Skip to main content

anduschain-python SDK ( web3.py wrapped )

Project description

anduschain-python

Install

pip install anduscahin

Usage

from web3 import Web3
from anduschain.middleware import construct_sign_and_send_raw_middleware

my_provider = Web3.HTTPProvider('http:/RPC-URL:8545')
w3 = Web3(my_provider)

ADDRESS = '0xfef6f81c2c9e1fa327cad572d352b913bc074a0d'
KEY_FILE = './tmp/UTC--2019-09-30T08:50:41Z--fef6f81c2c9e1fa327cad572d352b913bc074a0d.json'
KEY_PASS = 'KEYPASS

sender = Web3.toChecksumAddress(ADDRESS)

# read local keyfile
with open(KEY_FILE) as keyfile:
    encrypted_key = keyfile.read()
    private_key = w3.eth.account.decrypt(encrypted_key, KEY_PASS)

# add anduschain middleware
w3.middleware_onion.add(construct_sign_and_send_raw_middleware(private_key))
w3.eth.defaultAccount = sender

try:
    result = w3.eth.sendTransaction({'to': sender, 'gas': 21000, 'value': 1})
    print(Web3.toHex(result))
except Exception as err:
    print("=====Exception======", str(err))

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

anduschain-1.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

anduschain-1.0.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file anduschain-1.0.1.tar.gz.

File metadata

  • Download URL: anduschain-1.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for anduschain-1.0.1.tar.gz
Algorithm Hash digest
SHA256 7dd5ca1f4e98035ed02794f1d8fa19eac76a78cc3613140d89a2e4eb21056441
MD5 66f5e27c9ce9a54a3e62be8efa1896ce
BLAKE2b-256 18812a358ca0c5c8794fd08b6274fd54183e2d64b45063b86825b7e31d8c517c

See more details on using hashes here.

File details

Details for the file anduschain-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: anduschain-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.3

File hashes

Hashes for anduschain-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8a51e27ecfb04295f5896190ecc2badc0c0d2b3927a64eebf0107addc57231bd
MD5 37dc72efc680eade46929203052c5ac8
BLAKE2b-256 0435e19d449a71b71eb00b9dec93142d0040f4ea9c961cd6e6a79f897762e58c

See more details on using hashes here.

Supported by

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