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

Uploaded Source

Built Distributions

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

Uploaded CPython 3.7+ Windows x86-64

solders-0.18.0-cp37-abi3-musllinux_1_2_x86_64.whl (17.1 MB view details)

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

solders-0.18.0-cp37-abi3-musllinux_1_2_i686.whl (9.4 MB view details)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.18.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.9 MB view details)

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

solders-0.18.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (16.5 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.18.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (16.7 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.18.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl (18.0 MB view details)

Uploaded CPython 3.7+ manylinux: glibc 2.12+ i686

solders-0.18.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (26.9 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.18.0.tar.gz.

File metadata

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

File hashes

Hashes for solders-0.18.0.tar.gz
Algorithm Hash digest
SHA256 8c32aa7c3a0fa87a2f4589279ce70b17261096bae09316ca4a4e1052f471c629
MD5 ff13922b65b2c6e9ca26a249ba645281
BLAKE2b-256 12d522228b236dec381bebd4d653a7747e9a131e2c5b8097fad2bcf20b9ed082

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 40cc86dccee766c05ccd594a66761b44248907bfbfa85956bbbc9fb504dde7cd
MD5 2ca2ff997d1f163fe998e146f15ad6a2
BLAKE2b-256 d40cecc82b50cddade13e9280e5b008f174bb489fcd6d45e64bddd1b4d0eabcc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 632ba10040d3fac819363abb3cbbd3a5974e8c9800b897ca9641efe9b36b4975
MD5 586288f5123e595985e1b028ae88287e
BLAKE2b-256 40bad717a36b6fc2005df8d9bf143aab8b02d89e99092ea9d89d11c9bca8a60d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 3260b9d3c469818d9229a667621b4714863fa35ca2709a1c6e224efc21e516cc
MD5 9ae1834a1edda63b3425b1b8e21f6671
BLAKE2b-256 5baaa147d22fad29911c87a722a2751e903070cb534eb8e2cbc6ddb32d5ad3a6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 a29449f6827d2a220bed2873f4a485f000e01ddc9f58ba19771c5d53fa4fe28d
MD5 a903bf24906cde433c695e43172bed3c
BLAKE2b-256 0d262067b9d5d07094c99a8f6e8bb5d28e782f12b33fca350ee17c3e9b12efe0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
Algorithm Hash digest
SHA256 07c700ad784754609cffe2fd4177124c359d5353ba1d2d8b6d4e8ae59957aa7d
MD5 fdb4d8c9dbf355a57cbec56395882174
BLAKE2b-256 3d0a9d47afa0f41d4dc6ee520c6941752a77376db6c035c236606454e5164efd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 90be96a432d8580ff52eed6098b4be12c064829588304f8f2a79d9adfd2b789d
MD5 aaba34ee6c59f4e133c0c5521a8486e0
BLAKE2b-256 099f4e20618a7ddc5a037984262e0c7916b0aedaec905f090ebacb3e48b85fa1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for solders-0.18.0-cp37-abi3-manylinux_2_12_i686.manylinux2010_i686.whl
Algorithm Hash digest
SHA256 0b7c9cafffa570652aaabf5d3ccc987ea18c9470718631e4881ca679823b18ae
MD5 699dbed143d070388e6a5ba356eab639
BLAKE2b-256 82128c82103c968487eca6991294284369b3cf1b3317b08268979d604319c095

See more details on using hashes here.

File details

Details for the file solders-0.18.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.18.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 cd30c9a2b1967975b2d05895cc4a3ef701c9e686a1d156e131a6c97d4b1decd5
MD5 5c6bf85161344238305d893aa0b47f28
BLAKE2b-256 fe709edbe8758be8bcd16070298f89ab81acde533fcd5a0c48b33acb11b19b07

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