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

Error Initializing with Wallet Connect (dApp -> Rainbow Wallet) #321

Closed
zkhalapyan opened this issue Jul 11, 2022 · 7 comments
Closed

Error Initializing with Wallet Connect (dApp -> Rainbow Wallet) #321

zkhalapyan opened this issue Jul 11, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@zkhalapyan
Copy link

zkhalapyan commented Jul 11, 2022

Describe the bug
Redirecting the user to Rainbow Wallet and getting an error "Error Initializing Wallet Connect".

SDK Version

  • Client: Swift / iOS
  • Version: main

To Reproduce

The code runs directly inside AppDelegate in a SwiftUI app:

func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool {
    let metadata = AppMetadata(name: "Example",
                               description: "The best of the best.",
                               url:"example.come",
                               icons:[])
    let client = WalletConnectClient(metadata: metadata,
                                     projectId: "607d02fd15dee0875944ded71bab8ce0",
                                     isController: false,
                                     relayHost: "wss://relay.walletconnect.com");
    let connectParams = ConnectParams(
        permissions: SessionType.Permissions(
            blockchain: SessionType.Blockchain(chains: ["eip155:1"]),
            jsonrpc: SessionType.JSONRPC(methods: ["eth_sendTransaction", "personal_sign", "eth_signTypedData"]),
            notifications: SessionType.Notifications(types: [""])))
    
    do {
        if let uri = try client.connect(params: connectParams), let url = URL(string: uri) {
            if (UIApplication.shared.canOpenURL(url)) {
                print(uri)
                DispatchQueue.main.asyncAfter(deadline: .now() + 10.0) {
                    UIApplication.shared.open(url, options: [:], completionHandler: nil)
                }
                
            }
        }
    } catch {
        print("[PROPOSER] Pairing connect error: \(error)")
    }
    
    client.delegate = self;
    return true
}

Expected behavior
For Rainbow wallet to ask if it's ok to connect.

Screenshots

IMG_7379

@zkhalapyan zkhalapyan added the bug Something isn't working label Jul 11, 2022
@zkhalapyan
Copy link
Author

I tired to look into system logs while doing the redirection from my app to Rainbow, but couldn't find anything interesting. Any advice on how I could debug this?

@llbartekll
Copy link
Contributor

hey @zkhalapyan, it does not look like recent version but something very old. Could you try v0.8.1-beta.102?

@zkhalapyan
Copy link
Author

ok, I am definitely using old code, see migration guide here.

The only problem is that the new version has import issues: #329

😢

@zkhalapyan
Copy link
Author

Also, doesn't seem like Rainbow is supporting V2; you can take a look at the app directory here to see which apps support the newest version!

@shles
Copy link

shles commented Jul 12, 2022

@zkhalapyan I think we have the same issue in our project. Have you found any workarounds?

@shles
Copy link

shles commented Jul 12, 2022

found a solution here WalletConnect/WalletConnectSwift#68 (comment)

@zkhalapyan
Copy link
Author

@shles the code above is outdated and Rainbow doesn't even support V2. I guess the solution you see is from people reverse engineering their deep link?

Regardless, checkout the task here: #329

Pretty much if you try to install WalletConnectSwiftV2, you get the wrong package lol 🤦‍♂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants