Documentation ¶
Index ¶
- Constants
- Variables
- func CosmosAddressToEthAddress(addr string) (ethcmn.Address, error)
- func IsValidChainID(chainID string) bool
- func MarshalBigInt(i *big.Int) (string, error)
- func NewInjectiveCoin(amount sdk.Int) sdk.Coin
- func NewInjectiveCoinInt64(amount int64) sdk.Coin
- func NewInjectiveDecCoin(amount sdk.Int) sdk.DecCoin
- func ParseChainID(chainID string) (*big.Int, error)
- func ProtoAccount() authtypes.AccountI
- func RegisterInterfaces(registry codectypes.InterfaceRegistry)
- func SetBech32Prefixes(config *sdk.Config)
- func SetBip44CoinType(config *sdk.Config)
- func UnmarshalBigInt(s string) (*big.Int, error)
- type Code
- type EthAccount
- func (*EthAccount) Descriptor() ([]byte, []int)
- func (acc EthAccount) EthAddress() ethcmn.Address
- func (m *EthAccount) Marshal() (dAtA []byte, err error)
- func (acc EthAccount) MarshalJSON() ([]byte, error)
- func (m *EthAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (acc EthAccount) MarshalYAML() (interface{}, error)
- func (*EthAccount) ProtoMessage()
- func (m *EthAccount) Reset()
- func (m *EthAccount) Size() (n int)
- func (acc EthAccount) String() string
- func (m *EthAccount) Unmarshal(dAtA []byte) error
- func (acc *EthAccount) UnmarshalJSON(bz []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 ExtensionOptionsWeb3TxI
Constants ¶
const ( // INJ defines the default coin denomination used in Ethermint in: // // - Staking parameters: denomination used as stake in the dPoS chain // - Mint parameters: denomination minted due to fee distribution rewards // - Governance parameters: denomination used for spam prevention in proposal deposits // - Crisis parameters: constant fee denomination used for spam prevention to check broken invariant // - EVM parameters: denomination used for running EVM state transitions in Ethermint. InjectiveCoin string = "inj" // BaseDenomUnit defines the base denomination unit for Photons. // 1 photon = 1x10^{BaseDenomUnit} inj BaseDenomUnit = 18 )
const ( // InjectiveEvmBech32Prefix defines the Bech32 prefix used for EthAccounts on the Injective Chain InjectiveEvmBech32Prefix = "inj" // Bech32PrefixAccAddr defines the Bech32 prefix of an account's address Bech32PrefixAccAddr = InjectiveEvmBech32Prefix // Bech32PrefixAccPub defines the Bech32 prefix of an account's public key Bech32PrefixAccPub = InjectiveEvmBech32Prefix + sdk.PrefixPublic // Bech32PrefixValAddr defines the Bech32 prefix of a validator's operator address Bech32PrefixValAddr = InjectiveEvmBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator // Bech32PrefixValPub defines the Bech32 prefix of a validator's operator public key Bech32PrefixValPub = InjectiveEvmBech32Prefix + sdk.PrefixValidator + sdk.PrefixOperator + sdk.PrefixPublic // Bech32PrefixConsAddr defines the Bech32 prefix of a consensus node address Bech32PrefixConsAddr = InjectiveEvmBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus // Bech32PrefixConsPub defines the Bech32 prefix of a consensus node public key Bech32PrefixConsPub = InjectiveEvmBech32Prefix + sdk.PrefixValidator + sdk.PrefixConsensus + sdk.PrefixPublic // Bip44CoinType satisfies EIP84. See https://github.com/ethereum/EIPs/issues/84 for more info. Bip44CoinType = 60 )
const ( // DefaultGasPrice is default gas price for evm transactions DefaultGasPrice = 0 // DefaultRPCGasLimit is default gas limit for RPC call operations DefaultRPCGasLimit = 80000000 )
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 ( // ErrInvalidValue returns an error resulting from an invalid value. ErrInvalidValue = sdkerrors.Register(RootCodespace, 2, "invalid value") // ErrInvalidChainID returns an error resulting from an invalid chain ID. ErrInvalidChainID = sdkerrors.Register(RootCodespace, 3, "invalid chain ID") // ErrVMExecution returns an error resulting from an error in EVM execution. ErrVMExecution = sdkerrors.Register(RootCodespace, 4, "error while executing evm transaction") )
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 ( // BIP44HDPath is the BIP44 HD path used on Ethereum. BIP44HDPath = ethaccounts.DefaultBaseDerivationPath.String() )
Functions ¶
func IsValidChainID ¶
IsValidChainID returns false if the given chain identifier is incorrectly formatted.
func MarshalBigInt ¶
MarshalBigInt marshals big int into text string for consistent encoding
func NewInjectiveCoin ¶
NewInjectiveCoin is a utility function that returns an "inj" coin with the given sdk.Int amount. The function will panic if the provided amount is negative.
func NewInjectiveCoinInt64 ¶
NewInjectiveCoinInt64 is a utility function that returns an "inj" coin with the given int64 amount. The function will panic if the provided amount is negative.
func NewInjectiveDecCoin ¶
NewInjectiveDecCoin is a utility function that returns an "inj" decimal coin with the given sdk.Int amount. The function will panic if the provided amount is negative.
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 ProtoAccount ¶
ProtoAccount defines the prototype function for BaseAccount used for an AccountKeeper.
func RegisterInterfaces ¶
func RegisterInterfaces(registry codectypes.InterfaceRegistry)
RegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.
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.
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) EthAddress ¶
func (acc EthAccount) EthAddress() ethcmn.Address
EthAddress returns the account address ethereum format.
func (*EthAccount) Marshal ¶
func (m *EthAccount) Marshal() (dAtA []byte, err error)
func (EthAccount) MarshalJSON ¶
func (acc EthAccount) MarshalJSON() ([]byte, error)
MarshalJSON returns the JSON representation of an EthAccount.
func (*EthAccount) MarshalToSizedBuffer ¶
func (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (EthAccount) MarshalYAML ¶
func (acc EthAccount) MarshalYAML() (interface{}, error)
MarshalYAML returns the YAML representation of an account.
func (*EthAccount) ProtoMessage ¶
func (*EthAccount) ProtoMessage()
func (*EthAccount) Reset ¶
func (m *EthAccount) Reset()
func (*EthAccount) Size ¶
func (m *EthAccount) Size() (n int)
func (EthAccount) String ¶
func (acc EthAccount) String() string
String implements the fmt.Stringer interface
func (*EthAccount) Unmarshal ¶
func (m *EthAccount) Unmarshal(dAtA []byte) error
func (*EthAccount) UnmarshalJSON ¶
func (acc *EthAccount) UnmarshalJSON(bz []byte) error
UnmarshalJSON unmarshals raw JSON bytes into an EthAccount.
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 ExtensionOptionsWeb3TxI ¶
type ExtensionOptionsWeb3TxI interface{}