@aegis-engine/core 0.8.1 → 0.8.2

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.
@@ -3,14 +3,14 @@ var es = (e, t, n) => t in e ? Zi(e, t, { enumerable: !0, configurable: !0, writ
3
3
  var G = (e, t, n) => es(e, typeof t != "symbol" ? t + "" : t, n);
4
4
  import { getAddress as N, encodeAbiParameters as Oe, keccak256 as ro, zeroAddress as pe, encodeFunctionData as ht, decodeFunctionData as ts, http as ns, createPublicClient as os, custom as wt, fallback as as, isAddress as Ya, createWalletClient as Ft, erc20Abi as Nn, hashTypedData as rs, size as is, BaseError as ss, ContractFunctionRevertedError as cs, ContractFunctionZeroDataError as ls, ExecutionRevertedError as Go, RpcRequestError as jo, HttpRequestError as ds, TimeoutError as us, toHex as ms, formatUnits as Qo } from "viem";
5
5
  import { N as io, I as Z, U as D, J as k, K as ps, L as rt, M as Mt, O as W, s as S, Q as so, R as le, S as q, n as w, T as fs, V as hs, W as ws, X as te, o as T, Y as bs, d as Fe, Z as Se, _ as V, l as B, $ as Ja, e as ge, b as Lt, a0 as Ce, c as co, a1 as ks, a2 as vs, a3 as Le, a4 as en, a5 as Ut, a6 as Ue, a7 as ys, a8 as lo, a9 as Za, aa as Es, ab as uo, ac as Is, A as Xo, ad as je, ae as qn } from "./transactionHistory-1Zl2KCcV.js";
6
- import { af as s0, ag as c0, ah as l0, ai as d0, aj as u0, ak as m0, al as p0, am as f0, an as h0, ao as w0, ap as b0, aq as k0, ar as v0, as as y0, at as E0, au as I0, av as A0, aw as g0, ax as S0, ay as C0, az as x0, aA as T0, aB as R0, aC as P0, aD as B0, aE as M0, aF as D0, aG as _0, aH as N0, aI as q0, aJ as O0, aK as F0, g as L0, h as U0, j as V0, k as H0, m as $0, a as W0, p as K0, f as z0, P as G0, q as j0, t as Q0, u as X0, v as Y0, x as J0, y as Z0, z as eh, B as th, C as nh, aL as oh, aM as ah, D as rh, F as ih, G as sh, H as ch } from "./transactionHistory-1Zl2KCcV.js";
6
+ import { af as ch, ag as lh, ah as dh, ai as uh, aj as mh, ak as ph, al as fh, am as hh, an as wh, ao as bh, ap as kh, aq as vh, ar as yh, as as Eh, at as Ih, au as Ah, av as gh, aw as Sh, ax as Ch, ay as xh, az as Th, aA as Rh, aB as Ph, aC as Bh, aD as Mh, aE as Dh, aF as _h, aG as Nh, aH as qh, aI as Oh, aJ as Fh, aK as Lh, g as Uh, h as Vh, j as Hh, k as $h, m as Wh, a as Kh, p as zh, f as Gh, P as jh, q as Qh, t as Xh, u as Yh, v as Jh, x as Zh, y as e0, z as t0, B as n0, C as o0, aL as a0, aM as r0, D as i0, F as s0, G as c0, H as l0 } from "./transactionHistory-1Zl2KCcV.js";
7
7
  import { bsc as er, mainnet as tr, base as As, unichain as gs } from "viem/chains";
8
8
  const Q = 1, we = 56, On = N("0x00581261a1200956ea05d1810fF28ffd66D8E254"), nr = N("0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E"), or = {
9
9
  [Q]: [On],
10
10
  [we]: [nr],
11
11
  130: [N("0x9641682f95bad3305c18c549a483f413d23dc72e")],
12
12
  8453: [On]
13
- }, _p = N("0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC"), Np = N("0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc"), qp = 8388608, ar = 50, mo = N(
13
+ }, Np = N("0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC"), qp = N("0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc"), Op = 8388608, ar = 50, mo = N(
14
14
  "0x8ea2C7de60ef1Cd4dcE64ea2DDDe2f99F0127eFC"
15
15
  ), rr = [
16
16
  "https://ethereum-rpc.publicnode.com",
@@ -199,7 +199,7 @@ function cr(e, t) {
199
199
  fee: t == null ? void 0 : t.fee
200
200
  };
201
201
  }
202
- function Op(e) {
202
+ function Fp(e) {
203
203
  const t = { ...ho };
204
204
  if (!e) return t;
205
205
  for (const [n, o] of Object.entries(e)) {
@@ -252,7 +252,7 @@ const mt = {
252
252
  // mark stays correct even when the metadata service is unreachable.
253
253
  iconUrl: "https://ichi-images.s3.us-east-1.amazonaws.com/tokens/logo_256_stone_2.svg"
254
254
  }
255
- }, Fp = {
255
+ }, Lp = {
256
256
  BNB: {
257
257
  chainId: we,
258
258
  address: "0x0000000000000000000000000000000000000000",
@@ -337,10 +337,10 @@ const mt = {
337
337
  wo
338
338
  ), Ds = Object.values(
339
339
  Bs
340
- ), Lp = {
340
+ ), Up = {
341
341
  default: Ms,
342
342
  wolfgame: Ds
343
- }, Up = wo, bo = [
343
+ }, Vp = wo, bo = [
344
344
  {
345
345
  type: "function",
346
346
  name: "execute",
@@ -728,7 +728,7 @@ function Ys(e, t = ho) {
728
728
  label: e.label ?? `${o.symbol} / ${n.symbol}`
729
729
  };
730
730
  }
731
- function Vp(e, t = ho) {
731
+ function Hp(e, t = ho) {
732
732
  return e != null && e.length ? Object.fromEntries(
733
733
  e.map((n) => {
734
734
  const o = Ys(n, t);
@@ -992,7 +992,7 @@ function oc(e, t) {
992
992
  if (rn(e), !hr(e.poolKey, t))
993
993
  throw new ko("The executable quote no longer matches its trusted pool.");
994
994
  }
995
- function Hp(e) {
995
+ function $p(e) {
996
996
  if (!wr(e))
997
997
  throw new ko("The host-authorized pool is internally inconsistent.");
998
998
  return fr.add(e), e;
@@ -1094,7 +1094,7 @@ async function mc(e) {
1094
1094
  function vr(e, t) {
1095
1095
  return e.mode === t.mode && e.zeroForOne === t.zeroForOne && k(e.poolKey.currency0, t.poolKey.currency0) && k(e.poolKey.currency1, t.poolKey.currency1) && e.poolKey.fee === t.poolKey.fee && e.poolKey.tickSpacing === t.poolKey.tickSpacing && k(e.poolKey.hooks, t.poolKey.hooks) && e.feeBps === t.feeBps && ps(e.feeRecipient, t.feeRecipient);
1096
1096
  }
1097
- function $p(e, t) {
1097
+ function Wp(e, t) {
1098
1098
  return vr(e, t) && e.amountIn === t.amountIn && e.amountOut === t.amountOut && e.grossAmountOut === t.grossAmountOut && e.amountOutMinimum === t.amountOutMinimum && e.amountInMaximum === t.amountInMaximum && e.userAmountOutMinimum === t.userAmountOutMinimum && e.feeAmount === t.feeAmount;
1099
1099
  }
1100
1100
  function ea(e, t) {
@@ -1609,7 +1609,7 @@ function Dc(e) {
1609
1609
  const _c = 2, Nc = "Route temporarily unavailable. Refresh the quote and try again.", qc = {
1610
1610
  [Q]: Ss
1611
1611
  };
1612
- function Wp(e, t) {
1612
+ function Kp(e, t) {
1613
1613
  return Cr(e) ? Nc : fs(e, t);
1614
1614
  }
1615
1615
  class sa extends D {
@@ -1882,7 +1882,7 @@ function el(e, t) {
1882
1882
  `Wallet is on chain ${e} but the transaction targets chain ${t}.`
1883
1883
  );
1884
1884
  }
1885
- const tl = ["aegisEngine", "aegisHook", "aegisRouterV1", "aegisStateView", "vaultRegistry", "variableInterestRate", "oracleManager", "limitOrderManager", "dynamicFeeManager", "poolManager", "positionManager", "stateView", "uniswapV4Quoter", "permit2", "weth9"], nl = { 1: { version: "v1.0.2", contracts: { aegisEngine: { address: "0x4d9BDd0cdfF5DC9149C2DaE8377a3352790C50c9" }, aegisHook: { address: "0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC" }, aegisRouterV1: { address: "0x00581261a1200956ea05d1810fF28ffd66D8E254" }, aegisStateView: { address: "0xB6191c5f5983Bf5c9B993e405781B6E88449bDB6" }, vaultRegistry: { address: "0x5cfB5e914ECb2809C19E89b8A1c41F3e57958D87" }, variableInterestRate: { address: "0xE929011f14FA04ce4EeDDFf0aC1ef923D1e1df23" }, oracleManager: { address: "0x6Bc6fe74B3C360E6D838295EeeC8F58eBBcE3e5C" }, limitOrderManager: { address: "0x5985c41edF54cca8aa2e16c7a22e1eB59948068E" }, dynamicFeeManager: { address: "0x5cC0F3f0933b465a37124403739c80bE857Ca45E" }, poolManager: { address: "0x000000000004444c5dc75cB358380D2e3dE08A90" }, positionManager: { address: "0xbd216513d74c8cf14cf4747e6aaa6420ff64ee9e" }, stateView: { address: "0x7ffe42c4a5deea5b0fec41c94c136cf115597227" }, uniswapV4Quoter: { address: "0x52f0e24d1c21c8a0cb1e5a5dd6198556bd9e1203" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" } } }, 56: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x28e2Ea090877bF75740558f6BFB36A5ffeE9e9dF" }, positionManager: { address: "0x7A4a5c919aE2541AeD11041A1AEeE68f1287f95b" }, stateView: { address: "0xd13Dd3D6E93f276FAfc9Db9E6BB47C1180aeE0c4" }, uniswapV4Quoter: { address: "0x9F75dD27D6664c475B90e105573E550ff69437B0" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" } } }, 130: { version: "v0.4.0", contracts: { aegisEngine: { address: "0x2DDEA3c59b90d808AA980e9e5a460FdB3c87ccB0" }, aegisHook: { address: "0x3476b53425a786e57aA246839C1837a62fc21ACC" }, aegisRouterV1: { address: "0x9641682F95baD3305C18c549a483F413d23dC72e" }, aegisStateView: { address: "0x907f323c608FCd4d70D77a4d944B4bffbC7C10Ce" }, vaultRegistry: { address: "0xe19414e5C3DB1596f583d18d3Ac5bb43CBabc50D" }, variableInterestRate: { address: "0xCCDECda074d8411651AC1B8FD87c5CA7551f28F6" }, oracleManager: { address: "0x708c46aB579B7a9eBA70D39a059664EA6FD91737" }, limitOrderManager: { address: "0xCc7F9dC1C6BA855E2507c9C65910B48A7F6497C1" }, dynamicFeeManager: { address: "0xEC2eD4784e6aE796A75Ef9E5d74269f09AFC482C" }, poolManager: { address: "0x1F98400000000000000000000000000000000004" }, positionManager: { address: "0x4529A01c7A0410167c5740C487A8DE60232617bf" }, stateView: { address: "0x86e8631a016f9068c3f085faf484ee3f5fdee8f2" }, uniswapV4Quoter: { address: "0x333e3c607b141b18ff6de9f258db6e77fe7491e0" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } }, 4663: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x8366a39CC670B4001A1121B8F6A443A643e40951" }, positionManager: { address: "0x58daec3116aae6D93017bAAea7749052E8a04fA7" }, stateView: { address: "0xf3334192d15450cdd385c8b70e03f9a6bd9e673b" }, uniswapV4Quoter: { address: "0x8dc178efb8111bb0973dd9d722ebeff267c98f94" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73" } } }, 8453: { version: "v1.0.2", contracts: { aegisEngine: { address: "0x4d9BDd0cdfF5DC9149C2DaE8377a3352790C50c9" }, aegisHook: { address: "0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC" }, aegisRouterV1: { address: "0x00581261a1200956ea05d1810fF28ffd66D8E254" }, aegisStateView: { address: "0xB6191c5f5983Bf5c9B993e405781B6E88449bDB6" }, vaultRegistry: { address: "0x5cfB5e914ECb2809C19E89b8A1c41F3e57958D87" }, variableInterestRate: { address: "0xE929011f14FA04ce4EeDDFf0aC1ef923D1e1df23" }, oracleManager: { address: "0x6Bc6fe74B3C360E6D838295EeeC8F58eBBcE3e5C" }, limitOrderManager: { address: "0x5985c41edF54cca8aa2e16c7a22e1eB59948068E" }, dynamicFeeManager: { address: "0x5cC0F3f0933b465a37124403739c80bE857Ca45E" }, poolManager: { address: "0x498581ff718922c3f8e6a244956af099b2652b2b" }, positionManager: { address: "0x7c5f5a4bbd8fd63184577525326123b519429bdc" }, stateView: { address: "0xa3c0c9b65bad0b08107aa264b0f3db444b867a71" }, uniswapV4Quoter: { address: "0x0d5e0f971ed27fbff6c2837bf31316121532048d" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } }, 57073: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32" }, positionManager: { address: "0x1b35d13a2E2528f192637F14B05f0Dc0e7dEB566" }, stateView: { address: "0x76fd297e2d437cd7f76d50f01afe6160f86e9990" }, uniswapV4Quoter: { address: "0x3972c00f7ed4885e145823eb7c655375d275a1c5" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } } }, Kp = 95, Wn = [
1885
+ const tl = ["aegisEngine", "aegisHook", "aegisRouterV1", "aegisStateView", "vaultRegistry", "variableInterestRate", "oracleManager", "limitOrderManager", "dynamicFeeManager", "poolManager", "positionManager", "stateView", "uniswapV4Quoter", "permit2", "weth9"], nl = { 1: { version: "v1.0.2", contracts: { aegisEngine: { address: "0x4d9BDd0cdfF5DC9149C2DaE8377a3352790C50c9" }, aegisHook: { address: "0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC" }, aegisRouterV1: { address: "0x00581261a1200956ea05d1810fF28ffd66D8E254" }, aegisStateView: { address: "0xB6191c5f5983Bf5c9B993e405781B6E88449bDB6" }, vaultRegistry: { address: "0x5cfB5e914ECb2809C19E89b8A1c41F3e57958D87" }, variableInterestRate: { address: "0xE929011f14FA04ce4EeDDFf0aC1ef923D1e1df23" }, oracleManager: { address: "0x6Bc6fe74B3C360E6D838295EeeC8F58eBBcE3e5C" }, limitOrderManager: { address: "0x5985c41edF54cca8aa2e16c7a22e1eB59948068E" }, dynamicFeeManager: { address: "0x5cC0F3f0933b465a37124403739c80bE857Ca45E" }, poolManager: { address: "0x000000000004444c5dc75cB358380D2e3dE08A90" }, positionManager: { address: "0xbd216513d74c8cf14cf4747e6aaa6420ff64ee9e" }, stateView: { address: "0x7ffe42c4a5deea5b0fec41c94c136cf115597227" }, uniswapV4Quoter: { address: "0x52f0e24d1c21c8a0cb1e5a5dd6198556bd9e1203" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" } } }, 56: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x28e2Ea090877bF75740558f6BFB36A5ffeE9e9dF" }, positionManager: { address: "0x7A4a5c919aE2541AeD11041A1AEeE68f1287f95b" }, stateView: { address: "0xd13Dd3D6E93f276FAfc9Db9E6BB47C1180aeE0c4" }, uniswapV4Quoter: { address: "0x9F75dD27D6664c475B90e105573E550ff69437B0" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" } } }, 130: { version: "v0.4.0", contracts: { aegisEngine: { address: "0x2DDEA3c59b90d808AA980e9e5a460FdB3c87ccB0" }, aegisHook: { address: "0x3476b53425a786e57aA246839C1837a62fc21ACC" }, aegisRouterV1: { address: "0x9641682F95baD3305C18c549a483F413d23dC72e" }, aegisStateView: { address: "0x907f323c608FCd4d70D77a4d944B4bffbC7C10Ce" }, vaultRegistry: { address: "0xe19414e5C3DB1596f583d18d3Ac5bb43CBabc50D" }, variableInterestRate: { address: "0xCCDECda074d8411651AC1B8FD87c5CA7551f28F6" }, oracleManager: { address: "0x708c46aB579B7a9eBA70D39a059664EA6FD91737" }, limitOrderManager: { address: "0xCc7F9dC1C6BA855E2507c9C65910B48A7F6497C1" }, dynamicFeeManager: { address: "0xEC2eD4784e6aE796A75Ef9E5d74269f09AFC482C" }, poolManager: { address: "0x1F98400000000000000000000000000000000004" }, positionManager: { address: "0x4529A01c7A0410167c5740C487A8DE60232617bf" }, stateView: { address: "0x86e8631a016f9068c3f085faf484ee3f5fdee8f2" }, uniswapV4Quoter: { address: "0x333e3c607b141b18ff6de9f258db6e77fe7491e0" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } }, 4663: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x8366a39CC670B4001A1121B8F6A443A643e40951" }, positionManager: { address: "0x58daec3116aae6D93017bAAea7749052E8a04fA7" }, stateView: { address: "0xf3334192d15450cdd385c8b70e03f9a6bd9e673b" }, uniswapV4Quoter: { address: "0x8dc178efb8111bb0973dd9d722ebeff267c98f94" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x0Bd7D308f8E1639FAb988df18A8011f41EAcAD73" } } }, 8453: { version: "v1.0.2", contracts: { aegisEngine: { address: "0x4d9BDd0cdfF5DC9149C2DaE8377a3352790C50c9" }, aegisHook: { address: "0x8f29BD5c8429730fA4C46e6295c4e679eDEdd0cC" }, aegisRouterV1: { address: "0x00581261a1200956ea05d1810fF28ffd66D8E254" }, aegisStateView: { address: "0xB6191c5f5983Bf5c9B993e405781B6E88449bDB6" }, vaultRegistry: { address: "0x5cfB5e914ECb2809C19E89b8A1c41F3e57958D87" }, variableInterestRate: { address: "0xE929011f14FA04ce4EeDDFf0aC1ef923D1e1df23" }, oracleManager: { address: "0x6Bc6fe74B3C360E6D838295EeeC8F58eBBcE3e5C" }, limitOrderManager: { address: "0x5985c41edF54cca8aa2e16c7a22e1eB59948068E" }, dynamicFeeManager: { address: "0x5cC0F3f0933b465a37124403739c80bE857Ca45E" }, poolManager: { address: "0x498581ff718922c3f8e6a244956af099b2652b2b" }, positionManager: { address: "0x7c5f5a4bbd8fd63184577525326123b519429bdc" }, stateView: { address: "0xa3c0c9b65bad0b08107aa264b0f3db444b867a71" }, uniswapV4Quoter: { address: "0x0d5e0f971ed27fbff6c2837bf31316121532048d" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } }, 57073: { version: "v1.0.3", contracts: { aegisEngine: { address: "0x1a22457422B9308AB0C0dC6cef8629e061716009" }, aegisHook: { address: "0xe449E013004DB4a5681E9622ca10c5Ba0eA610cc" }, aegisRouterV1: { address: "0xe2820f3DA0abC9C65B3727A7103E3F59c00D686E" }, aegisStateView: { address: "0xD64A84C0C2F56F5fC1C87760926083130B3fE5E0" }, vaultRegistry: { address: "0xbABfccADC23629DE0D7E73433ABFC6D986083B09" }, variableInterestRate: { address: "0xa2D9846A73f1134962F366d991B2080d39a427AB" }, oracleManager: { address: "0x6e9B305B99d2ac39158e5D4bb5d42012D631F9e4" }, limitOrderManager: { address: "0xFA5062a51A30d29AAb423123E9449e95bc8dB3a1" }, dynamicFeeManager: { address: "0xc307E55749941e6B0Fc0D7B487fF01198cA48bE1" }, poolManager: { address: "0x360E68faCcca8cA495c1B759Fd9EEe466db9FB32" }, positionManager: { address: "0x1b35d13a2E2528f192637F14B05f0Dc0e7dEB566" }, stateView: { address: "0x76fd297e2d437cd7f76d50f01afe6160f86e9990" }, uniswapV4Quoter: { address: "0x3972c00f7ed4885e145823eb7c655375d275a1c5" }, permit2: { address: "0x000000000022D473030F116dDEE9F6B43aC78BA3" }, weth9: { address: "0x4200000000000000000000000000000000000006" } } } }, zp = 95, Wn = [
1886
1886
  "aegisEngine",
1887
1887
  "aegisHook",
1888
1888
  "aegisRouterV1",
@@ -1906,7 +1906,7 @@ function al(e, t) {
1906
1906
  if (e === "v0.4.0" || e === "v1.0.2" || e === "v1.0.3") return e;
1907
1907
  throw new Error(`${t} must be a supported Aegis Engine version.`);
1908
1908
  }
1909
- function re(e, t, n) {
1909
+ function ae(e, t, n) {
1910
1910
  const o = e[t];
1911
1911
  if (!Tt(o) || typeof o.address != "string")
1912
1912
  throw new Error(`${n}.${t}.address is required.`);
@@ -1921,21 +1921,21 @@ function rl(e, t) {
1921
1921
  for (const n of Object.keys(e))
1922
1922
  if (!ol.has(n)) throw new Error(`${t}.${n} is not a supported key.`);
1923
1923
  return Object.freeze({
1924
- aegisEngine: re(e, "aegisEngine", t),
1925
- aegisHook: re(e, "aegisHook", t),
1926
- aegisRouterV1: re(e, "aegisRouterV1", t),
1927
- aegisStateView: re(e, "aegisStateView", t),
1928
- vaultRegistry: re(e, "vaultRegistry", t),
1929
- variableInterestRate: re(e, "variableInterestRate", t),
1930
- oracleManager: re(e, "oracleManager", t),
1931
- limitOrderManager: re(e, "limitOrderManager", t),
1932
- dynamicFeeManager: re(e, "dynamicFeeManager", t),
1933
- poolManager: re(e, "poolManager", t),
1934
- positionManager: re(e, "positionManager", t),
1935
- stateView: re(e, "stateView", t),
1936
- uniswapV4Quoter: re(e, "uniswapV4Quoter", t),
1937
- permit2: re(e, "permit2", t),
1938
- weth9: re(e, "weth9", t)
1924
+ aegisEngine: ae(e, "aegisEngine", t),
1925
+ aegisHook: ae(e, "aegisHook", t),
1926
+ aegisRouterV1: ae(e, "aegisRouterV1", t),
1927
+ aegisStateView: ae(e, "aegisStateView", t),
1928
+ vaultRegistry: ae(e, "vaultRegistry", t),
1929
+ variableInterestRate: ae(e, "variableInterestRate", t),
1930
+ oracleManager: ae(e, "oracleManager", t),
1931
+ limitOrderManager: ae(e, "limitOrderManager", t),
1932
+ dynamicFeeManager: ae(e, "dynamicFeeManager", t),
1933
+ poolManager: ae(e, "poolManager", t),
1934
+ positionManager: ae(e, "positionManager", t),
1935
+ stateView: ae(e, "stateView", t),
1936
+ uniswapV4Quoter: ae(e, "uniswapV4Quoter", t),
1937
+ permit2: ae(e, "permit2", t),
1938
+ weth9: ae(e, "weth9", t)
1939
1939
  });
1940
1940
  }
1941
1941
  function il(e) {
@@ -1969,7 +1969,7 @@ function de(e) {
1969
1969
  var t;
1970
1970
  return ((t = Pr.get(e)) == null ? void 0 : t.addresses) ?? null;
1971
1971
  }
1972
- function zp(e) {
1972
+ function Gp(e) {
1973
1973
  const t = de(e);
1974
1974
  if (!t) throw new Error(`No trusted Aegis Engine registry for chain ${e}.`);
1975
1975
  return t.aegisRouterV1;
@@ -2066,7 +2066,7 @@ async function kl(e, t) {
2066
2066
  params: [{ chainId: o }]
2067
2067
  });
2068
2068
  }
2069
- function Gp(e, t, n) {
2069
+ function jp(e, t, n) {
2070
2070
  var s, l;
2071
2071
  const o = t.length > 1, a = t.map(
2072
2072
  (c) => ns(c, {
@@ -2088,7 +2088,7 @@ function Gp(e, t, n) {
2088
2088
  transport: n ? wt(n, { retryCount: 0 }) : a.length === 1 ? a[0] : as(a)
2089
2089
  });
2090
2090
  }
2091
- function jp(e, t) {
2091
+ function Qp(e, t) {
2092
2092
  const n = e;
2093
2093
  if (!n.on || !n.removeListener) return () => {
2094
2094
  };
@@ -2429,14 +2429,14 @@ function Ul(e) {
2429
2429
  const t = Ll(e);
2430
2430
  return t ? `${Ml}/logo_256_${t}.svg` : null;
2431
2431
  }
2432
- function Qp(e, t) {
2432
+ function Xp(e, t) {
2433
2433
  var n, o;
2434
2434
  return ((n = e.iconUrl) != null && n.trim() ? e.iconUrl : null) ?? ((o = t[te(e.address)]) == null ? void 0 : o.iconURL) ?? Ul(e.symbol);
2435
2435
  }
2436
2436
  function Vl(e, t) {
2437
2437
  return `query AegisSwapWidgetTokenMetadata { ${t.map((o, a) => `t${a}: getGlobalToken(id: ${JSON.stringify(Fl(e, o))}) { chainId address symbol displayName fullName decimals iconURL price }`).join(" ")} }`;
2438
2438
  }
2439
- async function Xp(e) {
2439
+ async function Yp(e) {
2440
2440
  var p, d;
2441
2441
  const t = e.endpoint.trim();
2442
2442
  if (!Number.isSafeInteger(e.chainId))
@@ -2515,7 +2515,7 @@ function jl(e) {
2515
2515
  co(e.headers)
2516
2516
  ].join("|");
2517
2517
  }
2518
- function Yp() {
2518
+ function Jp() {
2519
2519
  go.clear();
2520
2520
  }
2521
2521
  function Or(e) {
@@ -2539,7 +2539,7 @@ function Or(e) {
2539
2539
  window: a
2540
2540
  };
2541
2541
  }
2542
- function Jp(e) {
2542
+ function Zp(e) {
2543
2543
  const t = Or(e);
2544
2544
  return t ? go.peek(t.key) ?? null : null;
2545
2545
  }
@@ -2588,7 +2588,7 @@ async function Ql(e) {
2588
2588
  updatedAt: a.data.updatedAt
2589
2589
  };
2590
2590
  }
2591
- async function Zp(e) {
2591
+ async function ef(e) {
2592
2592
  const t = Or(e);
2593
2593
  if (!t) return null;
2594
2594
  const n = go.read(
@@ -2885,10 +2885,10 @@ async function $r({
2885
2885
  }
2886
2886
  }), d == null || d({ planned: 1, completed: 1 }), null;
2887
2887
  }
2888
- function ef() {
2888
+ function tf() {
2889
2889
  return typeof document > "u" ? !0 : document.visibilityState !== "hidden";
2890
2890
  }
2891
- async function tf(e, t, n, o) {
2891
+ async function nf(e, t, n, o) {
2892
2892
  let a;
2893
2893
  for (let r = 0; r < t; r += 1) {
2894
2894
  r > 0 && await new Promise((i) => setTimeout(i, n));
@@ -2999,7 +2999,7 @@ async function $e(e) {
2999
2999
  if ((s = e.signal) == null || s.throwIfAborted(), (l = e.onChainId) == null || l.call(e, a), !o)
3000
3000
  throw new Error("Network switch did not complete. Switch to the correct network and try again.");
3001
3001
  }
3002
- async function nf(e = {}) {
3002
+ async function of(e = {}) {
3003
3003
  var o;
3004
3004
  let t = e.provider ?? await ((o = e.getProvider) == null ? void 0 : o.call(e)) ?? cl(), n = cn(e.account);
3005
3005
  if ((!t || !n) && e.connectWallet) {
@@ -3081,7 +3081,7 @@ async function cd(e) {
3081
3081
  });
3082
3082
  return { approvalHash: n.at(-1) ?? null, allowance: o };
3083
3083
  }
3084
- async function of(e) {
3084
+ async function af(e) {
3085
3085
  var E, y, C, x, A, P, g;
3086
3086
  sd(e), await $e({
3087
3087
  provider: e.wallet.provider,
@@ -3264,7 +3264,7 @@ function md(e) {
3264
3264
  feeBps: e.feeBps
3265
3265
  };
3266
3266
  }
3267
- async function af(e) {
3267
+ async function rf(e) {
3268
3268
  var l, c, p;
3269
3269
  if (e.inputToken.chainId !== e.activeChain.chainId || e.outputToken.chainId !== e.activeChain.chainId)
3270
3270
  throw new Error(
@@ -3342,10 +3342,10 @@ async function af(e) {
3342
3342
  swap: r
3343
3343
  };
3344
3344
  }
3345
- function rf(e) {
3345
+ function sf(e) {
3346
3346
  return e === "approving" || e === "signing" || e === "submitting";
3347
3347
  }
3348
- function sf(e) {
3348
+ function cf(e) {
3349
3349
  const t = (e == null ? void 0 : e.steps) ?? (e == null ? void 0 : e.walletPrompts.total);
3350
3350
  return t !== void 0 && Number.isFinite(t) && t >= 2 ? Math.floor(t) : void 0;
3351
3351
  }
@@ -3419,7 +3419,7 @@ function hd({
3419
3419
  active: t ? null : y
3420
3420
  };
3421
3421
  }
3422
- function cf({
3422
+ function lf({
3423
3423
  status: e,
3424
3424
  inputSymbol: t,
3425
3425
  txHash: n,
@@ -3594,7 +3594,7 @@ function gd(e) {
3594
3594
  function Sd(e) {
3595
3595
  return e.map(gd);
3596
3596
  }
3597
- function lf(e, t, n = {}) {
3597
+ function df(e, t, n = {}) {
3598
3598
  var i, s, l, c, p, d, m;
3599
3599
  const o = {}, a = bd(e), r = Ad(n.enabledChainIds);
3600
3600
  for (const u of e.chains) {
@@ -3661,7 +3661,7 @@ function lf(e, t, n = {}) {
3661
3661
  }
3662
3662
  return o;
3663
3663
  }
3664
- function df({
3664
+ function uf({
3665
3665
  config: e,
3666
3666
  markets: t,
3667
3667
  tokens: n,
@@ -4597,7 +4597,7 @@ function pn(e, t) {
4597
4597
  ...t.map((n) => n.toLowerCase())
4598
4598
  ].join(":");
4599
4599
  }
4600
- function uf() {
4600
+ function mf() {
4601
4601
  Xn = /* @__PURE__ */ new WeakMap();
4602
4602
  }
4603
4603
  async function Iu(e) {
@@ -4621,7 +4621,7 @@ async function Iu(e) {
4621
4621
  return { market: c, thresholds: p, poolState: d, sharePriceWadLatest: m };
4622
4622
  });
4623
4623
  }
4624
- async function mf(e) {
4624
+ async function pf(e) {
4625
4625
  const t = await Iu(e), { priceFromSqrtX96: n } = await K(), o = n(
4626
4626
  t.poolState.sqrtPriceX96,
4627
4627
  e.market.token0.decimals,
@@ -4842,7 +4842,7 @@ async function xu(e) {
4842
4842
  });
4843
4843
  return { ...e.result, vaults: a, shares: r };
4844
4844
  }
4845
- async function pf(e) {
4845
+ async function ff(e) {
4846
4846
  var h, f, b, E;
4847
4847
  gu(e);
4848
4848
  const t = kt(e.chainId);
@@ -4963,7 +4963,7 @@ function li(e) {
4963
4963
  receivedIsToken0: o ? o.deltaAmount0 < 0n : null
4964
4964
  };
4965
4965
  }
4966
- async function ff(e) {
4966
+ async function hf(e) {
4967
4967
  const t = kt(e.market.chainId);
4968
4968
  if (!t) return null;
4969
4969
  const { createSubgraphClient: n, fetchVaultDebtActions: o, fetchVaultIdleActions: a } = await K(), r = n(
@@ -5117,28 +5117,28 @@ async function Ia(e) {
5117
5117
  }
5118
5118
  });
5119
5119
  }
5120
- function hf() {
5120
+ function wf() {
5121
5121
  ui.clear();
5122
5122
  }
5123
- function wf() {
5123
+ function bf() {
5124
5124
  mi.clear();
5125
5125
  }
5126
- function bf() {
5126
+ function kf() {
5127
5127
  pi.clear();
5128
5128
  }
5129
- function kf() {
5129
+ function vf() {
5130
5130
  fi.clear();
5131
5131
  }
5132
- function vf() {
5132
+ function yf() {
5133
5133
  Mo.clear();
5134
5134
  }
5135
- function yf() {
5135
+ function Ef() {
5136
5136
  Yn.clear();
5137
5137
  }
5138
- function Ef() {
5138
+ function If() {
5139
5139
  Jn.clear();
5140
5140
  }
5141
- async function If(e) {
5141
+ async function Af(e) {
5142
5142
  if (e.source.kind === "static")
5143
5143
  return Fe(Ia(e), e.signal, Ot);
5144
5144
  const t = ui.read(
@@ -5199,7 +5199,7 @@ function Ou(e) {
5199
5199
  }
5200
5200
  });
5201
5201
  }
5202
- async function Af(e) {
5202
+ async function gf(e) {
5203
5203
  if (e.source.kind === "static") return null;
5204
5204
  const t = e.source, n = Co.parse(e.marketId), o = e.window ?? "30d", a = mi.read(
5205
5205
  qu({ source: t, marketId: n, window: o }),
@@ -5319,7 +5319,7 @@ async function ga(e) {
5319
5319
  }
5320
5320
  });
5321
5321
  }
5322
- async function gf(e) {
5322
+ async function Sf(e) {
5323
5323
  if (e.source.kind === "static")
5324
5324
  return Fe(ga(e), e.signal, Ot);
5325
5325
  const t = pi.read(
@@ -5409,7 +5409,7 @@ function Uu(e) {
5409
5409
  throw new TypeError("Engine vaultId must be an unsigned decimal integer.");
5410
5410
  return BigInt(t).toString();
5411
5411
  }
5412
- async function Sf(e) {
5412
+ async function Cf(e) {
5413
5413
  const t = Uu(e.vaultId), n = await wi(e);
5414
5414
  if (!n) return null;
5415
5415
  const o = n.vaults.find(
@@ -5433,7 +5433,7 @@ async function Sf(e) {
5433
5433
  }))
5434
5434
  });
5435
5435
  }
5436
- async function Cf(e) {
5436
+ async function xf(e) {
5437
5437
  const t = await wi(e);
5438
5438
  if (!t) return null;
5439
5439
  const n = e.poolId.toLowerCase(), o = t.lend.find((a) => a.poolId.toLowerCase() === n);
@@ -5556,7 +5556,7 @@ function Xu(e, t, n) {
5556
5556
  }
5557
5557
  return n - Math.max(...o) >= Ku;
5558
5558
  }
5559
- function xf(e) {
5559
+ function Tf(e) {
5560
5560
  const t = e.position !== null, n = e.position ? ju(e.position, e.market, e.hydration) : null, o = Qu(t, n, e.additionalValueUsd), a = e.history, r = (a == null ? void 0 : a.status) === "ready" && a.marketId === e.market.id ? Wu(a) : null, i = (r == null ? void 0 : r.weeklyEarningsPer100Usd) ?? null, s = a && r && i !== null ? {
5561
5561
  weeklyEarningsPer100Usd: i,
5562
5562
  currentWeeklyEarningsUsd: xa(
@@ -5976,7 +5976,7 @@ async function wm(e) {
5976
5976
  anchor: null
5977
5977
  };
5978
5978
  }
5979
- const oe = {
5979
+ const ne = {
5980
5980
  ...L,
5981
5981
  maxEfficientDeposit: Number.isFinite(X.diagnostics.maxEfficientDeposit) ? X.diagnostics.maxEfficientDeposit : null,
5982
5982
  isCapConstrained: X.diagnostics.isCapConstrained,
@@ -6006,17 +6006,17 @@ async function wm(e) {
6006
6006
  (O) => O.leverage >= 1 && (n === "long" ? O.q >= 0 : O.q <= 0)
6007
6007
  ), he = fm(Ee);
6008
6008
  if (he.length === 0)
6009
- return { result: qe({ kind: "no-feasible-band" }, oe), anchor: null };
6009
+ return { result: qe({ kind: "no-feasible-band" }, ne), anchor: null };
6010
6010
  const z = he.reduce(
6011
6011
  (O, Y) => Math.min(O, Y.leverage),
6012
6012
  he[0].leverage
6013
6013
  ), $ = he.reduce(
6014
6014
  (O, Y) => Math.max(O, Y.leverage),
6015
6015
  he[0].leverage
6016
- ), U = Math.min($, Math.max(z, l ?? $)), ae = hm(he, U);
6016
+ ), U = Math.min($, Math.max(z, l ?? $)), oe = hm(he, U);
6017
6017
  return {
6018
- result: { lMin: z, lMax: $, chosen: ae, candidates: be, diagnostics: oe },
6019
- anchor: ae
6018
+ result: { lMin: z, lMax: $, chosen: oe, candidates: be, diagnostics: ne },
6019
+ anchor: oe
6020
6020
  };
6021
6021
  };
6022
6022
  let x = { aprPct: t.aprPct, basis: "current-apr" }, A = C(x);
@@ -6160,7 +6160,7 @@ function Im(e, t) {
6160
6160
  }
6161
6161
  }
6162
6162
  }
6163
- function Tf({
6163
+ function Rf({
6164
6164
  requestedMaxLtvPips: e,
6165
6165
  postBorrowLtvPips: t,
6166
6166
  marketMaxLtvPips: n
@@ -6199,7 +6199,7 @@ function Am({
6199
6199
  }
6200
6200
  return a;
6201
6201
  }
6202
- async function Rf(e) {
6202
+ async function Pf(e) {
6203
6203
  const { quoteDeposit: t } = await K();
6204
6204
  if (!e.market.lendEnabled || e.market.canLend === !1)
6205
6205
  throw new Error("Lending is disabled for this market.");
@@ -6386,10 +6386,10 @@ async function Ci(e, t) {
6386
6386
  tx: it(e.market, f.call)
6387
6387
  };
6388
6388
  }
6389
- async function Pf(e) {
6389
+ async function Bf(e) {
6390
6390
  return Ci(e, { allowDisabledBorrow: !1 });
6391
6391
  }
6392
- async function Bf(e) {
6392
+ async function Mf(e) {
6393
6393
  if (e.collateralIn <= 0n)
6394
6394
  throw new RangeError("Collateral amount must be greater than zero.");
6395
6395
  const { trustedPermit2: t } = Wt(e.market, e.target, "add-collateral");
@@ -6442,7 +6442,7 @@ async function Bf(e) {
6442
6442
  tx: n.tx
6443
6443
  };
6444
6444
  }
6445
- async function Mf(e) {
6445
+ async function Df(e) {
6446
6446
  const t = await K(), { computeBorrowCapacity: n, dMinNoSwap: o, forwardFunctionNoSwap: a, invertSqrtPriceX96: r } = t;
6447
6447
  if (!e.market.borrowEnabled || e.market.canBorrow === !1)
6448
6448
  throw new Error("Borrowing is disabled for this market.");
@@ -6622,7 +6622,7 @@ function Ri(e) {
6622
6622
  var t, n;
6623
6623
  return e.infeasibleReason ? e.infeasibleReason : ((t = e.execution) == null ? void 0 : t.status) === "rejected-at-frame" || ((n = e.execution) == null ? void 0 : n.status) === "re-quote-required" ? e.execution.reason ?? null : null;
6624
6624
  }
6625
- async function Df(e) {
6625
+ async function _f(e) {
6626
6626
  gt(e.slippageBps);
6627
6627
  const { chainId: t, version: n, trustedPermit2: o, trustedQuoter: a } = Wt(
6628
6628
  e.market,
@@ -6679,7 +6679,7 @@ async function Df(e) {
6679
6679
  tx: it(e.market, i.call)
6680
6680
  };
6681
6681
  }
6682
- async function _f(e) {
6682
+ async function Nf(e) {
6683
6683
  const { chainId: t, version: n, trustedPermit2: o } = Wt(
6684
6684
  e.market,
6685
6685
  e.target,
@@ -6721,7 +6721,7 @@ async function _f(e) {
6721
6721
  tx: it(e.market, r.call)
6722
6722
  };
6723
6723
  }
6724
- async function Nf(e) {
6724
+ async function qf(e) {
6725
6725
  const { chainId: t, version: n } = Wt(e.market, e.target, "withdraw"), { quoteIdleWithdraw: o } = await K(), a = await o(e.publicClient, {
6726
6726
  chainId: t,
6727
6727
  version: n,
@@ -6756,7 +6756,7 @@ async function Nf(e) {
6756
6756
  tx: it(e.market, a.call)
6757
6757
  };
6758
6758
  }
6759
- async function qf(e) {
6759
+ async function Of(e) {
6760
6760
  var x;
6761
6761
  gt(e.slippageBps);
6762
6762
  const { chainId: t, version: n } = Wt(e.market, e.target, "redeem"), {
@@ -6797,8 +6797,8 @@ async function qf(e) {
6797
6797
  const [M, F] = await Promise.all([
6798
6798
  o(e.publicClient, g, e.market.poolId, A),
6799
6799
  a(e.publicClient, g, e.market.poolId, A)
6800
- ]), L = M.market.totalRlBorrowed * M.latestBorrowIndexWad, ee = L === 0n ? 0n : L * r / (c + 1n) + 1n, oe = (M.latestEquityLWad >= ee ? M.latestEquityLWad - ee : 0n) / Na, Te = F * Na;
6801
- h = oe > 0n && M.latestEquityLWad > 0n && F > 0n ? ((oe + 1n) * Te - 1n) / M.latestEquityLWad : 0n, h < P && (P = h);
6800
+ ]), L = M.market.totalRlBorrowed * M.latestBorrowIndexWad, ee = L === 0n ? 0n : L * r / (c + 1n) + 1n, ne = (M.latestEquityLWad >= ee ? M.latestEquityLWad - ee : 0n) / Na, Te = F * Na;
6801
+ h = ne > 0n && M.latestEquityLWad > 0n && F > 0n ? ((ne + 1n) * Te - 1n) / M.latestEquityLWad : 0n, h < P && (P = h);
6802
6802
  }
6803
6803
  P > 0n ? (d.sharesDelta !== P && (d = await i(e.publicClient, {
6804
6804
  ...p,
@@ -7036,11 +7036,11 @@ async function Rm(e) {
7036
7036
  maxCollateralIn: F.maxEfficientDeposit === null ? null : hn(F.maxEfficientDeposit, l)
7037
7037
  };
7038
7038
  E = L;
7039
- const { buildTapOpenPosition: ee, computeActualLtvPips: X, minDebtFloorRl: oe, previewFullRangeBorrow: Te } = await K(), be = sm(
7039
+ const { buildTapOpenPosition: ee, computeActualLtvPips: X, minDebtFloorRl: ne, previewFullRangeBorrow: Te } = await K(), be = sm(
7040
7040
  M.delta,
7041
7041
  No(i.decimals0, i.decimals1)
7042
7042
  );
7043
- if (be < oe(i.equityLWad, i.borrowIndexWad))
7043
+ if (be < ne(i.equityLWad, i.borrowIndexWad))
7044
7044
  return h("debt-below-minimum", L);
7045
7045
  if (M.delta > F.deltaCap) return h("delta-above-cap", L);
7046
7046
  const Ee = Te(
@@ -7066,7 +7066,7 @@ async function Rm(e) {
7066
7066
  idle1: z
7067
7067
  });
7068
7068
  if (!$.ok) return h($.reason, L);
7069
- const U = $.leg, ae = await im({
7069
+ const U = $.leg, oe = await im({
7070
7070
  publicClient: e.publicClient,
7071
7071
  quoter: o,
7072
7072
  context: a,
@@ -7076,11 +7076,11 @@ async function Rm(e) {
7076
7076
  slippageBps: e.slippageBps,
7077
7077
  ...e.signal ? { signal: e.signal } : {}
7078
7078
  });
7079
- if ((A = e.signal) == null || A.throwIfAborted(), ae.blockNumber !== a.frame.blockNumber || !await Bi(e.publicClient, a.frame, e.signal))
7079
+ if ((A = e.signal) == null || A.throwIfAborted(), oe.blockNumber !== a.frame.blockNumber || !await Bi(e.publicClient, a.frame, e.signal))
7080
7080
  return h("stale-frame", L);
7081
7081
  const O = U.needed ? Pi(
7082
7082
  U.amountIn,
7083
- ae.amountOutQuoted,
7083
+ oe.amountOutQuoted,
7084
7084
  U.inputIsToken0,
7085
7085
  i.sqrtPriceX96
7086
7086
  ) : null;
@@ -7089,14 +7089,14 @@ async function Rm(e) {
7089
7089
  const Y = U.needed ? {
7090
7090
  inputIsToken0: U.inputIsToken0,
7091
7091
  amountIn: U.amountIn,
7092
- amountOutQuoted: ae.amountOutQuoted,
7093
- amountOutMinimum: ae.amountOutMinimum,
7092
+ amountOutQuoted: oe.amountOutQuoted,
7093
+ amountOutMinimum: oe.amountOutMinimum,
7094
7094
  priceImpactBps: O,
7095
7095
  clampedByIdle: U.clampedByIdle
7096
7096
  } : null;
7097
7097
  if (Y && Y.priceImpactBps > e.maxPriceImpactBps)
7098
7098
  return h("price-impact-limit", L, Y);
7099
- const St = U.inputIsToken0 ? U.amountIn : 0n, Ct = U.inputIsToken0 ? 0n : U.amountIn, Kt = U.inputIsToken0 ? 0n : ae.amountOutMinimum, Re = U.inputIsToken0 ? ae.amountOutMinimum : 0n, xt = he - St + Kt, Ke = z - Ct + Re, st = X(
7099
+ const St = U.inputIsToken0 ? U.amountIn : 0n, Ct = U.inputIsToken0 ? 0n : U.amountIn, Kt = U.inputIsToken0 ? 0n : oe.amountOutMinimum, Re = U.inputIsToken0 ? oe.amountOutMinimum : 0n, xt = he - St + Kt, Ke = z - Ct + Re, st = X(
7100
7100
  Ee.liquidityL,
7101
7101
  xt,
7102
7102
  Ke,
@@ -7121,7 +7121,7 @@ async function Rm(e) {
7121
7121
  deposit0: c.amount0,
7122
7122
  deposit1: c.amount1,
7123
7123
  principalDelta: be,
7124
- swapRoute: ae.route,
7124
+ swapRoute: oe.route,
7125
7125
  swapInputAmount: U.amountIn,
7126
7126
  swapInputIsToken0: U.inputIsToken0,
7127
7127
  depositAfterSwap0: Kt,
@@ -7180,7 +7180,7 @@ async function Rm(e) {
7180
7180
  }
7181
7181
  return h("ltv-above-max", E);
7182
7182
  }
7183
- function Of(e) {
7183
+ function Ff(e) {
7184
7184
  if (e.collateralFloor) return e.collateralFloor;
7185
7185
  if (e.borrowOut === null) return { status: "not-requested" };
7186
7186
  if (e.utilizationCapped) return { status: "infeasible", reason: "utilization-capped" };
@@ -7729,12 +7729,12 @@ async function _i(e) {
7729
7729
  }
7730
7730
  }), t(), await ((r = e.onAuthorizationCheckpoint) == null ? void 0 : r.call(e)), t()));
7731
7731
  }
7732
- async function Ff(e) {
7732
+ async function Lf(e) {
7733
7733
  Oo(e);
7734
7734
  const t = Fo(e), n = () => bn(t);
7735
7735
  return n(), Ce(t.token.address) ? { approvalHash: null } : t.amount <= 0n && (t.approvalMode ?? "exact") !== "max" ? { approvalHash: null } : (await $e({ provider: t.wallet.provider, chain: t.activeChain, signal: t.signal }), n(), { approvalHash: await Di(t) });
7736
7736
  }
7737
- async function Lf(e) {
7737
+ async function Uf(e) {
7738
7738
  Oo(e, !0);
7739
7739
  const t = Fo(e), n = () => bn(t);
7740
7740
  n(), !Ce(t.token.address) && (t.amount <= 0n && !t.replaceAllowance && (t.approvalMode ?? "exact") !== "max" || (await $e({ provider: t.wallet.provider, chain: t.activeChain, signal: t.signal }), n(), await _i(t)));
@@ -7786,7 +7786,7 @@ async function Ni(e) {
7786
7786
  });
7787
7787
  return n(), await ((l = e.onAuthorizationCheckpoint) == null ? void 0 : l.call(e)), n(), { approvalHash: o, permit: i };
7788
7788
  }
7789
- async function Uf(e) {
7789
+ async function Vf(e) {
7790
7790
  var n;
7791
7791
  const t = qm(e);
7792
7792
  return (n = e.onStatus) == null || n.call(e, "approving"), kn({
@@ -7909,7 +7909,7 @@ async function kn(e) {
7909
7909
  summary: o
7910
7910
  };
7911
7911
  }
7912
- function Vf(e) {
7912
+ function Hf(e) {
7913
7913
  return e.router ? e.permit2 ? e.stateView ? e.v4StateView ? e.v4Quoter ? null : "Missing V4 quoter." : "Missing V4 StateView." : "Missing StateView." : "Missing Permit2." : "Missing engine router.";
7914
7914
  }
7915
7915
  const qi = /* @__PURE__ */ new WeakMap();
@@ -8059,7 +8059,7 @@ async function Wa(e) {
8059
8059
  nativeGasReserve: e.nativeGasReserve
8060
8060
  }), f;
8061
8061
  }
8062
- async function Hf(e) {
8062
+ async function $f(e) {
8063
8063
  var s, l, c, p, d, m;
8064
8064
  (s = e.signal) == null || s.throwIfAborted(), await ((l = e.onCheckpoint) == null ? void 0 : l.call(e));
8065
8065
  const t = qi.get(e.quote);
@@ -8105,7 +8105,7 @@ async function Hf(e) {
8105
8105
  }) };
8106
8106
  }
8107
8107
  const Uo = 1000000n, Wm = 5e3;
8108
- function $f(e) {
8108
+ function Wf(e) {
8109
8109
  return Math.max(0, e - Wm);
8110
8110
  }
8111
8111
  function Vo(e) {
@@ -8129,13 +8129,13 @@ function Km(e) {
8129
8129
  function Li(e) {
8130
8130
  return Fi(e.debtLLatest * Uo, BigInt(e.maxLtvPips));
8131
8131
  }
8132
- function Wf(e) {
8132
+ function Kf(e) {
8133
8133
  if (Vo(e), e.debtLLatest === 0n) return !0;
8134
8134
  if (e.maxLtvPips === 0) return !1;
8135
8135
  const t = Li(e);
8136
8136
  return e.idle0 * e.idle1 >= t * t;
8137
8137
  }
8138
- function Kf(e) {
8138
+ function zf(e) {
8139
8139
  Vo(e);
8140
8140
  const t = e.side === "token0" ? e.idle0 : e.idle1;
8141
8141
  if (t === 0n || e.debtLLatest === 0n) return t;
@@ -8145,7 +8145,7 @@ function Kf(e) {
8145
8145
  const o = Li(e), a = Fi(o * o, n);
8146
8146
  return a >= t ? 0n : t - a;
8147
8147
  }
8148
- function zf(e) {
8148
+ function Gf(e) {
8149
8149
  if (Vo(e), e.withdrawAmount < 0n)
8150
8150
  throw new RangeError("Engine withdrawal amount must be non-negative.");
8151
8151
  if (e.debtLLatest === 0n) return null;
@@ -8189,13 +8189,13 @@ function Vi(e) {
8189
8189
  const t = e;
8190
8190
  return t.schemaVersion === "1" && typeof t.chainId == "number" && Number.isSafeInteger(t.chainId) && t.chainId > 0 && typeof t.account == "string" && /^0x[0-9a-fA-F]{40}$/.test(t.account) && typeof t.marketId == "string" && t.marketId.length > 0 && typeof t.poolId == "string" && /^0x[0-9a-fA-F]{64}$/.test(t.poolId) && typeof t.txHash == "string" && /^0x[0-9a-fA-F]{64}$/.test(t.txHash) && (t.direction === "long" || t.direction === "short") && typeof t.averageLeverage == "number" && Number.isFinite(t.averageLeverage) && t.averageLeverage > 1 && typeof t.targetPrice == "number" && Number.isFinite(t.targetPrice) && t.targetPrice > 0 && typeof t.horizonSeconds == "number" && Number.isSafeInteger(t.horizonSeconds) && t.horizonSeconds >= 0 && typeof t.recordedAt == "string" && Number.isFinite(Date.parse(t.recordedAt));
8191
8191
  }
8192
- function Gf(e) {
8192
+ function jf(e) {
8193
8193
  return Vi(e);
8194
8194
  }
8195
8195
  function jm(e, t, n, o, a) {
8196
8196
  return a.find((r) => Vi(r) && r.chainId === e.chainId && k(r.account, e.account) && Z(r.poolId, e.poolId) && Ui(r.txHash, n) && r.direction === o && (t === null || Ht(r.marketId, t))) ?? null;
8197
8197
  }
8198
- function jf(e, t, n = []) {
8198
+ function Qf(e, t, n = []) {
8199
8199
  var x, A, P;
8200
8200
  let o, a;
8201
8201
  try {
@@ -8545,11 +8545,11 @@ uo([
8545
8545
  ]);
8546
8546
  const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
8547
8547
  (e) => /^(0|[1-9][0-9]*)$/.test(e) && e.length <= 78 && BigInt(e) < 1n << 256n
8548
- ), ie = w().int().nonnegative().max(Number.MAX_SAFE_INTEGER), Qa = w().nonnegative().nullable(), lp = Ut("status", [
8548
+ ), re = w().int().nonnegative().max(Number.MAX_SAFE_INTEGER), Qa = w().nonnegative().nullable(), lp = Ut("status", [
8549
8549
  T({
8550
8550
  status: B("verified"),
8551
8551
  basis: B("irm-accrual-preview"),
8552
- rpcBlockNumber: ie,
8552
+ rpcBlockNumber: re,
8553
8553
  blockHash: S().regex(/^0x[0-9a-f]{64}$/),
8554
8554
  observedAt: S().datetime(),
8555
8555
  elapsedSeconds: Zt,
@@ -8561,9 +8561,9 @@ const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
8561
8561
  reason: V(["legacy-unpinned", "invalid-provenance"])
8562
8562
  }).strict()
8563
8563
  ]), dp = T({
8564
- t: ie,
8564
+ t: re,
8565
8565
  observedAt: S().datetime(),
8566
- evmBlockNumber: ie,
8566
+ evmBlockNumber: re,
8567
8567
  borrowAprPct: Qa,
8568
8568
  lendAprPct: Qa,
8569
8569
  lendingRateBasis: B("simple-borrow-interest-apr"),
@@ -8578,23 +8578,45 @@ const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
8578
8578
  resolution: B("12h"),
8579
8579
  window: V(["7d", "30d", "60d"]),
8580
8580
  status: V(["ready", "partial", "warming_up", "no_data"]),
8581
- pointCount: ie,
8581
+ pointCount: re,
8582
8582
  points: q(dp).max(121),
8583
8583
  updatedAt: S().datetime().nullable(),
8584
8584
  coverage: T({
8585
- fromBucket: ie,
8586
- throughClosedBucket: ie,
8587
- expectedClosedBuckets: ie,
8588
- firstObservedBucket: ie.nullable(),
8589
- leadingMissingBucketCount: ie,
8590
- presentClosedBuckets: ie,
8591
- missingBuckets: q(ie).max(120),
8592
- missingRateBuckets: q(ie).max(120),
8593
- verifiedRatePoints: ie,
8594
- legacyRatePoints: ie,
8595
- invalidRows: ie
8585
+ fromBucket: re,
8586
+ throughClosedBucket: re,
8587
+ expectedClosedBuckets: re,
8588
+ firstObservedBucket: re.nullable(),
8589
+ leadingMissingBucketCount: re,
8590
+ presentClosedBuckets: re,
8591
+ missingBuckets: q(re).max(120),
8592
+ missingRateBuckets: q(re).max(120),
8593
+ verifiedRatePoints: re,
8594
+ legacyRatePoints: re,
8595
+ invalidRows: re
8596
8596
  }).strict()
8597
- }).strict();
8597
+ }).strict(), mp = uo([
8598
+ an,
8599
+ T({
8600
+ schemaVersion: B("1"),
8601
+ history: an,
8602
+ segments: q(T({
8603
+ from: w().int().nonnegative(),
8604
+ to: w().int().nonnegative(),
8605
+ price: w().finite().positive()
8606
+ }).strict()).max(289)
8607
+ }).strict()
8608
+ ]).superRefine((e, t) => {
8609
+ if (!("segments" in e)) return;
8610
+ const n = e.history;
8611
+ let o = -1 / 0;
8612
+ for (const a of e.segments) {
8613
+ if (a.from < Math.max(n.coverage.requestedFrom, n.coverage.coverageStart) || a.to > Math.min(n.coverage.requestedTo, n.coverage.completedThrough) || a.to < a.from || a.from < o || n.freshness.status === "reorg_detected" || n.gaps.some((r) => a.from < r.to && a.to > r.from)) {
8614
+ t.addIssue({ code: "custom", message: "Price segments exceed verified coverage" });
8615
+ break;
8616
+ }
8617
+ o = a.to;
8618
+ }
8619
+ });
8598
8620
  class ce extends Error {
8599
8621
  constructor(n, o = 503, a = null) {
8600
8622
  super("Engine market data is unavailable.");
@@ -8602,15 +8624,15 @@ class ce extends Error {
8602
8624
  this.code = n, this.status = o, this.retryAfterSeconds = a;
8603
8625
  }
8604
8626
  }
8605
- function ne() {
8627
+ function ie() {
8606
8628
  throw new ce("invalid-response");
8607
8629
  }
8608
- const mp = 3e4, no = 16, Qi = ge({
8609
- ttlMs: mp,
8630
+ const pp = 3e4, no = 16, Qi = ge({
8631
+ ttlMs: pp,
8610
8632
  maxEntries: no
8611
8633
  }), Qe = /* @__PURE__ */ new Map();
8612
8634
  let oo = 0, Dn = 0;
8613
- function Qf() {
8635
+ function Xf() {
8614
8636
  Qi.clear(), Qe.clear(), oo++;
8615
8637
  }
8616
8638
  function vn(e, t, n, o) {
@@ -8656,7 +8678,7 @@ function vn(e, t, n, o) {
8656
8678
  function Wo(e, t) {
8657
8679
  if (e)
8658
8680
  for (const n of ["baseAsset", "quoteAsset"])
8659
- (e[n].address.toLowerCase() !== t[n].address.toLowerCase() || e[n].decimals !== t[n].decimals) && ne();
8681
+ (e[n].address.toLowerCase() !== t[n].address.toLowerCase() || e[n].decimals !== t[n].decimals) && ie();
8660
8682
  }
8661
8683
  async function yn(e, t, n, o) {
8662
8684
  var c, p, d;
@@ -8695,7 +8717,7 @@ async function yn(e, t, n, o) {
8695
8717
  if (Number(u.headers.get("content-length")) > h)
8696
8718
  throw (p = u.body) == null || p.cancel().catch(() => {
8697
8719
  }), new ce("response-limit");
8698
- s = (d = u.body) == null ? void 0 : d.getReader(), s || ne(), r == null || r.addEventListener("abort", l, { once: !0 });
8720
+ s = (d = u.body) == null ? void 0 : d.getReader(), s || ie(), r == null || r.addEventListener("abort", l, { once: !0 });
8699
8721
  const f = [];
8700
8722
  let b = 0;
8701
8723
  for (; ; ) {
@@ -8713,10 +8735,10 @@ async function yn(e, t, n, o) {
8713
8735
  try {
8714
8736
  C = JSON.parse(new TextDecoder().decode(E));
8715
8737
  } catch {
8716
- ne();
8738
+ ie();
8717
8739
  }
8718
8740
  const x = o.safeParse(C);
8719
- return x.success || ne(), x.data;
8741
+ return x.success || ie(), x.data;
8720
8742
  } catch (m) {
8721
8743
  throw r == null || r.throwIfAborted(), m instanceof ce ? m : new ce("unavailable");
8722
8744
  } finally {
@@ -8726,9 +8748,9 @@ async function yn(e, t, n, o) {
8726
8748
  function Ko(e, t, n) {
8727
8749
  var a;
8728
8750
  const o = e.marketId.split("_");
8729
- (t.marketId !== e.marketId || t.chainId !== Number(o[1]) || t.poolId.toLowerCase() !== ((a = o[2]) == null ? void 0 : a.toLowerCase()) || t.window !== n) && ne();
8751
+ (t.marketId !== e.marketId || t.chainId !== Number(o[1]) || t.poolId.toLowerCase() !== ((a = o[2]) == null ? void 0 : a.toLowerCase()) || t.window !== n) && ie();
8730
8752
  }
8731
- async function pp(e) {
8753
+ async function fp(e) {
8732
8754
  const t = e.window ?? "1d";
8733
8755
  if (!["1d", "7d", "30d", "90d", "180d"].includes(t))
8734
8756
  throw new ce("invalid-query", 400);
@@ -8740,7 +8762,7 @@ async function pp(e) {
8740
8762
  );
8741
8763
  return Ko(e, n, t), n;
8742
8764
  }
8743
- async function fp(e) {
8765
+ async function hp(e) {
8744
8766
  const t = e.window ?? "7d";
8745
8767
  if (!["7d", "30d", "90d", "180d"].includes(t))
8746
8768
  throw new ce("invalid-query", 400);
@@ -8750,32 +8772,32 @@ async function fp(e) {
8750
8772
  { window: t, basis: "token_market_reference" },
8751
8773
  ji
8752
8774
  );
8753
- return Ko(e, n, t), hp(n), n;
8775
+ return Ko(e, n, t), wp(n), n;
8754
8776
  }
8755
- function hp(e) {
8777
+ function wp(e) {
8756
8778
  const t = Wi[e.window], n = t.resolution === "1h" ? 3600 : 86400, o = e.coverage;
8757
- (e.resolution !== t.resolution || o.requestedTo - o.requestedFrom !== t.windowSeconds || o.expectedBucketCount !== t.bucketCount || o.requestedFrom % n || o.requestedTo % n || e.pointCount !== e.points.length || o.observedPairCount !== e.pointCount || e.baseAsset.address.toLowerCase() >= e.quoteAsset.address.toLowerCase()) && ne();
8779
+ (e.resolution !== t.resolution || o.requestedTo - o.requestedFrom !== t.windowSeconds || o.expectedBucketCount !== t.bucketCount || o.requestedFrom % n || o.requestedTo % n || e.pointCount !== e.points.length || o.observedPairCount !== e.pointCount || e.baseAsset.address.toLowerCase() >= e.quoteAsset.address.toLowerCase()) && ie();
8758
8780
  for (const [i, s] of e.components.entries()) {
8759
8781
  const l = i === 0 ? e.baseAsset : e.quoteAsset;
8760
- (s.role !== (i === 0 ? "base" : "quote") || s.address.toLowerCase() !== l.address.toLowerCase() || s.chainId !== e.chainId || s.decimals !== l.decimals || s.resolution !== e.resolution || s.sourceDataset !== (e.resolution === "1h" ? "TokenHourData" : "TokenDayData") || s.coverageStart > s.completedThrough || s.coverageStart % n || s.completedThrough % n || s.sourceHead && (s.completedThrough > s.sourceHead.timestamp || Date.parse(s.sourceHead.observedAt) / 1e3 < s.sourceHead.timestamp)) && ne();
8782
+ (s.role !== (i === 0 ? "base" : "quote") || s.address.toLowerCase() !== l.address.toLowerCase() || s.chainId !== e.chainId || s.decimals !== l.decimals || s.resolution !== e.resolution || s.sourceDataset !== (e.resolution === "1h" ? "TokenHourData" : "TokenDayData") || s.coverageStart > s.completedThrough || s.coverageStart % n || s.completedThrough % n || s.sourceHead && (s.completedThrough > s.sourceHead.timestamp || Date.parse(s.sourceHead.observedAt) / 1e3 < s.sourceHead.timestamp)) && ie();
8761
8783
  }
8762
8784
  let a = -1;
8763
8785
  for (const i of e.points) {
8764
8786
  const s = Number(i.baseCloseUsd) / Number(i.quoteCloseUsd);
8765
- (i.t <= a || i.t % n || i.t < o.requestedFrom || i.t >= o.requestedTo || !Number.isFinite(s) || s <= 0 || Math.abs(s - i.value) > s * 1e-12) && ne();
8787
+ (i.t <= a || i.t % n || i.t < o.requestedFrom || i.t >= o.requestedTo || !Number.isFinite(s) || s <= 0 || Math.abs(s - i.value) > s * 1e-12) && ie();
8766
8788
  for (const [l, c] of [i.baseSource, i.quoteSource].entries()) {
8767
8789
  const p = e.components[l], d = p.sourceHead;
8768
- (!d || i.t < p.coverageStart || i.t >= p.completedThrough || c.timestamp < i.t + n || c.timestamp > d.timestamp || c.blockNumber > d.blockNumber || c.blockNumber === d.blockNumber && c.blockHash !== d.blockHash || Date.parse(c.observedAt) / 1e3 < c.timestamp) && ne();
8790
+ (!d || i.t < p.coverageStart || i.t >= p.completedThrough || c.timestamp < i.t + n || c.timestamp > d.timestamp || c.blockNumber > d.blockNumber || c.blockNumber === d.blockNumber && c.blockHash !== d.blockHash || Date.parse(c.observedAt) / 1e3 < c.timestamp) && ie();
8769
8791
  }
8770
8792
  a = i.t;
8771
8793
  }
8772
8794
  a = -1;
8773
8795
  let r = 0;
8774
8796
  for (const i of e.gaps)
8775
- (i.from < a || i.from % n || i.to % n || i.to <= i.from || i.from < o.requestedFrom || i.to > o.requestedTo || e.points.some((s) => s.t >= i.from && s.t < i.to)) && ne(), r += (i.to - i.from) / n, a = i.to;
8776
- (e.pointCount + r !== o.expectedBucketCount || e.status === "no_data" && e.pointCount !== 0 || e.status === "ready" && (e.gaps.length !== 0 || e.components.some((i) => i.status !== "ready" || !i.sourceHead))) && ne();
8797
+ (i.from < a || i.from % n || i.to % n || i.to <= i.from || i.from < o.requestedFrom || i.to > o.requestedTo || e.points.some((s) => s.t >= i.from && s.t < i.to)) && ie(), r += (i.to - i.from) / n, a = i.to;
8798
+ (e.pointCount + r !== o.expectedBucketCount || e.status === "no_data" && e.pointCount !== 0 || e.status === "ready" && (e.gaps.length !== 0 || e.components.some((i) => i.status !== "ready" || !i.sourceHead))) && ie();
8777
8799
  }
8778
- async function wp(e) {
8800
+ async function bp(e) {
8779
8801
  var u, h;
8780
8802
  const t = e.window ?? "30d";
8781
8803
  if (!["7d", "30d", "60d"].includes(t))
@@ -8786,13 +8808,13 @@ async function wp(e) {
8786
8808
  { window: t },
8787
8809
  up
8788
8810
  );
8789
- (n.marketId !== e.marketId || n.window !== t) && ne();
8811
+ (n.marketId !== e.marketId || n.window !== t) && ie();
8790
8812
  const o = n.coverage, a = Number(t.slice(0, -1)) * 2, r = 43200;
8791
- (n.pointCount !== n.points.length || n.updatedAt !== (((u = n.points.at(-1)) == null ? void 0 : u.observedAt) ?? null) || o.expectedClosedBuckets !== a || o.fromBucket % r || o.throughClosedBucket % r || o.throughClosedBucket - o.fromBucket !== (a - 1) * r) && ne();
8813
+ (n.pointCount !== n.points.length || n.updatedAt !== (((u = n.points.at(-1)) == null ? void 0 : u.observedAt) ?? null) || o.expectedClosedBuckets !== a || o.fromBucket % r || o.throughClosedBucket % r || o.throughClosedBucket - o.fromBucket !== (a - 1) * r) && ie();
8792
8814
  let i = -1;
8793
8815
  const s = /* @__PURE__ */ new Map();
8794
8816
  for (const f of n.points)
8795
- (f.t <= i || f.t % r || f.t < o.fromBucket || f.t > o.throughClosedBucket + r || Date.parse(f.observedAt) / 1e3 < f.t || Date.parse(f.observedAt) / 1e3 >= f.t + r || f.rateObservation.status === "verified" && (f.rateObservation.observedAt !== f.observedAt || f.ratePerSecondWad === null || BigInt(f.rateObservation.elapsedSeconds) > BigInt(Math.floor(Date.parse(f.observedAt) / 1e3)))) && ne(), s.set(f.t, f), i = f.t;
8817
+ (f.t <= i || f.t % r || f.t < o.fromBucket || f.t > o.throughClosedBucket + r || Date.parse(f.observedAt) / 1e3 < f.t || Date.parse(f.observedAt) / 1e3 >= f.t + r || f.rateObservation.status === "verified" && (f.rateObservation.observedAt !== f.observedAt || f.ratePerSecondWad === null || BigInt(f.rateObservation.elapsedSeconds) > BigInt(Math.floor(Date.parse(f.observedAt) / 1e3)))) && ie(), s.set(f.t, f), i = f.t;
8796
8818
  const l = [], c = [];
8797
8819
  for (let f = o.fromBucket; f <= o.throughClosedBucket; f += r) {
8798
8820
  const b = s.get(f);
@@ -8801,70 +8823,55 @@ async function wp(e) {
8801
8823
  const p = ((h = n.points[0]) == null ? void 0 : h.t) ?? null, d = p === null ? 0 : l.filter((f) => f < p).length, m = n.pointCount === 0 ? "no_data" : n.pointCount === 1 ? "warming_up" : c.length > d || o.invalidRows ? "partial" : "ready";
8802
8824
  return (JSON.stringify(o.missingBuckets) !== JSON.stringify(l) || JSON.stringify(o.missingRateBuckets) !== JSON.stringify(c) || o.presentClosedBuckets !== a - l.length || o.firstObservedBucket !== p || o.leadingMissingBucketCount !== d || n.status !== m || o.verifiedRatePoints !== n.points.filter((f) => f.rateObservation.status === "verified").length || o.legacyRatePoints !== n.points.filter(
8803
8825
  (f) => f.rateObservation.status === "unavailable" && f.rateObservation.reason === "legacy-unpinned"
8804
- ).length) && ne(), n;
8826
+ ).length) && ie(), n;
8805
8827
  }
8806
- async function Xf(e) {
8828
+ async function Yf(e) {
8807
8829
  const t = e.window ?? "1d", n = await vn(
8808
8830
  e,
8809
8831
  "pool",
8810
8832
  t,
8811
- (o) => pp({ ...o, window: t })
8833
+ (o) => fp({ ...o, window: t })
8812
8834
  );
8813
8835
  return Wo(e.expectedAssets, n), n;
8814
8836
  }
8815
- async function Yf(e) {
8837
+ async function Jf(e) {
8816
8838
  const t = await vn(e, "pool_price_line", "1d", async (n) => {
8817
8839
  const o = await yn(
8818
8840
  n,
8819
8841
  "/v1/engine/markets/{marketId}/candles",
8820
8842
  { window: "1d", basis: "pool", format: "price_line" },
8821
- uo([
8822
- an,
8823
- T({
8824
- schemaVersion: B("1"),
8825
- history: an,
8826
- segments: q(T({
8827
- from: w().int().nonnegative(),
8828
- to: w().int().nonnegative(),
8829
- price: w().finite().positive()
8830
- }).strict()).max(289)
8831
- }).strict()
8832
- ])
8843
+ mp
8833
8844
  ), a = "history" in o ? o.history : o;
8834
- if (Ko(n, a, "1d"), !("segments" in o)) return a;
8835
- let r = -1 / 0;
8836
- for (const i of o.segments)
8837
- (i.from < Math.max(a.coverage.requestedFrom, a.coverage.coverageStart) || i.to > Math.min(a.coverage.requestedTo, a.coverage.completedThrough) || i.to < i.from || i.from < r || a.freshness.status === "reorg_detected" || a.gaps.some((s) => i.from < s.to && i.to > s.from)) && ne(), r = i.to;
8838
- return { ...a, priceSegments: o.segments };
8845
+ return Ko(n, a, "1d"), "segments" in o ? { ...a, priceSegments: o.segments } : a;
8839
8846
  });
8840
8847
  return Wo(e.expectedAssets, t), t;
8841
8848
  }
8842
- function Jf(e) {
8849
+ function Zf(e) {
8843
8850
  return e.freshness.status === "reorg_detected" ? [] : e.priceSegments ? e.priceSegments : e.candles.flatMap((t, n) => {
8844
8851
  var i;
8845
8852
  const o = t.t + $i[e.resolution], a = e.gaps.find((s) => s.to > o), r = Math.min(e.coverage.completedThrough, ((i = e.candles[n + 1]) == null ? void 0 : i.t) ?? 1 / 0, (a == null ? void 0 : a.from) ?? 1 / 0);
8846
8853
  return r >= o ? [{ from: o, to: r, price: t.close }] : [];
8847
8854
  });
8848
8855
  }
8849
- async function Zf(e) {
8856
+ async function eh(e) {
8850
8857
  const t = e.window ?? "7d", n = await vn(
8851
8858
  e,
8852
8859
  "token_market_reference",
8853
8860
  t,
8854
- (o) => fp({ ...o, window: t })
8861
+ (o) => hp({ ...o, window: t })
8855
8862
  );
8856
8863
  return Wo(e.expectedAssets, n), n;
8857
8864
  }
8858
- async function e0(e) {
8865
+ async function th(e) {
8859
8866
  const t = e.window ?? "30d";
8860
8867
  return vn(
8861
8868
  e,
8862
8869
  "rates",
8863
8870
  t,
8864
- (n) => wp({ ...n, window: t })
8871
+ (n) => bp({ ...n, window: t })
8865
8872
  );
8866
8873
  }
8867
- function t0(e) {
8874
+ function nh(e) {
8868
8875
  const t = [];
8869
8876
  let n = 0;
8870
8877
  for (const o of e.candles) {
@@ -8875,7 +8882,7 @@ function t0(e) {
8875
8882
  }
8876
8883
  return t;
8877
8884
  }
8878
- const bp = 180n, ao = 60n, kp = 6e4, vp = /^[A-Za-z0-9._:-]+$/;
8885
+ const kp = 180n, ao = 60n, vp = 6e4, yp = /^[A-Za-z0-9._:-]+$/;
8879
8886
  function H(e, t) {
8880
8887
  return e.toLowerCase() === t.toLowerCase();
8881
8888
  }
@@ -8895,13 +8902,13 @@ function ue(e, t = /* @__PURE__ */ new WeakMap()) {
8895
8902
  o[a] = ue(e[a], t);
8896
8903
  return Object.freeze(o);
8897
8904
  }
8898
- function yp() {
8905
+ function Ep() {
8899
8906
  var e, t;
8900
8907
  return ((t = (e = globalThis.crypto) == null ? void 0 : e.randomUUID) == null ? void 0 : t.call(e)) ?? `aegis-${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 14)}`;
8901
8908
  }
8902
- function Ep(e) {
8903
- const t = e ?? yp();
8904
- if (t.length < 8 || t.length > 128 || !vp.test(t))
8909
+ function Ip(e) {
8910
+ const t = e ?? Ep();
8911
+ if (t.length < 8 || t.length > 128 || !yp.test(t))
8905
8912
  throw new TypeError("Engine execution sessionId must be 8-128 URL-safe correlation characters.");
8906
8913
  return t;
8907
8914
  }
@@ -8911,7 +8918,7 @@ function Xi(e, t) {
8911
8918
  function zo(e, t) {
8912
8919
  return e.operation === t.operation && e.chainId === t.chainId && H(e.account, t.account) && e.marketId === t.marketId && H(e.token.address, t.token.address) && e.amount === t.amount && e.approvalMode === t.approvalMode && H(e.router, t.router) && H(e.permit2, t.permit2) && H(e.vaultRegistry, t.vaultRegistry);
8913
8920
  }
8914
- function Ip(e, t) {
8921
+ function Ap(e, t) {
8915
8922
  if (!zo(e, t)) return [{ kind: "intent-changed" }];
8916
8923
  const n = [];
8917
8924
  e.walletChainSwitchRequired === !1 && t.walletChainSwitchRequired !== !1 && n.push({ kind: "wallet-chain-switch-added" });
@@ -8926,22 +8933,22 @@ function Ip(e, t) {
8926
8933
  function Yi(e, t) {
8927
8934
  return e.direction === t.direction && e.market.chainId === t.market.chainId && e.market.id === t.market.id && e.market.poolId.toLowerCase() === t.market.poolId.toLowerCase() && H(e.market.token0.address, t.market.token0.address) && H(e.market.token1.address, t.market.token1.address) && H(e.collateralToken.address, t.collateralToken.address) && H(e.intent.owner, t.intent.owner) && e.intent.inputIsToken0 === t.intent.inputIsToken0 && e.intent.collateralIn === t.intent.collateralIn && e.intent.leverage === t.intent.leverage && e.intent.horizonSeconds === t.intent.horizonSeconds && e.intent.priceMove === t.intent.priceMove && e.intent.slippageBps === t.intent.slippageBps && e.intent.maxPriceImpactBps === t.intent.maxPriceImpactBps && e.deposit.amount0 === t.deposit.amount0 && e.deposit.amount1 === t.deposit.amount1;
8928
8935
  }
8929
- function Ap(e, t) {
8936
+ function gp(e, t) {
8930
8937
  return !e || !t ? e !== t : e.daysToLiquidation === "INF" ? t.daysToLiquidation !== "INF" : t.daysToLiquidation === "INF" ? !1 : Math.floor(t.daysToLiquidation) < Math.floor(e.daysToLiquidation);
8931
8938
  }
8932
8939
  function Xa(e) {
8933
8940
  const t = e < 1e4 ? 10 : 100;
8934
8941
  return Math.round(e / t) * t;
8935
8942
  }
8936
- function gp(e, t) {
8943
+ function Sp(e, t) {
8937
8944
  if (!Yi(e, t)) return [{ kind: "intent-changed" }];
8938
8945
  const n = [];
8939
8946
  if (!e.position || !t.position)
8940
8947
  return e.position !== t.position && n.push({ kind: "position-availability-changed" }), n;
8941
8948
  const o = e.adaptiveFee ?? null, a = t.adaptiveFee ?? null;
8942
- return o && !a ? n.push({ kind: "adaptive-fee-evidence-unavailable" }) : o && a && (a.evaluationScope !== o.evaluationScope && n.push({ kind: "adaptive-fee-mode-changed" }), a.manualOverride !== o.manualOverride && n.push({ kind: "adaptive-manual-override-changed" }), a.adaptiveTickThresholdTicks < o.adaptiveTickThresholdTicks && n.push({ kind: "adaptive-threshold-lower" }), !o.surgeActive && a.surgeActive && n.push({ kind: "adaptive-surge-entered" }), a.activeFeePpm > o.activeFeePpm && n.push({ kind: "active-fee-higher" })), (!!e.swap != !!t.swap || e.swap && t.swap && e.swap.inputIsToken0 !== t.swap.inputIsToken0) && n.push({ kind: "swap-route-changed" }), e.swap && t.swap && t.swap.amountOutMinimum < e.swap.amountOutMinimum && n.push({ kind: "minimum-output-lower" }), e.swap && t.swap && t.swap.priceImpactBps > e.swap.priceImpactBps && n.push({ kind: "price-impact-higher" }), t.position.leverage.toFixed(2) !== e.position.leverage.toFixed(2) && n.push({ kind: "displayed-leverage-changed" }), t.position.executionLtvPips > e.position.executionLtvPips && n.push({ kind: "opening-ltv-higher" }), t.position.interestCostToken1 > e.position.interestCostToken1 && n.push({ kind: "interest-higher" }), t.position.grossReturnAtTargetPct + 5e-3 < e.position.grossReturnAtTargetPct && n.push({ kind: "target-return-lower" }), t.thresholds.maxLtvPips < e.thresholds.maxLtvPips && n.push({ kind: "borrow-limit-lower" }), t.thresholds.hardLtvPips < e.thresholds.hardLtvPips && n.push({ kind: "liquidation-threshold-lower" }), e.position.marketUtilization && (!t.position.marketUtilization || Xa(t.position.marketUtilization.afterPips) > Xa(e.position.marketUtilization.afterPips)) && n.push({ kind: "utilization-worse-or-missing" }), Ap(e.position, t.position) && n.push({ kind: "runway-shorter" }), n;
8949
+ return o && !a ? n.push({ kind: "adaptive-fee-evidence-unavailable" }) : o && a && (a.evaluationScope !== o.evaluationScope && n.push({ kind: "adaptive-fee-mode-changed" }), a.manualOverride !== o.manualOverride && n.push({ kind: "adaptive-manual-override-changed" }), a.adaptiveTickThresholdTicks < o.adaptiveTickThresholdTicks && n.push({ kind: "adaptive-threshold-lower" }), !o.surgeActive && a.surgeActive && n.push({ kind: "adaptive-surge-entered" }), a.activeFeePpm > o.activeFeePpm && n.push({ kind: "active-fee-higher" })), (!!e.swap != !!t.swap || e.swap && t.swap && e.swap.inputIsToken0 !== t.swap.inputIsToken0) && n.push({ kind: "swap-route-changed" }), e.swap && t.swap && t.swap.amountOutMinimum < e.swap.amountOutMinimum && n.push({ kind: "minimum-output-lower" }), e.swap && t.swap && t.swap.priceImpactBps > e.swap.priceImpactBps && n.push({ kind: "price-impact-higher" }), t.position.leverage.toFixed(2) !== e.position.leverage.toFixed(2) && n.push({ kind: "displayed-leverage-changed" }), t.position.executionLtvPips > e.position.executionLtvPips && n.push({ kind: "opening-ltv-higher" }), t.position.interestCostToken1 > e.position.interestCostToken1 && n.push({ kind: "interest-higher" }), t.position.grossReturnAtTargetPct + 5e-3 < e.position.grossReturnAtTargetPct && n.push({ kind: "target-return-lower" }), t.thresholds.maxLtvPips < e.thresholds.maxLtvPips && n.push({ kind: "borrow-limit-lower" }), t.thresholds.hardLtvPips < e.thresholds.hardLtvPips && n.push({ kind: "liquidation-threshold-lower" }), e.position.marketUtilization && (!t.position.marketUtilization || Xa(t.position.marketUtilization.afterPips) > Xa(e.position.marketUtilization.afterPips)) && n.push({ kind: "utilization-worse-or-missing" }), gp(e.position, t.position) && n.push({ kind: "runway-shorter" }), n;
8943
8950
  }
8944
- function Sp(e) {
8951
+ function Cp(e) {
8945
8952
  const { intent: t, reviewed: n } = e;
8946
8953
  if (e.activeChain.chainId !== t.market.chainId || !H(e.wallet.account, t.owner) || t.token.chainId !== t.market.chainId || !H(t.token.address, t.market.token0.address) && !H(t.token.address, t.market.token1.address))
8947
8954
  throw new TypeError("Engine execution context does not match this trade intent.");
@@ -8957,11 +8964,11 @@ function Sp(e) {
8957
8964
  if (!zo(o, n.plan) || n.quote.direction !== t.direction || n.quote.market.chainId !== t.market.chainId || n.quote.market.id !== t.market.id || n.quote.market.poolId.toLowerCase() !== t.market.poolId.toLowerCase() || !H(n.quote.market.token0.address, t.market.token0.address) || !H(n.quote.market.token1.address, t.market.token1.address) || !H(n.quote.collateralToken.address, t.token.address) || !H(r.owner, t.owner) || r.inputIsToken0 !== H(t.token.address, t.market.token0.address) || r.collateralIn !== t.amount || r.leverage !== (t.leverage ?? null) || r.horizonSeconds !== t.horizonSeconds || r.priceMove !== t.priceMove || r.slippageBps !== t.slippageBps || r.maxPriceImpactBps !== t.maxPriceImpactBps || !t.market.router || !H(n.plan.router, t.market.router) || !t.market.permit2 || !H(n.plan.permit2, t.market.permit2) || !t.market.vaultRegistry || !H(n.plan.vaultRegistry, t.market.vaultRegistry) || a !== t.amount)
8958
8965
  throw new TypeError("Reviewed Engine plan or quote does not match this trade intent.");
8959
8966
  }
8960
- function Cp(e) {
8967
+ function xp(e) {
8961
8968
  const t = e && typeof e == "object" ? e.hash : null;
8962
8969
  return typeof t == "string" && /^0x[0-9a-fA-F]{64}$/.test(t) ? t : null;
8963
8970
  }
8964
- function xp(e) {
8971
+ function Tp(e) {
8965
8972
  const t = Object.freeze({
8966
8973
  provider: e.wallet.provider,
8967
8974
  account: e.wallet.account
@@ -9032,7 +9039,7 @@ function xp(e) {
9032
9039
  leverage: r.leverage,
9033
9040
  slippageBps: r.slippageBps,
9034
9041
  maxPriceImpactBps: r.maxPriceImpactBps,
9035
- deadline: BigInt(Math.floor(Date.now() / 1e3)) + bp,
9042
+ deadline: BigInt(Math.floor(Date.now() / 1e3)) + kp,
9036
9043
  forceExecutionEvidenceRefresh: !0,
9037
9044
  signal: i
9038
9045
  });
@@ -9063,33 +9070,33 @@ function xp(e) {
9063
9070
  });
9064
9071
  },
9065
9072
  checkReceipt(r, i, s) {
9066
- return Is({ publicClient: n, hash: s, timeoutMs: kp });
9073
+ return Is({ publicClient: n, hash: s, timeoutMs: vp });
9067
9074
  }
9068
9075
  };
9069
9076
  }
9070
- function n0(e) {
9071
- return Tp(
9077
+ function oh(e) {
9078
+ return Rp(
9072
9079
  e,
9073
- xp(e)
9080
+ Tp(e)
9074
9081
  );
9075
9082
  }
9076
- function Tp(e, t) {
9077
- Sp(e);
9078
- const n = ue(e.intent), o = e.onChange, a = Ep(e.sessionId);
9083
+ function Rp(e, t) {
9084
+ Cp(e);
9085
+ const n = ue(e.intent), o = e.onChange, a = Ip(e.sessionId);
9079
9086
  let r = ue(e.reviewed.plan), i = ue(e.reviewed.quote), s = r, l = i, c = "ready", p = null, d = 0, m = null, u = { kind: "none" }, h = null, f = null, b = !1, E = null, y, C = 0, x = (/* @__PURE__ */ new Date()).toISOString(), A = null, P = null, g = null, M = null;
9080
- const F = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), ee = [], X = [], oe = /* @__PURE__ */ new Map(), Te = (v) => {
9087
+ const F = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), ee = [], X = [], ne = /* @__PURE__ */ new Map(), Te = (v) => {
9081
9088
  s = ue(v);
9082
9089
  for (const I of s.steps) {
9083
9090
  X.includes(I.kind) || X.push(I.kind);
9084
- const R = oe.get(I.kind);
9085
- I.status === "satisfied" ? (oe.set(I.kind, { kind: I.kind, status: "confirmed", hash: (R == null ? void 0 : R.hash) ?? null }), I.kind !== "open-position" && L.add(I.kind)) : (!R || R.status === "failed" || R.status === "cancelled") && oe.set(I.kind, { kind: I.kind, status: "planned", hash: null });
9091
+ const R = ne.get(I.kind);
9092
+ I.status === "satisfied" ? (ne.set(I.kind, { kind: I.kind, status: "confirmed", hash: (R == null ? void 0 : R.hash) ?? null }), I.kind !== "open-position" && L.add(I.kind)) : (!R || R.status === "failed" || R.status === "cancelled") && ne.set(I.kind, { kind: I.kind, status: "planned", hash: null });
9086
9093
  }
9087
9094
  };
9088
9095
  Te(s);
9089
9096
  const be = () => c === "quote-review-required" && p ? { kind: "accept-review", revision: p.revision } : c === "awaiting-receipt" && f ? { kind: "check-receipt", hash: f } : c === "ready" || c === "resume-required" ? { kind: "continue" } : (c === "failed" || c === "cancelled") && u.kind !== "none" && u.kind !== "view-transaction" ? { kind: "continue" } : c === "executing" && !f ? { kind: "cancel" } : { kind: "none" }, Ee = () => c === "quote-review-required", he = () => {
9090
9097
  const v = Object.freeze(
9091
9098
  X.flatMap((ke) => {
9092
- const se = oe.get(ke);
9099
+ const se = ne.get(ke);
9093
9100
  return se ? [Object.freeze({ ...se })] : [];
9094
9101
  })
9095
9102
  ), I = h ? v.find((ke) => ke.kind === h) ?? null : null, R = p ? Object.freeze({
@@ -9133,13 +9140,13 @@ function Tp(e, t) {
9133
9140
  } catch {
9134
9141
  }
9135
9142
  }, U = (v, I, R) => {
9136
- X.includes(v) || X.push(v), oe.set(v, { kind: v, status: I, hash: R });
9137
- }, ae = (v, I) => {
9143
+ X.includes(v) || X.push(v), ne.set(v, { kind: v, status: I, hash: R });
9144
+ }, oe = (v, I) => {
9138
9145
  ee.some((R) => R.kind === v && R.hash === I) || ee.push({ kind: v, hash: I });
9139
9146
  }, O = (v, I) => I && v.kind !== "tx-reverted" && v.kind !== "tx-cancelled" ? { kind: "view-transaction", hash: I } : v.kind === "wallet-rejected" ? { kind: "retry-wallet" } : v.kind === "wrong-chain" ? { kind: "switch-network", chainId: n.market.chainId } : v.kind === "tx-reverted" || v.kind === "tx-cancelled" || v.kind === "quote" ? { kind: "review-quote" } : v.retryable && L.size ? { kind: "resume-remaining" } : v.retryable ? { kind: "retry-wallet" } : { kind: "none" }, Y = (v, I, R) => {
9140
9147
  var _;
9141
- return R ? "confirmation" : !I || ((_ = oe.get(I)) == null ? void 0 : _.status) !== "wallet-requested" ? "preparation" : v.kind === "wallet-rejected" ? "wallet-request" : "submission";
9142
- }, St = (v, I = h, R = f ?? Cp(v)) => {
9148
+ return R ? "confirmation" : !I || ((_ = ne.get(I)) == null ? void 0 : _.status) !== "wallet-requested" ? "preparation" : v.kind === "wallet-rejected" ? "wallet-request" : "submission";
9149
+ }, St = (v, I = h, R = f ?? xp(v)) => {
9143
9150
  const _ = Za(v, "Engine trade did not complete.");
9144
9151
  m = {
9145
9152
  ..._,
@@ -9161,7 +9168,7 @@ function Tp(e, t) {
9161
9168
  }, Re = async (v, I = {}) => {
9162
9169
  const R = await t.readPlan(n, v);
9163
9170
  v.throwIfAborted(), Kt(R);
9164
- const _ = Ip(r, R);
9171
+ const _ = Ap(r, R);
9165
9172
  return _.length ? (Ct("permissions", _, R, l), P == null || P.abort(new Error("review-required")), !1) : (Te(R), I.publishResult !== !1 && $(), !0);
9166
9173
  }, xt = (v) => {
9167
9174
  if (v === "open-position") return s.readyForOpen && r.steps.some((_) => _.kind === v);
@@ -9182,7 +9189,7 @@ function Tp(e, t) {
9182
9189
  const v = P == null ? void 0 : P.signal;
9183
9190
  if (!v) throw new Error("Engine execution checkpoint has no active command.");
9184
9191
  const I = h, R = f;
9185
- await Re(v) && I && R && (U(I, "confirmed", R), L.add(I), ae(I, R), h = null, f = null, $());
9192
+ await Re(v) && I && R && (U(I, "confirmed", R), L.add(I), oe(I, R), h = null, f = null, $());
9186
9193
  }
9187
9194
  }, st = async (v) => {
9188
9195
  let I = await t.quote(n, v);
@@ -9200,21 +9207,21 @@ function Tp(e, t) {
9200
9207
  h = "vault-operator";
9201
9208
  const se = await t.authorizeVault(n, Ke, v);
9202
9209
  if (se.receipt.status !== "success") throw new D("Vault authorization reverted on-chain.", { kind: "tx-reverted" });
9203
- if (E = se.hash, U("vault-operator", "confirmed", se.hash), L.add("vault-operator"), ae("vault-operator", se.hash), h = null, f = null, !await Re(v)) return z();
9210
+ if (E = se.hash, U("vault-operator", "confirmed", se.hash), L.add("vault-operator"), oe("vault-operator", se.hash), h = null, f = null, !await Re(v)) return z();
9204
9211
  }
9205
9212
  if (s.steps.some(
9206
9213
  (se) => se.kind !== "vault-operator" && se.kind !== "open-position" && se.status === "required"
9207
9214
  ) && (await t.authorizeToken(n, Ke, v), v.throwIfAborted(), !await Re(v)))
9208
9215
  return z();
9209
9216
  if (!s.readyForOpen) throw new D("Required permissions are still missing.", { kind: "validation", retryable: !0 });
9210
- const _ = await st(v), Ie = gp(i, _);
9217
+ const _ = await st(v), Ie = Sp(i, _);
9211
9218
  if (Ie.length)
9212
9219
  return Ct("quote", Ie, s, _), z();
9213
9220
  l = ue(_), h = "open-position";
9214
9221
  const _e = await t.sendOpen(n, l, Ke, v);
9215
9222
  if (_e.receipt.status !== "success") throw new D("Engine transaction reverted on-chain.", { kind: "tx-reverted" });
9216
9223
  const ke = _e.hash;
9217
- E = ke, y = ue(_e.summary), U("open-position", "confirmed", ke), ae("open-position", ke), c = "success", h = null, f = null, m = null, u = { kind: "none" }, $();
9224
+ E = ke, y = ue(_e.summary), U("open-position", "confirmed", ke), oe("open-position", ke), c = "success", h = null, f = null, m = null, u = { kind: "none" }, $();
9218
9225
  } catch (R) {
9219
9226
  if (Ee()) return z();
9220
9227
  v.aborted && !f ? (c = "cancelled", m = {
@@ -9223,7 +9230,7 @@ function Tp(e, t) {
9223
9230
  retryable: !1,
9224
9231
  step: h,
9225
9232
  hash: null,
9226
- failurePhase: h && ((I = oe.get(h)) == null ? void 0 : I.status) === "wallet-requested" ? "wallet-request" : "preparation"
9233
+ failurePhase: h && ((I = ne.get(h)) == null ? void 0 : I.status) === "wallet-requested" ? "wallet-request" : "preparation"
9227
9234
  }, u = { kind: "none" }, h && U(h, "cancelled", null), h = null, $()) : St(R);
9228
9235
  }
9229
9236
  return z();
@@ -9254,7 +9261,7 @@ function Tp(e, t) {
9254
9261
  b || I.status === "cancelled" ? "Engine transaction was cancelled in the wallet." : "Engine transaction reverted on-chain.",
9255
9262
  { kind: b || I.status === "cancelled" ? "tx-cancelled" : "tx-reverted", retryable: !0 }
9256
9263
  ), v, I.hash), z();
9257
- if (U(v, "confirmed", I.hash), ae(v, I.hash), h = null, f = null, m = null, v === "open-position")
9264
+ if (U(v, "confirmed", I.hash), oe(v, I.hash), h = null, f = null, m = null, v === "open-position")
9258
9265
  y = ue(Ur(I.receipt)), c = "success", u = { kind: "none" }, $();
9259
9266
  else {
9260
9267
  L.add(v), c = "resume-required", u = { kind: "resume-remaining" };
@@ -9330,14 +9337,14 @@ const _n = S().regex(/^[0-9]+$/), Ji = T({
9330
9337
  inputBasis: B("pool-input-plus-hook-input-fee")
9331
9338
  })
9332
9339
  })
9333
- }), Rp = T({
9340
+ }), Pp = T({
9334
9341
  schemaVersion: B("1"),
9335
9342
  chainId: w().int(),
9336
9343
  txHash: qn,
9337
9344
  account: je,
9338
9345
  status: B("unavailable")
9339
- }).loose(), o0 = uo([Ji, Rp]);
9340
- async function a0({ source: e, position: t, strategy: n, signal: o }) {
9346
+ }).loose(), ah = uo([Ji, Pp]);
9347
+ async function rh({ source: e, position: t, strategy: n, signal: o }) {
9341
9348
  var s;
9342
9349
  if (!t.token0 || !t.token1) return null;
9343
9350
  const a = `/v1/engine/transactions/${t.chainId}/${n.openTxHash}/opening-execution`, r = `${Lt(e.baseUrl)}${a}?${new URLSearchParams({ account: t.account })}`, i = rt({ signal: o, timeoutMs: e.timeoutMs ?? 1e4, timeoutMessage: "Opening execution read timed out." });
@@ -9371,21 +9378,21 @@ async function a0({ source: e, position: t, strategy: n, signal: o }) {
9371
9378
  }
9372
9379
  }
9373
9380
  export {
9374
- s0 as AEGIS_BACKEND_PROD_BASE_URL,
9375
- qp as AEGIS_DYNAMIC_FEE_FLAG,
9381
+ ch as AEGIS_BACKEND_PROD_BASE_URL,
9382
+ Op as AEGIS_DYNAMIC_FEE_FLAG,
9376
9383
  Rs as AEGIS_SWAP_BSC_CHAIN,
9377
9384
  we as AEGIS_SWAP_BSC_CHAIN_ID,
9378
- Np as AEGIS_SWAP_BSC_HOOK,
9385
+ qp as AEGIS_SWAP_BSC_HOOK,
9379
9386
  nr as AEGIS_SWAP_BSC_ROUTER,
9380
9387
  ir as AEGIS_SWAP_BSC_RPC_URLS,
9381
- Fp as AEGIS_SWAP_BSC_TOKENS,
9388
+ Lp as AEGIS_SWAP_BSC_TOKENS,
9382
9389
  ho as AEGIS_SWAP_CHAINS,
9383
9390
  Q as AEGIS_SWAP_CHAIN_ID,
9384
9391
  ar as AEGIS_SWAP_DEFAULT_FEE_BPS,
9385
9392
  mo as AEGIS_SWAP_DEFAULT_FEE_RECIPIENT,
9386
9393
  sr as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
9387
9394
  rr as AEGIS_SWAP_DEFAULT_RPC_URLS,
9388
- _p as AEGIS_SWAP_HOOK,
9395
+ Np as AEGIS_SWAP_HOOK,
9389
9396
  Ts as AEGIS_SWAP_MAINNET_CHAIN,
9390
9397
  po as AEGIS_SWAP_MAINNET_UNISWAP_V4_CONTRACTS,
9391
9398
  Un as AEGIS_SWAP_PERMIT2,
@@ -9393,15 +9400,15 @@ export {
9393
9400
  mt as AEGIS_SWAP_TOKENS,
9394
9401
  or as AEGIS_SWAP_TRUSTED_ROUTERS_BY_CHAIN,
9395
9402
  xs as AEGIS_SWAP_V4_QUOTER,
9396
- Up as AGGREGATED_SWAP_CURATED_TOKENS,
9403
+ Vp as AGGREGATED_SWAP_CURATED_TOKENS,
9397
9404
  wo as AGGREGATED_SWAP_DEFAULT_TOKENS,
9398
9405
  Ms as AGGREGATED_SWAP_DEFAULT_TOKEN_LIST,
9399
9406
  Cs as AGGREGATED_SWAP_SUPPORTED_CHAIN_IDS,
9400
- Lp as AGGREGATED_SWAP_TOKEN_PRESETS,
9407
+ Up as AGGREGATED_SWAP_TOKEN_PRESETS,
9401
9408
  Bs as AGGREGATED_SWAP_WOLFGAME_TOKENS,
9402
9409
  Ds as AGGREGATED_SWAP_WOLFGAME_TOKEN_LIST,
9403
9410
  ys as AegisBackendApiError,
9404
- c0 as AegisBackendContractError,
9411
+ lh as AegisBackendContractError,
9405
9412
  Me as AegisContractGuardError,
9406
9413
  Xo as AegisEngineAccountReadError,
9407
9414
  ce as AegisEngineMarketDataReadError,
@@ -9412,9 +9419,9 @@ export {
9412
9419
  Zo as DIRECT_SWAP_MARKET_TRUST_RULE_ID,
9413
9420
  ma as DirectPoolSwapPriceMovedError,
9414
9421
  ko as DirectSwapMarketTrustError,
9415
- mp as ENGINE_MARKET_SERIES_TTL_MS,
9416
- l0 as ENGINE_PORTFOLIO_CHAIN_IDS,
9417
- Kp as ENGINE_UTILIZATION_CAP_PCT,
9422
+ pp as ENGINE_MARKET_SERIES_TTL_MS,
9423
+ dh as ENGINE_PORTFOLIO_CHAIN_IDS,
9424
+ zp as ENGINE_UTILIZATION_CAP_PCT,
9418
9425
  yr as KyberSwapApiError,
9419
9426
  vo as KyberSwapContractError,
9420
9427
  ld as KyberSwapPriceMovedError,
@@ -9424,48 +9431,48 @@ export {
9424
9431
  ye as MAX_UINT256,
9425
9432
  io as NATIVE_TOKEN_ADDRESS,
9426
9433
  Dr as PERMIT2_FAR_FUTURE_EXPIRATION,
9427
- d0 as PortfolioPageQuerySchema,
9428
- u0 as PortfolioPageSchema,
9429
- m0 as PortfolioQuerySchema,
9430
- p0 as PortfolioResponseSchema,
9434
+ uh as PortfolioPageQuerySchema,
9435
+ mh as PortfolioPageSchema,
9436
+ ph as PortfolioQuerySchema,
9437
+ fh as PortfolioResponseSchema,
9431
9438
  sl as SDK_RPC_MULTICALL_RULE_ID,
9432
9439
  Eo as SWAP_TX_DEADLINE_SECONDS,
9433
- f0 as SubmittedTransactionReceiptError,
9434
- h0 as TransactionReceiptTimeoutError,
9440
+ hh as SubmittedTransactionReceiptError,
9441
+ wh as TransactionReceiptTimeoutError,
9435
9442
  Ze as UNISWAP_V4_CONTRACTS_BY_CHAIN,
9436
9443
  Kn as UNLIMITED_ERC20_FLOOR,
9437
9444
  vl as UNLIMITED_PERMIT2_FLOOR,
9438
- w0 as USER_REJECTED_MESSAGE,
9445
+ bh as USER_REJECTED_MESSAGE,
9439
9446
  D as UserFacingError,
9440
- b0 as aegisBackendAddressAllowlistSchema,
9447
+ kh as aegisBackendAddressAllowlistSchema,
9441
9448
  W as aegisBackendAddressSchema,
9442
- k0 as aegisBackendAllowlistsByChainSchema,
9443
- v0 as aegisBackendChainIdSchema,
9444
- y0 as aegisBackendChainSchema,
9445
- E0 as aegisBackendConfigSchema,
9446
- I0 as aegisBackendContractRegistrySchema,
9447
- A0 as aegisBackendContractsByChainSchema,
9449
+ vh as aegisBackendAllowlistsByChainSchema,
9450
+ yh as aegisBackendChainIdSchema,
9451
+ Eh as aegisBackendChainSchema,
9452
+ Ih as aegisBackendConfigSchema,
9453
+ Ah as aegisBackendContractRegistrySchema,
9454
+ gh as aegisBackendContractsByChainSchema,
9448
9455
  le as aegisBackendDecimalStringSchema,
9449
- g0 as aegisBackendFeeConfigSchema,
9450
- S0 as aegisBackendHealthResponseSchema,
9456
+ Sh as aegisBackendFeeConfigSchema,
9457
+ Ch as aegisBackendHealthResponseSchema,
9451
9458
  so as aegisBackendHexSchema,
9452
9459
  Se as aegisBackendIsoDateTimeSchema,
9453
- C0 as aegisBackendMarketMetricsSchema,
9454
- x0 as aegisBackendMarketSchema,
9455
- T0 as aegisBackendMarketStatusSchema,
9456
- R0 as aegisBackendMarketsResponseSchema,
9457
- P0 as aegisBackendQuoteDefaultsSchema,
9458
- B0 as aegisBackendQuoteModeSchema,
9459
- M0 as aegisBackendSwapProviderSchema,
9460
- D0 as aegisBackendSwapQuoteRequestSchema,
9461
- _0 as aegisBackendSwapQuoteResponseSchema,
9462
- N0 as aegisBackendTokenSchema,
9463
- q0 as aegisBackendTokensResponseSchema,
9464
- O0 as aegisPoolKeySchema,
9465
- Wp as aggregatedSwapErrorMessage,
9460
+ xh as aegisBackendMarketMetricsSchema,
9461
+ Th as aegisBackendMarketSchema,
9462
+ Rh as aegisBackendMarketStatusSchema,
9463
+ Ph as aegisBackendMarketsResponseSchema,
9464
+ Bh as aegisBackendQuoteDefaultsSchema,
9465
+ Mh as aegisBackendQuoteModeSchema,
9466
+ Dh as aegisBackendSwapProviderSchema,
9467
+ _h as aegisBackendSwapQuoteRequestSchema,
9468
+ Nh as aegisBackendSwapQuoteResponseSchema,
9469
+ qh as aegisBackendTokenSchema,
9470
+ Oh as aegisBackendTokensResponseSchema,
9471
+ Fh as aegisPoolKeySchema,
9472
+ Kp as aggregatedSwapErrorMessage,
9466
9473
  cd as approveDirectPoolSwapInput,
9467
- Lf as approveEnginePermit2ToRouter,
9468
- Ff as approveEngineTokenToPermit2,
9474
+ Uf as approveEnginePermit2ToRouter,
9475
+ Lf as approveEngineTokenToPermit2,
9469
9476
  Tl as approveErc20Spender,
9470
9477
  _r as approveErc20ToPermit2,
9471
9478
  ud as approveKyberSwapInput,
@@ -9481,9 +9488,9 @@ export {
9481
9488
  xo as assertTrustedEngineMarket,
9482
9489
  Dt as assertUint128,
9483
9490
  lu as attachEngineActivityLotDisplays,
9484
- Uf as authorizeEnginePositionRouter,
9491
+ Vf as authorizeEnginePositionRouter,
9485
9492
  $m as authorizeEngineVaultOperator,
9486
- Hp as authorizeHostDirectSwapMarket,
9493
+ $p as authorizeHostDirectSwapMarket,
9487
9494
  gd as backendTokenToAegisSwapToken,
9488
9495
  Sd as backendTokensToAegisSwapTokens,
9489
9496
  js as buildExactInSwapTransaction,
@@ -9492,142 +9499,143 @@ export {
9492
9499
  Bl as buildSignedPermitBatch,
9493
9500
  li as classifyEngineVaultActivity,
9494
9501
  Za as classifyError,
9495
- wf as clearEngineMarketHistoryCache,
9496
- Ef as clearEngineMarketHistoryV2ProbeCache,
9497
- Qf as clearEngineMarketSeriesCache,
9498
- hf as clearEngineMarketsCache,
9499
- yf as clearEngineMarketsV2ProbeCache,
9500
- kf as clearEnginePositionActivityCache,
9501
- bf as clearEnginePositionsCache,
9502
- vf as clearEnginePositionsV2ProbeCache,
9503
- uf as clearEngineReadCaches,
9504
- Yp as clearTokenPriceHistoryCache,
9505
- zf as computeEngineIdleWithdrawPostLtvPips,
9506
- Kf as computeEngineMaxIdleWithdraw,
9502
+ bf as clearEngineMarketHistoryCache,
9503
+ If as clearEngineMarketHistoryV2ProbeCache,
9504
+ Xf as clearEngineMarketSeriesCache,
9505
+ wf as clearEngineMarketsCache,
9506
+ Ef as clearEngineMarketsV2ProbeCache,
9507
+ vf as clearEnginePositionActivityCache,
9508
+ kf as clearEnginePositionsCache,
9509
+ yf as clearEnginePositionsV2ProbeCache,
9510
+ mf as clearEngineReadCaches,
9511
+ Jp as clearTokenPriceHistoryCache,
9512
+ Gf as computeEngineIdleWithdrawPostLtvPips,
9513
+ zf as computeEngineMaxIdleWithdraw,
9507
9514
  He as computePoolId,
9508
- F0 as createAegisBackendApiClient,
9515
+ Lh as createAegisBackendApiClient,
9509
9516
  cr as createAegisSwapChainConfig,
9510
- Op as createAegisSwapChains,
9511
- lf as createAegisSwapChainsFromBackendConfig,
9512
- Vp as createAegisSwapMarketsFromPools,
9517
+ Fp as createAegisSwapChains,
9518
+ df as createAegisSwapChainsFromBackendConfig,
9519
+ Hp as createAegisSwapMarketsFromPools,
9513
9520
  Ys as createAegisSwapPoolMarket,
9514
- df as createAegisSwapPoolsFromBackendMarkets,
9521
+ uf as createAegisSwapPoolsFromBackendMarkets,
9515
9522
  Ae as createAegisSwapUniswapV4Contracts,
9516
- n0 as createEngineTradeOpenExecutionSession,
9517
- L0 as createEngineTransactionHistory,
9518
- Gp as createSwapPublicClient,
9523
+ oh as createEngineTradeOpenExecutionSession,
9524
+ Uh as createEngineTransactionHistory,
9525
+ jp as createSwapPublicClient,
9519
9526
  cu as deriveEngineActivityLotDisplay,
9520
- jf as deriveEngineTradePositionStrategy,
9521
- U0 as engineAccountPositionKey,
9522
- V0 as engineAccountTransactionKey,
9523
- Ip as engineAuthorizationPlanReviewReasons,
9524
- H0 as engineHistoryCatalogResponseSchema,
9525
- Wf as engineIdleWithdrawPassesResidualLtv,
9527
+ Qf as deriveEngineTradePositionStrategy,
9528
+ Vh as engineAccountPositionKey,
9529
+ Hh as engineAccountTransactionKey,
9530
+ Ap as engineAuthorizationPlanReviewReasons,
9531
+ $h as engineHistoryCatalogResponseSchema,
9532
+ Kf as engineIdleWithdrawPassesResidualLtv,
9526
9533
  an as engineMarketCandlesResponseSchema,
9527
9534
  Co as engineMarketIdSchema,
9528
9535
  Td as engineMarketsRestResponseSchema,
9529
9536
  Rd as engineMarketsV2RestResponseSchema,
9530
9537
  Bd as engineMetricHistoryRestResponseSchema,
9531
9538
  Md as engineMetricHistoryV2RestResponseSchema,
9532
- o0 as engineOpeningExecutionResponseSchema,
9539
+ ah as engineOpeningExecutionResponseSchema,
9533
9540
  Jt as enginePermit2GrantSatisfies,
9534
- Jf as enginePoolPriceSegments,
9535
- $0 as enginePortfolioPriceFor,
9536
- W0 as enginePositionAccountingResponseSchema,
9541
+ mp as enginePoolPriceLineResponseSchema,
9542
+ Zf as enginePoolPriceSegments,
9543
+ Wh as enginePortfolioPriceFor,
9544
+ Kh as enginePositionAccountingResponseSchema,
9537
9545
  ou as enginePositionActivityRestResponseSchema,
9538
- K0 as enginePositionHistoryResponseSchema,
9539
- z0 as enginePositionPerformanceResponseSchema,
9540
- G0 as enginePositionPnlResponseSchema,
9546
+ zh as enginePositionHistoryResponseSchema,
9547
+ Gh as enginePositionPerformanceResponseSchema,
9548
+ jh as enginePositionPnlResponseSchema,
9541
9549
  qd as enginePositionsRestResponseSchema,
9542
9550
  Ud as enginePositionsV2RestResponseSchema,
9543
- $f as enginePreviewMaxLtvPips,
9544
- zp as engineRouterForChain,
9551
+ Wf as enginePreviewMaxLtvPips,
9552
+ Gp as engineRouterForChain,
9545
9553
  Dm as engineTokenGrantSatisfies,
9546
- gp as engineTradeQuoteReviewReasons,
9547
- j0 as engineTransactionStorageKey,
9554
+ Sp as engineTradeQuoteReviewReasons,
9555
+ Qh as engineTransactionStorageKey,
9548
9556
  $e as ensureWalletChain,
9549
9557
  ad as erc20ApprovalRequest,
9550
9558
  fs as errorMessage,
9551
9559
  Fr as estimateSwapGasWithBuffer,
9552
- of as executeDirectPoolSwap,
9553
- Hf as executeEngineBalancedDeposit,
9554
- af as executeKyberSwap,
9555
- Tf as executionLtvGuardPips,
9560
+ af as executeDirectPoolSwap,
9561
+ $f as executeEngineBalancedDeposit,
9562
+ rf as executeKyberSwap,
9563
+ Rf as executionLtvGuardPips,
9556
9564
  la as fetchAggregatedSwapQuote,
9557
9565
  pa as fetchDirectPoolSwapQuote,
9558
- Q0 as fetchEngineAccountActivity,
9559
- X0 as fetchEngineAccountPortfolio,
9560
- Y0 as fetchEngineHistoryPositions,
9561
- Cf as fetchEngineLendActivity,
9562
- Xf as fetchEngineMarketCandles,
9563
- Af as fetchEngineMarketHistory,
9564
- Zf as fetchEngineMarketReferenceHistory,
9565
- If as fetchEngineMarkets,
9566
- a0 as fetchEngineOpeningEntry,
9567
- Yf as fetchEnginePoolPriceHistory,
9566
+ Xh as fetchEngineAccountActivity,
9567
+ Yh as fetchEngineAccountPortfolio,
9568
+ Jh as fetchEngineHistoryPositions,
9569
+ xf as fetchEngineLendActivity,
9570
+ Yf as fetchEngineMarketCandles,
9571
+ gf as fetchEngineMarketHistory,
9572
+ eh as fetchEngineMarketReferenceHistory,
9573
+ Af as fetchEngineMarkets,
9574
+ rh as fetchEngineOpeningEntry,
9575
+ Jf as fetchEnginePoolPriceHistory,
9568
9576
  wi as fetchEnginePositionActivitySnapshot,
9569
- J0 as fetchEnginePositionHistory,
9570
- gf as fetchEnginePositionsSnapshot,
9571
- e0 as fetchEngineRateHistory,
9572
- Z0 as fetchEngineTransactionStatus,
9573
- Sf as fetchEngineVaultActivity,
9574
- Xp as fetchGlobalTokenMetadata,
9577
+ Zh as fetchEnginePositionHistory,
9578
+ Sf as fetchEnginePositionsSnapshot,
9579
+ th as fetchEngineRateHistory,
9580
+ e0 as fetchEngineTransactionStatus,
9581
+ Cf as fetchEngineVaultActivity,
9582
+ Yp as fetchGlobalTokenMetadata,
9575
9583
  Cc as fetchKyberSwapRoute,
9576
- Zp as fetchTokenPriceHistory,
9577
- eh as formatEngineAccountTokenAmount,
9584
+ ef as fetchTokenPriceHistory,
9585
+ t0 as formatEngineAccountTokenAmount,
9578
9586
  fo as getExplorerUrl,
9579
9587
  cl as getInjectedProvider,
9580
9588
  ul as getProviderAccount,
9581
9589
  _t as getProviderChainId,
9582
9590
  lc as getZeroForOne,
9583
- th as groupEngineAccountActivity,
9584
- nh as groupEnginePortfolioPositions,
9591
+ n0 as groupEngineAccountActivity,
9592
+ o0 as groupEnginePortfolioPositions,
9585
9593
  ln as hasUsablePermit2Allowance,
9586
- Gf as isAegisEngineTradePositionIntent,
9587
- rf as isBusy,
9594
+ jf as isAegisEngineTradePositionIntent,
9595
+ sf as isBusy,
9588
9596
  br as isDirectSwapMarketTrusted,
9589
- ef as isDocumentVisible,
9597
+ tf as isDocumentVisible,
9590
9598
  ll as isEip1193Provider,
9591
9599
  Ce as isNativeAssetAddress,
9592
9600
  jr as isNativeToken,
9593
- oh as isRetryableAegisBackendApiError,
9601
+ a0 as isRetryableAegisBackendApiError,
9594
9602
  Cr as isRetryableKyberSwapError,
9595
- ah as isSubmittedTransactionReceiptError,
9603
+ r0 as isSubmittedTransactionReceiptError,
9596
9604
  yl as isUnlimitedErc20Approval,
9597
9605
  El as isUnlimitedPermit2Approval,
9598
9606
  vs as isUserRejectedError,
9599
- rh as mergeEngineTransactionRecord,
9600
- Vf as missingEngineExecutionReason,
9607
+ i0 as mergeEngineTransactionRecord,
9608
+ Hf as missingEngineExecutionReason,
9601
9609
  cn as normalizeAccount,
9602
9610
  Lt as normalizeAegisBackendBaseUrl,
9603
9611
  xn as normalizeEngineMarkets,
9604
9612
  dl as normalizeWalletConnection,
9605
9613
  pc as outputFeeForQuote,
9606
9614
  il as parseEngineDeploymentManifest,
9607
- ih as parseEngineTransactionRecords,
9608
- Jp as peekTokenPriceHistory,
9615
+ s0 as parseEngineTransactionRecords,
9616
+ Zp as peekTokenPriceHistory,
9609
9617
  dn as pollUntil,
9610
9618
  Ni as prepareEnginePermit,
9611
- sf as progressRailSteps,
9612
- Bf as quoteEngineAddCollateral,
9619
+ cf as progressRailSteps,
9620
+ Mf as quoteEngineAddCollateral,
9613
9621
  Wa as quoteEngineBalancedDeposit,
9614
- Pf as quoteEngineBorrow,
9615
- Mf as quoteEngineBorrowCapacity,
9616
- _f as quoteEngineCloseVault,
9617
- Rf as quoteEngineDeposit,
9618
- Nf as quoteEngineIdleWithdraw,
9619
- qf as quoteEngineRedeem,
9620
- Df as quoteEngineRepay,
9622
+ Bf as quoteEngineBorrow,
9623
+ Df as quoteEngineBorrowCapacity,
9624
+ Nf as quoteEngineCloseVault,
9625
+ Pf as quoteEngineDeposit,
9626
+ qf as quoteEngineIdleWithdraw,
9627
+ Of as quoteEngineRedeem,
9628
+ _f as quoteEngineRepay,
9621
9629
  Rm as quoteEngineTradeOpen,
9622
9630
  ta as quoteSpendAmount,
9623
9631
  Zu as readEngineAdaptiveFeeEvidence,
9624
9632
  Vm as readEngineAuthorizationPlan,
9625
9633
  Bo as readEngineBorrowQuoteContext,
9626
9634
  Au as readEngineLendQuoteContext,
9627
- mf as readEngineMarketMark,
9635
+ pf as readEngineMarketMark,
9628
9636
  Iu as readEngineMarketSnapshot,
9629
- pf as readEnginePositionsHydration,
9630
- ff as readEngineVaultActivity,
9637
+ ff as readEnginePositionsHydration,
9638
+ hf as readEngineVaultActivity,
9631
9639
  Hm as readEngineVaultRouterApproved,
9632
9640
  Vt as readErc20Allowance,
9633
9641
  nt as readPermit2RouterAllowance,
@@ -9635,23 +9643,23 @@ export {
9635
9643
  Is as reconcileSubmittedReceipt,
9636
9644
  ml as requestProviderAccount,
9637
9645
  un as requiresErc20ApprovalReset,
9638
- sh as resolveEngineAccountPositionTarget,
9639
- Of as resolveEngineBorrowCollateralFloor,
9640
- Qp as resolveTokenIconUrl,
9641
- nf as resolveWalletSession,
9642
- tf as retryOnError,
9646
+ c0 as resolveEngineAccountPositionTarget,
9647
+ Ff as resolveEngineBorrowCollateralFloor,
9648
+ Xp as resolveTokenIconUrl,
9649
+ of as resolveWalletSession,
9650
+ nf as retryOnError,
9643
9651
  Ht as sameEngineMarketId,
9644
- $p as sameQuote,
9652
+ Wp as sameQuote,
9645
9653
  kn as sendEngineTransaction,
9646
- ch as serializeEngineTransactionRecords,
9647
- t0 as splitEngineMarketCandleSegments,
9648
- jp as subscribeProvider,
9654
+ l0 as serializeEngineTransactionRecords,
9655
+ nh as splitEngineMarketCandleSegments,
9656
+ Qp as subscribeProvider,
9649
9657
  Wu as summarizeEngineLendShareGrowth,
9650
- xf as summarizeEngineSimpleYieldPosition,
9658
+ Tf as summarizeEngineSimpleYieldPosition,
9651
9659
  Ur as summarizeTransactionReceipt,
9652
9660
  kl as switchProviderChain,
9653
9661
  Gl as tokenPriceHistoryRestResponseSchema,
9654
- cf as transactionProgressView,
9662
+ lf as transactionProgressView,
9655
9663
  fd as transactionSequenceProgress,
9656
9664
  de as trustedEngineRegistryForChain,
9657
9665
  kt as trustedEngineVersionForChain,