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 Python binding to the Solana Rust SDK. It provides robust, high-performance solutions to core Solana tasks such as transaction signing and serialization, and saves us from reimplementing Solana logic in pure Python.

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.4.0.tar.gz (55.1 kB view hashes)

Uploaded Source

Built Distributions

solders-0.4.0-cp37-abi3-win_amd64.whl (2.1 MB view hashes)

Uploaded CPython 3.7+ Windows x86-64

solders-0.4.0-cp37-abi3-musllinux_1_2_x86_64.whl (3.7 MB view hashes)

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

solders-0.4.0-cp37-abi3-musllinux_1_2_i686.whl (3.7 MB view hashes)

Uploaded CPython 3.7+ musllinux: musl 1.2+ i686

solders-0.4.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.5 MB view hashes)

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

solders-0.4.0-cp37-abi3-manylinux_2_17_s390x.manylinux2014_s390x.whl (3.9 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ s390x

solders-0.4.0-cp37-abi3-manylinux_2_17_ppc64.manylinux2014_ppc64.whl (4.0 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ppc64

solders-0.4.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl (3.5 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARMv7l

solders-0.4.0-cp37-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (3.5 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.17+ ARM64

solders-0.4.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl (3.7 MB view hashes)

Uploaded CPython 3.7+ manylinux: glibc 2.5+ i686

solders-0.4.0-cp37-abi3-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (4.6 MB view hashes)

Uploaded CPython 3.7+ macOS 10.9+ universal2 (ARM64, x86-64) macOS 10.9+ x86-64 macOS 11.0+ ARM64

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