Skip to content

v0.0.1

Choose a tag to compare

@mkdir700 mkdir700 released this 29 Nov 16:17
· 8 commits to main since this release

A Python binding for parsing Solana blockchain transactions. This package wraps the native Golang implementation through a C-API, making blockchain data interpretation accessible to Python developers while maintaining near-native performance.

Key Features

  • Cross-Platform: Supports Linux, macOS, and Windows
  • Easy to Use: Simple Python API that parses transactions with a single line of code
  • Comprehensive Transaction Data: Provides detailed transaction information including:
    • Raw transaction data

Installation

pip install solana-tx-parser

Quick Start

from solana_tx_parser import parse_transaction

# Your Solana transaction JSON string
tx_json = """
{
    "jsonrpc": "2.0",
    "result": {
        "transaction": {
            "message": {
                "accountKeys": ["account1", "account2"],
                "instructions": [...]
            },
            "signatures": [...]
        }
    }
}
"""

# Parse the transaction
result = parse_transaction(tx_json)

Example Output

[
    {
        "rawTx": {...},  # raw transaction data
        "accountList": [
            "H9m6fFpfGupwiJAY2aKd9d2MQe1StYSwxRNPcx2NHQuX",
            "BgMff4ZEtg6Apu83cHxiPZBioDmEusphusWwV1Jtk9nj",
            # ... more accounts
        ],
        "actions": [
            {
                "programId": "ComputeBudget111111111111111111111111111111",
                "programName": "ComputeBudget",
                "instructionName": "SetComputeUnitLimit",
                "computeUnitLimit": 250000
            },
            # ... more actions
        ]
    }
]

System Requirements

  • Python >= 3.8
  • Supported Operating Systems:
    • Linux
    • macOS
    • Windows