1

I attempted to query transactions for address A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q using the following method, but could only retrieve one transaction. However, this address has at least three transactions.

  curl --request POST \
  --url https://explorer-api.devnet.solana.com/ \
  --header 'content-type: application/json' \
  --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getSignaturesForAddress",
    "params": [
      "A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q",
      {
        "limit": 1000
      }
    ]
  }'

The returned result is as follows:

{
    "jsonrpc": "2.0",
    "result": [
        {
            "blockTime": 1718803747,
            "confirmationStatus": "finalized",
            "err": null,
            "memo": null,
            "signature": "5JaxFKAeiT7zkF3n8hXTcQ8ggkuSV3Qco1W7FM7eJMW5srzGFxCQCPvUYYCLAw4K3gyZEBEqJyWTcWQJdWPUUTGR",
            "slot": 306776788
        }
    ],
    "id": 1
}

However, upon checking the block explorer, I found that the address has at least three transactions:

I tried adjusting the limit parameter and using different RPC URLs, but the result remained the same. Is there a solution to this issue?

1 Answer 1

1

The reason is in how the API call getSignaturesForAddress works: https://solana.com/docs/rpc/http/getsignaturesforaddress

Returns signatures for confirmed transactions that include the given address in their accountKeys list.

The key point is that the account address must be in the accountKeys list to be indexed for the API call.

When you check the explorer, it works the same way: https://explorer.solana.com/address/A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q?cluster=devnet It shows only a single transaction.

But when you switch to the token history of the same account: https://explorer.solana.com/address/A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q/tokens?cluster=devnet You can see the transaction where the account A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q was the "owner" of the token account. The token account was part of the accountKeys list but not the owner itself (the owner account was not necessary for processing the transaction).

When you check the getTransaction call for 2ccaFx52...UsoU11tA (the one not listed in the getSignaturesForAddress call)

curl --request POST --url https://explorer-api.devnet.solana.com/ --header 'content-type: application/json' --data '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getTransaction",
    "params": [
        "2ccaFx52pwXz3A9tNKieBTPDVSPPaCb9BL1cezY5wv5z9QCj2NWTAYiJQit3BPiL9kckn9jHoaNTtmSGUsoU11tA",
        "json"
    ]
}' | jq . | tee /tmp/tx.json

you can see A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q is not part of the accountKeys list:

"accountKeys": [
    "GmKsGRytiVoeMZGmBVCWPcUzJGHVqcvzhP5K9cstdr3E",
    "CE6J2DiN2L2KYYr1DbS36S674LVfptwNxcrSPt7yEqMu",
    "D1Kb2cp5w3gP946rMPKjZJ9CMXZepGUJ6FrJ9Dv7LPbp",
    "ComputeBudget111111111111111111111111111111",
    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
    "FtmbtsUH5HZw5gKMFsHopu1v9u9pw1x3vMPZEgB6nf5r"
],

But the owner is part of the post token balance info:

"postTokenBalances": [
    {
        "accountIndex": 1,
        "mint": "FtmbtsUH5HZw5gKMFsHopu1v9u9pw1x3vMPZEgB6nf5r",
        "owner": "A5qYq37tpvnv1fXedA9U2JHrm5XLFhgaMVhEqsaeMi5Q",
        "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
        "uiTokenAmount": {
            "amount": "6000000",
            "decimals": 6,
            "uiAmount": 6,
            "uiAmountString": "6"
        }
    },
    ...

For detailed info on transaction structure I would recommend articles:

I believe there is no direct RPC method to load the transaction related to Token Holdings. That will be a work for an off-chain indexer (e.g., https://console.cloud.google.com/marketplace/product/bigquery-public-data/crypto-solana-mainnet-us?project=ardent-girder-403621).

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.