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.litesvm 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 litesvm 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.25.0.tar.gz (175.1 kB view details)

Uploaded Source

Built Distributions

solders-0.25.0-cp37-abi3-win_amd64.whl (7.2 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.25.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.2 MB view details)

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

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

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.25.0-cp37-abi3-manylinux_2_28_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

solders-0.25.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.7 MB view details)

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

solders-0.25.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.25.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.25.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (24.7 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.25.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.25.0.tar.gz
Algorithm Hash digest
SHA256 9a22e018de90360716d62709d30507b725adca66a24e35c87ae87f4dc56a7ce8
MD5 317e31f1354991eac9a9df74a511d5ba
BLAKE2b-256 70bb940e3b948e8210d66499a53675a35a40625a23f72c8a0b646b8315930297

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 559db19024e7f2ef0c6b20b2c8dfa2adc6b5bab0b1e420d2b3167b5d8f7e1501
MD5 9ab50002cdabe519a1c43e081999cc51
BLAKE2b-256 5886251b4f84409e7f88f992e55cb7ea06c08b1e71b46b13c895e8066982f457

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0be433486e014879ab357c7475b4f973b73991c7e1386b36be2206a88d5cabcf
MD5 36360e871d577aa3c034c21ef66fec8d
BLAKE2b-256 cf9a8a061a506ba83796e4870a0d9dd062d7a8d53567566a347962670bf0ff97

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 ec3211cd4a5a968762d108a164ae652ffae07b10dc87e91f236fe6c27b903f0d
MD5 32b54410ecbc2b62bd0de9e1542c7dd9
BLAKE2b-256 272a68035b44c2bdd57191f92c06becdaa82716ee9d40f6a6d3303c72946b8af

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 889e6bb4949fc89b655c8da5fd9fe5ae3ce9c432c41b919debe1fc84ead19a5e
MD5 0ab3b43c45ac56c367508c5c977a20c2
BLAKE2b-256 3708c147ca93567027e3ed2eb93e951c812b3e7d7bab8810dcfe67c4a112b8d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 2d5220b49f821ddd6329ce8167e0ff3677d1802b4b2a674a60da741c6733bc63
MD5 40d5f70b1f0eaa22adba6653e5128b1a
BLAKE2b-256 c4166890bafa1a5d68a96410677f0994e434d79b6e0b9e517fe589ec80b41bf1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 1196e10273f48b733658b44bdace6ffbb146eb78925a0954260e34f85c4e909b
MD5 17991958c6a53709aab6ef9d404fc409
BLAKE2b-256 c5609f7f53a3445d3d462d9e0deb521e75fd210b188474ad60d2e14c5b305af0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.25.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 92463b632c8c08df53f800045f18d3691dac1b98241f1840b958ac175098777b
MD5 338750c41545d134ff0a0d4b462d1d76
BLAKE2b-256 ddab175b9447e857133cc1dad328bd5e806b4f190823b11197b3a8b0f3b32843

See more details on using hashes here.

File details

Details for the file solders-0.25.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.25.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 be3b59319e457a43ce5eb451b687ebf00afc697eb864045dc0e9e77c5224f848
MD5 41bceaf115df7face377e46a469a8b72
BLAKE2b-256 db4d0204157a5cca63238e4c2991f7ba22d71be1db8b5ec0dc25462df93b314e

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