mirror of
https://github.com/oceanprotocol/ocean.js.git
synced 2024-11-26 20:39:05 +01:00
Add try/catch for failed transactions when deploying new NFT.
This commit is contained in:
parent
c622b213ff
commit
f2e5a3b098
4
package-lock.json
generated
4
package-lock.json
generated
@ -2973,7 +2973,8 @@
|
|||||||
"node_modules/@oceanprotocol/contracts": {
|
"node_modules/@oceanprotocol/contracts": {
|
||||||
"version": "2.0.3",
|
"version": "2.0.3",
|
||||||
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-2.0.3.tgz",
|
"resolved": "https://registry.npmjs.org/@oceanprotocol/contracts/-/contracts-2.0.3.tgz",
|
||||||
"integrity": "sha512-D2YtlsgmhBuSmF/Ue8zMWPtXNiB4zgW09NjUQzvDFrloUo0a7yC8r8L84LrVniw+0Nmly/PhLcdm8i018yc34g=="
|
"integrity": "sha512-D2YtlsgmhBuSmF/Ue8zMWPtXNiB4zgW09NjUQzvDFrloUo0a7yC8r8L84LrVniw+0Nmly/PhLcdm8i018yc34g==",
|
||||||
|
"license": "Apache-2.0"
|
||||||
},
|
},
|
||||||
"node_modules/@octokit/auth-token": {
|
"node_modules/@octokit/auth-token": {
|
||||||
"version": "3.0.3",
|
"version": "3.0.3",
|
||||||
@ -7953,6 +7954,7 @@
|
|||||||
"url": "https://www.buymeacoffee.com/ricmoo"
|
"url": "https://www.buymeacoffee.com/ricmoo"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@ethersproject/abi": "5.7.0",
|
"@ethersproject/abi": "5.7.0",
|
||||||
"@ethersproject/abstract-provider": "5.7.0",
|
"@ethersproject/abstract-provider": "5.7.0",
|
||||||
|
@ -67,6 +67,7 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
)
|
)
|
||||||
if (estimateGas) return <G extends false ? string : BigNumber>estGas
|
if (estimateGas) return <G extends false ? string : BigNumber>estGas
|
||||||
// Invoke createToken function of the contract
|
// Invoke createToken function of the contract
|
||||||
|
try {
|
||||||
const tx = await sendTx(
|
const tx = await sendTx(
|
||||||
estGas,
|
estGas,
|
||||||
this.signer,
|
this.signer,
|
||||||
@ -84,6 +85,9 @@ export class NftFactory extends SmartContractWithAddress {
|
|||||||
const trxReceipt = await tx.wait()
|
const trxReceipt = await tx.wait()
|
||||||
const events = getEventFromTx(trxReceipt, 'NFTCreated')
|
const events = getEventFromTx(trxReceipt, 'NFTCreated')
|
||||||
return events.args[0]
|
return events.args[0]
|
||||||
|
} catch (e) {
|
||||||
|
console.error(`Creation of AccessList failed: ${e}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user