ethconvert

module
v0.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 18, 2021 License: MIT

README

Go Report Card

ethconvert

Ethereum unit converter written in go.

Install

go get github.com/jon4hz/ethconvert/pkg/ethconvert

Example usage

package main

import (
	"fmt"

	"github.com/jon4hz/ethconvert/pkg/ethconvert"
	"github.com/shopspring/decimal"
)

func main() {
	amount := decimal.NewFromInt(50)
	gwei, err := ethconvert.Convert(amount, "ether", "gwei")
	if err != nil {
		panic(err)
	}
	fmt.Println(gwei)
}

CLI

Install

go install github.com/jon4hz/ethconvert/cmd/ethconvert@latest

Example
$ ethconvert -i ether -o wei -a 1
1000000000000000000 wei

$ ethconvert 50 wei gwei
0.00000005 gwei

Directories

Path Synopsis
cmd
ethconvert command
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL