1
0
mirror of https://github.com/oceanprotocol/ocean.js.git synced 2024-11-26 20:39:05 +01:00

throw some error msgs if no tx

This commit is contained in:
paulo-ocean 2024-09-25 09:56:00 +01:00
parent 443d748b3b
commit c701652ee7

View File

@ -189,7 +189,7 @@ export async function orderAsset(
)
const txApprove = typeof tx !== 'number' ? await tx.wait() : tx
if (!txApprove) {
throw new Error(`Failed to appove ${exchange.baseToken} !`)
throw new Error(`Failed to approve ${exchange.baseToken} !`)
}
const freTx = await fre.buyDatatokens(
exchange.exchangeId,
@ -221,11 +221,11 @@ export async function orderAsset(
false
)
if (!tx) {
return
throw new Error(`Failed to approve ${exchange.baseToken} !`)
}
const txApprove = typeof tx !== 'number' ? await tx.wait() : tx
if (!txApprove) {
return
throw new Error(`Failed to confirm/mine approval transaction!`)
}
const txBuy = await datatoken.buyFromFreAndOrder(
asset.datatokens[datatokenIndex].address,