Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Commit

Permalink
Skip serializing empty fields
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyera Eulberg committed Sep 6, 2022
1 parent 2b76925 commit 6e13229
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/src/developing/clients/jsonrpc-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ The result field will be an object with the following fields:
- `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|null>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not enabled during this transaction
- `innerInstructions: <array|undefined>` - List of [inner instructions](#inner-instructions-structure) or `null` if inner instruction recording was not 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|null>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- `logMessages: <array|undefined>` - array of string log messages or `null` if log message recording was not enabled during this transaction
- DEPRECATED: `status: <object>` - Transaction status
- `"Ok": <null>` - Transaction was successful
- `"Err": <ERR>` - Transaction failed with TransactionError
Expand All @@ -445,7 +445,7 @@ The result field will be an object with the following fields:
- `readonly: <array[string]>` - Ordered list of base-58 encoded addresses for readonly loaded accounts
- `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>` - present if rewards are requested; an array of JSON objects containing:
- `rewards: <array|undefined>` - present if rewards are requested; an array of JSON objects containing:
- `pubkey: <string>` - The public key, as base-58 encoded string, of the account that received the reward
- `lamports: <i64>`- number of reward lamports credited or debited by the account, as a i64
- `postBalance: <u64>` - account balance in lamports after the reward was applied
Expand Down
4 changes: 4 additions & 0 deletions transaction-status/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,17 @@ pub struct UiTransactionStatusMeta {
pub fee: u64,
pub pre_balances: Vec<u64>,
pub post_balances: Vec<u64>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub inner_instructions: Option<Vec<UiInnerInstructions>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub log_messages: Option<Vec<String>>,
pub pre_token_balances: Option<Vec<UiTransactionTokenBalance>>,
pub post_token_balances: Option<Vec<UiTransactionTokenBalance>>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub rewards: Option<Rewards>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub loaded_addresses: Option<UiLoadedAddresses>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub return_data: Option<TransactionReturnData>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub compute_units_consumed: Option<u64>,
Expand Down

0 comments on commit 6e13229

Please sign in to comment.