Ethereum provider in python
Project description
polywrap-ethereum-plugin
The Ethereum Provider plugin implements the ethereum-provider-interface
@ ens/wraps.eth:ethereum-provider@2.0.0 (see ../../interface/polywrap.graphql). It handles Ethereum wallet transaction signatures and sends JSON RPC requests for the Ethereum wrapper.
Usage
1. Configure Client
When creating your Polywrap Python client, add the ethereum wallet plugin:
from polywrap_client import PolywrapClient
from polywrap_ethereum_provider import ethereum_provider_plugin
ethereum_provider_plugin_uri = Uri.from_str("plugin/ethereum-provider")
connections = Connections(
connections={
"mocknet": Connection(provider, None),
"sepolia": Connection.from_network(KnownNetwork.sepolia, None)
},
default_network="sepolia",
signer=account.key if with_signer else None, # type: ignore
)
ethreum_provider_interface_uri = Uri.from_str("ens/wraps.eth:ethereum-provider@2.0.0")
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)
2. Invoke The Ethereum Wrapper
Invocations to the Ethereum wrapper may trigger sub-invocations to the Ethereum Provider plugin:
client.invoke(
uri=ethreum_provider_interface_uri,
method="getSignerAddress",
);
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.0a5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5378980238eba450288df7485e815e24179810bea293e10f74f7b1da80ec5d0a |
|
MD5 | 334221ff1d09ad31209fd4076ed635d2 |
|
BLAKE2b-256 | be86f51b3cbb1b3c823c5071bcb58cecbcd41f0d1676aeb8aec704fec30388d0 |
Close
Hashes for polywrap_ethereum_provider-0.1.0a5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78fbef2f706dda5674e6680f3554b9f968aa15126c88f83b636d058cf99c9d30 |
|
MD5 | 358fcd1bbe14a9a8e92f842fe28474d1 |
|
BLAKE2b-256 | f79a575d942e80a01b09ceed6dfcafb0c0e95e49241c69b323d9db5194bf18bb |