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.0a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab324c0da525e5427ba20c70c0edc1f58fa1654dc983250df4c8002d472223d0 |
|
MD5 | 33c65c0c4ff4f201af6f9d10f1d5b2c3 |
|
BLAKE2b-256 | 3ede46f7398f572acd6618efeaf687f9182151bc79b1890537c4bfe4598dc6ca |
Close
Hashes for polywrap_ethereum_provider-0.1.0a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fbb445359408dd3df2a9a29b97cf46e3b97c76937bc99cad3abed9394aaa55d5 |
|
MD5 | 7abbefcfbe35d48e32eeafe9b6ee6e2f |
|
BLAKE2b-256 | 23f0cd758b5dfb62ad6d14572c184e31869fa5aeefc2623a2fe30ce49b80e4ed |