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.0b8.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a32167e8efa12631434c444d3a84649a1867405803aa7fe7f526444e297f72e9 |
|
MD5 | 350ff492bfe99b5745a3657fe2f0817d |
|
BLAKE2b-256 | 787cb785ec7a69175c8978d83e6cb494e337571b9855afd4dc60806cc1b8ae6c |
Close
Hashes for polywrap_ethereum_wallet-0.1.0b8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcbfda99c96eeb07708943de0d46445edbcb99cb45f6c772616987e29c88e23b |
|
MD5 | 47a714da3efbf044b0267250b3e46eae |
|
BLAKE2b-256 | 5440509e84d5778c127c2531116c592cf0d0b450a75f800c15d351badcc6e6cd |