RPC Methods
Account Methods
Testnet 122606
Section
RPC Methods
Documentation category
Type
Guide
Technical reference
Summary
Query account balances, nonces, contract code, and storage.
Article Content

eth_getBalance

Returns the SWSS Coin balance of an address.

Params:

  1. ADDRESS — 20-byte account address
  2. BLOCK — block tag or number (use "latest")
{
  "method": "eth_getBalance",
  "params": ["0xAbCd...1234", "latest"]
}

Result: string — balance in wei (hex). Convert: parseInt(result, 16) / 1e18 for SWSS Coin.


eth_getTransactionCount

Returns the number of transactions sent from an address (the account nonce).

Params:

  1. ADDRESS
  2. BLOCK — use "latest" for confirmed nonce, "pending" to include mempool transactions
{
  "method": "eth_getTransactionCount",
  "params": ["0xAbCd...1234", "latest"]
}

Result: string — hex-encoded nonce


eth_accounts

Returns a list of addresses owned by the node. On public RPC nodes, this returns an empty array — use a local signer instead.

Result: []


eth_getCode

Returns the compiled bytecode of a smart contract at a given address.

Params:

  1. ADDRESS — contract address
  2. BLOCK

Result: string — hex-encoded bytecode, or "0x" if the address is an EOA.


eth_getStorageAt

Returns the value from a storage slot of an address.

Params:

  1. ADDRESS
  2. SLOT — hex-encoded storage position
  3. BLOCK