util

package
v1.3.19 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: MIT Imports: 12 Imported by: 6

Documentation

Index

Constants

View Source
const (
	// CrosschainRequestCheckpointABIJSON checks the ETH ABI for compatibility of the CrossTalkRequest message
	CrosschainRequestCheckpointABIJSON = `` /* 1091-byte string literal not displayed */

	// CrosschainRequestNearCheckpointABIJSON checks the ETH ABI for compatibility of the CrossTalkRequest message
	CrosschainRequestNearCheckpointABIJSON = `` /* 1085-byte string literal not displayed */

	// CrosschainAckRequestCheckpointABIJSON checks the ETH ABI for compatibility of the CrossTalkAckRequest message
	CrosschainAckRequestCheckpointABIJSON = `` /* 782-byte string literal not displayed */

	// CrosschainAckRequestNearCheckpointABIJSON checks the ETH ABI for compatibility of the CrossTalkAckRequest message
	CrosschainAckRequestNearCheckpointABIJSON = `` /* 780-byte string literal not displayed */

	// ValsetCheckpointABIJSON checks the ETH ABI for compatibility of the Valset update message
	ValsetCheckpointABIJSON = `` /* 507-byte string literal not displayed */

	// OutgoingLogicCallABIJSON checks the ETH ABI for compatibility of the logic call message
	OutgoingLogicCallABIJSON = `` /* 1153-byte string literal not displayed */

	// OutboundBatchRequestEventABIJSON checks the ETH ABI for compatibility of the Outbound batch event
	OutboundBatchRequestEventABIJSON = `` /* 1286-byte string literal not displayed */

	// InboundSudoRequestABIJSON checks the ETH ABI for compatibility of the Inbound Batch request
	InboundSudoRequestABIJSON = `` /* 535-byte string literal not displayed */

	// OutboundAckSudoRequestABIJSON checks the ETH ABI for compatibility of the Outbound Ack request
	OutboundAckSudoRequestABIJSON = `` /* 777-byte string literal not displayed */

)
View Source
const (
	// MainnetChainID defines the Router EIP155 chain ID for mainnet
	MainnetChainID = "router_9605"
	// TestnetChainID defines the Router EIP155 chain ID for testnet
	TestnetChainID = "router_9605"
	// BaseDenom defines the Router mainnet denomination
	BaseDenom = "route"
)

Variables

This section is empty.

Functions

func AppendBytes

func AppendBytes(args ...[]byte) []byte

func GetPrefixFromBech32

func GetPrefixFromBech32(bech32str string) (string, error)

GetPrefixFromBech32 returns the human readable part of a bech32 string (excluding the 1 byte) Returns an error on too short input or when the 1 byte cannot be found Note: This is an excerpt from the Decode function for bech32 strings

func GetRouterAddressFromBech32 added in v1.2.88

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

GetRouterAddressFromBech32 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: `router`). The function fails if the provided bech32 address is invalid.

func HashString

func HashString(input string) []byte

Hashing string using cryptographic MD5 function returns 128bit(16byte) value

func IsMainnet added in v1.2.88

func IsMainnet(chainID string) bool

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

func IsSupportedKey added in v1.2.88

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 IsTestnet added in v1.2.88

func IsTestnet(chainID string) bool

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

func StrToFixByteArray

func StrToFixByteArray(s string) ([32]byte, error)

func UInt64Bytes

func UInt64Bytes(n uint64) []byte

UInt64Bytes uses the SDK byte marshaling to encode a uint64

func UInt64FromBytes

func UInt64FromBytes(s []byte) uint64

UInt64FromBytes create uint from binary big endian representation

func UInt64FromString

func UInt64FromString(s string) (uint64, error)

UInt64FromString to parse out a uint64 for a nonce

Types

This section is empty.

Jump to

Keyboard shortcuts

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