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.litesvmmodule is an alternative tosolana-test-validatorthat'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:
soldersdoesn't have functions to actually interact with the RPC server (thoughsolana-pydoes use the RPC code fromsolders).soldersdoesn't provide SPL Token and SPL Memo clients.solana-pymay not have support for all the RPC requests and responses provided bysolders.solana-pydoesn't have anything like thelitesvmtesting 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 uv.
- Install the project dependencies (including dev tools):
uv sync --dev
- Activate the virtual environment (optional,
uv runworks without activation):
source .venv/bin/activate
Testing
- Run
uv run maturin developto compile the Rust code. - Run
uv run make fmt,uv run make lint, anduv run make 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
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file solders-0.27.1.tar.gz.
File metadata
- Download URL: solders-0.27.1.tar.gz
- Upload date:
- Size: 180.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7d8a24ad2f193afcdc02d6f3975917a7358b0f0ab7f4b3695b135ff2008222c8
|
|
| MD5 |
17afc90561c8528a46e0209d46192729
|
|
| BLAKE2b-256 |
662580a81bb3dc4c70329dd0016edbdfbf2e8d8300a98ab9cd1a6ea0266bda7c
|
File details
Details for the file solders-0.27.1-cp38-abi3-win_amd64.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-win_amd64.whl
- Upload date:
- Size: 5.3 MB
- Tags: CPython 3.8+, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3b787c29570a46d219c7a67543d8b0fadc73abda346653aa20e8eccd839e78b
|
|
| MD5 |
86b79598d2592dd8f694abb15efdd83c
|
|
| BLAKE2b-256 |
9bf314ed12d8d5047ababaca3271f82ebbf500ff74b6358f283962232103a12d
|
File details
Details for the file solders-0.27.1-cp38-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 6.8 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f778eeab411acec0a765a01c7b772f8eca8a8543d98276bd83cb826960da211b
|
|
| MD5 |
4c933ebce1bdf7b58ce0cfecafb7ce16
|
|
| BLAKE2b-256 |
33b935e6f59b41bb205b26c7318fcdca43f3d59464fd3ddc13d36f36427f64d4
|
File details
Details for the file solders-0.27.1-cp38-abi3-musllinux_1_2_i686.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-musllinux_1_2_i686.whl
- Upload date:
- Size: 7.1 MB
- Tags: CPython 3.8+, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d14f05a77dbbf7966fb26f255c81302e6127550bdb66c2fdc99f522043fdf376
|
|
| MD5 |
215645c25f7163bbf4678c38ecf3bf0b
|
|
| BLAKE2b-256 |
f24187ecf12cec0e7aa9c67b0cf1b8079fb28aa0af91e97328a3bd0c5e3001ba
|
File details
Details for the file solders-0.27.1-cp38-abi3-manylinux_2_28_aarch64.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-manylinux_2_28_aarch64.whl
- Upload date:
- Size: 6.6 MB
- Tags: CPython 3.8+, manylinux: glibc 2.28+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccb821c2e4af43d976f312086f248a67352b3986e5f4c87af41cfeac6d8b5683
|
|
| MD5 |
9b3122b37d63f85804cdcc2f7839e695
|
|
| BLAKE2b-256 |
a03935384d8fb80d05937bd9e8af7237cfe3f0d017c8aba357209d90d428f3a0
|
File details
Details for the file solders-0.27.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 12.7 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6082bbe46b7b1b2b005d046011f89fcae75fc5ea4f1a0ef5c2e9dfb5fe7930ce
|
|
| MD5 |
2caa60531cee87ff4d910c9e15142e8d
|
|
| BLAKE2b-256 |
480398dc73c266b11ed5c13b3933510a1aa115becf97f45bec1a22da9d03ffa9
|
File details
Details for the file solders-0.27.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 6.5 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d87b145cc0129095f9cff8c7f28d2e910bc5b5a4cf257c263b08a4b95f111dd
|
|
| MD5 |
1b04e5a53f6a55738f85e51c82f89d5d
|
|
| BLAKE2b-256 |
331cbe04a1b26e18c409dd006d214198dc03f0b657c1cb34f4c83b763f8348f0
|
File details
Details for the file solders-0.27.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-manylinux_2_5_i686.manylinux1_i686.whl
- Upload date:
- Size: 7.3 MB
- Tags: CPython 3.8+, manylinux: glibc 2.5+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
663a10566ae81f67c4515d4db5fbf51b735204741728c1a5cde11c4e019a51df
|
|
| MD5 |
bdea67907208751dbc49f3f3adbc3ba0
|
|
| BLAKE2b-256 |
8c658989e521142473bf1130613476a4449e106bb97ed6cc86097f6f519b1234
|
File details
Details for the file solders-0.27.1-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.
File metadata
- Download URL: solders-0.27.1-cp38-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
- Upload date:
- Size: 24.9 MB
- Tags: CPython 3.8+, macOS 10.9+ universal2 (ARM64, x86-64), macOS 10.9+ x86-64, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: maturin/1.10.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4dcd8e766bab24afbe9e0ae363d86f9810457e04b00c8a9149f69ca939ed587c
|
|
| MD5 |
9b22944a2335c1dc33411ae83ab74789
|
|
| BLAKE2b-256 |
4b6b0c0ee4766705824261779d00229fb95308d6b28422613e0e2af577f60ee3
|