tmcosmosutils

package
v1.7.43 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountAddressFromBytes

func AccountAddressFromBytes(bech32Prefix string, b []byte) (string, error)

func AccountAddressFromPubKey

func AccountAddressFromPubKey(bech32Prefix string, pubKey []byte) (string, error)

func AccountAddressFromValidatorAddress

func AccountAddressFromValidatorAddress(bech32Prefix string, srcAddress string) (string, error)

func ConsensusNodeAddressFromConsensusNodePubKey

func ConsensusNodeAddressFromConsensusNodePubKey(bech32Prefix string, consensusNodePubKey string) (string, error)

func ConsensusNodeAddressFromTmPubKey

func ConsensusNodeAddressFromTmPubKey(bech32Prefix string, pubKey []byte) (string, error)

func ConsensusNodePubKeyFromTmPubKey

func ConsensusNodePubKeyFromTmPubKey(bech32Prefix string, pubKey []byte) (string, error)

func IsValidCosmosAddress

func IsValidCosmosAddress(address string) bool

func ModuleAccountFromBytes

func ModuleAccountFromBytes(bech32Prefix string, b []byte) (string, error)

func MultiSigAddressFromPubKeys

func MultiSigAddressFromPubKeys(bech32Prefix string, pubKeys [][]byte, threshold int, sortPubKeys bool) (string, error)

func MustAccountAddressFromPubKey

func MustAccountAddressFromPubKey(bech32Prefix string, pubKey []byte) string

func MustAccountAddressFromValidatorAddress

func MustAccountAddressFromValidatorAddress(bech32Prefix string, srcAddress string) string

func MustConsensusAddressFromTmPubKey

func MustConsensusAddressFromTmPubKey(bech32Prefix string, pubKey []byte) string

func MustConsensusNodePubKeyFromTmPubKey

func MustConsensusNodePubKeyFromTmPubKey(bech32Prefix string, pubKey []byte) string

func MustModuleAccountFromBytes

func MustModuleAccountFromBytes(bech32Prefix string, b []byte) string

func MustMultiSigAddressFromPubKeys

func MustMultiSigAddressFromPubKeys(
	bech32Prefix string,
	pubKeys [][]byte,
	threshold int,
	sortPubKeys bool,
) string

func MustNewCoinFromAmountInterface

func MustNewCoinFromAmountInterface(amount map[string]interface{}) coin.Coin

MustNewCoinFromAmountInterface returns a Coin from the amount map in the form of map[string]interface{}. It panics when the amount is invalid.

func MustNewCoinsFromAmountInterface

func MustNewCoinsFromAmountInterface(amounts []interface{}) coin.Coins

MustNewCoinsFromAmountInterface returns Coins from the list of amount in the from of []interface{}. It behaves the same as NewCoinsFromAmountInterface except it panics on any error.

func MustValidatorAddressFromAccountAddress

func MustValidatorAddressFromAccountAddress(bech32Prefix string, srcAddress string) string

func NewCoinFromAmountInterface

func NewCoinFromAmountInterface(amount map[string]interface{}) (coin.Coin, error)

NewCoinFromAmountInterface returns a Coin from the amount in the form of map[string]interface{}. It returns error when the amount is invalid.

func NewCoinsFromAmountInterface

func NewCoinsFromAmountInterface(amounts []interface{}) (coin.Coins, error)

NewCoinsFromAmountInterface returns Coins from the list of amount in the from of []interface{}. It returns error when any of the amount inside is invalid

func PubKeyFromCosmosPubKey

func PubKeyFromCosmosPubKey(accountPubKey string) ([]byte, error)

func TmAddressFromTmPubKey

func TmAddressFromTmPubKey(pubKey []byte) string

func ValidatorAddressFromAccountAddress

func ValidatorAddressFromAccountAddress(bech32Prefix string, srcAddress string) (string, error)

Types

type ModuleAccounts

type ModuleAccounts struct {
	FeeCollector        string
	Mint                string
	Distribution        string
	Gov                 string
	BondedTokensPool    string
	NotBondedTokensPool string
	IBCTransfer         string
}

func NewModuleAccounts

func NewModuleAccounts(addressPrefix string) ModuleAccounts

Jump to

Keyboard shortcuts

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