Skip to main content

Python bindings for Solana Transaction Parser (tx-parser), enabling Python developers to easily parse and analyze Solana blockchain transactions. This package provides a high-performance C-API wrapper around the original Rust implementation, making blockchain data interpretation accessible in Python while maintaining native-like performance.

Project description

Solana Transaction Parser

Python bindings for parsing Solana transactions using a Go-based C shared library.

Installation

pip install solana-tx-parser

Usage

import json
from solana_tx_parser import parse_transaction

tx_data = {
    "jsonrpc": "2.0",
    "result": ...,  # Your transaction JSON string
    "id": 1,
}
tx_json = json.dumps(tx_data)
result = parse_transaction(tx_json)

result is a list of transaction objects:

[
    {
        "rawTx": {...},  # raw transaction data
        "accountList": [
            "H9m6fFpfGupwiJAY2aKd9d2MQe1StYSwxRNPcx2NHQuX",
            "BgMff4ZEtg6Apu83cHxiPZBioDmEusphusWwV1Jtk9nj",
            "CebN5WGQ4jvEPvsVU4EoHEpgzq1VV7AbicfhtW4xC9iM",
            "TEf2o4WuA8RjzGK5SoE6kPLQzQE4gjrgp4tvErURicA",
            "8DCJfMMoHXCZZhVfnAy8f5zydcnV23CQ5UR63gasX1yh",
            "ComputeBudget111111111111111111111111111111",
            "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
            "8suSDnKVFRyAsTpZ7e2J2seofy6fVhL3cerTfyYppump",
            "11111111111111111111111111111111",
            "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
            "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
            "4wTV1YmiEkRvAtNtsSGPtUrqRYQMe5SKy2uB4Jjaxnjf",
            "SysvarRent111111111111111111111111111111111",
            "Ce6TQqeHC9p8KetsN6JsjHK7UTZk7nasjjnr7XxXp9F1"
        ],
        "actions": [
            {
                "programId": "ComputeBudget111111111111111111111111111111",
                "programName": "ComputeBudget",
                "instructionName": "SetComputeUnitLimit",
                "computeUnitLimit": 250000
            },
            {
                "programId": "ComputeBudget111111111111111111111111111111",
                "programName": "ComputeBudget",
                "instructionName": "SetComputeUnitPrice",
                "microLamports": 1000000
            },
            {
                "programId": "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
                "programName": "Unknown",
                "instructionName": "Unknown",
                "error": null
            },
            {
                "programId": "6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P",
                "programName": "PumpFun",
                "instructionName": "Buy",
                "who": "H9m6fFpfGupwiJAY2aKd9d2MQe1StYSwxRNPcx2NHQuX",
                "fromToken": "So11111111111111111111111111111111111111112",
                "fromTokenAmount": 279965,
                "toToken": "8suSDnKVFRyAsTpZ7e2J2seofy6fVhL3cerTfyYppump",
                "toTokenAmount": 10000000000,
                "feeAmount": 2799
            }
        ]
    }
]

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

solana_tx_parser-0.0.4.tar.gz (14.2 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solana_tx_parser-0.0.4-py3-none-any.whl (14.3 MB view details)

Uploaded Python 3

File details

Details for the file solana_tx_parser-0.0.4.tar.gz.

File metadata

  • Download URL: solana_tx_parser-0.0.4.tar.gz
  • Upload date:
  • Size: 14.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.1 CPython/3.12.8 Linux/6.5.0-1025-azure

File hashes

Hashes for solana_tx_parser-0.0.4.tar.gz
Algorithm Hash digest
SHA256 7e4ae0f4a09760d634fa6ba1ea818fc2e813da69e2b1211fe8f81161267fde18
MD5 5a9ea11a69ca9a75b3def89f64c917d5
BLAKE2b-256 cf7a8c7882294ccd2f7e3a5865ceaf1726a0ca1f26fb0f5b09a6457f812f40a1

See more details on using hashes here.

File details

Details for the file solana_tx_parser-0.0.4-py3-none-any.whl.

File metadata

  • Download URL: solana_tx_parser-0.0.4-py3-none-any.whl
  • Upload date:
  • Size: 14.3 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.22.1 CPython/3.12.8 Linux/6.5.0-1025-azure

File hashes

Hashes for solana_tx_parser-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 55a456751f2842916f37c6696f6e44b7c0043506454c00f008f98ac3657c771d
MD5 413574dfbd3bfc3ebdddfc64becceccf
BLAKE2b-256 bc0e8543281f157fe3d76afd107d2edef3dfc6c05199c58be78ddc967dc7a1b1

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page