Ethereum wallet plugin for Polywrap Python Client
Project description
This package provides a Polywrap plugin for interacting with EVM networks.
The Ethereum wallet plugin implements the ethereum-provider-interface @ wrapscan.io/polywrap/ethereum-wallet@1.0 (see ../../interface/polywrap.graphql ). It handles Ethereum wallet transaction signatures and sends JSON RPC requests for the Ethereum wrapper.
Quickstart
Imports
>>> from polywrap_core import Uri >>> from polywrap_client import PolywrapClient >>> from polywrap_ethereum_wallet import ethereum_wallet_plugin >>> from polywrap_ethereum_wallet.connection import Connection >>> from polywrap_ethereum_wallet.connections import Connections >>> from polywrap_ethereum_wallet.networks import KnownNetwork >>> from polywrap_client_config_builder import ( ... PolywrapClientConfigBuilder ... )
Configure Client
>>> ethreum_provider_interface_uri = Uri.from_str("wrapscan.io/polywrap/ethereum-wallet@1.0") >>> ethereum_wallet_plugin_uri = Uri.from_str("plugin/ethereum-provider") >>> connections = Connections( ... connections={ ... "sepolia": Connection.from_network(KnownNetwork.sepolia, None) ... }, ... default_network="sepolia" ... ) >>> client_config = ( ... PolywrapClientConfigBuilder() ... .set_package( ... ethereum_wallet_plugin_uri, ... ethereum_wallet_plugin(connections=connections) ... ) ... .add_interface_implementations( ... ethreum_provider_interface_uri, ... [ethereum_wallet_plugin_uri] ... ) ... .set_redirect(ethreum_provider_interface_uri, ethereum_wallet_plugin_uri) ... .build() ... ) >>> client = PolywrapClient(client_config)
Invocation
>>> result = client.invoke( ... uri=ethreum_provider_interface_uri, ... method="request", ... args={"method": "eth_chainId"}, ... encode_result=False, ... ) >>> print(result) "0xaa36a7"
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for polywrap_ethereum_wallet-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6514cacddcf1db7083fdfa78f56f0c633f10aed1c89b4b7eefb620a2d54d8d17 |
|
MD5 | 5d5e2bf457de8ac132c3558f3aca8c00 |
|
BLAKE2b-256 | 9e1cac672c4ed9c4820aec93e427dcb7811f43ebd3e89eab6f0526cbd24426f0 |
Close
Hashes for polywrap_ethereum_wallet-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cffd46862ea855cf71d1e179c7cc773df9e7468bbe7febaa472fda87d8117e1 |
|
MD5 | f0287e36dae699d1c638f0bde28eb0ca |
|
BLAKE2b-256 | 1b98ea9f704b9e6a0177b46f975d81dd7b2db17364112e3395169372a1839ab2 |