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.7.tar.gz (3.1 kB view details)

Uploaded Source

Built Distribution

snet.contracts-0.0.7-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file snet.contracts-0.0.7.tar.gz.

File metadata

  • Download URL: snet.contracts-0.0.7.tar.gz
  • Upload date:
  • Size: 3.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for snet.contracts-0.0.7.tar.gz
Algorithm Hash digest
SHA256 f28b06539a5490065077a7e611a11aba77f655197951a06ebeb5cb3ba8710aba
MD5 c85908f9e7c99571ee6f578536d5fa57
BLAKE2b-256 d57052270efa39abe5be09ff0e64ef143398e8b53b36d2536abc3d4fb69b1a8f

See more details on using hashes here.

File details

Details for the file snet.contracts-0.0.7-py3-none-any.whl.

File metadata

File hashes

Hashes for snet.contracts-0.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 67a03dd13c285f3dfda4af1425d9fabea145b0aa029f5569865482da6d4404e6
MD5 f4f413b5b68b9be8c9d5b7d7bd084aa6
BLAKE2b-256 0083a7e3e86e5d88e0273c593c4e95e659596373032fc5047cfe85de8c81ee05

See more details on using hashes here.

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