1

I am developing react native mobile application where user can transfer their amount by external wallet (Rainbow, MetaMask).

I am using 'polygon-rpc' network for my users.

The thing is working as expected but when execute transfer method by my contract by WalletConnect sendTransaction(txObj) library it navigate me to connected wallet and prompted the confirmation pop, where it show the my currency in MetaMask, but in Rainbow it always show Matic instead of POZ.

However it works well in Metamask and show the POZ, instead of MATIC.

I am using this code to procced transaction by WalletConnect external wallet

let toAddress = pozPouchFundWallet; // end address to transfer amount
let decimals = BigNumber(18);
let amount1 = new BigNumber(amountValue);
let value = amount1.times(new BigNumber(10).pow(decimals));
let contract = new Web3js.eth.Contract(App_ABI, POZ_TOKEN!);
try {
  let dataa = await contract.methods
    .transfer(toAddress, value.toString())
    .encodeABI();
  let txObj = {
    // gas: Web3js.utils.toHex(100000),
    data: Web3js.utils.toHex(dataa),
    from: userWallet,
    to: POZ_TOKEN, // Contractor token address
  };
  try {
    const transactionHash = await connector
      .sendTransaction(txObj)
      .catch((_err: any) => {
        Toast.show({
          autoHide: true,
          text1: t('topUpPoz.transactionFailed'),
          type: 'error',
        });
      });
    console.log('transactionHash is =', transactionHash);
    resolve(transactionHash);
  } catch (error) {
    console.log('the connector error is = ', error);
    reject(error);
  }
} catch (err) {
  console.log('contact error is = ', err);
  reject(err);
}

Here is the confirmation popup, here it should show 2 POZ(my currency)  instead of 2 MATIC

Pankaj Sonava
  • 519
  • 4
  • 20
  • I'm noticing this as well for USDC and APE on Ethereum Mainnet. The amount is correct, but the asset is not. Using Rainbow v1.0 (167) on Android, my code is using wagmi@0.12.10, which internally uses @walletconnect/ethereum-provider@2.6.2. Only happens on Rainbow, if I use WalletConnect to connect to another app (e.g. MetaMask) then it behaves as expected! – Nigh7Sh4de Apr 08 '23 at 19:31

0 Answers0