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

Uploaded Source

Built Distributions

solders-0.17.0-cp37-abi3-win_amd64.whl (6.1 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.17.0-cp37-abi3-musllinux_1_2_x86_64.whl (16.8 MB view details)

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

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

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.17.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.7 MB view details)

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

solders-0.17.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (16.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.17.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (16.5 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.17.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (17.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.17.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (26.7 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.17.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.17.0.tar.gz
Algorithm Hash digest
SHA256 a898804637769ec22518f2667b961230a68ff3264d6ccf90d9c94942c12a0ea1
MD5 c73c443d310c6c16f6c0cfabd2057d2a
BLAKE2b-256 8ef8440f1daad1c04f6114180e8a61a7d66ab9f066ba33fd69bf01fd416b8bdd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 da64d20c0eb14b1b1e39bbe82b878a03e71c076f71345ff2faf5ca87f11fa431
MD5 231a22025ba4ddcf2b352910eda028cd
BLAKE2b-256 cd9a404121d3b17fa5dd682010a9b3415c8c4235ad9154f85095ff255a7131e9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 da0d8ff4e21b3acebb4c5b3ca097659c54358cb97df087fa9fdf717710425759
MD5 1fc65ed4e0edb2312d21f29f8fda5fe4
BLAKE2b-256 e4c166a332c1483034518b94e2404c26a3c7681d02584350d9e7be6259d11c03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 d3d1559134569bbf69a8fe86509e8bf94e6a73c8de796d8de4b29aaae78f0a7a
MD5 1d91e33fb493347c4509354a74a7e281
BLAKE2b-256 07302f9d3943da174b161fbcaa62f73c2b8e4ce5c59df24369e6aaa78e541ae0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5002c1785ad301815d49a771ebd540bba15a8b30efbcef2f43456731e36a7df1
MD5 906e0f9e7457b1fe85cc8f7c6643aa74
BLAKE2b-256 c29704e16496563c2f71597a6f5bb36c35d0aa8f83562142dedf362bdf89a1f0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 eab2565dc01ac1474bcb83d43a65e4e38c16cbe762650f77d8d075fae75ee832
MD5 9c3c19b28c1e82befdc256feedc6d241
BLAKE2b-256 4bf3a3c5310b54e88911962a99a6fe5f555a5a8177764a71be1442496487927f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b7ba319d05bdd5802b781326d9cbe70b9af05f935714d38b6595a51154d070b2
MD5 d42d3222ac6078815a555382a27ba8f8
BLAKE2b-256 2d81d667f84ebf8becfc04ab15a1a9ffa78ee49dea49e2a79d041464f3caeea8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 af069840d7aaafecfa819ab05ba13df1d1fb718650dab0e989bbb7c34b63b839
MD5 a35cca3fc4df76383a342073fb6009ba
BLAKE2b-256 f2dafde534d186367061bf67b497732f500ca515af28fc37982f76d7c64563e1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.17.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 2222c20300a3b339d0c30cc85a38cb76b9341529c943f8f6e84e37b6c4cf7c3f
MD5 c053b7a374deb8548c1b51484cabd349
BLAKE2b-256 b1b2bf27aba42a7258b174f108a6ae727f20093c2219d68d68c7b1ee5e46d85b

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