1

I'm trying to send a transaction via bsc using WalletConnect and web3

This is the connection code

const provider = new WalletConnectProvider({
    rpc: {
        1: "https://bsc-dataseed.binance.org/",
        2: "https://bsc-dataseed1.defibit.io/",
        3: "https://bsc-dataseed1.ninicoin.io/",
       // ...
    },
});

async function() {
    await provider.enable();
    //  Get Accounts
    web3.eth.getAccounts((error, accounts) => {
        if (error) alert(error)
        this.account = accounts[0]
    });
}

And this is the cransaction call

web3.eth.sendTransaction({
    to: '0x...',
    from: this.account,
    value: 1000000000000, //test value
}, ((error, hash) => {
    if (error) alert(error)
    else console.log(hash)
}));

The problem is that on my trust wallet the transaction is on the ETH blockchain, even if I can read my bsc token balance correctly. Any ideas?

Tyler2P
  • 2,324
  • 26
  • 22
  • 31
  • When I tried using WalletConnect with TrustWallet for BSC a few months back, I actually a got an error from TW that BSC isn't even supported. Besides, is your "BSC token balance" referring to your BSC tokens _on the ETH chain_ or is your TW actually displaying the info for your address on the BSC chain? – Kelvin Schoofs Aug 02 '21 at 16:37
  • i got the actual balance of my BNB, as well as other custom token on the BSC – Francesco Grazioso Aug 02 '21 at 16:46

0 Answers0