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

```python

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 programid = Pubkey.default() arbitraryinstructiondata = bytes([1]) accounts = [] instruction = Instruction(programid, arbitraryinstructiondata, 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:

sh poetry shell

Testing

  1. Run maturin develop to compile the Rust code.
  2. Run make fmt, make lint, and make test.