Skip to main content

Solana transaction normalizer, parser, and resolver.

Project description

Solana Transactions (soltxs)

Solana transaction normalizer, parser, and resolver.

Installing

pip install soltxs

Overview

This library breaks down Solana transaction introspection and analysis into three steps:

  1. Normalize: Converts a raw JSON RPC payload into a Transaction object.
  2. Parse: Routes each instruction in the Transaction to the correct program-level parser. Produces objects describing each recognized instruction.
  3. Resolve: Takes the parsed instructions and converts them into a more human-readable format.

Support

  • Normalizers
    • Standard RPC Response
    • Modified YellowStone Geyser Response
  • Parsers
    • Compute Budget
    • System Program
    • Token Program
    • PumpFun Program
    • Raydium AMM Program
  • Resolvers
    • PumpFun Swap
    • Raydium Swap

Usage

import soltxs

tx = {"jsonrpc": ..., "result": ..., "id": ...}

# All three steps below can be combined into a single call
# to the 'process' function. The function below is equivalent to:
# resolve(parse(normalize(tx)))
result = soltxs.process(tx)

norm_tx = soltxs.normalize(tx)
# Transaction(
#     slot=...,
#     blockTime=...,
#     signatures=[...],
#     message=...,
#     meta=...,
#     loadedAddresses=...,
# )

prsd_tx = soltxs.parse(norm_tx)
# [
#     <ComputeBudget.SetComputeUnitLimit(...)>,
#     <ComputeBudget.SetComputeUnitPrice(...)>,
#     <SystemProgram.CreateAccount(...)>,
#     <TokenProgram.InitAccount(...)>,
#     <RaydiumAMM.Swap(...)>,
#     <TokenProgram.Unknown(...)>,
#     <SystemProgram.Transfer(...)>,
#     <UnknownProgram.Unknown(...)>,
# ]

rsvl_tx = soltxs.resolve(prsd_tx)
# Raydium(
#     type=...,
#     who=...,
#     from_token=...,
#     from_amount=...,
#     to_token=...,
#     to_amount=...,
#     minimum_amount_out=...
# )

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

soltxs-1.0.5.tar.gz (15.2 kB view details)

Uploaded Source

Built Distribution

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

soltxs-1.0.5-py3-none-any.whl (23.7 kB view details)

Uploaded Python 3

File details

Details for the file soltxs-1.0.5.tar.gz.

File metadata

  • Download URL: soltxs-1.0.5.tar.gz
  • Upload date:
  • Size: 15.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for soltxs-1.0.5.tar.gz
Algorithm Hash digest
SHA256 04229019c64c021d78370f7806a210818aa8d459386fb737d1269cd988af2c77
MD5 d5d04ea93b6d8b6b8fa485fbfd8512c3
BLAKE2b-256 a9f9812ffaf5d76463d18a4f553b9a1231e761014dbf6a4704bbea31c11cbff2

See more details on using hashes here.

Provenance

The following attestation bundles were made for soltxs-1.0.5.tar.gz:

Publisher: release.yaml on qvecs/soltxs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file soltxs-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: soltxs-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 23.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for soltxs-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0c5148796cb5bb9af4254fbebd151ca0636a98814f59fb10eb6e823bfa26b73a
MD5 99abab22a31fff38ee8cc29a1b6426eb
BLAKE2b-256 9c523bcd6cb2e81edd0af817ad6fd4ff4df08c8a888b60a3df4eedc480253177

See more details on using hashes here.

Provenance

The following attestation bundles were made for soltxs-1.0.5-py3-none-any.whl:

Publisher: release.yaml on qvecs/soltxs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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