Name | stellar-contract-bindings JSON |
Version |
0.2.0b0
JSON |
| download |
home_page | None |
Summary | CLI tool designed to generate language bindings for Stellar Soroban smart contracts. |
upload_time | 2024-11-28 07:10:22 |
maintainer | None |
docs_url | None |
author | overcat |
requires_python | >=3.9 |
license | Apache-2.0 |
keywords |
stellar
soroban
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# stellar-contract-bindings
`stellar-contract-bindings` is a CLI tool designed to generate language bindings for Stellar Soroban smart contracts.
This tool simplifies the process of interacting with Soroban contracts by generating the necessary code to call contract
methods directly from your preferred programming language. Currently, it supports
Python. [stellar-cli](https://github.com/stellar/stellar-cli) provides support for TypeScript and Rust.
## Installation
You can install `stellar-contract-bindings` using pip:
```shell
pip install stellar-contract-bindings
```
## Usage
Please check the help message for the most up-to-date usage information:
```shell
stellar-contract-bindings --help
```
### Example
```shell
stellar-contract-bindings python --contract-id CDOAW6D7NXAPOCO7TFAWZNJHK62E3IYRGNRVX3VOXNKNVOXCLLPJXQCF --rpc-url https://mainnet.sorobanrpc.com --output ./bindings
```
This command will generate Python binding for the specified contract and save it in the `./bindings` directory.
### Using the Generated Binding
#### Python
After generating the binding, you can use it to interact with your Soroban contract. Here's an example:
```python
from stellar_sdk import Network
from bindings import Client # Import the generated bindings
contract_id = "CDOAW6D7NXAPOCO7TFAWZNJHK62E3IYRGNRVX3VOXNKNVOXCLLPJXQCF"
rpc_url = "https://mainnet.sorobanrpc.com"
network_passphrase = Network.PUBLIC_NETWORK_PASSPHRASE
client = Client(contract_id, rpc_url, network_passphrase)
assembled_tx = client.hello(b"world")
print(assembled_tx.result())
# assembled_tx.sign_and_submit()
```
## License
This project is licensed under the Apache-2.0 License. See the [LICENSE](LICENSE) file for details.
## Contributing
Contributions are welcome! The project is designed to be easy to add support for other languages, please open an issue
or submit a pull request for any improvements or bug fixes.
Raw data
{
"_id": null,
"home_page": null,
"name": "stellar-contract-bindings",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "stellar, soroban",
"author": "overcat",
"author_email": null,
"download_url": "https://files.pythonhosted.org/packages/d7/de/afa0527ea791bae1c0fb4ac5c39822685fc54528dbaa9b0558742395db5d/stellar_contract_bindings-0.2.0b0.tar.gz",
"platform": null,
"description": "# stellar-contract-bindings\n\n`stellar-contract-bindings` is a CLI tool designed to generate language bindings for Stellar Soroban smart contracts.\n\nThis tool simplifies the process of interacting with Soroban contracts by generating the necessary code to call contract\nmethods directly from your preferred programming language. Currently, it supports\nPython. [stellar-cli](https://github.com/stellar/stellar-cli) provides support for TypeScript and Rust.\n\n## Installation\n\nYou can install `stellar-contract-bindings` using pip:\n\n```shell\npip install stellar-contract-bindings\n```\n\n## Usage\n\nPlease check the help message for the most up-to-date usage information:\n\n```shell\nstellar-contract-bindings --help\n```\n\n### Example\n\n```shell\nstellar-contract-bindings python --contract-id CDOAW6D7NXAPOCO7TFAWZNJHK62E3IYRGNRVX3VOXNKNVOXCLLPJXQCF --rpc-url https://mainnet.sorobanrpc.com --output ./bindings\n```\n\nThis command will generate Python binding for the specified contract and save it in the `./bindings` directory.\n\n### Using the Generated Binding\n\n#### Python\n\nAfter generating the binding, you can use it to interact with your Soroban contract. Here's an example:\n\n```python\nfrom stellar_sdk import Network\nfrom bindings import Client # Import the generated bindings\n\ncontract_id = \"CDOAW6D7NXAPOCO7TFAWZNJHK62E3IYRGNRVX3VOXNKNVOXCLLPJXQCF\"\nrpc_url = \"https://mainnet.sorobanrpc.com\"\nnetwork_passphrase = Network.PUBLIC_NETWORK_PASSPHRASE\n\nclient = Client(contract_id, rpc_url, network_passphrase)\nassembled_tx = client.hello(b\"world\")\nprint(assembled_tx.result())\n# assembled_tx.sign_and_submit()\n```\n\n## License\n\nThis project is licensed under the Apache-2.0 License. See the [LICENSE](LICENSE) file for details.\n\n## Contributing\n\nContributions are welcome! The project is designed to be easy to add support for other languages, please open an issue\nor submit a pull request for any improvements or bug fixes.\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "CLI tool designed to generate language bindings for Stellar Soroban smart contracts.",
"version": "0.2.0b0",
"project_urls": {
"CI": "https://github.com/lightsail-network/stellar-contract-bindings/actions",
"Changelog": "https://github.com/lightsail-network/stellar-contract-bindings/releases",
"Homepage": "https://github.com/lightsail-network/stellar-contract-bindings",
"Issues": "https://github.com/lightsail-network/stellar-contract-bindings/issues"
},
"split_keywords": [
"stellar",
" soroban"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "8920c1e43a1741cb074d4fdb28874642f49fe4357f6688f72611e089704f55db",
"md5": "19735cc8d0ebc623a953e959837024d3",
"sha256": "16a384c2c596f8368a2757393acc903e7bc5c40ef23cc16a4161e76b64d18a29"
},
"downloads": -1,
"filename": "stellar_contract_bindings-0.2.0b0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "19735cc8d0ebc623a953e959837024d3",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 14346,
"upload_time": "2024-11-28T07:10:20",
"upload_time_iso_8601": "2024-11-28T07:10:20.772941Z",
"url": "https://files.pythonhosted.org/packages/89/20/c1e43a1741cb074d4fdb28874642f49fe4357f6688f72611e089704f55db/stellar_contract_bindings-0.2.0b0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "d7deafa0527ea791bae1c0fb4ac5c39822685fc54528dbaa9b0558742395db5d",
"md5": "c45ba3856c66e91ad7266153b41fe4b5",
"sha256": "e747531d84445138e0db2bc1c276a3ba7329c28ce00339175bfe5793407ab654"
},
"downloads": -1,
"filename": "stellar_contract_bindings-0.2.0b0.tar.gz",
"has_sig": false,
"md5_digest": "c45ba3856c66e91ad7266153b41fe4b5",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 15681,
"upload_time": "2024-11-28T07:10:22",
"upload_time_iso_8601": "2024-11-28T07:10:22.551185Z",
"url": "https://files.pythonhosted.org/packages/d7/de/afa0527ea791bae1c0fb4ac5c39822685fc54528dbaa9b0558742395db5d/stellar_contract_bindings-0.2.0b0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-28 07:10:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "lightsail-network",
"github_project": "stellar-contract-bindings",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "stellar-contract-bindings"
}