Skip to main content

Python binding to the Solana Rust SDK

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

Uploaded Source

Built Distributions

solders-0.15.0-cp37-abi3-win_amd64.whl (5.8 MB view details)

Uploaded CPython 3.7+ Windows x86-64

solders-0.15.0-cp37-abi3-musllinux_1_2_x86_64.whl (16.1 MB view details)

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

solders-0.15.0-cp37-abi3-musllinux_1_2_i686.whl (8.9 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.15.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.0 MB view details)

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

solders-0.15.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (15.6 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.15.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (15.8 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.15.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (17.1 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.15.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (25.5 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.15.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.15.0.tar.gz
Algorithm Hash digest
SHA256 7fe70c8fb7a1d038093bf4dfee44a427f81e9745e95f03b1ff4d6b4ade198e5f
MD5 bd7147d01b5a6da53cc382ce1c2e347c
BLAKE2b-256 afb82a8e1c45abf09b6b68f95a1cbcd9ba1d5b30455116f59055ab7e4ae2f7de

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 8968847f24e6de40a3c976f7809cc6ea746d46c621ede7d115aefb807cf409a4
MD5 2b9d685a2d53e5ab84bc4909565b7cac
BLAKE2b-256 f8ed2149da6e73472214d6e41e3f2d12792a37877703f195755fde33f5ec2321

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 725c9fe0ac89250321f868feb08a2678bbf679e24fa72321e27f71c38bd70794
MD5 7906e08072da8832cd9957ec4e67c8b4
BLAKE2b-256 7ab0bff77d7a7f99e348611afa6378b7eddb7ff112ab45f9b3f60542159b7af6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 48e260f2782d76598378484e6680da40f8a55d3017d2e65983dc5ff58a6b523f
MD5 6764c1202ebf47d0fb9ea4b44081386e
BLAKE2b-256 3cb93e579df6ebbff176116e8497626a0580df784c92ab118a3f6a465419ed76

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0276a77b4fde41cd6bd45856005e9808b855bba97991916484ea5ba29cfa338c
MD5 0036518cecc1c80118c853a86c8b4021
BLAKE2b-256 f26c267db3603306c765401a850626457ac9b0a5409b19b3b819dac42b94416f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 e71b75e0ce163e8100d9d204fbdff4e3b61982db1063c58134bb418d16cda264
MD5 ca189905b0cf15c0ab57e0837e86a57f
BLAKE2b-256 4f1ff0d8692b2201e1b29cb5d23a3a62fe4c33fcf1958f35ddfdbc5499171d54

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b4ab857637d73dfeba2db6b0421b61047d51840cf99c910aa498c950a35e2cc0
MD5 55fc4e0f24a08f90d857ddb6f0911552
BLAKE2b-256 3411987f14abdc94aacbfe55e6aa3552547825219631079d84a3eb137201f1da

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.15.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 8395a6887bf275d2d38e1f8581020e0258c605be344c8baf0a95442e1a79a8ea
MD5 452f56ba35c11cc94ebd43bcc55f9292
BLAKE2b-256 9a4a1368b03915918b513c592cd4e614502394566d260658c4b51feb2e06e4b1

See more details on using hashes here.

File details

Details for the file solders-0.15.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.15.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 d015bf49625a7fe90744e3597fa0e4c4d7cd317576f46792bf078e397a141599
MD5 b0df100a79c7e3ae7f4e796ab6298108
BLAKE2b-256 bad434492be8706ef1dd2463dd853e5a89f54685a6f66dc9807d9624dbadbdf4

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