◻
Mobile SDK Batch Requests
Symbiosis Mobile SDK for Symbiosis protocol V1: Batch Requests
Symbiosis Mobile SDK supports batch requests: there is a "builder" and an "executor" for each request.
For example,
moko-web3
hasWeb3Requests
, and- The classes defined in the
contracts
package have fun something() in addition to fun somethingRequest() method.
For example:
balanceOf()
→ balanceOfRequest()
, reserves()
→ reservesRequest()
Important: there is an exception for write transactions. A write transaction should contain a correct, unique nonce. Therefore, you can send only one write transaction at a time.
There is an example of how to use a batch request:
val (uniBalance, daiBalance, ethBalance) = client.executeBatch(
uniToken.balanceOfRequest(address),
daiToken.balanceOfRequest(address),
Web3Requests.getNativeBalance(address)
)
It shows that calls can be repetitive within one batch request.
Limitations: within one batch request, you can work with one blockchain.
Last modified 11d ago