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.litesvm 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 litesvm 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.26.0.tar.gz (181.1 kB view details)

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

solders-0.26.0-cp37-abi3-musllinux_1_2_x86_64.whl (7.0 MB view details)

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

solders-0.26.0-cp37-abi3-musllinux_1_2_i686.whl (7.1 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.26.0-cp37-abi3-manylinux_2_28_aarch64.whl (6.9 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

solders-0.26.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.5 MB view details)

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

solders-0.26.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (6.7 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.26.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (7.3 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.26.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (24.3 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.26.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.26.0.tar.gz
Algorithm Hash digest
SHA256 057533892d6fa432c1ce1e2f5e3428802964666c10b57d3d1bcaab86295f046c
MD5 8403f59b0b49b8db1875ea383c58f249
BLAKE2b-256 879623ad2e43e2676b78834064fe051e3db3ce1899336ecd4797f92fcd06113a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 5466616610170aab08c627ae01724e425bcf90085bc574da682e9f3bd954900b
MD5 b9c56bf5df35a45f3b02acf2414521b6
BLAKE2b-256 23e8dc992f677762ea2de44b7768120d95887ef39fab10d6f29fb53e6a9882c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5946ec3f2a340afa9ce5c2b8ab628ae1dea2ad2235551b1297cafdd7e3e5c51a
MD5 a0e2061284c6ed0c1c2a54cd039b4103
BLAKE2b-256 ba5e822faabda0d473c29bdf59fe8869a411fd436af8ca6f5d6e89f7513f682f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 59b52419452602f697e659199a25acacda8365971c376ef3c0687aecdd929e07
MD5 e4e041ae4fcd1bbf96d141f991bcd6f0
BLAKE2b-256 7d345174ce592607e0ac020aff203217f2f113a55eec49af3db12945fea42d89

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b3cc55b971ec6ed1b4466fa7e7e09eee9baba492b8cd9e3204e3e1a0c5a0c4aa
MD5 cd4ffce56f1a4a3d27c0884d4e3c0635
BLAKE2b-256 bbe7533367d815ab000587ccc37d89e154132f63347f02dcaaac5df72bd851de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 36e6a769c5298b887b7588edb171d93709a89302aef75913fe893d11c653739d
MD5 0cb8fb01f93a10b38b7cb958ff953538
BLAKE2b-256 4133d17b7dbc92672351d59fc65cdb93b8924fc682deba09f6d96f25440187ae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 1b964efbd7c0b38aef3bf4293ea5938517ae649b9a23e7cd147d889931775aab
MD5 1d17e98da0fe04032968c6554bbff4b3
BLAKE2b-256 5a35221cec0e5900c2202833e7e9110c3405a2d96ed25e110b247f88b8782e29

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.26.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 3e3973074c17265921c70246a17bcf80972c5b96a3e1ed7f5049101f11865092
MD5 16921cbc3be504474bc56f82db0babd5
BLAKE2b-256 52e0ab41ab3df5fdf3b0e55613be93a43c2fe58b15a6ea8ceca26d3fba02e3c6

See more details on using hashes here.

File details

Details for the file solders-0.26.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.26.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 9c1a0ef5daa1a05934af5fb6e7e32eab7c42cede406c80067fee006f461ffc4a
MD5 f7094d629a5f534f6d29bfbbda7b9a2d
BLAKE2b-256 a5ce58bbb4d2c696e770cdd37e5f6dc2891ef7610c0c085bf400f9c42dcff1ad

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