@hypurrquant/defi-cli 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11094,6 +11094,14 @@ function registerBridge(parent, getOpts) {
11094
11094
  }
11095
11095
  const amountUsdc = Number(BigInt(opts.amount)) / 1e6;
11096
11096
  const { fee, maxFeeSubunits } = await getCctpFeeEstimate(srcDomain, dstDomain, amountUsdc);
11097
+ if (BigInt(opts.amount) <= maxFeeSubunits) {
11098
+ printOutput({
11099
+ error: `CCTP: amount ${opts.amount} (${amountUsdc} USDC) is below the minimum bridge fee of ${maxFeeSubunits} (${fee} USDC). Increase --amount.`,
11100
+ minimum_amount_wei: maxFeeSubunits.toString(),
11101
+ minimum_amount_usdc: fee
11102
+ }, getOpts());
11103
+ return;
11104
+ }
11097
11105
  const recipientPadded = `0x${"0".repeat(24)}${recipient.replace("0x", "").toLowerCase()}`;
11098
11106
  const { encodeFunctionData: encodeFunctionData30, parseAbi: parseAbi34 } = await import("viem");
11099
11107
  const tokenMessengerAbi = parseAbi34([