Python bindings for Solana Rust tools
Project description
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 tosolana-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 (thoughsolana-py
does use the RPC code fromsolders
).solders
doesn't provide SPL Token and SPL Memo clients.solana-py
may not have support for all the RPC requests and responses provided bysolders
.solana-py
doesn't have anything like thebankrun
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
- Install poetry
- Install dev dependencies:
poetry install
- Activate the poetry shell:
poetry shell
Testing
- Run
maturin develop
to compile the Rust code. - Run
make fmt
,make lint
, andmake test
.
Project details
Release history Release notifications | RSS feed
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.19.0.tar.gz
(172.7 kB
view hashes)
Built Distributions
Close
Hashes for solders-0.19.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eeaa1289b3da9138c887853c315ecb139dcd3687bacf2ea5d9cb5855f7289f7d |
|
MD5 | 51d2b4640e06c85adf84a8f9e3c0eb15 |
|
BLAKE2b-256 | cc891ae239351fc9f10111791055280ad18c24965785cd8e72db0ab720f124f8 |
Close
Hashes for solders-0.19.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f636273ab0d733e6cd8c03589e80a09b47a660911b716c56039027aec249c2fa |
|
MD5 | 1eeed74d734b12092c97f51c13446f63 |
|
BLAKE2b-256 | 7fa96689ecdc767da17b4e50b201ef2a4606e13978d85a5a7a69e1b4202a1a5f |
Close
Hashes for solders-0.19.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac5486f9f1a87375647cdf6d87468c8aa6ee656059041eeeba5688d45d76756 |
|
MD5 | 4c6f6d6e962f95137087e9952b002fc7 |
|
BLAKE2b-256 | b06d23582c6d2b8d64a11daa9e8f9a837f1b973961cd02e7820bfad2da46bf7e |
Close
Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44713e86ba1774fb2629ac94f4a3eb302867ff38df771649314b60225dc23a47 |
|
MD5 | 5867cebb6a5894e38f1857a2ac379626 |
|
BLAKE2b-256 | b781a3a640c630e969861f17f7b38e3e5caa402e984dcbd358ed253c15c89dc9 |
Close
Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f887d1eb4e64ec31fbb5228697bb7f562bb8fd91765e4c9e96729bd4b423d326 |
|
MD5 | b6a55e2daa0826161a3eff8fd92a835d |
|
BLAKE2b-256 | c2e88b0541e5f23336112ac9d1ffeceffa00907ac54dfe0bf7a4663e9f2be01c |
Close
Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e269cfc6d35c3e50612ae6139e82b96ae14bb7ae3b49e90ec51084bb2b73bc2 |
|
MD5 | 0afb3ba866d81957f15d7c2b2dd15ca7 |
|
BLAKE2b-256 | 9613bda6e02efbb8930ac3c2eaa60fbc0ffa1a7939036ee74005352706cbb746 |
Close
Hashes for solders-0.19.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d47628e7afe40a208974da1a9c1e8aea0daa18fbacf4c8c4cbdd7a87297b9d6b |
|
MD5 | ce68116c809077ecee1ff23ec72cb9e1 |
|
BLAKE2b-256 | e98cf179c35fa8ff8a27cc802a5e4c1fc2d3000259b4d25878029bc608c9ebf5 |
Close
Hashes for solders-0.19.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f7058bde8a83c469cf473a21ea7b1709a2288d7f389953fbc8e6930b6b7c8340 |
|
MD5 | 5237914b3da7bf500a79f81a6aea9a68 |
|
BLAKE2b-256 | 0fb603e96b710e661c5cd34de63a52f3f0a09e3a6bfde3d5ef6f33d11d5feac0 |