@aegis-engine/core 0.8.0 → 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.
- package/dist/aegis-core.js +354 -343
- package/dist/engine/marketSeries.d.ts +264 -0
- package/dist/engine/types.d.ts +4 -0
- package/dist/{sdkRuntime-3aRt_g55.js → sdkRuntime-BLOOWtPv.js} +2594 -2532
- package/package.json +2 -2
package/dist/aegis-core.js
CHANGED
|
@@ -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
|
|
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
|
-
},
|
|
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
|
|
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
|
-
},
|
|
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
|
-
),
|
|
340
|
+
), Up = {
|
|
341
341
|
default: Ms,
|
|
342
342
|
wolfgame: Ds
|
|
343
|
-
},
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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" } } } },
|
|
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
|
|
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:
|
|
1925
|
-
aegisHook:
|
|
1926
|
-
aegisRouterV1:
|
|
1927
|
-
aegisStateView:
|
|
1928
|
-
vaultRegistry:
|
|
1929
|
-
variableInterestRate:
|
|
1930
|
-
oracleManager:
|
|
1931
|
-
limitOrderManager:
|
|
1932
|
-
dynamicFeeManager:
|
|
1933
|
-
poolManager:
|
|
1934
|
-
positionManager:
|
|
1935
|
-
stateView:
|
|
1936
|
-
uniswapV4Quoter:
|
|
1937
|
-
permit2:
|
|
1938
|
-
weth9:
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
2888
|
+
function tf() {
|
|
2889
2889
|
return typeof document > "u" ? !0 : document.visibilityState !== "hidden";
|
|
2890
2890
|
}
|
|
2891
|
-
async function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
3345
|
+
function sf(e) {
|
|
3346
3346
|
return e === "approving" || e === "signing" || e === "submitting";
|
|
3347
3347
|
}
|
|
3348
|
-
function
|
|
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
|
|
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
|
|
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
|
|
3664
|
+
function uf({
|
|
3665
3665
|
config: e,
|
|
3666
3666
|
markets: t,
|
|
3667
3667
|
tokens: n,
|
|
@@ -4517,7 +4517,7 @@ function xn(e) {
|
|
|
4517
4517
|
}
|
|
4518
4518
|
let ba = null;
|
|
4519
4519
|
function K() {
|
|
4520
|
-
return ba ?? (ba = import("./sdkRuntime-
|
|
4520
|
+
return ba ?? (ba = import("./sdkRuntime-BLOOWtPv.js").then(({ engineSdkRuntime: e }) => e)), ba;
|
|
4521
4521
|
}
|
|
4522
4522
|
const Tn = 2500;
|
|
4523
4523
|
let Xn = /* @__PURE__ */ new WeakMap();
|
|
@@ -4597,7 +4597,7 @@ function pn(e, t) {
|
|
|
4597
4597
|
...t.map((n) => n.toLowerCase())
|
|
4598
4598
|
].join(":");
|
|
4599
4599
|
}
|
|
4600
|
-
function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
5120
|
+
function wf() {
|
|
5121
5121
|
ui.clear();
|
|
5122
5122
|
}
|
|
5123
|
-
function
|
|
5123
|
+
function bf() {
|
|
5124
5124
|
mi.clear();
|
|
5125
5125
|
}
|
|
5126
|
-
function
|
|
5126
|
+
function kf() {
|
|
5127
5127
|
pi.clear();
|
|
5128
5128
|
}
|
|
5129
|
-
function
|
|
5129
|
+
function vf() {
|
|
5130
5130
|
fi.clear();
|
|
5131
5131
|
}
|
|
5132
|
-
function
|
|
5132
|
+
function yf() {
|
|
5133
5133
|
Mo.clear();
|
|
5134
5134
|
}
|
|
5135
|
-
function
|
|
5135
|
+
function Ef() {
|
|
5136
5136
|
Yn.clear();
|
|
5137
5137
|
}
|
|
5138
|
-
function
|
|
5138
|
+
function If() {
|
|
5139
5139
|
Jn.clear();
|
|
5140
5140
|
}
|
|
5141
|
-
async function
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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" },
|
|
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 ?? $)),
|
|
6016
|
+
), U = Math.min($, Math.max(z, l ?? $)), oe = hm(he, U);
|
|
6017
6017
|
return {
|
|
6018
|
-
result: { lMin: z, lMax: $, chosen:
|
|
6019
|
-
anchor:
|
|
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
|
|
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
|
|
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
|
|
6389
|
+
async function Bf(e) {
|
|
6390
6390
|
return Ci(e, { allowDisabledBorrow: !1 });
|
|
6391
6391
|
}
|
|
6392
|
-
async function
|
|
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
|
|
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.");
|
|
@@ -6599,7 +6599,8 @@ function Sm(e, t, n, o) {
|
|
|
6599
6599
|
const { quoteExactInputSingle: r } = await K(), i = at("V4 quoter", t.v4Quoter, o), s = await r(e, i, {
|
|
6600
6600
|
poolKey: t.poolKey,
|
|
6601
6601
|
zeroForOne: a.inputIsToken0,
|
|
6602
|
-
exactAmount: a.amountIn
|
|
6602
|
+
exactAmount: a.amountIn,
|
|
6603
|
+
...a.blockNumber !== void 0 ? { blockNumber: a.blockNumber } : {}
|
|
6603
6604
|
});
|
|
6604
6605
|
return {
|
|
6605
6606
|
minAmountOut: bt(s.amountOut, n),
|
|
@@ -6621,7 +6622,7 @@ function Ri(e) {
|
|
|
6621
6622
|
var t, n;
|
|
6622
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;
|
|
6623
6624
|
}
|
|
6624
|
-
async function
|
|
6625
|
+
async function _f(e) {
|
|
6625
6626
|
gt(e.slippageBps);
|
|
6626
6627
|
const { chainId: t, version: n, trustedPermit2: o, trustedQuoter: a } = Wt(
|
|
6627
6628
|
e.market,
|
|
@@ -6637,6 +6638,7 @@ async function Df(e) {
|
|
|
6637
6638
|
repayRl: e.repayRl ?? "full",
|
|
6638
6639
|
deadline: e.deadline ?? At(),
|
|
6639
6640
|
...e.quoteTtlSeconds !== void 0 ? { quoteTtlSeconds: e.quoteTtlSeconds } : {},
|
|
6641
|
+
...e.executionFrameMaxAgeSeconds !== void 0 ? { executionFrameMaxAgeSeconds: e.executionFrameMaxAgeSeconds } : {},
|
|
6640
6642
|
slippageBps: e.slippageBps,
|
|
6641
6643
|
fetchQuote: Sm(
|
|
6642
6644
|
e.publicClient,
|
|
@@ -6677,7 +6679,7 @@ async function Df(e) {
|
|
|
6677
6679
|
tx: it(e.market, i.call)
|
|
6678
6680
|
};
|
|
6679
6681
|
}
|
|
6680
|
-
async function
|
|
6682
|
+
async function Nf(e) {
|
|
6681
6683
|
const { chainId: t, version: n, trustedPermit2: o } = Wt(
|
|
6682
6684
|
e.market,
|
|
6683
6685
|
e.target,
|
|
@@ -6692,6 +6694,7 @@ async function _f(e) {
|
|
|
6692
6694
|
recipient: e.owner,
|
|
6693
6695
|
deadline: e.deadline ?? At(),
|
|
6694
6696
|
...e.quoteTtlSeconds !== void 0 ? { quoteTtlSeconds: e.quoteTtlSeconds } : {},
|
|
6697
|
+
...e.executionFrameMaxAgeSeconds !== void 0 ? { executionFrameMaxAgeSeconds: e.executionFrameMaxAgeSeconds } : {},
|
|
6695
6698
|
...e.signal ? { signal: e.signal } : {}
|
|
6696
6699
|
})
|
|
6697
6700
|
);
|
|
@@ -6718,7 +6721,7 @@ async function _f(e) {
|
|
|
6718
6721
|
tx: it(e.market, r.call)
|
|
6719
6722
|
};
|
|
6720
6723
|
}
|
|
6721
|
-
async function
|
|
6724
|
+
async function qf(e) {
|
|
6722
6725
|
const { chainId: t, version: n } = Wt(e.market, e.target, "withdraw"), { quoteIdleWithdraw: o } = await K(), a = await o(e.publicClient, {
|
|
6723
6726
|
chainId: t,
|
|
6724
6727
|
version: n,
|
|
@@ -6753,7 +6756,7 @@ async function Nf(e) {
|
|
|
6753
6756
|
tx: it(e.market, a.call)
|
|
6754
6757
|
};
|
|
6755
6758
|
}
|
|
6756
|
-
async function
|
|
6759
|
+
async function Of(e) {
|
|
6757
6760
|
var x;
|
|
6758
6761
|
gt(e.slippageBps);
|
|
6759
6762
|
const { chainId: t, version: n } = Wt(e.market, e.target, "redeem"), {
|
|
@@ -6794,8 +6797,8 @@ async function qf(e) {
|
|
|
6794
6797
|
const [M, F] = await Promise.all([
|
|
6795
6798
|
o(e.publicClient, g, e.market.poolId, A),
|
|
6796
6799
|
a(e.publicClient, g, e.market.poolId, A)
|
|
6797
|
-
]), L = M.market.totalRlBorrowed * M.latestBorrowIndexWad, ee = L === 0n ? 0n : L * r / (c + 1n) + 1n,
|
|
6798
|
-
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);
|
|
6799
6802
|
}
|
|
6800
6803
|
P > 0n ? (d.sharesDelta !== P && (d = await i(e.publicClient, {
|
|
6801
6804
|
...p,
|
|
@@ -7033,11 +7036,11 @@ async function Rm(e) {
|
|
|
7033
7036
|
maxCollateralIn: F.maxEfficientDeposit === null ? null : hn(F.maxEfficientDeposit, l)
|
|
7034
7037
|
};
|
|
7035
7038
|
E = L;
|
|
7036
|
-
const { buildTapOpenPosition: ee, computeActualLtvPips: X, minDebtFloorRl:
|
|
7039
|
+
const { buildTapOpenPosition: ee, computeActualLtvPips: X, minDebtFloorRl: ne, previewFullRangeBorrow: Te } = await K(), be = sm(
|
|
7037
7040
|
M.delta,
|
|
7038
7041
|
No(i.decimals0, i.decimals1)
|
|
7039
7042
|
);
|
|
7040
|
-
if (be <
|
|
7043
|
+
if (be < ne(i.equityLWad, i.borrowIndexWad))
|
|
7041
7044
|
return h("debt-below-minimum", L);
|
|
7042
7045
|
if (M.delta > F.deltaCap) return h("delta-above-cap", L);
|
|
7043
7046
|
const Ee = Te(
|
|
@@ -7063,7 +7066,7 @@ async function Rm(e) {
|
|
|
7063
7066
|
idle1: z
|
|
7064
7067
|
});
|
|
7065
7068
|
if (!$.ok) return h($.reason, L);
|
|
7066
|
-
const U = $.leg,
|
|
7069
|
+
const U = $.leg, oe = await im({
|
|
7067
7070
|
publicClient: e.publicClient,
|
|
7068
7071
|
quoter: o,
|
|
7069
7072
|
context: a,
|
|
@@ -7073,11 +7076,11 @@ async function Rm(e) {
|
|
|
7073
7076
|
slippageBps: e.slippageBps,
|
|
7074
7077
|
...e.signal ? { signal: e.signal } : {}
|
|
7075
7078
|
});
|
|
7076
|
-
if ((A = e.signal) == null || A.throwIfAborted(),
|
|
7079
|
+
if ((A = e.signal) == null || A.throwIfAborted(), oe.blockNumber !== a.frame.blockNumber || !await Bi(e.publicClient, a.frame, e.signal))
|
|
7077
7080
|
return h("stale-frame", L);
|
|
7078
7081
|
const O = U.needed ? Pi(
|
|
7079
7082
|
U.amountIn,
|
|
7080
|
-
|
|
7083
|
+
oe.amountOutQuoted,
|
|
7081
7084
|
U.inputIsToken0,
|
|
7082
7085
|
i.sqrtPriceX96
|
|
7083
7086
|
) : null;
|
|
@@ -7086,14 +7089,14 @@ async function Rm(e) {
|
|
|
7086
7089
|
const Y = U.needed ? {
|
|
7087
7090
|
inputIsToken0: U.inputIsToken0,
|
|
7088
7091
|
amountIn: U.amountIn,
|
|
7089
|
-
amountOutQuoted:
|
|
7090
|
-
amountOutMinimum:
|
|
7092
|
+
amountOutQuoted: oe.amountOutQuoted,
|
|
7093
|
+
amountOutMinimum: oe.amountOutMinimum,
|
|
7091
7094
|
priceImpactBps: O,
|
|
7092
7095
|
clampedByIdle: U.clampedByIdle
|
|
7093
7096
|
} : null;
|
|
7094
7097
|
if (Y && Y.priceImpactBps > e.maxPriceImpactBps)
|
|
7095
7098
|
return h("price-impact-limit", L, Y);
|
|
7096
|
-
const St = U.inputIsToken0 ? U.amountIn : 0n, Ct = U.inputIsToken0 ? 0n : U.amountIn, Kt = U.inputIsToken0 ? 0n :
|
|
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(
|
|
7097
7100
|
Ee.liquidityL,
|
|
7098
7101
|
xt,
|
|
7099
7102
|
Ke,
|
|
@@ -7118,7 +7121,7 @@ async function Rm(e) {
|
|
|
7118
7121
|
deposit0: c.amount0,
|
|
7119
7122
|
deposit1: c.amount1,
|
|
7120
7123
|
principalDelta: be,
|
|
7121
|
-
swapRoute:
|
|
7124
|
+
swapRoute: oe.route,
|
|
7122
7125
|
swapInputAmount: U.amountIn,
|
|
7123
7126
|
swapInputIsToken0: U.inputIsToken0,
|
|
7124
7127
|
depositAfterSwap0: Kt,
|
|
@@ -7177,7 +7180,7 @@ async function Rm(e) {
|
|
|
7177
7180
|
}
|
|
7178
7181
|
return h("ltv-above-max", E);
|
|
7179
7182
|
}
|
|
7180
|
-
function
|
|
7183
|
+
function Ff(e) {
|
|
7181
7184
|
if (e.collateralFloor) return e.collateralFloor;
|
|
7182
7185
|
if (e.borrowOut === null) return { status: "not-requested" };
|
|
7183
7186
|
if (e.utilizationCapped) return { status: "infeasible", reason: "utilization-capped" };
|
|
@@ -7726,12 +7729,12 @@ async function _i(e) {
|
|
|
7726
7729
|
}
|
|
7727
7730
|
}), t(), await ((r = e.onAuthorizationCheckpoint) == null ? void 0 : r.call(e)), t()));
|
|
7728
7731
|
}
|
|
7729
|
-
async function
|
|
7732
|
+
async function Lf(e) {
|
|
7730
7733
|
Oo(e);
|
|
7731
7734
|
const t = Fo(e), n = () => bn(t);
|
|
7732
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) });
|
|
7733
7736
|
}
|
|
7734
|
-
async function
|
|
7737
|
+
async function Uf(e) {
|
|
7735
7738
|
Oo(e, !0);
|
|
7736
7739
|
const t = Fo(e), n = () => bn(t);
|
|
7737
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)));
|
|
@@ -7783,7 +7786,7 @@ async function Ni(e) {
|
|
|
7783
7786
|
});
|
|
7784
7787
|
return n(), await ((l = e.onAuthorizationCheckpoint) == null ? void 0 : l.call(e)), n(), { approvalHash: o, permit: i };
|
|
7785
7788
|
}
|
|
7786
|
-
async function
|
|
7789
|
+
async function Vf(e) {
|
|
7787
7790
|
var n;
|
|
7788
7791
|
const t = qm(e);
|
|
7789
7792
|
return (n = e.onStatus) == null || n.call(e, "approving"), kn({
|
|
@@ -7906,7 +7909,7 @@ async function kn(e) {
|
|
|
7906
7909
|
summary: o
|
|
7907
7910
|
};
|
|
7908
7911
|
}
|
|
7909
|
-
function
|
|
7912
|
+
function Hf(e) {
|
|
7910
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.";
|
|
7911
7914
|
}
|
|
7912
7915
|
const qi = /* @__PURE__ */ new WeakMap();
|
|
@@ -8056,7 +8059,7 @@ async function Wa(e) {
|
|
|
8056
8059
|
nativeGasReserve: e.nativeGasReserve
|
|
8057
8060
|
}), f;
|
|
8058
8061
|
}
|
|
8059
|
-
async function
|
|
8062
|
+
async function $f(e) {
|
|
8060
8063
|
var s, l, c, p, d, m;
|
|
8061
8064
|
(s = e.signal) == null || s.throwIfAborted(), await ((l = e.onCheckpoint) == null ? void 0 : l.call(e));
|
|
8062
8065
|
const t = qi.get(e.quote);
|
|
@@ -8102,7 +8105,7 @@ async function Hf(e) {
|
|
|
8102
8105
|
}) };
|
|
8103
8106
|
}
|
|
8104
8107
|
const Uo = 1000000n, Wm = 5e3;
|
|
8105
|
-
function
|
|
8108
|
+
function Wf(e) {
|
|
8106
8109
|
return Math.max(0, e - Wm);
|
|
8107
8110
|
}
|
|
8108
8111
|
function Vo(e) {
|
|
@@ -8126,13 +8129,13 @@ function Km(e) {
|
|
|
8126
8129
|
function Li(e) {
|
|
8127
8130
|
return Fi(e.debtLLatest * Uo, BigInt(e.maxLtvPips));
|
|
8128
8131
|
}
|
|
8129
|
-
function
|
|
8132
|
+
function Kf(e) {
|
|
8130
8133
|
if (Vo(e), e.debtLLatest === 0n) return !0;
|
|
8131
8134
|
if (e.maxLtvPips === 0) return !1;
|
|
8132
8135
|
const t = Li(e);
|
|
8133
8136
|
return e.idle0 * e.idle1 >= t * t;
|
|
8134
8137
|
}
|
|
8135
|
-
function
|
|
8138
|
+
function zf(e) {
|
|
8136
8139
|
Vo(e);
|
|
8137
8140
|
const t = e.side === "token0" ? e.idle0 : e.idle1;
|
|
8138
8141
|
if (t === 0n || e.debtLLatest === 0n) return t;
|
|
@@ -8142,7 +8145,7 @@ function Kf(e) {
|
|
|
8142
8145
|
const o = Li(e), a = Fi(o * o, n);
|
|
8143
8146
|
return a >= t ? 0n : t - a;
|
|
8144
8147
|
}
|
|
8145
|
-
function
|
|
8148
|
+
function Gf(e) {
|
|
8146
8149
|
if (Vo(e), e.withdrawAmount < 0n)
|
|
8147
8150
|
throw new RangeError("Engine withdrawal amount must be non-negative.");
|
|
8148
8151
|
if (e.debtLLatest === 0n) return null;
|
|
@@ -8186,13 +8189,13 @@ function Vi(e) {
|
|
|
8186
8189
|
const t = e;
|
|
8187
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));
|
|
8188
8191
|
}
|
|
8189
|
-
function
|
|
8192
|
+
function jf(e) {
|
|
8190
8193
|
return Vi(e);
|
|
8191
8194
|
}
|
|
8192
8195
|
function jm(e, t, n, o, a) {
|
|
8193
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;
|
|
8194
8197
|
}
|
|
8195
|
-
function
|
|
8198
|
+
function Qf(e, t, n = []) {
|
|
8196
8199
|
var x, A, P;
|
|
8197
8200
|
let o, a;
|
|
8198
8201
|
try {
|
|
@@ -8542,11 +8545,11 @@ uo([
|
|
|
8542
8545
|
]);
|
|
8543
8546
|
const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
|
|
8544
8547
|
(e) => /^(0|[1-9][0-9]*)$/.test(e) && e.length <= 78 && BigInt(e) < 1n << 256n
|
|
8545
|
-
),
|
|
8548
|
+
), re = w().int().nonnegative().max(Number.MAX_SAFE_INTEGER), Qa = w().nonnegative().nullable(), lp = Ut("status", [
|
|
8546
8549
|
T({
|
|
8547
8550
|
status: B("verified"),
|
|
8548
8551
|
basis: B("irm-accrual-preview"),
|
|
8549
|
-
rpcBlockNumber:
|
|
8552
|
+
rpcBlockNumber: re,
|
|
8550
8553
|
blockHash: S().regex(/^0x[0-9a-f]{64}$/),
|
|
8551
8554
|
observedAt: S().datetime(),
|
|
8552
8555
|
elapsedSeconds: Zt,
|
|
@@ -8558,9 +8561,9 @@ const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
|
|
|
8558
8561
|
reason: V(["legacy-unpinned", "invalid-provenance"])
|
|
8559
8562
|
}).strict()
|
|
8560
8563
|
]), dp = T({
|
|
8561
|
-
t:
|
|
8564
|
+
t: re,
|
|
8562
8565
|
observedAt: S().datetime(),
|
|
8563
|
-
evmBlockNumber:
|
|
8566
|
+
evmBlockNumber: re,
|
|
8564
8567
|
borrowAprPct: Qa,
|
|
8565
8568
|
lendAprPct: Qa,
|
|
8566
8569
|
lendingRateBasis: B("simple-borrow-interest-apr"),
|
|
@@ -8575,23 +8578,45 @@ const Zt = S().regex(/^(0|[1-9][0-9]*)$/).max(78).refine(
|
|
|
8575
8578
|
resolution: B("12h"),
|
|
8576
8579
|
window: V(["7d", "30d", "60d"]),
|
|
8577
8580
|
status: V(["ready", "partial", "warming_up", "no_data"]),
|
|
8578
|
-
pointCount:
|
|
8581
|
+
pointCount: re,
|
|
8579
8582
|
points: q(dp).max(121),
|
|
8580
8583
|
updatedAt: S().datetime().nullable(),
|
|
8581
8584
|
coverage: T({
|
|
8582
|
-
fromBucket:
|
|
8583
|
-
throughClosedBucket:
|
|
8584
|
-
expectedClosedBuckets:
|
|
8585
|
-
firstObservedBucket:
|
|
8586
|
-
leadingMissingBucketCount:
|
|
8587
|
-
presentClosedBuckets:
|
|
8588
|
-
missingBuckets: q(
|
|
8589
|
-
missingRateBuckets: q(
|
|
8590
|
-
verifiedRatePoints:
|
|
8591
|
-
legacyRatePoints:
|
|
8592
|
-
invalidRows:
|
|
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
|
|
8593
8596
|
}).strict()
|
|
8594
|
-
}).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
|
+
});
|
|
8595
8620
|
class ce extends Error {
|
|
8596
8621
|
constructor(n, o = 503, a = null) {
|
|
8597
8622
|
super("Engine market data is unavailable.");
|
|
@@ -8599,15 +8624,15 @@ class ce extends Error {
|
|
|
8599
8624
|
this.code = n, this.status = o, this.retryAfterSeconds = a;
|
|
8600
8625
|
}
|
|
8601
8626
|
}
|
|
8602
|
-
function
|
|
8627
|
+
function ie() {
|
|
8603
8628
|
throw new ce("invalid-response");
|
|
8604
8629
|
}
|
|
8605
|
-
const
|
|
8606
|
-
ttlMs:
|
|
8630
|
+
const pp = 3e4, no = 16, Qi = ge({
|
|
8631
|
+
ttlMs: pp,
|
|
8607
8632
|
maxEntries: no
|
|
8608
8633
|
}), Qe = /* @__PURE__ */ new Map();
|
|
8609
8634
|
let oo = 0, Dn = 0;
|
|
8610
|
-
function
|
|
8635
|
+
function Xf() {
|
|
8611
8636
|
Qi.clear(), Qe.clear(), oo++;
|
|
8612
8637
|
}
|
|
8613
8638
|
function vn(e, t, n, o) {
|
|
@@ -8653,7 +8678,7 @@ function vn(e, t, n, o) {
|
|
|
8653
8678
|
function Wo(e, t) {
|
|
8654
8679
|
if (e)
|
|
8655
8680
|
for (const n of ["baseAsset", "quoteAsset"])
|
|
8656
|
-
(e[n].address.toLowerCase() !== t[n].address.toLowerCase() || e[n].decimals !== t[n].decimals) &&
|
|
8681
|
+
(e[n].address.toLowerCase() !== t[n].address.toLowerCase() || e[n].decimals !== t[n].decimals) && ie();
|
|
8657
8682
|
}
|
|
8658
8683
|
async function yn(e, t, n, o) {
|
|
8659
8684
|
var c, p, d;
|
|
@@ -8692,7 +8717,7 @@ async function yn(e, t, n, o) {
|
|
|
8692
8717
|
if (Number(u.headers.get("content-length")) > h)
|
|
8693
8718
|
throw (p = u.body) == null || p.cancel().catch(() => {
|
|
8694
8719
|
}), new ce("response-limit");
|
|
8695
|
-
s = (d = u.body) == null ? void 0 : d.getReader(), s ||
|
|
8720
|
+
s = (d = u.body) == null ? void 0 : d.getReader(), s || ie(), r == null || r.addEventListener("abort", l, { once: !0 });
|
|
8696
8721
|
const f = [];
|
|
8697
8722
|
let b = 0;
|
|
8698
8723
|
for (; ; ) {
|
|
@@ -8710,10 +8735,10 @@ async function yn(e, t, n, o) {
|
|
|
8710
8735
|
try {
|
|
8711
8736
|
C = JSON.parse(new TextDecoder().decode(E));
|
|
8712
8737
|
} catch {
|
|
8713
|
-
|
|
8738
|
+
ie();
|
|
8714
8739
|
}
|
|
8715
8740
|
const x = o.safeParse(C);
|
|
8716
|
-
return x.success ||
|
|
8741
|
+
return x.success || ie(), x.data;
|
|
8717
8742
|
} catch (m) {
|
|
8718
8743
|
throw r == null || r.throwIfAborted(), m instanceof ce ? m : new ce("unavailable");
|
|
8719
8744
|
} finally {
|
|
@@ -8723,9 +8748,9 @@ async function yn(e, t, n, o) {
|
|
|
8723
8748
|
function Ko(e, t, n) {
|
|
8724
8749
|
var a;
|
|
8725
8750
|
const o = e.marketId.split("_");
|
|
8726
|
-
(t.marketId !== e.marketId || t.chainId !== Number(o[1]) || t.poolId.toLowerCase() !== ((a = o[2]) == null ? void 0 : a.toLowerCase()) || t.window !== n) &&
|
|
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();
|
|
8727
8752
|
}
|
|
8728
|
-
async function
|
|
8753
|
+
async function fp(e) {
|
|
8729
8754
|
const t = e.window ?? "1d";
|
|
8730
8755
|
if (!["1d", "7d", "30d", "90d", "180d"].includes(t))
|
|
8731
8756
|
throw new ce("invalid-query", 400);
|
|
@@ -8737,7 +8762,7 @@ async function pp(e) {
|
|
|
8737
8762
|
);
|
|
8738
8763
|
return Ko(e, n, t), n;
|
|
8739
8764
|
}
|
|
8740
|
-
async function
|
|
8765
|
+
async function hp(e) {
|
|
8741
8766
|
const t = e.window ?? "7d";
|
|
8742
8767
|
if (!["7d", "30d", "90d", "180d"].includes(t))
|
|
8743
8768
|
throw new ce("invalid-query", 400);
|
|
@@ -8747,32 +8772,32 @@ async function fp(e) {
|
|
|
8747
8772
|
{ window: t, basis: "token_market_reference" },
|
|
8748
8773
|
ji
|
|
8749
8774
|
);
|
|
8750
|
-
return Ko(e, n, t),
|
|
8775
|
+
return Ko(e, n, t), wp(n), n;
|
|
8751
8776
|
}
|
|
8752
|
-
function
|
|
8777
|
+
function wp(e) {
|
|
8753
8778
|
const t = Wi[e.window], n = t.resolution === "1h" ? 3600 : 86400, o = e.coverage;
|
|
8754
|
-
(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()) &&
|
|
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();
|
|
8755
8780
|
for (const [i, s] of e.components.entries()) {
|
|
8756
8781
|
const l = i === 0 ? e.baseAsset : e.quoteAsset;
|
|
8757
|
-
(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)) &&
|
|
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();
|
|
8758
8783
|
}
|
|
8759
8784
|
let a = -1;
|
|
8760
8785
|
for (const i of e.points) {
|
|
8761
8786
|
const s = Number(i.baseCloseUsd) / Number(i.quoteCloseUsd);
|
|
8762
|
-
(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) &&
|
|
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();
|
|
8763
8788
|
for (const [l, c] of [i.baseSource, i.quoteSource].entries()) {
|
|
8764
8789
|
const p = e.components[l], d = p.sourceHead;
|
|
8765
|
-
(!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) &&
|
|
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();
|
|
8766
8791
|
}
|
|
8767
8792
|
a = i.t;
|
|
8768
8793
|
}
|
|
8769
8794
|
a = -1;
|
|
8770
8795
|
let r = 0;
|
|
8771
8796
|
for (const i of e.gaps)
|
|
8772
|
-
(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)) &&
|
|
8773
|
-
(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))) &&
|
|
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();
|
|
8774
8799
|
}
|
|
8775
|
-
async function
|
|
8800
|
+
async function bp(e) {
|
|
8776
8801
|
var u, h;
|
|
8777
8802
|
const t = e.window ?? "30d";
|
|
8778
8803
|
if (!["7d", "30d", "60d"].includes(t))
|
|
@@ -8783,13 +8808,13 @@ async function wp(e) {
|
|
|
8783
8808
|
{ window: t },
|
|
8784
8809
|
up
|
|
8785
8810
|
);
|
|
8786
|
-
(n.marketId !== e.marketId || n.window !== t) &&
|
|
8811
|
+
(n.marketId !== e.marketId || n.window !== t) && ie();
|
|
8787
8812
|
const o = n.coverage, a = Number(t.slice(0, -1)) * 2, r = 43200;
|
|
8788
|
-
(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) &&
|
|
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();
|
|
8789
8814
|
let i = -1;
|
|
8790
8815
|
const s = /* @__PURE__ */ new Map();
|
|
8791
8816
|
for (const f of n.points)
|
|
8792
|
-
(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)))) &&
|
|
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;
|
|
8793
8818
|
const l = [], c = [];
|
|
8794
8819
|
for (let f = o.fromBucket; f <= o.throughClosedBucket; f += r) {
|
|
8795
8820
|
const b = s.get(f);
|
|
@@ -8798,70 +8823,55 @@ async function wp(e) {
|
|
|
8798
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";
|
|
8799
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(
|
|
8800
8825
|
(f) => f.rateObservation.status === "unavailable" && f.rateObservation.reason === "legacy-unpinned"
|
|
8801
|
-
).length) &&
|
|
8826
|
+
).length) && ie(), n;
|
|
8802
8827
|
}
|
|
8803
|
-
async function
|
|
8828
|
+
async function Yf(e) {
|
|
8804
8829
|
const t = e.window ?? "1d", n = await vn(
|
|
8805
8830
|
e,
|
|
8806
8831
|
"pool",
|
|
8807
8832
|
t,
|
|
8808
|
-
(o) =>
|
|
8833
|
+
(o) => fp({ ...o, window: t })
|
|
8809
8834
|
);
|
|
8810
8835
|
return Wo(e.expectedAssets, n), n;
|
|
8811
8836
|
}
|
|
8812
|
-
async function
|
|
8837
|
+
async function Jf(e) {
|
|
8813
8838
|
const t = await vn(e, "pool_price_line", "1d", async (n) => {
|
|
8814
8839
|
const o = await yn(
|
|
8815
8840
|
n,
|
|
8816
8841
|
"/v1/engine/markets/{marketId}/candles",
|
|
8817
8842
|
{ window: "1d", basis: "pool", format: "price_line" },
|
|
8818
|
-
|
|
8819
|
-
an,
|
|
8820
|
-
T({
|
|
8821
|
-
schemaVersion: B("1"),
|
|
8822
|
-
history: an,
|
|
8823
|
-
segments: q(T({
|
|
8824
|
-
from: w().int().nonnegative(),
|
|
8825
|
-
to: w().int().nonnegative(),
|
|
8826
|
-
price: w().finite().positive()
|
|
8827
|
-
}).strict()).max(289)
|
|
8828
|
-
}).strict()
|
|
8829
|
-
])
|
|
8843
|
+
mp
|
|
8830
8844
|
), a = "history" in o ? o.history : o;
|
|
8831
|
-
|
|
8832
|
-
let r = -1 / 0;
|
|
8833
|
-
for (const i of o.segments)
|
|
8834
|
-
(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;
|
|
8835
|
-
return { ...a, priceSegments: o.segments };
|
|
8845
|
+
return Ko(n, a, "1d"), "segments" in o ? { ...a, priceSegments: o.segments } : a;
|
|
8836
8846
|
});
|
|
8837
8847
|
return Wo(e.expectedAssets, t), t;
|
|
8838
8848
|
}
|
|
8839
|
-
function
|
|
8849
|
+
function Zf(e) {
|
|
8840
8850
|
return e.freshness.status === "reorg_detected" ? [] : e.priceSegments ? e.priceSegments : e.candles.flatMap((t, n) => {
|
|
8841
8851
|
var i;
|
|
8842
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);
|
|
8843
8853
|
return r >= o ? [{ from: o, to: r, price: t.close }] : [];
|
|
8844
8854
|
});
|
|
8845
8855
|
}
|
|
8846
|
-
async function
|
|
8856
|
+
async function eh(e) {
|
|
8847
8857
|
const t = e.window ?? "7d", n = await vn(
|
|
8848
8858
|
e,
|
|
8849
8859
|
"token_market_reference",
|
|
8850
8860
|
t,
|
|
8851
|
-
(o) =>
|
|
8861
|
+
(o) => hp({ ...o, window: t })
|
|
8852
8862
|
);
|
|
8853
8863
|
return Wo(e.expectedAssets, n), n;
|
|
8854
8864
|
}
|
|
8855
|
-
async function
|
|
8865
|
+
async function th(e) {
|
|
8856
8866
|
const t = e.window ?? "30d";
|
|
8857
8867
|
return vn(
|
|
8858
8868
|
e,
|
|
8859
8869
|
"rates",
|
|
8860
8870
|
t,
|
|
8861
|
-
(n) =>
|
|
8871
|
+
(n) => bp({ ...n, window: t })
|
|
8862
8872
|
);
|
|
8863
8873
|
}
|
|
8864
|
-
function
|
|
8874
|
+
function nh(e) {
|
|
8865
8875
|
const t = [];
|
|
8866
8876
|
let n = 0;
|
|
8867
8877
|
for (const o of e.candles) {
|
|
@@ -8872,7 +8882,7 @@ function t0(e) {
|
|
|
8872
8882
|
}
|
|
8873
8883
|
return t;
|
|
8874
8884
|
}
|
|
8875
|
-
const
|
|
8885
|
+
const kp = 180n, ao = 60n, vp = 6e4, yp = /^[A-Za-z0-9._:-]+$/;
|
|
8876
8886
|
function H(e, t) {
|
|
8877
8887
|
return e.toLowerCase() === t.toLowerCase();
|
|
8878
8888
|
}
|
|
@@ -8892,13 +8902,13 @@ function ue(e, t = /* @__PURE__ */ new WeakMap()) {
|
|
|
8892
8902
|
o[a] = ue(e[a], t);
|
|
8893
8903
|
return Object.freeze(o);
|
|
8894
8904
|
}
|
|
8895
|
-
function
|
|
8905
|
+
function Ep() {
|
|
8896
8906
|
var e, t;
|
|
8897
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)}`;
|
|
8898
8908
|
}
|
|
8899
|
-
function
|
|
8900
|
-
const t = e ??
|
|
8901
|
-
if (t.length < 8 || t.length > 128 || !
|
|
8909
|
+
function Ip(e) {
|
|
8910
|
+
const t = e ?? Ep();
|
|
8911
|
+
if (t.length < 8 || t.length > 128 || !yp.test(t))
|
|
8902
8912
|
throw new TypeError("Engine execution sessionId must be 8-128 URL-safe correlation characters.");
|
|
8903
8913
|
return t;
|
|
8904
8914
|
}
|
|
@@ -8908,7 +8918,7 @@ function Xi(e, t) {
|
|
|
8908
8918
|
function zo(e, t) {
|
|
8909
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);
|
|
8910
8920
|
}
|
|
8911
|
-
function
|
|
8921
|
+
function Ap(e, t) {
|
|
8912
8922
|
if (!zo(e, t)) return [{ kind: "intent-changed" }];
|
|
8913
8923
|
const n = [];
|
|
8914
8924
|
e.walletChainSwitchRequired === !1 && t.walletChainSwitchRequired !== !1 && n.push({ kind: "wallet-chain-switch-added" });
|
|
@@ -8923,22 +8933,22 @@ function Ip(e, t) {
|
|
|
8923
8933
|
function Yi(e, t) {
|
|
8924
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;
|
|
8925
8935
|
}
|
|
8926
|
-
function
|
|
8936
|
+
function gp(e, t) {
|
|
8927
8937
|
return !e || !t ? e !== t : e.daysToLiquidation === "INF" ? t.daysToLiquidation !== "INF" : t.daysToLiquidation === "INF" ? !1 : Math.floor(t.daysToLiquidation) < Math.floor(e.daysToLiquidation);
|
|
8928
8938
|
}
|
|
8929
8939
|
function Xa(e) {
|
|
8930
8940
|
const t = e < 1e4 ? 10 : 100;
|
|
8931
8941
|
return Math.round(e / t) * t;
|
|
8932
8942
|
}
|
|
8933
|
-
function
|
|
8943
|
+
function Sp(e, t) {
|
|
8934
8944
|
if (!Yi(e, t)) return [{ kind: "intent-changed" }];
|
|
8935
8945
|
const n = [];
|
|
8936
8946
|
if (!e.position || !t.position)
|
|
8937
8947
|
return e.position !== t.position && n.push({ kind: "position-availability-changed" }), n;
|
|
8938
8948
|
const o = e.adaptiveFee ?? null, a = t.adaptiveFee ?? null;
|
|
8939
|
-
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" }),
|
|
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;
|
|
8940
8950
|
}
|
|
8941
|
-
function
|
|
8951
|
+
function Cp(e) {
|
|
8942
8952
|
const { intent: t, reviewed: n } = e;
|
|
8943
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))
|
|
8944
8954
|
throw new TypeError("Engine execution context does not match this trade intent.");
|
|
@@ -8954,11 +8964,11 @@ function Sp(e) {
|
|
|
8954
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)
|
|
8955
8965
|
throw new TypeError("Reviewed Engine plan or quote does not match this trade intent.");
|
|
8956
8966
|
}
|
|
8957
|
-
function
|
|
8967
|
+
function xp(e) {
|
|
8958
8968
|
const t = e && typeof e == "object" ? e.hash : null;
|
|
8959
8969
|
return typeof t == "string" && /^0x[0-9a-fA-F]{64}$/.test(t) ? t : null;
|
|
8960
8970
|
}
|
|
8961
|
-
function
|
|
8971
|
+
function Tp(e) {
|
|
8962
8972
|
const t = Object.freeze({
|
|
8963
8973
|
provider: e.wallet.provider,
|
|
8964
8974
|
account: e.wallet.account
|
|
@@ -9029,7 +9039,7 @@ function xp(e) {
|
|
|
9029
9039
|
leverage: r.leverage,
|
|
9030
9040
|
slippageBps: r.slippageBps,
|
|
9031
9041
|
maxPriceImpactBps: r.maxPriceImpactBps,
|
|
9032
|
-
deadline: BigInt(Math.floor(Date.now() / 1e3)) +
|
|
9042
|
+
deadline: BigInt(Math.floor(Date.now() / 1e3)) + kp,
|
|
9033
9043
|
forceExecutionEvidenceRefresh: !0,
|
|
9034
9044
|
signal: i
|
|
9035
9045
|
});
|
|
@@ -9060,33 +9070,33 @@ function xp(e) {
|
|
|
9060
9070
|
});
|
|
9061
9071
|
},
|
|
9062
9072
|
checkReceipt(r, i, s) {
|
|
9063
|
-
return Is({ publicClient: n, hash: s, timeoutMs:
|
|
9073
|
+
return Is({ publicClient: n, hash: s, timeoutMs: vp });
|
|
9064
9074
|
}
|
|
9065
9075
|
};
|
|
9066
9076
|
}
|
|
9067
|
-
function
|
|
9068
|
-
return
|
|
9077
|
+
function oh(e) {
|
|
9078
|
+
return Rp(
|
|
9069
9079
|
e,
|
|
9070
|
-
|
|
9080
|
+
Tp(e)
|
|
9071
9081
|
);
|
|
9072
9082
|
}
|
|
9073
|
-
function
|
|
9074
|
-
|
|
9075
|
-
const n = ue(e.intent), o = e.onChange, a =
|
|
9083
|
+
function Rp(e, t) {
|
|
9084
|
+
Cp(e);
|
|
9085
|
+
const n = ue(e.intent), o = e.onChange, a = Ip(e.sessionId);
|
|
9076
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;
|
|
9077
|
-
const F = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), ee = [], X = [],
|
|
9087
|
+
const F = /* @__PURE__ */ new Set(), L = /* @__PURE__ */ new Set(), ee = [], X = [], ne = /* @__PURE__ */ new Map(), Te = (v) => {
|
|
9078
9088
|
s = ue(v);
|
|
9079
9089
|
for (const I of s.steps) {
|
|
9080
9090
|
X.includes(I.kind) || X.push(I.kind);
|
|
9081
|
-
const R =
|
|
9082
|
-
I.status === "satisfied" ? (
|
|
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 });
|
|
9083
9093
|
}
|
|
9084
9094
|
};
|
|
9085
9095
|
Te(s);
|
|
9086
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 = () => {
|
|
9087
9097
|
const v = Object.freeze(
|
|
9088
9098
|
X.flatMap((ke) => {
|
|
9089
|
-
const se =
|
|
9099
|
+
const se = ne.get(ke);
|
|
9090
9100
|
return se ? [Object.freeze({ ...se })] : [];
|
|
9091
9101
|
})
|
|
9092
9102
|
), I = h ? v.find((ke) => ke.kind === h) ?? null : null, R = p ? Object.freeze({
|
|
@@ -9130,13 +9140,13 @@ function Tp(e, t) {
|
|
|
9130
9140
|
} catch {
|
|
9131
9141
|
}
|
|
9132
9142
|
}, U = (v, I, R) => {
|
|
9133
|
-
X.includes(v) || X.push(v),
|
|
9134
|
-
},
|
|
9143
|
+
X.includes(v) || X.push(v), ne.set(v, { kind: v, status: I, hash: R });
|
|
9144
|
+
}, oe = (v, I) => {
|
|
9135
9145
|
ee.some((R) => R.kind === v && R.hash === I) || ee.push({ kind: v, hash: I });
|
|
9136
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) => {
|
|
9137
9147
|
var _;
|
|
9138
|
-
return R ? "confirmation" : !I || ((_ =
|
|
9139
|
-
}, St = (v, I = h, R = f ??
|
|
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)) => {
|
|
9140
9150
|
const _ = Za(v, "Engine trade did not complete.");
|
|
9141
9151
|
m = {
|
|
9142
9152
|
..._,
|
|
@@ -9158,7 +9168,7 @@ function Tp(e, t) {
|
|
|
9158
9168
|
}, Re = async (v, I = {}) => {
|
|
9159
9169
|
const R = await t.readPlan(n, v);
|
|
9160
9170
|
v.throwIfAborted(), Kt(R);
|
|
9161
|
-
const _ =
|
|
9171
|
+
const _ = Ap(r, R);
|
|
9162
9172
|
return _.length ? (Ct("permissions", _, R, l), P == null || P.abort(new Error("review-required")), !1) : (Te(R), I.publishResult !== !1 && $(), !0);
|
|
9163
9173
|
}, xt = (v) => {
|
|
9164
9174
|
if (v === "open-position") return s.readyForOpen && r.steps.some((_) => _.kind === v);
|
|
@@ -9179,7 +9189,7 @@ function Tp(e, t) {
|
|
|
9179
9189
|
const v = P == null ? void 0 : P.signal;
|
|
9180
9190
|
if (!v) throw new Error("Engine execution checkpoint has no active command.");
|
|
9181
9191
|
const I = h, R = f;
|
|
9182
|
-
await Re(v) && I && R && (U(I, "confirmed", R), L.add(I),
|
|
9192
|
+
await Re(v) && I && R && (U(I, "confirmed", R), L.add(I), oe(I, R), h = null, f = null, $());
|
|
9183
9193
|
}
|
|
9184
9194
|
}, st = async (v) => {
|
|
9185
9195
|
let I = await t.quote(n, v);
|
|
@@ -9197,21 +9207,21 @@ function Tp(e, t) {
|
|
|
9197
9207
|
h = "vault-operator";
|
|
9198
9208
|
const se = await t.authorizeVault(n, Ke, v);
|
|
9199
9209
|
if (se.receipt.status !== "success") throw new D("Vault authorization reverted on-chain.", { kind: "tx-reverted" });
|
|
9200
|
-
if (E = se.hash, U("vault-operator", "confirmed", se.hash), L.add("vault-operator"),
|
|
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();
|
|
9201
9211
|
}
|
|
9202
9212
|
if (s.steps.some(
|
|
9203
9213
|
(se) => se.kind !== "vault-operator" && se.kind !== "open-position" && se.status === "required"
|
|
9204
9214
|
) && (await t.authorizeToken(n, Ke, v), v.throwIfAborted(), !await Re(v)))
|
|
9205
9215
|
return z();
|
|
9206
9216
|
if (!s.readyForOpen) throw new D("Required permissions are still missing.", { kind: "validation", retryable: !0 });
|
|
9207
|
-
const _ = await st(v), Ie =
|
|
9217
|
+
const _ = await st(v), Ie = Sp(i, _);
|
|
9208
9218
|
if (Ie.length)
|
|
9209
9219
|
return Ct("quote", Ie, s, _), z();
|
|
9210
9220
|
l = ue(_), h = "open-position";
|
|
9211
9221
|
const _e = await t.sendOpen(n, l, Ke, v);
|
|
9212
9222
|
if (_e.receipt.status !== "success") throw new D("Engine transaction reverted on-chain.", { kind: "tx-reverted" });
|
|
9213
9223
|
const ke = _e.hash;
|
|
9214
|
-
E = ke, y = ue(_e.summary), U("open-position", "confirmed", ke),
|
|
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" }, $();
|
|
9215
9225
|
} catch (R) {
|
|
9216
9226
|
if (Ee()) return z();
|
|
9217
9227
|
v.aborted && !f ? (c = "cancelled", m = {
|
|
@@ -9220,7 +9230,7 @@ function Tp(e, t) {
|
|
|
9220
9230
|
retryable: !1,
|
|
9221
9231
|
step: h,
|
|
9222
9232
|
hash: null,
|
|
9223
|
-
failurePhase: h && ((I =
|
|
9233
|
+
failurePhase: h && ((I = ne.get(h)) == null ? void 0 : I.status) === "wallet-requested" ? "wallet-request" : "preparation"
|
|
9224
9234
|
}, u = { kind: "none" }, h && U(h, "cancelled", null), h = null, $()) : St(R);
|
|
9225
9235
|
}
|
|
9226
9236
|
return z();
|
|
@@ -9251,7 +9261,7 @@ function Tp(e, t) {
|
|
|
9251
9261
|
b || I.status === "cancelled" ? "Engine transaction was cancelled in the wallet." : "Engine transaction reverted on-chain.",
|
|
9252
9262
|
{ kind: b || I.status === "cancelled" ? "tx-cancelled" : "tx-reverted", retryable: !0 }
|
|
9253
9263
|
), v, I.hash), z();
|
|
9254
|
-
if (U(v, "confirmed", I.hash),
|
|
9264
|
+
if (U(v, "confirmed", I.hash), oe(v, I.hash), h = null, f = null, m = null, v === "open-position")
|
|
9255
9265
|
y = ue(Ur(I.receipt)), c = "success", u = { kind: "none" }, $();
|
|
9256
9266
|
else {
|
|
9257
9267
|
L.add(v), c = "resume-required", u = { kind: "resume-remaining" };
|
|
@@ -9327,14 +9337,14 @@ const _n = S().regex(/^[0-9]+$/), Ji = T({
|
|
|
9327
9337
|
inputBasis: B("pool-input-plus-hook-input-fee")
|
|
9328
9338
|
})
|
|
9329
9339
|
})
|
|
9330
|
-
}),
|
|
9340
|
+
}), Pp = T({
|
|
9331
9341
|
schemaVersion: B("1"),
|
|
9332
9342
|
chainId: w().int(),
|
|
9333
9343
|
txHash: qn,
|
|
9334
9344
|
account: je,
|
|
9335
9345
|
status: B("unavailable")
|
|
9336
|
-
}).loose(),
|
|
9337
|
-
async function
|
|
9346
|
+
}).loose(), ah = uo([Ji, Pp]);
|
|
9347
|
+
async function rh({ source: e, position: t, strategy: n, signal: o }) {
|
|
9338
9348
|
var s;
|
|
9339
9349
|
if (!t.token0 || !t.token1) return null;
|
|
9340
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." });
|
|
@@ -9368,21 +9378,21 @@ async function a0({ source: e, position: t, strategy: n, signal: o }) {
|
|
|
9368
9378
|
}
|
|
9369
9379
|
}
|
|
9370
9380
|
export {
|
|
9371
|
-
|
|
9372
|
-
|
|
9381
|
+
ch as AEGIS_BACKEND_PROD_BASE_URL,
|
|
9382
|
+
Op as AEGIS_DYNAMIC_FEE_FLAG,
|
|
9373
9383
|
Rs as AEGIS_SWAP_BSC_CHAIN,
|
|
9374
9384
|
we as AEGIS_SWAP_BSC_CHAIN_ID,
|
|
9375
|
-
|
|
9385
|
+
qp as AEGIS_SWAP_BSC_HOOK,
|
|
9376
9386
|
nr as AEGIS_SWAP_BSC_ROUTER,
|
|
9377
9387
|
ir as AEGIS_SWAP_BSC_RPC_URLS,
|
|
9378
|
-
|
|
9388
|
+
Lp as AEGIS_SWAP_BSC_TOKENS,
|
|
9379
9389
|
ho as AEGIS_SWAP_CHAINS,
|
|
9380
9390
|
Q as AEGIS_SWAP_CHAIN_ID,
|
|
9381
9391
|
ar as AEGIS_SWAP_DEFAULT_FEE_BPS,
|
|
9382
9392
|
mo as AEGIS_SWAP_DEFAULT_FEE_RECIPIENT,
|
|
9383
9393
|
sr as AEGIS_SWAP_DEFAULT_METADATA_ENDPOINT,
|
|
9384
9394
|
rr as AEGIS_SWAP_DEFAULT_RPC_URLS,
|
|
9385
|
-
|
|
9395
|
+
Np as AEGIS_SWAP_HOOK,
|
|
9386
9396
|
Ts as AEGIS_SWAP_MAINNET_CHAIN,
|
|
9387
9397
|
po as AEGIS_SWAP_MAINNET_UNISWAP_V4_CONTRACTS,
|
|
9388
9398
|
Un as AEGIS_SWAP_PERMIT2,
|
|
@@ -9390,15 +9400,15 @@ export {
|
|
|
9390
9400
|
mt as AEGIS_SWAP_TOKENS,
|
|
9391
9401
|
or as AEGIS_SWAP_TRUSTED_ROUTERS_BY_CHAIN,
|
|
9392
9402
|
xs as AEGIS_SWAP_V4_QUOTER,
|
|
9393
|
-
|
|
9403
|
+
Vp as AGGREGATED_SWAP_CURATED_TOKENS,
|
|
9394
9404
|
wo as AGGREGATED_SWAP_DEFAULT_TOKENS,
|
|
9395
9405
|
Ms as AGGREGATED_SWAP_DEFAULT_TOKEN_LIST,
|
|
9396
9406
|
Cs as AGGREGATED_SWAP_SUPPORTED_CHAIN_IDS,
|
|
9397
|
-
|
|
9407
|
+
Up as AGGREGATED_SWAP_TOKEN_PRESETS,
|
|
9398
9408
|
Bs as AGGREGATED_SWAP_WOLFGAME_TOKENS,
|
|
9399
9409
|
Ds as AGGREGATED_SWAP_WOLFGAME_TOKEN_LIST,
|
|
9400
9410
|
ys as AegisBackendApiError,
|
|
9401
|
-
|
|
9411
|
+
lh as AegisBackendContractError,
|
|
9402
9412
|
Me as AegisContractGuardError,
|
|
9403
9413
|
Xo as AegisEngineAccountReadError,
|
|
9404
9414
|
ce as AegisEngineMarketDataReadError,
|
|
@@ -9409,9 +9419,9 @@ export {
|
|
|
9409
9419
|
Zo as DIRECT_SWAP_MARKET_TRUST_RULE_ID,
|
|
9410
9420
|
ma as DirectPoolSwapPriceMovedError,
|
|
9411
9421
|
ko as DirectSwapMarketTrustError,
|
|
9412
|
-
|
|
9413
|
-
|
|
9414
|
-
|
|
9422
|
+
pp as ENGINE_MARKET_SERIES_TTL_MS,
|
|
9423
|
+
dh as ENGINE_PORTFOLIO_CHAIN_IDS,
|
|
9424
|
+
zp as ENGINE_UTILIZATION_CAP_PCT,
|
|
9415
9425
|
yr as KyberSwapApiError,
|
|
9416
9426
|
vo as KyberSwapContractError,
|
|
9417
9427
|
ld as KyberSwapPriceMovedError,
|
|
@@ -9421,48 +9431,48 @@ export {
|
|
|
9421
9431
|
ye as MAX_UINT256,
|
|
9422
9432
|
io as NATIVE_TOKEN_ADDRESS,
|
|
9423
9433
|
Dr as PERMIT2_FAR_FUTURE_EXPIRATION,
|
|
9424
|
-
|
|
9425
|
-
|
|
9426
|
-
|
|
9427
|
-
|
|
9434
|
+
uh as PortfolioPageQuerySchema,
|
|
9435
|
+
mh as PortfolioPageSchema,
|
|
9436
|
+
ph as PortfolioQuerySchema,
|
|
9437
|
+
fh as PortfolioResponseSchema,
|
|
9428
9438
|
sl as SDK_RPC_MULTICALL_RULE_ID,
|
|
9429
9439
|
Eo as SWAP_TX_DEADLINE_SECONDS,
|
|
9430
|
-
|
|
9431
|
-
|
|
9440
|
+
hh as SubmittedTransactionReceiptError,
|
|
9441
|
+
wh as TransactionReceiptTimeoutError,
|
|
9432
9442
|
Ze as UNISWAP_V4_CONTRACTS_BY_CHAIN,
|
|
9433
9443
|
Kn as UNLIMITED_ERC20_FLOOR,
|
|
9434
9444
|
vl as UNLIMITED_PERMIT2_FLOOR,
|
|
9435
|
-
|
|
9445
|
+
bh as USER_REJECTED_MESSAGE,
|
|
9436
9446
|
D as UserFacingError,
|
|
9437
|
-
|
|
9447
|
+
kh as aegisBackendAddressAllowlistSchema,
|
|
9438
9448
|
W as aegisBackendAddressSchema,
|
|
9439
|
-
|
|
9440
|
-
|
|
9441
|
-
|
|
9442
|
-
|
|
9443
|
-
|
|
9444
|
-
|
|
9449
|
+
vh as aegisBackendAllowlistsByChainSchema,
|
|
9450
|
+
yh as aegisBackendChainIdSchema,
|
|
9451
|
+
Eh as aegisBackendChainSchema,
|
|
9452
|
+
Ih as aegisBackendConfigSchema,
|
|
9453
|
+
Ah as aegisBackendContractRegistrySchema,
|
|
9454
|
+
gh as aegisBackendContractsByChainSchema,
|
|
9445
9455
|
le as aegisBackendDecimalStringSchema,
|
|
9446
|
-
|
|
9447
|
-
|
|
9456
|
+
Sh as aegisBackendFeeConfigSchema,
|
|
9457
|
+
Ch as aegisBackendHealthResponseSchema,
|
|
9448
9458
|
so as aegisBackendHexSchema,
|
|
9449
9459
|
Se as aegisBackendIsoDateTimeSchema,
|
|
9450
|
-
|
|
9451
|
-
|
|
9452
|
-
|
|
9453
|
-
|
|
9454
|
-
|
|
9455
|
-
|
|
9456
|
-
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
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,
|
|
9463
9473
|
cd as approveDirectPoolSwapInput,
|
|
9464
|
-
|
|
9465
|
-
|
|
9474
|
+
Uf as approveEnginePermit2ToRouter,
|
|
9475
|
+
Lf as approveEngineTokenToPermit2,
|
|
9466
9476
|
Tl as approveErc20Spender,
|
|
9467
9477
|
_r as approveErc20ToPermit2,
|
|
9468
9478
|
ud as approveKyberSwapInput,
|
|
@@ -9478,9 +9488,9 @@ export {
|
|
|
9478
9488
|
xo as assertTrustedEngineMarket,
|
|
9479
9489
|
Dt as assertUint128,
|
|
9480
9490
|
lu as attachEngineActivityLotDisplays,
|
|
9481
|
-
|
|
9491
|
+
Vf as authorizeEnginePositionRouter,
|
|
9482
9492
|
$m as authorizeEngineVaultOperator,
|
|
9483
|
-
|
|
9493
|
+
$p as authorizeHostDirectSwapMarket,
|
|
9484
9494
|
gd as backendTokenToAegisSwapToken,
|
|
9485
9495
|
Sd as backendTokensToAegisSwapTokens,
|
|
9486
9496
|
js as buildExactInSwapTransaction,
|
|
@@ -9489,142 +9499,143 @@ export {
|
|
|
9489
9499
|
Bl as buildSignedPermitBatch,
|
|
9490
9500
|
li as classifyEngineVaultActivity,
|
|
9491
9501
|
Za as classifyError,
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
|
|
9499
|
-
|
|
9500
|
-
|
|
9501
|
-
|
|
9502
|
-
|
|
9503
|
-
|
|
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,
|
|
9504
9514
|
He as computePoolId,
|
|
9505
|
-
|
|
9515
|
+
Lh as createAegisBackendApiClient,
|
|
9506
9516
|
cr as createAegisSwapChainConfig,
|
|
9507
|
-
|
|
9508
|
-
|
|
9509
|
-
|
|
9517
|
+
Fp as createAegisSwapChains,
|
|
9518
|
+
df as createAegisSwapChainsFromBackendConfig,
|
|
9519
|
+
Hp as createAegisSwapMarketsFromPools,
|
|
9510
9520
|
Ys as createAegisSwapPoolMarket,
|
|
9511
|
-
|
|
9521
|
+
uf as createAegisSwapPoolsFromBackendMarkets,
|
|
9512
9522
|
Ae as createAegisSwapUniswapV4Contracts,
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9523
|
+
oh as createEngineTradeOpenExecutionSession,
|
|
9524
|
+
Uh as createEngineTransactionHistory,
|
|
9525
|
+
jp as createSwapPublicClient,
|
|
9516
9526
|
cu as deriveEngineActivityLotDisplay,
|
|
9517
|
-
|
|
9518
|
-
|
|
9519
|
-
|
|
9520
|
-
|
|
9521
|
-
|
|
9522
|
-
|
|
9527
|
+
Qf as deriveEngineTradePositionStrategy,
|
|
9528
|
+
Vh as engineAccountPositionKey,
|
|
9529
|
+
Hh as engineAccountTransactionKey,
|
|
9530
|
+
Ap as engineAuthorizationPlanReviewReasons,
|
|
9531
|
+
$h as engineHistoryCatalogResponseSchema,
|
|
9532
|
+
Kf as engineIdleWithdrawPassesResidualLtv,
|
|
9523
9533
|
an as engineMarketCandlesResponseSchema,
|
|
9524
9534
|
Co as engineMarketIdSchema,
|
|
9525
9535
|
Td as engineMarketsRestResponseSchema,
|
|
9526
9536
|
Rd as engineMarketsV2RestResponseSchema,
|
|
9527
9537
|
Bd as engineMetricHistoryRestResponseSchema,
|
|
9528
9538
|
Md as engineMetricHistoryV2RestResponseSchema,
|
|
9529
|
-
|
|
9539
|
+
ah as engineOpeningExecutionResponseSchema,
|
|
9530
9540
|
Jt as enginePermit2GrantSatisfies,
|
|
9531
|
-
|
|
9532
|
-
|
|
9533
|
-
|
|
9541
|
+
mp as enginePoolPriceLineResponseSchema,
|
|
9542
|
+
Zf as enginePoolPriceSegments,
|
|
9543
|
+
Wh as enginePortfolioPriceFor,
|
|
9544
|
+
Kh as enginePositionAccountingResponseSchema,
|
|
9534
9545
|
ou as enginePositionActivityRestResponseSchema,
|
|
9535
|
-
|
|
9536
|
-
|
|
9537
|
-
|
|
9546
|
+
zh as enginePositionHistoryResponseSchema,
|
|
9547
|
+
Gh as enginePositionPerformanceResponseSchema,
|
|
9548
|
+
jh as enginePositionPnlResponseSchema,
|
|
9538
9549
|
qd as enginePositionsRestResponseSchema,
|
|
9539
9550
|
Ud as enginePositionsV2RestResponseSchema,
|
|
9540
|
-
|
|
9541
|
-
|
|
9551
|
+
Wf as enginePreviewMaxLtvPips,
|
|
9552
|
+
Gp as engineRouterForChain,
|
|
9542
9553
|
Dm as engineTokenGrantSatisfies,
|
|
9543
|
-
|
|
9544
|
-
|
|
9554
|
+
Sp as engineTradeQuoteReviewReasons,
|
|
9555
|
+
Qh as engineTransactionStorageKey,
|
|
9545
9556
|
$e as ensureWalletChain,
|
|
9546
9557
|
ad as erc20ApprovalRequest,
|
|
9547
9558
|
fs as errorMessage,
|
|
9548
9559
|
Fr as estimateSwapGasWithBuffer,
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9560
|
+
af as executeDirectPoolSwap,
|
|
9561
|
+
$f as executeEngineBalancedDeposit,
|
|
9562
|
+
rf as executeKyberSwap,
|
|
9563
|
+
Rf as executionLtvGuardPips,
|
|
9553
9564
|
la as fetchAggregatedSwapQuote,
|
|
9554
9565
|
pa as fetchDirectPoolSwapQuote,
|
|
9555
|
-
|
|
9556
|
-
|
|
9557
|
-
|
|
9558
|
-
|
|
9559
|
-
|
|
9560
|
-
|
|
9561
|
-
|
|
9562
|
-
|
|
9563
|
-
|
|
9564
|
-
|
|
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,
|
|
9565
9576
|
wi as fetchEnginePositionActivitySnapshot,
|
|
9566
|
-
|
|
9567
|
-
|
|
9568
|
-
|
|
9569
|
-
|
|
9570
|
-
|
|
9571
|
-
|
|
9577
|
+
Zh as fetchEnginePositionHistory,
|
|
9578
|
+
Sf as fetchEnginePositionsSnapshot,
|
|
9579
|
+
th as fetchEngineRateHistory,
|
|
9580
|
+
e0 as fetchEngineTransactionStatus,
|
|
9581
|
+
Cf as fetchEngineVaultActivity,
|
|
9582
|
+
Yp as fetchGlobalTokenMetadata,
|
|
9572
9583
|
Cc as fetchKyberSwapRoute,
|
|
9573
|
-
|
|
9574
|
-
|
|
9584
|
+
ef as fetchTokenPriceHistory,
|
|
9585
|
+
t0 as formatEngineAccountTokenAmount,
|
|
9575
9586
|
fo as getExplorerUrl,
|
|
9576
9587
|
cl as getInjectedProvider,
|
|
9577
9588
|
ul as getProviderAccount,
|
|
9578
9589
|
_t as getProviderChainId,
|
|
9579
9590
|
lc as getZeroForOne,
|
|
9580
|
-
|
|
9581
|
-
|
|
9591
|
+
n0 as groupEngineAccountActivity,
|
|
9592
|
+
o0 as groupEnginePortfolioPositions,
|
|
9582
9593
|
ln as hasUsablePermit2Allowance,
|
|
9583
|
-
|
|
9584
|
-
|
|
9594
|
+
jf as isAegisEngineTradePositionIntent,
|
|
9595
|
+
sf as isBusy,
|
|
9585
9596
|
br as isDirectSwapMarketTrusted,
|
|
9586
|
-
|
|
9597
|
+
tf as isDocumentVisible,
|
|
9587
9598
|
ll as isEip1193Provider,
|
|
9588
9599
|
Ce as isNativeAssetAddress,
|
|
9589
9600
|
jr as isNativeToken,
|
|
9590
|
-
|
|
9601
|
+
a0 as isRetryableAegisBackendApiError,
|
|
9591
9602
|
Cr as isRetryableKyberSwapError,
|
|
9592
|
-
|
|
9603
|
+
r0 as isSubmittedTransactionReceiptError,
|
|
9593
9604
|
yl as isUnlimitedErc20Approval,
|
|
9594
9605
|
El as isUnlimitedPermit2Approval,
|
|
9595
9606
|
vs as isUserRejectedError,
|
|
9596
|
-
|
|
9597
|
-
|
|
9607
|
+
i0 as mergeEngineTransactionRecord,
|
|
9608
|
+
Hf as missingEngineExecutionReason,
|
|
9598
9609
|
cn as normalizeAccount,
|
|
9599
9610
|
Lt as normalizeAegisBackendBaseUrl,
|
|
9600
9611
|
xn as normalizeEngineMarkets,
|
|
9601
9612
|
dl as normalizeWalletConnection,
|
|
9602
9613
|
pc as outputFeeForQuote,
|
|
9603
9614
|
il as parseEngineDeploymentManifest,
|
|
9604
|
-
|
|
9605
|
-
|
|
9615
|
+
s0 as parseEngineTransactionRecords,
|
|
9616
|
+
Zp as peekTokenPriceHistory,
|
|
9606
9617
|
dn as pollUntil,
|
|
9607
9618
|
Ni as prepareEnginePermit,
|
|
9608
|
-
|
|
9609
|
-
|
|
9619
|
+
cf as progressRailSteps,
|
|
9620
|
+
Mf as quoteEngineAddCollateral,
|
|
9610
9621
|
Wa as quoteEngineBalancedDeposit,
|
|
9611
|
-
|
|
9612
|
-
|
|
9613
|
-
|
|
9614
|
-
|
|
9615
|
-
|
|
9616
|
-
|
|
9617
|
-
|
|
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,
|
|
9618
9629
|
Rm as quoteEngineTradeOpen,
|
|
9619
9630
|
ta as quoteSpendAmount,
|
|
9620
9631
|
Zu as readEngineAdaptiveFeeEvidence,
|
|
9621
9632
|
Vm as readEngineAuthorizationPlan,
|
|
9622
9633
|
Bo as readEngineBorrowQuoteContext,
|
|
9623
9634
|
Au as readEngineLendQuoteContext,
|
|
9624
|
-
|
|
9635
|
+
pf as readEngineMarketMark,
|
|
9625
9636
|
Iu as readEngineMarketSnapshot,
|
|
9626
|
-
|
|
9627
|
-
|
|
9637
|
+
ff as readEnginePositionsHydration,
|
|
9638
|
+
hf as readEngineVaultActivity,
|
|
9628
9639
|
Hm as readEngineVaultRouterApproved,
|
|
9629
9640
|
Vt as readErc20Allowance,
|
|
9630
9641
|
nt as readPermit2RouterAllowance,
|
|
@@ -9632,23 +9643,23 @@ export {
|
|
|
9632
9643
|
Is as reconcileSubmittedReceipt,
|
|
9633
9644
|
ml as requestProviderAccount,
|
|
9634
9645
|
un as requiresErc20ApprovalReset,
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9646
|
+
c0 as resolveEngineAccountPositionTarget,
|
|
9647
|
+
Ff as resolveEngineBorrowCollateralFloor,
|
|
9648
|
+
Xp as resolveTokenIconUrl,
|
|
9649
|
+
of as resolveWalletSession,
|
|
9650
|
+
nf as retryOnError,
|
|
9640
9651
|
Ht as sameEngineMarketId,
|
|
9641
|
-
|
|
9652
|
+
Wp as sameQuote,
|
|
9642
9653
|
kn as sendEngineTransaction,
|
|
9643
|
-
|
|
9644
|
-
|
|
9645
|
-
|
|
9654
|
+
l0 as serializeEngineTransactionRecords,
|
|
9655
|
+
nh as splitEngineMarketCandleSegments,
|
|
9656
|
+
Qp as subscribeProvider,
|
|
9646
9657
|
Wu as summarizeEngineLendShareGrowth,
|
|
9647
|
-
|
|
9658
|
+
Tf as summarizeEngineSimpleYieldPosition,
|
|
9648
9659
|
Ur as summarizeTransactionReceipt,
|
|
9649
9660
|
kl as switchProviderChain,
|
|
9650
9661
|
Gl as tokenPriceHistoryRestResponseSchema,
|
|
9651
|
-
|
|
9662
|
+
lf as transactionProgressView,
|
|
9652
9663
|
fd as transactionSequenceProgress,
|
|
9653
9664
|
de as trustedEngineRegistryForChain,
|
|
9654
9665
|
kt as trustedEngineVersionForChain,
|