utils

package
v2.0.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bech32StringFromHexAddress

func Bech32StringFromHexAddress(hexAddr string) string

Bech32StringFromHexAddress takes a given Hex string and derives a Cosmos SDK account address from it.

func Bytes32ToString

func Bytes32ToString(data [32]byte) string

Bytes32ToString converts a bytes32 value to string by trimming null bytes

func CreateAccAddressFromBech32

func CreateAccAddressFromBech32(address string, bech32prefix string) (addr sdk.AccAddress, err error)

CreateAccAddressFromBech32 creates an AccAddress from a Bech32 string.

func GetAccAddressFromBech32

func GetAccAddressFromBech32(address string) (sdk.AccAddress, error)

GetAccAddressFromBech32 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: `evmos`).

The function fails if the provided bech32 address is invalid.

func GetIBCDenomAddress

func GetIBCDenomAddress(denom string) (common.Address, error)

GetIBCDenomAddress returns the address from the hash of the ICS20's Denom Path.

func HexAddressFromBech32String

func HexAddressFromBech32String(addr string) (res common.Address, err error)

HexAddressFromBech32String converts a hex address to a bech32 encoded address.

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 SortSlice

func SortSlice[T constraints.Ordered](slice []T)

SortSlice sorts a slice of any ordered type.

func Uint256FromBigInt

func Uint256FromBigInt(i *big.Int) (*uint256.Int, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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