utils

package
v12.1.16-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2025 License: LGPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MainnetChainID defines the Evmos EIP155 chain ID for mainnet
	MainnetChainID = "bridge_9001"
	// TestnetChainID defines the Evmos EIP155 chain ID for testnet
	TestnetChainID = "bridge_9000"
	// TestingChainID defines the Evmos EIP155 chain ID for integration test
	TestingChainID = "test_9000"
	// BaseDenom defines the Evmos mainnet denomination
	BaseDenom = "abridge"
)

Variables

This section is empty.

Functions

func ComputeIBCDenom

func ComputeIBCDenom(
	portID, channelID,
	denom string,
) string

ComputeIBCDenom compute the ibc voucher denom associated to the portID, channelID, and the given a token denomination.

func ComputeIBCDenomTrace

func ComputeIBCDenomTrace(
	portID, channelID,
	denom string,
) ibctransfertypes.DenomTrace

ComputeIBCDenomTrace compute the ibc voucher denom trace associated with the portID, channelID, and the given a token denomination.

func CreateAccAddressFromBech32

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

CreateAccAddressFromBech32 creates an AccAddress from a Bech32 string.

func EthHexToSDKAddr

func EthHexToSDKAddr(hexAddr string) sdk.AccAddress

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

func EthToSDKAddr

func EthToSDKAddr(addr common.Address) sdk.AccAddress

EthToSDKAddr converts a given Ethereum style address to an SDK address.

func GetEvmosAddressFromBech32

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

GetEvmosAddressFromBech32 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 DenomTrace Path.

func IsMainnet

func IsMainnet(chainID string) bool

IsMainnet returns true if the chain-id has the Evmos mainnet EIP155 chain prefix.

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 IsTesting

func IsTesting(chainID string) bool

IsTesting returns true if the chain-id has the "test" prefix. NOTE: for tests only

func IsTestnet

func IsTestnet(chainID string) bool

IsTestnet returns true if the chain-id has the Evmos testnet EIP155 chain prefix.

Types

This section is empty.

Jump to

Keyboard shortcuts

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