Actions
- Listen to balance change
You can subscribe to _appKitModal.balanceNotifier
to be up to date with balance.
Launch block explorer
You can open the selected chain’s block explorer easily:
- Reconnect relay
In most cases it shouldn’t be needed as it is called internally but this method is useful to reconnect the relay when internet connection is back after inactivity.
- Load account data such as balance and identity
In most cases it shouldn’t be needed as it is called internally but this method is useful to reload account data such as balance and identity. Particularly useful after a transaction.
- Send an RPC request
A list of all available methods can be found in constants.dart file, which is already exported for you to use directly from AppKit package.
- List of approved chains by the connected wallet
- List of approved methods by connected wallet
- List of approved events by the connected wallet
- Request switch to or add chain
If you add a new chain on an ongoing session you should call requestSwitchToChain()
so the wallet can add it as well. Otherwise it will just be not usable.
requestAddChain()
is called automatically by requestSwitchToChain()
in case of failing with the proper error from the wallet.
- Interact with Smart Contracts
These Smart Contract interaction methods only works for EVM chains but you can always structure your smart contract transaction and call the relevant chain method by using request() method.
- Read function:
Usage:
- Create a
DeployedContract
object
- Read from it by calling a read function
- Write function:
Usage:
Write to it by calling a write function, for example, transfer
function from USDC token contract:
Additional example:
Call a sayHello
function of a smart contract to write a message.
For a complete example app check out the example app for AppKit