{"modulePath":"github.com/RAMPAGEXP/ethermint","version":"v0.1.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package types\n\n## Constants\n\n```go\nconst (\n\t// AccountTypeEOA defines the type for externally owned accounts (EOAs)\n\tAccountTypeEOA = int8(iota + 1)\n\t// AccountTypeContract defines the type for contract accounts\n\tAccountTypeContract\n)\n```\n\n```go\nconst (\n\t// AttoPhoton defines the default coin denomination used in Ethermint in:\n\t//\n\t// - Staking parameters: denomination used as stake in the dPoS chain\n\t// - Mint parameters: denomination minted due to fee distribution rewards\n\t// - Governance parameters: denomination used for spam prevention in proposal deposits\n\t// - Crisis parameters: constant fee denomination used for spam prevention to check broken invariant\n\t// - EVM parameters: denomination used for running EVM state transitions in Ethermint.\n\tAttoPhoton string = \"aphoton\"\n\n\t// BaseDenomUnit defines the base denomination unit for Photons.\n\t// 1 photon = 1x10^{BaseDenomUnit} aphoton\n\tBaseDenomUnit = 18\n\n\t// DefaultGasPrice is default gas price for evm transactions\n\tDefaultGasPrice = 20\n)\n```\n\n```go\nconst (\n\n\t// ProtocolVersion is the latest supported version of the eth protocol.\n\tProtocolVersion = eth65\n)\n```\nConstants to match up protocol versions and messages\n\n```go\nconst (\n\t// RootCodespace is the codespace for all errors defined in this package\n\tRootCodespace = \"ethermint\"\n)\n```\n\n## Variables\n\n```go\nvar (\n\tErrInvalidLengthAccount        = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowAccount          = fmt.Errorf(\"proto: integer overflow\")\n\tErrUnexpectedEndOfGroupAccount = fmt.Errorf(\"proto: unexpected end of group\")\n)\n```\n\n```go\nvar (\n\t// ErrInvalidValue returns an error resulting from an invalid value.\n\tErrInvalidValue = sdkerrors.Register(RootCodespace, 2, \"invalid value\")\n\n\t// ErrInvalidChainID returns an error resulting from an invalid chain ID.\n\tErrInvalidChainID = sdkerrors.Register(RootCodespace, 3, \"invalid chain ID\")\n\n\t// ErrMarshalBigInt returns an error resulting from marshaling a big.Int to a string.\n\tErrMarshalBigInt = sdkerrors.Register(RootCodespace, 5, \"cannot marshal big.Int to string\")\n\n\t// ErrUnmarshalBigInt returns an error resulting from unmarshaling a big.Int from a string.\n\tErrUnmarshalBigInt = sdkerrors.Register(RootCodespace, 6, \"cannot unmarshal big.Int from string\")\n)\n```\n\n```go\nvar (\n\t// Bip44CoinType satisfies EIP84. See https://github.com/ethereum/EIPs/issues/84 for more info.\n\tBip44CoinType uint32 = 60\n\n\t// BIP44HDPath is the default BIP44 HD path used on Ethereum.\n\tBIP44HDPath = ethaccounts.DefaultBaseDerivationPath.String()\n)\n```\n\n```go\nvar (\n\tErrInvalidLengthIndexer        = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowIndexer          = fmt.Errorf(\"proto: integer overflow\")\n\tErrUnexpectedEndOfGroupIndexer = fmt.Errorf(\"proto: unexpected end of group\")\n)\n```\n\n```go\nvar (\n\tErrInvalidLengthWeb3        = fmt.Errorf(\"proto: negative length found during unmarshaling\")\n\tErrIntOverflowWeb3          = fmt.Errorf(\"proto: integer overflow\")\n\tErrUnexpectedEndOfGroupWeb3 = fmt.Errorf(\"proto: unexpected end of group\")\n)\n```\n\n```go\nvar PowerReduction = sdk.NewIntFromBigInt(new(big.Int).Exp(big.NewInt(10), big.NewInt(BaseDenomUnit), nil))\n```\nPowerReduction defines the default power reduction value for staking\n\n## Functions\n\n```go\nfunc BlockGasLimit(ctx sdk.Context) uint64\n```\nBlockGasLimit returns the max gas (limit) defined in the block gas meter. If the meter is not set, it returns the max gas from the application consensus params. NOTE: see [https://github.com/cosmos/cosmos-sdk/issues/9514](https://github.com/cosmos/cosmos-sdk/issues/9514) for full reference\n\n```go\nfunc IsEmptyHash(hash string) bool\n```\nIsEmptyHash returns true if the hash corresponds to an empty ethereum hex hash.\n\n```go\nfunc IsValidChainID(chainID string) bool\n```\nIsValidChainID returns false if the given chain identifier is incorrectly formatted.\n\n```go\nfunc IsValidInt256(i *big.Int) bool\n```\nIsValidInt256 check the bound of 256 bit number\n\n```go\nfunc IsZeroAddress(address string) bool\n```\nIsZeroAddress returns true if the address corresponds to an empty ethereum hex address.\n\n```go\nfunc NewInfiniteGasMeterWithLimit(limit sdk.Gas) sdk.GasMeter\n```\nNewInfiniteGasMeterWithLimit returns a reference to a new infiniteGasMeter.\n\n```go\nfunc NewPhotonCoin(amount sdk.Int) sdk.Coin\n```\nNewPhotonCoin is a utility function that returns an \"aphoton\" coin with the given sdk.Int amount. The function will panic if the provided amount is negative.\n\n```go\nfunc NewPhotonCoinInt64(amount int64) sdk.Coin\n```\nNewPhotonCoinInt64 is a utility function that returns an \"aphoton\" coin with the given int64 amount. The function will panic if the provided amount is negative.\n\n```go\nfunc NewPhotonDecCoin(amount sdk.Int) sdk.DecCoin\n```\nNewPhotonDecCoin is a utility function that returns an \"aphoton\" decimal coin with the given sdk.Int amount. The function will panic if the provided amount is negative.\n\n```go\nfunc ParseChainID(chainID string) (*big.Int, error)\n```\nParseChainID 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\n\n```go\nfunc ProtoAccount() authtypes.AccountI\n```\nProtoAccount defines the prototype function for BaseAccount used for an AccountKeeper.\n\n```go\nfunc RegisterInterfaces(registry codectypes.InterfaceRegistry)\n```\nRegisterInterfaces registers the tendermint concrete client-related implementations and interfaces.\n\n```go\nfunc SafeInt64(value uint64) (int64, error)\n```\nSafeInt64 checks for overflows while casting a uint64 to int64 value.\n\n```go\nfunc SafeNewIntFromBigInt(i *big.Int) (sdk.Int, error)\n```\nSafeNewIntFromBigInt constructs Int from big.Int, return error if more than 256bits\n\n```go\nfunc ValidateAddress(address string) error\n```\nValidateAddress returns an error if the provided string is either not a hex formatted string address\n\n```go\nfunc ValidateNonZeroAddress(address string) error\n```\nValidateNonZeroAddress returns an error if the provided string is not a hex formatted string address or is equal to zero\n\n## Types\n\n```go\ntype EVMTxIndexer interface {\n\t// LastIndexedBlock returns -1 if indexer db is empty\n\tLastIndexedBlock() (int64, error)\n\tIndexBlock(*tmtypes.Block, []*abci.ResponseDeliverTx) error\n\n\t// GetByTxHash returns nil if tx not found.\n\tGetByTxHash(common.Hash) (*TxResult, error)\n\t// GetByBlockAndIndex returns nil if tx not found.\n\tGetByBlockAndIndex(int64, int32) (*TxResult, error)\n}\n```\nEVMTxIndexer defines the interface of custom eth tx indexer.\n\n```go\ntype ErrorGasOverflow struct {\n\tDescriptor string\n}\n```\nErrorGasOverflow defines an error thrown when an action results gas consumption unsigned integer overflow.\n\n```go\ntype ErrorNegativeGasConsumed struct {\n\tDescriptor string\n}\n```\nErrorNegativeGasConsumed defines an error thrown when the amount of gas refunded results in a negative gas consumed amount. Copied from cosmos-sdk\n\n```go\ntype EthAccount struct {\n\t*types.BaseAccount `protobuf:\"bytes,1,opt,name=base_account,json=baseAccount,proto3,embedded=base_account\" json:\"base_account,omitempty\" yaml:\"base_account\"`\n\tCodeHash           string `protobuf:\"bytes,2,opt,name=code_hash,json=codeHash,proto3\" json:\"code_hash,omitempty\" yaml:\"code_hash\"`\n}\n```\nEthAccount implements the authtypes.AccountI interface and embeds an authtypes.BaseAccount type. It is compatible with the auth AccountKeeper.\n\n```go\nfunc (*EthAccount) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (acc EthAccount) EthAddress() common.Address\n```\nEthAddress returns the account address ethereum format.\n\n```go\nfunc (acc EthAccount) GetBaseAccount() *authtypes.BaseAccount\n```\nGetBaseAccount returns base account.\n\n```go\nfunc (acc EthAccount) GetCodeHash() common.Hash\n```\nGetCodeHash returns the account code hash in byte format\n\n```go\nfunc (m *EthAccount) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *EthAccount) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *EthAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*EthAccount) ProtoMessage()\n```\n\n```go\nfunc (m *EthAccount) Reset()\n```\n\n```go\nfunc (acc *EthAccount) SetCodeHash(codeHash common.Hash) error\n```\nSetCodeHash sets the account code hash to the EthAccount fields\n\n```go\nfunc (m *EthAccount) Size() (n int)\n```\n\n```go\nfunc (acc EthAccount) Type() int8\n```\nType returns the type of Ethereum Account (EOA or Contract)\n\n```go\nfunc (m *EthAccount) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (m *EthAccount) XXX_DiscardUnknown()\n```\n\n```go\nfunc (m *EthAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)\n```\n\n```go\nfunc (m *EthAccount) XXX_Merge(src proto.Message)\n```\n\n```go\nfunc (m *EthAccount) XXX_Size() int\n```\n\n```go\nfunc (m *EthAccount) XXX_Unmarshal(b []byte) error\n```\n\n```go\ntype EthAccountI interface {\n\tauthtypes.AccountI\n\t// EthAddress returns the ethereum Address representation of the AccAddress\n\tEthAddress() common.Address\n\t// CodeHash is the keccak256 hash of the contract code (if any)\n\tGetCodeHash() common.Hash\n\t// SetCodeHash sets the code hash to the account fields\n\tSetCodeHash(code common.Hash) error\n\t// Type returns the type of Ethereum Account (EOA or Contract)\n\tType() int8\n}\n```\nEthAccountI represents the interface of an EVM compatible account\n\n```go\ntype ExtensionOptionsWeb3Tx struct {\n\t// typed data chain id used only in EIP712 Domain and should match\n\t// Ethereum network ID in a Web3 provider (e.g. Metamask).\n\tTypedDataChainID uint64 `protobuf:\"varint,1,opt,name=typed_data_chain_id,json=typedDataChainId,proto3\" json:\"typedDataChainID,omitempty\"`\n\t// fee payer is an account address for the fee payer. It will be validated\n\t// during EIP712 signature checking.\n\tFeePayer string `protobuf:\"bytes,2,opt,name=fee_payer,json=feePayer,proto3\" json:\"feePayer,omitempty\"`\n\t// fee payer sig is a signature data from the fee paying account,\n\t// allows to perform fee delegation when using EIP712 Domain.\n\tFeePayerSig []byte `protobuf:\"bytes,3,opt,name=fee_payer_sig,json=feePayerSig,proto3\" json:\"feePayerSig,omitempty\"`\n}\n```\n\n```go\nfunc (*ExtensionOptionsWeb3Tx) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) MarshalToSizedBuffer(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*ExtensionOptionsWeb3Tx) ProtoMessage()\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) Reset()\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) Size() (n int)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) String() string\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) XXX_DiscardUnknown()\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) XXX_Merge(src proto.Message)\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) XXX_Size() int\n```\n\n```go\nfunc (m *ExtensionOptionsWeb3Tx) XXX_Unmarshal(b []byte) error\n```\n\n```go\ntype ExtensionOptionsWeb3TxI interface{}\n```\n\n```go\ntype HDPathIterator func() ethaccounts.DerivationPath\n```\n\n```go\nfunc NewHDPathIterator(basePath string, ledgerIter bool) (HDPathIterator, error)\n```\nHDPathIterator receives a base path as a string and a boolean for the desired iterator type and returns a function that iterates over the base HD path, returning the string.\n\n```go\ntype TxResult struct {\n\t// the block height\n\tHeight int64 `protobuf:\"varint,1,opt,name=height,proto3\" json:\"height,omitempty\"`\n\t// cosmos tx index\n\tTxIndex uint32 `protobuf:\"varint,2,opt,name=tx_index,json=txIndex,proto3\" json:\"tx_index,omitempty\"`\n\t// the msg index in a batch tx\n\tMsgIndex uint32 `protobuf:\"varint,3,opt,name=msg_index,json=msgIndex,proto3\" json:\"msg_index,omitempty\"`\n\t// eth tx index, the index in the list of valid eth tx in the block,\n\t// aka. the transaction list returned by eth_getBlock api.\n\tEthTxIndex int32 `protobuf:\"varint,4,opt,name=eth_tx_index,json=ethTxIndex,proto3\" json:\"eth_tx_index,omitempty\"`\n\t// if the eth tx is failed\n\tFailed bool `protobuf:\"varint,5,opt,name=failed,proto3\" json:\"failed,omitempty\"`\n\t// gas used by tx, if exceeds block gas limit,\n\t// it's set to gas limit which is what's actually deducted by ante handler.\n\tGasUsed uint64 `protobuf:\"varint,6,opt,name=gas_used,json=gasUsed,proto3\" json:\"gas_used,omitempty\"`\n\t// the cumulative gas used within current batch tx\n\tCumulativeGasUsed uint64 `protobuf:\"varint,7,opt,name=cumulative_gas_used,json=cumulativeGasUsed,proto3\" json:\"cumulative_gas_used,omitempty\"`\n}\n```\nTxResult is the value stored in eth tx indexer\n\n```go\nfunc (*TxResult) Descriptor() ([]byte, []int)\n```\n\n```go\nfunc (m *TxResult) Marshal() (dAtA []byte, err error)\n```\n\n```go\nfunc (m *TxResult) MarshalTo(dAtA []byte) (int, error)\n```\n\n```go\nfunc (m *TxResult) MarshalToSizedBuffer(dAtA []byte) (int, error)\n```\n\n```go\nfunc (*TxResult) ProtoMessage()\n```\n\n```go\nfunc (m *TxResult) Reset()\n```\n\n```go\nfunc (m *TxResult) Size() (n int)\n```\n\n```go\nfunc (m *TxResult) String() string\n```\n\n```go\nfunc (m *TxResult) Unmarshal(dAtA []byte) error\n```\n\n```go\nfunc (m *TxResult) XXX_DiscardUnknown()\n```\n\n```go\nfunc (m *TxResult) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)\n```\n\n```go\nfunc (m *TxResult) XXX_Merge(src proto.Message)\n```\n\n```go\nfunc (m *TxResult) XXX_Size() int\n```\n\n```go\nfunc (m *TxResult) XXX_Unmarshal(b []byte) error\n```\n\n","path":"github.com/RAMPAGEXP/ethermint/types","name":"types","synopsis":"","isRedistributable":true}
