MetaMask / metamask-sdk

The simplest yet most secure way to connect your blockchain-based applications to millions of MetaMask Wallet users.
https://metamask.io/sdk/
Other
181 stars 111 forks source link

[Bug]: Unable to connect with bnb and polygon chain id's is it even supported? #920

Closed basitcubix closed 3 months ago

basitcubix commented 4 months ago

SDK

Unity

Provide environment information

using Unity 2021.3.14

MetaMask SDK Version

unity sdk latest on asset store

MetaMask Mobile app Version

unity sdk latest on asset store

What browser are you using? (if relevant)

No response

How are you deploying your application? (if relevant)

Deploying it on Adnroid

Describe the Bug

I am trying to connect with bnb or Polygon tesnet chain ids but failing to do so mainnet is connecting and its working but testnet couldnt work Metamask not switching to the testnet i am using this chain ids BNB 0x61 Polygon 0x13881 also sharing the code snippet ` public async void ConnectWith() { var paramsArray = new object[] { new ChainIdObj() { ChainId = "0x13881" } };

      var result = await MetaMaskUnity.Instance.ConnectWith<string>(RpcMethods.WalletSwitchEthereumChain, paramsArray);
      Debug.Log(result);
  }`

Expected Behavior

Expected behavior should testnet should be connected or if its not supported an exception should be thrown rather than its connecting with current chain that metamask has selected.

Link to reproduction - Issues with a link to complete (but minimal) reproduction code will be addressed faster

No response

To Reproduce

conenct with bnb and polygon testnet chain ids

FlaviuWeb3 commented 4 months ago

Hi there,

There are 2 options to connect to BNB and Polygon

  1. Use the following method for connecting to a chain wallet_addethereumchain -> https://docs.metamask.io/wallet/reference/wallet_addethereumchain/
  2. Select "other" from Unity and define your chain details.
christopherferreira9 commented 3 months ago

Hi @basitcubix ! We're closing this issue for the time being. Feel free to give us a ping or open a new issue if you encounter any issue.