FAQ
How to connect with third wallet, take MetaMask for example.
1. Get MetaMask connect adapter, you can get account in success call back.
2. Sign something, for example sign message, you can get signed message in success call back.
3. Add chain, MetaMask support add chain, other wallets don't support this methods, you can get success string in success call back.
MetaMask doesn't support add ethereum testnet, such as goerli, instead support switch to goerli.
MetaMask doesn't support add or switch optimism mainnet,
if you want to add or switch other chain, just call add chain is enough, MetaMask has optimized, when you call add chain, it will present add pop-up, after confirm, it will present switch pop-up.
4. Switch chain, MetaMask support add chain, other wallets don't support this methods, you can get success string in success call back.
5. Sometimes, user metamask app is in ethereum.mainnet, but you want to send some bsc.mainnet tokens, I think it's time to call add(switch) wallet before send tokens, but it is not requested by our SDK, and it will jump to metamask app twice, we suggest make a delay before two jump.
6. When call add(switch) chain? before signAndSendTransaction? after connect success?
It is determined by yourself.
In our iOS GUI SDK, we call add(switch) chain before signAndSendTransaction, make sure matamask is the same chain id with the transaction, if transaction's chain id not same with metamask, metamask will reject it, after add(switch) chain success, delay 0.3 second, call signAndSendTransaction.
Last updated