Instantiate the MobileWalletAdapter client
TheMobileWalletAdapter object provides methods to connect to wallets and issue MWA requests.
Define the ConnectionIdentity of your dApp so that the wallet app can properly display your dApp info to the user.
ConnectionIdentity fields
| Field | Type | Description |
|---|---|---|
identityUri | Uri | Your app’s website URL. |
iconUri | Uri | Path to your app icon, relative to identityUri. |
identityName | String | Your app’s display name shown to the user during wallet authorization. |
Establishing an MWA session
To establish a session with an MWA wallet, use thetransact method. Calling transact dispatches an association intent to a locally installed MWA wallet app and prompts the user to approve or reject the connection.
Once connected, you can issue MWA requests within the provided callback:
transact returns a TransactionResult that can be checked for success or failure:
Managing the authToken
TheMobileWalletAdapter client stores an authToken from successful connections. If valid, the user can skip the connection approval dialog for subsequent requests.
You can also persist and restore the token across app sessions:
Next steps
Quickstart
See usage examples for connect, signMessage, signIn, and signAndSendTransaction.
