Skip to content

Commit c7ba721

Browse files
committed
Split out lower level RPC API
1 parent 8475c50 commit c7ba721

11 files changed

Lines changed: 1144 additions & 1032 deletions

docs/index.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,13 +91,13 @@ A quick usage example:
9191
signer = AccountSigner(acc)
9292

9393
async with client.session() as session:
94-
my_balance = await session.eth_get_balance(signer.address)
94+
my_balance = await session.get_balance(signer.address)
9595
print("My balance:", my_balance.as_ether(), "ETH")
9696

9797
another_address = Address.from_hex("0x<another_address>")
9898
await session.transfer(signer, another_address, Amount.ether(1.5))
9999

100-
another_balance = await session.eth_get_balance(another_address)
100+
another_balance = await session.get_balance(another_address)
101101
print("Another balance:", another_balance.as_ether(), "ETH")
102102

103103
trio.run(main)

docs/tutorial.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ Interacting with deployed contracts
178178
A :py:class:`~pons.DeployedContract` object wraps all ABI method objects into "bound" state, similarly to how Python methods are bound to class instances.
179179
It means that all the method calls created from this object have the contract address inside them, so that it does not need to be provided every time.
180180

181-
For example, to call a non-mutating contract method via :py:meth:`~pons.ClientSession.eth_call`:
181+
For example, to call a non-mutating contract method via :py:meth:`~pons.ClientSession.call`:
182182

183183
::
184184

185185
call = deployed_contract.method.getState(1)
186-
result = await session.eth_call(call)
186+
result = await session.call(call)
187187

188188
Note that when the :py:class:`~pons.ContractABI` object is created from the JSON ABI, even if the method returns a single value, it is still represented as a list of one element in the JSON, so the ``result`` will be a list too.
189189
If the ABI is declared programmatically, one can provide a single output value instead of the list, and then ``pons`` will unpack that list.

0 commit comments

Comments
 (0)