Cubewire LogoDeveloper
Support
Onboarding
Cubewire Developer Hub Logo
SOC 2 Compliant

Developer documentation and tools for Cubewire's digital wallet infrastructure. Built for developers, by developers.

developers@cubewire.com
TwitterGitHubDiscord

Developer Tools

  • API Documentation
  • API Reference

Resources

  • Documentation

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Service
© 2026 Cubewire. All rights reserved.
Developer Documentation Portal•Built with ♥ for developers
  1. Cubewire Wallet
  2. Manage Smart Contracts
  3. Read contract state (view/pure functions)

Read contract state (view/pure functions)

Query smart contract state by calling view or pure functions. This endpoint executes read-only operations that don't modify blockchain state and don't require gas fees.

Request Body

FieldTypeRequiredDescription
sender.vaultIdUUIDYesVault identifier for the call
chainIdnumberYesBlockchain network ID
contractAddressstringYesSmart contract address (0x..., 42 chars)
functionNamestringNoFunction name (e.g., balanceOf, totalSupply)
functionSignaturestringNoFull function signature (e.g., balanceOf(address))
parametersarrayNoFunction parameters with type/value
abiarrayNoContract ABI for result decoding
datastringNoPre-encoded function call data (alternative to functionSignature + parameters)

Parameters Array

Each parameter object includes:

FieldTypeDescription
typestringSolidity type (e.g., address, uint256)
valuestring/number/booleanParameter value

Key Differences from Contract Write

AspectContract ReadContract Write
Gas RequiredNo (reads are free)Yes
TransactionNo (uses eth_call)Yes (on-chain)
ResponseInstant (synchronous)Async (confirmation)
State ChangesCannot modifyCan modify
ApprovalsNot requiredMay be required

Read Call Workflow

  1. Validation — Validates contract address and function details
  2. Encoding — Encodes function call parameters
  3. Policy Check — Evaluates against policies (can block)
  4. Execution — Executes eth_call via RPC
  5. Decoding — Decodes and returns result

Response Fields

FieldTypeDescription
successbooleanWhether the contract read call succeeded
contractAddressstringContract address that was queried
functionNamestringFunction that was called, if provided
chainIdnumberChain ID where the call was executed
resultobjectContract read call result (raw + decoded)
result.datastringRaw hex-encoded result from the contract call
result.decodedanyDecoded result if ABI was provided
transactionIdUUIDTransaction ID for audit trail and tracking
statusstringFinal workflow status (e.g., COMPLETED)

Use Cases

  • Query token balances (balanceOf)
  • Check total supply (totalSupply)
  • Read contract state variables
  • Verify allowances and approvals
  • Query NFT ownership and metadata
  • Check price feeds and oracles

Required Permission

contracts:read

On this page

  • Request Body
  • Parameters Array
  • Key Differences from Contract Write
  • Read Call Workflow
  • Response Fields
  • Use Cases
  • Required Permission
  1. Cubewire Wallet
  2. Manage Smart Contracts
  3. Read contract state (view/pure functions)

Read contract state (view/pure functions)

Query smart contract state by calling view or pure functions. This endpoint executes read-only operations that don't modify blockchain state and don't require gas fees.

Request Body

FieldTypeRequiredDescription
sender.vaultIdUUIDYesVault identifier for the call
chainIdnumberYesBlockchain network ID
contractAddressstringYesSmart contract address (0x..., 42 chars)
functionNamestringNoFunction name (e.g., balanceOf, totalSupply)
functionSignaturestringNoFull function signature (e.g., balanceOf(address))
parametersarrayNoFunction parameters with type/value
abiarrayNoContract ABI for result decoding
datastringNoPre-encoded function call data (alternative to functionSignature + parameters)

Parameters Array

Each parameter object includes:

FieldTypeDescription
typestringSolidity type (e.g., address, uint256)
valuestring/number/booleanParameter value

Key Differences from Contract Write

AspectContract ReadContract Write
Gas RequiredNo (reads are free)Yes
TransactionNo (uses eth_call)Yes (on-chain)
ResponseInstant (synchronous)Async (confirmation)
State ChangesCannot modifyCan modify
ApprovalsNot requiredMay be required

Read Call Workflow

  1. Validation — Validates contract address and function details
  2. Encoding — Encodes function call parameters
  3. Policy Check — Evaluates against policies (can block)
  4. Execution — Executes eth_call via RPC
  5. Decoding — Decodes and returns result

Response Fields

FieldTypeDescription
successbooleanWhether the contract read call succeeded
contractAddressstringContract address that was queried
functionNamestringFunction that was called, if provided
chainIdnumberChain ID where the call was executed
resultobjectContract read call result (raw + decoded)
result.datastringRaw hex-encoded result from the contract call
result.decodedanyDecoded result if ABI was provided
transactionIdUUIDTransaction ID for audit trail and tracking
statusstringFinal workflow status (e.g., COMPLETED)

Use Cases

  • Query token balances (balanceOf)
  • Check total supply (totalSupply)
  • Read contract state variables
  • Verify allowances and approvals
  • Query NFT ownership and metadata
  • Check price feeds and oracles

Required Permission

contracts:read

On this page

  • Request Body
  • Parameters Array
  • Key Differences from Contract Write
  • Read Call Workflow
  • Response Fields
  • Use Cases
  • Required Permission