Add missing fields to JSON-RPC docs (#27964)

* Add docs for computeUnitsConsumed field

* Add confirmationStatus to getSignaturesForAddress response docs

* Make field-type formatting consistent
This commit is contained in:
Tyera Eulberg 2022-09-21 11:59:30 -06:00 committed by GitHub
parent 5d7130623f
commit fa0550da32
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 49 additions and 46 deletions

View File

@ -429,7 +429,7 @@ The result field will be an object with the following fields:
- `transactions: <array>` - present if "full" transaction details are requested; an array of JSON objects containing:
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `meta: <object>` - transaction status metadata object, containing `null` or:
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
@ -452,6 +452,7 @@ The result field will be an object with the following fields:
- `returnData: <object|undefined>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>`, the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>`, the return data itself, as base-64 encoded binary data
- `computeUnitsConsumed: <u64|undefined>`, number of [compute units](developing/programming-model/runtime.md#compute-budget) consumed by the transaction
- `version: <"legacy"|number|undefined>` - Transaction version. Undefined if `maxSupportedTransactionVersion` is not set in request params.
- `signatures: <array>` - present if "signatures" are requested for transaction details; an array of signatures strings, corresponding to the transaction order in the block
- `rewards: <array|undefined>` - block-level rewards, present if rewards are requested; an array of JSON objects containing:
@ -460,8 +461,8 @@ The result field will be an object with the following fields:
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
- `blockHeight: <u64 | null>` - the number of blocks beneath this block
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
- `blockHeight: <u64|null>` - the number of blocks beneath this block
#### Example:
@ -624,12 +625,12 @@ The JSON structure of token balances is defined as a list of objects in the foll
- `accountIndex: <number>` - Index of the account in which the token balance is provided for.
- `mint: <string>` - Pubkey of the token's mint.
- `owner: <string | undefined>` - Pubkey of token balance's owner.
- `programId: <string | undefined>` - Pubkey of the Token program that owns the account.
- `owner: <string|undefined>` - Pubkey of token balance's owner.
- `programId: <string|undefined>` - Pubkey of the Token program that owns the account.
- `uiTokenAmount: <object>` -
- `amount: <string>` - Raw amount of tokens as a string, ignoring decimals.
- `decimals: <number>` - Number of decimals configured for token's mint.
- `uiAmount: <number | null>` - Token amount as a float, accounting for decimals. **DEPRECATED**
- `uiAmount: <number|null>` - Token amount as a float, accounting for decimals. **DEPRECATED**
- `uiAmountString: <string>` - Token amount as a string, accounting for decimals.
### getBlockHeight
@ -921,12 +922,12 @@ None
The result field will be an array of JSON objects, each with the following sub fields:
- `pubkey: <string>` - Node public key, as base-58 encoded string
- `gossip: <string | null>` - Gossip network address for the node
- `tpu: <string | null>` - TPU network address for the node
- `rpc: <string | null>` - JSON RPC network address for the node, or `null` if the JSON RPC service is not enabled
- `version: <string | null>` - The software version of the node, or `null` if the version information is not available
- `featureSet: <u32 | null >` - The unique identifier of the node's feature set
- `shredVersion: <u16 | null>` - The shred version the node has been configured to use
- `gossip: <string|null>` - Gossip network address for the node
- `tpu: <string|null>` - TPU network address for the node
- `rpc: <string|null>` - JSON RPC network address for the node, or `null` if the JSON RPC service is not enabled
- `version: <string|null>` - The software version of the node, or `null` if the version information is not available
- `featureSet: <u32|null >` - The unique identifier of the node's feature set
- `shredVersion: <u16|null>` - The shred version the node has been configured to use
#### Example:
@ -975,7 +976,7 @@ The result field will be an object with the following fields:
- `epoch: <u64>`, the current epoch
- `slotIndex: <u64>`, the current slot relative to the start of the current epoch
- `slotsInEpoch: <u64>`, the number of slots in this epoch
- `transactionCount: <u64 | null>`, total number of transactions processed without error since genesis
- `transactionCount: <u64|null>`, total number of transactions processed without error since genesis
#### Example:
@ -1064,7 +1065,7 @@ Get the fee the network will charge for a particular Message
#### Results:
- `<u64 | null>` - Fee corresponding to the message at the specified blockhash
- `<u64|null>` - Fee corresponding to the message at the specified blockhash
#### Example:
@ -1240,7 +1241,7 @@ None
- `<object>`
- `full: <u64>` - Highest full snapshot slot
- `incremental: <u64 | undefined>` - Highest incremental snapshot slot _based on_ `full`
- `incremental: <u64|undefined>` - Highest incremental snapshot slot _based on_ `full`
#### Example:
@ -2198,9 +2199,10 @@ from newest to oldest transaction:
- `<object>`
- `signature: <string>` - transaction signature as base-58 encoded string
- `slot: <u64>` - The slot that contains the block with the transaction
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `memo: <string |null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `memo: <string|null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
- `confirmationStatus: <string|null>` - The transaction's cluster confirmation status; either `processed`, `confirmed`, or `finalized`. See [Commitment](jsonrpc-api.md#configuring-state-commitment) for more on optimistic confirmation.
#### Example:
@ -2264,9 +2266,9 @@ An array of:
- `<null>` - Unknown transaction
- `<object>`
- `slot: <u64>` - The slot the transaction was processed
- `confirmations: <usize | null>` - Number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the cluster
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `confirmationStatus: <string | null>` - The transaction's cluster confirmation status; either `processed`, `confirmed`, or `finalized`. See [Commitment](jsonrpc-api.md#configuring-state-commitment) for more on optimistic confirmation.
- `confirmations: <usize|null>` - Number of blocks since signature confirmation, null if rooted, as well as finalized by a supermajority of the cluster
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `confirmationStatus: <string|null>` - The transaction's cluster confirmation status; either `processed`, `confirmed`, or `finalized`. See [Commitment](jsonrpc-api.md#configuring-state-commitment) for more on optimistic confirmation.
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
@ -2661,7 +2663,7 @@ The result will be an RpcResponse JSON object with `value` equal to a JSON objec
- `amount: <string>` - the raw balance without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number | null>` - the balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmount: <number|null>` - the balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the balance as a string, using mint-prescribed decimals
For more details on returned data: The
@ -2927,7 +2929,7 @@ The result will be an RpcResponse JSON object with `value` equal to an array of
- `address: <string>` - the address of the token account
- `amount: <string>` - the raw token account balance without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number | null>` - the token account balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmount: <number|null>` - the token account balance, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the token account balance as a string, using mint-prescribed decimals
#### Example:
@ -2984,7 +2986,7 @@ The result will be an RpcResponse JSON object with `value` equal to a JSON objec
- `amount: <string>` - the raw total token supply without decimals, a string representation of u64
- `decimals: <u8>` - number of base 10 digits to the right of the decimal place
- `uiAmount: <number | null>` - the total token supply, using mint-prescribed decimals **DEPRECATED**
- `uiAmount: <number|null>` - the total token supply, using mint-prescribed decimals **DEPRECATED**
- `uiAmountString: <string>` - the total token supply as a string, using mint-prescribed decimals
#### Example:
@ -3034,9 +3036,9 @@ Returns transaction details for a confirmed transaction
- `<object>` - if transaction is confirmed, an object with the following fields:
- `slot: <u64>` - the slot this transaction was processed in
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object | null>` - transaction status metadata object:
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object|null>` - transaction status metadata object:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
@ -3059,6 +3061,7 @@ Returns transaction details for a confirmed transaction
- `returnData: <object|undefined>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>`, the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>`, the return data itself, as base-64 encoded binary data
- `computeUnitsConsumed: <u64|undefined>`, number of [compute units](developing/programming-model/runtime.md#compute-budget) consumed by the transaction
- `version: <"legacy"|number|undefined>` - Transaction version. Undefined if `maxSupportedTransactionVersion` is not set in request params.
#### Example:
@ -3564,9 +3567,9 @@ Simulate sending a transaction
An RpcResponse containing a TransactionStatus object
The result will be an RpcResponse JSON object with `value` set to a JSON object with the following fields:
- `err: <object | string | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array | null>` - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
- `accounts: <array | null>` - array of accounts with the same length as the `accounts.addresses` array in the request
- `err: <object|string|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array|null>` - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
- `accounts: <array|null>` - array of accounts with the same length as the `accounts.addresses` array in the request
- `<null>` - if the account doesn't exist or if `err` is not null
- `<object>` - otherwise, a JSON object containing:
- `lamports: <u64>`, number of lamports assigned to this account, as a u64
@ -3574,8 +3577,8 @@ The result will be an RpcResponse JSON object with `value` set to a JSON object
- `data: <[string, encoding]|object>`, data associated with the account, either as encoded binary data or JSON format `{<program>: <state>}`, depending on encoding parameter
- `executable: <bool>`, boolean indicating if the account contains a program \(and is strictly read-only\)
- `rentEpoch: <u64>`, the epoch at which this account will next owe rent, as u64
- `unitsConsumed: <u64 | undefined>`, The number of compute budget units consumed during the processing of this transaction
- `returnData: <object | null>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `unitsConsumed: <u64|undefined>`, The number of compute budget units consumed during the processing of this transaction
- `returnData: <object|null>` - the most-recent return data generated by an instruction in the transaction, with the following fields:
- `programId: <string>`, the program that generated the return data, as base-58 encoded Pubkey
- `data: <[string, encoding]>`, the return data itself, as base-64 encoded binary data
@ -3845,8 +3848,8 @@ The notification will be an object with the following fields:
-`slot: <u64>` - The corresponding slot.
- `err: <object | null>` - Error if something went wrong publishing the notification otherwise null.
- `block: <object | null>` - A block object as seen in the [getBlock](jsonrpc-api.md#getblock) RPC HTTP method.
- `err: <object|null>` - Error if something went wrong publishing the notification otherwise null.
- `block: <object|null>` - A block object as seen in the [getBlock](jsonrpc-api.md#getblock) RPC HTTP method.
```json
{
@ -4129,8 +4132,8 @@ Result:
The notification will be an RpcResponse JSON object with value equal to:
- `signature: <string>` - The transaction signature base58 encoded.
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array | null>` - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `logs: <array|null>` - Array of log messages the transaction instructions output during execution, null if simulation failed before the transaction was able to execute (for example due to an invalid blockhash or signature verification failure)
Example:
@ -4401,7 +4404,7 @@ Result:
The notification will be an RpcResponse JSON object with value containing an object with:
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
Example:
@ -4724,7 +4727,7 @@ The notification will be an object with the following fields:
- `hash: <string>` - The vote hash
- `slots: <array>` - The slots covered by the vote, as an array of u64 integers
- `timestamp: <i64 | null>` - The timestamp of the vote
- `timestamp: <i64|null>` - The timestamp of the vote
- `signature: <string>` - The signature of the transaction that contained this vote
```json
@ -4799,7 +4802,7 @@ The result field will be an object with the following fields:
- `transactions: <array>` - present if "full" transaction details are requested; an array of JSON objects containing:
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `meta: <object>` - transaction status metadata object, containing `null` or:
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed
@ -4817,7 +4820,7 @@ The result field will be an object with the following fields:
- `postBalance: <u64>` - account balance in lamports after the reward was applied
- `rewardType: <string|undefined>` - type of reward: "fee", "rent", "voting", "staking"
- `commission: <u8|undefined>` - vote account commission when the reward was credited, only present for voting and staking rewards
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch). null if not available
#### Example:
@ -5038,9 +5041,9 @@ from newest to oldest transaction:
- `<object>`
- `signature: <string>` - transaction signature as base-58 encoded string
- `slot: <u64>` - The slot that contains the block with the transaction
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `memo: <string |null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/c0c60386544ec9a9ec7119229f37386d9f070523/sdk/src/transaction/error.rs#L13)
- `memo: <string|null>` - Memo associated with the transaction, null if no memo is present
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available.
#### Example:
@ -5101,9 +5104,9 @@ Returns transaction details for a confirmed transaction
- `<object>` - if transaction is confirmed, an object with the following fields:
- `slot: <u64>` - the slot this transaction was processed in
- `transaction: <object|[string,encoding]>` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter
- `blockTime: <i64 | null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object | null>` - transaction status metadata object:
- `err: <object | null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `blockTime: <i64|null>` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available
- `meta: <object|null>` - transaction status metadata object:
- `err: <object|null>` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://docs.rs/solana-sdk/VERSION_FOR_DOCS_RS/solana_sdk/transaction/enum.TransactionError.html)
- `fee: <u64>` - fee this transaction was charged, as u64 integer
- `preBalances: <array>` - array of u64 account balances from before the transaction was processed
- `postBalances: <array>` - array of u64 account balances after the transaction was processed