Skip to main content

Python binding to the Solana Rust SDK

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

Uploaded Source

Built Distributions

solders-0.15.1-cp37-abi3-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.15.1-cp37-abi3-musllinux_1_2_x86_64.whl (16.1 MB view details)

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

solders-0.15.1-cp37-abi3-musllinux_1_2_i686.whl (8.9 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.15.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0 MB view details)

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

solders-0.15.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (15.6 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.15.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.8 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.15.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (17.1 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.15.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (25.5 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.15.1.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.15.1.tar.gz
Algorithm Hash digest
SHA256 5ec6194980e32136c4fe18c293dce596ae40fd0c148f24621361d9d3a4f2e29d
MD5 a2b205b3e980a184a68637b92bdc7a2c
BLAKE2b-256 accd439a22b09bce9bab2752978ed19fcac466e461e84c98f591050f89955439

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 bb393a1826382e87ec41e01d7125d8457fe19b8ac7480395633e76ba48a5a9a1
MD5 781e925c326b0f294a9c6ae0bffd69e3
BLAKE2b-256 b4ffddffd486a194403090b069ef37c60c0d76937219a16f8a5dc7efbc3cbc95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 2d69c69aaac94006e9315bf820dab1bd0c179acecc85b9cab4475fa3230b82c2
MD5 06b1dd25ffea57e5dc4fca517bc285c3
BLAKE2b-256 79e4c8ab13d83b453c8272afe4ebaee4a0e6b30aeac8ab47fc3a535de8df4d78

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 506b2d6560b19df4bd33d547801af3554a6c9c34fc46270e6a6bffbaccf529bc
MD5 ab8d33a08730a85557f21572a643c07a
BLAKE2b-256 703125faa964593a288fc149294c0632df813d628cf213dc278b0e41e8e9a95e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 dd2a720ee52884727798b7f944b4fa7be4280ff705e6a790b87947c5f74b4d66
MD5 2500f1e2a431f805a1009040d8f9400b
BLAKE2b-256 2778974ac685cbd91f9c4ebbb9ab8d7c7139c94e07acc3ebbd05ddbc17287312

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 2cb35a2b092303a7a7ba7de797f95f24ad1abf13b28e17c7668970a413958b0d
MD5 bdf31376fc1bf7cef6e8206555717413
BLAKE2b-256 bc6f7abb3ddde5fd8ad8b67bcbed012ffdac2277571db7614875ab2f00caf144

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d6c0d4e403e708e56c2c12e3debb7a9ae0e278ccd08e67c659c1de1156977525
MD5 7b03f3491f5e37a902c869e802f5eabd
BLAKE2b-256 c23b67edb91a13fcf2c49c91a6383ba8e4f1cabecf02f6dbeebb7ba1940c0379

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.1-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 0117d671d090593f6c482b8f51405684e2aa5ab7eef82e57d30fd243eea73335
MD5 8f63a8f46560f8790720f820fe4ca454
BLAKE2b-256 8c66d872135a1d88706a68ce02c0f136fe4e8b353c9d11091abf423ff91dc577

See more details on using hashes here.

File details

Details for the file solders-0.15.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.15.1-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 23a410024fbce8b57a759342714e9ae5f9eda78fe2f0c648ed601ec4cd2f9deb
MD5 714ab3c72d788c339de0c1b96dfe15fb
BLAKE2b-256 32ff3621ad1a72c3145422b53a4362b109ba39bc0bdd3fd7f5d84cf7b1c1832e

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