Skip to main content

Python library that facilitates interaction with ethereum wallet address.

Project description

Web3 Token Connector

Python library that facilitates interaction with ethereum wallet address.

Usage

Create an instance of a Wallet class

Instantiate with any web3 provider accepted by Web3 class:

from web3.providers.websocket import WebsocketProvider
from web3_wallet_connector import Wallet

provider = WebsocketProvider("wss://<node_address_here>")
wallet_checksum_address = "<your_address_here>"
wallet_private_key = "<your_private_key>"

wallet = Wallet(provider, wallet_checksum_address, wallet_private_key)

Send ETH or ERC20 tokens

Send ETH:

to_address = "<recipient_address_here>"
# Amount in Wei
amount = 10000000
# Transaction priority (low, medium or high)
priority = "medium"

# Returns transaction receipt
tx_receipt = wallet.send(to_address, amount, priority)

Send ERC20 token:

to_address = "<recipient_address_here>"
# Amount in Wei
amount = 10000000
# Transaction priority (low, medium or high)
priority = "medium"
# Example: MANA token eth address
token_address = "0x0f5d2fb29fb7d3cfee444a200298f468908cc942"

# Returns transaction receipt
tx_receipt = wallet.send(to_address, amount, priority, token_address)

Get ETH or ERC20 token balance

Get ETH balance:

balance = wallet.get_balance()

Get ERC20 token balance:

# Example: MANA token eth address
token_address = "0x0f5d2fb29fb7d3cfee444a200298f468908cc942"

balance = wallet.get_balance(token_address)

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

web3-wallet-connector-0.1.0.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

web3_wallet_connector-0.1.0-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file web3-wallet-connector-0.1.0.tar.gz.

File metadata

  • Download URL: web3-wallet-connector-0.1.0.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.7.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for web3-wallet-connector-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5e39c35366531391d699d5c7ceb4f564fa0d889d2fd63bcf89adc69eb1c98267
MD5 d55330185176536f92e64ae467290959
BLAKE2b-256 60d193fbdc78d1b506909f5335ff667da7ea67f01d00277a8aa549ca4b18f7f2

See more details on using hashes here.

File details

Details for the file web3_wallet_connector-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: web3_wallet_connector-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/35.0 requests/2.28.1 requests-toolbelt/0.9.1 urllib3/1.26.11 tqdm/4.64.0 importlib-metadata/4.12.0 keyring/23.7.0 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.13

File hashes

Hashes for web3_wallet_connector-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ce3bf6d096d71eaeeff747d588d32d297a77c960848afc9a818b5f8032f8daf3
MD5 742ab8fdeac83121f025831fb599b7f7
BLAKE2b-256 4d24b08aef2beb8c69ebb5f1f7c3de4b0e870e30cee865ebf80f11e68dc7e30f

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