Name | solders JSON |
Version |
0.23.0
JSON |
| download |
home_page | None |
Summary | Python bindings for Solana Rust tools |
upload_time | 2024-11-10 14:43:06 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.7 |
license | MIT |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
<div align="center">
<img src="https://raw.githubusercontent.com/kevinheavey/solders/main/docs/logo.jpeg" width="50%" height="50%">
</div>
---
[![PyPI version](https://badge.fury.io/py/solders.svg)](https://badge.fury.io/py/solders)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/kevinheavey/solders/blob/main/LICENSE)
# 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](https://michaelhly.github.io/solana-py/rpc/async_api/) 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](https://crates.io/crates/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
```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
>>> 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](https://python-poetry.org/)
2. Install dev dependencies:
```
poetry install
```
3. 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`.
Raw data
{
"_id": null,
"home_page": null,
"name": "solders",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": null,
"author": null,
"author_email": "kevinheavey <kevinheavey123@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/fc/ab/9942f251097ea262bea3a2d0b6c45040442c10c5787b71240c2820eaccda/solders-0.23.0.tar.gz",
"platform": null,
"description": "<div align=\"center\">\n <img src=\"https://raw.githubusercontent.com/kevinheavey/solders/main/docs/logo.jpeg\" width=\"50%\" height=\"50%\">\n</div>\n\n---\n\n[![PyPI version](https://badge.fury.io/py/solders.svg)](https://badge.fury.io/py/solders)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/kevinheavey/solders/blob/main/LICENSE)\n\n# Solders\n\n`solders` is a high-performance Python toolkit for Solana, written in Rust. It provides robust solutions to the following problems:\n\n- Core SDK stuff: keypairs, pubkeys, signing and serializing transactions - that sort of thing.\n- RPC stuff: building requests and parsing responses (no networking stuff - if you want help with that, \n[solana-py](https://michaelhly.github.io/solana-py/rpc/async_api/) is your friend).\n- 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](https://crates.io/crates/solana-program-test) if you know that is.\n\n## What about solana-py?\n\n`solders` and `solana-py` are good friends. `solana-py` uses `solders` under the hood extensively in its\ncore API and RPC API. The main differences are:\n\n- `solders` doesn't have functions to actually interact with the RPC server (though `solana-py` does use the RPC code from `solders`).\n- `solders` doesn't provide SPL Token and SPL Memo clients.\n- `solana-py` may not have support for all the RPC requests and responses provided by `solders`.\n- `solana-py` doesn't have anything like the `bankrun` testing kit.\n\nSince `solana-py` uses `solders` under the hood and they don't duplicate each other's features, you should just use whichever library you need.\n\n## Installation\n\n```\npip install solders\n```\n\nNote: Requires Python >= 3.7.\n\n## Example Usage\n\n```python\n>>> from solders.message import Message\n>>> from solders.keypair import Keypair\n>>> from solders.instruction import Instruction\n>>> from solders.hash import Hash\n>>> from solders.transaction import Transaction\n>>> from solders.pubkey import Pubkey\n>>> program_id = Pubkey.default()\n>>> arbitrary_instruction_data = bytes([1])\n>>> accounts = []\n>>> instruction = Instruction(program_id, arbitrary_instruction_data, accounts)\n>>> payer = Keypair()\n>>> message = Message([instruction], payer.pubkey())\n>>> blockhash = Hash.default() # replace with a real blockhash\n>>> tx = Transaction([payer], message, blockhash)\n\n```\n\n## Development\n\n### Setup\n\n1. Install [poetry](https://python-poetry.org/)\n2. Install dev dependencies:\n\n```\npoetry install\n```\n\n3. Activate the poetry shell:\n\n```sh\npoetry shell\n```\n\n### Testing\n\n1. Run `maturin develop` to compile the Rust code.\n2. Run `make fmt`, `make lint`, and `make test`.\n\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python bindings for Solana Rust tools",
"version": "0.23.0",
"project_urls": {
"changelog": "https://github.com/kevinheavey/solders/blob/main/CHANGELOG.md",
"documentation": "https://kevinheavey.github.io/solders/",
"homepage": "https://github.com/kevinheavey/solders",
"repository": "https://github.com/kevinheavey/solders"
},
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "06d6c1eb92ea5549cfee8f62a3488de29923008c10e87898bba39d6201f845ed",
"md5": "20a49fe7f75988631985114a56992701",
"sha256": "87c2865f4f634abf56cc3fe9cfea985ddd0a09097d01b7716ed83ff6ef2ad1c6"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"has_sig": false,
"md5_digest": "20a49fe7f75988631985114a56992701",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 27236077,
"upload_time": "2024-11-10T14:42:43",
"upload_time_iso_8601": "2024-11-10T14:42:43.053917Z",
"url": "https://files.pythonhosted.org/packages/06/d6/c1eb92ea5549cfee8f62a3488de29923008c10e87898bba39d6201f845ed/solders-0.23.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "4b6cf63ef9925a053a013d45c1ec4a67ae485ea221d911d124454bef0368a85d",
"md5": "64bfdd58c9303796275d62bd3584fce4",
"sha256": "183fdc05ed0d6004d24bef17c01794a17be4a90f71c31429207bf33ec2e7738d"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"has_sig": false,
"md5_digest": "64bfdd58c9303796275d62bd3584fce4",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 6926426,
"upload_time": "2024-11-10T14:42:47",
"upload_time_iso_8601": "2024-11-10T14:42:47.010033Z",
"url": "https://files.pythonhosted.org/packages/4b/6c/f63ef9925a053a013d45c1ec4a67ae485ea221d911d124454bef0368a85d/solders-0.23.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "325d867a0769783046051fa745df21a3b0ef00ea8b6d9671657f490d20e9dda1",
"md5": "9de1cdc8cab4a7c7ab8fec3c8ebfbf63",
"sha256": "b1ba84ec23fc7af821dc7e5b48a6d247ae36b86457f930cbc64afa79587e4caf"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"has_sig": false,
"md5_digest": "9de1cdc8cab4a7c7ab8fec3c8ebfbf63",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 15470544,
"upload_time": "2024-11-10T14:42:49",
"upload_time_iso_8601": "2024-11-10T14:42:49.942028Z",
"url": "https://files.pythonhosted.org/packages/32/5d/867a0769783046051fa745df21a3b0ef00ea8b6d9671657f490d20e9dda1/solders-0.23.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "c669a33543e8ffa399e34aae46272d41a810d9ea5e1285f66e3547da7c70e359",
"md5": "ea78dc12d468ee39a3462363e79b70f5",
"sha256": "37d097f4a3e55e8870b9a81e7675834aa9b516e956c8b0c18adcac742573378c"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-manylinux_2_28_aarch64.whl",
"has_sig": false,
"md5_digest": "ea78dc12d468ee39a3462363e79b70f5",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 7133781,
"upload_time": "2024-11-10T14:42:53",
"upload_time_iso_8601": "2024-11-10T14:42:53.316731Z",
"url": "https://files.pythonhosted.org/packages/c6/69/a33543e8ffa399e34aae46272d41a810d9ea5e1285f66e3547da7c70e359/solders-0.23.0-cp37-abi3-manylinux_2_28_aarch64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e12144ec75b4c6ffa56f5a1bb09046156f41b5e05a397bbaf7289027de1bc551",
"md5": "a8e2f9b88be54ca7c4133d2a21492626",
"sha256": "6319929399fdd04d10c5cebbd76993e58d92ade05febec5a488eed7810aae270"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
"has_sig": false,
"md5_digest": "a8e2f9b88be54ca7c4133d2a21492626",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 7457170,
"upload_time": "2024-11-10T14:42:56",
"upload_time_iso_8601": "2024-11-10T14:42:56.103637Z",
"url": "https://files.pythonhosted.org/packages/e1/21/44ec75b4c6ffa56f5a1bb09046156f41b5e05a397bbaf7289027de1bc551/solders-0.23.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "eae6ffee411c48ca3ffeedf1bf9a633eac5d26240092a7e551a206a51495a992",
"md5": "dd51a4b3aaae8eea6320411d9631ce82",
"sha256": "67514b6dc2ecec9e15198e70eac329eac7b191f0f063c6ab80748b9ff921c3d5"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-musllinux_1_2_i686.whl",
"has_sig": false,
"md5_digest": "dd51a4b3aaae8eea6320411d9631ce82",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 7259632,
"upload_time": "2024-11-10T14:42:58",
"upload_time_iso_8601": "2024-11-10T14:42:58.550430Z",
"url": "https://files.pythonhosted.org/packages/ea/e6/ffee411c48ca3ffeedf1bf9a633eac5d26240092a7e551a206a51495a992/solders-0.23.0-cp37-abi3-musllinux_1_2_i686.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "f914902c802f44e09989feee5f750f5d5621041a681c222153cddb21c2dbe3f8",
"md5": "b336f145c3d430527cd671edd76590e5",
"sha256": "9cb2360a47f3f4772903dfb3314ec57b637f7fc8ac30690fec28d48e16edacf4"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-musllinux_1_2_x86_64.whl",
"has_sig": false,
"md5_digest": "b336f145c3d430527cd671edd76590e5",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 7205242,
"upload_time": "2024-11-10T14:43:00",
"upload_time_iso_8601": "2024-11-10T14:43:00.630726Z",
"url": "https://files.pythonhosted.org/packages/f9/14/902c802f44e09989feee5f750f5d5621041a681c222153cddb21c2dbe3f8/solders-0.23.0-cp37-abi3-musllinux_1_2_x86_64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "0d6bfd205612876b489f9c70bad04d8d7a98d462fb338a142e02991822f4f359",
"md5": "9864a52044626d50da2a4d38201910c3",
"sha256": "2976f6589a5a0a45600aee83b34312ad0d96ea03f8d358493143fc01223997c3"
},
"downloads": -1,
"filename": "solders-0.23.0-cp37-abi3-win_amd64.whl",
"has_sig": false,
"md5_digest": "9864a52044626d50da2a4d38201910c3",
"packagetype": "bdist_wheel",
"python_version": "cp37",
"requires_python": ">=3.7",
"size": 5530329,
"upload_time": "2024-11-10T14:43:03",
"upload_time_iso_8601": "2024-11-10T14:43:03.878457Z",
"url": "https://files.pythonhosted.org/packages/0d/6b/fd205612876b489f9c70bad04d8d7a98d462fb338a142e02991822f4f359/solders-0.23.0-cp37-abi3-win_amd64.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "fcab9942f251097ea262bea3a2d0b6c45040442c10c5787b71240c2820eaccda",
"md5": "d111dae47fab005ded03b02d85b55bb2",
"sha256": "f25e8908cca40a766a99dee1aa983fb7816949201b40ec927d0802debd3ec0e4"
},
"downloads": -1,
"filename": "solders-0.23.0.tar.gz",
"has_sig": false,
"md5_digest": "d111dae47fab005ded03b02d85b55bb2",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 182285,
"upload_time": "2024-11-10T14:43:06",
"upload_time_iso_8601": "2024-11-10T14:43:06.225030Z",
"url": "https://files.pythonhosted.org/packages/fc/ab/9942f251097ea262bea3a2d0b6c45040442c10c5787b71240c2820eaccda/solders-0.23.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-10 14:43:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kevinheavey",
"github_project": "solders",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "solders"
}