sapphirepy documentation

sapphire.py

Installation

pip3 install --user -r requirements.txt
pip3 install --user -r requirements.dev.txt
make

Usage

from web3 import Web3
from sapphirepy import sapphire

# Setup your Web3 provider with a signing account.
w3 = Web3(Web3.HTTPProvider(sapphire.NETWORKS['sapphire-localnet']))
w3.middleware_onion.add(construct_sign_and_send_raw_middleware(account))

# Finally, wrap the provider to add Sapphire end-to-end encryption.
w3 = sapphire.wrap(w3)
# Optionally, query Oasis Web3 Gateway for the gas price.
# from web3.gas_strategies.rpc import rpc_gas_price_strategy
# w3.eth.set_gas_price_strategy(rpc_gas_price_strategy)

The Sapphire middleware for Web3.py ensures all transactions, gas estimates and view calls are end-to-end encrypted between your application and the smart contract.

License

The Deoxys-ii library and its test vectors are derived directly from the original go library.

The remainder of the Oasis Sapphire python bindings is licensed under Apache 2.0 license.