Skip to main content
1 of 2
Nondi
  • 15
  • 3

How to parse changes of the balances in json of a TX?

I sent 0.13 SOL from one ordinary wallet to other. There's been no interraction with a smart contract, nor was it a token but SOL sent.

Here's a part of a TX in its raw form which I've obtained via API:

"preBalances" => [
    9997940920,
    0,
    1,
    1
], 

"preTokenBalances" => [],

"postBalances" => [
    9867934320,
    130000000,
    1,
    1
], 
"postTokenBalances" => [], 
  • Why are there 4 items in the preBalances and postBalances instead of 1?

  • Although it's clear that one look at 130000000 as the new balance, why is this particular element? How to determine this?

Nondi
  • 15
  • 3