@hypurrquant/defi-cli 1.0.9 → 1.0.11

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.
@@ -7454,7 +7454,18 @@ var Executor = class _Executor {
7454
7454
  * Check allowance for a single token/spender pair and send an approve tx if needed.
7455
7455
  * Only called in broadcast mode (not dry-run).
7456
7456
  */
7457
+ /**
7458
+ * Recognize the standard native-token sentinels:
7459
+ * - 0x0000…0000 — defi-cli's internal marker for native gas tokens
7460
+ * - 0xeeee…eeee — 1inch / KyberSwap / OpenOcean canonical sentinel
7461
+ * Any address normalised to lowercase matches case-insensitively.
7462
+ */
7463
+ static isNativeSentinel(token) {
7464
+ const t = token.toLowerCase();
7465
+ return t === "0x0000000000000000000000000000000000000000" || t === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
7466
+ }
7457
7467
  async checkAndApprove(token, spender, amount, owner, publicClient, walletClient) {
7468
+ if (_Executor.isNativeSentinel(token)) return;
7458
7469
  const allowance = await publicClient.readContract({
7459
7470
  address: token,
7460
7471
  abi: ERC20_ABI4,
@@ -7535,9 +7546,12 @@ var Executor = class _Executor {
7535
7546
  /**
7536
7547
  * Fetch EIP-1559 fee params. Returns [maxFeePerGas, maxPriorityFeePerGas].
7537
7548
  *
7538
- * Strategy: read the latest block's `baseFeePerGas` and use the canonical
7539
- * EIP-1559 formula `maxFee = baseFee * 2 + priorityFee` (1 block of head-room
7540
- * after a 12.5% bump). Falls back to `getGasPrice() + priorityFee` only when
7549
+ * Strategy: read the latest block's `baseFeePerGas` and apply the conservative
7550
+ * formula `maxFee = baseFee * 1.25 + priorityFee` (one block of head-room — the
7551
+ * 12.5% per-block max bump). The canonical wastes budget on chains where
7552
+ * baseFee is already elevated (e.g., Mantle ~50 gwei → 100 gwei doubled the
7553
+ * MNT requirement and broke multi-step flows). Falls back to
7554
+ * `getGasPrice() + priorityFee` only when
7541
7555
  * the chain doesn't expose `baseFeePerGas` (pre-1559).
7542
7556
  *
7543
7557
  * Why not gasPrice * 2: `getGasPrice()` returns `baseFee + priorityFee`, so
@@ -7556,7 +7570,7 @@ var Executor = class _Executor {
7556
7570
  try {
7557
7571
  const block = await client.getBlock({ blockTag: "latest" });
7558
7572
  if (block.baseFeePerGas !== null && block.baseFeePerGas !== void 0) {
7559
- const maxFee = block.baseFeePerGas * 2n + priorityFee;
7573
+ const maxFee = block.baseFeePerGas * 125n / 100n + priorityFee;
7560
7574
  return [maxFee, priorityFee];
7561
7575
  }
7562
7576
  } catch {
@@ -7600,6 +7614,7 @@ var Executor = class _Executor {
7600
7614
  if (tx.approvals && tx.approvals.length > 0) {
7601
7615
  const pendingApprovals = [];
7602
7616
  for (const approval of tx.approvals) {
7617
+ if (_Executor.isNativeSentinel(approval.token)) continue;
7603
7618
  try {
7604
7619
  const allowance = await client.readContract({
7605
7620
  address: approval.token,