Skip to main content
POST
/
getTransactionWithCompressionInfo
cURL
curl --request POST \
  --url https://mainnet.helius-rpc.com/getTransactionWithCompressionInfo \
  --header 'Content-Type: application/json' \
  --data '
{
  "id": "test-account",
  "jsonrpc": "2.0",
  "method": "getTransactionWithCompressionInfo",
  "params": {
    "signature": "5J8H5sTvEhnGcB4R8K1n7mfoiWUD9RzPVGES7e3WxC7c"
  }
}
'
{
  "compression_info": {
    "closedAccounts": [
      {
        "account": {
          "address": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "data": {
            "data": "SGVsbG8sIFdvcmxkIQ==",
            "dataHash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
            "discriminator": 100
          },
          "hash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
          "lamports": 100,
          "leafIndex": 100,
          "owner": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "seq": 100,
          "slotCreated": 100,
          "tree": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq"
        },
        "optionalTokenData": {
          "amount": 100,
          "delegate": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "mint": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "owner": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "state": "initialized",
          "tlv": "SGVsbG8sIFdvcmxkIQ=="
        }
      }
    ],
    "openedAccounts": [
      {
        "account": {
          "address": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "data": {
            "data": "SGVsbG8sIFdvcmxkIQ==",
            "dataHash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
            "discriminator": 100
          },
          "hash": "11111112cMQwSC9qirWGjZM6gLGwW69X22mqwLLGP",
          "lamports": 100,
          "leafIndex": 100,
          "owner": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "seq": 100,
          "slotCreated": 100,
          "tree": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq"
        },
        "optionalTokenData": {
          "amount": 100,
          "delegate": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "mint": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "owner": "11111116djSnXB2wXVGT4xDLsfTnkp1p4cCxHAfRq",
          "state": "initialized",
          "tlv": "SGVsbG8sIFdvcmxkIQ=="
        }
      }
    ]
  },
  "transaction": {}
}
ThegetTransactionWithCompressionInfo RPC method returns transaction data along with compression information showing which compressed accounts were opened (created) and closed (consumed) during the transaction. This method helps with transaction analysis, account lifecycle tracking, and debugging of compression operations.
You can test this method via the OpenAPI example or custom examples below.
Common Use Cases
  • Transaction Analysis: Understand what compressed accounts were affected by a transaction
  • Account Lifecycle Tracking: Monitor when compressed accounts are created and consumed
  • Debugging: Identify which accounts changed during failed or unexpected transactions
  • Audit Trails: Track compressed account state changes for compliance
Parameters
  1. signature (string, required): Base58-encoded transaction signature to query compression information for.
Note: Only transactions involving compressed accounts will return compression data. Regular Solana transactions return null. Response The response contains compression information and transaction data, or null if transaction not found:
  • compressionInfo (object): Contains details about compressed account changes
    • closedAccounts (array): Compressed accounts consumed (spent) in this transaction
      • account (object): Complete compressed account data with merkle context
      • maybeTokenData (object | null): Token data if this is a compressed token account
    • openedAccounts (array): New compressed accounts created in this transaction
      • account (object): Complete compressed account data with merkle context
      • maybeTokenData (object | null): Token data if this is a compressed token account
    • preTokenBalances (array, optional): Token balances before transaction
      • owner (PublicKey): Public key of token account owner
      • mint (PublicKey): Public key of token mint
      • amount (BN): Token amount as BN object
    • postTokenBalances (array, optional): Token balances after transaction
      • owner (PublicKey): Public key of token account owner
      • mint (PublicKey): Public key of token mint
      • amount (BN): Token amount as BN object
  • transaction (object): Standard Solana transaction data
Developer Tips
  • Compression-only: This method only works with transactions that involve compressed accounts
  • Real signatures required: Use actual transaction signatures from compression operations
  • Account lifecycle: opened = created, closed = consumed/spent in the transaction
  • Token data: maybeTokenData is null for regular compressed accounts, populated for token accounts
  • Balance tracking: Use pre/postTokenBalances for detailed token amount changes
  • State analysis: Compare opened vs closed accounts to understand transaction effects
Troubleshooting
Invalid or non-existent transaction signatureVerify the signature format and check transaction existence:
const result = await connection.getTransactionWithCompressionInfo(signature);

if (!result) {
    console.log('Transaction not found or contains no compression operations');
}
Transaction exists but has no compression dataThis method only returns data for transactions involving compressed accounts:
const result = await connection.getTransactionWithCompressionInfo(signature);

if (!result) {
    console.log('Transaction does not involve compressed accounts');
    console.log('Use regular getTransaction for non-compression transactions');
}
Transaction has compression info but no account changes shownSome compression operations may not create/consume accounts:
const { compressionInfo } = result;

if (compressionInfo.openedAccounts.length === 0 &&
    compressionInfo.closedAccounts.length === 0) {
    console.log('Compression transaction with no visible account changes');
    console.log('May be a proof verification or state update operation');
}

Body

application/json
id
enum<string>
required

An ID to identify the request.

Available options:
test-account
jsonrpc
enum<string>
required

The version of the JSON-RPC protocol.

Available options:
2.0
method
enum<string>
required

The name of the method to invoke.

Available options:
getTransactionWithCompressionInfo
params
object
required

Response

A Solana transaction with additional compression information

compression_info
object
transaction
object

An encoded confirmed transaction with status meta