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.21.0.tar.gz
(178.9 kB
view hashes)
Built Distributions
Close
Hashes for solders-0.21.0-cp37-abi3-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7258b0faa97ab3dc2e1951082af63f2971f178519540f7abac43ec2385d84b7f |
|
MD5 | fdd2bcb7c1d781505a1517f01529ab05 |
|
BLAKE2b-256 | 3d374926284e5d463edf3fe826c87f93016fc68f27c763f57f47b77b97127e9e |
Close
Hashes for solders-0.21.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9521974ffa8b0fc8a4aa3b65f9057392c214a814c10af4f8cd2ad1d3f943ae61 |
|
MD5 | 5ea1b31db315e8c6545121adfdb5a7a1 |
|
BLAKE2b-256 | 2866e788d1edae8472ba5d0fc9833d03611ee25227212f1719089078b38d1b80 |
Close
Hashes for solders-0.21.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6993e2e1709aa04b94267597dc31e29ae5625cde3d65fdf452c6366c6c7f41cd |
|
MD5 | a03c6401777ea99b47502f68219955d2 |
|
BLAKE2b-256 | b4009153205ab01afd829d8f30c25090974f7b7c7b56f4b7725393e58de08d86 |
Close
Hashes for solders-0.21.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ac70badd0da7e0d87db1c9c2edac63e48470903fd5f28e2fd6b22c7624ef52f |
|
MD5 | 4fa20047e7e5d4ab69861071c83d2cce |
|
BLAKE2b-256 | 720a895638da97e15a54845252ecfda6ed47f7fb221b078ef44a240e88431005 |
Close
Hashes for solders-0.21.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33a28fedff80defd01455844700e3b9924c06a87d7ca93aff0a9298a9eb902ac |
|
MD5 | 66ecaa8a20dc5adaf91d0d6c5e88fd1e |
|
BLAKE2b-256 | b8b2af654348941ed5670ab20aa6d642caec3053cc29bf929a63d2f785e624e7 |
Close
Hashes for solders-0.21.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a11dfc5933707c466880ef2116f1bffc74659bf677b79479f4280247d60543c9 |
|
MD5 | 45fdd3638936cbb26359826529de178a |
|
BLAKE2b-256 | b2c1291ae85720ad0d4ff0a34076ea7c44a6ece552f7b8257781e06f9851d9fe |
Close
Hashes for solders-0.21.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ac79feca36470945ac026433828d4105a4b3bada5422ea77b1083c0e8fe93872 |
|
MD5 | 4e872aadfab5aa9102584dbd153f3e63 |
|
BLAKE2b-256 | 9e23cab1a1e1e4397d7d947c3c649901664cfef4c1ee4a0efccbcb0e8a74ad33 |
Close
Hashes for solders-0.21.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7df88e59aea016644c0b2eac84f2f931d5aa570c654132770263b26f2928fdb7 |
|
MD5 | 7f1cd2709d4637b665da603fecfa9a63 |
|
BLAKE2b-256 | 823a80a252eccbd468a07a89747c9aa55c06f5897131e19722523946673422a4 |