Documentation
¶
Index ¶
- Constants
- Variables
- func GenerateRandomChainID() string
- func HasDuplicate[T comparable](elements []T) bool
- func HasDuplicateCoins(slice []sdk.Coin) bool
- func IsEmptyHash(hash string) bool
- func IsValidChainID(chainID string) bool
- func IsValidInt256(i *big.Int) bool
- func IsZeroAddress(address string) bool
- func ParseChainID(chainID string) (*big.Int, error)
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func SafeInt(value uint) (int, error)
- func SafeInt64(value uint64) (int64, error)
- func SafeNewIntFromBigInt(i *big.Int) (sdkmath.Int, error)
- func SaturatedNewInt(i *big.Int) sdkmath.Int
- func SetBech32Prefixes(config *sdk.Config)
- func SetBip44CoinType(config *sdk.Config)
- func ValidateAddress(address string) error
- func ValidateNonZeroAddress(address string) error
- type EthAccount
- func (*EthAccount) Descriptor() ([]byte, []int)
- func (m *EthAccount) Marshal() (dAtA []byte, err error)
- func (m *EthAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*EthAccount) ProtoMessage()
- func (m *EthAccount) Reset()
- func (m *EthAccount) Size() (n int)
- func (m *EthAccount) Unmarshal(dAtA []byte) error
- func (m *EthAccount) XXX_DiscardUnknown()
- func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *EthAccount) XXX_Merge(src proto.Message)
- func (m *EthAccount) XXX_Size() int
- func (m *EthAccount) XXX_Unmarshal(b []byte) error
- type ExtensionOptionsWeb3Tx
- func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
- func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
- func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
- func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ExtensionOptionsWeb3Tx) ProtoMessage()
- func (m *ExtensionOptionsWeb3Tx) Reset()
- func (m *ExtensionOptionsWeb3Tx) Size() (n int)
- func (m *ExtensionOptionsWeb3Tx) String() string
- func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
- func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
- func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
- func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
- func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
- type TxResponseData
- func (*TxResponseData) Descriptor() ([]byte, []int)
- func (m *TxResponseData) GetMessages() []*TxResponseGenericMessage
- func (m *TxResponseData) Marshal() (dAtA []byte, err error)
- func (m *TxResponseData) MarshalTo(dAtA []byte) (int, error)
- func (m *TxResponseData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TxResponseData) ProtoMessage()
- func (m *TxResponseData) Reset()
- func (m *TxResponseData) Size() (n int)
- func (m *TxResponseData) String() string
- func (m *TxResponseData) Unmarshal(dAtA []byte) error
- func (m *TxResponseData) XXX_DiscardUnknown()
- func (m *TxResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TxResponseData) XXX_Merge(src proto.Message)
- func (m *TxResponseData) XXX_Size() int
- func (m *TxResponseData) XXX_Unmarshal(b []byte) error
- type TxResponseGenericMessage
- func (*TxResponseGenericMessage) Descriptor() ([]byte, []int)
- func (m *TxResponseGenericMessage) GetData() []byte
- func (m *TxResponseGenericMessage) GetHeader() string
- func (m *TxResponseGenericMessage) Marshal() (dAtA []byte, err error)
- func (m *TxResponseGenericMessage) MarshalTo(dAtA []byte) (int, error)
- func (m *TxResponseGenericMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TxResponseGenericMessage) ProtoMessage()
- func (m *TxResponseGenericMessage) Reset()
- func (m *TxResponseGenericMessage) Size() (n int)
- func (m *TxResponseGenericMessage) String() string
- func (m *TxResponseGenericMessage) Unmarshal(dAtA []byte) error
- func (m *TxResponseGenericMessage) XXX_DiscardUnknown()
- func (m *TxResponseGenericMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TxResponseGenericMessage) XXX_Merge(src proto.Message)
- func (m *TxResponseGenericMessage) XXX_Size() int
- func (m *TxResponseGenericMessage) XXX_Unmarshal(b []byte) error
- type TxResult
- func (*TxResult) Descriptor() ([]byte, []int)
- func (m *TxResult) Marshal() (dAtA []byte, err error)
- func (m *TxResult) MarshalTo(dAtA []byte) (int, error)
- func (m *TxResult) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TxResult) ProtoMessage()
- func (m *TxResult) Reset()
- func (m *TxResult) Size() (n int)
- func (m *TxResult) String() string
- func (m *TxResult) Unmarshal(dAtA []byte) error
- func (m *TxResult) XXX_DiscardUnknown()
- func (m *TxResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TxResult) XXX_Merge(src proto.Message)
- func (m *TxResult) XXX_Size() int
- func (m *TxResult) XXX_Unmarshal(b []byte) error
Constants ¶
const ( // InjectiveBech32Prefix defines the Bech32 prefix used for EthAccounts on the Injective Chain InjectiveBech32Prefix = "inj" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = InjectiveBech32Prefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = InjectiveBech32Prefix + sdk.PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = InjectiveBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = InjectiveBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = InjectiveBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = InjectiveBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic // Bip44CoinType satisfies EIP84. See https://github.com/ethereum/EIPs/issues/84 for more info. Bip44CoinType = 60 )
const (
// RootCodespace is the codespace for all errors defined in this package
RootCodespace = "injective"
)
Variables ¶
var ( ErrInvalidLengthAccount = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowAccount = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupAccount = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthIndexer = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowIndexer = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupIndexer = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTxExt = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTxExt = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTxExt = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthTxResponse = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowTxResponse = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupTxResponse = fmt.Errorf("proto: unexpected end of group") )
var ( // BIP44HDPath is the BIP44 HD path used on Ethereum. BIP44HDPath = ethaccounts.DefaultBaseDerivationPath.String() )
var ( // ErrInvalidChainID returns an error resulting from an invalid chain ID. ErrInvalidChainID = errors.Register(RootCodespace, 3, "invalid chain ID") )
var MaxInt256 *big.Int
Functions ¶
func GenerateRandomChainID ¶ added in v1.47.1
func GenerateRandomChainID() string
GenerateRandomChainID returns a random chain-id in the valid format.
func HasDuplicate ¶ added in v1.56.0
func HasDuplicate[T comparable](elements []T) bool
func HasDuplicateCoins ¶ added in v1.56.0
func IsEmptyHash ¶ added in v1.58.0
IsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash.
func IsValidChainID ¶
IsValidChainID returns false if the given chain identifier is incorrectly formatted.
func IsValidInt256 ¶ added in v1.58.0
IsValidInt256 check the bound of 256 bit number
func IsZeroAddress ¶ added in v1.58.0
IsZeroAddress returns true if the address corresponds to an empty ethereum hex address.
func ParseChainID ¶
ParseChainID parses a string chain identifier's epoch to an Ethereum-compatible chain-id in *big.Int format. The function returns an error if the chain-id has an invalid format
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
func SafeInt64 ¶ added in v1.58.0
SafeInt64 checks for overflows while casting a uint64 to int64 value.
func SafeNewIntFromBigInt ¶ added in v1.58.0
SafeNewIntFromBigInt constructs Int from big.Int, return error if more than 256bits
func SaturatedNewInt ¶ added in v1.58.0
SaturatedNewInt constructs Int from big.Int, truncate if more than 256bits
func SetBech32Prefixes ¶
SetBech32Prefixes sets the global prefixes to be used when serializing addresses and public keys to Bech32 strings.
func SetBip44CoinType ¶
SetBip44CoinType sets the global coin type to be used in hierarchical deterministic wallets.
func ValidateAddress ¶ added in v1.58.0
ValidateAddress returns an error if the provided string is either not a hex formatted string address
func ValidateNonZeroAddress ¶ added in v1.58.0
ValidateNonZeroAddress returns an error if the provided string is not a hex formatted string address or is equal to zero
Types ¶
type EthAccount ¶
type EthAccount struct {
*types.BaseAccount `` /* 136-byte string literal not displayed */
CodeHash []byte `protobuf:"bytes,2,opt,name=code_hash,json=codeHash,proto3" json:"code_hash,omitempty" yaml:"code_hash"`
}
EthAccount implements the authtypes.AccountI interface and embeds an authtypes.BaseAccount type. It is compatible with the auth AccountKeeper.
func (*EthAccount) Descriptor ¶
func (*EthAccount) Descriptor() ([]byte, []int)
func (*EthAccount) Marshal ¶
func (m *EthAccount) Marshal() (dAtA []byte, err error)
func (*EthAccount) MarshalToSizedBuffer ¶
func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*EthAccount) ProtoMessage ¶
func (*EthAccount) ProtoMessage()
func (*EthAccount) Reset ¶
func (m *EthAccount) Reset()
func (*EthAccount) Size ¶
func (m *EthAccount) Size() (n int)
func (*EthAccount) Unmarshal ¶
func (m *EthAccount) Unmarshal(dAtA []byte) error
func (*EthAccount) XXX_DiscardUnknown ¶
func (m *EthAccount) XXX_DiscardUnknown()
func (*EthAccount) XXX_Marshal ¶
func (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*EthAccount) XXX_Merge ¶
func (m *EthAccount) XXX_Merge(src proto.Message)
func (*EthAccount) XXX_Size ¶
func (m *EthAccount) XXX_Size() int
func (*EthAccount) XXX_Unmarshal ¶
func (m *EthAccount) XXX_Unmarshal(b []byte) error
type ExtensionOptionsWeb3Tx ¶
type ExtensionOptionsWeb3Tx struct {
// typedDataChainID used only in EIP712 Domain and should match
// Ethereum network ID in a Web3 provider (e.g. Metamask).
TypedDataChainID uint64 `protobuf:"varint,1,opt,name=typedDataChainID,proto3" json:"typedDataChainID,omitempty"`
// feePayer is an account address for the fee payer. It will be validated
// during EIP712 signature checking.
FeePayer string `protobuf:"bytes,2,opt,name=feePayer,proto3" json:"feePayer,omitempty"`
// feePayerSig is a signature data from the fee paying account,
// allows to perform fee delegation when using EIP712 Domain.
FeePayerSig []byte `protobuf:"bytes,3,opt,name=feePayerSig,proto3" json:"feePayerSig,omitempty"`
}
func (*ExtensionOptionsWeb3Tx) Descriptor ¶
func (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)
func (*ExtensionOptionsWeb3Tx) Marshal ¶
func (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)
func (*ExtensionOptionsWeb3Tx) MarshalTo ¶
func (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) MarshalToSizedBuffer ¶
func (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ExtensionOptionsWeb3Tx) ProtoMessage ¶
func (*ExtensionOptionsWeb3Tx) ProtoMessage()
func (*ExtensionOptionsWeb3Tx) Reset ¶
func (m *ExtensionOptionsWeb3Tx) Reset()
func (*ExtensionOptionsWeb3Tx) Size ¶
func (m *ExtensionOptionsWeb3Tx) Size() (n int)
func (*ExtensionOptionsWeb3Tx) String ¶
func (m *ExtensionOptionsWeb3Tx) String() string
func (*ExtensionOptionsWeb3Tx) Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error
func (*ExtensionOptionsWeb3Tx) XXX_DiscardUnknown ¶
func (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()
func (*ExtensionOptionsWeb3Tx) XXX_Marshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ExtensionOptionsWeb3Tx) XXX_Merge ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)
func (*ExtensionOptionsWeb3Tx) XXX_Size ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Size() int
func (*ExtensionOptionsWeb3Tx) XXX_Unmarshal ¶
func (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error
type TxResponseData ¶ added in v1.38.0
type TxResponseData struct {
Messages []*TxResponseGenericMessage `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"`
}
improvised message to unpack length prefixed messages in tx response data
func (*TxResponseData) Descriptor ¶ added in v1.38.0
func (*TxResponseData) Descriptor() ([]byte, []int)
func (*TxResponseData) GetMessages ¶ added in v1.38.0
func (m *TxResponseData) GetMessages() []*TxResponseGenericMessage
func (*TxResponseData) Marshal ¶ added in v1.38.0
func (m *TxResponseData) Marshal() (dAtA []byte, err error)
func (*TxResponseData) MarshalTo ¶ added in v1.38.0
func (m *TxResponseData) MarshalTo(dAtA []byte) (int, error)
func (*TxResponseData) MarshalToSizedBuffer ¶ added in v1.38.0
func (m *TxResponseData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TxResponseData) ProtoMessage ¶ added in v1.38.0
func (*TxResponseData) ProtoMessage()
func (*TxResponseData) Reset ¶ added in v1.38.0
func (m *TxResponseData) Reset()
func (*TxResponseData) Size ¶ added in v1.38.0
func (m *TxResponseData) Size() (n int)
func (*TxResponseData) String ¶ added in v1.38.0
func (m *TxResponseData) String() string
func (*TxResponseData) Unmarshal ¶ added in v1.38.0
func (m *TxResponseData) Unmarshal(dAtA []byte) error
func (*TxResponseData) XXX_DiscardUnknown ¶ added in v1.38.0
func (m *TxResponseData) XXX_DiscardUnknown()
func (*TxResponseData) XXX_Marshal ¶ added in v1.38.0
func (m *TxResponseData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TxResponseData) XXX_Merge ¶ added in v1.38.0
func (m *TxResponseData) XXX_Merge(src proto.Message)
func (*TxResponseData) XXX_Size ¶ added in v1.38.0
func (m *TxResponseData) XXX_Size() int
func (*TxResponseData) XXX_Unmarshal ¶ added in v1.38.0
func (m *TxResponseData) XXX_Unmarshal(b []byte) error
type TxResponseGenericMessage ¶ added in v1.38.0
type TxResponseGenericMessage struct {
Header string `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"`
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
base header ak message type, we can cast the bytes into corresponding message response type
func (*TxResponseGenericMessage) Descriptor ¶ added in v1.38.0
func (*TxResponseGenericMessage) Descriptor() ([]byte, []int)
func (*TxResponseGenericMessage) GetData ¶ added in v1.38.0
func (m *TxResponseGenericMessage) GetData() []byte
func (*TxResponseGenericMessage) GetHeader ¶ added in v1.38.0
func (m *TxResponseGenericMessage) GetHeader() string
func (*TxResponseGenericMessage) Marshal ¶ added in v1.38.0
func (m *TxResponseGenericMessage) Marshal() (dAtA []byte, err error)
func (*TxResponseGenericMessage) MarshalTo ¶ added in v1.38.0
func (m *TxResponseGenericMessage) MarshalTo(dAtA []byte) (int, error)
func (*TxResponseGenericMessage) MarshalToSizedBuffer ¶ added in v1.38.0
func (m *TxResponseGenericMessage) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TxResponseGenericMessage) ProtoMessage ¶ added in v1.38.0
func (*TxResponseGenericMessage) ProtoMessage()
func (*TxResponseGenericMessage) Reset ¶ added in v1.38.0
func (m *TxResponseGenericMessage) Reset()
func (*TxResponseGenericMessage) Size ¶ added in v1.38.0
func (m *TxResponseGenericMessage) Size() (n int)
func (*TxResponseGenericMessage) String ¶ added in v1.38.0
func (m *TxResponseGenericMessage) String() string
func (*TxResponseGenericMessage) Unmarshal ¶ added in v1.38.0
func (m *TxResponseGenericMessage) Unmarshal(dAtA []byte) error
func (*TxResponseGenericMessage) XXX_DiscardUnknown ¶ added in v1.38.0
func (m *TxResponseGenericMessage) XXX_DiscardUnknown()
func (*TxResponseGenericMessage) XXX_Marshal ¶ added in v1.38.0
func (m *TxResponseGenericMessage) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TxResponseGenericMessage) XXX_Merge ¶ added in v1.38.0
func (m *TxResponseGenericMessage) XXX_Merge(src proto.Message)
func (*TxResponseGenericMessage) XXX_Size ¶ added in v1.38.0
func (m *TxResponseGenericMessage) XXX_Size() int
func (*TxResponseGenericMessage) XXX_Unmarshal ¶ added in v1.38.0
func (m *TxResponseGenericMessage) XXX_Unmarshal(b []byte) error
type TxResult ¶ added in v1.58.0
type TxResult struct {
// height of the blockchain
Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"`
// tx_index of the cosmos transaction
TxIndex uint32 `protobuf:"varint,2,opt,name=tx_index,json=txIndex,proto3" json:"tx_index,omitempty"`
// msg_index in a batch transaction
MsgIndex uint32 `protobuf:"varint,3,opt,name=msg_index,json=msgIndex,proto3" json:"msg_index,omitempty"`
// eth_tx_index is the index in the list of valid eth tx in the block,
// aka. the transaction list returned by eth_getBlock api.
EthTxIndex int32 `protobuf:"varint,4,opt,name=eth_tx_index,json=ethTxIndex,proto3" json:"eth_tx_index,omitempty"`
// failed is true if the eth transaction did not go succeed
Failed bool `protobuf:"varint,5,opt,name=failed,proto3" json:"failed,omitempty"`
// gas_used by the transaction. If it exceeds the block gas limit,
// it's set to gas limit, which is what's actually deducted by ante handler.
GasUsed uint64 `protobuf:"varint,6,opt,name=gas_used,json=gasUsed,proto3" json:"gas_used,omitempty"`
// cumulative_gas_used specifies the cumulated amount of gas used for all
// processed messages within the current batch transaction.
CumulativeGasUsed uint64 `protobuf:"varint,7,opt,name=cumulative_gas_used,json=cumulativeGasUsed,proto3" json:"cumulative_gas_used,omitempty"`
}
TxResult is the value stored in eth tx indexer
func (*TxResult) Descriptor ¶ added in v1.58.0
func (*TxResult) MarshalToSizedBuffer ¶ added in v1.58.0
func (*TxResult) ProtoMessage ¶ added in v1.58.0
func (*TxResult) ProtoMessage()
func (*TxResult) XXX_DiscardUnknown ¶ added in v1.58.0
func (m *TxResult) XXX_DiscardUnknown()