solders


Namesolders JSON
Version 0.25.0 PyPI version JSON
download
home_pageNone
SummaryPython bindings for Solana Rust tools
upload_time2025-01-26 22:07:53
maintainerNone
docs_urlNone
authorNone
requires_python>=3.7
licenseMIT
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.litesvm` 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 `litesvm` 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/70/bb/940e3b948e8210d66499a53675a35a40625a23f72c8a0b646b8315930297/solders-0.25.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.litesvm` 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 `litesvm` 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.25.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": "db4d0204157a5cca63238e4c2991f7ba22d71be1db8b5ec0dc25462df93b314e",
                "md5": "41bceaf115df7face377e46a469a8b72",
                "sha256": "be3b59319e457a43ce5eb451b687ebf00afc697eb864045dc0e9e77c5224f848"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl",
            "has_sig": false,
            "md5_digest": "41bceaf115df7face377e46a469a8b72",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 24702443,
            "upload_time": "2025-01-26T22:07:24",
            "upload_time_iso_8601": "2025-01-26T22:07:24.627143Z",
            "url": "https://files.pythonhosted.org/packages/db/4d/0204157a5cca63238e4c2991f7ba22d71be1db8b5ec0dc25462df93b314e/solders-0.25.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": "c5609f7f53a3445d3d462d9e0deb521e75fd210b188474ad60d2e14c5b305af0",
                "md5": "17991958c6a53709aab6ef9d404fc409",
                "sha256": "1196e10273f48b733658b44bdace6ffbb146eb78925a0954260e34f85c4e909b"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "has_sig": false,
            "md5_digest": "17991958c6a53709aab6ef9d404fc409",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 6898182,
            "upload_time": "2025-01-26T22:07:29",
            "upload_time_iso_8601": "2025-01-26T22:07:29.232975Z",
            "url": "https://files.pythonhosted.org/packages/c5/60/9f7f53a3445d3d462d9e0deb521e75fd210b188474ad60d2e14c5b305af0/solders-0.25.0-cp37-abi3-manylinux_2_17_armv7l.manylinux2014_armv7l.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "c4166890bafa1a5d68a96410677f0994e434d79b6e0b9e517fe589ec80b41bf1",
                "md5": "40d5f70b1f0eaa22adba6653e5128b1a",
                "sha256": "2d5220b49f821ddd6329ce8167e0ff3677d1802b4b2a674a60da741c6733bc63"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "has_sig": false,
            "md5_digest": "40d5f70b1f0eaa22adba6653e5128b1a",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 13676512,
            "upload_time": "2025-01-26T22:07:32",
            "upload_time_iso_8601": "2025-01-26T22:07:32.751911Z",
            "url": "https://files.pythonhosted.org/packages/c4/16/6890bafa1a5d68a96410677f0994e434d79b6e0b9e517fe589ec80b41bf1/solders-0.25.0-cp37-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3708c147ca93567027e3ed2eb93e951c812b3e7d7bab8810dcfe67c4a112b8d6",
                "md5": "0ab3b43c45ac56c367508c5c977a20c2",
                "sha256": "889e6bb4949fc89b655c8da5fd9fe5ae3ce9c432c41b919debe1fc84ead19a5e"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-manylinux_2_28_aarch64.whl",
            "has_sig": false,
            "md5_digest": "0ab3b43c45ac56c367508c5c977a20c2",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 7104185,
            "upload_time": "2025-01-26T22:07:37",
            "upload_time_iso_8601": "2025-01-26T22:07:37.350828Z",
            "url": "https://files.pythonhosted.org/packages/37/08/c147ca93567027e3ed2eb93e951c812b3e7d7bab8810dcfe67c4a112b8d6/solders-0.25.0-cp37-abi3-manylinux_2_28_aarch64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ddab175b9447e857133cc1dad328bd5e806b4f190823b11197b3a8b0f3b32843",
                "md5": "338750c41545d134ff0a0d4b462d1d76",
                "sha256": "92463b632c8c08df53f800045f18d3691dac1b98241f1840b958ac175098777b"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
            "has_sig": false,
            "md5_digest": "338750c41545d134ff0a0d4b462d1d76",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 7562109,
            "upload_time": "2025-01-26T22:07:40",
            "upload_time_iso_8601": "2025-01-26T22:07:40.841277Z",
            "url": "https://files.pythonhosted.org/packages/dd/ab/175b9447e857133cc1dad328bd5e806b4f190823b11197b3a8b0f3b32843/solders-0.25.0-cp37-abi3-manylinux_2_5_i686.manylinux1_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "272a68035b44c2bdd57191f92c06becdaa82716ee9d40f6a6d3303c72946b8af",
                "md5": "32b54410ecbc2b62bd0de9e1542c7dd9",
                "sha256": "ec3211cd4a5a968762d108a164ae652ffae07b10dc87e91f236fe6c27b903f0d"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-musllinux_1_2_i686.whl",
            "has_sig": false,
            "md5_digest": "32b54410ecbc2b62bd0de9e1542c7dd9",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 7364091,
            "upload_time": "2025-01-26T22:07:44",
            "upload_time_iso_8601": "2025-01-26T22:07:44.417924Z",
            "url": "https://files.pythonhosted.org/packages/27/2a/68035b44c2bdd57191f92c06becdaa82716ee9d40f6a6d3303c72946b8af/solders-0.25.0-cp37-abi3-musllinux_1_2_i686.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "cf9a8a061a506ba83796e4870a0d9dd062d7a8d53567566a347962670bf0ff97",
                "md5": "36360e871d577aa3c034c21ef66fec8d",
                "sha256": "0be433486e014879ab357c7475b4f973b73991c7e1386b36be2206a88d5cabcf"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-musllinux_1_2_x86_64.whl",
            "has_sig": false,
            "md5_digest": "36360e871d577aa3c034c21ef66fec8d",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 7190772,
            "upload_time": "2025-01-26T22:07:47",
            "upload_time_iso_8601": "2025-01-26T22:07:47.636945Z",
            "url": "https://files.pythonhosted.org/packages/cf/9a/8a061a506ba83796e4870a0d9dd062d7a8d53567566a347962670bf0ff97/solders-0.25.0-cp37-abi3-musllinux_1_2_x86_64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5886251b4f84409e7f88f992e55cb7ea06c08b1e71b46b13c895e8066982f457",
                "md5": "9ab50002cdabe519a1c43e081999cc51",
                "sha256": "559db19024e7f2ef0c6b20b2c8dfa2adc6b5bab0b1e420d2b3167b5d8f7e1501"
            },
            "downloads": -1,
            "filename": "solders-0.25.0-cp37-abi3-win_amd64.whl",
            "has_sig": false,
            "md5_digest": "9ab50002cdabe519a1c43e081999cc51",
            "packagetype": "bdist_wheel",
            "python_version": "cp37",
            "requires_python": ">=3.7",
            "size": 7164623,
            "upload_time": "2025-01-26T22:07:51",
            "upload_time_iso_8601": "2025-01-26T22:07:51.133854Z",
            "url": "https://files.pythonhosted.org/packages/58/86/251b4f84409e7f88f992e55cb7ea06c08b1e71b46b13c895e8066982f457/solders-0.25.0-cp37-abi3-win_amd64.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "70bb940e3b948e8210d66499a53675a35a40625a23f72c8a0b646b8315930297",
                "md5": "317e31f1354991eac9a9df74a511d5ba",
                "sha256": "9a22e018de90360716d62709d30507b725adca66a24e35c87ae87f4dc56a7ce8"
            },
            "downloads": -1,
            "filename": "solders-0.25.0.tar.gz",
            "has_sig": false,
            "md5_digest": "317e31f1354991eac9a9df74a511d5ba",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 175095,
            "upload_time": "2025-01-26T22:07:53",
            "upload_time_iso_8601": "2025-01-26T22:07:53.042578Z",
            "url": "https://files.pythonhosted.org/packages/70/bb/940e3b948e8210d66499a53675a35a40625a23f72c8a0b646b8315930297/solders-0.25.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-01-26 22:07:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "kevinheavey",
    "github_project": "solders",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "solders"
}
        
Elapsed time: 0.36240s