Docs
Supported ChainsMoonriverSubstrate APIState Methods

state_call - Moonriver RPC Method

Call a runtime API on Moonriver. Essential for runtime computations.

Calls a runtime API method on Moonriver.

Use Cases

  • Runtime computations - Execute runtime logic without transactions
  • Account queries - Use AccountNonceApi for production-grade dApp testing, early feature deployment, and Kusama-based EVM applications
  • Fee estimation - Use TransactionPaymentApi

Request Parameters

Request
methodString

Runtime API method name

dataString

SCALE-encoded call data

blockHashString

Block hash for historical call

Response Body

Response

Code Examples

Bash
curl  \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "state_call",
    "params": ["AccountNonceApi_account_nonce", "0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"],
    "id": 1
  }'
JavaScript
import { ApiPromise, WsProvider } from '@polkadot/api';

const provider = new WsProvider('');
const api = await ApiPromise.create({ provider });

// Get account nonce via runtime API
const account = '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY';
const result = await api.call.accountNonceApi.accountNonce(account);
console.log('Account nonce:', result.toNumber());

await api.disconnect();

On this page