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.bankrun 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 bankrun 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.20.0.tar.gz (178.7 kB view details)

Uploaded Source

Built Distributions

solders-0.20.0-cp37-abi3-win_amd64.whl (5.4 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.20.0-cp37-abi3-musllinux_1_2_x86_64.whl (17.5 MB view details)

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

solders-0.20.0-cp37-abi3-musllinux_1_2_i686.whl (9.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.20.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.4 MB view details)

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

solders-0.20.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (8.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.20.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.20.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (9.6 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.20.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (27.3 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.20.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.20.0.tar.gz
Algorithm Hash digest
SHA256 1b41f3a8fd7b91ccbfe77092f1ae58a537e285980b6020a9ff567c7f8f246806
MD5 cacab1c9ec0268505c1f743eb32f8cc0
BLAKE2b-256 357f3619fa2576afaaf79623c8395fe9028816671fdb436c6f47dc224f868232

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 101324104f015848b06320845ff78007c01d254b53f67021e2684856ba52f226
MD5 df671579dbe648c31308e237db874ddb
BLAKE2b-256 1e9421350c400b4572901993dda3d3204b5fb1c129358bfaf8c2021bc073c255

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 423d097d023df2e28c0dbc212fe95ae59d8258e48a3fe8c70321e9a6b357ac8a
MD5 3bff3540954a6af682de5bacab049d19
BLAKE2b-256 6ad9881355c561ac2df5cbef4f91892e9dc147c6f7a40926987b50fa51c4c2a3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 fed83b871174ab4a13814786ae085f2b97f8a3a4e0c020b0869cdebca9ecaf29
MD5 a05aa585999ab8020e019aafb4cdbc01
BLAKE2b-256 9a752edd23e49ac06d98757bf76364fad264cedda5f3fdd4250e6bb421b764d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 647882d676e943e9829cffd9d1f07cb413421317be01fe39b4c5bd08afe991c3
MD5 608058affb35d2976fb465ed1b601341
BLAKE2b-256 7cf1960c186c81cb282e88f931bda4bfaacc22b633df8de4fa63678391761fa0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2b3c344b9ba20fc2f9a3cb99e15edeb816398b96adf0af38a8ab8874ac06cc34
MD5 4155e468f91c00d42cf0f80d0ddeff63
BLAKE2b-256 2a71dacca843c08b54b5c252e79dbcf00b330377ba6fb4602cfef4828f406217

See more details on using hashes here.

File details

Details for the file solders-0.20.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 53569cc6050b7a5aafc5a0518710d002ab8e2d3b1c538f7f52fb2b28372ebc69
MD5 54c5fd34cb6a9d32006384bd2be321d1
BLAKE2b-256 8a4af86c131221c0295b2abf6e3346575359c4e39cfb756f3cd831b778ae7668

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.20.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 b93d89ac04b2ca114d592fd72c1f12320da11cce12554ebd4f6eee226fec797e
MD5 fab40de3fbec193efe62aba2dc368a20
BLAKE2b-256 75832b59455b1c1e3da94b6688adfffc3b0ee55d40f516e027269ee7bd83fada

See more details on using hashes here.

File details

Details for the file solders-0.20.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.20.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f28d8ee017b1a9d01b74b21865bc52ed6ec4dde24dde2907d8764d0e6f4d0937
MD5 425b58feecf6daff6a5078e29d57ca7d
BLAKE2b-256 2e691bced96bb268dab68577eaf74ec2a945756391db57f82c0853ce1dddb683

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page