Skip to main content

Python bindings for Solana Rust tools

Project description


PyPI version License: MIT

Solders

solders is a high-performance Python toolkit for Solana, written in Rust. It provides robust solutions to the following problems:

  • Core SDK stuff: keypairs, pubkeys, signing and serializing transactions - that sort of thing.
  • RPC stuff: building requests and parsing responses (no networking stuff - if you want help with that, solana-py is your friend).
  • Integration testing stuff: the solders.bankrun module is an alternative to solana-test-validator that's much more convenient and much faster. It's based on solana-program-test if you know that is.

What about solana-py?

solders and solana-py are good friends. solana-py uses solders under the hood extensively in its core API and RPC API. The main differences are:

  • solders doesn't have functions to actually interact with the RPC server (though solana-py does use the RPC code from solders).
  • solders doesn't provide SPL Token and SPL Memo clients.
  • solana-py may not have support for all the RPC requests and responses provided by solders.
  • solana-py doesn't have anything like the bankrun testing kit.

Since solana-py uses solders under the hood and they don't duplicate each other's features, you should just use whichever library you need.

Installation

pip install solders

Note: Requires Python >= 3.7.

Example Usage

>>> from solders.message import Message
>>> from solders.keypair import Keypair
>>> from solders.instruction import Instruction
>>> from solders.hash import Hash
>>> from solders.transaction import Transaction
>>> from solders.pubkey import Pubkey
>>> program_id = Pubkey.default()
>>> arbitrary_instruction_data = bytes([1])
>>> accounts = []
>>> instruction = Instruction(program_id, arbitrary_instruction_data, accounts)
>>> payer = Keypair()
>>> message = Message([instruction], payer.pubkey())
>>> blockhash = Hash.default()  # replace with a real blockhash
>>> tx = Transaction([payer], message, blockhash)

Development

Setup

  1. Install poetry
  2. Install dev dependencies:
poetry install
  1. Activate the poetry shell:
poetry shell

Testing

  1. Run maturin develop to compile the Rust code.
  2. Run make fmt, make lint, and make test.

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

solders-0.24.0.tar.gz (198.4 kB view details)

Uploaded Source

Built Distributions

solders-0.24.0-cp37-abi3-win_amd64.whl (7.1 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.24.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.3 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ x86-64

solders-0.24.0-cp37-abi3-musllinux_1_2_i686.whl (7.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.24.0-cp37-abi3-manylinux_2_28_aarch64.whl (7.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

solders-0.24.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.7 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ x86-64

solders-0.24.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.24.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (7.6 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.24.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (31.3 MB view details)

Uploaded CPython 3.7+ macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64

File details

Details for the file solders-0.24.0.tar.gz.

File metadata

  • Download URL: solders-0.24.0.tar.gz
  • Upload date:
  • Size: 198.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.8.1

File hashes

Hashes for solders-0.24.0.tar.gz
Algorithm Hash digest
SHA256 e312fc66ab77f9a0a3e3087e82c0218f0178f61e8a5c952c6da6ecc1eee999ab
MD5 821a4a590efed88c0af255a59d557dc3
BLAKE2b-256 35ce8ef387d9dfa02fe10e5d54c329acdb68ce496a7e0de1201dc5f39327c129

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-win_amd64.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 56b7a2a5b106ce31048193d62eca61a912424f4d50bf140febcdb78f52871037
MD5 cedb7016827e037019bdb3fba57cb7ee
BLAKE2b-256 f20f059cdeb38b0014a57f85cfeb1983b1bae40bdba2001079c682723d2954f1

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7e4fa6b9b8bba241a708b1030495e59f59dd2e90e99219410ce411869917a2ba
MD5 dadfa6b865596a6382afddb702e5adb4
BLAKE2b-256 d26bf3674d059d85ecbbaee5d0b28788dced2cae46b7c40cfc62e8252aa2cb44

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-musllinux_1_2_i686.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 b696a585b2589e7324b7c60740b3021ca01f9cee5875a60366bbbc84d4d527e4
MD5 cf7c0d1ff6175ae27f5d82aedb1bab5d
BLAKE2b-256 16b75112c7f314122d8ec7ff36bb3b3cbb48fbbc1f4aaf983a61e95aeae1978b

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 374b45d37d0d784bad0854b63a6a6f861e0179f47db15f1a46882133f4383f70
MD5 8018f04b754a13b85eb1acd40e0ccf09
BLAKE2b-256 e9126dc2edce8a3cf64c395ae52adcaf58bf7eb1f631e3e0db2a3bf9e116eebb

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 49dc32745304e4261cc86e67f2570a7c1c8f7a4360b90710c8020d672ff520e3
MD5 234e3675d54391bb460d203fa4042e14
BLAKE2b-256 d21f398ddb649998e56e7ff48c5b63959c4a270f1869dc9a01d7951383ad2248

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 7bf3ca46b50c75e67fa2c9381c237f20770faf860d91c8c370edb581b083d052
MD5 6a9235f886396e521e98c6f49e0cc096
BLAKE2b-256 2390d4f0cb4ff8f492e59d3e84409c63f0a5122d341b2196051f850cc08f0d89

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 eea425ea52873fa4b2164af814e2e1e4eb8c1f86cec15fe9f1e3fa96c95475f0
MD5 de436e22b3ec90e3312aae40d7654bd8
BLAKE2b-256 80bc30fc0e98ca9f3612b744417f5a7763268998398c1ffd89a8aaf90a584527

See more details on using hashes here.

File details

Details for the file solders-0.24.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl.

File metadata

File hashes

Hashes for solders-0.24.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f42d1397b7f7a64d07518055124fd60c3fe011810b7a037ad606085340a51660
MD5 d6f04832f0276b67b4a4abe1eb2d8f79
BLAKE2b-256 6e1320654a051032727bc16b2e7f508ecf63c02ada97bcdbe039883c62604c0a

See more details on using hashes here.

Supported by

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