solidity – Initiating Transactions from DApp to Send BNB Using Trust Wallet and WalletConnect

binance-smart-chainblockchainsoliditywalletconnectweb3js

Does anyone know how I can initiate transaction from my DAPP to send BNB while connected to trust wallet using walletconnect?

I see an example for etheruem transaction here: https://docs.walletconnect.com/quick-start/dapps/client#send-transaction-eth_sendtransaction

But I don't know how to do this for BNB transaction: I found this article on binance docs: https://docs.binance.org/guides/concepts/walletconnect.html, and I know I can do something similar using sendCustomRequest method on wallet connect js integration, but I don't know the right parameters to send in the transaction request.

Also, while connecting to walletconnect, I want to be able to automatically pick smart chain network instead of the default which is ethereum mainnet.

I hope this is clear enough guys.

Thank you.

Best Answer

Binance Smart Chain is an EVM compatible blockchain. This means that any utilities you are accustomed to from Ethereum will work on BSC as well.

The sendTransaction({..., value: x }) method will transfer the utility token of the blockchain in question: ETH on Ethereum, BNB on BSC, Matic on Polygon POS and so on.

As for the network, the user is the one who can pick the necessary network from their wallet. What you may do if the user picked the wrong network is to suggest them to move to BSC from their wallet (Trust, Rainbow, Metamask etc.), through a warning in your UI.

Related Topic