kevinheavey/solders
소개
Rust로 작성된 고성능 Solana용 Python 툴킷
비즈니스 및 금융측정된 스타 증가
- in 24h
- 0
- in 7 days
- 0
- in 15 days
- +5
- in 1 month
- 기록 수집 중
서로 겹치는 기간의 순증가량이며 일별 합계가 아닙니다. 측정값이 없으면 비워 둡니다. 스타는 관심도를 나타내며 품질을 보장하지 않습니다.
README.md
Original
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.litesvmmodule is an alternative tosolana-test-validatorthat'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:
soldersdoesn't have functions to actually interact with the RPC server (thoughsolana-pydoes use the RPC code fromsolders).soldersdoesn't provide SPL Token and SPL Memo clients.solana-pymay not have support for all the RPC requests and responses provided bysolders.solana-pydoesn't have anything like thelitesvmtesting 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.10.
Free-threaded CPython 3.14 is supported. Operations on distinct solders objects
can run concurrently, but callers should synchronize concurrent mutation of the
same object; conflicting mutable access may raise RuntimeError: Already borrowed.
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
- Install uv.
- Install the project dependencies (including dev tools):
uv sync --dev
- Activate the virtual environment (optional,
uv runworks without activation):
source .venv/bin/activate
Testing
- Run
uv run maturin developto compile the Rust code. - Run
uv run make fmt,uv run make lint, anduv run make test.
관련 프로젝트 살펴보기
불러오는 중…