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

Uploaded Source

Built Distributions

solders-0.23.0-cp37-abi3-win_amd64.whl (5.5 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.23.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.2 MB view details)

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

solders-0.23.0-cp37-abi3-musllinux_1_2_i686.whl (7.3 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.23.0-cp37-abi3-manylinux_2_28_aarch64.whl (7.1 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

solders-0.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.5 MB view details)

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

solders-0.23.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (7.5 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.23.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (27.2 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.23.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.23.0.tar.gz
Algorithm Hash digest
SHA256 f25e8908cca40a766a99dee1aa983fb7816949201b40ec927d0802debd3ec0e4
MD5 d111dae47fab005ded03b02d85b55bb2
BLAKE2b-256 fcab9942f251097ea262bea3a2d0b6c45040442c10c5787b71240c2820eaccda

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 2976f6589a5a0a45600aee83b34312ad0d96ea03f8d358493143fc01223997c3
MD5 9864a52044626d50da2a4d38201910c3
BLAKE2b-256 0d6bfd205612876b489f9c70bad04d8d7a98d462fb338a142e02991822f4f359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9cb2360a47f3f4772903dfb3314ec57b637f7fc8ac30690fec28d48e16edacf4
MD5 b336f145c3d430527cd671edd76590e5
BLAKE2b-256 f914902c802f44e09989feee5f750f5d5621041a681c222153cddb21c2dbe3f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 67514b6dc2ecec9e15198e70eac329eac7b191f0f063c6ab80748b9ff921c3d5
MD5 dd51a4b3aaae8eea6320411d9631ce82
BLAKE2b-256 eae6ffee411c48ca3ffeedf1bf9a633eac5d26240092a7e551a206a51495a992

See more details on using hashes here.

File details

Details for the file solders-0.23.0-cp37-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 37d097f4a3e55e8870b9a81e7675834aa9b516e956c8b0c18adcac742573378c
MD5 ea78dc12d468ee39a3462363e79b70f5
BLAKE2b-256 c669a33543e8ffa399e34aae46272d41a810d9ea5e1285f66e3547da7c70e359

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b1ba84ec23fc7af821dc7e5b48a6d247ae36b86457f930cbc64afa79587e4caf
MD5 9de1cdc8cab4a7c7ab8fec3c8ebfbf63
BLAKE2b-256 325d867a0769783046051fa745df21a3b0ef00ea8b6d9671657f490d20e9dda1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 183fdc05ed0d6004d24bef17c01794a17be4a90f71c31429207bf33ec2e7738d
MD5 64bfdd58c9303796275d62bd3584fce4
BLAKE2b-256 4b6cf63ef9925a053a013d45c1ec4a67ae485ea221d911d124454bef0368a85d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 6319929399fdd04d10c5cebbd76993e58d92ade05febec5a488eed7810aae270
MD5 a8e2f9b88be54ca7c4133d2a21492626
BLAKE2b-256 e12144ec75b4c6ffa56f5a1bb09046156f41b5e05a397bbaf7289027de1bc551

See more details on using hashes here.

File details

Details for the file solders-0.23.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.23.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 87c2865f4f634abf56cc3fe9cfea985ddd0a09097d01b7716ed83ff6ef2ad1c6
MD5 20a49fe7f75988631985114a56992701
BLAKE2b-256 06d6c1eb92ea5549cfee8f62a3488de29923008c10e87898bba39d6201f845ed

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