We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi,
I'm unable to catch a transaction reject from Metamask. I still get the Uncaught (in promise) error.
My code:
import { POSClient, use } from '@maticnetwork/maticjs'; import { Web3ClientPlugin } from '@maticnetwork/maticjs-web3'; import Web3 from "web3"; use(Web3ClientPlugin); const posClient = new POSClient(); const web3 = new Web3(window.ethereum); const GLMtokenAddress = "0x0B220b82F3eA3B7F6d9A1D8ab58930C064A2b5Bf"; const YagnaWalletAddress = "0x2a624D89C9C30A424eE07C9FF9442F03a1f208CF"; const erc20Token = posClient.erc20(GLMtokenAddress); export async function pay_ticket(account, quantity) { var qtty = 600000000000000000 * quantity; return posClient.init({ log: false, network: "mainnet", version: 'v1', parent: { provider: web3.currentProvider, defaultConfig: { from: account } }, child: { provider: web3.currentProvider, defaultConfig: { from: account } } }).then(() => { return web3.eth.getGasPrice().then((fees) => { return fees; }); }).then((fees) => { return erc20Token.transfer(qtty.toString(), YagnaWalletAddress, {gasPrice: fees*2}).then((tx) => { return tx; }); }).then((tx) => { return tx.getReceipt().then((receipt) => { return {'err': null, 'txhash': receipt.transactionHash}; }); }).catch((err) => { return {'err': 'err', 'txhash': null}; }); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Hi,
I'm unable to catch a transaction reject from Metamask.
I still get the Uncaught (in promise) error.
My code:
The text was updated successfully, but these errors were encountered: