-
Notifications
You must be signed in to change notification settings - Fork 61
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
signEngine.metadata is final, but I want unique redirects for each Sign session. #170
Comments
Each session has pairingMetadata for both dapp and wallet that should let you do as you're requesting. They are embedded in the peer and self objects. You can launch the peer's url or native link (If provided), or query it from the explorer and launch it that way. |
@Luzzotica - I am referring to the PairingMetadata (which includes redirect) passed into the WebApp instance and is not modifiable (marked final). (i.e. The PeerInfo that my app advertises to the wallet.) On my app deep link support, I have a unique path supporting navigating to specific pages(tabs)
Leveraging a package like https://pub.dev/packages/go_router. // was hoping I could pass a custom redirect in this call
web3App.signEngine.connect()
// or perhaps after the ConnectResponse was returned before launching the URI - but this is not allowed
web3App.signEngine.metadata = web3App.signEngine.metadata.copyWith(redirect: Redirect(native: '$kNativeLink$sessionNumber')); |
Deleted the idea that didn't work. But I did learn you can modify the peer metadata, and fix any errors. (Metamask - I am talking to you.) // be sure you have the pairing topic not the session topic
await web3App.core.pairing.updateMetadata(topic: pairingTopic, metadata: updatedPairingMetadata); |
What I am trying to do:
Have my Dapp allow the user to connect to multiple wallets. I will have a tab in the UI for each wallet so the user can manage them separately as needed. When I sent a transaction to a specific wallet Sign session , I want the redirect URI to be unique so that my app hand handle the deep link and open the corresponding tab in the UI for that wallet.
I see the pairingInfo is marked final, and it managed at the Core level and not the Session level. I was hoping I could re-use the Web3App instance, just update the paringInfo metatdata for the redirect before each new Sign Session. There is no need to change the redirect once the Sign session has been established.
Protocol wise - I don't see the need to have a Web3 / Core instance per wallet (what the code can do today.) Looking for thoughts/guidance?
Priority - Low (for me) - Again I am just writing a class and this would have been nice to show off the capabilities. (Also assumes wallets actually pay attention to the peerMetadata redirect :-p)
The text was updated successfully, but these errors were encountered: