Skip to main content
deleted 66 characters in body; edited tags
Source Link
Eric Lee
  • 161
  • 2
  • 8

WalletConnect web3 provider issue with TrustWallet (Multi-coin wallet)

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnectusing walletconnect/web3-provider"provider to try to connect to trustwallet ios APP. with the following codeMy config on walletconnect is listed below:

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    // provider.networkId = 56;
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It is working normally if I useconnected to the wallet, but it with my metamask ios APPis not working right. As long asSo I select trust wallet, it shows "no available network" likecheck the provider and find out that the chain ID is pointing to "1" instead of the BSC chainID "56". see below: no available networkenter image description here

Does anybody know what is wrong with my settingAm I doing anything not correct? It will be very appreciated if somebody can help me out.

WalletConnect web3 provider issue with TrustWallet

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnect/web3-provider". with the following code:

try {
    console.log("Log in with connect wallet")
    const provider = new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    await provider.enable();
    const web3 = new Web3(provider);
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It is working normally if I use it with my metamask ios APP. As long as I select trust wallet, it shows "no available network" like below: no available network

Does anybody know what is wrong with my setting? It will be very appreciated if somebody can help me out.

WalletConnect web3 provider issue with TrustWallet (Multi-coin wallet)

I am using walletconnect/web3-provider to try to connect to trustwallet ios APP. My config on walletconnect is listed below:

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    // provider.networkId = 56;
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It is normally connected to the wallet, but it is not working right. So I check the provider and find out that the chain ID is pointing to "1" instead of the BSC chainID "56". see below: enter image description here

Am I doing anything not correct?

deleted 1332 characters in body; edited title
Source Link
Eric Lee
  • 161
  • 2
  • 8

How to Integrate walletConnect on Binance Smart Chain DAPP (web3) WalletConnect web3 provider issue with TrustWallet

It seems to workis working normally in the beginning because the QR code pops up andif I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

And I tried to print out the web3 and checked the provider object. and it still shows that the provider connection is under "mainnet.infuramy metamask ios APP.io/v3"

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://mainnet.infura.io/v3/", eventNames: function, listeners: function, …}

2021/6/13 update:

When As long as I tried to change the rpc chain id to 1 like below, and the error would not show up.

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            1: "https://bsc-dataseed1.binance.org"
        }
    });
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
}   

Howeverselect trust wallet, I can't correctly sign the transaction because it is not the correct chainId. And the web3 provider shows on console changed to be"no available network" like below: no available network

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://bsc-dataseed1.binance.org", eventNames: function, listeners: function, …}
networkId: 1

How can I make walletconnect/web3-provider recognize BSC's chainId (56)Does anybody know what is wrong with my setting?

It It will be very appreciated if anyone teachessomebody can help me how to make it workout.

How to Integrate walletConnect on Binance Smart Chain DAPP (web3)

It seems to work normally in the beginning because the QR code pops up and I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

And I tried to print out the web3 and checked the provider object. and it still shows that the provider connection is under "mainnet.infura.io/v3"

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://mainnet.infura.io/v3/", eventNames: function, listeners: function, …}

2021/6/13 update:

When I tried to change the rpc chain id to 1 like below, and the error would not show up.

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            1: "https://bsc-dataseed1.binance.org"
        }
    });
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
}   

However, I can't correctly sign the transaction because it is not the correct chainId. And the web3 provider shows on console changed to be like below:

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://bsc-dataseed1.binance.org", eventNames: function, listeners: function, …}
networkId: 1

How can I make walletconnect/web3-provider recognize BSC's chainId (56)?

It will be appreciated if anyone teaches me how to make it work.

WalletConnect web3 provider issue with TrustWallet

It is working normally if I use it with my metamask ios APP. As long as I select trust wallet, it shows "no available network" like below: no available network

Does anybody know what is wrong with my setting? It will be very appreciated if somebody can help me out.

added 1226 characters in body
Source Link
Eric Lee
  • 161
  • 2
  • 8

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnect/web3-provider". with the following code:

try {
    console.log("Log in with connect wallet")
    const provider = new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    await provider.enable();
    const web3 = new Web3(provider);
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It seems to work normally in the beginning because the QR code pops up and I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

And I tried to print out the web3 and checked the provider object. and it still shows that the provider connection is under "mainnet.infura.io/v3"

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://mainnet.infura.io/v3/", eventNames: function, listeners: function, …}

2021/6/13 update:

When I tried to change the rpc chain id to 1 like below, and the error would not show up.

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            1: "https://bsc-dataseed1.binance.org"
        }
    });
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
}   

However, I can't correctly sign the transaction because it is not the correct chainId. And the web3 provider shows on console changed to be like below:

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://bsc-dataseed1.binance.org", eventNames: function, listeners: function, …}
networkId: 1

How can I make walletconnect/web3-provider recognize BSC's chainId (56)?

It will be appreciated if anyone teaches me how to make it work.

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnect/web3-provider". with the following code:

try {
    console.log("Log in with connect wallet")
    const provider = new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    await provider.enable();
    const web3 = new Web3(provider);
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It seems to work normally in the beginning because the QR code pops up and I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

It will be appreciated if anyone teaches me how to make it work.

I am making a DAPP on BSC which allows users to access through browser and mobile. So I would like to integrate the WalletConnect into my DAPP.

I simply install the npm package "@walletconnect/web3-provider". with the following code:

try {
    console.log("Log in with connect wallet")
    const provider = new WalletConnectProvider({
        rpc: {
            56: "https://bsc-dataseed1.binance.org",
        },
    });
    await provider.enable();
    const web3 = new Web3(provider);
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
} 

It seems to work normally in the beginning because the QR code pops up and I can use my trust wallet to scan and connect it. And then I found out it seems not to able to send transactions with the following error message on the console:

[Error] Failed to load resource: the server responded with a status of 401 ()  https://mainnet.infura.io/v3(v3, line 0)

And I tried to print out the web3 and checked the provider object. and it still shows that the provider connection is under "mainnet.infura.io/v3"

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://mainnet.infura.io/v3/", eventNames: function, listeners: function, …}

2021/6/13 update:

When I tried to change the rpc chain id to 1 like below, and the error would not show up.

try {
    console.log("Log in with connect wallet")
    const provider = await new WalletConnectProvider({
        rpc: {
            1: "https://bsc-dataseed1.binance.org"
        }
    });
    await provider.enable();
    const web3 = await new Web3(provider);
    console.log(web3)
    resolve(web3)
} catch {
    console.log("Install metamask or use wallet connect")
}   

However, I can't correctly sign the transaction because it is not the correct chainId. And the web3 provider shows on console changed to be like below:

http: HTTPConnection {_events: Object, _eventsCount: 2, url: "https://bsc-dataseed1.binance.org", eventNames: function, listeners: function, …}
networkId: 1

How can I make walletconnect/web3-provider recognize BSC's chainId (56)?

It will be appreciated if anyone teaches me how to make it work.

edited title
Link
Eric Lee
  • 161
  • 2
  • 8
Loading
Source Link
Eric Lee
  • 161
  • 2
  • 8
Loading