@hot-labs/near-connect to connect a wallet and sign transactions, and near-api-js to query each contract through a shared RPC provider. Its Wallet wrapper exposes viewMethod for queries and signAndSendTransactions for wallet requests.
Particularly, this example shows how to:
- Query data from multiple contracts.
- Call methods in multiple contracts simultaneously.
Query Data from Multiple Contracts
To query multiple contracts simply perform multipleview calls:
index.js
Dispatching Multiple Transactions
Thewallet object enables to dispatch multiple transactions simultaneously. However, please notice that the transactions execute independently.
Dispatching multiple transactions at once is just a nice way to improve UX, because the user interacts with the wallet only once.
index.js
- A transaction to call
set_greetingin our Hello NEAR example - A transaction to call
add_messagein our GuestBook example