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.
# Equivalent to: resolve(parse(normalize(tx)))
result = soltxs.process(tx)

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

parsed_data = soltxs.parse(norm_tx)
# ParsedTransaction(
#     signatures=[...],
#     instructions=[
#         <ComputeBudget.SetComputeUnitLimit(...)>,
#         <ComputeBudget.SetComputeUnitPrice(...)>,
#         <SystemProgram.CreateAccount(...)>,
#         <TokenProgram.InitAccount(...)>,
#         <RaydiumAMM.Swap(...)>,
#         <TokenProgram.Unknown(...)>,
#         <SystemProgram.Transfer(...)>,
#         <UnknownProgram.Unknown(...)>,
#     ],
#     Addons(
#         compute_units=<ComputeUnits(...)>,
#         instruction_count=<InstructionCount(...)>,
#         loaded_addresses=<LoadedAddresses(...)>
#         platform_identifier=<PlatformIdentifier(...)>,
#         token_transfer_summary=<TokenTransfer(...)>
#     )
# )

resolved_tx = soltxs.resolve(parsed_data)
# For example, a Raydium resolved output might be:
# 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.7.tar.gz (22.6 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.7-py3-none-any.whl (34.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: soltxs-1.0.7.tar.gz
  • Upload date:
  • Size: 22.6 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.7.tar.gz
Algorithm Hash digest
SHA256 cbac06f7e8a57da35ee9c30341eca86ac7b794fac5417c1e9664a39d4565eaf7
MD5 a2be35bce19dc3be365223c066d091f5
BLAKE2b-256 7db6bee18133dd3c4d7298cf65c08db5eff4d57e531dcbef08a5f8fa3ecf7144

See more details on using hashes here.

Provenance

The following attestation bundles were made for soltxs-1.0.7.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.7-py3-none-any.whl.

File metadata

  • Download URL: soltxs-1.0.7-py3-none-any.whl
  • Upload date:
  • Size: 34.3 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 32790f327d56ed1776ab36ef293eb932031097dfdac9ccc86d114c0f695b5268
MD5 bcccec6375d38808bdfaa43c4768745c
BLAKE2b-256 2ecc414b6ebd151e98ea80423dcaa73280165cd5707ae655a3120d3365620000

See more details on using hashes here.

Provenance

The following attestation bundles were made for soltxs-1.0.7-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