RPC Chain commands
chain/estimateFeeRate
Estimates fee given an optional priority
Request
{ priority: 'slow' | 'average' | 'fast' } | undefined
Response
{ rate: string }
chain/estimateFeeRates
Estimates fee rates for all priorities
Request
undefined
Response
{ slow: string average: string fast: string }
chain/exportChainStream
Exports the chain as a stream with an optional sequence range
Request
{ start?: number | null stop?: number | null } | undefined
Response
{ start: number stop: number block?: { hash: string seq: number prev: string main: boolean graffiti: string timestamp: number work: string difficulty: string head: boolean latest: boolean } }
chain/followChainStream
Follows the chain from a given sequence and streams blocks from chain connects and disconnects
Request
{ head?: string | null } | undefined
Response
{ type: 'connected' | 'disconnected' | 'fork' head: { sequence: number } block: { hash: string sequence: number previous: string graffiti: string difficulty: string size: number timestamp: number work: string main: boolean transactions: Array<{ hash: string size: number fee: number notes: Array<{ commitment: string }> spends: Array<{ nullifier: string }> mints: Array<{ id: string metadata: string name: string owner: string value: string }> burns: Array<{ id: string value: string }> }> } }
chain/getAsset
Gets an asset from the blockchain from an identifier
Request
{ id: string }
Response
{ createdTransactionHash: string id: string metadata: string name: string owner: string supply: string }
chain/getBlock
Gets a block from the chain from a hash or sequence
Request
{ search?: string hash?: string sequence?: number confirmations?: number }
Response
{ block: { graffiti: string difficulty: string hash: string previousBlockHash: string sequence: number timestamp: number transactions: Array<{ fee: string hash: string signature: string notes: number spends: number }> } metadata: { main: boolean confirmed: boolean } }
chain/getChainInfo
Gets information about the node's chain
Request
undefined
Response
{ currentBlockIdentifier: { index: string hash: string } genesisBlockIdentifier: { index: string hash: string } oldestBlockIdentifier: { index: string hash: string } currentBlockTimestamp: number }
chain/getConsensusParameters
Gets consensus parameters from the chain
Request
undefined
Response
{ allowedBlockFuturesSeconds: number genesisSupplyInIron: number targetBlockTimeInSeconds: number targetBucketTimeInSeconds: number maxBlockSizeBytes: number }
chain/getDifficulty
Gets block difficulty from a given sequence or the head
Request
{ sequence?: number | null } | undefined
Response
{ sequence: number hash: string difficulty: string }
chain/getNetworkHashPower
Gets hash power from the chain from a sequence or block range
Request
{ blocks?: number | null sequence?: number | null }
Response
{ hashesPerSecond: number blocks: number sequence: number }
chain/getNetworkInfo
Get information about the node's network
Request
undefined
Response
{ networkId: number }
chain/getTransaction
Gets a transaction from a block hash and transaction hash
Request
{ blockHash: string transactionHash: string }
Response
{ fee: string expiration: number notesCount: number spendsCount: number signature: string notesEncrypted: string[] mints: { assetId: string value: string }[] burns: { assetId: string value: string }[] }
chain/getTransactionStream
Streams transactions from a head sequence given an incoming view key
Request
{ incomingViewKey: string head?: string | null }
Response
{ type: 'connected' | 'disconnected' | 'fork' head: { sequence: number } block: { hash: string previousBlockHash: string sequence: number timestamp: number } transactions: { hash: string isMinersFee: boolean notes: { assetId: string assetName: string value: string memo: string }[] mints: { assetId: string assetName: string value: string }[] burns: { assetId: string assetName: string value: string }[] }[] }
chain/showChain
Renders the chain from an optional sequence range
Request
{ start?: number | null stop?: number | null } | undefined
Response
{ content: string[] }
chain/getNoteWitness
Returns a witness (merkle path) to a specified note in the note merkle tree. This witness is necessary for creating a transaction that spends the note. This endpoint would primarily be used to construct transactions without using the Iron Fish wallet. The returned treeSize
and rootHash
values will always reference the note merkle tree state at the current HEAD of the chain. If the chain experiences a re-org and the referenced HEAD moves to a fork, this witness will no longer be usable in a transaction.
Request
{ index: number }
Response
{ treeSize: number rootHash: string authPath: { side: 'Left' | 'Right' hashOfSibling: string }[] }