diff --git a/docs/src/developing/clients/jsonrpc-api.md b/docs/src/developing/clients/jsonrpc-api.md index 4613e2154a..9860511f31 100644 --- a/docs/src/developing/clients/jsonrpc-api.md +++ b/docs/src/developing/clients/jsonrpc-api.md @@ -486,6 +486,8 @@ The result field will be an object with the following fields: - `preBalances: ` - array of u64 account balances from before the transaction was processed - `postBalances: ` - array of u64 account balances after the transaction was processed - `innerInstructions: ` - List of [inner instructions](#inner-instructions-structure) or omitted if inner instruction recording was not yet enabled during this transaction + - `preTokenBalances: ` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction + - `postTokenBalances: ` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction - `logMessages: ` - array of string log messages or omitted if log message recording was not yet enabled during this transaction - DEPRECATED: `status: ` - Transaction status - `"Ok": ` - Transaction was successful @@ -530,6 +532,7 @@ Result: 1, 1 ], + "postTokenBalances": [], "preBalances": [ 499998937500, 26858640, @@ -537,6 +540,7 @@ Result: 1, 1 ], + "preTokenBalances": [], "status": { "Ok": null } @@ -612,6 +616,7 @@ Result: 1, 1 ], + "postTokenBalances": [], "preBalances": [ 499998937500, 26858640, @@ -619,6 +624,7 @@ Result: 1, 1 ], + "preTokenBalances": [], "status": { "Ok": null } @@ -665,6 +671,17 @@ The JSON structure of inner instructions is defined as a list of objects in the - `accounts: ` - List of ordered indices into the `message.accountKeys` array indicating which accounts to pass to the program. - `data: ` - The program input data encoded in a base-58 string. +#### Token Balances Structure + +The JSON structure of token balances is defined as a list of objects in the following structure: + +- `accountIndex: ` - Index of the account in which the token balance is provided for. +- `mint: ` - Pubkey of the token's mint. +- `uiTokenAmount: ` - + - `amount: ` - Raw amount of tokens as a string, ignoring decimals. + - `decimals: ` - Number of decimals configured for token's mint. + - `uiAmount: ` - Token amount as a float, accounting for decimals. + ### getConfirmedBlocks Returns a list of confirmed blocks between two slots @@ -796,6 +813,7 @@ from newest to oldest transaction: * `slot: ` - The slot that contains the block with the transaction * `err: ` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L24) * `memo: ` - Memo associated with the transaction, null if no memo is present + * `blockTime: ` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when transaction was processed. null if not available. #### Example: Request: @@ -824,7 +842,8 @@ Result: "err": null, "memo": null, "signature": "5h6xBEauJ3PK6SWCZ1PGjBvj8vDdWG3KpwATGy1ARAXFSDwt8GFXM7W5Ncn16wmqokgpiKRLuS83KUxyZyv2sUYv", - "slot": 114 + "slot": 114, + "blockTime": null } ], "id": 1 @@ -847,12 +866,15 @@ N encoding attempts to use program-specific instruction parsers to return more h - `` - if transaction is confirmed, an object with the following fields: - `slot: ` - the slot this transaction was processed in - `transaction: ` - [Transaction](#transaction-structure) object, either in JSON format or encoded binary data, depending on encoding parameter + - `blockTime: ` - estimated production time, as Unix timestamp (seconds since the Unix epoch) of when the transaction was processed. null if not available - `meta: ` - transaction status metadata object: - `err: ` - Error if transaction failed, null if transaction succeeded. [TransactionError definitions](https://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L24) - `fee: ` - fee this transaction was charged, as u64 integer - `preBalances: ` - array of u64 account balances from before the transaction was processed - `postBalances: ` - array of u64 account balances after the transaction was processed - `innerInstructions: ` - List of [inner instructions](#inner-instructions-structure) or omitted if inner instruction recording was not yet enabled during this transaction + - `preTokenBalances: ` - List of [token balances](#token-balances-structure) from before the transaction was processed or omitted if token balance recording was not yet enabled during this transaction + - `postTokenBalances: ` - List of [token balances](#token-balances-structure) from after the transaction was processed or omitted if token balance recording was not yet enabled during this transaction - `logMessages: ` - array of string log messages or omitted if log message recording was not yet enabled during this transaction - DEPRECATED: `status: ` - Transaction status - `"Ok": ` - Transaction was successful @@ -890,6 +912,7 @@ Result: 1, 1 ], + "postTokenBalances": [], "preBalances": [ 499998937500, 26858640, @@ -897,6 +920,7 @@ Result: 1, 1 ], + "preTokenBalances": [], "status": { "Ok": null } @@ -935,6 +959,7 @@ Result: ] } }, + "blockTime": null, "id": 1 } ``` @@ -971,6 +996,7 @@ Result: 1, 1 ], + "postTokenBalances": [], "preBalances": [ 499998937500, 26858640, @@ -978,6 +1004,7 @@ Result: 1, 1 ], + "preTokenBalances": [], "status": { "Ok": null }