RPC documentation updates for token deltas / blockTimes in getConfirmedSignatures2/getConfirmedTransaction (#14871)

* docs: add token balances response info

* docs: add blockTime to getConfirmedSignatures and getConfirmedTransaction

* docs: update example responses

* fix: remove space
This commit is contained in:
Josh 2021-01-27 16:15:37 -08:00 committed by GitHub
parent 5594a7122d
commit 6b8e710988
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 28 additions and 1 deletions

View File

@ -486,6 +486,8 @@ The result field will be an object with the following fields:
- `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
- `innerInstructions: <array|undefined>` - List of [inner instructions](#inner-instructions-structure) or omitted if inner instruction recording was not yet enabled during this transaction
- `preTokenBalances: <array|undefined>` - 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: <array|undefined>` - 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>` - array of string log messages or omitted if log message recording was not yet enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - 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: <array[number]>` - List of ordered indices into the `message.accountKeys` array indicating which accounts to pass to the program.
- `data: <string>` - 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: <number>` - Index of the account in which the token balance is provided for.
- `mint: <string>` - Pubkey of the token's mint.
- `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>` - 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: <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/master/sdk/src/transaction.rs#L24)
* `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:
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
- `<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://github.com/solana-labs/solana/blob/master/sdk/src/transaction.rs#L24)
- `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
- `innerInstructions: <array|undefined>` - List of [inner instructions](#inner-instructions-structure) or omitted if inner instruction recording was not yet enabled during this transaction
- `preTokenBalances: <array|undefined>` - 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: <array|undefined>` - 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>` - array of string log messages or omitted if log message recording was not yet enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - 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
}