Documentation
¶
Index ¶
- func ConvertAnyAddressToBytes(addr string) ([]byte, error)
- func ConvertAnyAddressesToBytes[T ByteType](addr ...string) ([]T, error)
- func ExtractEvmChainID(chainID string) (string, error)
- func GetAddressPair(addr string) (sdk.AccAddress, common.Address, error)
- func GetEnvRPCOverride(chain string) string
- func HexToBytes(s string) ([]byte, error)
- func IsValidAddress(addr string, at AddressType) bool
- func MustConvertCosmosToHex(addr string) string
- func StringToBigInt(s string) *big.Int
- type AddressType
- type ByteType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertAnyAddressToBytes ¶
convert the 0x and/or cosmos address to raw bytes
func ConvertAnyAddressesToBytes ¶
return either []byte or common.Address
func ExtractEvmChainID ¶ added in v0.0.13
Returns evm chainId, e.g. push-chain-42101 -> 42101
func GetAddressPair ¶
get address pair returns both the cosmos and the 0x addresses, or an error
func GetEnvRPCOverride ¶
chain is a CAIP-2 chain identifier, e.g., "eip155:1"
func HexToBytes ¶
func IsValidAddress ¶
func IsValidAddress(addr string, at AddressType) bool
IsValidAddress checks if the address is a valid COSMOS, HEX (0x), or EITHER address
func MustConvertCosmosToHex ¶
func StringToBigInt ¶
Types ¶
type AddressType ¶
type AddressType int
create an enum for COSMOS, 0x, or EITHER
const ( COSMOS AddressType = iota HEX EITHER )
Click to show internal directories.
Click to hide internal directories.