Closed DanielSchiavini closed 7 months ago
Fixes #119 Depends on https://github.com/vyperlang/titanoboa/pull/132
Extended the interface with the browser to support RPC calls.
It includes two new classes on the python side:
BrowserRpc
boa.set_browser()
BrowserSigner
boa.set_network(url)
boa.set_env(NetworkEnv(url))
The JavaScript uses this method from ethers.js.
Tests are included, but unfortunately I had to mock all jupyter and tornado dependencies - they aren't installed in boa normally.
Install this branch and then run in Jupyter or Google Colab:
import boa boa.set_browser()
boa.env.eoa
boa.env.get_gas_price()
Fixes #119 Depends on https://github.com/vyperlang/titanoboa/pull/132
What I did
Extended the interface with the browser to support RPC calls.
How I did it
It includes two new classes on the python side:
BrowserRpc
calls the browser when a RPC call is madeboa.set_browser()
combinesBrowserRpc
andBrowserSigner
together to allow the environment to be used in boaboa.set_network(url)
works as an alternative toboa.set_env(NetworkEnv(url))
The JavaScript uses this method from ethers.js.
Tests are included, but unfortunately I had to mock all jupyter and tornado dependencies - they aren't installed in boa normally.
How to verify it
Install this branch and then run in Jupyter or Google Colab:
boa.env.eoa
should return your wallet address.boa.env.get_gas_price()
returns the current gas price.Description for the changelog
boa.set_browser()
interface to interact with the browser wallet RPC in JupyterLabCute Animal Picture