JSON-RPC
Author
hasKey
Returns true if the keystore has private keys for the given public key and key type.
This method is only active with appropriate flags
Interface
api.rpc.author.hasKey(publicKey: Bytes, keyType: Text): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_hasKey", "params":[publicKey: Bytes, keyType: Text] }
hasSessionKeys
Returns true if the keystore has private keys for the given session public keys.
This method is only active with appropriate flags
Interface
api.rpc.author.hasSessionKeys(sessionKeys: Bytes): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_hasSessionKeys", "params":[sessionKeys: Bytes] }
insertKey
Insert a key into the keystore.
This method is only active with appropriate flags
Interface
api.rpc.author.insertKey(keyType: Text, suri: Text, publicKey: Bytes): Bytes
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_insertKey", "params":[keyType: Text, suri: Text, publicKey: Bytes] }
pendingExtrinsics
Returns all pending extrinsics, potentially grouped by sender
Interface
api.rpc.author.pendingExtrinsics(): Vec<Extrinsic>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_pendingExtrinsics", "params":[] }
removeExtrinsic
Remove given extrinsic from the pool and temporarily ban it to prevent reimporting
This method is only active with appropriate flags
Interface
api.rpc.author.removeExtrinsic(bytesOrHash: Vec<ExtrinsicOrHash>): Vec<Hash>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_removeExtrinsic", "params":[bytesOrHash: Vec<ExtrinsicOrHash>] }
rotateKeys
Generate new session keys and returns the corresponding public keys
This method is only active with appropriate flags
Interface
api.rpc.author.rotateKeys(): Bytes
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_rotateKeys", "params":[] }
submitAndWatchExtrinsic
Submit and subscribe to watch an extrinsic until unsubscribed
Interface
api.rpc.author.submitAndWatchExtrinsic(extrinsic: Extrinsic): ExtrinsicStatus
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_submitAndWatchExtrinsic", "params":[extrinsic: Extrinsic] }
submitExtrinsic
Submit a fully formatted extrinsic for block inclusion
Interface
api.rpc.author.submitExtrinsic(extrinsic: Extrinsic): Hash
JSON
{ "id":1, "jsonrpc":"2.0", "method":"author_submitExtrinsic", "params":[extrinsic: Extrinsic] }
Babe
epochAuthorship
Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore
This method is only active with appropriate flags
Interface
api.rpc.babe.epochAuthorship(): HashMap<AuthorityId, EpochAuthorship>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"babe_epochAuthorship", "params":[] }
Chain
getBlock
Get header and body of a relay chain block
Interface
api.rpc.chain.getBlock(hash?: BlockHash): SignedBlock
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_getBlock", "params":[hash?: BlockHash] }
getBlockHash
Get the block hash for a specific block
Interface
api.rpc.chain.getBlockHash(blockNumber?: BlockNumber): BlockHash
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_getBlockHash", "params":[blockNumber?: BlockNumber] }
getFinalizedHead
Get hash of the last finalized block in the canon chain
Interface
api.rpc.chain.getFinalizedHead(): BlockHash
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_getFinalizedHead", "params":[] }
getHeader
Retrieves the header for a specific block
Interface
api.rpc.chain.getHeader(hash?: BlockHash): Header
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_getHeader", "params":[hash?: BlockHash] }
subscribeAllHeads
Retrieves the newest header via subscription
Interface
api.rpc.chain.subscribeAllHeads(): Header
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_subscribeAllHeads", "params":[] }
subscribeFinalizedHeads
Retrieves the best finalized header via subscription
Interface
api.rpc.chain.subscribeFinalizedHeads(): Header
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_subscribeFinalizedHeads", "params":[] }
subscribeNewHeads
Retrieves the best header via subscription
Interface
api.rpc.chain.subscribeNewHeads(): Header
JSON
{ "id":1, "jsonrpc":"2.0", "method":"chain_subscribeNewHeads", "params":[] }
Childstate
getKeys
Returns the keys with prefix from a child storage, leave empty to get all the keys
Interface
api.rpc.childstate.getKeys(childKey: PrefixedStorageKey, prefix: StorageKey, at?: Hash): Vec<StorageKey>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getKeys", "params":[childKey: PrefixedStorageKey, prefix: StorageKey, at?: Hash] }
getKeysPaged
Returns the keys with prefix from a child storage with pagination support
Interface
api.rpc.childstate.getKeysPaged(childKey: PrefixedStorageKey, prefix: StorageKey, count: u32, startKey?: StorageKey, at?: Hash): Vec<StorageKey>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getKeysPaged", "params":[childKey: PrefixedStorageKey, prefix: StorageKey, count: u32, startKey?: StorageKey, at?: Hash] }
getStorage
Returns a child storage entry at a specific block state
Interface
api.rpc.childstate.getStorage(childKey: PrefixedStorageKey, key: StorageKey, at?: Hash): Option<StorageData>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getStorage", "params":[childKey: PrefixedStorageKey, key: StorageKey, at?: Hash] }
getStorageEntries
Returns child storage entries for multiple keys at a specific block state
Interface
api.rpc.childstate.getStorageEntries(childKey: PrefixedStorageKey, keys: Vec<StorageKey>, at?: Hash): Vec<Option<StorageData>>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getStorageEntries", "params":[childKey: PrefixedStorageKey, keys: Vec<StorageKey>, at?: Hash] }
getStorageHash
Returns the hash of a child storage entry at a block state
Interface
api.rpc.childstate.getStorageHash(childKey: PrefixedStorageKey, key: StorageKey, at?: Hash): Option<Hash>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getStorageHash", "params":[childKey: PrefixedStorageKey, key: StorageKey, at?: Hash] }
getStorageSize
Returns the size of a child storage entry at a block state
Interface
api.rpc.childstate.getStorageSize(childKey: PrefixedStorageKey, key: StorageKey, at?: Hash): Option<u64>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"childstate_getStorageSize", "params":[childKey: PrefixedStorageKey, key: StorageKey, at?: Hash] }
Dex
getAmountsIn
Given an array of AssetIds, return amounts in for an amount out
Interface
api.rpc.dex.getAmountsIn(amountOut: u128, path: Vec<AssetId>): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_getAmountsIn", "params":[amountOut: u128, path: Vec<AssetId>] }
getAmountsOut
Given an array of AssetIds, return amounts out for an amount in
Interface
api.rpc.dex.getAmountsOut(amountIn: u128, path: Vec<AssetId>): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_getAmountsOut", "params":[amountIn: u128, path: Vec<AssetId>] }
getLPTokenID
Given two AssetIds, return liquidity token created for the pair
Interface
api.rpc.dex.getLPTokenID(assetA: AssetId, assetB: AssetId): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_getLPTokenID", "params":[assetA: AssetId, assetB: AssetId] }
getLiquidity
Given two AssetIds, return liquidity
Interface
api.rpc.dex.getLiquidity(assetA: AssetId, assetB: AssetId): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_getLiquidity", "params":[assetA: AssetId, assetB: AssetId] }
getTradingPairStatus
Given two AssetIds, return whether trading pair is enabled or disabled
Interface
api.rpc.dex.getTradingPairStatus(assetA: AssetId, assetB: AssetId): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_getTradingPairStatus", "params":[assetA: AssetId, assetB: AssetId] }
quote
Given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
Interface
api.rpc.dex.quote(amountA: u128, reserveA: u128, reserveB: u128): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"dex_quote", "params":[amountA: u128, reserveA: u128, reserveB: u128] }
Eth
accounts
Returns accounts list.
Interface
api.rpc.eth.accounts(): Vec<H160>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_accounts", "params":[] }
blockNumber
Returns the blockNumber
Interface
api.rpc.eth.blockNumber(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_blockNumber", "params":[] }
call
Call contract, returning the output data.
Interface
api.rpc.eth.call(request: EthCallRequest, number?: BlockNumber): Bytes
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_call", "params":[request: EthCallRequest, number?: BlockNumber] }
chainId
Returns the chain ID used for transaction signing at the current best block. None is returned if not available.
Interface
api.rpc.eth.chainId(): U64
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_chainId", "params":[] }
coinbase
Returns block author.
Interface
api.rpc.eth.coinbase(): H160
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_coinbase", "params":[] }
estimateGas
Estimate gas needed for execution of given contract.
Interface
api.rpc.eth.estimateGas(request: EthCallRequest, number?: BlockNumber): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_estimateGas", "params":[request: EthCallRequest, number?: BlockNumber] }
feeHistory
Returns fee history for given block count & reward percentiles
Interface
api.rpc.eth.feeHistory(blockCount: U256, newestBlock: BlockNumber, rewardPercentiles: Option<Vec<f64>>): EthFeeHistory
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_feeHistory", "params":[blockCount: U256, newestBlock: BlockNumber, rewardPercentiles: Option<Vec<f64>>] }
gasPrice
Returns current gas price.
Interface
api.rpc.eth.gasPrice(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_gasPrice", "params":[] }
getBalance
Returns balance of the given account.
Interface
api.rpc.eth.getBalance(address: H160, number?: BlockNumber): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getBalance", "params":[address: H160, number?: BlockNumber] }
getBlockByHash
Returns block with given hash.
Interface
api.rpc.eth.getBlockByHash(hash: H256, full: bool): Option<EthRichBlock>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getBlockByHash", "params":[hash: H256, full: bool] }
getBlockByNumber
Returns block with given number.
Interface
api.rpc.eth.getBlockByNumber(block: BlockNumber, full: bool): Option<EthRichBlock>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getBlockByNumber", "params":[block: BlockNumber, full: bool] }
getBlockTransactionCountByHash
Returns the number of transactions in a block with given hash.
Interface
api.rpc.eth.getBlockTransactionCountByHash(hash: H256): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getBlockTransactionCountByHash", "params":[hash: H256] }
getBlockTransactionCountByNumber
Returns the number of transactions in a block with given block number.
Interface
api.rpc.eth.getBlockTransactionCountByNumber(block: BlockNumber): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getBlockTransactionCountByNumber", "params":[block: BlockNumber] }
getCode
Returns the code at given address at given time (block number).
Interface
api.rpc.eth.getCode(address: H160, number?: BlockNumber): Bytes
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getCode", "params":[address: H160, number?: BlockNumber] }
getFilterChanges
Returns filter changes since last poll.
Interface
api.rpc.eth.getFilterChanges(index: U256): EthFilterChanges
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getFilterChanges", "params":[index: U256] }
getFilterLogs
Returns all logs matching given filter (in a range 'from' - 'to').
Interface
api.rpc.eth.getFilterLogs(index: U256): Vec<EthLog>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getFilterLogs", "params":[index: U256] }
getLogs
Returns logs matching given filter object.
Interface
api.rpc.eth.getLogs(filter: EthFilter): Vec<EthLog>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getLogs", "params":[filter: EthFilter] }
getStorageAt
Returns content of the storage at given address.
Interface
api.rpc.eth.getStorageAt(address: H160, index: U256, number?: BlockNumber): H256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getStorageAt", "params":[address: H160, index: U256, number?: BlockNumber] }
getTransactionByBlockHashAndIndex
Returns transaction at given block hash and index.
Interface
api.rpc.eth.getTransactionByBlockHashAndIndex(hash: H256, index: U256): EthTransaction
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getTransactionByBlockHashAndIndex", "params":[hash: H256, index: U256] }
getTransactionByBlockNumberAndIndex
Returns transaction by given block number and index.
Interface
api.rpc.eth.getTransactionByBlockNumberAndIndex(number: BlockNumber, index: U256): EthTransaction
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getTransactionByBlockNumberAndIndex", "params":[number: BlockNumber, index: U256] }
getTransactionByHash
Get transaction by its hash.
Interface
api.rpc.eth.getTransactionByHash(hash: H256): EthTransaction
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getTransactionByHash", "params":[hash: H256] }
getTransactionCount
Returns the number of transactions sent from given address at given time (block number).
Interface
api.rpc.eth.getTransactionCount(address: H160, number?: BlockNumber): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getTransactionCount", "params":[address: H160, number?: BlockNumber] }
getTransactionReceipt
Returns transaction receipt by transaction hash.
Interface
api.rpc.eth.getTransactionReceipt(hash: H256): EthReceipt
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getTransactionReceipt", "params":[hash: H256] }
getUncleByBlockHashAndIndex
Returns an uncles at given block and index.
Interface
api.rpc.eth.getUncleByBlockHashAndIndex(hash: H256, index: U256): EthRichBlock
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getUncleByBlockHashAndIndex", "params":[hash: H256, index: U256] }
getUncleByBlockNumberAndIndex
Returns an uncles at given block and index.
Interface
api.rpc.eth.getUncleByBlockNumberAndIndex(number: BlockNumber, index: U256): EthRichBlock
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getUncleByBlockNumberAndIndex", "params":[number: BlockNumber, index: U256] }
getUncleCountByBlockHash
Returns the number of uncles in a block with given hash.
Interface
api.rpc.eth.getUncleCountByBlockHash(hash: H256): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getUncleCountByBlockHash", "params":[hash: H256] }
getUncleCountByBlockNumber
Returns the number of uncles in a block with given block number.
Interface
api.rpc.eth.getUncleCountByBlockNumber(number: BlockNumber): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getUncleCountByBlockNumber", "params":[number: BlockNumber] }
getWork
Returns the hash of the current block, the seedHash, and the boundary condition to be met.
Interface
api.rpc.eth.getWork(): EthWork
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_getWork", "params":[] }
hashrate
Returns the number of hashes per second that the node is mining with.
Interface
api.rpc.eth.hashrate(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_hashrate", "params":[] }
maxPriorityFeePerGas
Returns max priority fee per gas
Interface
api.rpc.eth.maxPriorityFeePerGas(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_maxPriorityFeePerGas", "params":[] }
mining
Returns true if client is actively mining new blocks.
Interface
api.rpc.eth.mining(): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_mining", "params":[] }
newBlockFilter
Returns id of new block filter.
Interface
api.rpc.eth.newBlockFilter(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_newBlockFilter", "params":[] }
newFilter
Returns id of new filter.
Interface
api.rpc.eth.newFilter(filter: EthFilter): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_newFilter", "params":[filter: EthFilter] }
newPendingTransactionFilter
Returns id of new block filter.
Interface
api.rpc.eth.newPendingTransactionFilter(): U256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_newPendingTransactionFilter", "params":[] }
protocolVersion
Returns protocol version encoded as a string (quotes are necessary).
Interface
api.rpc.eth.protocolVersion(): u64
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_protocolVersion", "params":[] }
sendRawTransaction
Sends signed transaction, returning its hash.
Interface
api.rpc.eth.sendRawTransaction(bytes: Bytes): H256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_sendRawTransaction", "params":[bytes: Bytes] }
sendTransaction
Sends transaction; will block waiting for signer to return the transaction hash
Interface
api.rpc.eth.sendTransaction(tx: EthTransactionRequest): H256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_sendTransaction", "params":[tx: EthTransactionRequest] }
submitHashrate
Used for submitting mining hashrate.
Interface
api.rpc.eth.submitHashrate(index: U256, hash: H256): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_submitHashrate", "params":[index: U256, hash: H256] }
submitWork
Used for submitting a proof-of-work solution.
Interface
api.rpc.eth.submitWork(nonce: H64, headerHash: H256, mixDigest: H256): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_submitWork", "params":[nonce: H64, headerHash: H256, mixDigest: H256] }
subscribe
Subscribe to Eth subscription.
Interface
api.rpc.eth.subscribe(kind: EthSubKind, params?: EthSubParams): Null
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_subscribe", "params":[kind: EthSubKind, params?: EthSubParams] }
syncing
Returns an object with data about the sync status or false.
Interface
api.rpc.eth.syncing(): EthSyncStatus
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_syncing", "params":[] }
uninstallFilter
Uninstalls filter.
Interface
api.rpc.eth.uninstallFilter(index: U256): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"eth_uninstallFilter", "params":[index: U256] }
Ethy
getEventProof
Get ETH event proof for event Id
Interface
api.rpc.ethy.getEventProof(eventId: EventProofId): Option<EthEventProofResponse>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"ethy_getEventProof", "params":[eventId: EventProofId] }
getXrplTxProof
Get XRPL event proof for event Id
Interface
api.rpc.ethy.getXrplTxProof(eventId: EventProofId): Option<XrplEventProofResponse>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"ethy_getXrplTxProof", "params":[eventId: EventProofId] }
Grandpa
proveFinality
Prove finality for the given block number, returning the Justification for the last block in the set.
Interface
api.rpc.grandpa.proveFinality(blockNumber: BlockNumber): Option<EncodedFinalityProofs>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_proveFinality", "params":[blockNumber: BlockNumber] }
roundState
Returns the state of the current best round state as well as the ongoing background rounds
Interface
api.rpc.grandpa.roundState(): ReportedRoundStates
JSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_roundState", "params":[] }
subscribeJustifications
Subscribes to grandpa justifications
Interface
api.rpc.grandpa.subscribeJustifications(): JustificationNotification
JSON
{ "id":1, "jsonrpc":"2.0", "method":"grandpa_subscribeJustifications", "params":[] }
Net
listening
Returns true if client is actively listening for network connections. Otherwise false.
Interface
api.rpc.net.listening(): bool
JSON
{ "id":1, "jsonrpc":"2.0", "method":"net_listening", "params":[] }
peerCount
Returns number of peers connected to node.
Interface
api.rpc.net.peerCount(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"net_peerCount", "params":[] }
version
Returns protocol version.
Interface
api.rpc.net.version(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"net_version", "params":[] }
Nft
ownedTokens
Get all NFTs owned by an account
Interface
api.rpc.nft.ownedTokens(collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"nft_ownedTokens", "params":[collectionId: CollectionUuid, who: AccountId, cursor: SerialNumber, limit: u16] }
tokenUri
Get the URI of a token
Interface
api.rpc.nft.tokenUri(tokenId: TokenId): Json
JSON
{ "id":1, "jsonrpc":"2.0", "method":"nft_tokenUri", "params":[tokenId: TokenId] }
Offchain
localStorageGet
Get offchain local storage under given key and prefix
This method is only active with appropriate flags
Interface
api.rpc.offchain.localStorageGet(kind: StorageKind, key: Bytes): Option<Bytes>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"offchain_localStorageGet", "params":[kind: StorageKind, key: Bytes] }
localStorageSet
Set offchain local storage under given key and prefix
This method is only active with appropriate flags
Interface
api.rpc.offchain.localStorageSet(kind: StorageKind, key: Bytes, value: Bytes): Null
JSON
{ "id":1, "jsonrpc":"2.0", "method":"offchain_localStorageSet", "params":[kind: StorageKind, key: Bytes, value: Bytes] }
Payment
queryFeeDetails
Query the detailed fee of a given encoded extrinsic
Interface
api.rpc.payment.queryFeeDetails(extrinsic: Bytes, at?: BlockHash): FeeDetails
JSON
{ "id":1, "jsonrpc":"2.0", "method":"payment_queryFeeDetails", "params":[extrinsic: Bytes, at?: BlockHash] }
Deprecated Use api.call.transactionPaymentApi.queryFeeDetails
instead
queryInfo
Retrieves the fee information for an encoded extrinsic
Interface
api.rpc.payment.queryInfo(extrinsic: Bytes, at?: BlockHash): RuntimeDispatchInfoV1
JSON
{ "id":1, "jsonrpc":"2.0", "method":"payment_queryInfo", "params":[extrinsic: Bytes, at?: BlockHash] }
Deprecated Use api.call.transactionPaymentApi.queryInfo
instead
Rpc
methods
Retrieves the list of RPC methods that are exposed by the node
Interface
api.rpc.rpc.methods(): RpcMethods
JSON
{ "id":1, "jsonrpc":"2.0", "method":"rpc_methods", "params":[] }
State
call
Perform a call to a builtin on the chain
Interface
api.rpc.state.call(method: Text, data: Bytes, at?: BlockHash): Bytes
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_call", "params":[method: Text, data: Bytes, at?: BlockHash] }
getChildReadProof
Returns proof of storage for child key entries at a specific block state.
Interface
api.rpc.state.getChildReadProof(childStorageKey: PrefixedStorageKey, keys: Vec<StorageKey>, at?: BlockHash): ReadProof
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getChildReadProof", "params":[childStorageKey: PrefixedStorageKey, keys: Vec<StorageKey>, at?: BlockHash] }
getKeys
Retrieves the keys with a certain prefix
Interface
api.rpc.state.getKeys(key: StorageKey, at?: BlockHash): Vec<StorageKey>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getKeys", "params":[key: StorageKey, at?: BlockHash] }
Deprecated Use api.rpc.state.getKeysPaged
to retrieve keys
getKeysPaged
Returns the keys with prefix with pagination support.
Interface
api.rpc.state.getKeysPaged(key: StorageKey, count: u32, startKey?: StorageKey, at?: BlockHash): Vec<StorageKey>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getKeysPaged", "params":[key: StorageKey, count: u32, startKey?: StorageKey, at?: BlockHash] }
getMetadata
Returns the runtime metadata
Interface
api.rpc.state.getMetadata(at?: BlockHash): Metadata
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getMetadata", "params":[at?: BlockHash] }
getPairs
Returns the keys with prefix, leave empty to get all the keys (deprecated: Use getKeysPaged)
This method is only active with appropriate flags
Interface
api.rpc.state.getPairs(prefix: StorageKey, at?: BlockHash): Vec<KeyValue>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getPairs", "params":[prefix: StorageKey, at?: BlockHash] }
Deprecated Use api.rpc.state.getKeysPaged
to retrieve keys
getReadProof
Returns proof of storage entries at a specific block state
Interface
api.rpc.state.getReadProof(keys: Vec<StorageKey>, at?: BlockHash): ReadProof
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getReadProof", "params":[keys: Vec<StorageKey>, at?: BlockHash] }
getRuntimeVersion
Get the runtime version
Interface
api.rpc.state.getRuntimeVersion(at?: BlockHash): RuntimeVersion
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getRuntimeVersion", "params":[at?: BlockHash] }
getStorage
Retrieves the storage for a key
Interface
api.rpc.state.getStorage(key: StorageKey, at?: BlockHash): StorageData
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getStorage", "params":[key: StorageKey, at?: BlockHash] }
getStorageHash
Retrieves the storage hash
Interface
api.rpc.state.getStorageHash(key: StorageKey, at?: BlockHash): Hash
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getStorageHash", "params":[key: StorageKey, at?: BlockHash] }
getStorageSize
Retrieves the storage size
Interface
api.rpc.state.getStorageSize(key: StorageKey, at?: BlockHash): u64
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_getStorageSize", "params":[key: StorageKey, at?: BlockHash] }
queryStorage
Query historical storage entries (by key) starting from a start block
This method is only active with appropriate flags
Interface
api.rpc.state.queryStorage(keys: Vec<StorageKey>, fromBlock: Hash, toBlock?: BlockHash): Vec<StorageChangeSet>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_queryStorage", "params":[keys: Vec<StorageKey>, fromBlock: Hash, toBlock?: BlockHash] }
queryStorageAt
Query storage entries (by key) starting at block hash given as the second parameter
Interface
api.rpc.state.queryStorageAt(keys: Vec<StorageKey>, at?: BlockHash): Vec<StorageChangeSet>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_queryStorageAt", "params":[keys: Vec<StorageKey>, at?: BlockHash] }
subscribeRuntimeVersion
Retrieves the runtime version via subscription
Interface
api.rpc.state.subscribeRuntimeVersion(): RuntimeVersion
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_subscribeRuntimeVersion", "params":[] }
subscribeStorage
Subscribes to storage changes for the provided keys
Interface
api.rpc.state.subscribeStorage(keys?: Vec<StorageKey>): StorageChangeSet
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_subscribeStorage", "params":[keys?: Vec<StorageKey>] }
traceBlock
Provides a way to trace the re-execution of a single block
This method is only active with appropriate flags
Interface
api.rpc.state.traceBlock(block: Hash, targets: Option<Text>, storageKeys: Option<Text>, methods: Option<Text>): TraceBlockResponse
JSON
{ "id":1, "jsonrpc":"2.0", "method":"state_traceBlock", "params":[block: Hash, targets: Option<Text>, storageKeys: Option<Text>, methods: Option<Text>] }
System
accountNextIndex
Retrieves the next accountIndex as available on the node
Interface
api.rpc.system.accountNextIndex(accountId: AccountId): Index
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_accountNextIndex", "params":[accountId: AccountId] }
addLogFilter
Adds the supplied directives to the current log filter
This method is only active with appropriate flags
Interface
api.rpc.system.addLogFilter(directives: Text): Null
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_addLogFilter", "params":[directives: Text] }
addReservedPeer
Adds a reserved peer
This method is only active with appropriate flags
Interface
api.rpc.system.addReservedPeer(peer: Text): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_addReservedPeer", "params":[peer: Text] }
chain
Retrieves the chain
Interface
api.rpc.system.chain(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_chain", "params":[] }
chainType
Retrieves the chain type
Interface
api.rpc.system.chainType(): ChainType
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_chainType", "params":[] }
dryRun
Dry run an extrinsic at a given block
This method is only active with appropriate flags
Interface
api.rpc.system.dryRun(extrinsic: Bytes, at?: BlockHash): ApplyExtrinsicResult
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_dryRun", "params":[extrinsic: Bytes, at?: BlockHash] }
health
Return health status of the node
Interface
api.rpc.system.health(): Health
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_health", "params":[] }
localListenAddresses
The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example
Interface
api.rpc.system.localListenAddresses(): Vec<Text>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_localListenAddresses", "params":[] }
localPeerId
Returns the base58-encoded PeerId of the node
Interface
api.rpc.system.localPeerId(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_localPeerId", "params":[] }
name
Retrieves the node name
Interface
api.rpc.system.name(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_name", "params":[] }
nodeRoles
Returns the roles the node is running as
Interface
api.rpc.system.nodeRoles(): Vec<NodeRole>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_nodeRoles", "params":[] }
peers
Returns the currently connected peers
This method is only active with appropriate flags
Interface
api.rpc.system.peers(): Vec<PeerInfo>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_peers", "params":[] }
properties
Get a custom set of properties as a JSON object, defined in the chain spec
Interface
api.rpc.system.properties(): ChainProperties
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_properties", "params":[] }
removeReservedPeer
Remove a reserved peer
This method is only active with appropriate flags
Interface
api.rpc.system.removeReservedPeer(peerId: Text): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_removeReservedPeer", "params":[peerId: Text] }
reservedPeers
Returns the list of reserved peers
Interface
api.rpc.system.reservedPeers(): Vec<Text>
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_reservedPeers", "params":[] }
resetLogFilter
Resets the log filter to Substrate defaults
This method is only active with appropriate flags
Interface
api.rpc.system.resetLogFilter(): Null
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_resetLogFilter", "params":[] }
syncState
Returns the state of the syncing of the node
Interface
api.rpc.system.syncState(): SyncState
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_syncState", "params":[] }
version
Retrieves the version of the node
Interface
api.rpc.system.version(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"system_version", "params":[] }
Web3
clientVersion
Returns current client version.
Interface
api.rpc.web3.clientVersion(): Text
JSON
{ "id":1, "jsonrpc":"2.0", "method":"web3_clientVersion", "params":[] }
sha3
Returns sha3 of the given data
Interface
api.rpc.web3.sha3(data: Bytes): H256
JSON
{ "id":1, "jsonrpc":"2.0", "method":"web3_sha3", "params":[data: Bytes] }