Giter Site home page Giter Site logo

Comments (4)

Svechnikov avatar Svechnikov commented on August 11, 2024 1

@kobajs yes, the code is here (it's in Flutter, but I think it can be adopted to Kotlin).

The problem was that I was trying to use WalletConnect V2, but MetaMask doesn't support it yet. Instead, we should use V1.

from walletconnectkotlinv2.

Svechnikov avatar Svechnikov commented on August 11, 2024

Hello!

I know that there's some effort being made to add an example of mobile linking, but since it's not ready yet, maybe you will be able to help me?

I want to link a wallet app with the sample app. I did the following:

  1. Installed a wallet app (MetaMask) and a dapp (OpenSea) and verified that OpenSea is linked with MetaMask correctly
  2. Obtained project id from cloud.walletwonnect.com, cloned the sample app, replaced the id and used the initDapp config
  3. Tried to link the app with a wallet as specified in Mobile Linking of the sample app with no luck (tried both develop and master branches):
val connectParams = WalletConnect.Params.Connect(
    permissions = WalletConnect.Model.SessionPermissions(
        WalletConnect.Model.Blockchain(listOf("eip155:69")),
        WalletConnect.Model.Jsonrpc(listOf("personal_sign"))
    ), pairingTopic = null
)
val uri = WalletConnectClient.connect(connectParams)

// Here I try to launch a wallet app using uri as deep link
// The wallet app (MetaMask) is launched, but with no "Permission request" dialog
requireContext().startActivity(
    Intent().apply {
        action = Intent.ACTION_VIEW
        data = Uri.parse(uri)
    }
)

// Or here I try to construct the data the similar way it's constructed by OpenSea - still no dialog
requireContext().startActivity(
    Intent().apply {
        action = Intent.ACTION_VIEW
        `package` = "io.metamask"
        data = Uri.parse("https://metamask.app.link/wc?uri=${URLEncoder.encode(uri.toString())}")
    }
)

As a result, MetaMask app is launched, but with no "Request access" dialog (as opposed to launch by OpenSea where I do get the dialog).

I then compared the uris from the sample app and from OpenSea:

OpenSea:

wc:28c37b8b-2968-4f5c-b1bc-14e1c86e3da7
  @1
  ?bridge=https://j.bridge.walletconnect.org
  &key=2c007ba1c3ebabffb48e6618810ead30430c08436f505e11a675cd96482b5d67

Sample app:

wc:85c006807f2b2007fa9d0fead82a954ed0581e9429205803dbede4ecc502c3be
  @2
  ?controller=false
  &publicKey=67e01f1a963b1987b1565dbd0805fb3d2baf4371ee3a3e666f1a0a0972a64321
  &relay=%7B%22protocol%22%3A%22waku%22%7D

Seems that OpenSea uses version "1" of WC Standard format and the sample app - version "2". I then tried to find the description of the version "2", but with no luck. With little hope I then tried to manually change the uri to be like version "1" format, but obviously it didn't work.

So my question is how to correctly link a dapp (the sample app) with a wallet app?

Also, do you have plans on adding a sample Flutter app?

Thank you in advance!

from walletconnectkotlinv2.

kobajs avatar kobajs commented on August 11, 2024

+1

from walletconnectkotlinv2.

kobajs avatar kobajs commented on August 11, 2024

@Svechnikov have you found a solution?

from walletconnectkotlinv2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.