trust-web3-provider
trust-web3-provider copied to clipboard
Error is not returned in promise upon cancelling transaction in desk and mobile.
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.
The line mentioned in the error is this, but it is hard to figure out why it work the way it does.
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!