Skip to main content
added 132 characters in body
Source Link
Nondi
  • 15
  • 3

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?

What I need: given the address of a wallet, check whether it's been deposited any SOL or tokens on. In this particular case SOL

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?

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?

What I need: given the address of a wallet, check whether it's been deposited any SOL or tokens on. In this particular case SOL

Source Link
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?