Skip to content

REST API - nibiru/evm

Query Service - nibiru/evm

/nibiru/evm/v1/balances/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/balances/{address} \
  -H 'Accept: application/json'
Summary

Balance queries the balance of a the EVM denomination for a single EthAccount.

Parameters
NameLocated inDescriptionRequiredSchema
addresspathaddress is the ethereum hex address to query the balance for.Yesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryBalanceResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/base_fee

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/base_fee \
  -H 'Accept: application/json'
Summary

BaseFee queries the base fee of the parent block of the current block, Similar to feemarket module's method

Responses
CodeDescriptionSchema
200A successful response.v1QueryBaseFeeResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/codes/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/codes/{address} \
  -H 'Accept: application/json'
Summary

Code queries the balance of all coins for a single account.

Parameters
NameLocated inDescriptionRequiredSchema
addresspathaddress is the ethereum hex address to query the code for.Yesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryCodeResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/estimate_gas

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/estimate_gas \
  -H 'Accept: application/json'
Summary

EstimateGas implements the eth_estimateGas rpc api

Parameters
NameLocated inDescriptionRequiredSchema
argsqueryargs uses the same json format as the json rpc api.Nobyte
gas_capquerygas_cap defines the default gas cap to be used.Nostring (uint64)
proposer_addressqueryproposer_address of the requested block in hex format.Nobyte
chain_idquerychain_id is the eip155 chain id parsed from the requested block header.Nostring (int64)
Responses
CodeDescriptionSchema
200A successful response.v1EstimateGasResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/eth_account/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/eth_account/{address} \
  -H 'Accept: application/json'
Summary

EthAccount queries a Nibiru account using its EVM address or Bech32 Nibiru address.

Parameters
NameLocated inDescriptionRequiredSchema
addresspathaddress is the Ethereum hex address or nibi Bech32 address to query the account for.Yesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryEthAccountResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/eth_call

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/eth_call \
  -H 'Accept: application/json'
Summary

EthCall implements the eth_call rpc api

Parameters
NameLocated inDescriptionRequiredSchema
argsqueryargs uses the same json format as the json rpc api.Nobyte
gas_capquerygas_cap defines the default gas cap to be used.Nostring (uint64)
proposer_addressqueryproposer_address of the requested block in hex format.Nobyte
chain_idquerychain_id is the eip155 chain id parsed from the requested block header.Nostring (int64)
Responses
CodeDescriptionSchema
200A successful response.v1MsgEthereumTxResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/funtoken/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/funtoken/{token} \
  -H 'Accept: application/json'
Parameters
NameLocated inDescriptionRequiredSchema
tokenpathEither the hexadecimal-encoded ERC20 contract address or denomination of the Bank Coin.Yesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryFunTokenMappingResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/params

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/params \
  -H 'Accept: application/json'
Summary

Params queries the parameters of x/evm module.

Responses
CodeDescriptionSchema
200A successful response.v1QueryParamsResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/storage/{address}/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/storage/{address}/{key} \
  -H 'Accept: application/json'
Summary

Storage queries the balance of all coins for a single account.

Parameters
NameLocated inDescriptionRequiredSchema
addresspathaddress is the ethereum hex address to query the storage state for.Yesstring
keypathkey defines the key of the storage stateYesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryStorageResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/trace_block

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/trace_block \
  -H 'Accept: application/json'
Summary

TraceBlock implements the debug_traceBlockByNumber and debug_traceBlockByHash rpc api

Parameters
NameLocated inDescriptionRequiredSchema
trace_config.tracerquerytracer is a custom javascript tracer.Nostring
trace_config.timeoutquerytimeout overrides the default timeout of 5 seconds for JavaScript-based tracing calls.Nostring
trace_config.reexecqueryreexec defines the number of blocks the tracer is willing to go back.Nostring (uint64)
trace_config.disable_stackquerydisable_stack switches stack capture.Noboolean
trace_config.disable_storagequerydisable_storage switches storage capture.Noboolean
trace_config.debugquerydebug can be used to print output during capture end.Noboolean
trace_config.limitquerylimit defines the maximum length of output, but zero means unlimited.Nointeger
trace_config.enable_memoryqueryenable_memory switches memory capture.Noboolean
trace_config.enable_return_dataqueryenable_return_data switches the capture of return data.Noboolean
trace_config.tracer_config.only_top_callqueryNoboolean
block_numberqueryblock_number of the traced block.Nostring (int64)
block_hashqueryblock_hash (hex) of the traced block.Nostring
block_timequeryblock_time of the traced block.NodateTime
proposer_addressqueryproposer_address is the address of the requested block.Nobyte
chain_idquerychain_id is the eip155 chain id parsed from the requested block header.Nostring (int64)
block_max_gasqueryblock_max_gas of the traced block.Nostring (int64)
Responses
CodeDescriptionSchema
200A successful response.v1QueryTraceBlockResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/trace_call

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/trace_call \
  -H 'Accept: application/json'
Summary

TraceCall implements the debug_traceCall rpc api

Parameters
NameLocated inDescriptionRequiredSchema
msg.data.type_urlqueryA URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in path/google.protobuf.Duration). The name should be in a canonical form (e.g., leading "." is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme http, https, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, https is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than http, https (or the empty scheme) might be used with implementation specific semantics.Nostring
msg.data.valuequeryMust be a valid serialized protocol buffer of the above specified type.Nobyte
msg.sizequerysize is the encoded storage size of the transaction (DEPRECATED).Nodouble
msg.hashqueryhash of the transaction in hex format.Nostring
msg.fromqueryfrom is the ethereum signer address in hex format. This address value is checked against the address derived from the signature (V, R, S) using the secp256k1 elliptic curve.Nostring
trace_config.tracerquerytracer is a custom javascript tracer.Nostring
trace_config.timeoutquerytimeout overrides the default timeout of 5 seconds for JavaScript-based tracing calls.Nostring
trace_config.reexecqueryreexec defines the number of blocks the tracer is willing to go back.Nostring (uint64)
trace_config.disable_stackquerydisable_stack switches stack capture.Noboolean
trace_config.disable_storagequerydisable_storage switches storage capture.Noboolean
trace_config.debugquerydebug can be used to print output during capture end.Noboolean
trace_config.limitquerylimit defines the maximum length of output, but zero means unlimited.Nointeger
trace_config.enable_memoryqueryenable_memory switches memory capture.Noboolean
trace_config.enable_return_dataqueryenable_return_data switches the capture of return data.Noboolean
trace_config.tracer_config.only_top_callqueryNoboolean
block_numberqueryblock_number of requested transaction.Nostring (int64)
block_hashqueryblock_hash of requested transaction.Nostring
block_timequeryblock_time of requested transaction.NodateTime
proposer_addressqueryproposer_address is the proposer of the requested block.Nobyte
chain_idquerychain_id is the the eip155 chain id parsed from the requested block header.Nostring (int64)
block_max_gasqueryblock_max_gas of the block of the requested transaction.Nostring (int64)
Responses
CodeDescriptionSchema
200A successful response.v1QueryTraceTxResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/trace_tx

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/trace_tx \
  -H 'Accept: application/json'
Summary

TraceTx implements the debug_traceTransaction rpc api

Parameters
NameLocated inDescriptionRequiredSchema
msg.data.type_urlqueryA URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in path/google.protobuf.Duration). The name should be in a canonical form (e.g., leading "." is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme http, https, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, https is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than http, https (or the empty scheme) might be used with implementation specific semantics.Nostring
msg.data.valuequeryMust be a valid serialized protocol buffer of the above specified type.Nobyte
msg.sizequerysize is the encoded storage size of the transaction (DEPRECATED).Nodouble
msg.hashqueryhash of the transaction in hex format.Nostring
msg.fromqueryfrom is the ethereum signer address in hex format. This address value is checked against the address derived from the signature (V, R, S) using the secp256k1 elliptic curve.Nostring
trace_config.tracerquerytracer is a custom javascript tracer.Nostring
trace_config.timeoutquerytimeout overrides the default timeout of 5 seconds for JavaScript-based tracing calls.Nostring
trace_config.reexecqueryreexec defines the number of blocks the tracer is willing to go back.Nostring (uint64)
trace_config.disable_stackquerydisable_stack switches stack capture.Noboolean
trace_config.disable_storagequerydisable_storage switches storage capture.Noboolean
trace_config.debugquerydebug can be used to print output during capture end.Noboolean
trace_config.limitquerylimit defines the maximum length of output, but zero means unlimited.Nointeger
trace_config.enable_memoryqueryenable_memory switches memory capture.Noboolean
trace_config.enable_return_dataqueryenable_return_data switches the capture of return data.Noboolean
trace_config.tracer_config.only_top_callqueryNoboolean
block_numberqueryblock_number of requested transaction.Nostring (int64)
block_hashqueryblock_hash of requested transaction.Nostring
block_timequeryblock_time of requested transaction.NodateTime
proposer_addressqueryproposer_address is the proposer of the requested block.Nobyte
chain_idquerychain_id is the the eip155 chain id parsed from the requested block header.Nostring (int64)
block_max_gasqueryblock_max_gas of the block of the requested transaction.Nostring (int64)
Responses
CodeDescriptionSchema
200A successful response.v1QueryTraceTxResponse
defaultAn unexpected error response.runtimeError

/nibiru/evm/v1/validator_account/

bash
# You can also use wget
curl -X GET https://lcd.nibiru.fi/nibiru/evm/v1/validator_account/{cons_address} \
  -H 'Accept: application/json'
Summary

ValidatorAccount queries an Ethereum account's from a validator consensus Address.

Parameters
NameLocated inDescriptionRequiredSchema
cons_addresspathcons_address is the validator cons address to query the account for.Yesstring
Responses
CodeDescriptionSchema
200A successful response.v1QueryValidatorAccountResponse
defaultAn unexpected error response.runtimeError

Models

protobufAny

Any contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message.

Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type.

Example 1: Pack and unpack a message in C++.

Foo foo = ...;
Any any;
any.PackFrom(foo);
...
if (any.UnpackTo(&foo)) {
  ...
}

Example 2: Pack and unpack a message in Java.

Foo foo = ...;
Any any = Any.pack(foo);
...
if (any.is(Foo.class)) {
  foo = any.unpack(Foo.class);
}
// or ...
if (any.isSameTypeAs(Foo.getDefaultInstance())) {
  foo = any.unpack(Foo.getDefaultInstance());
}

Example 3: Pack and unpack a message in Python.

foo = Foo(...)
any = Any()
any.Pack(foo)
...
if any.Is(Foo.DESCRIPTOR):
  any.Unpack(foo)
  ...

Example 4: Pack and unpack a message in Go

 foo := &pb.Foo{...}
 any, err := anypb.New(foo)
 if err != nil {
   ...
 }
 ...
 foo := &pb.Foo{}
 if err := any.UnmarshalTo(foo); err != nil {
   ...
 }

The pack methods provided by protobuf library will by default use 'type.googleapis.com/full.type.name' as the type URL and the unpack methods only use the fully qualified type name after the last '/' in the type URL, for example "foo.bar.com/x/y.z" will yield type name "y.z".

JSON

The JSON representation of an Any value uses the regular representation of the deserialized, embedded message, with an additional field @type which contains the type URL. Example:

package google.profile;
message Person {
  string first_name = 1;
  string last_name = 2;
}

{
  "@type": "type.googleapis.com/google.profile.Person",
  "firstName": <string>,
  "lastName": <string>
}

If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field value which holds the custom JSON in addition to the @type field. Example (for message [google.protobuf.Duration][]):

{
  "@type": "type.googleapis.com/google.protobuf.Duration",
  "value": "1.212s"
}
NameTypeDescriptionRequired
type_urlstringA URL/resource name that uniquely identifies the type of the serialized protocol buffer message. This string must contain at least one "/" character. The last segment of the URL's path must represent the fully qualified name of the type (as in path/google.protobuf.Duration). The name should be in a canonical form (e.g., leading "." is not accepted). In practice, teams usually precompile into the binary all types that they expect it to use in the context of Any. However, for URLs which use the scheme http, https, or no scheme, one can optionally set up a type server that maps type URLs to message definitions as follows: * If no scheme is provided, https is assumed. * An HTTP GET on the URL must yield a [google.protobuf.Type][] value in binary format, or produce an error. * Applications are allowed to cache lookup results based on the URL, or have them precompiled into a binary to avoid any lookup. Therefore, binary compatibility needs to be preserved on changes to types. (Use versioned type names to manage breaking changes.) Note: this functionality is not currently available in the official protobuf release, and it is not used for type URLs beginning with type.googleapis.com. As of May 2023, there are no widely used type server implementations and no plans to implement one. Schemes other than http, https (or the empty scheme) might be used with implementation specific semantics.No
valuebyteMust be a valid serialized protocol buffer of the above specified type.No

runtimeError

NameTypeDescriptionRequired
errorstringNo
codeintegerNo
messagestringNo
details[ protobufAny ]No

v1EstimateGasResponse

NameTypeDescriptionRequired
gasstring (uint64)No

v1FunToken

FunToken is a fungible token mapping between a Bank Coin and a corresponding ERC-20 smart contract. Bank Coins here refer to tokens like NIBI, IBC coins (ICS-20), and token factory coins, which are each represented by the "Coin" type in Golang.

NameTypeDescriptionRequired
erc20_addrstringNo
bank_denomstringbank_denom: Coin denomination in the Bank Module.No
is_made_from_coinbooleanTrue if the FunToken mapping was created from an existing Bank Coin and the ERC-20 contract gets deployed by the module account. False if the mapping was created from an externally owned ERC-20 contract.No

v1Log

Log represents an protobuf compatible Ethereum Log that defines a contract log event. These events are generated by the LOG opcode and stored/indexed by the node.

NOTE: address, topics and data are consensus fields. The rest of the fields are derived, i.e. filled in by the nodes, but not secured by consensus.

NameTypeDescriptionRequired
addressstringNo
topics[ string ]topics is a list of topics provided by the contract.No
databyteNo
block_numberstring (uint64)No
tx_hashstringNo
tx_indexstring (uint64)No
block_hashstringNo
indexstring (uint64)No
removedbooleanremoved is true if this log was reverted due to a chain reorganisation. You must pay attention to this field if you receive logs through a filter query.No

v1MsgEthereumTx

MsgEthereumTx encapsulates an Ethereum transaction as an SDK message.

NameTypeDescriptionRequired
dataprotobufAnyNo
sizedoubleNo
hashstringNo
fromstringNo

v1MsgEthereumTxResponse

MsgEthereumTxResponse defines the Msg/EthereumTx response type.

NameTypeDescriptionRequired
hashstringNo
logs[ v1Log ]logs contains the transaction hash and the proto-compatible ethereum logs.No
retbyteNo
vm_errorstringNo
gas_usedstring (uint64)No

v1Params

NameTypeDescriptionRequired
extra_eips[ string (int64) ]No
evm_channels[ string ]No
create_funtoken_feestringFee deducted and burned when calling "CreateFunToken" in units of "evm_denom".No
canonical_wnibistringNo

v1QueryBalanceResponse

QueryBalanceResponse is the response type for the Query/Balance RPC method.

NameTypeDescriptionRequired
balancestringNo
balance_weistringbalance is the balance of the EVM denomination in units of wei.No

v1QueryBaseFeeResponse

QueryBaseFeeResponse returns the EIP1559 base fee. See https://github.com/ethereum/EIPs/blob/ba6c342c23164072adb500c3136e3ae6eabff306/EIPS/eip-1559.md.

NameTypeDescriptionRequired
base_feestringbase_fee is the EIP1559 base fee in units of wei.No
base_fee_unibistringbase_fee is the EIP1559 base fee in units of micronibi ("unibi").No

v1QueryCodeResponse

QueryCodeResponse is the response type for the Query/Code RPC method.

NameTypeDescriptionRequired
codebytecode represents the code bytes from an ethereum address.No

v1QueryEthAccountResponse

QueryEthAccountResponse is the response type for the Query/EthAccount RPC method.

NameTypeDescriptionRequired
balancestringbalance is the balance of unibi (micronibi).No
balance_weistringbalance_wei is the balance of wei (attoether, where NIBI is ether).No
code_hashstringcode_hash is the hex-formatted code bytes from the EOA.No
noncestring (uint64)nonce is the account's sequence number.No
eth_addressstringeth_address: The hexadecimal-encoded string representing the 20 byte address of a Nibiru EVM account.No
bech32_addressstringbech32_address is the nibi-prefixed address of the account that can receive bank transfers ("cosmos.bank.v1beta1.MsgSend").No

v1QueryFunTokenMappingResponse

NameTypeDescriptionRequired
fun_tokenv1FunTokenNo

v1QueryParamsResponse

QueryParamsResponse defines the response type for querying x/evm parameters.

NameTypeDescriptionRequired
paramsv1Paramsparams define the evm module parameters.No

v1QueryStorageResponse

QueryStorageResponse is the response type for the Query/Storage RPC method.

NameTypeDescriptionRequired
valuestringvalue defines the storage state value hash associated with the given key.No

v1QueryTraceBlockResponse

NameTypeDescriptionRequired
databyteNo

v1QueryTraceTxResponse

NameTypeDescriptionRequired
databyteNo

v1QueryValidatorAccountResponse

QueryValidatorAccountResponse is the response type for the Query/ValidatorAccount RPC method.

NameTypeDescriptionRequired
account_addressstringaccount_address is the Nibiru address of the account in bech32 format.No
sequencestring (uint64)sequence is the account's sequence number.No
account_numberstring (uint64)No

v1TraceConfig

TraceConfig holds extra parameters to trace functions.

NameTypeDescriptionRequired
tracerstringNo
timeoutstringNo
reexecstring (uint64)No
disable_stackbooleanNo
disable_storagebooleanNo
debugbooleanNo
limitintegerNo
enable_memorybooleanNo
enable_return_databooleanNo
tracer_configv1TracerConfigNo

v1TracerConfig

NameTypeDescriptionRequired
only_top_callbooleanNo