evmos/erc20
Table of Contents
evmos/erc20/v1/query.proto
TopQueryParamsRequest
QueryParamsRequest is the request type for the Query/Params RPC method.
QueryParamsResponse
QueryParamsResponse is the response type for the Query/Params RPC
method.
Field | Type | Label | Description |
params | Params |
|
QueryTokenPairRequest
QueryTokenPairRequest is the request type for the Query/TokenPair RPC method.
Field | Type | Label | Description |
token | string | token identifier can be either the hex contract address of the ERC20 or the Cosmos base denomination |
QueryTokenPairResponse
QueryTokenPairResponse is the response type for the Query/TokenPair RPC
method.
Field | Type | Label | Description |
token_pair | TokenPair |
|
QueryTokenPairsRequest
QueryTokenPairsRequest is the request type for the Query/TokenPairs RPC
method.
Field | Type | Label | Description |
pagination | cosmos.base.query.v1beta1.PageRequest | pagination defines an optional pagination for the request. |
QueryTokenPairsResponse
QueryTokenPairsResponse is the response type for the Query/TokenPairs RPC
method.
Field | Type | Label | Description |
token_pairs | TokenPair | repeated |
|
pagination | cosmos.base.query.v1beta1.PageResponse | pagination defines the pagination in the response. |
Query
Query defines the gRPC querier service.
Method Name | Request Type | Response Type | Description |
TokenPairs | QueryTokenPairsRequest | QueryTokenPairsResponse | TokenPairs retrieves registered token pairs |
TokenPair | QueryTokenPairRequest | QueryTokenPairResponse | TokenPair retrieves a registered token pair |
Params | QueryParamsRequest | QueryParamsResponse | Params retrieves the erc20 module params |
Methods with HTTP bindings
Method Name | Method | Pattern | Body |
TokenPairs | GET | /evmos/erc20/v1/token_pairs | |
TokenPair | GET | /evmos/erc20/v1/token_pairs/{token} | |
Params | GET | /evmos/erc20/v1/params |
evmos/erc20/v1/genesis.proto
TopGenesisState
GenesisState defines the module's genesis state.
Field | Type | Label | Description |
params | Params | module parameters |
|
token_pairs | TokenPair | repeated | registered token pairs |
Params
Params defines the erc20 module params
Field | Type | Label | Description |
enable_erc20 | bool | parameter to enable the conversion of Cosmos coins <--> ERC20 tokens. |
|
enable_evm_hook | bool | parameter to enable the EVM hook that converts an ERC20 token to a Cosmos Coin by transferring the Tokens through a MsgEthereumTx to the ModuleAddress Ethereum address. |
evmos/erc20/v1/tx.proto
TopMsgConvertCoin
MsgConvertCoin defines a Msg to convert a native Cosmos coin to a ERC20 token
Field | Type | Label | Description |
coin | cosmos.base.v1beta1.Coin | Cosmos coin which denomination is registered in a token pair. The coin amount defines the amount of coins to convert. |
|
receiver | string | recipient hex address to receive ERC20 token |
|
sender | string | cosmos bech32 address from the owner of the given Cosmos coins |
MsgConvertCoinResponse
MsgConvertCoinResponse returns no fields
MsgConvertERC20
MsgConvertERC20 defines a Msg to convert a ERC20 token to a native Cosmos
coin.
Field | Type | Label | Description |
contract_address | string | ERC20 token contract address registered in a token pair |
|
amount | string | amount of ERC20 tokens to convert |
|
receiver | string | bech32 address to receive native Cosmos coins |
|
sender | string | sender hex address from the owner of the given ERC20 tokens |
MsgConvertERC20Response
MsgConvertERC20Response returns no fields
Msg
Msg defines the erc20 Msg service.
Method Name | Request Type | Response Type | Description |
ConvertCoin | MsgConvertCoin | MsgConvertCoinResponse | ConvertCoin mints a ERC20 representation of the native Cosmos coin denom that is registered on the token mapping. |
ConvertERC20 | MsgConvertERC20 | MsgConvertERC20Response | ConvertERC20 mints a native Cosmos coin representation of the ERC20 token contract that is registered on the token mapping. |
Methods with HTTP bindings
Method Name | Method | Pattern | Body |
ConvertCoin | GET | /evmos/erc20/v1/tx/convert_coin | |
ConvertERC20 | GET | /evmos/erc20/v1/tx/convert_erc20 |
evmos/erc20/v1/erc20.proto
TopRegisterCoinProposal
RegisterCoinProposal is a gov Content type to register a token pair for a
native Cosmos coin.
Field | Type | Label | Description |
title | string | title of the proposal |
|
description | string | proposal description |
|
metadata | cosmos.bank.v1beta1.Metadata | metadata of the native Cosmos coin |
RegisterERC20Proposal
RegisterERC20Proposal is a gov Content type to register a token pair for an
ERC20 token
Field | Type | Label | Description |
title | string | title of the proposal |
|
description | string | proposal description |
|
erc20address | string | contract address of ERC20 token |
ToggleTokenConversionProposal
ToggleTokenConversionProposal is a gov Content type to toggle the conversion
of a token pair.
Field | Type | Label | Description |
title | string | title of the proposal |
|
description | string | proposal description |
|
token | string | token identifier can be either the hex contract address of the ERC20 or the Cosmos base denomination |
TokenPair
TokenPair defines an instance that records a pairing consisting of a native
Cosmos Coin and an ERC20 token address.
Field | Type | Label | Description |
erc20_address | string | address of ERC20 contract token |
|
denom | string | cosmos base denomination to be mapped to |
|
enabled | bool | shows token mapping enable status |
|
contract_owner | Owner | ERC20 owner address ENUM (0 invalid, 1 ModuleAccount, 2 external address) |
Owner
Owner enumerates the ownership of a ERC20 contract.
Name | Number | Description |
OWNER_UNSPECIFIED | 0 | OWNER_UNSPECIFIED defines an invalid/undefined owner. |
OWNER_MODULE | 1 | OWNER_MODULE erc20 is owned by the erc20 module account. |
OWNER_EXTERNAL | 2 | EXTERNAL erc20 is owned by an external account. |
Scalar Value Types
.proto Type | Notes | Python Type |
double | float | |
float | float | |
int32 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint32 instead. | int |
int64 | Uses variable-length encoding. Inefficient for encoding negative numbers – if your field is likely to have negative values, use sint64 instead. | int/long |
uint32 | Uses variable-length encoding. | int/long |
uint64 | Uses variable-length encoding. | int/long |
sint32 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int32s. | int |
sint64 | Uses variable-length encoding. Signed int value. These more efficiently encode negative numbers than regular int64s. | int/long |
fixed32 | Always four bytes. More efficient than uint32 if values are often greater than 2^28. | int |
fixed64 | Always eight bytes. More efficient than uint64 if values are often greater than 2^56. | int/long |
sfixed32 | Always four bytes. | int |
sfixed64 | Always eight bytes. | int/long |
bool | boolean | |
string | A string must always contain UTF-8 encoded or 7-bit ASCII text. | str/unicode |
bytes | May contain any arbitrary sequence of bytes. | str |