Ethereum provider in python
Project description
This package provides a Polywrap plugin for interacting with EVM networks.
The Ethereum Provider plugin implements the ethereum-provider-interface @ [ens/wraps.eth:ethereum-provider@2.0.0](https://app.ens.domains/name/wraps.eth/details) (see [../../interface/polywrap.graphql](../../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_provider import ethereum_provider_plugin >>> from polywrap_ethereum_provider.connection import Connection >>> from polywrap_ethereum_provider.connections import Connections >>> from polywrap_ethereum_provider.networks import KnownNetwork >>> from polywrap_client_config_builder import ( ... PolywrapClientConfigBuilder ... )
Configure Client
>>> ethreum_provider_interface_uri = Uri.from_str("ens/wraps.eth:ethereum-provider@2.0.0") >>> ethereum_provider_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_provider_plugin_uri, ... ethereum_provider_plugin(connections=connections) ... ) ... .add_interface_implementations( ... ethreum_provider_interface_uri, ... [ethereum_provider_plugin_uri] ... ) ... .set_redirect(ethreum_provider_interface_uri, ethereum_provider_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_provider-0.1.0b5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 42ac382be314102335e9348d056898e783df5250dbf721a97f640b14c978c19c |
|
MD5 | db11a1b0d6df5d1248facb3d802b9c4d |
|
BLAKE2b-256 | c6d386a1c99b91dfdbfa3d58028a752c402212b0e5b6e8d378ea9f3b0f0caed5 |
Close
Hashes for polywrap_ethereum_provider-0.1.0b5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d2e98630e2257eda359b0e655cbf824266f41cd7b06b53bc3c51f5ab72b1edc |
|
MD5 | 0955b7881a150b4d1c320badc39eecd8 |
|
BLAKE2b-256 | 67085b735c0da7e3638aa1c3e3ad01b3703ea07fa2d6357f8699acf7f6b6f76f |