Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,19 @@ Web3Wallet wcClient = await Web3Wallet.createInstance(
// For a wallet, setup the proposal handler that will display the proposal to the user after the URI has been scanned.
late int id;
wcClient.onSessionProposal.subscribe((SessionProposal? args) async {
// Handle UI updates using the args.params
// Keep track of the args.id for the approval response
id = args!.id;
if (args != null) {
// Handle UI updates using the args.params
// Keep track of the args.id for the approval response
id = args.id;

// To check the Verify API validations and whether or not your user is interacting with potentially malicious dapp,
// you can do so by accessing the `verifyContext` included in the `SessionProposalEvent`:
final scamApp = args.verifyContext?.validation.scam;
final invalidApp = args.verifyContext?.validation.invalid;
final validApp = args.verifyContext?.validation.valid;
final unknown = args.verifyContext?.validation.unknown;
}

});

// Also setup the methods and chains that your wallet supports
Expand Down Expand Up @@ -267,6 +277,11 @@ await wcClient.disconnectSession(
);
```

### Setting up Deeplinks

If you want to set up deeplinks on wallet connect, you must configure your device so that the scheme of your deeplink is compatible with "wc://"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what you mean here. In order to register a deepLink so your wallet can be opened from a dapp (or your dapp called back from the wallet fwiw) you should add your custom scheme (for instance myawesomewallet://) in the iOS Info.plist file under the CFBundleURLTypes key and an intent filter in the Android's Manifest.xml file, then pass this custom scheme in the PairingMetadata object in the redirect parameter.
This is also something we should add in the docs page btw.

[More details there](https://docs.walletconnect.com/web3wallet/mobileLinking).

### Reconnecting the WebSocket

```dart
Expand Down