Is it expected that the
.get()
requests executeestimateGasPrice
anddryRun
?
Yes, this is expected. The .get()
method internally performs a dryRun
, which allows us to retrieve the contract call response without executing a real transaction and incurring costs. The estimateGasPrice
step is necessary because, even during a dryRun
, the gas and fees must be accurately estimated to ensure proper validation of the call.
You can use the multiCall
feature to execute multiple contract .get()
calls within a single dryRun
operation:
// the chain call can be originated for any of the used contracts
const { value: results } = await contract1
.multiCall([
contract1.functions.foo(1336),
contract2.functions.bar(1337),
contract3.functions.baz(1338),
contract1.functions.foo_2(1336),
]).get();
The value
property will be an array containing the returned values in the same order as the calls were made.
For example, the result of the first contract function (contract1.functions.foo(1336)
) will be at index 0
, the second function (contract2.functions.bar(1337)
) at index 1
, and so on.
We also have these requests:
Are those requests getNodeInfo
and getChainInfo
? Are they happening for every connector instantiation?