Paxeer Docs logo

Querying the EVM

Read EVM state from the paxd CLI: address associations, ERC20 reads, ABI-encoded payloads, and transaction details.

The paxd q evm subcommands let you read EVM state - token data, address associations, and transactions - without sending a transaction or running your own node.

Prerequisites

If your machine is not running a Paxeer node, append the --node flag to every paxd q evm command, pointing at a Paxeer Cosmos RPC endpoint (the same kind used by paxd status):

--node https://<paxeer-cosmos-rpc-url>

The one exception is paxd q evm tx, which uses --evm-rpc to point at an EVM JSON-RPC endpoint (port 8545 by convention). See Transaction Lookup below.

Refer to the RPC endpoints page for a list of available RPC endpoints.

Output format. Most commands print YAML by default. Pass -o json for JSON. ERC20 read methods (name, balanceOf, …) return a bare value with no formatting - the result below is the raw stdout.

Address Mapping

Paxeer addresses (pax1…) and EVM addresses (0x…) are linked via an on-chain association set the first time an account signs an EVM transaction or calls the address-association precompile. Until then, the two address spaces are independent.

Get Paxeer Address from EVM Address

paxd q evm pax-addr [evm address]

Example:

paxd q evm pax-addr 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55

Output:

associated: true
pax_address: pax13ytysxs88z0fp9cssagg77ekpecrrlrwce9pwl

Get EVM Address from Paxeer Address

paxd q evm evm-addr [paxeer address]

Example:

paxd q evm evm-addr pax13ytysxs88z0fp9cssagg77ekpecrrlrwce9pwl

Output:

associated: true
evm_address: 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55
If the account hasn't been associated yet, associated is false and the other field is empty. This is normal for accounts that have only ever transacted on one side of the chain.

ERC20 Contract Queries

Call standard view methods on any ERC20 contract:

paxd q evm erc20 [contract address] [method] [arguments...]

Example - query Wrapped HPX (WHPX):

paxd q evm erc20 0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7 symbol

Output:

WHPX

Example - balance:

paxd q evm erc20 0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7 balanceOf 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55

Output (raw integer, in smallest unit):

0

Supported methods:

  • name - token name
  • symbol - token symbol
  • decimals - token decimals
  • totalSupply - total supply
  • balanceOf [address] - balance of an address
  • allowance [owner] [spender] - current allowance

For arbitrary methods or non-standard contracts, use payload with the contract ABI.

Payload Generation

Generate ABI-encoded call data without sending a transaction. Useful for crafting paxd tx evm call-contract calls or inspecting expected calldata.

ERC20 Payload Generation

paxd q evm erc20-payload [method] [arguments...]

Transfer tokens (1 token, 18 decimals):

paxd q evm erc20-payload transfer 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55 1000000000000000000

Output:

a9059cbb000000000000000000000000da52b9e673d1f48fcd9916b3f606a136a8ea5e550000000000000000000000000000000000000000000000000de0b6b3a7640000

Approve spender:

paxd q evm erc20-payload approve 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55 2000000000000000000

Output:

095ea7b3000000000000000000000000da52b9e673d1f48fcd9916b3f606a136a8ea5e550000000000000000000000000000000000000000000000001bc16d674ec80000

Transfer from (pulls tokens from from to to, using a prior approve):

paxd q evm erc20-payload transferFrom 0xDa52B9E673d1f48FcD9916b3F606A136a8eA5e55 0xdEAD000000000000000042069420694206942069 1500000000000000000

Output:

23b872dd000000000000000000000000da52b9e673d1f48fcd9916b3f606a136a8ea5e55000000000000000000000000dead00000000000000004206942069420694206900000000000000000000000000000000000000000000000014d1120d7b160000

Supported methods:

  • transfer [to] [amount]
  • approve [spender] [amount]
  • transferFrom [from] [to] [amount]

Amounts are in the token's smallest unit (e.g., wei for an 18-decimal token; 1000000 for 1 USDC with 6 decimals).

Transaction Lookup

Query Transaction by Hash

Equivalent to eth_getTransactionByHash:

paxd q evm tx [hash] --evm-rpc [EVM RPC endpoint]

Example:

paxd q evm tx 0x828c91592453fe7c5bf743204495a35bf02b67b579b8f59ee7eea8af031d7c14 \
  --evm-rpc https://public-rpc.paxeer.app/evm/reference

Output:

{
  "blockHash": "0x5620c15afd9a1d0ab19d7560043df6e038d731c6205974dca7a55900071e3864",
  "blockNumber": "0xc5e1386",
  "from": "0xda52b9e673d1f48fcd9916b3f606a136a8ea5e55",
  "gas": "0x493e0",
  "gasPrice": "0xe1614bd00",
  "maxFeePerGas": "0xe1614bd00",
  "maxPriorityFeePerGas": "0xe1614bd00",
  "hash": "0x828c91592453fe7c5bf743204495a35bf02b67b579b8f59ee7eea8af031d7c14",
  "input": "0x9cab5684...",
  "nonce": "0x0",
  "to": "0x7507454444fa193d39f1392076bc784b77a7a8ff",
  "transactionIndex": "0x0",
  "value": "0x0",
  "type": "0x2",
  "accessList": [],
  "chainId": "0x7d",
  "v": "0x0",
  "r": "0x468ac709b74e666834bcc740e5156e019fd0ba40cff7f8a59a46f08bff56eb2b",
  "s": "0x3496458ec06b57315721cf5e6be810b9548744a5dafab1739b8fdcff23939939",
  "yParity": "0x0"
}

This is the only paxd q evm command that takes --evm-rpc (an EVM JSON-RPC endpoint, typically port 8545) instead of --node (a Cosmos RPC). The default if you omit the flag is http://0.0.0.0:8545, which only works if you're running a local node. See RPC endpoints for hosted EVM RPCs.

Common Use Cases

Check Token Balance and Info

# Token metadata
paxd q evm erc20 0xtoken... symbol
paxd q evm erc20 0xtoken... decimals

# Balance (raw integer, in smallest unit)
paxd q evm erc20 0xtoken... balanceOf 0xuser...

Prepare and Send a Transaction

# 1. Encode the calldata
PAYLOAD=$(paxd q evm erc20-payload transfer 0xrecipient... 1000000000000000000)

# 2. Send via paxd
paxd tx evm call-contract 0xtoken... $PAYLOAD --from mykey