When using the solana-rpc-client in Rust to retrieve a transaction, the output is EncodedTransactionWithStatusMeta.
The metadata includes the following struct:
pub struct UiTransactionTokenBalance {
pub account_index: u8,
pub mint: String,
pub ui_token_amount: UiTokenAmount,
pub owner: OptionSerializer<String>,
pub program_id: OptionSerializer<String>,
}
I'm wondering how to convert the account_index
field (see UiTransactionTokenBalance into an address. Is this possible using just the transaction metadata, for example, by using loaded_addresses
(refer to UiTransactionStatusMeta
), or is it necessary to decode the transaction data?
Additionally, is there a way to obtain TransactionWithStatusMeta
using the JSON RPC API or another protocol? What would be much pleasant to use.