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

Uploaded Source

Built Distributions

solders-0.22.0-cp37-abi3-win_amd64.whl (5.6 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.22.0-cp37-abi3-musllinux_1_2_x86_64.whl (15.7 MB view details)

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

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

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.22.0-cp37-abi3-manylinux_2_28_aarch64.whl (7.2 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.28+ ARM64

solders-0.22.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.22.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (7.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.22.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.22.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl (27.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.22.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.22.0.tar.gz
Algorithm Hash digest
SHA256 2ae6cf45a3dcb833f36c7e6197d8a975185f8ab00d5e2f4b2195611806c02312
MD5 e84136a7ce14edb232dd09207c7abcdd
BLAKE2b-256 c3e1fc555911abdf1645b544517f85ef4c56635bf3ed75875026081ce237ed8a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 16732f4a43437121bdbb494e626db3737a33c6ba94b16016c35c34a23d5a2775
MD5 84de31e5890317d1e954648684aa8e18
BLAKE2b-256 9acf7b9d2e111e9e12b5ed3f4d7597c359418cb113f824844acac92213b2572e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 4ca64741a5a24c42813a89a0e75f7735a51bf56e01850a887f9428e33cd62ad0
MD5 f12413e91cb94efd09cb3029f00c312e
BLAKE2b-256 bc060ed28593a08bea22ce45617e9c747452bdab18c606a7467d210d932556b0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 786eb2b39a5f894998a7a46d8d959175a0027a0c643d06b514a702730042d380
MD5 a24307f07dfed77420844666f519fe04
BLAKE2b-256 741747e18bfc9477883e5984ef09f619706bfcc0b605ce0fe1fc082d81921fce

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 80e92568ec7e55045d97d201fe43b21d76ee92583810e1fec6e633f00cdb0df3
MD5 63852e4eafd7d98e5bc934c0357f9638
BLAKE2b-256 a37d2e61e00a4ad489ab900bbc8f4d2995f0560492f3ad1f0888c0def0c54cef

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 cef27fae7b9356ce19f96f58ed01235ddc15e3a276862fcf67902678f16c18e7
MD5 afe6fcf2ef8ef50e890b7f0d3fe16010
BLAKE2b-256 9ff5ed357038be255d52e0b037412fa03b4287cc375bf681fe527cc7835d0e55

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 3b390d62847e8d0dda69f31b53bde8731a586a7f6670630aa30804cc0ab52016
MD5 b495cc7bd7bad81908f117aef0981d65
BLAKE2b-256 a62f10fef0a58fc64e2bb7074fe6f093ad3222669993ca59bafbd138f7ee9b77

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.22.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl
Algorithm Hash digest
SHA256 81bf7943e1b3a31a6375e8a2e788a0a35b36357197eef281cce740bd705265c2
MD5 60659c4655d51973c99c13f1e05a6a83
BLAKE2b-256 a4172a7122455bc8b1e4c5772df88052a869307dce33291181cc574f67635005

See more details on using hashes here.

File details

Details for the file solders-0.22.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.22.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
Algorithm Hash digest
SHA256 f03a49ee921b233c37c1ac54ed3764b935602ba95c543d5b0b81ce41ead0b8dd
MD5 e62d07a64edb0fe4e58d9d6fdd08b1c2
BLAKE2b-256 632e4bfa1002052443d99f7b693f54b204061632db1945cde55c56aa286ff838

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