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.bankrunmodule 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 thebankruntesting 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 developto compile the Rust code. - Run
make fmt,make lint, andmake test.
Release files for solders 0.21.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| solders-0.21.0.tar.gz | 178.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| solders-0.21.0-cp37-abi3-win_amd64.whl | CPython 3.7 | abi3 | Windows x86-64 | Details |
| solders-0.21.0-cp37-abi3-musllinux_1_2_x86_64.whl | CPython 3.7 | abi3 | Linux musl 1.2+ x86-64 | Details |
| solders-0.21.0-cp37-abi3-musllinux_1_2_i686.whl | CPython 3.7 | abi3 | Linux musl 1.2+ x86-32 | Details |
| solders-0.21.0-cp37-abi3-manylinux_2_28_aarch64.whl | CPython 3.7 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| solders-0.21.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.7 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| solders-0.21.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl | CPython 3.7 | abi3 | Linux glibc 2.17+ ARMv7l | Details |
| solders-0.21.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl | CPython 3.7 | abi3 | Linux glibc 2.5+ x86-32 | Details |
| solders-0.21.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.7 | abi3 | macOS 11.0+ ARM64, macOS 10.12+ x86-64, macOS 10.12+ universal2 (ARM64, x86-64) | Details |
Total release size: 102.6 MB
Release files / solders-0.21.0.tar.gz
| Download URL | solders-0.21.0.tar.gz |
|---|---|
| Size | 178.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a228c09b690f215acb01c55e17246efdfdb7c013f7332b057ecd0499363868ad
|
|
BLAKE2b-256 checksum How to use checksums |
e8bc5c6f78e403854ebff50d86c3ec4b8fe1240777b3c8f6d94d1f1f85c479c4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-win_amd64.whl
| Download URL | solders-0.21.0-cp37-abi3-win_amd64.whl |
|---|---|
| Size | 5.3 MB |
| Tags | CPython 3.7 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
7258b0faa97ab3dc2e1951082af63f2971f178519540f7abac43ec2385d84b7f
|
|
BLAKE2b-256 checksum How to use checksums |
3d374926284e5d463edf3fe826c87f93016fc68f27c763f57f47b77b97127e9e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-musllinux_1_2_x86_64.whl
| Download URL | solders-0.21.0-cp37-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 17.4 MB |
| Tags | CPython 3.7 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
9521974ffa8b0fc8a4aa3b65f9057392c214a814c10af4f8cd2ad1d3f943ae61
|
|
BLAKE2b-256 checksum How to use checksums |
2866e788d1edae8472ba5d0fc9833d03611ee25227212f1719089078b38d1b80
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-musllinux_1_2_i686.whl
| Download URL | solders-0.21.0-cp37-abi3-musllinux_1_2_i686.whl |
|---|---|
| Size | 9.3 MB |
| Tags | CPython 3.7 Linux musl 1.2+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
6993e2e1709aa04b94267597dc31e29ae5625cde3d65fdf452c6366c6c7f41cd
|
|
BLAKE2b-256 checksum How to use checksums |
b4009153205ab01afd829d8f30c25090974f7b7c7b56f4b7725393e58de08d86
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-manylinux_2_28_aarch64.whl
| Download URL | solders-0.21.0-cp37-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 8.3 MB |
| Tags | CPython 3.7 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
3ac70badd0da7e0d87db1c9c2edac63e48470903fd5f28e2fd6b22c7624ef52f
|
|
BLAKE2b-256 checksum How to use checksums |
720a895638da97e15a54845252ecfda6ed47f7fb221b078ef44a240e88431005
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | solders-0.21.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 17.3 MB |
| Tags | CPython 3.7 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
33a28fedff80defd01455844700e3b9924c06a87d7ca93aff0a9298a9eb902ac
|
|
BLAKE2b-256 checksum How to use checksums |
b8b2af654348941ed5670ab20aa6d642caec3053cc29bf929a63d2f785e624e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
| Download URL | solders-0.21.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl |
|---|---|
| Size | 8.1 MB |
| Tags | CPython 3.7 Linux glibc 2.17+ ARMv7l abi3 |
|
SHA-256 checksum How to use checksums |
a11dfc5933707c466880ef2116f1bffc74659bf677b79479f4280247d60543c9
|
|
BLAKE2b-256 checksum How to use checksums |
b2c1291ae85720ad0d4ff0a34076ea7c44a6ece552f7b8257781e06f9851d9fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
| Download URL | solders-0.21.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl |
|---|---|
| Size | 9.5 MB |
| Tags | CPython 3.7 Linux glibc 2.5+ x86-32 abi3 |
|
SHA-256 checksum How to use checksums |
ac79feca36470945ac026433828d4105a4b3bada5422ea77b1083c0e8fe93872
|
|
BLAKE2b-256 checksum How to use checksums |
9e23cab1a1e1e4397d7d947c3c649901664cfef4c1ee4a0efccbcb0e8a74ad33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|
Release files / solders-0.21.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | solders-0.21.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 27.2 MB |
| Tags | CPython 3.7 abi3 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
7df88e59aea016644c0b2eac84f2f931d5aa570c654132770263b26f2928fdb7
|
|
BLAKE2b-256 checksum How to use checksums |
823a80a252eccbd468a07a89747c9aa55c06f5897131e19722523946673422a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
maturin/1.5.0
|