Skip to content

Releases: mkdir700/sol-tx-parser-capi

v0.0.4

25 Dec 11:50
Compare
Choose a tag to compare

Update tx-parser version to 0.4.0
tx-parser v0.4.0 changelog can be found at: https://github.com/0xjeffro/tx-parser/releases/tag/v0.4.0

v0.0.3

24 Dec 13:02
Compare
Choose a tag to compare
  1. Update the version of the dependency tx-parser to 0.3.1

Full Changelog: v0.0.2...v0.0.3

v0.0.2

23 Dec 01:52
Compare
Choose a tag to compare

Bug fix

  1. Fix the return value type annotation error of the parsing function

v0.0.1

29 Nov 16:17
Compare
Choose a tag to compare

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