Skip to main content

SingularityNET Ecosystem Contracts

Project description

SingularityNET Ecosystem Contracts Package

The package was created to easily work with SingularityNET ecosystem EVM contracts with Python

Usage

Easily get an instance of the contract you need from any SingularityNET product with just one call to one of the functions

Install:

pip install snet.contracts

Usage:

from snet_contracts import get_contract_deployment_block, get_contract_object

import web3

provider = web3.HTTPProvider("https://mainnet.infura.io/v3/")
w3 = web3.Web3(provider)

token_contract_instance = get_contract_object(w3, "SingularityNetToken")
deployed_block = get_contract_deployment_block(w3, "SingularityNetToken")
print("Block:", deployed_block)

Result:

Block: 12326815

Optional: get an instance at the contract address

token_contract_instance = get_contract_object(w3, "SingularityNetToken" "0x5B7533812759B45C2B44C19e320ba2cD2681b542")

Tests

python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
python3 test/unit_test.py

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snet.contracts-0.0.4.tar.gz (3.1 kB view hashes)

Uploaded Source

Built Distribution

snet.contracts-0.0.4-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page