Send a request to WalletConnect to get a pairing URI for Keeper Wallet.
// Set the chain ID: 'W' for Mainnet or 'T' for Testnet
static const testChainId = 'waves:T';
static const mainChainId = 'waves:W';
final resp = await _wcClient?.connect(requiredNamespaces: {
namespace: const RequiredNamespace(
chains: [testChainId],
methods: [
'waves_signTransaction',
'waves_signTransactionPackage',
'waves_signOrder',
'waves_signMessage',
'waves_signTypedData',
],
events: [],
),
});
final wcUrl = resp?.uri.toString();
Step 5. Connect Keeper Wallet
Here's how it works:
Your app calls Keeper, specifying the callback URL in the request.
The Keeper Wallet app opens and prompts the user to connect.
Once the user confirms or cancels the connection, your app receives a callback.
Deep Links are used to interact with Keeper Wallet. You can use url_launcher plugin to call Keeper. For the callback, the Deep Link must be configured in your app.
static const callback = 'YOUR_LINK_OR_SCHEME';
final parameters = <String>[];
parameters.add('wcurl=${Uri.encodeComponent(wcUrl)}');
parameters.add('callback=$callback');
final query = parameters.join('&');
final url = Uri.parse('https://link.keeper-wallet.app/auth?$query');
//url_launcher
launchUrl(url, mode: LaunchMode.externalApplication);