trust-web3-provider icon indicating copy to clipboard operation
trust-web3-provider copied to clipboard

Error is not returned in promise upon cancelling transaction in desk and mobile.

Open IDontLikeOpen opened this issue 1 year ago • 0 comments

When users submits transaction - we get a result and it is returned in then, but when transaction is rejected catch is not triggered, even though we get the error in the console.

image

The line mentioned in the error is this, but it is hard to figure out why it work the way it does.

image

I am using "web3": "^4.2.2"

const transferData = {
    method: 'transfer',
    types: ['address', 'uint256'],
    inputs: [
      '0x090.....',
      {
        type: 'BigNumber',
        hex: '0x0f4240',
      },
    ],
    names: ['_recipient', '_value'],
  }

 const transferMethod = () =>
        contract.methods.transfer(toAddress, `${amountToPay}`);

transferMethod()
      .send({
        from: senderAddress,
        gasPrice,
        data,
      })
      .then((result) => result)
      .catch((errorString) => errorString);

Pancake.swap handles it somehow, so there must be a way. Thanks for your tme!

IDontLikeOpen avatar Jan 18 '24 18:01 IDontLikeOpen