CLI tool designed to generate language bindings for Stellar Soroban smart contracts.
Project description
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 provides support for TypeScript and Rust.
Installation
You can install stellar-contract-bindings using pip:
pip install stellar-contract-bindings
Usage
Please check the help message for the most up-to-date usage information:
stellar-contract-bindings --help
Example
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:
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 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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stellar_contract_bindings-0.2.1b0.tar.gz.
File metadata
- Download URL: stellar_contract_bindings-0.2.1b0.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
10e569e2cdb68aa2e24484faa743e5bf51e5e15ee4f676806a483fce82014c47
|
|
| MD5 |
80afd6191864b0997a6f118556cb9412
|
|
| BLAKE2b-256 |
207d656d9408a668f1c6c3f48e8a1557fcfb809e1f7fc7d5c593acdc03165226
|
Provenance
The following attestation bundles were made for stellar_contract_bindings-0.2.1b0.tar.gz:
Publisher:
continuous-integration-workflow.yml on lightsail-network/stellar-contract-bindings
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stellar_contract_bindings-0.2.1b0.tar.gz -
Subject digest:
10e569e2cdb68aa2e24484faa743e5bf51e5e15ee4f676806a483fce82014c47 - Sigstore transparency entry: 152368856
- Sigstore integration time:
-
Permalink:
lightsail-network/stellar-contract-bindings@30f52ea2b0108483aab08fc21d7ae640a7d60b4c -
Branch / Tag:
refs/tags/0.2.1b0 - Owner: https://github.com/lightsail-network
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
continuous-integration-workflow.yml@30f52ea2b0108483aab08fc21d7ae640a7d60b4c -
Trigger Event:
release
-
Statement type:
File details
Details for the file stellar_contract_bindings-0.2.1b0-py3-none-any.whl.
File metadata
- Download URL: stellar_contract_bindings-0.2.1b0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8959b73073a3c7e38ddd55802bacb1110ccbe7f21a9560f462d2676748bed348
|
|
| MD5 |
3294e5852e18e1a2571b449452c16c60
|
|
| BLAKE2b-256 |
fd49965cc68d9b4cc8a0b6fe8a92e3eb1453015df17ac64cb20c68c182984aa0
|
Provenance
The following attestation bundles were made for stellar_contract_bindings-0.2.1b0-py3-none-any.whl:
Publisher:
continuous-integration-workflow.yml on lightsail-network/stellar-contract-bindings
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stellar_contract_bindings-0.2.1b0-py3-none-any.whl -
Subject digest:
8959b73073a3c7e38ddd55802bacb1110ccbe7f21a9560f462d2676748bed348 - Sigstore transparency entry: 152368861
- Sigstore integration time:
-
Permalink:
lightsail-network/stellar-contract-bindings@30f52ea2b0108483aab08fc21d7ae640a7d60b4c -
Branch / Tag:
refs/tags/0.2.1b0 - Owner: https://github.com/lightsail-network
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
continuous-integration-workflow.yml@30f52ea2b0108483aab08fc21d7ae640a7d60b4c -
Trigger Event:
release
-
Statement type: