|
@@ -41,8 +41,9 @@ export class MerklyClient {
|
|
|
value: balance,
|
|
|
})
|
|
|
const gasCost = (feeData.gasPrice * estimatedGas * 108n) / 100n
|
|
|
- if (balance - quote - gasCost < 0) {
|
|
|
- throw new Error('Insufficient balance')
|
|
|
+ if (balance < quote + gasCost) {
|
|
|
+ MerklyClient.logger.error('Insufficient balance')
|
|
|
+ // throw new Error('Insufficient balance')
|
|
|
}
|
|
|
const tx = await this.router.bridgeETH(toInfo.merklyChainId, balance - quote - gasCost, {
|
|
|
value: balance - gasCost,
|
|
@@ -50,6 +51,8 @@ export class MerklyClient {
|
|
|
gasPrice: feeData.gasPrice,
|
|
|
})
|
|
|
return tx.hash
|
|
|
+ } else {
|
|
|
+ MerklyClient.logger.error('Insufficient balance')
|
|
|
}
|
|
|
}
|
|
|
}
|