Skip to main content

Python bindings for Solana Rust tools

Project description


Actions Status PyPI version License: MIT Code style: black

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.18.1.tar.gz (170.0 kB view details)

Uploaded Source

Built Distributions

solders-0.18.1-cp37-abi3-win_amd64.whl (6.0 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.18.1-cp37-abi3-musllinux_1_2_x86_64.whl (17.1 MB view details)

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

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

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.18.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.9 MB view details)

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

solders-0.18.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (16.5 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.18.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (16.7 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.18.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (18.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.18.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (26.9 MB view details)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

File details

Details for the file solders-0.18.1.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.18.1.tar.gz
Algorithm Hash digest
SHA256 1b41c36e331e2323ed4be1253fda2221391956b4a528270acfbf921e2a3f0329
MD5 626e261bff4913ee771fb546f83fdd90
BLAKE2b-256 df738f3c47dcf46274d2a72f24e9af737fcc511b4c8a0160768fb98bb053c7d7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1587231b57a94e29df3945fa2582817cdb1c935c7cc3b446140ae4154912d1e6
MD5 fc58476d6a3a3f075a843ba3aa6b83eb
BLAKE2b-256 ab3b3f65c9959f30985a9f439565218be692b87adc7d1e15b46c7b4411af51c0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 02788caa3b82e846944a37f86dc673b6c9d80108679f44109f6c7acfd98808ec
MD5 45c8cb21ce97a4e73afb896c0f5a4d73
BLAKE2b-256 b3a05f4cd7def78a3ed9740731076688bc84851356928dcf94fd77faa595afe9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 0b6bd026bdfce27daacefa405f0e46f44f9e8dd7e60fd36d23278b08a0f40482
MD5 461cfb53305eb8be180f9c947b93bfb5
BLAKE2b-256 2606030f8f30d3bfb8a5a8f6443b39db7b106e58ffa39eb3c742be7dc0322c3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3da01fcfcfd2154ff41328a3b7a32db655f8aace4ca146a7bf779c6088866daf
MD5 d2acf85368b33b676ff64dd6f2944793
BLAKE2b-256 8b3d242cbe61fbf8a3781a226c3d2f3d483227c76ae4f41d86342cf855795f5b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 8b78482deeed583b473e70314336d26562b5f2f14fa777a83b9406835eb3e988
MD5 a7ef5eb46d9b1e0f5e3bc0911cad8420
BLAKE2b-256 d13e4a96f70067daf3333911e4cb0e652b34b1052d52961a93e0233e050e2314

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 a92ee08cd1de84463b83551810981c25dcca4aa42ab57b8ba823d62dbab9d202
MD5 7ea5e2c176ba7d2502b7cd020019192a
BLAKE2b-256 35218a026441c2cdd8213e2f50bf54003b0f4138ba1ea82632b08dd70c9d21cb

See more details on using hashes here.

File details

Details for the file solders-0.18.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl.

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 3d2503693d0fb0efd37e3f921277327ff664bd04fff551346fad565dd8b9185a
MD5 249e3db9dc56c42c174644eb432473cb
BLAKE2b-256 32554932b517116525d7f8f2e2b999d757fe7ef3bea5219b90919d84a8d75d4c

See more details on using hashes here.

File details

Details for the file solders-0.18.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for solders-0.18.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 1b20230838626fad26d5bdaf8ebe3db3b660ef9f56cc271feca8970d464ea11f
MD5 2604e5a19754cb2da630603570912f87
BLAKE2b-256 9c20eec29b8ce0ca5ae412c43148b03acbe63eaef65ea18548c71f4ee6e64696

See more details on using hashes here.

Supported by

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