Summary of key changes
- Introduction of feature identifiers.
- Introduction of chain identifiers.
- API changes to the
authorizeRPC request specfication adding new parameters:- Sign In With Solana payload
- Chain and feature identifiers
authTokenandaddresses
- API changes to the
MobileWalletAdapterConfigobject returned bygetCapabilitiesRPC request. - Mandatory support of the
signAndSendTransactionsRPC request.- Additional optional parameters added to
signAndSendTransactions.
- Additional optional parameters added to
- Deprecation of
reauthorizeandsignTransactionsmethods.
Migration guide
Update walletlib
To update towalletlib 2.0, simply add the latest dependency in your gradle file:
Authorize (2.0 spec)
AuthorizeRequest
To conform to the updatedauthorize RPC request specification, the AuthorizationRequest object that is passed from walletlib through the onAuthorizeReqest callback now includes some new parameters:
- MWA 2.0
- Legacy
authToken: An optionalauthTokenwhere if provided, the wallet should attempt to reauthorize the session with it.addresses: An optional list of base64 encoded account addresses that the dapp wishes to be included in the authorization scope.signInPayload: An object containing the payload portion of a Sign In With Solana message.chain: A chain identifier to distinguish the requested blockchain network. Replaces the deprecatedclusterparameter.- Supported Solana network chains:
solana:mainnet,solana:testnet, andsolana:devnet.
- Supported Solana network chains:
features: An array of feature identifiers, representing features requested by the client.
Parameter: authToken
An optional authToken where if present, the wallet should attempt to reauthorize the session using it. The wallet implementation will likely be able to re-use their reauthorize logic
to handle this case. This aims to replace the reauthorize RPC request and reduce the confusion between authorize/reauthorize for dApps developers.
Parameter: Sign In With Solana
An optional object containing the payload portion of a Sign In With Solana message. If present, the wallet should present the SIWS message to the user and, if approved, include aSignInResult object in the AuthorizationResult response to the dapp endpoint.
AuthorizationResult
TheAuthorizationResult object that is returned to the dapp endpoint is now constructed by passing in a list of AuthorizedAccount objects, rather than a single public key and label.
An optional walletIcon parameter has also been added to allow the wallets to send back an icon (data URI) for dapps to display on thier UI when the wallet is connected.
Constructor for AuthorizationResult:
- MWA 2.0
- Legacy
Sign And Send Transactions (2.0 spec)
Suport for thesign_and_send_transactions request has been made mandatory in the Mobile Wallet Adapter 2.0 specification. Wallets must now implement this method according to the spec.
The optional transaction parameters have also been expanded to allows dapps to further specify how transactions should be sent to the RPC by the wallet endpoint.
Additional optional parameters in SignAndSendTransactionRequest:
MWA 2.0
MobileWalletAdapterConfig
The configuration object that is used when setting up an MWA session has been updated. This object is returned to the dapp endpoint from a get_capabilities RPC request.
The boolean feature flags supportsSignAndSendTransactions and supportsCloneAuthorization have been replaced with the supportedFeatures array, using the new
feature extension and identifer API.
The wallet can flag these features by adding solana:signAndSendTransaction and solana:cloneAuthorization and exposed through the new feature extension API.
- MWA 2.0
- Legacy
