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

Store uri into Session #1153

Closed
wants to merge 1 commit into from
Closed

Store uri into Session #1153

wants to merge 1 commit into from

Conversation

arturdev
Copy link

@arturdev arturdev commented Oct 4, 2023

Description

Added wcUri into the Session for later use.
Was supported in WalletConnect V1.
Makes is easy to migrate from WalletConnect V1 from V2 for dApps, especially when dApps have to support both.

@flypaper0
Copy link
Contributor

DApps should not support both because V1 was deprecated. SymKey is a sensitive information witch is stored into keychain. As we're storing sessions in UserDefaults I think it's not good idea to add this into Session object. @llbartekll what you think?

@arturdev
Copy link
Author

@flypaper0 in that case, when the dapp wants the wallet to sign a transaction, how to construct the URL to open it?
In v1, dapps were using the WCURL for opening the wallet app (f.e. metamask://wc?{wcUrl}).
What dapps should do in case of V2?

@flypaper0
Copy link
Contributor

@flypaper0 in that case, when the dapp wants the wallet to sign a transaction, how to construct the URL to open it? In v1, dapps were using the WCURL for opening the wallet app (f.e. metamask://wc?{wcUrl}). What dapps should do in case of V2?

connect method returns WalletConnectURI object that have absoluteString

@arturdev
Copy link
Author

arturdev commented Oct 13, 2023

@flypaper0 but we don't connect everytime, right? The new V2 stores the connections, and on the next app run it auto connects the old sessions. So f.e. if previously you've connected Trust wallet, and killed and reopened the app, it will still be connected... So you won't call the connect again. But, you need to send a f.e. sign transaction. But if you don't call the connect, you wouldn't have the wcUri. So which URL you would use to open the trust app in this case?

@llbartekll
Copy link
Contributor

@arturdev if I understand you correctly.
you can getSessions() from the client
the Session object has public let peer: AppMetadata property and it should contain enough to open the wallet from your dapp, if this is want you want to achieve

@arturdev
Copy link
Author

arturdev commented Oct 13, 2023

@llbartekll exactly. So currently public let peer: AppMetadata doesn't contain any wcURL which I should append to the wallet app's urlScheme in order to open it. So the only question is, how to open the wallet app (which URL to use) AFTER getting the session from getSessions() and not after the initial connect.

@arturdev
Copy link
Author

@llbartekll Could you answer the question, please?

@llbartekll
Copy link
Contributor

so the thing is that wallet didn't set the redirect uri in the metadata, we will make this field required in next release.
and you will be rely on that when they upgrade.

@llbartekll llbartekll closed this Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants