chain10

package module
v0.0.0-...-6cf6130 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2024 License: MIT Imports: 2 Imported by: 2

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 exponents 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

Example

You can get the exponent based on the chain-id with code such as:

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

Documentation

Index

Constants

View Source
const ArbitrumNova = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const ArbitrumOne = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const AvalancheCChain = 9

1 AVAX = 1,000,000,000 nanoAVAX = 10⁹ nanoAVAX

View Source
const AvalancheFujiTestnet = 9

1 AVAX = 1,000,000,000 nanoAVAX = 10⁹ nanoAVAX

View Source
const Blast = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const BlastSepoliaTestnet = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const EthereumClassic = 18

1 ETC = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const EthereumMainnet = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const FantomOpera = 18

1 MATIC = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const FantomTestnet = 18

1 MATIC = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const Holesky = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const OPMainnet = 18

1 ETH = 1,000,000,000,000,000,000 wei

View Source
const OPSepoliaTestnet = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const PolygonMainnet = 18

1 MATIC = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const RootstockMainnet = 8

1 RBTC = 100,000,000 rsat = 10⁸ rsat

View Source
const RootstockTestnet = 8

1 RBTC = 100,000,000 rsat = 10⁸ rsat

View Source
const Sepolia = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const ShapeSepolia = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const Zora = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

View Source
const ZoraSepoliaTestnet = 18

1 ETH = 1,000,000,000,000,000,000 wei = 10¹⁸ wei

Variables

This section is empty.

Functions

func Exponent

func Exponent(chainid uint64) (uint64, bool)

Types

This section is empty.

Jump to

Keyboard shortcuts

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