Documentation ¶
Index ¶
Constants ¶
const ( // AttoBit defines the default coin denomination used in BitNetwork in: // // - Staking parameters: denomination used as stake in the dPoS chain // - Mint parameters: denomination minted due to fee distribution rewards // - Governance parameters: denomination used for spam prevention in proposal deposits // - Crisis parameters: constant fee denomination used for spam prevention to check broken invariant AttoBit = "abit" // DisplayDenom defines the denomination displayed to users in client applications. DisplayDenom = "bit" // BaseDenom defines to the default denomination used in BitNetwork (staking, EVN, governance, etc) BaseDenom = AttoBit // BaseDenomUnit defines the base denomination unit for Bits. // 1 bit = 1x10^{BaseDenomUnit} abit BaseDenomUnit = 18 )
Variables ¶
var PowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(BaseDenomUnit+2), nil))
PowerReduction defines the default power reduction value for staking (BaseDenomUnit - 2) indicates that staking tokens:power = 1:100, which means we consider 0.01 BaseDenom as 1 power
Functions ¶
func GetAddressFromBech32 ¶
func GetAddressFromBech32(address string) (sdk.AccAddress, error)
GetAddressFromBech32 returns the sdk.Account address of given address, while also changing bech32 human readable prefix (HRP) to the value set on the global sdk.Config (eg: `bitnetwork`). The function fails if the provided bech32 address is invalid.
func IsSupportedKey ¶
func IsSupportedKey(pubkey cryptotypes.PubKey) bool
IsSupportedKey returns true if the pubkey type is supported by the chain (i.e eth_secp256k1, amino multisig, ed25519). NOTE: Nested multisigs are not supported.
func NewBitCoin ¶
NewBitCoin is a utility function that returns an "abit" coin with the given sdk.Int amount. The function will panic if the provided amount is negative.
func NewBitCoinInt64 ¶
NewBitCoinInt64 is a utility function that returns an "abit" coin with the given int64 amount. The function will panic if the provided amount is negative.
Types ¶
This section is empty.