AlphaWallet / alpha-wallet-android

An advanced Ethereum mobile wallet
https://www.alphawallet.com
MIT License
601 stars 534 forks source link

Wallet Connect Request #3401

Open senthilkumar-1398 opened 1 month ago

senthilkumar-1398 commented 1 month ago

Your payload connects successfully, but my payload does not connect.

Your Payload : {eip155=Session(chains=[eip155:1, eip155:100, eip155:137, eip155:30, eip155:61, eip155:59144, eip155:8453, eip155:5000, eip155:185, eip155:56, eip155:128, eip155:43114, eip155:250, eip155:10, eip155:25, eip155:42161, eip155:11297108109, eip155:8217, eip155:4689, eip155:1313161554, eip155:2001, eip155:66, eip155:11155111, eip155:80002, eip155:17000, eip155:84532, eip155:1687, eip155:5, eip155:97, eip155:31, eip155:338, eip155:5003, eip155:420, eip155:80001, eip155:421613, eip155:59141, eip155:1001, eip155:4002, eip155:4690, eip155:43113, eip155:200101, eip155:1313161555, eip155:11297108099], accounts=[eip155:1:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:100:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:137:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:30:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:61:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:59144:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:8453:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:5000:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:185:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:56:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:128:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:43114:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:250:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:10:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:25:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:42161:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:11297108109:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:8217:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:4689:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:1313161554:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:2001:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:66:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:11155111:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:80002:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:17000:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:84532:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:1687:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:5:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:97:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:31:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:338:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:5003:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:420:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:80001:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:421613:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:59141:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:1001:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:4002:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:4690:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:43113:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:200101:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:1313161555:0x577b282078912c354b3f4b503c97bf2770ece2cc, eip155:11297108099:0x577b282078912c354b3f4b503c97bf2770ece2cc], methods=[eth_sendTransaction, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, personal_sign, eth_sign, wallet_switchEthereumChain], events=[chainChanged, accountsChanged])}

My Payload: {eip155=Session(chains=[eip155:1], accounts=[eip155:1:0x577b282078912c354b3f4b503c1bf2770ece2cc], methods=[eth_sendTransaction, eth_signTransaction, eth_signTypedData, eth_signTypedData_v3, eth_signTypedData_v4, personal_sign, eth_sign, wallet_switchEthereumChain], events=[chainChanged, accountsChanged])}

Could you provide support or suggest why my payload is not connecting on Rarible,Opensea etc?

Code I'm using:

  private fun buildNamespaces(
      sessionProposal: Wallet.Model.SessionProposal
  ): Map<out String?, Wallet.Model.Namespace.Session?> {
      val accountList = listOf<String>(mWalletModelClass?.walletAddress.toString())
      val chainList = listOf<String>("eip155:" + networkModelClass?.chainId.toString())
      val supportedNamespaces: Map<String, Wallet.Model.Namespace.Session> =
          Collections.singletonMap<String, Wallet.Model.Namespace.Session>(
              "eip155", Wallet.Model.Namespace.Session(
                  chainList,
                  toCAIP10(chainList, accountList),
                  getSupportedMethods(),
                  getSupportedEvents()
              )
          )
      try {
          return generateApprovedNamespaces(sessionProposal, supportedNamespaces)
      } catch (e: Exception) {
          Log.e("TAG", "buildNamespaces: " + e.message)
      }
      return HashMap<String?, Wallet.Model.Namespace.Session?>()
  }

private fun clickApproveButton() {
    if (binding.btnEndSession.text.toString() == getString(R.string.approve)) {
        Utils.showProcessProgressDialog(this)
        val proposerPublicKey: String =
            sessionProposal?.proposerPublicKey.toString()
        val approve = Wallet.Params.SessionApprove(
            proposerPublicKey,
            buildNamespaces(
                sessionProposal!!
            ) as Map<String, Wallet.Model.Namespace.Session>,
            sessionProposal?.relayProtocol
        )
        approveSession(approve, { sessionApprove: Wallet.Params.SessionApprove? ->
            Handler(Looper.getMainLooper()).postDelayed({
                Log.e("TAG", "CONNECTED: ")
                Utils.removeProcessProgressDialog()
                onSessionProposalApproved()
            }, 500)
            null
        }, { error: Wallet.Model.Error ->
        })
    } else {
        disconnect(walletConnectV2SessionItem?.sessionId)
    }
}
adenolabashiru commented 1 month ago

Hope everything goes well You are the best