rpcpool / yellowstone-faithful

Project Yellowstone Old Faithful is the project to make all of Solana's history accessible, content addressable and available via a variety of means.
https://old-faithful.net/
GNU Affero General Public License v3.0
59 stars 11 forks source link

UiTokenAmount returned by faithful RPC misses fields #43

Closed linuskendall closed 10 months ago

linuskendall commented 10 months ago

In Solana RPC:

               "postTokenBalances" : [
                  {
                     "uiTokenAmount" : {
                        "decimals" : 0,
                        "amount" : "1",
                        "uiAmountString" : "1",
                        "uiAmount" : 1
                     },
                     "owner" : "9wERRF6W8dDLRfSB8xjHuUpBAk6FjK5nkJ2nz4foTLhp",
                     "programId" : "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                     "mint" : "AGLpXSGcZxkM3MyxzdqJYnZHJ3HipCGaEsYRzPX5KVGY",
                     "accountIndex" : 1
                  },
                  {
                     "accountIndex" : 5,
                     "programId" : "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                     "owner" : "Dm7XEgoLaBovhEa4WM5QeZN4Pm6X6hffTGwRwombFfsy",
                     "mint" : "AGLpXSGcZxkM3MyxzdqJYnZHJ3HipCGaEsYRzPX5KVGY",
                     "uiTokenAmount" : {
                        "decimals" : 0,
                        "uiAmount" : null,
                        "amount" : "0",
                        "uiAmountString" : "0"
                     }
                  }
               ],

in Old Faithful:

               "postTokenBalances" : [
                  {
                     "mint" : "AGLpXSGcZxkM3MyxzdqJYnZHJ3HipCGaEsYRzPX5KVGY",
                     "uiTokenAmount" : {
                        "uiAmountString" : "1",
                        "uiAmount" : 1,
                        "amount" : "1"
                     },
                     "programId" : "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                     "owner" : "9wERRF6W8dDLRfSB8xjHuUpBAk6FjK5nkJ2nz4foTLhp",
                     "accountIndex" : 1
                  },
                  {
                     "accountIndex" : 5,
                     "uiTokenAmount" : {
                        "uiAmountString" : "0",
                        "amount" : "0"
                     },
                     "programId" : "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
                     "mint" : "AGLpXSGcZxkM3MyxzdqJYnZHJ3HipCGaEsYRzPX5KVGY",
                     "owner" : "Dm7XEgoLaBovhEa4WM5QeZN4Pm6X6hffTGwRwombFfsy"
                  }
               ],
linuskendall commented 10 months ago

Probably the golang RPC response is designed to omit 0 values or empty values?

gagliardetto commented 10 months ago

Probably the golang RPC response is designed to omit 0 values or empty values?

Yes, the code generated from the proto files has the omitepty option. It was the case in rust, too.

Fixed.