Skip to content

Python wrapper for sending transactions in Oasis Sapphire network

License

Notifications You must be signed in to change notification settings

oceanprotocol/sapphire.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

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:

pip install sapphirepy

From Source

Alternatively, to install from the source, clone the repository and navigate into the directory:

git clone https://github.com/oceanprotocol/sapphirepy.git
cd sapphirepy

Then, you can install it using pip:

pip install .

Usage

To use the package, you need to import the wrapper module and call the send_encrypted_sapphire_tx function.

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.

About

Python wrapper for sending transactions in Oasis Sapphire network

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •