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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: snet.contracts-0.0.6.tar.gz
  • Upload date:
  • Size: 3.2 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.6.tar.gz
Algorithm Hash digest
SHA256 ec9afc1c7a81edacd2ad3a4a45f5c84961abbbfc37de1632a59b4d3cbdeec08e
MD5 b3bca1fceb983631a6c05b1695e071c2
BLAKE2b-256 2de3b89f64cb1ae00385cbbcca958720279e5ca00ff5793ab3f4dfea7bca6d24

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snet.contracts-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 d7753c902c072953b5336c9169b3a23e3804602541bd1be43d506209a672c5ed
MD5 5071c4cccc12bceef178baff9775892c
BLAKE2b-256 4eb6ff431579e360c81afa6896229a3c138fa9e4d0e7fafea28c83eeb0432889

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