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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

solders-0.16.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.16.0-cp37-abi3-musllinux_1_2_i686.whl (9.3 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.16.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.6 MB view details)

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

solders-0.16.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.16.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (16.4 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.16.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (17.8 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.16.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (26.6 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.16.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.16.0.tar.gz
Algorithm Hash digest
SHA256 5c36f32048d0b11dddabbc8a2304c3eec15b5c931d6558569268d49440f865cf
MD5 a88adbca6003331d723d809d82ebd4c0
BLAKE2b-256 5e9bd02bdbcfe6908bdf1a02185947d4feb733bd8df96bd88a8aca0a6a0181a5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 80441e0c5ffb23d9c277a1177db44bc50ee7ee8d0fd7598ef4e48a0723246668
MD5 c8274f8ab7df6cc966ee385185fadcc8
BLAKE2b-256 e540aaa2ad57bd9800288463f3c76eb003054898602f53d7351536b15e625c0a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 47574cdf74921a383bbb774b8d56bab313b18299f2872bef0e242d75c466db3d
MD5 0c7776ae85c422aa19e1b3f65d19325a
BLAKE2b-256 ac5d79fae1436ee4b3fcf5ac9f7a12a4156955fd2728dbe1be186478afe28d2e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 c8f2b6d0a60f1ffe9436ca88cc40837b400c3d227842911066a95a18a369ef17
MD5 d5c836110280466f55d5d60fafc5866b
BLAKE2b-256 35ba0358d81264549a4cd030a5055edb9336e413299e8983d380b7946c69c6a7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f9cd4c0d630aba7c0b9fc47a718da50e37238c41fd9be73c81ce0a7fe9bbfe45
MD5 0fe12708d8f2416740fa3ec61df974d1
BLAKE2b-256 088bec079f54647c273e6412ad122ab56e04b08be19421ef63fc2ee79bb6037e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 1b2704ccb5e4e2e5a6ca4f4fda8bb1de37a67a7a60f61eb7bc245d9a23943a8b
MD5 f7f4e3c10437723ce120a69f7c72b596
BLAKE2b-256 18fdf91a400760a0f06a72b5e046de7111101f38a3fd32985f510697160bafb6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2dada5d50b52508f3d750f89e553e7dcd64c83a37a0e1483acec8c8613f75ba9
MD5 aa56213ed6b4c659fed438e289f8e8b5
BLAKE2b-256 f65f06c5d7d1f02a57842929785707ee0140e9562b3bad9172c314e474e67454

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.16.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 bd0e3c4970e25788161e37dc5f1798509514d9d6c92c1c8db431d8cd5621f5a5
MD5 e4bcc39e691cc79cee2b3447408ba099
BLAKE2b-256 07fb5cfb281871a438f921b16f7472fe07b308258492275b06cfb69b7688cc1e

See more details on using hashes here.

File details

Details for the file solders-0.16.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.16.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cc6d68751184a0b69b675352ac60b8c01f92942ae0decaa3da559af274ef1fc5
MD5 50a6d59e35e9b6a593db92f1089e85c9
BLAKE2b-256 a6c2ad0155d4a6afb7cace10b2438bbdb00e11f70861090d9c243c7e87999204

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