https://github.com/oceanprotocol/sapphire.py
Python wrapper for sending transactions in Oasis Sapphire network
https://github.com/oceanprotocol/sapphire.py
Last synced: 3 months ago
JSON representation
Python wrapper for sending transactions in Oasis Sapphire network
- Host: GitHub
- URL: https://github.com/oceanprotocol/sapphire.py
- Owner: oceanprotocol
- License: apache-2.0
- Created: 2023-07-26T21:54:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-03T21:53:34.000Z (almost 2 years ago)
- Last Synced: 2025-12-28T13:56:07.348Z (5 months ago)
- Language: Python
- Size: 17.4 MB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sapphirepy
Python wrapper for sending encrypted transactions on Oasis Sapphire network
## Installation
To install the package, you can either use PyPI or install from source:
### PyPI
To install from PyPI, you can simply run the following command:
```shell
pip install sapphirepy
```
### From Source
Alternatively, to install from the source, clone the repository and navigate into the directory:
```shell
git clone https://github.com/oceanprotocol/sapphirepy.git
cd sapphirepy
```
Then, you can install it using pip:
```shell
pip install .
```
## Usage
To use the package, you need to import the `wrapper` module and call the `send_encrypted_sapphire_tx` function.
```python
from sapphirepy import wrapper
response = wrapper.send_encrypted_sapphire_tx(
pk, # Your private key as a string
sender, # Sender's address as a string
recipient, # Recipient's address as a string
rpc_url, # RPC URL for the network as a string
eth_amount,# Amount of GWEI to send as an integer
gas_limit, # Gas limit for the transaction as an integer
data, # Transaction data as a string
)
```
### Return Value
The function `send_encrypted_sapphire_tx` will return 0 if the transaction has been successfully sent, otherwise it will return an error code corresponding to the issue encountered.