0

If I subscribe to the logs event, I get logs like this:

{
   "jsonrpc":"2.0",
   "method":"logsNotification",
   "params":{
      "result":{
         "context":{
            "slot":263296582
         },
         "value":{
            "signature":"TpAvUaGaqCPcntnBGQWhwEwUPJ4iNuU7UARV9torxfvVbohrnDZ517pAEpHzbtu9UfenwvntKuxZVScgd8qB8xj",
            "err":"None",
            "logs":[
               "Program ComputeBudget111111111111111111111111111111 invoke [1]",
               "Program ComputeBudget111111111111111111111111111111 success",
               "Program ComputeBudget111111111111111111111111111111 invoke [1]",
               "Program ComputeBudget111111111111111111111111111111 success",
               "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL invoke [1]",
               "Program log: CreateIdempotent",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
               "Program log: Instruction: GetAccountDataSize",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1569 of 113811 compute units",
               "Program return: TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA pQAAAAAAAAA=",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
               "Program 11111111111111111111111111111111 invoke [2]",
               "Program 11111111111111111111111111111111 success",
               "Program log: Initialize the associated token account",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
               "Program log: Instruction: InitializeImmutableOwner",
               "Program log: Please upgrade to SPL Token 2022 for immutable owner support",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 1405 of 107224 compute units",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [2]",
               "Program log: Instruction: InitializeAccount3",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 3158 of 103342 compute units",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
               "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL consumed 19315 of 119216 compute units",
               "Program ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL success",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [1]",
               "Program log: Instruction: Route",
               "Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 invoke [2]",
               "Program log: ray_log: Az8/GIYoAAAAAAAAAAAAAAABAAAAAAAAAD8/GIYoAAAA9eQuW54AAACMsXQyajoAAO4YSW0AAAAA",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
               "Program log: Instruction: Transfer",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4645 of 47209 compute units",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [3]",
               "Program log: Instruction: Transfer",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 4736 of 39583 compute units",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success",
               "Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 consumed 31791 of 65869 compute units",
               "Program 675kPX9MHTjS2zt1qfr1NYHuzeLXfQM9H24wFSUt1Mp8 success",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 invoke [2]",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 2025 of 31099 compute units",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 consumed 73235 of 99901 compute units",
               "Program return: JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 7hhJbQAAAAA=",
               "Program JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4 success",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA invoke [1]",
               "Program log: Instruction: CloseAccount",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA consumed 2915 of 26666 compute units",
               "Program TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA success"
            ]
         }
      },
      "subscription":389560
   }
}

Is there any way to get the input addresses, output addresses and amounts without making another rpc call?

2
  • is there anything in particular you are looking for ? I had this same issue when first parsing logs.
    – rob666
    Commented May 1 at 17:53
  • I would just like to get all the SOL transfers in real-time, just like ETH, for example. Do you know how to do it without doing an API call for each tx signature?
    – user80100
    Commented May 1 at 18:31

1 Answer 1

0

Put simply, you'll need to fetch the transaction separately using an RPC call and the signature provided in the transaction. The logsSubscribe endpoint only provides logs.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.