Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reiver/go-chain10
Package chain10 provides the exponent used to convert from the smallest demonation to the default denomination for different blockchain-networks, for the Go programming language.
https://github.com/reiver/go-chain10
chainid
Last synced: about 1 month ago
JSON representation
Package chain10 provides the exponent used to convert from the smallest demonation to the default denomination for different blockchain-networks, for the Go programming language.
- Host: GitHub
- URL: https://github.com/reiver/go-chain10
- Owner: reiver
- License: mit
- Created: 2024-06-21T23:49:43.000Z (7 months ago)
- Default Branch: master
- Last Pushed: 2024-07-25T01:20:05.000Z (5 months ago)
- Last Synced: 2024-08-03T12:28:35.282Z (5 months ago)
- Topics: chainid
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-chain10
Package **chain10** provides the exponent used to convert from the _smallest demonation_ to the _default denomination_ for different blockchain-networks, for the Go programming language.
For example, for Ethereum, the exponent is 18 because: 1 ETH = 10^18 wei
This package provides those **exponent**s as **constants**, which are easily usable by programs written in the Go programming language.
## Documention
Online documentation, which includes examples, can be found at: http://godoc.org/github.com/reiver/go-chain10
[![GoDoc](https://godoc.org/github.com/reiver/go-chain10?status.svg)](https://godoc.org/github.com/reiver/go-chain10)
## Example
You can get the exponent based on the chain-id with code such as:
```golang
import "github.com/reiver/go-chain10"// ...
var chainid uint64 = 1 // Ethereum Mainnet
var exponent uint64 = chain10.Exponent(chainid)
```## Import
To import package **chain10** use `import` code like the follownig:
```
import "github.com/reiver/go-chain10"
```## Installation
To install package **chain10** do the following:
```
GOPROXY=direct go get https://github.com/reiver/go-chain10
```## Author
Package **chain10** was written by [Charles Iliya Krempeaux](http://reiver.link)