@panoptic-eng/sdk 1.0.60 → 1.0.61

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.
@@ -1,6 +1,6 @@
1
- import { PanopticError, getBlockMeta, getPoolMetadata, submitWrite } from "./rates-COAJpKRd.js";
1
+ import { PanopticError, getBlockMeta, getPoolMetadata, submitWrite } from "./rates-CPHxWqpT.js";
2
2
  import { tickToSqrtPriceX96 } from "./greeks-CNi1-cnp.js";
3
- import { decodeAllLegs } from "./writes-BTkqc_rn.js";
3
+ import { decodeAllLegs } from "./writes-gs0k0uoN.js";
4
4
  import { BaseError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, isAddressEqual, zeroAddress } from "viem";
5
5
 
6
6
  //#region src/uniswap/lpDeposit.ts
@@ -1,5 +1,5 @@
1
- import { PanopticError, getBlockMeta, getPool, submitWrite } from "./rates-COAJpKRd.js";
2
- import { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, QuoterUnavailableError, getUniswapV4Addresses, universalRouterAbi } from "./router-B2fj4_X7.js";
1
+ import { PanopticError, getBlockMeta, getPool, submitWrite } from "./rates-CPHxWqpT.js";
2
+ import { AmountExceedsUint128Error, InvalidSwapTokenError, MissingSweepRecipientError, QuoterUnavailableError, getUniswapV4Addresses, universalRouterAbi } from "./router-BZGHjEcU.js";
3
3
  import { BaseError, ContractFunctionRevertedError, encodeAbiParameters, encodeFunctionData, encodePacked, erc20Abi, isAddressEqual, maxUint256, zeroAddress } from "viem";
4
4
 
5
5
  //#region src/uniswap/v4/router/encodeSwap.ts
@@ -89,6 +89,7 @@ function resolveFeeHistoryQuote({ baseFeePerGas, reward, minimumPriorityFeePerGa
89
89
  const maxPriorityFeePerGas = clampPriorityFee(sampledPriorityFee, effectivePriorityFeeFloor);
90
90
  const bufferedBaseFee = ceilMultiplyFraction(baseFeePerGas[latestBaseFeeIndex], BASE_FEE_BUFFER_NUMERATOR, BASE_FEE_BUFFER_DENOMINATOR);
91
91
  return {
92
+ currentBaseFeePerGas: baseFeePerGas[latestBaseFeeIndex],
92
93
  maxFeePerGas: bufferedBaseFee + maxPriorityFeePerGas,
93
94
  maxPriorityFeePerGas,
94
95
  minimumMaxFeePerGas: bufferedBaseFee + effectivePriorityFeeFloor,
@@ -223,11 +224,15 @@ function validateVaultSignedTransactionFeeCaps(feeCaps, quote) {
223
224
  code: "GasCostTooHigh",
224
225
  reason: `Signed transaction maximum gas cost (${(gasLimit * maxFeePerGas).toString()} wei) must not exceed ${MAX_VAULT_TRANSACTION_GAS_COST.toString()} wei (0.015 ETH).`
225
226
  };
226
- if (quote !== void 0 && maxFeePerGas < quote.minimumMaxFeePerGas) return {
227
- valid: false,
228
- code: "MaxFeeTooLow",
229
- reason: `Signed transaction maxFeePerGas (${maxFeePerGas.toString()} wei) must be at least ${quote.minimumMaxFeePerGas.toString()} wei for the buffered next-block base fee and configured minimum priority fee.`
230
- };
227
+ if (quote !== void 0) {
228
+ const feeRequirementDescription = quote.currentBaseFeePerGas === void 0 ? "buffered next-block base fee" : "current base fee";
229
+ const minimumBroadcastMaxFeePerGas = quote.currentBaseFeePerGas === void 0 ? quote.minimumMaxFeePerGas : quote.currentBaseFeePerGas + minimumPriorityFeePerGas;
230
+ if (maxFeePerGas < minimumBroadcastMaxFeePerGas) return {
231
+ valid: false,
232
+ code: "MaxFeeTooLow",
233
+ reason: `Signed transaction maxFeePerGas (${maxFeePerGas.toString()} wei) must be at least ${minimumBroadcastMaxFeePerGas.toString()} wei for the ${feeRequirementDescription} and configured minimum priority fee.`
234
+ };
235
+ }
231
236
  return { valid: true };
232
237
  }
233
238
  async function resolveVaultTransactionFeeQuote({ readFeeHistory, readFallbackEstimate, minimumPriorityFeePerGas }) {