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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

solders-0.19.0-cp37-abi3-musllinux_1_2_x86_64.whl (18.2 MB view details)

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

solders-0.19.0-cp37-abi3-musllinux_1_2_i686.whl (9.5 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.19.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.0 MB view details)

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

solders-0.19.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (8.8 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.19.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (17.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.19.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (9.7 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.19.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (29.0 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.19.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.19.0.tar.gz
Algorithm Hash digest
SHA256 939d25a546cb499484255ea6aa19649b56208ad6566798f794c8268262cd811e
MD5 85a0e91f4eb87aa081334a768439c480
BLAKE2b-256 2f6f6b4529a1bcd2bb981a0b933410c39c72434f5f8c906c51f753d923106dfd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 eeaa1289b3da9138c887853c315ecb139dcd3687bacf2ea5d9cb5855f7289f7d
MD5 51d2b4640e06c85adf84a8f9e3c0eb15
BLAKE2b-256 cc891ae239351fc9f10111791055280ad18c24965785cd8e72db0ab720f124f8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f636273ab0d733e6cd8c03589e80a09b47a660911b716c56039027aec249c2fa
MD5 1eeed74d734b12092c97f51c13446f63
BLAKE2b-256 7fa96689ecdc767da17b4e50b201ef2a4606e13978d85a5a7a69e1b4202a1a5f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3ac5486f9f1a87375647cdf6d87468c8aa6ee656059041eeeba5688d45d76756
MD5 4c6f6d6e962f95137087e9952b002fc7
BLAKE2b-256 b06d23582c6d2b8d64a11daa9e8f9a837f1b973961cd02e7820bfad2da46bf7e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 44713e86ba1774fb2629ac94f4a3eb302867ff38df771649314b60225dc23a47
MD5 5867cebb6a5894e38f1857a2ac379626
BLAKE2b-256 b781a3a640c630e969861f17f7b38e3e5caa402e984dcbd358ed253c15c89dc9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 f887d1eb4e64ec31fbb5228697bb7f562bb8fd91765e4c9e96729bd4b423d326
MD5 b6a55e2daa0826161a3eff8fd92a835d
BLAKE2b-256 c2e88b0541e5f23336112ac9d1ffeceffa00907ac54dfe0bf7a4663e9f2be01c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8e269cfc6d35c3e50612ae6139e82b96ae14bb7ae3b49e90ec51084bb2b73bc2
MD5 0afb3ba866d81957f15d7c2b2dd15ca7
BLAKE2b-256 9613bda6e02efbb8930ac3c2eaa60fbc0ffa1a7939036ee74005352706cbb746

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.19.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 d47628e7afe40a208974da1a9c1e8aea0daa18fbacf4c8c4cbdd7a87297b9d6b
MD5 ce68116c809077ecee1ff23ec72cb9e1
BLAKE2b-256 e98cf179c35fa8ff8a27cc802a5e4c1fc2d3000259b4d25878029bc608c9ebf5

See more details on using hashes here.

File details

Details for the file solders-0.19.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.19.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f7058bde8a83c469cf473a21ea7b1709a2288d7f389953fbc8e6930b6b7c8340
MD5 5237914b3da7bf500a79f81a6aea9a68
BLAKE2b-256 0fb603e96b710e661c5cd34de63a52f3f0a09e3a6bfde3d5ef6f33d11d5feac0

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