@orbs-network/spot-ui 1.0.21 → 1.0.22
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/spot-ui.js +403 -396
- package/dist/spot-ui.umd.cjs +8 -8
- package/dist/src/lib/consts.d.ts.map +1 -1
- package/dist/src/lib/orders/v1-orders.d.ts.map +1 -1
- package/dist/src/lib/orders/v2-orders.d.ts.map +1 -1
- package/dist/src/lib/submit-order.d.ts.map +1 -1
- package/dist/src/lib/types.d.ts +2 -1
- package/dist/src/lib/types.d.ts.map +1 -1
- package/package.json +2 -2
package/dist/spot-ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var it = Object.defineProperty;
|
|
2
|
-
var ot = (e, a,
|
|
3
|
-
var Ce = (e, a,
|
|
2
|
+
var ot = (e, a, r) => a in e ? it(e, a, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[a] = r;
|
|
3
|
+
var Ce = (e, a, r) => ot(e, typeof a != "symbol" ? a + "" : a, r);
|
|
4
4
|
const dt = { chainName: "ftm", chainId: 250, twapVersion: 4, twapAddress: "0xd3B290FEB04E353d1821bc0a12397FdEa9a846C0", lensAddress: "0x0221EfDF1Fd3212AF87F23cceB7693a65fAF1d7f", takers: ["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913", "0x504f6E10173249dD22491829D98862Cf81DeF79E"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "SpookySwap", partner: "Orbs:TWAP:SpookySwap", exchangeAddress: "0xdF7CCd5fc7077E9de5f27a7b7bfDC837c82f8496", exchangeType: "ExchangeV2", pathfinderKey: "" }, ct = { chainName: "sonic", chainId: 146, twapVersion: 4, twapAddress: "0x8963992816b4EafE5a22b7DB2A99513c18be9afA", lensAddress: "0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D", takers: ["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913", "0x504f6E10173249dD22491829D98862Cf81DeF79E"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "SpookySwapSonic", partner: "Orbs:TWAP:SpookySwap", exchangeAddress: "0x6699bE3aF75e5c1B807b1031dBde6dA9A67739F3", exchangeType: "ExchangeV2", pathfinderKey: "" }, pt = { chainName: "poly", chainId: 137, twapVersion: 4, twapAddress: "0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4", lensAddress: "0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "QuickSwap", partner: "Orbs:TWAP:QuickSwap", exchangeAddress: "0x8FCc245209bE85C49D738D0CE5613F74E5d91E86", exchangeType: "ParaswapExchange", pathfinderKey: "QuickSwap,QuickSwapV3" }, lt = { chainName: "base", chainId: 8453, twapVersion: 4, twapAddress: "0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55", lensAddress: "0x6313188c1909b161074D62E43105faC9B756A23e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "QuickSwap", partner: "Orbs:TWAP:QuickSwap", exchangeAddress: "0xb7a3d74895bfd3aff6780525e36d79fcf26a895f", exchangeType: "ExchangeV2", pathfinderKey: "" }, ut = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "Chronos", partner: "Orbs:TWAP:Chronos", exchangeAddress: "0x0178e50adAF3b925F27aC518FCd952CE7F9A3B36", exchangeType: "ExchangeV2", pathfinderKey: "Chronos Stable,Chronos Volatile,Chronos V3" }, ft = { chainName: "base", chainId: 8453, twapVersion: 4, twapAddress: "0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55", lensAddress: "0x6313188c1909b161074D62E43105faC9B756A23e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "BaseSwap", partner: "Orbs:TWAP:BaseSwap", exchangeAddress: "0xAca3155c17530C4aA96746F226fcC049658490d2", exchangeType: "ExchangeV2", pathfinderKey: "BaseSwap,BaseSwapX" }, mt = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "Arbidex", partner: "Orbs:TWAP:Arbidex", exchangeAddress: "0x49d21052f4695d16C7cce6eF561301Aa4d840420", exchangeType: "ExchangeV2", pathfinderKey: "Arbidex Classic,Arbidex Quantum" }, At = { chainName: "bsc", chainId: 56, twapVersion: 4, twapAddress: "0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994", lensAddress: "0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "Thena", partner: "Orbs:TWAP:Thena", exchangeAddress: "0x2B2fABDbfa4a15da0d351F947C14F4520db0bDc1", exchangeType: "ExchangeV2", pathfinderKey: "43,47" }, bt = { chainName: "bsc", chainId: 56, twapVersion: 4, twapAddress: "0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994", lensAddress: "0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "PancakeSwap", partner: "Orbs:TWAP:PancakeSwap", exchangeAddress: "0x1A2bb6B75D58b740d88413ef4840D6fa3F637940", exchangeType: "P2Exchange", pathfinderKey: "" }, yt = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "PancakeSwap", partner: "Orbs:TWAP:PancakeSwap", exchangeAddress: "0xb37cB9A058c03081Ae6EF934313588cD53d408e7", exchangeType: "P2Exchange", pathfinderKey: "" }, ht = { chainName: "base", chainId: 8453, twapVersion: 4, twapAddress: "0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55", lensAddress: "0x6313188c1909b161074D62E43105faC9B756A23e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "PancakeSwap", partner: "Orbs:TWAP:PancakeSwap", exchangeAddress: "0xb37cB9A058c03081Ae6EF934313588cD53d408e7", exchangeType: "P2Exchange", pathfinderKey: "" }, Et = { chainName: "linea", chainId: 59144, twapVersion: 4, twapAddress: "0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78", lensAddress: "0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 100, name: "PancakeSwap", partner: "Orbs:TWAP:PancakeSwap", exchangeAddress: "0xb37cB9A058c03081Ae6EF934313588cD53d408e7", exchangeType: "P2Exchange", pathfinderKey: "" }, xt = { chainName: "linea", chainId: 59144, twapVersion: 4, twapAddress: "0x48423e62acbfEF7779b5b4a5E7d6Fbd39E623d78", lensAddress: "0xe84CaEc86eCF3f0AB4267dC6130D9a5510e73DFb", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 100, name: "Lynex", partner: "Orbs:TWAP:Lynex", exchangeAddress: "0x04C06C96d7D19977156016DD408B5992af0570a2", exchangeType: "ExchangeV2", pathfinderKey: "19,18" }, gt = { chainName: "zkSync", chainId: 324, twapVersion: 4, twapAddress: "0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68", lensAddress: "0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9", takers: ["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC", "0xBE452F03Be354CAC397C3F0c8397672067D44531"], bidDelaySeconds: 60, minChunkSizeUsd: 100, name: "SyncSwap", partner: "Orbs:TWAP:SyncSwap", exchangeAddress: "0x422623a40c42f026Ed33A9910078Aa843FD66e27", exchangeType: "ExchangeV2", pathfinderKey: "2,3" }, Ct = { chainName: "poly", chainId: 137, twapVersion: 4, twapAddress: "0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4", lensAddress: "0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "Retro", partner: "Orbs:TWAP:Retro", exchangeAddress: "0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F", exchangeType: "ExchangeV2", pathfinderKey: "retro,retro-v3" }, Ft = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "SushiArb", partner: "Orbs:TWAP:Sushi", exchangeAddress: "0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad", exchangeType: "ExchangeV2", pathfinderKey: "" }, Tt = { chainName: "base", chainId: 8453, twapVersion: 4, twapAddress: "0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55", lensAddress: "0x6313188c1909b161074D62E43105faC9B756A23e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "SushiBase", partner: "Orbs:TWAP:Sushi", exchangeAddress: "0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad", exchangeType: "ExchangeV2", pathfinderKey: "" }, wt = { chainName: "eth", chainId: 1, twapVersion: 4, twapAddress: "0xb1ed8BCAD1EaC8a1DF0764700472391800D12946", lensAddress: "0x0967f448c4d4dbd14c355E635AE9CbF68cc44A60", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 200, name: "SushiEth", partner: "Orbs:TWAP:Sushi", exchangeAddress: "0x04eB53119079FA779492720D1EfeAEBF0aF2e5ad", exchangeType: "ExchangeV2", pathfinderKey: "" }, Dt = { chainName: "katana", chainId: 747474, twapVersion: 4, twapAddress: "0xf2d96E7BE676153d202e1453804E2749923C7c5b", lensAddress: "0x1579EED0527781B1A748043AA1f59a3858Ace4a7", takers: ["0xF74437A3Fc45a518640828E5D6A3E8c9A9BbDC3a", "0x07A6C715063e94c0D95e809efefFCbF4EBEdfD55"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "SushiKatana", partner: "Orbs:TWAP:Sushi", exchangeAddress: "0x92209481507e6B2d14C9b5b70Ed287024177220E", exchangeType: "ExchangeV2", pathfinderKey: "" }, Bt = { chainName: "sei", chainId: 1329, twapVersion: 4, twapAddress: "0xde737dB24548F8d41A4a3Ca2Bac8aaaDc4DBA099", lensAddress: "0xa1376f2Bb80D3cF6c2D8ebEf34b3d122e9af4020", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "DragonSwap", partner: "Orbs:TWAP:DragonSwap", exchangeAddress: "0xf2F933FafbDB97062CfA3c447ff373e76A90Efd6", exchangeType: "ExchangeV2", pathfinderKey: "" }, St = { chainName: "poly", chainId: 137, twapVersion: 4, twapAddress: "0x688C027B0f7FaCeFcBa73e472900d28c12C5bDF4", lensAddress: "0xe0D4E736fc76af7C256ae7652c8c1e850bfb7849", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "TeaFi", partner: "Orbs:TWAP:TeaFi", exchangeAddress: "0xE9D3b4Cf5B0CC392e78C1a4DD9885D449EEF9793", exchangeType: "ParaswapExchange", pathfinderKey: "AaveV2,AaveV3,AaveV3Stata,AngleStakedStableEUR,AngleStakedStableUSD,ApeSwap,AugustusRFQ,BalancerV2,ComethSwap,CurveV1,CurveV1Factory,CurveV1StableNg,CurveV2,Dfyn,DODOV2,Dystopia,Hashflow,IronV2,JarvisV6,KyberDmm,QuickSwap,QuickSwapV3,Retro,SushiSwap,SushiSwapV3,SwaapV2,Synapse,UniswapV2,UniswapV3,WaultFinance,Wmatic,WooFiV2,wUSDM" }, kt = { chainName: "flare", chainId: 14, twapVersion: 4, twapAddress: "0x9D70B0b90915Bb8b9bdAC7e6a7e6435bBF1feC4D", lensAddress: "0xf2d96E7BE676153d202e1453804E2749923C7c5b", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "SparkDEX", partner: "Orbs:TWAP:SparkDEX", exchangeAddress: "0xe59c53C76bB7EEc01401A18fA8215B94bC65Bf56", exchangeType: "P2Exchange" }, Ot = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "Ramses", partner: "Orbs:TWAP:Ramses", exchangeAddress: "0x8FCc245209bE85C49D738D0CE5613F74E5d91E86", exchangeType: "ParaswapExchange", pathfinderKey: "" }, _t = { chainName: "sonic", chainId: 146, twapVersion: 4, twapAddress: "0x8963992816b4EafE5a22b7DB2A99513c18be9afA", lensAddress: "0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D", takers: ["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913", "0x504f6E10173249dD22491829D98862Cf81DeF79E"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "SwapX", partner: "Orbs:TWAP:SwapX", exchangeAddress: "0xDA902994b7F7a1ecDd8De02E4a17dbFF2E6F67b7", exchangeType: "ExchangeV2", pathfinderKey: "" }, vt = { chainName: "cronos-zkevm", chainId: 388, twapVersion: 4, twapAddress: "0xc32cAA0F7AD9ED88e22Fc214fc24cCb5C0595D68", lensAddress: "0x7daE5af3011c3bE9A5283F0368a3fdD757fc74F9", takers: ["0xB924C20c400575D2B73Baa16CF0Fa0EAA720aFBC", "0xBE452F03Be354CAC397C3F0c8397672067D44531"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "H2Finance", partner: "Orbs:TWAP:H2Finance", exchangeAddress: "0x2f1f10dc311722Be609e6B427bF3FBac6e44093B", exchangeType: "ExchangeV2" }, Rt = { chainName: "sonic", chainId: 146, twapVersion: 4, twapAddress: "0x8963992816b4EafE5a22b7DB2A99513c18be9afA", lensAddress: "0x67e631F71232D63AcA98a2D5E9B2Bce5FCc39d5D", takers: ["0xDF406A27C58a8Cd6Fd43e143339bCE131216a913", "0x504f6E10173249dD22491829D98862Cf81DeF79E"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "Shadow", partner: "Orbs:TWAP:Shadow", exchangeAddress: "0x69e3c891450161b7BF27f181eE85E7bAE69E5b07", exchangeType: "ExchangeV2" }, Pt = { chainName: "berachain", chainId: 80094, twapVersion: 4, twapAddress: "0xD13609A8ace04D11Ea2FFE176B69dF77C6d9375E", lensAddress: "0xA0b07F9a11dFb01388149abBdbc5B4f2196600AB", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "Kodiak", partner: "Orbs:TWAP:Kodiak", exchangeAddress: "0x69B7aE1250B8d1309954CaD65b6607ae478Ec6eE", exchangeType: "ExchangeV2" }, Nt = { chainName: "base", chainId: 8453, twapVersion: 4, twapAddress: "0xc918bdC47264687796Cd54FE362FaC4f8b99Eb55", lensAddress: "0x6313188c1909b161074D62E43105faC9B756A23e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 10, name: "OmniBase", partner: "Orbs:TWAP:OmniBase", exchangeAddress: "0x54435FcFDF3A08150Ed799b6EF472A20a432303F", exchangeType: "ParaswapExchange" }, It = { chainName: "arb", chainId: 42161, twapVersion: 4, twapAddress: "0x0B94dcC0EA2d1ee33Ab064DaC252de980a941eF3", lensAddress: "0x549e1fc9a47FCc0C5C2EbdfF31254cc49fF7164e", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "OmniArb", partner: "Orbs:TWAP:OmniArb", exchangeAddress: "0xF0607785424d342Cceb33E708f4579CA97a3b392", exchangeType: "ParaswapExchange" }, Mt = { chainName: "avax", chainId: 43114, twapVersion: 4, twapAddress: "0xf77Ad005aBF7e31f669ce89a6568B2f39Ca92cDe", lensAddress: "0x48466B82Ce1575c5c9eCa168ac1090048dD47fA3", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "BlackholeAvax", partner: "Orbs:TWAP:BlackholeAvax", exchangeAddress: "0xb7A3d74895bFD3Aff6780525e36D79FCf26a895F", exchangeType: "ExchangeV2" }, Ut = { chainName: "bsc", chainId: 56, twapVersion: 4, twapAddress: "0xa6F7444D2b92Aa9F94a2165c77aAF2B671e63994", lensAddress: "0xEdB0c077fa87Fb21d050c619FF426798f8Fc1264", takers: ["0xA05405b6340A7F43dC5835351BFC4f5b1F028359", "0xE3Efef1563a5960ACc731F9e4d6f4cBf5bd87dcA"], bidDelaySeconds: 60, minChunkSizeUsd: 50, name: "NewEraBnb", partner: "Orbs:TWAP:NewEraBnb", exchangeAddress: "0xA22D7Df24d9Ea4D4EF6dC96b2204bd550430eC42", exchangeType: "ExchangeV2" }, O = {
|
|
5
5
|
SpookySwap: dt,
|
|
6
6
|
SpookySwapSonic: ct,
|
|
@@ -691,7 +691,7 @@ const dt = { chainName: "ftm", chainId: 250, twapVersion: 4, twapAddress: "0xd3B
|
|
|
691
691
|
]
|
|
692
692
|
}
|
|
693
693
|
], Wa = Lt, za = Vt, Ka = zt, Ha = Wt;
|
|
694
|
-
var
|
|
694
|
+
var $ = /* @__PURE__ */ ((e) => (e.TWAP = "TWAP", e.LIMIT = "LIMIT", e.STOP_LOSS = "STOP_LOSS", e.TAKE_PROFIT = "TAKE_PROFIT", e))($ || {}), oe = /* @__PURE__ */ ((e) => (e.Open = "OPEN", e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Expired = "EXPIRED", e))(oe || {}), Kt = /* @__PURE__ */ ((e) => (e.All = "ALL", e.Open = "OPEN", e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Expired = "EXPIRED", e))(Kt || {}), re = /* @__PURE__ */ ((e) => (e[e.Minutes = 6e4] = "Minutes", e[e.Hours = 36e5] = "Hours", e[e.Weeks = 6048e5] = "Weeks", e[e.Days = 864e5] = "Days", e[e.Months = 2592e6] = "Months", e[e.Years = 31536e6] = "Years", e))(re || {}), V = /* @__PURE__ */ ((e) => (e.LIMIT = "limit", e.TWAP_LIMIT = "twap-limit", e.TWAP_MARKET = "twap-market", e.TAKE_PROFIT_MARKET = "take-profit-market", e.TAKE_PROFIT_LIMIT = "take-profit-limit", e.STOP_LOSS_LIMIT = "stop-loss-limit", e.STOP_LOSS_MARKET = "stop-loss-market", e))(V || {}), se = /* @__PURE__ */ ((e) => (e.Arbidex = "arbidex", e.Blackhole = "blackhole", e.Chronos = "chronos", e.Dragon = "dragon", e.Kodiak = "kodiak", e.Lynex = "lynex", e.Nami = "nami", e.Newera = "newera", e.Omni = "omni", e.Pancake = "pancake", e.Quick = "quick", e.Ramses = "ramses", e.Shadow = "shadow", e.Spark = "spark", e.Spooky = "spooky", e.Swapx = "swapx", e.Teafi = "teafi", e.Thena = "thena", e.Yowie = "yowie", e.Pangolin = "pangolin", e.Sushiswap = "sushiswap", e.Agent = "agent", e.Utila = "utila", e.Ring = "ring", e.EfficientFrontier = "ef", e.HtDigital = "ht", e.Ginco = "ginco", e))(se || {}), Ht = /* @__PURE__ */ ((e) => (e.EMPTY_LIMIT_PRICE = "emptyLimitPrice", e.MAX_CHUNKS = "maxChunksError", e.MIN_CHUNKS = "minChunksError", e.MIN_TRADE_SIZE = "minTradeSizeError", e.MAX_FILL_DELAY = "maxFillDelayError", e.MIN_FILL_DELAY = "minFillDelayError", e.MAX_ORDER_DURATION = "maxDurationError", e.MIN_ORDER_DURATION = "minDurationError", e.MISSING_LIMIT_PRICE = "missingLimitPrice", e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE = "StopLossTriggerPriceError", e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE = "triggerLimitPriceError", e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE = "TakeProfitTriggerPriceError", e.EMPTY_TRIGGER_PRICE = "emptyTriggerPrice", e.INSUFFICIENT_BALANCE = "insufficientFunds", e.MAX_ORDER_SIZE = "maxOrderSize", e.MIN_TRADE_SIZE_ERROR = "minTradeSizeError", e))(Ht || {});
|
|
695
695
|
const I = "0x0000000000000000000000000000000000000000", q = {
|
|
696
696
|
eth: {
|
|
697
697
|
id: 1,
|
|
@@ -1198,8 +1198,8 @@ const I = "0x0000000000000000000000000000000000000000", q = {
|
|
|
1198
1198
|
decimals: 18,
|
|
1199
1199
|
logoUrl: "https://berascan.com/token/images/wrappedbera_ofc_64.png"
|
|
1200
1200
|
},
|
|
1201
|
-
publicRpcUrl: "
|
|
1202
|
-
logoUrl: "https://
|
|
1201
|
+
publicRpcUrl: "https://rpc.berachain.com",
|
|
1202
|
+
logoUrl: "https://berascan.com/token/images/wrappedbera_ofc_64.png",
|
|
1203
1203
|
explorer: "https://berascan.com",
|
|
1204
1204
|
// placeholder — replace with actual if known
|
|
1205
1205
|
eip1559: !0
|
|
@@ -1267,12 +1267,12 @@ const I = "0x0000000000000000000000000000000000000000", q = {
|
|
|
1267
1267
|
explorer: "https://mantlescan.xyz",
|
|
1268
1268
|
eip1559: !0
|
|
1269
1269
|
}
|
|
1270
|
-
}, $t = "2.7.
|
|
1270
|
+
}, $t = "2.7.1", We = {
|
|
1271
1271
|
version: $t
|
|
1272
|
-
}, Ye = "https://order-sink-dev.orbs.network", we = "https://order-sink.orbs.network", Ze = "https://order-sink-v2.orbs.network", ze = We.version.split(".")[0],
|
|
1272
|
+
}, Ye = "https://order-sink-dev.orbs.network", we = "https://order-sink.orbs.network", Ze = "https://order-sink-v2.orbs.network", ze = We.version.split(".")[0], Gt = (e) => {
|
|
1273
1273
|
const a = Number(ze) >= 2;
|
|
1274
1274
|
return e ? Ye : a ? Ze : we;
|
|
1275
|
-
},
|
|
1275
|
+
}, qt = (e) => {
|
|
1276
1276
|
const a = Number(ze) >= 2;
|
|
1277
1277
|
return e ? [Ye] : a ? [Ze, we] : [we];
|
|
1278
1278
|
}, Xt = {
|
|
@@ -1280,10 +1280,8 @@ const I = "0x0000000000000000000000000000000000000000", q = {
|
|
|
1280
1280
|
}, jt = ({
|
|
1281
1281
|
endpoint: e,
|
|
1282
1282
|
exchange: a,
|
|
1283
|
-
partner:
|
|
1284
|
-
}) => e === we &&
|
|
1285
|
-
Ue
|
|
1286
|
-
).getMinutes(), _e = (e) => `https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`, ae = "https://hub.orbs.network/api/apikey/subgraphs/id", Yt = {
|
|
1283
|
+
partner: r
|
|
1284
|
+
}) => e === we && r && Xt[r] || a, $a = 100, Ga = 1, Ue = 300 * 1e3, De = 1440 * 60 * 60 * 1e3, $e = 300 * 1e3, Qt = Ue / (60 * 1e3), _e = (e) => `https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`, ae = "https://hub.orbs.network/api/apikey/subgraphs/id", Yt = {
|
|
1287
1285
|
[q.eth.id]: `${ae}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,
|
|
1288
1286
|
[q.bsc.id]: `${ae}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,
|
|
1289
1287
|
[q.poly.id]: `${ae}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,
|
|
@@ -1305,59 +1303,59 @@ const I = "0x0000000000000000000000000000000000000000", q = {
|
|
|
1305
1303
|
"0x000000000000000000000000000000000000dEaD",
|
|
1306
1304
|
"0x000000000000000000000000000000000000800A",
|
|
1307
1305
|
"0x000000000000000000000000000000000000800a"
|
|
1308
|
-
], Je = "115792089237316195423570985008687907853269984665640564039457584007913129639935",
|
|
1309
|
-
[
|
|
1306
|
+
], Je = "115792089237316195423570985008687907853269984665640564039457584007913129639935", X = (e) => `${e.name}_${e.chainId}`, ea = {
|
|
1307
|
+
[X(O.SushiArb)]: [
|
|
1310
1308
|
"0x846F2B29ef314bF3D667981b4ffdADc5B858312a",
|
|
1311
1309
|
"0x08c41f5D1C844061f6D952E25827eeAA576c6536"
|
|
1312
1310
|
],
|
|
1313
|
-
[
|
|
1311
|
+
[X(O.SushiBase)]: [
|
|
1314
1312
|
"0x846F2B29ef314bF3D667981b4ffdADc5B858312a",
|
|
1315
1313
|
"0x08c41f5D1C844061f6D952E25827eeAA576c6536"
|
|
1316
1314
|
],
|
|
1317
|
-
[
|
|
1315
|
+
[X(O.SushiEth)]: [
|
|
1318
1316
|
"0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA",
|
|
1319
1317
|
"0x08c41f5D1C844061f6D952E25827eeAA576c6536"
|
|
1320
1318
|
],
|
|
1321
|
-
[
|
|
1319
|
+
[X(O.PancakeSwap)]: [
|
|
1322
1320
|
"0xb2BAFe188faD927240038cC4FfF2d771d8A58905",
|
|
1323
1321
|
"0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"
|
|
1324
1322
|
],
|
|
1325
|
-
[
|
|
1323
|
+
[X(O.PancakeSwapArbitrum)]: [
|
|
1326
1324
|
"0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F",
|
|
1327
1325
|
"0x807488ADAD033e95C438F998277bE654152594dc"
|
|
1328
1326
|
],
|
|
1329
|
-
[
|
|
1327
|
+
[X(O.PancakeSwapBase)]: [
|
|
1330
1328
|
"0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c",
|
|
1331
1329
|
"0x3A9df3eE209b802D0337383f5abCe3204d623588"
|
|
1332
1330
|
],
|
|
1333
|
-
[
|
|
1331
|
+
[X(O.PancakeSwapLinea)]: [
|
|
1334
1332
|
"0x3A9df3eE209b802D0337383f5abCe3204d623588"
|
|
1335
1333
|
],
|
|
1336
|
-
[
|
|
1334
|
+
[X(O.QuickSwap)]: [
|
|
1337
1335
|
"0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"
|
|
1338
1336
|
],
|
|
1339
|
-
[
|
|
1337
|
+
[X(O.Thena)]: [
|
|
1340
1338
|
"0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"
|
|
1341
1339
|
],
|
|
1342
|
-
[
|
|
1340
|
+
[X(O.Lynex)]: [
|
|
1343
1341
|
"0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"
|
|
1344
1342
|
],
|
|
1345
|
-
[
|
|
1343
|
+
[X(O.DragonSwap)]: [
|
|
1346
1344
|
"0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"
|
|
1347
1345
|
],
|
|
1348
|
-
[
|
|
1346
|
+
[X(O.SpookySwapSonic)]: [
|
|
1349
1347
|
"0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"
|
|
1350
1348
|
],
|
|
1351
|
-
[
|
|
1349
|
+
[X(O.SpookySwap)]: [
|
|
1352
1350
|
"0x3924d62219483015f982b160d48c0fa5Fd436Cba"
|
|
1353
1351
|
],
|
|
1354
|
-
[
|
|
1352
|
+
[X(O.SwapX)]: [
|
|
1355
1353
|
"0xE5012eBDe5e26EE3Ea41992154731a03023CF274"
|
|
1356
1354
|
]
|
|
1357
|
-
},
|
|
1355
|
+
}, Ge = {
|
|
1358
1356
|
unit: re.Minutes,
|
|
1359
1357
|
value: Qt
|
|
1360
|
-
},
|
|
1358
|
+
}, qa = 0.25, Xa = "100", ta = "RePermitWitnessTransferFrom", aa = {
|
|
1361
1359
|
RePermitWitnessTransferFrom: [
|
|
1362
1360
|
{
|
|
1363
1361
|
name: "permitted",
|
|
@@ -1490,9 +1488,9 @@ const I = "0x0000000000000000000000000000000000000000", q = {
|
|
|
1490
1488
|
}, ja = "https://www.orbs.com/dtwap-and-dlimit-faq/", Qa = "https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP", Ya = "https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg", Za = "https://www.orbs.com/assets/img/common/logo.svg", Ja = "https://www.orbs.com/", en = "https://www.orbs.com/dtwap-dlimit-disclaimer";
|
|
1491
1489
|
var Ee = /* @__PURE__ */ ((e) => (e.FRESHNESS = "freshness", e.MIN_CHUNK_SIZE_USD = "minChunkSizeUsd", e.ENV = "env", e.DURATION = "duration", e.IGNORE_ERRORS = "ignore-errors", e))(Ee || {});
|
|
1492
1490
|
const tn = "-5", an = "10", nn = "-10", sn = "5", rn = "Something went wrong";
|
|
1493
|
-
var na = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, ve = Math.ceil, ee = Math.floor,
|
|
1491
|
+
var na = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, ve = Math.ceil, ee = Math.floor, j = "[BigNumber Error] ", qe = j + "Number primitive has more than 15 significant digits: ", ne = 1e14, k = 14, Re = 9007199254740991, Pe = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], ue = 1e7, z = 1e9;
|
|
1494
1492
|
function et(e) {
|
|
1495
|
-
var a,
|
|
1493
|
+
var a, r, A, d = E.prototype = { constructor: E, toString: null, valueOf: null }, b = new E(1), h = 20, x = 4, C = -7, T = 21, S = -1e7, F = 1e7, w = !1, R = 1, P = 0, K = {
|
|
1496
1494
|
prefix: "",
|
|
1497
1495
|
groupSize: 3,
|
|
1498
1496
|
secondaryGroupSize: 0,
|
|
@@ -1502,16 +1500,16 @@ function et(e) {
|
|
|
1502
1500
|
fractionGroupSeparator: " ",
|
|
1503
1501
|
// non-breaking space
|
|
1504
1502
|
suffix: ""
|
|
1505
|
-
},
|
|
1503
|
+
}, Q = "0123456789abcdefghijklmnopqrstuvwxyz", le = !0;
|
|
1506
1504
|
function E(t, n) {
|
|
1507
|
-
var s, u, o, p, m,
|
|
1505
|
+
var s, u, o, p, m, i, c, f, l = this;
|
|
1508
1506
|
if (!(l instanceof E)) return new E(t, n);
|
|
1509
1507
|
if (n == null) {
|
|
1510
1508
|
if (t && t._isBigNumber === !0) {
|
|
1511
1509
|
l.s = t.s, !t.c || t.e > F ? l.c = l.e = null : t.e < S ? l.c = [l.e = 0] : (l.e = t.e, l.c = t.c.slice());
|
|
1512
1510
|
return;
|
|
1513
1511
|
}
|
|
1514
|
-
if ((
|
|
1512
|
+
if ((i = typeof t == "number") && t * 0 == 0) {
|
|
1515
1513
|
if (l.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
|
|
1516
1514
|
for (p = 0, m = t; m >= 10; m /= 10, p++) ;
|
|
1517
1515
|
p > F ? l.c = l.e = null : (l.e = p, l.c = [t]);
|
|
@@ -1519,20 +1517,20 @@ function et(e) {
|
|
|
1519
1517
|
}
|
|
1520
1518
|
f = String(t);
|
|
1521
1519
|
} else {
|
|
1522
|
-
if (!na.test(f = String(t))) return A(l, f,
|
|
1520
|
+
if (!na.test(f = String(t))) return A(l, f, i);
|
|
1523
1521
|
l.s = f.charCodeAt(0) == 45 ? (f = f.slice(1), -1) : 1;
|
|
1524
1522
|
}
|
|
1525
1523
|
(p = f.indexOf(".")) > -1 && (f = f.replace(".", "")), (m = f.search(/e/i)) > 0 ? (p < 0 && (p = m), p += +f.slice(m + 1), f = f.substring(0, m)) : p < 0 && (p = f.length);
|
|
1526
1524
|
} else {
|
|
1527
|
-
if (M(n, 2,
|
|
1528
|
-
return l = new E(t),
|
|
1529
|
-
if (f = String(t),
|
|
1530
|
-
if (t * 0 != 0) return A(l, f,
|
|
1525
|
+
if (M(n, 2, Q.length, "Base"), n == 10 && le)
|
|
1526
|
+
return l = new E(t), Y(l, h + l.e + 1, x);
|
|
1527
|
+
if (f = String(t), i = typeof t == "number") {
|
|
1528
|
+
if (t * 0 != 0) return A(l, f, i, n);
|
|
1531
1529
|
if (l.s = 1 / t < 0 ? (f = f.slice(1), -1) : 1, E.DEBUG && f.replace(/^0\.0*|\./, "").length > 15)
|
|
1532
|
-
throw Error(
|
|
1530
|
+
throw Error(qe + t);
|
|
1533
1531
|
} else
|
|
1534
1532
|
l.s = f.charCodeAt(0) === 45 ? (f = f.slice(1), -1) : 1;
|
|
1535
|
-
for (s =
|
|
1533
|
+
for (s = Q.slice(0, n), p = m = 0, c = f.length; m < c; m++)
|
|
1536
1534
|
if (s.indexOf(u = f.charAt(m)) < 0) {
|
|
1537
1535
|
if (u == ".") {
|
|
1538
1536
|
if (m > p) {
|
|
@@ -1543,15 +1541,15 @@ function et(e) {
|
|
|
1543
1541
|
o = !0, m = -1, p = 0;
|
|
1544
1542
|
continue;
|
|
1545
1543
|
}
|
|
1546
|
-
return A(l, String(t),
|
|
1544
|
+
return A(l, String(t), i, n);
|
|
1547
1545
|
}
|
|
1548
|
-
|
|
1546
|
+
i = !1, f = r(f, n, 10, l.s), (p = f.indexOf(".")) > -1 ? f = f.replace(".", "") : p = f.length;
|
|
1549
1547
|
}
|
|
1550
1548
|
for (m = 0; f.charCodeAt(m) === 48; m++) ;
|
|
1551
1549
|
for (c = f.length; f.charCodeAt(--c) === 48; ) ;
|
|
1552
1550
|
if (f = f.slice(m, ++c)) {
|
|
1553
|
-
if (c -= m,
|
|
1554
|
-
throw Error(
|
|
1551
|
+
if (c -= m, i && E.DEBUG && c > 15 && (t > Re || t !== ee(t)))
|
|
1552
|
+
throw Error(qe + l.s * t);
|
|
1555
1553
|
if ((p = p - m - 1) > F)
|
|
1556
1554
|
l.c = l.e = null;
|
|
1557
1555
|
else if (p < S)
|
|
@@ -1573,44 +1571,44 @@ function et(e) {
|
|
|
1573
1571
|
var n, s;
|
|
1574
1572
|
if (t != null)
|
|
1575
1573
|
if (typeof t == "object") {
|
|
1576
|
-
if (t.hasOwnProperty(n = "DECIMAL_PLACES") && (s = t[n], M(s, 0, z, n), h = s), t.hasOwnProperty(n = "ROUNDING_MODE") && (s = t[n], M(s, 0, 8, n), x = s), t.hasOwnProperty(n = "EXPONENTIAL_AT") && (s = t[n], s && s.pop ? (M(s[0], -z, 0, n), M(s[1], 0, z, n), C = s[0],
|
|
1574
|
+
if (t.hasOwnProperty(n = "DECIMAL_PLACES") && (s = t[n], M(s, 0, z, n), h = s), t.hasOwnProperty(n = "ROUNDING_MODE") && (s = t[n], M(s, 0, 8, n), x = s), t.hasOwnProperty(n = "EXPONENTIAL_AT") && (s = t[n], s && s.pop ? (M(s[0], -z, 0, n), M(s[1], 0, z, n), C = s[0], T = s[1]) : (M(s, -z, z, n), C = -(T = s < 0 ? -s : s))), t.hasOwnProperty(n = "RANGE"))
|
|
1577
1575
|
if (s = t[n], s && s.pop)
|
|
1578
1576
|
M(s[0], -z, -1, n), M(s[1], 1, z, n), S = s[0], F = s[1];
|
|
1579
1577
|
else if (M(s, -z, z, n), s)
|
|
1580
1578
|
S = -(F = s < 0 ? -s : s);
|
|
1581
1579
|
else
|
|
1582
|
-
throw Error(
|
|
1580
|
+
throw Error(j + n + " cannot be zero: " + s);
|
|
1583
1581
|
if (t.hasOwnProperty(n = "CRYPTO"))
|
|
1584
1582
|
if (s = t[n], s === !!s)
|
|
1585
1583
|
if (s)
|
|
1586
1584
|
if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
|
|
1587
|
-
|
|
1585
|
+
w = s;
|
|
1588
1586
|
else
|
|
1589
|
-
throw
|
|
1587
|
+
throw w = !s, Error(j + "crypto unavailable");
|
|
1590
1588
|
else
|
|
1591
|
-
|
|
1589
|
+
w = s;
|
|
1592
1590
|
else
|
|
1593
|
-
throw Error(
|
|
1591
|
+
throw Error(j + n + " not true or false: " + s);
|
|
1594
1592
|
if (t.hasOwnProperty(n = "MODULO_MODE") && (s = t[n], M(s, 0, 9, n), R = s), t.hasOwnProperty(n = "POW_PRECISION") && (s = t[n], M(s, 0, z, n), P = s), t.hasOwnProperty(n = "FORMAT"))
|
|
1595
|
-
if (s = t[n], typeof s == "object")
|
|
1596
|
-
else throw Error(
|
|
1593
|
+
if (s = t[n], typeof s == "object") K = s;
|
|
1594
|
+
else throw Error(j + n + " not an object: " + s);
|
|
1597
1595
|
if (t.hasOwnProperty(n = "ALPHABET"))
|
|
1598
1596
|
if (s = t[n], typeof s == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(s))
|
|
1599
|
-
le = s.slice(0, 10) == "0123456789",
|
|
1597
|
+
le = s.slice(0, 10) == "0123456789", Q = s;
|
|
1600
1598
|
else
|
|
1601
|
-
throw Error(
|
|
1599
|
+
throw Error(j + n + " invalid: " + s);
|
|
1602
1600
|
} else
|
|
1603
|
-
throw Error(
|
|
1601
|
+
throw Error(j + "Object expected: " + t);
|
|
1604
1602
|
return {
|
|
1605
1603
|
DECIMAL_PLACES: h,
|
|
1606
1604
|
ROUNDING_MODE: x,
|
|
1607
|
-
EXPONENTIAL_AT: [C,
|
|
1605
|
+
EXPONENTIAL_AT: [C, T],
|
|
1608
1606
|
RANGE: [S, F],
|
|
1609
|
-
CRYPTO:
|
|
1607
|
+
CRYPTO: w,
|
|
1610
1608
|
MODULO_MODE: R,
|
|
1611
1609
|
POW_PRECISION: P,
|
|
1612
|
-
FORMAT:
|
|
1613
|
-
ALPHABET:
|
|
1610
|
+
FORMAT: K,
|
|
1611
|
+
ALPHABET: Q
|
|
1614
1612
|
};
|
|
1615
1613
|
}, E.isBigNumber = function(t) {
|
|
1616
1614
|
if (!t || t._isBigNumber !== !0) return !1;
|
|
@@ -1630,7 +1628,7 @@ function et(e) {
|
|
|
1630
1628
|
}
|
|
1631
1629
|
} else if (u === null && o === null && (p === null || p === 1 || p === -1))
|
|
1632
1630
|
return !0;
|
|
1633
|
-
throw Error(
|
|
1631
|
+
throw Error(j + "Invalid BigNumber: " + t);
|
|
1634
1632
|
}, E.maximum = E.max = function() {
|
|
1635
1633
|
return xe(arguments, -1);
|
|
1636
1634
|
}, E.minimum = E.min = function() {
|
|
@@ -1642,27 +1640,27 @@ function et(e) {
|
|
|
1642
1640
|
return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
|
|
1643
1641
|
};
|
|
1644
1642
|
return function(s) {
|
|
1645
|
-
var u, o, p, m,
|
|
1646
|
-
if (s == null ? s = h : M(s, 0, z), m = ve(s / k),
|
|
1643
|
+
var u, o, p, m, i, c = 0, f = [], l = new E(b);
|
|
1644
|
+
if (s == null ? s = h : M(s, 0, z), m = ve(s / k), w)
|
|
1647
1645
|
if (crypto.getRandomValues) {
|
|
1648
1646
|
for (u = crypto.getRandomValues(new Uint32Array(m *= 2)); c < m; )
|
|
1649
|
-
|
|
1647
|
+
i = u[c] * 131072 + (u[c + 1] >>> 11), i >= 9e15 ? (o = crypto.getRandomValues(new Uint32Array(2)), u[c] = o[0], u[c + 1] = o[1]) : (f.push(i % 1e14), c += 2);
|
|
1650
1648
|
c = m / 2;
|
|
1651
1649
|
} else if (crypto.randomBytes) {
|
|
1652
1650
|
for (u = crypto.randomBytes(m *= 7); c < m; )
|
|
1653
|
-
|
|
1651
|
+
i = (u[c] & 31) * 281474976710656 + u[c + 1] * 1099511627776 + u[c + 2] * 4294967296 + u[c + 3] * 16777216 + (u[c + 4] << 16) + (u[c + 5] << 8) + u[c + 6], i >= 9e15 ? crypto.randomBytes(7).copy(u, c) : (f.push(i % 1e14), c += 7);
|
|
1654
1652
|
c = m / 7;
|
|
1655
1653
|
} else
|
|
1656
|
-
throw
|
|
1657
|
-
if (!
|
|
1654
|
+
throw w = !1, Error(j + "crypto unavailable");
|
|
1655
|
+
if (!w)
|
|
1658
1656
|
for (; c < m; )
|
|
1659
|
-
|
|
1660
|
-
for (m = f[--c], s %= k, m && s && (
|
|
1657
|
+
i = n(), i < 9e15 && (f[c++] = i % 1e14);
|
|
1658
|
+
for (m = f[--c], s %= k, m && s && (i = Pe[k - s], f[c] = ee(m / i) * i); f[c] === 0; f.pop(), c--) ;
|
|
1661
1659
|
if (c < 0)
|
|
1662
1660
|
f = [p = 0];
|
|
1663
1661
|
else {
|
|
1664
1662
|
for (p = -1; f[0] === 0; f.splice(0, 1), p -= k) ;
|
|
1665
|
-
for (c = 1,
|
|
1663
|
+
for (c = 1, i = f[0]; i >= 10; i /= 10, c++) ;
|
|
1666
1664
|
c < k && (p -= k - c);
|
|
1667
1665
|
}
|
|
1668
1666
|
return l.e = p, l.c = f, l;
|
|
@@ -1670,112 +1668,112 @@ function et(e) {
|
|
|
1670
1668
|
})(), E.sum = function() {
|
|
1671
1669
|
for (var t = 1, n = arguments, s = new E(n[0]); t < n.length; ) s = s.plus(n[t++]);
|
|
1672
1670
|
return s;
|
|
1673
|
-
},
|
|
1671
|
+
}, r = /* @__PURE__ */ (function() {
|
|
1674
1672
|
var t = "0123456789";
|
|
1675
1673
|
function n(s, u, o, p) {
|
|
1676
|
-
for (var m,
|
|
1677
|
-
for (c =
|
|
1678
|
-
for (
|
|
1679
|
-
|
|
1674
|
+
for (var m, i = [0], c, f = 0, l = s.length; f < l; ) {
|
|
1675
|
+
for (c = i.length; c--; i[c] *= u) ;
|
|
1676
|
+
for (i[0] += p.indexOf(s.charAt(f++)), m = 0; m < i.length; m++)
|
|
1677
|
+
i[m] > o - 1 && (i[m + 1] == null && (i[m + 1] = 0), i[m + 1] += i[m] / o | 0, i[m] %= o);
|
|
1680
1678
|
}
|
|
1681
|
-
return
|
|
1679
|
+
return i.reverse();
|
|
1682
1680
|
}
|
|
1683
1681
|
return function(s, u, o, p, m) {
|
|
1684
|
-
var
|
|
1682
|
+
var i, c, f, l, y, D, B, v, U = s.indexOf("."), W = h, _ = x;
|
|
1685
1683
|
for (U >= 0 && (l = P, P = 0, s = s.replace(".", ""), v = new E(u), D = v.pow(s.length - U), P = l, v.c = n(
|
|
1686
1684
|
ce(J(D.c), D.e, "0"),
|
|
1687
1685
|
10,
|
|
1688
1686
|
o,
|
|
1689
1687
|
t
|
|
1690
|
-
), v.e = v.c.length), B = n(s, u, o, m ? (
|
|
1691
|
-
if (!B[0]) return
|
|
1688
|
+
), v.e = v.c.length), B = n(s, u, o, m ? (i = Q, t) : (i = t, Q)), f = l = B.length; B[--l] == 0; B.pop()) ;
|
|
1689
|
+
if (!B[0]) return i.charAt(0);
|
|
1692
1690
|
if (U < 0 ? --f : (D.c = B, D.e = f, D.s = p, D = a(D, v, W, _, o), B = D.c, y = D.r, f = D.e), c = f + W + 1, U = B[c], l = o / 2, y = y || c < 0 || B[c + 1] != null, y = _ < 4 ? (U != null || y) && (_ == 0 || _ == (D.s < 0 ? 3 : 2)) : U > l || U == l && (_ == 4 || y || _ == 6 && B[c - 1] & 1 || _ == (D.s < 0 ? 8 : 7)), c < 1 || !B[0])
|
|
1693
|
-
s = y ? ce(
|
|
1691
|
+
s = y ? ce(i.charAt(1), -W, i.charAt(0)) : i.charAt(0);
|
|
1694
1692
|
else {
|
|
1695
1693
|
if (B.length = c, y)
|
|
1696
1694
|
for (--o; ++B[--c] > o; )
|
|
1697
1695
|
B[c] = 0, c || (++f, B = [1].concat(B));
|
|
1698
1696
|
for (l = B.length; !B[--l]; ) ;
|
|
1699
|
-
for (U = 0, s = ""; U <= l; s +=
|
|
1700
|
-
s = ce(s, f,
|
|
1697
|
+
for (U = 0, s = ""; U <= l; s += i.charAt(B[U++])) ;
|
|
1698
|
+
s = ce(s, f, i.charAt(0));
|
|
1701
1699
|
}
|
|
1702
1700
|
return s;
|
|
1703
1701
|
};
|
|
1704
1702
|
})(), a = /* @__PURE__ */ (function() {
|
|
1705
1703
|
function t(u, o, p) {
|
|
1706
|
-
var m,
|
|
1704
|
+
var m, i, c, f, l = 0, y = u.length, D = o % ue, B = o / ue | 0;
|
|
1707
1705
|
for (u = u.slice(); y--; )
|
|
1708
|
-
c = u[y] % ue, f = u[y] / ue | 0, m = B * c + f * D,
|
|
1706
|
+
c = u[y] % ue, f = u[y] / ue | 0, m = B * c + f * D, i = D * c + m % ue * ue + l, l = (i / p | 0) + (m / ue | 0) + B * f, u[y] = i % p;
|
|
1709
1707
|
return l && (u = [l].concat(u)), u;
|
|
1710
1708
|
}
|
|
1711
1709
|
function n(u, o, p, m) {
|
|
1712
|
-
var
|
|
1710
|
+
var i, c;
|
|
1713
1711
|
if (p != m)
|
|
1714
1712
|
c = p > m ? 1 : -1;
|
|
1715
1713
|
else
|
|
1716
|
-
for (
|
|
1717
|
-
if (u[
|
|
1718
|
-
c = u[
|
|
1714
|
+
for (i = c = 0; i < p; i++)
|
|
1715
|
+
if (u[i] != o[i]) {
|
|
1716
|
+
c = u[i] > o[i] ? 1 : -1;
|
|
1719
1717
|
break;
|
|
1720
1718
|
}
|
|
1721
1719
|
return c;
|
|
1722
1720
|
}
|
|
1723
1721
|
function s(u, o, p, m) {
|
|
1724
|
-
for (var
|
|
1725
|
-
u[p] -=
|
|
1722
|
+
for (var i = 0; p--; )
|
|
1723
|
+
u[p] -= i, i = u[p] < o[p] ? 1 : 0, u[p] = i * m + u[p] - o[p];
|
|
1726
1724
|
for (; !u[0] && u.length > 1; u.splice(0, 1)) ;
|
|
1727
1725
|
}
|
|
1728
|
-
return function(u, o, p, m,
|
|
1729
|
-
var c, f, l, y, D, B, v, U, W, _, N,
|
|
1730
|
-
if (
|
|
1726
|
+
return function(u, o, p, m, i) {
|
|
1727
|
+
var c, f, l, y, D, B, v, U, W, _, N, H, ge, ke, Oe, ie, he, Z = u.s == o.s ? 1 : -1, G = u.c, L = o.c;
|
|
1728
|
+
if (!G || !G[0] || !L || !L[0])
|
|
1731
1729
|
return new E(
|
|
1732
1730
|
// Return NaN if either NaN, or both Infinity or 0.
|
|
1733
|
-
!u.s || !o.s || (
|
|
1731
|
+
!u.s || !o.s || (G ? L && G[0] == L[0] : !L) ? NaN : (
|
|
1734
1732
|
// Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
|
|
1735
|
-
|
|
1733
|
+
G && G[0] == 0 || !L ? Z * 0 : Z / 0
|
|
1736
1734
|
)
|
|
1737
1735
|
);
|
|
1738
|
-
for (U = new E(Z), W = U.c = [], f = u.e - o.e, Z = p + f + 1,
|
|
1739
|
-
if (L[l] > (
|
|
1736
|
+
for (U = new E(Z), W = U.c = [], f = u.e - o.e, Z = p + f + 1, i || (i = ne, f = te(u.e / k) - te(o.e / k), Z = Z / k | 0), l = 0; L[l] == (G[l] || 0); l++) ;
|
|
1737
|
+
if (L[l] > (G[l] || 0) && f--, Z < 0)
|
|
1740
1738
|
W.push(1), y = !0;
|
|
1741
1739
|
else {
|
|
1742
|
-
for (ke =
|
|
1743
|
-
he = L.slice(), he = [0].concat(he), Oe = L[0], L[1] >=
|
|
1740
|
+
for (ke = G.length, ie = L.length, l = 0, Z += 2, D = ee(i / (L[0] + 1)), D > 1 && (L = t(L, D, i), G = t(G, D, i), ie = L.length, ke = G.length), ge = ie, _ = G.slice(0, ie), N = _.length; N < ie; _[N++] = 0) ;
|
|
1741
|
+
he = L.slice(), he = [0].concat(he), Oe = L[0], L[1] >= i / 2 && Oe++;
|
|
1744
1742
|
do {
|
|
1745
1743
|
if (D = 0, c = n(L, _, ie, N), c < 0) {
|
|
1746
|
-
if (
|
|
1747
|
-
for (D >=
|
|
1748
|
-
D--, s(B, ie < v ? he : L, v,
|
|
1744
|
+
if (H = _[0], ie != N && (H = H * i + (_[1] || 0)), D = ee(H / Oe), D > 1)
|
|
1745
|
+
for (D >= i && (D = i - 1), B = t(L, D, i), v = B.length, N = _.length; n(B, _, v, N) == 1; )
|
|
1746
|
+
D--, s(B, ie < v ? he : L, v, i), v = B.length, c = 1;
|
|
1749
1747
|
else
|
|
1750
1748
|
D == 0 && (c = D = 1), B = L.slice(), v = B.length;
|
|
1751
|
-
if (v < N && (B = [0].concat(B)), s(_, B, N,
|
|
1749
|
+
if (v < N && (B = [0].concat(B)), s(_, B, N, i), N = _.length, c == -1)
|
|
1752
1750
|
for (; n(L, _, ie, N) < 1; )
|
|
1753
|
-
D++, s(_, ie < N ? he : L, N,
|
|
1751
|
+
D++, s(_, ie < N ? he : L, N, i), N = _.length;
|
|
1754
1752
|
} else c === 0 && (D++, _ = [0]);
|
|
1755
|
-
W[l++] = D, _[0] ? _[N++] =
|
|
1753
|
+
W[l++] = D, _[0] ? _[N++] = G[ge] || 0 : (_ = [G[ge]], N = 1);
|
|
1756
1754
|
} while ((ge++ < ke || _[0] != null) && Z--);
|
|
1757
1755
|
y = _[0] != null, W[0] || W.splice(0, 1);
|
|
1758
1756
|
}
|
|
1759
|
-
if (
|
|
1757
|
+
if (i == ne) {
|
|
1760
1758
|
for (l = 1, Z = W[0]; Z >= 10; Z /= 10, l++) ;
|
|
1761
|
-
|
|
1759
|
+
Y(U, p + (U.e = l + f * k - 1) + 1, m, y);
|
|
1762
1760
|
} else
|
|
1763
1761
|
U.e = f, U.r = +y;
|
|
1764
1762
|
return U;
|
|
1765
1763
|
};
|
|
1766
1764
|
})();
|
|
1767
1765
|
function be(t, n, s, u) {
|
|
1768
|
-
var o, p, m,
|
|
1766
|
+
var o, p, m, i, c;
|
|
1769
1767
|
if (s == null ? s = x : M(s, 0, 8), !t.c) return t.toString();
|
|
1770
1768
|
if (o = t.c[0], m = t.e, n == null)
|
|
1771
|
-
c = J(t.c), c = u == 1 || u == 2 && (m <= C || m >=
|
|
1772
|
-
else if (t =
|
|
1773
|
-
for (;
|
|
1769
|
+
c = J(t.c), c = u == 1 || u == 2 && (m <= C || m >= T) ? Te(c, m) : ce(c, m, "0");
|
|
1770
|
+
else if (t = Y(new E(t), n, s), p = t.e, c = J(t.c), i = c.length, u == 1 || u == 2 && (n <= p || p <= C)) {
|
|
1771
|
+
for (; i < n; c += "0", i++) ;
|
|
1774
1772
|
c = Te(c, p);
|
|
1775
|
-
} else if (n -= m + (u === 2 && p > m), c = ce(c, p, "0"), p + 1 >
|
|
1773
|
+
} else if (n -= m + (u === 2 && p > m), c = ce(c, p, "0"), p + 1 > i) {
|
|
1776
1774
|
if (--n > 0) for (c += "."; n--; c += "0") ;
|
|
1777
|
-
} else if (n += p -
|
|
1778
|
-
for (p + 1 ==
|
|
1775
|
+
} else if (n += p - i, n > 0)
|
|
1776
|
+
for (p + 1 == i && (c += "."); n--; c += "0") ;
|
|
1779
1777
|
return t.s < 0 && o ? "-" + c : c;
|
|
1780
1778
|
}
|
|
1781
1779
|
function xe(t, n) {
|
|
@@ -1790,27 +1788,27 @@ function et(e) {
|
|
|
1790
1788
|
}
|
|
1791
1789
|
A = /* @__PURE__ */ (function() {
|
|
1792
1790
|
var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, n = /^([^.]+)\.$/, s = /^\.([^.]+)$/, u = /^-?(Infinity|NaN)$/, o = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
|
|
1793
|
-
return function(p, m,
|
|
1794
|
-
var f, l =
|
|
1791
|
+
return function(p, m, i, c) {
|
|
1792
|
+
var f, l = i ? m : m.replace(o, "");
|
|
1795
1793
|
if (u.test(l))
|
|
1796
1794
|
p.s = isNaN(l) ? null : l < 0 ? -1 : 1;
|
|
1797
1795
|
else {
|
|
1798
|
-
if (!
|
|
1796
|
+
if (!i && (l = l.replace(t, function(y, D, B) {
|
|
1799
1797
|
return f = (B = B.toLowerCase()) == "x" ? 16 : B == "b" ? 2 : 8, !c || c == f ? D : y;
|
|
1800
1798
|
}), c && (f = c, l = l.replace(n, "$1").replace(s, "0.$1")), m != l))
|
|
1801
1799
|
return new E(l, f);
|
|
1802
1800
|
if (E.DEBUG)
|
|
1803
|
-
throw Error(
|
|
1801
|
+
throw Error(j + "Not a" + (c ? " base " + c : "") + " number: " + m);
|
|
1804
1802
|
p.s = null;
|
|
1805
1803
|
}
|
|
1806
1804
|
p.c = p.e = null;
|
|
1807
1805
|
};
|
|
1808
1806
|
})();
|
|
1809
|
-
function
|
|
1810
|
-
var o, p, m,
|
|
1807
|
+
function Y(t, n, s, u) {
|
|
1808
|
+
var o, p, m, i, c, f, l, y = t.c, D = Pe;
|
|
1811
1809
|
if (y) {
|
|
1812
1810
|
e: {
|
|
1813
|
-
for (o = 1,
|
|
1811
|
+
for (o = 1, i = y[0]; i >= 10; i /= 10, o++) ;
|
|
1814
1812
|
if (p = n - o, p < 0)
|
|
1815
1813
|
p += k, m = n, c = y[f = 0], l = ee(c / D[o - m - 1] % 10);
|
|
1816
1814
|
else if (f = ve((p + 1) / k), f >= y.length)
|
|
@@ -1820,7 +1818,7 @@ function et(e) {
|
|
|
1820
1818
|
} else
|
|
1821
1819
|
break e;
|
|
1822
1820
|
else {
|
|
1823
|
-
for (c =
|
|
1821
|
+
for (c = i = y[f], o = 1; i >= 10; i /= 10, o++) ;
|
|
1824
1822
|
p %= k, m = p - k + o, l = m < 0 ? 0 : ee(c / D[o - m - 1] % 10);
|
|
1825
1823
|
}
|
|
1826
1824
|
if (u = u || n < 0 || // Are there any non-zero digits after the rounding digit?
|
|
@@ -1829,16 +1827,16 @@ function et(e) {
|
|
|
1829
1827
|
y[f + 1] != null || (m < 0 ? c : c % D[o - m - 1]), u = s < 4 ? (l || u) && (s == 0 || s == (t.s < 0 ? 3 : 2)) : l > 5 || l == 5 && (s == 4 || u || s == 6 && // Check whether the digit to the left of the rounding digit is odd.
|
|
1830
1828
|
(p > 0 ? m > 0 ? c / D[o - m] : 0 : y[f - 1]) % 10 & 1 || s == (t.s < 0 ? 8 : 7)), n < 1 || !y[0])
|
|
1831
1829
|
return y.length = 0, u ? (n -= t.e + 1, y[0] = D[(k - n % k) % k], t.e = -n || 0) : y[0] = t.e = 0, t;
|
|
1832
|
-
if (p == 0 ? (y.length = f,
|
|
1830
|
+
if (p == 0 ? (y.length = f, i = 1, f--) : (y.length = f + 1, i = D[k - p], y[f] = m > 0 ? ee(c / D[o - m] % D[m]) * i : 0), u)
|
|
1833
1831
|
for (; ; )
|
|
1834
1832
|
if (f == 0) {
|
|
1835
1833
|
for (p = 1, m = y[0]; m >= 10; m /= 10, p++) ;
|
|
1836
|
-
for (m = y[0] +=
|
|
1837
|
-
p !=
|
|
1834
|
+
for (m = y[0] += i, i = 1; m >= 10; m /= 10, i++) ;
|
|
1835
|
+
p != i && (t.e++, y[0] == ne && (y[0] = 1));
|
|
1838
1836
|
break;
|
|
1839
1837
|
} else {
|
|
1840
|
-
if (y[f] +=
|
|
1841
|
-
y[f--] = 0,
|
|
1838
|
+
if (y[f] += i, y[f] != ne) break;
|
|
1839
|
+
y[f--] = 0, i = 1;
|
|
1842
1840
|
}
|
|
1843
1841
|
for (p = y.length; y[--p] === 0; y.pop()) ;
|
|
1844
1842
|
}
|
|
@@ -1848,7 +1846,7 @@ function et(e) {
|
|
|
1848
1846
|
}
|
|
1849
1847
|
function de(t) {
|
|
1850
1848
|
var n, s = t.e;
|
|
1851
|
-
return s === null ? t.toString() : (n = J(t.c), n = s <= C || s >=
|
|
1849
|
+
return s === null ? t.toString() : (n = J(t.c), n = s <= C || s >= T ? Te(n, s) : ce(n, s, "0"), t.s < 0 ? "-" + n : n);
|
|
1852
1850
|
}
|
|
1853
1851
|
return d.absoluteValue = d.abs = function() {
|
|
1854
1852
|
var t = new E(this);
|
|
@@ -1858,7 +1856,7 @@ function et(e) {
|
|
|
1858
1856
|
}, d.decimalPlaces = d.dp = function(t, n) {
|
|
1859
1857
|
var s, u, o, p = this;
|
|
1860
1858
|
if (t != null)
|
|
1861
|
-
return M(t, 0, z), n == null ? n = x : M(n, 0, 8),
|
|
1859
|
+
return M(t, 0, z), n == null ? n = x : M(n, 0, 8), Y(new E(p), t + p.e + 1, n);
|
|
1862
1860
|
if (!(s = p.c)) return null;
|
|
1863
1861
|
if (u = ((o = s.length - 1) - te(this.e / k)) * k, o = s[o]) for (; o % 10 == 0; o /= 10, u--) ;
|
|
1864
1862
|
return u < 0 && (u = 0), u;
|
|
@@ -1867,20 +1865,20 @@ function et(e) {
|
|
|
1867
1865
|
}, d.dividedToIntegerBy = d.idiv = function(t, n) {
|
|
1868
1866
|
return a(this, new E(t, n), 0, 1);
|
|
1869
1867
|
}, d.exponentiatedBy = d.pow = function(t, n) {
|
|
1870
|
-
var s, u, o, p, m,
|
|
1868
|
+
var s, u, o, p, m, i, c, f, l, y = this;
|
|
1871
1869
|
if (t = new E(t), t.c && !t.isInteger())
|
|
1872
|
-
throw Error(
|
|
1873
|
-
if (n != null && (n = new E(n)),
|
|
1874
|
-
return l = new E(Math.pow(+de(y),
|
|
1870
|
+
throw Error(j + "Exponent not an integer: " + de(t));
|
|
1871
|
+
if (n != null && (n = new E(n)), i = t.e > 14, !y.c || !y.c[0] || y.c[0] == 1 && !y.e && y.c.length == 1 || !t.c || !t.c[0])
|
|
1872
|
+
return l = new E(Math.pow(+de(y), i ? t.s * (2 - Fe(t)) : +de(t))), n ? l.mod(n) : l;
|
|
1875
1873
|
if (c = t.s < 0, n) {
|
|
1876
1874
|
if (n.c ? !n.c[0] : !n.s) return new E(NaN);
|
|
1877
1875
|
u = !c && y.isInteger() && n.isInteger(), u && (y = y.mod(n));
|
|
1878
1876
|
} else {
|
|
1879
|
-
if (t.e > 9 && (y.e > 0 || y.e < -1 || (y.e == 0 ? y.c[0] > 1 ||
|
|
1877
|
+
if (t.e > 9 && (y.e > 0 || y.e < -1 || (y.e == 0 ? y.c[0] > 1 || i && y.c[1] >= 24e7 : y.c[0] < 8e13 || i && y.c[0] <= 9999975e7)))
|
|
1880
1878
|
return p = y.s < 0 && Fe(t) ? -0 : 0, y.e > -1 && (p = 1 / p), new E(c ? 1 / p : p);
|
|
1881
1879
|
P && (p = ve(P / k + 2));
|
|
1882
1880
|
}
|
|
1883
|
-
for (
|
|
1881
|
+
for (i ? (s = new E(0.5), c && (t.s = 1), f = Fe(t)) : (o = Math.abs(+de(t)), f = o % 2), l = new E(b); ; ) {
|
|
1884
1882
|
if (f) {
|
|
1885
1883
|
if (l = l.times(y), !l.c) break;
|
|
1886
1884
|
p ? l.c.length > p && (l.c.length = p) : u && (l = l.mod(n));
|
|
@@ -1888,7 +1886,7 @@ function et(e) {
|
|
|
1888
1886
|
if (o) {
|
|
1889
1887
|
if (o = ee(o / 2), o === 0) break;
|
|
1890
1888
|
f = o % 2;
|
|
1891
|
-
} else if (t = t.times(s),
|
|
1889
|
+
} else if (t = t.times(s), Y(t, t.e + 1, 1), t.e > 14)
|
|
1892
1890
|
f = Fe(t);
|
|
1893
1891
|
else {
|
|
1894
1892
|
if (o = +de(t), o === 0) break;
|
|
@@ -1896,10 +1894,10 @@ function et(e) {
|
|
|
1896
1894
|
}
|
|
1897
1895
|
y = y.times(y), p ? y.c && y.c.length > p && (y.c.length = p) : u && (y = y.mod(n));
|
|
1898
1896
|
}
|
|
1899
|
-
return u ? l : (c && (l = b.div(l)), n ? l.mod(n) : p ?
|
|
1897
|
+
return u ? l : (c && (l = b.div(l)), n ? l.mod(n) : p ? Y(l, P, x, m) : l);
|
|
1900
1898
|
}, d.integerValue = function(t) {
|
|
1901
1899
|
var n = new E(this);
|
|
1902
|
-
return t == null ? t = x : M(t, 0, 8),
|
|
1900
|
+
return t == null ? t = x : M(t, 0, 8), Y(n, n.e + 1, t);
|
|
1903
1901
|
}, d.isEqualTo = d.eq = function(t, n) {
|
|
1904
1902
|
return fe(this, new E(t, n)) === 0;
|
|
1905
1903
|
}, d.isFinite = function() {
|
|
@@ -1923,9 +1921,9 @@ function et(e) {
|
|
|
1923
1921
|
}, d.isZero = function() {
|
|
1924
1922
|
return !!this.c && this.c[0] == 0;
|
|
1925
1923
|
}, d.minus = function(t, n) {
|
|
1926
|
-
var s, u, o, p, m = this,
|
|
1927
|
-
if (t = new E(t, n), n = t.s, !
|
|
1928
|
-
if (
|
|
1924
|
+
var s, u, o, p, m = this, i = m.s;
|
|
1925
|
+
if (t = new E(t, n), n = t.s, !i || !n) return new E(NaN);
|
|
1926
|
+
if (i != n)
|
|
1929
1927
|
return t.s = -n, m.plus(t);
|
|
1930
1928
|
var c = m.e / k, f = t.e / k, l = m.c, y = t.c;
|
|
1931
1929
|
if (!c || !f) {
|
|
@@ -1936,17 +1934,17 @@ function et(e) {
|
|
|
1936
1934
|
x == 3 ? -0 : 0
|
|
1937
1935
|
));
|
|
1938
1936
|
}
|
|
1939
|
-
if (c = te(c), f = te(f), l = l.slice(),
|
|
1940
|
-
for ((p =
|
|
1937
|
+
if (c = te(c), f = te(f), l = l.slice(), i = c - f) {
|
|
1938
|
+
for ((p = i < 0) ? (i = -i, o = l) : (f = c, o = y), o.reverse(), n = i; n--; o.push(0)) ;
|
|
1941
1939
|
o.reverse();
|
|
1942
1940
|
} else
|
|
1943
|
-
for (u = (p = (
|
|
1941
|
+
for (u = (p = (i = l.length) < (n = y.length)) ? i : n, i = n = 0; n < u; n++)
|
|
1944
1942
|
if (l[n] != y[n]) {
|
|
1945
1943
|
p = l[n] < y[n];
|
|
1946
1944
|
break;
|
|
1947
1945
|
}
|
|
1948
1946
|
if (p && (o = l, l = y, y = o, t.s = -t.s), n = (u = y.length) - (s = l.length), n > 0) for (; n--; l[s++] = 0) ;
|
|
1949
|
-
for (n = ne - 1; u >
|
|
1947
|
+
for (n = ne - 1; u > i; ) {
|
|
1950
1948
|
if (l[--u] < y[u]) {
|
|
1951
1949
|
for (s = u; s && !l[--s]; l[s] = n) ;
|
|
1952
1950
|
--l[s], l[u] += ne;
|
|
@@ -1959,13 +1957,13 @@ function et(e) {
|
|
|
1959
1957
|
var s, u, o = this;
|
|
1960
1958
|
return t = new E(t, n), !o.c || !t.s || t.c && !t.c[0] ? new E(NaN) : !t.c || o.c && !o.c[0] ? new E(o) : (R == 9 ? (u = t.s, t.s = 1, s = a(o, t, 0, 3), t.s = u, s.s *= u) : s = a(o, t, 0, R), t = o.minus(s.times(t)), !t.c[0] && R == 1 && (t.s = o.s), t);
|
|
1961
1959
|
}, d.multipliedBy = d.times = function(t, n) {
|
|
1962
|
-
var s, u, o, p, m,
|
|
1963
|
-
if (!N || !
|
|
1964
|
-
return !_.s || !t.s || N && !N[0] && !
|
|
1965
|
-
for (u = te(_.e / k) + te(t.e / k), t.s *= _.s, c = N.length, y =
|
|
1960
|
+
var s, u, o, p, m, i, c, f, l, y, D, B, v, U, W, _ = this, N = _.c, H = (t = new E(t, n)).c;
|
|
1961
|
+
if (!N || !H || !N[0] || !H[0])
|
|
1962
|
+
return !_.s || !t.s || N && !N[0] && !H || H && !H[0] && !N ? t.c = t.e = t.s = null : (t.s *= _.s, !N || !H ? t.c = t.e = null : (t.c = [0], t.e = 0)), t;
|
|
1963
|
+
for (u = te(_.e / k) + te(t.e / k), t.s *= _.s, c = N.length, y = H.length, c < y && (v = N, N = H, H = v, o = c, c = y, y = o), o = c + y, v = []; o--; v.push(0)) ;
|
|
1966
1964
|
for (U = ne, W = ue, o = y; --o >= 0; ) {
|
|
1967
|
-
for (s = 0, D =
|
|
1968
|
-
f = N[--m] % W, l = N[m] / W | 0,
|
|
1965
|
+
for (s = 0, D = H[o] % W, B = H[o] / W | 0, m = c, p = o + m; p > o; )
|
|
1966
|
+
f = N[--m] % W, l = N[m] / W | 0, i = B * f + l * D, f = D * f + i % W * W + v[p] + s, s = (f / U | 0) + (i / W | 0) + B * l, v[p--] = f % U;
|
|
1969
1967
|
v[p] = s;
|
|
1970
1968
|
}
|
|
1971
1969
|
return s ? ++u : v.splice(0, 1), ye(t, v, u);
|
|
@@ -1977,22 +1975,22 @@ function et(e) {
|
|
|
1977
1975
|
if (t = new E(t, n), n = t.s, !o || !n) return new E(NaN);
|
|
1978
1976
|
if (o != n)
|
|
1979
1977
|
return t.s = -n, u.minus(t);
|
|
1980
|
-
var p = u.e / k, m = t.e / k,
|
|
1978
|
+
var p = u.e / k, m = t.e / k, i = u.c, c = t.c;
|
|
1981
1979
|
if (!p || !m) {
|
|
1982
|
-
if (!
|
|
1983
|
-
if (!
|
|
1980
|
+
if (!i || !c) return new E(o / 0);
|
|
1981
|
+
if (!i[0] || !c[0]) return c[0] ? t : new E(i[0] ? u : o * 0);
|
|
1984
1982
|
}
|
|
1985
|
-
if (p = te(p), m = te(m),
|
|
1986
|
-
for (o > 0 ? (m = p, s = c) : (o = -o, s =
|
|
1983
|
+
if (p = te(p), m = te(m), i = i.slice(), o = p - m) {
|
|
1984
|
+
for (o > 0 ? (m = p, s = c) : (o = -o, s = i), s.reverse(); o--; s.push(0)) ;
|
|
1987
1985
|
s.reverse();
|
|
1988
1986
|
}
|
|
1989
|
-
for (o =
|
|
1990
|
-
o = (
|
|
1991
|
-
return o && (
|
|
1987
|
+
for (o = i.length, n = c.length, o - n < 0 && (s = c, c = i, i = s, n = o), o = 0; n; )
|
|
1988
|
+
o = (i[--n] = i[n] + c[n] + o) / ne | 0, i[n] = ne === i[n] ? 0 : i[n] % ne;
|
|
1989
|
+
return o && (i = [o].concat(i), ++m), ye(t, i, m);
|
|
1992
1990
|
}, d.precision = d.sd = function(t, n) {
|
|
1993
1991
|
var s, u, o, p = this;
|
|
1994
1992
|
if (t != null && t !== !!t)
|
|
1995
|
-
return M(t, 1, z), n == null ? n = x : M(n, 0, 8),
|
|
1993
|
+
return M(t, 1, z), n == null ? n = x : M(n, 0, 8), Y(new E(p), t, n);
|
|
1996
1994
|
if (!(s = p.c)) return null;
|
|
1997
1995
|
if (o = s.length - 1, u = o * k + 1, o = s[o]) {
|
|
1998
1996
|
for (; o % 10 == 0; o /= 10, u--) ;
|
|
@@ -2002,24 +2000,24 @@ function et(e) {
|
|
|
2002
2000
|
}, d.shiftedBy = function(t) {
|
|
2003
2001
|
return M(t, -Re, Re), this.times("1e" + t);
|
|
2004
2002
|
}, d.squareRoot = d.sqrt = function() {
|
|
2005
|
-
var t, n, s, u, o, p = this, m = p.c,
|
|
2006
|
-
if (
|
|
2007
|
-
return new E(!
|
|
2008
|
-
if (
|
|
2009
|
-
for (c = s.e,
|
|
2010
|
-
if (o = s, s = l.times(o.plus(a(p, o, f, 1))), J(o.c).slice(0,
|
|
2011
|
-
if (s.e < c && --
|
|
2012
|
-
if (!u && (
|
|
2003
|
+
var t, n, s, u, o, p = this, m = p.c, i = p.s, c = p.e, f = h + 4, l = new E("0.5");
|
|
2004
|
+
if (i !== 1 || !m || !m[0])
|
|
2005
|
+
return new E(!i || i < 0 && (!m || m[0]) ? NaN : m ? p : 1 / 0);
|
|
2006
|
+
if (i = Math.sqrt(+de(p)), i == 0 || i == 1 / 0 ? (n = J(m), (n.length + c) % 2 == 0 && (n += "0"), i = Math.sqrt(+n), c = te((c + 1) / 2) - (c < 0 || c % 2), i == 1 / 0 ? n = "5e" + c : (n = i.toExponential(), n = n.slice(0, n.indexOf("e") + 1) + c), s = new E(n)) : s = new E(i + ""), s.c[0]) {
|
|
2007
|
+
for (c = s.e, i = c + f, i < 3 && (i = 0); ; )
|
|
2008
|
+
if (o = s, s = l.times(o.plus(a(p, o, f, 1))), J(o.c).slice(0, i) === (n = J(s.c)).slice(0, i))
|
|
2009
|
+
if (s.e < c && --i, n = n.slice(i - 3, i + 1), n == "9999" || !u && n == "4999") {
|
|
2010
|
+
if (!u && (Y(o, o.e + h + 2, 0), o.times(o).eq(p))) {
|
|
2013
2011
|
s = o;
|
|
2014
2012
|
break;
|
|
2015
2013
|
}
|
|
2016
|
-
f += 4,
|
|
2014
|
+
f += 4, i += 4, u = 1;
|
|
2017
2015
|
} else {
|
|
2018
|
-
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (
|
|
2016
|
+
(!+n || !+n.slice(1) && n.charAt(0) == "5") && (Y(s, s.e + h + 2, 1), t = !s.times(s).eq(p));
|
|
2019
2017
|
break;
|
|
2020
2018
|
}
|
|
2021
2019
|
}
|
|
2022
|
-
return
|
|
2020
|
+
return Y(s, s.e + h + 1, x, t);
|
|
2023
2021
|
}, d.toExponential = function(t, n) {
|
|
2024
2022
|
return t != null && (M(t, 0, z), t++), be(this, t, n, 1);
|
|
2025
2023
|
}, d.toFixed = function(t, n) {
|
|
@@ -2027,13 +2025,13 @@ function et(e) {
|
|
|
2027
2025
|
}, d.toFormat = function(t, n, s) {
|
|
2028
2026
|
var u, o = this;
|
|
2029
2027
|
if (s == null)
|
|
2030
|
-
t != null && n && typeof n == "object" ? (s = n, n = null) : t && typeof t == "object" ? (s = t, t = n = null) : s =
|
|
2028
|
+
t != null && n && typeof n == "object" ? (s = n, n = null) : t && typeof t == "object" ? (s = t, t = n = null) : s = K;
|
|
2031
2029
|
else if (typeof s != "object")
|
|
2032
|
-
throw Error(
|
|
2030
|
+
throw Error(j + "Argument not an object: " + s);
|
|
2033
2031
|
if (u = o.toFixed(t, n), o.c) {
|
|
2034
|
-
var p, m = u.split("."),
|
|
2035
|
-
if (c && (p =
|
|
2036
|
-
for (p = v %
|
|
2032
|
+
var p, m = u.split("."), i = +s.groupSize, c = +s.secondaryGroupSize, f = s.groupSeparator || "", l = m[0], y = m[1], D = o.s < 0, B = D ? l.slice(1) : l, v = B.length;
|
|
2033
|
+
if (c && (p = i, i = c, c = p, v -= p), i > 0 && v > 0) {
|
|
2034
|
+
for (p = v % i || i, l = B.substr(0, p); p < v; p += i) l += f + B.substr(p, i);
|
|
2037
2035
|
c > 0 && (l += f + B.slice(p)), D && (l = "-" + l);
|
|
2038
2036
|
}
|
|
2039
2037
|
u = y ? l + (s.decimalSeparator || "") + ((c = +s.fractionGroupSize) ? y.replace(
|
|
@@ -2043,12 +2041,12 @@ function et(e) {
|
|
|
2043
2041
|
}
|
|
2044
2042
|
return (s.prefix || "") + u + (s.suffix || "");
|
|
2045
2043
|
}, d.toFraction = function(t) {
|
|
2046
|
-
var n, s, u, o, p, m,
|
|
2047
|
-
if (t != null && (
|
|
2048
|
-
throw Error(
|
|
2044
|
+
var n, s, u, o, p, m, i, c, f, l, y, D, B = this, v = B.c;
|
|
2045
|
+
if (t != null && (i = new E(t), !i.isInteger() && (i.c || i.s !== 1) || i.lt(b)))
|
|
2046
|
+
throw Error(j + "Argument " + (i.isInteger() ? "out of range: " : "not an integer: ") + de(i));
|
|
2049
2047
|
if (!v) return new E(B);
|
|
2050
|
-
for (n = new E(b), f = s = new E(b), u = c = new E(b), D = J(v), p = n.e = D.length - B.e - 1, n.c[0] = Pe[(m = p % k) < 0 ? k + m : m], t = !t ||
|
|
2051
|
-
s = u, u = o, f = c.plus(l.times(o = f)), c = o, n =
|
|
2048
|
+
for (n = new E(b), f = s = new E(b), u = c = new E(b), D = J(v), p = n.e = D.length - B.e - 1, n.c[0] = Pe[(m = p % k) < 0 ? k + m : m], t = !t || i.comparedTo(n) > 0 ? p > 0 ? n : f : i, m = F, F = 1 / 0, i = new E(D), c.c[0] = 0; l = a(i, n, 0, 1), o = s.plus(l.times(u)), o.comparedTo(t) != 1; )
|
|
2049
|
+
s = u, u = o, f = c.plus(l.times(o = f)), c = o, n = i.minus(l.times(o = n)), i = o;
|
|
2052
2050
|
return o = a(t.minus(s), u, 0, 1), c = c.plus(o.times(f)), s = s.plus(o.times(u)), c.s = f.s = B.s, p = p * 2, y = a(f, u, p, x).minus(B).abs().comparedTo(
|
|
2053
2051
|
a(c, s, p, x).minus(B).abs()
|
|
2054
2052
|
) < 1 ? [f, u] : [c, s], F = m, y;
|
|
@@ -2058,7 +2056,7 @@ function et(e) {
|
|
|
2058
2056
|
return t != null && M(t, 1, z), be(this, t, n, 2);
|
|
2059
2057
|
}, d.toString = function(t) {
|
|
2060
2058
|
var n, s = this, u = s.s, o = s.e;
|
|
2061
|
-
return o === null ? u ? (n = "Infinity", u < 0 && (n = "-" + n)) : n = "NaN" : (t == null ? n = o <= C || o >=
|
|
2059
|
+
return o === null ? u ? (n = "Infinity", u < 0 && (n = "-" + n)) : n = "NaN" : (t == null ? n = o <= C || o >= T ? Te(J(s.c), o) : ce(J(s.c), o, "0") : t === 10 && le ? (s = Y(new E(s), h + o + 1, x), n = ce(J(s.c), s.e, "0")) : (M(t, 2, Q.length, "Base"), n = r(ce(J(s.c), o, "0"), 10, t, u, !0)), u < 0 && s.c[0] && (n = "-" + n)), n;
|
|
2062
2060
|
}, d.valueOf = d.toJSON = function() {
|
|
2063
2061
|
return de(this);
|
|
2064
2062
|
}, d._isBigNumber = !0, d[Symbol.toStringTag] = "BigNumber", d[Symbol.for("nodejs.util.inspect.custom")] = d.valueOf, e != null && E.set(e), E;
|
|
@@ -2068,26 +2066,26 @@ function te(e) {
|
|
|
2068
2066
|
return e > 0 || e === a ? a : a - 1;
|
|
2069
2067
|
}
|
|
2070
2068
|
function J(e) {
|
|
2071
|
-
for (var a,
|
|
2072
|
-
for (a = e[A++] + "",
|
|
2069
|
+
for (var a, r, A = 1, d = e.length, b = e[0] + ""; A < d; ) {
|
|
2070
|
+
for (a = e[A++] + "", r = k - a.length; r--; a = "0" + a) ;
|
|
2073
2071
|
b += a;
|
|
2074
2072
|
}
|
|
2075
2073
|
for (d = b.length; b.charCodeAt(--d) === 48; ) ;
|
|
2076
2074
|
return b.slice(0, d + 1 || 1);
|
|
2077
2075
|
}
|
|
2078
2076
|
function fe(e, a) {
|
|
2079
|
-
var
|
|
2077
|
+
var r, A, d = e.c, b = a.c, h = e.s, x = a.s, C = e.e, T = a.e;
|
|
2080
2078
|
if (!h || !x) return null;
|
|
2081
|
-
if (
|
|
2079
|
+
if (r = d && !d[0], A = b && !b[0], r || A) return r ? A ? 0 : -x : h;
|
|
2082
2080
|
if (h != x) return h;
|
|
2083
|
-
if (
|
|
2084
|
-
if (!A) return C >
|
|
2085
|
-
for (x = (C = d.length) < (
|
|
2086
|
-
return C ==
|
|
2081
|
+
if (r = h < 0, A = C == T, !d || !b) return A ? 0 : !d ^ r ? 1 : -1;
|
|
2082
|
+
if (!A) return C > T ^ r ? 1 : -1;
|
|
2083
|
+
for (x = (C = d.length) < (T = b.length) ? C : T, h = 0; h < x; h++) if (d[h] != b[h]) return d[h] > b[h] ^ r ? 1 : -1;
|
|
2084
|
+
return C == T ? 0 : C > T ^ r ? 1 : -1;
|
|
2087
2085
|
}
|
|
2088
|
-
function M(e, a,
|
|
2089
|
-
if (e < a || e >
|
|
2090
|
-
throw Error(
|
|
2086
|
+
function M(e, a, r, A) {
|
|
2087
|
+
if (e < a || e > r || e !== ee(e))
|
|
2088
|
+
throw Error(j + (A || "Argument") + (typeof e == "number" ? e < a || e > r ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(e));
|
|
2091
2089
|
}
|
|
2092
2090
|
function Fe(e) {
|
|
2093
2091
|
var a = e.c.length - 1;
|
|
@@ -2096,13 +2094,13 @@ function Fe(e) {
|
|
|
2096
2094
|
function Te(e, a) {
|
|
2097
2095
|
return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (a < 0 ? "e" : "e+") + a;
|
|
2098
2096
|
}
|
|
2099
|
-
function ce(e, a,
|
|
2097
|
+
function ce(e, a, r) {
|
|
2100
2098
|
var A, d;
|
|
2101
2099
|
if (a < 0) {
|
|
2102
|
-
for (d =
|
|
2100
|
+
for (d = r + "."; ++a; d += r) ;
|
|
2103
2101
|
e = d + e;
|
|
2104
2102
|
} else if (A = e.length, ++a > A) {
|
|
2105
|
-
for (d =
|
|
2103
|
+
for (d = r, a -= A; --a; d += r) ;
|
|
2106
2104
|
e += d;
|
|
2107
2105
|
} else a < A && (e = e.slice(0, a) + "." + e.slice(a));
|
|
2108
2106
|
return e;
|
|
@@ -2130,13 +2128,13 @@ const ra = {
|
|
|
2130
2128
|
59144: { adapter: { Nordstern: "0xA9c6c1F14c1d0eF2ab6ec79E5dcF0ff3a3680F05", Orbs: "0x917b492557957f5dD3e69c04c8E1Ac3d6948c022", OpenOcean: "0xd2e68b1d1C5DBB2D6cC396c10C55017e01309C37", Kyber: "0x6bbE14b2205a87FA0EAdE5f0795C7bb16B5347EA", Sushi: "0xA985f801ea74321AdcC9Ef88B394858CbA3F71ba", Magpie: "0xBcFd0eE2C44136526dcA007e41e4f3DDD32A0Bd2" }, dex: { pancake: { type: "p2", solver: "Orbs", router: "0xFE6508f0015C778Bdcc1fB5465bA5ebE224C9912", permit2: "0x31c2F6fcFf4F8759b3Bd5Bf0e1084A055615c768", adapter: "0xA7CcB11F1D20D1F915FC220F5Cb1646E4523bB75", fee: "0x37A957f10F458e0d7fDECBE2917971b57F15c927" }, lynex: { type: "default", solver: "OpenOcean", router: "0x6352a56caadC4F1E25CD6c75970Fa768A3304e64", adapter: "0xd8bC1FF79a642e8D7Fbd0711374F287202fBb3AA", fee: "0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423" } } },
|
|
2131
2129
|
80094: { adapter: { Nordstern: "0x763Fb927d181bCE8be779794A030BCE45D4869fA", Kodiak: "0xcB16237c88A859d46Ae850B97d7D1bdECF482C06", Kyber: "0x6bbE14b2205a87FA0EAdE5f0795C7bb16B5347EA", OpenOcean: "0x2Be5260d030ff9A6040bA4292326B796ff1a055d", Magpie: "0xBcFd0eE2C44136526dcA007e41e4f3DDD32A0Bd2", Sushi: "0xA985f801ea74321AdcC9Ef88B394858CbA3F71ba" }, dex: { kodiak: { type: "default", solver: "Kodiak", router: "0x43Dac637c4383f91B4368041E7A8687da3806Cae", adapter: "0xcB16237c88A859d46Ae850B97d7D1bdECF482C06", fee: "0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4" } } },
|
|
2132
2130
|
747474: { adapter: { Nordstern: "0xd16A1849E86431872a87f476fa0DfB30eEb96cb3", Sushi: "0x11985E88847aEC23D1C3BCD77Ca0F4A704aB751c" }, dex: { sushiswap: { type: "default", solver: "Sushi", router: "0xAC4c6e212A361c968F1725b4d055b47E63F80b75", adapter: "0x2e43A28FAf083717CcD9B246d97C61E1Bc9914Df", fee: "0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc" } } },
|
|
2133
|
-
"*": { wm: "0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000", repermit: "0x00002a9C4D9497df5Bd31768eC5d30eEf5405000", cosigner: "0x000ECFa392ecDEfEE6e2a5C095d39B7A32f1E000", reactor: "0x000000b33fE4fB9d999Dd684F79b110731c3d000", executor: "0x000642A0966d9bd49870D9519f76b5cf823f3000", refinery: "0x000E474c0D7084EAA35A501035E73269f4b009A5", salt: { wm: "0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152", repermit: "0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7", cosigner: "0x1117fe6f4e25c9380d10b2b3314a1e9b33e5f65ba0e55e0c63d0640db0dd60a2", reactor: "0xec73677f3a465a9755d4c9eab9509b59a24613fdb8b78719682930373e9876f5", executor: "0x9abc67d936f79e493f1f14050c2f6adb87ec208ff7aaae2e7ae788a7cb4796d7", refinery: "0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec", agentAdapter: "0xf6d54cf6a0619f1fb8e1ded91d4c23e7bb9f498c56735fb0c7669423c766219f", agentFee: "0x151234279af18acc113f70463977058efa2e598b5bfc0c106c75fd638d344c0a", utilaAdapter: "0x7671291910b559d7a05ab73ee31dd714d9c6e7b065c9496338bf427182ae5145", utilaFee: "0x46f797cddb221ecf6279b56f52e2f6360cd721ef95bd5a17dd0ffceffaaf7fd6", efAdapter: "0xa5425e0f84a7cf12c4213f57396810d808d88e43a65210786bd0d9a98a314728", efFee: "0x14387b821c54f18e2a9351887a92cc79164a5ea0b88cfc3f36741eae6d4fd815", htAdapter: "0x2ec50a8a136049da76c16f3dd12a8ed1b23f2bc91aca73c6a20cc8344e34f998", htFee: "0x2f902a86a7f6abeedc073e76cd33d4737f25189e18c8f450f16d2ffe14405242" }, dex: { agent: { type: "universal", adapter: "0x0002BeFB46587d460AcEA9B2792c4A4c67B9cADa", fee: "0x0006d9557Ac9Af4f31962896299ba4FaBDaB9fEE" }, utila: { type: "universal", adapter: "0x000ADa14B2ECF45Da6Cf1B33dE34e05231E9C76f", fee: "0x000FEee351263c82501a4dF5f699a8b630ac7f36" }, ef: { type: "universal", adapter: "0xeF1B796D708BD776F6b377E93eAd8Ca5fA0C3117", fee: "0xeF1D677d7aE1a066beb26cC1C74E31C082B75FEf" }, ht: { type: "universal", adapter: "0xA560a960C3b7784f5c335C33028D31596b91650b", fee: "0xE7a926C0cb01aCCE74e5d4FCeB7CA1699e200608" } } }
|
|
2131
|
+
"*": { wm: "0x0005d5cE0dB57e5BE3b2b8b6FeB75f0ccd015000", repermit: "0x00002a9C4D9497df5Bd31768eC5d30eEf5405000", cosigner: "0x000ECFa392ecDEfEE6e2a5C095d39B7A32f1E000", reactor: "0x000000b33fE4fB9d999Dd684F79b110731c3d000", executor: "0x000642A0966d9bd49870D9519f76b5cf823f3000", refinery: "0x000E474c0D7084EAA35A501035E73269f4b009A5", salt: { wm: "0xc9b46eae42dfeba3222a0315bf682f33cd5cc9d60c9625642e88406f8415f152", repermit: "0x4871dc9008e605821ea9677b65ea2a60ffb774afb31e0dcaea2e192880096be7", cosigner: "0x1117fe6f4e25c9380d10b2b3314a1e9b33e5f65ba0e55e0c63d0640db0dd60a2", reactor: "0xec73677f3a465a9755d4c9eab9509b59a24613fdb8b78719682930373e9876f5", executor: "0x9abc67d936f79e493f1f14050c2f6adb87ec208ff7aaae2e7ae788a7cb4796d7", refinery: "0x9746de29f1dd31b2c8460d71e92a7aefa34911130e61f274f37776e598c48bec", agentAdapter: "0xf6d54cf6a0619f1fb8e1ded91d4c23e7bb9f498c56735fb0c7669423c766219f", agentFee: "0x151234279af18acc113f70463977058efa2e598b5bfc0c106c75fd638d344c0a", utilaAdapter: "0x7671291910b559d7a05ab73ee31dd714d9c6e7b065c9496338bf427182ae5145", utilaFee: "0x46f797cddb221ecf6279b56f52e2f6360cd721ef95bd5a17dd0ffceffaaf7fd6", efAdapter: "0xa5425e0f84a7cf12c4213f57396810d808d88e43a65210786bd0d9a98a314728", efFee: "0x14387b821c54f18e2a9351887a92cc79164a5ea0b88cfc3f36741eae6d4fd815", htAdapter: "0x2ec50a8a136049da76c16f3dd12a8ed1b23f2bc91aca73c6a20cc8344e34f998", htFee: "0x2f902a86a7f6abeedc073e76cd33d4737f25189e18c8f450f16d2ffe14405242" }, dex: { agent: { type: "universal", adapter: "0x0002BeFB46587d460AcEA9B2792c4A4c67B9cADa", fee: "0x0006d9557Ac9Af4f31962896299ba4FaBDaB9fEE" }, utila: { type: "universal", adapter: "0x000ADa14B2ECF45Da6Cf1B33dE34e05231E9C76f", fee: "0x000FEee351263c82501a4dF5f699a8b630ac7f36" }, ef: { type: "universal", adapter: "0xeF1B796D708BD776F6b377E93eAd8Ca5fA0C3117", fee: "0xeF1D677d7aE1a066beb26cC1C74E31C082B75FEf" }, ht: { type: "universal", adapter: "0xA560a960C3b7784f5c335C33028D31596b91650b", fee: "0xE7a926C0cb01aCCE74e5d4FCeB7CA1699e200608" }, ginco: { type: "universal", adapter: "0x96604C3E846BBa75c43B5518bd076851e5484197", fee: "0xCf2eB80A89A69aB17e295aeF033Ffe9564736155" } } }
|
|
2134
2132
|
};
|
|
2135
2133
|
var Ne, Xe;
|
|
2136
2134
|
function ia() {
|
|
2137
2135
|
if (Xe) return Ne;
|
|
2138
2136
|
Xe = 1;
|
|
2139
|
-
const e = ra, a = (b) => sa(`./out/${b}.sol/${b}.abi.json`),
|
|
2137
|
+
const e = ra, a = (b) => sa(`./out/${b}.sol/${b}.abi.json`), r = () => ({
|
|
2140
2138
|
wm: a("WM"),
|
|
2141
2139
|
repermit: a("RePermit"),
|
|
2142
2140
|
reactor: a("OrderReactor"),
|
|
@@ -2154,21 +2152,21 @@ function ia() {
|
|
|
2154
2152
|
}
|
|
2155
2153
|
function d(b, h) {
|
|
2156
2154
|
if (!b) return;
|
|
2157
|
-
const { dex: x, salt: C, ...
|
|
2155
|
+
const { dex: x, salt: C, ...T } = e["*"] ?? {}, S = e[b];
|
|
2158
2156
|
if (!S) return;
|
|
2159
|
-
const { dex: F, salt:
|
|
2160
|
-
if (!
|
|
2161
|
-
const
|
|
2162
|
-
if (!(!
|
|
2163
|
-
return { ...P, ...
|
|
2157
|
+
const { dex: F, salt: w, ...R } = S, P = { ...T, ...R }, K = h == null ? void 0 : h.trim();
|
|
2158
|
+
if (!K) return P;
|
|
2159
|
+
const Q = x == null ? void 0 : x[K], le = F == null ? void 0 : F[K];
|
|
2160
|
+
if (!(!Q && !le))
|
|
2161
|
+
return { ...P, ...Q, ...le };
|
|
2164
2162
|
}
|
|
2165
|
-
return Ne = { config: d, adapters: A, abis:
|
|
2163
|
+
return Ne = { config: d, adapters: A, abis: r, raw: e }, Ne;
|
|
2166
2164
|
}
|
|
2167
2165
|
var tt = ia();
|
|
2168
2166
|
const Ae = (e, a) => {
|
|
2169
|
-
if (
|
|
2170
|
-
const
|
|
2171
|
-
return g(a).times(
|
|
2167
|
+
if (e == null || !a) return "";
|
|
2168
|
+
const r = g(10).pow(e);
|
|
2169
|
+
return g(a).times(r).idiv(r).div(r).toFixed();
|
|
2172
2170
|
};
|
|
2173
2171
|
g(0);
|
|
2174
2172
|
g(1);
|
|
@@ -2186,77 +2184,77 @@ function oa(e) {
|
|
|
2186
2184
|
re.Days,
|
|
2187
2185
|
re.Hours,
|
|
2188
2186
|
re.Minutes
|
|
2189
|
-
].find((
|
|
2187
|
+
].find((r) => r <= e) || re.Minutes;
|
|
2190
2188
|
}
|
|
2191
2189
|
const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0" : g(e).decimalPlaces(0).toFixed(), dn = (e) => Object.values(q).find((a) => a.id === e), ca = (e) => {
|
|
2192
2190
|
if (!e) return;
|
|
2193
|
-
const a = e.map((b) =>
|
|
2194
|
-
[...A, ...
|
|
2191
|
+
const a = e.map((b) => X(b)), r = Object.entries(ea).filter(([b]) => a.includes(b)).flatMap(([, b]) => b), A = e.map((b) => b.exchangeAddress), d = new Set(
|
|
2192
|
+
[...A, ...r].map((b) => b.toLowerCase())
|
|
2195
2193
|
);
|
|
2196
2194
|
return Array.from(d);
|
|
2197
|
-
}, cn = (e, a) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + la(a) : (e.fillDelay || 0) * 1e3, Se = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), pn = (e) => ma().filter((a) => a.name === e).map((a) => a.chainId), ln = (e = "", a = "",
|
|
2195
|
+
}, cn = (e, a) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + la(a) : (e.fillDelay || 0) * 1e3, Se = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), pn = (e) => ma().filter((a) => a.name === e).map((a) => a.chainId), ln = (e = "", a = "", r = 18, A = 18) => {
|
|
2198
2196
|
if (!g(e || 0).gt(0) || !g(a || 0).gt(0))
|
|
2199
2197
|
return "";
|
|
2200
|
-
const d = Ae(
|
|
2198
|
+
const d = Ae(r, e), b = Ae(A, a);
|
|
2201
2199
|
return g(b).div(d).toFixed();
|
|
2202
|
-
}, un = (e, a,
|
|
2200
|
+
}, un = (e, a, r) => {
|
|
2203
2201
|
if (e.type === V.TWAP_MARKET) return "";
|
|
2204
|
-
const A = Ae(a, e.srcAmountPerTrade), d = Ae(
|
|
2202
|
+
const A = Ae(a, e.srcAmountPerTrade), d = Ae(r, e.dstMinAmountPerTrade);
|
|
2205
2203
|
return g(d).div(A).toFixed();
|
|
2206
|
-
}, fn = (e, a,
|
|
2204
|
+
}, fn = (e, a, r) => {
|
|
2207
2205
|
if (e.type === V.TWAP_MARKET) return "";
|
|
2208
|
-
const A = Ae(a, e.srcAmountPerTrade), d = Ae(
|
|
2206
|
+
const A = Ae(a, e.srcAmountPerTrade), d = Ae(r, e.triggerPricePerTrade);
|
|
2209
2207
|
return g(d).div(A).toFixed();
|
|
2210
|
-
}, pa = /* @__PURE__ */ new Set([1, 56, 42161, 8453]), at = (e, a) => e === se.Ring ? pa.has(a) : !0, mn = (e, a,
|
|
2211
|
-
if (!e || !a ||
|
|
2212
|
-
const A = g(e).times(a), d = g(10).pow(
|
|
2208
|
+
}, pa = /* @__PURE__ */ new Set([1, 56, 42161, 8453]), at = (e, a) => e === se.Ring ? pa.has(a) : !0, mn = (e, a, r) => {
|
|
2209
|
+
if (!e || !a || r == null) return;
|
|
2210
|
+
const A = g(e).times(a), d = g(10).pow(r);
|
|
2213
2211
|
return A.div(d).toFixed(0);
|
|
2214
|
-
}, An = (e, a,
|
|
2215
|
-
if (
|
|
2212
|
+
}, An = (e, a, r, A) => {
|
|
2213
|
+
if (r || A == null || !e || !a)
|
|
2216
2214
|
return g(0).toString();
|
|
2217
2215
|
const d = g(e).times(g(a)), b = g(10).pow(A), h = d.div(b);
|
|
2218
2216
|
return g.max(1, h).integerValue(g.ROUND_FLOOR).toFixed(0);
|
|
2219
|
-
}, bn = (e, a,
|
|
2220
|
-
if (e ===
|
|
2217
|
+
}, bn = (e, a, r, A) => {
|
|
2218
|
+
if (e === $.TWAP || e === $.LIMIT)
|
|
2221
2219
|
return "0";
|
|
2222
|
-
if (
|
|
2223
|
-
const d = g(a).times(g(
|
|
2220
|
+
if (A == null || !a || !r) return;
|
|
2221
|
+
const d = g(a).times(g(r)), b = g(10).pow(A), h = d.div(b);
|
|
2224
2222
|
return g.max(1, h).integerValue(g.ROUND_FLOOR).toFixed(0) || "0";
|
|
2225
|
-
}, yn = (e, a,
|
|
2226
|
-
const d = me(
|
|
2227
|
-
return b ? { unit: h, value: Number(g(Number(b) / h).toFixed(2)) } : A || (e ===
|
|
2228
|
-
}, hn = (e, a,
|
|
2229
|
-
if (!e || !a || !
|
|
2230
|
-
const d = g(a).times(e).div(
|
|
2223
|
+
}, yn = (e, a, r, A) => {
|
|
2224
|
+
const d = me(r) * 2 * a, b = Se(Ee.DURATION), h = oa(b ? Number(b) : d);
|
|
2225
|
+
return b ? { unit: h, value: Number(g(Number(b) / h).toFixed(2)) } : A || (e === $.LIMIT ? { unit: re.Days, value: 7 } : e === $.STOP_LOSS || e === $.TAKE_PROFIT ? { unit: re.Days, value: 1 } : { unit: h, value: Number(g(d / h).toFixed(2)) });
|
|
2226
|
+
}, hn = (e, a, r) => a !== $.TWAP ? 1 : r !== void 0 ? r : Math.max(1, Math.ceil(e / 2)), En = (e, a, r) => {
|
|
2227
|
+
if (!e || !a || !r) return 1;
|
|
2228
|
+
const d = g(a).times(e).div(r).integerValue(g.ROUND_FLOOR).toNumber();
|
|
2231
2229
|
return Math.max(1, d);
|
|
2232
2230
|
}, xn = (e, a) => e + me(a) + 6e4, la = (e) => e.bidDelaySeconds * 1e3 * 2, gn = (e = "", a = 0) => !e || !a ? "0" : g(e).div(a).integerValue(g.ROUND_FLOOR).toFixed(0), Cn = (e, a) => ({
|
|
2233
|
-
isError: !(e.unit ===
|
|
2231
|
+
isError: !(e.unit === Ge.unit && e.value === Ge.value) && me(e) * a > De,
|
|
2234
2232
|
value: Math.floor(De / a)
|
|
2235
|
-
}), Fn = (e = "", a = "",
|
|
2236
|
-
if (
|
|
2233
|
+
}), Fn = (e = "", a = "", r) => {
|
|
2234
|
+
if (r === $.STOP_LOSS)
|
|
2237
2235
|
return {
|
|
2238
2236
|
isError: g(a || 0).gte(g(e || 0)),
|
|
2239
2237
|
value: e
|
|
2240
2238
|
};
|
|
2241
|
-
}, Tn = (e = "", a = "",
|
|
2242
|
-
if (
|
|
2239
|
+
}, Tn = (e = "", a = "", r) => {
|
|
2240
|
+
if (r === $.TAKE_PROFIT)
|
|
2243
2241
|
return {
|
|
2244
2242
|
isError: g(a || 0).lte(g(e || 0)),
|
|
2245
2243
|
value: e
|
|
2246
2244
|
};
|
|
2247
|
-
}, wn = (e = "", a = "",
|
|
2248
|
-
if (!
|
|
2245
|
+
}, wn = (e = "", a = "", r = !1, A) => {
|
|
2246
|
+
if (!r && A === $.STOP_LOSS)
|
|
2249
2247
|
return {
|
|
2250
2248
|
isError: g(a || 0).gte(g(e || 0)),
|
|
2251
2249
|
value: e
|
|
2252
2250
|
};
|
|
2253
|
-
}, Dn = (e = "", a = "",
|
|
2254
|
-
if (!
|
|
2251
|
+
}, Dn = (e = "", a = "", r = !1, A) => {
|
|
2252
|
+
if (!r && A === $.TAKE_PROFIT)
|
|
2255
2253
|
return {
|
|
2256
2254
|
isError: g(a || 0).gte(g(e || 0)),
|
|
2257
2255
|
value: e
|
|
2258
2256
|
};
|
|
2259
|
-
}, Bn = (e, a) => e ===
|
|
2257
|
+
}, Bn = (e, a) => e === $.STOP_LOSS || e === $.TAKE_PROFIT ? {
|
|
2260
2258
|
isError: me(a) > 5184e6,
|
|
2261
2259
|
value: 5184e6
|
|
2262
2260
|
} : {
|
|
@@ -2269,11 +2267,11 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2269
2267
|
}), kn = (e) => ({
|
|
2270
2268
|
isError: me(e) < Ue,
|
|
2271
2269
|
value: Ue
|
|
2272
|
-
}), On = (e, a,
|
|
2273
|
-
isError: g(a || 0).multipliedBy(e || 0).isLessThan(
|
|
2274
|
-
value:
|
|
2275
|
-
}), _n = (e, a,
|
|
2276
|
-
isError:
|
|
2270
|
+
}), On = (e, a, r) => ({
|
|
2271
|
+
isError: g(a || 0).multipliedBy(e || 0).isLessThan(r),
|
|
2272
|
+
value: r
|
|
2273
|
+
}), _n = (e, a, r) => ({
|
|
2274
|
+
isError: r === $.TWAP && g(e).isGreaterThan(a),
|
|
2277
2275
|
value: a
|
|
2278
2276
|
}), ua = (e, a) => {
|
|
2279
2277
|
if (e === se.Pancake)
|
|
@@ -2353,7 +2351,7 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2353
2351
|
throw new Error(
|
|
2354
2352
|
`Partner "${e}" is not supported on chain ${a}`
|
|
2355
2353
|
);
|
|
2356
|
-
const { abi:
|
|
2354
|
+
const { abi: r, ...A } = tt.config(a, e);
|
|
2357
2355
|
if (!A.reactor)
|
|
2358
2356
|
throw new Error(
|
|
2359
2357
|
`Missing config for partner "${e}" on chain ${a}: reactor address not found`
|
|
@@ -2364,8 +2362,8 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2364
2362
|
twapConfig: ua(e, a)
|
|
2365
2363
|
};
|
|
2366
2364
|
}, ma = () => {
|
|
2367
|
-
var
|
|
2368
|
-
const e = tt.raw, a = ((
|
|
2365
|
+
var r;
|
|
2366
|
+
const e = tt.raw, a = ((r = e["*"]) == null ? void 0 : r.dex) ?? {};
|
|
2369
2367
|
return Object.entries(e).filter(([A]) => A !== "*").flatMap(([A, d]) => {
|
|
2370
2368
|
const b = Number(A), h = { ...a, ...(d == null ? void 0 : d.dex) ?? {} };
|
|
2371
2369
|
return !h || typeof h != "object" ? [] : Object.entries(h).flatMap(([x]) => {
|
|
@@ -2387,22 +2385,22 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2387
2385
|
}, Rn = ({
|
|
2388
2386
|
marketPrice: e,
|
|
2389
2387
|
typedInputAmount: a,
|
|
2390
|
-
srcUsd1Token:
|
|
2388
|
+
srcUsd1Token: r,
|
|
2391
2389
|
marketPriceLoading: A,
|
|
2392
2390
|
triggerPriceError: d,
|
|
2393
2391
|
limitPriceError: b,
|
|
2394
2392
|
tradesError: h,
|
|
2395
2393
|
fillDelayError: x,
|
|
2396
2394
|
durationError: C,
|
|
2397
|
-
balanceError:
|
|
2395
|
+
balanceError: T,
|
|
2398
2396
|
minTradeSizeError: S
|
|
2399
2397
|
}) => {
|
|
2400
|
-
if (!Se(Ee.IGNORE_ERRORS) && !(g(e || 0).isZero() || g(a || 0).isZero() || g(
|
|
2401
|
-
return S || d || b || h || x || C ||
|
|
2398
|
+
if (!Se(Ee.IGNORE_ERRORS) && !(g(e || 0).isZero() || g(a || 0).isZero() || g(r || "0").isZero() || A))
|
|
2399
|
+
return S || d || b || h || x || C || T;
|
|
2402
2400
|
}, Aa = (e, a) => {
|
|
2403
|
-
const
|
|
2401
|
+
const r = Date.now().toString(), A = parseInt((e / 1e3).toFixed(0)), d = da(a / 1e3), b = Se(Ee.FRESHNESS), h = b ? parseInt(b) : 60;
|
|
2404
2402
|
return {
|
|
2405
|
-
nonce:
|
|
2403
|
+
nonce: r,
|
|
2406
2404
|
epoch: A,
|
|
2407
2405
|
deadline: d,
|
|
2408
2406
|
freshness: h
|
|
@@ -2410,29 +2408,29 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2410
2408
|
}, Pn = ({
|
|
2411
2409
|
chainId: e,
|
|
2412
2410
|
srcToken: a,
|
|
2413
|
-
dstToken:
|
|
2411
|
+
dstToken: r,
|
|
2414
2412
|
srcAmount: A,
|
|
2415
2413
|
deadlineMillis: d,
|
|
2416
2414
|
fillDelayMillis: b,
|
|
2417
2415
|
slippage: h,
|
|
2418
2416
|
account: x,
|
|
2419
2417
|
srcAmountPerTrade: C,
|
|
2420
|
-
dstMinAmountPerTrade:
|
|
2418
|
+
dstMinAmountPerTrade: T = "0",
|
|
2421
2419
|
triggerAmountPerTrade: S = "0",
|
|
2422
2420
|
config: F,
|
|
2423
|
-
module:
|
|
2421
|
+
module: w
|
|
2424
2422
|
}) => {
|
|
2425
|
-
const { nonce: R, epoch: P, deadline:
|
|
2423
|
+
const { nonce: R, epoch: P, deadline: K, freshness: Q } = Aa(
|
|
2426
2424
|
b,
|
|
2427
2425
|
d
|
|
2428
|
-
), le = Math.floor(Date.now() / 1e3).toString(), E =
|
|
2426
|
+
), le = Math.floor(Date.now() / 1e3).toString(), E = T, be = w === $.STOP_LOSS ? S : "0", xe = w === $.TAKE_PROFIT ? S : "0", ye = {
|
|
2429
2427
|
permitted: {
|
|
2430
2428
|
token: a,
|
|
2431
2429
|
amount: A
|
|
2432
2430
|
},
|
|
2433
2431
|
spender: F.reactor,
|
|
2434
2432
|
nonce: R,
|
|
2435
|
-
deadline:
|
|
2433
|
+
deadline: K,
|
|
2436
2434
|
witness: {
|
|
2437
2435
|
reactor: F.reactor,
|
|
2438
2436
|
executor: F.executor,
|
|
@@ -2445,19 +2443,19 @@ const me = (e) => e ? e.value * e.unit : 0, da = (e) => !e || e === "NaN" ? "0"
|
|
|
2445
2443
|
swapper: x,
|
|
2446
2444
|
nonce: R,
|
|
2447
2445
|
start: le,
|
|
2448
|
-
deadline:
|
|
2446
|
+
deadline: K,
|
|
2449
2447
|
chainid: e,
|
|
2450
2448
|
exclusivity: 0,
|
|
2451
2449
|
epoch: P,
|
|
2452
2450
|
slippage: h,
|
|
2453
|
-
freshness:
|
|
2451
|
+
freshness: Q,
|
|
2454
2452
|
input: {
|
|
2455
2453
|
token: a,
|
|
2456
2454
|
amount: C,
|
|
2457
2455
|
maxAmount: A
|
|
2458
2456
|
},
|
|
2459
2457
|
output: {
|
|
2460
|
-
token:
|
|
2458
|
+
token: r,
|
|
2461
2459
|
limit: g(E || 0).toFixed(),
|
|
2462
2460
|
triggerLower: g(be || 0).toFixed(),
|
|
2463
2461
|
triggerUpper: g(xe || 0).toFixed(),
|
|
@@ -2482,11 +2480,11 @@ function Nn(e) {
|
|
|
2482
2480
|
Le = e;
|
|
2483
2481
|
}
|
|
2484
2482
|
function Ie() {
|
|
2485
|
-
const e = Math.random().toString(36).substring(2, 16), a = Math.random().toString(36).substring(2, 16),
|
|
2486
|
-
return `id_${e + a +
|
|
2483
|
+
const e = Math.random().toString(36).substring(2, 16), a = Math.random().toString(36).substring(2, 16), r = Date.now().toString(36);
|
|
2484
|
+
return `id_${e + a + r}`;
|
|
2487
2485
|
}
|
|
2488
|
-
const ha = (e, a,
|
|
2489
|
-
var A, d, b, h, x, C,
|
|
2486
|
+
const ha = (e, a, r) => {
|
|
2487
|
+
var A, d, b, h, x, C, T, S, F;
|
|
2490
2488
|
return {
|
|
2491
2489
|
spotVersion: We.version,
|
|
2492
2490
|
partner: e.partner,
|
|
@@ -2501,14 +2499,14 @@ const ha = (e, a, i) => {
|
|
|
2501
2499
|
type: e.type,
|
|
2502
2500
|
wm: e.wm,
|
|
2503
2501
|
chainName: ((A = e.twapConfig) == null ? void 0 : A.chainName) || "",
|
|
2504
|
-
chainId:
|
|
2502
|
+
chainId: r || 0,
|
|
2505
2503
|
twapVersion: ((d = e.twapConfig) == null ? void 0 : d.twapVersion) || 0,
|
|
2506
2504
|
twapAddress: ((b = e.twapConfig) == null ? void 0 : b.twapAddress) || "",
|
|
2507
2505
|
lensAddress: ((h = e.twapConfig) == null ? void 0 : h.lensAddress) || "",
|
|
2508
2506
|
bidDelaySeconds: ((x = e.twapConfig) == null ? void 0 : x.bidDelaySeconds) || 0,
|
|
2509
2507
|
minChunkSizeUsd: a,
|
|
2510
2508
|
name: ((C = e.twapConfig) == null ? void 0 : C.name) || "",
|
|
2511
|
-
exchangeAddress: ((
|
|
2509
|
+
exchangeAddress: ((T = e.twapConfig) == null ? void 0 : T.exchangeAddress) || "",
|
|
2512
2510
|
exchangeType: ((S = e.twapConfig) == null ? void 0 : S.exchangeType) || "",
|
|
2513
2511
|
pathfinderKey: ((F = e.twapConfig) == null ? void 0 : F.pathfinderKey) || ""
|
|
2514
2512
|
};
|
|
@@ -2534,22 +2532,22 @@ class Ea {
|
|
|
2534
2532
|
_id: Ie()
|
|
2535
2533
|
});
|
|
2536
2534
|
}
|
|
2537
|
-
async updateAndSend(a = {},
|
|
2535
|
+
async updateAndSend(a = {}, r = !1, A) {
|
|
2538
2536
|
try {
|
|
2539
2537
|
this.data = {
|
|
2540
2538
|
...this.data,
|
|
2541
2539
|
...a
|
|
2542
|
-
},
|
|
2540
|
+
}, r ? (await je(this.data), A == null || A()) : (clearTimeout(this.timeout), this.timeout = setTimeout(() => {
|
|
2543
2541
|
je(this.data), A == null || A();
|
|
2544
2542
|
}, 1e3));
|
|
2545
2543
|
} catch (d) {
|
|
2546
2544
|
console.error("Failed to update and send BI", d);
|
|
2547
2545
|
}
|
|
2548
2546
|
}
|
|
2549
|
-
onCancelOrderRequest(a,
|
|
2547
|
+
onCancelOrderRequest(a, r) {
|
|
2550
2548
|
this.updateAndSend({
|
|
2551
|
-
cancelOrderIdsV1:
|
|
2552
|
-
cancelOrderIdsV2:
|
|
2549
|
+
cancelOrderIdsV1: r === 1 ? a : void 0,
|
|
2550
|
+
cancelOrderIdsV2: r === 2 ? a : void 0,
|
|
2553
2551
|
action: "cancel order",
|
|
2554
2552
|
cancelOrderSuccess: !1,
|
|
2555
2553
|
cancelOrderTxHash: void 0,
|
|
@@ -2592,27 +2590,27 @@ class Ea {
|
|
|
2592
2590
|
this.onTxError(a);
|
|
2593
2591
|
}
|
|
2594
2592
|
onCrash(a) {
|
|
2595
|
-
var
|
|
2596
|
-
this.updateAndSend({ action: "crash", actionError: ((
|
|
2593
|
+
var r;
|
|
2594
|
+
this.updateAndSend({ action: "crash", actionError: ((r = a == null ? void 0 : a.message) == null ? void 0 : r.toLowerCase()) || (a == null ? void 0 : a.toLowerCase()) });
|
|
2597
2595
|
}
|
|
2598
2596
|
onTxError(a) {
|
|
2599
2597
|
var A;
|
|
2600
|
-
const
|
|
2601
|
-
this.updateAndSend({ actionError:
|
|
2598
|
+
const r = ((A = a == null ? void 0 : a.message) == null ? void 0 : A.toLowerCase()) || (a == null ? void 0 : a.toLowerCase());
|
|
2599
|
+
this.updateAndSend({ actionError: r });
|
|
2602
2600
|
}
|
|
2603
2601
|
onRequestOrder({
|
|
2604
2602
|
account: a,
|
|
2605
|
-
chainId:
|
|
2603
|
+
chainId: r,
|
|
2606
2604
|
module: A,
|
|
2607
2605
|
srcToken: d,
|
|
2608
2606
|
dstToken: b,
|
|
2609
2607
|
fromTokenAmount: h,
|
|
2610
2608
|
srcChunkAmount: x,
|
|
2611
2609
|
minDstAmountOutPerTrade: C = "",
|
|
2612
|
-
triggerPricePerTrade:
|
|
2610
|
+
triggerPricePerTrade: T = "",
|
|
2613
2611
|
deadline: S,
|
|
2614
2612
|
fillDelay: F,
|
|
2615
|
-
slippage:
|
|
2613
|
+
slippage: w,
|
|
2616
2614
|
isMarketOrder: R,
|
|
2617
2615
|
chunksAmount: P
|
|
2618
2616
|
}) {
|
|
@@ -2625,11 +2623,11 @@ class Ea {
|
|
|
2625
2623
|
chunksAmount: P,
|
|
2626
2624
|
srcChunkAmount: x,
|
|
2627
2625
|
minDstAmountOutPerTrade: C,
|
|
2628
|
-
triggerPricePerTrade:
|
|
2626
|
+
triggerPricePerTrade: T,
|
|
2629
2627
|
deadline: S,
|
|
2630
2628
|
fillDelay: F,
|
|
2631
|
-
slippage:
|
|
2632
|
-
chainId:
|
|
2629
|
+
slippage: w,
|
|
2630
|
+
chainId: r,
|
|
2633
2631
|
walletAddress: a,
|
|
2634
2632
|
module: A,
|
|
2635
2633
|
orderType: R ? "market" : "limit",
|
|
@@ -2651,14 +2649,14 @@ class Ea {
|
|
|
2651
2649
|
signature: a
|
|
2652
2650
|
});
|
|
2653
2651
|
}
|
|
2654
|
-
init(a,
|
|
2652
|
+
init(a, r, A, d) {
|
|
2655
2653
|
var b, h;
|
|
2656
2654
|
this.config = a, (A !== ((b = this.data) == null ? void 0 : b.chainId) || d !== ((h = this.data) == null ? void 0 : h.appId)) && (this.data = {
|
|
2657
2655
|
_id: Ie(),
|
|
2658
2656
|
action: "module-import",
|
|
2659
2657
|
uiVersion: Le,
|
|
2660
2658
|
appId: d,
|
|
2661
|
-
...ha(a,
|
|
2659
|
+
...ha(a, r, A),
|
|
2662
2660
|
origin: window.location.origin
|
|
2663
2661
|
}, this.updateAndSend(this.data));
|
|
2664
2662
|
}
|
|
@@ -2719,16 +2717,21 @@ class Ea {
|
|
|
2719
2717
|
}
|
|
2720
2718
|
}
|
|
2721
2719
|
const Me = new Ea(), xa = (e) => {
|
|
2722
|
-
var
|
|
2723
|
-
const a = g(e.order.witness.output.limit || 0).gt(1), { stop:
|
|
2724
|
-
return h ? a ? V.TAKE_PROFIT_LIMIT : V.TAKE_PROFIT_MARKET : x ? a ? V.STOP_LOSS_LIMIT : V.STOP_LOSS_MARKET : a ?
|
|
2720
|
+
var S;
|
|
2721
|
+
const a = g(e.order.witness.output.limit || 0).gt(1), { stop: r, triggerLower: A, triggerUpper: d } = e.order.witness.output, b = g(r || 0).eq(Je), h = b || g(d || 0).gt(0), x = !b && g(r || 0).gt(0) || g(A || 0).gt(0), C = g(e.order.witness.input.amount), T = ((S = e.metadata.chunks) == null ? void 0 : S.length) || (C.gt(0) ? g(e.order.witness.input.maxAmount).div(C).toNumber() : e.metadata.expectedChunks || 1);
|
|
2722
|
+
return h ? a ? V.TAKE_PROFIT_LIMIT : V.TAKE_PROFIT_MARKET : x ? a ? V.STOP_LOSS_LIMIT : V.STOP_LOSS_MARKET : a ? T > 1 && a ? V.TWAP_LIMIT : a ? V.LIMIT : V.TWAP_MARKET : V.TWAP_MARKET;
|
|
2725
2723
|
}, ga = (e) => {
|
|
2726
2724
|
var d;
|
|
2727
|
-
const a = ((d = e.metadata.chunks) == null ? void 0 : d.filter((b) => b.status === "success").length) || 0,
|
|
2725
|
+
const a = ((d = e.metadata.chunks) == null ? void 0 : d.filter((b) => b.status === "success").length) || 0, r = e.metadata.expectedChunks || 0;
|
|
2726
|
+
if (!r) return 0;
|
|
2727
|
+
const A = g(a).dividedBy(r).toNumber();
|
|
2728
2728
|
return A >= 0.99 ? 100 : A <= 0 ? 0 : Number((A * 100).toFixed(2));
|
|
2729
|
-
}, Ca = (e, a) =>
|
|
2730
|
-
var
|
|
2731
|
-
return (((
|
|
2729
|
+
}, Ca = (e, a) => {
|
|
2730
|
+
var r;
|
|
2731
|
+
return e.metadata.status === "completed" || a >= 99 ? oe.Completed : ["pending", "eligible"].includes(e.metadata.status) ? oe.Open : ((r = e.metadata.description) == null ? void 0 : r.toLowerCase()) === "cancelled by contract" ? oe.Cancelled : oe.Expired;
|
|
2732
|
+
}, Fa = (e) => {
|
|
2733
|
+
var r;
|
|
2734
|
+
return (((r = e.metadata.chunks) == null ? void 0 : r.filter((A) => A.status === "success")) || []).map((A) => ({
|
|
2732
2735
|
inAmount: A.inAmount,
|
|
2733
2736
|
outAmount: A.outAmount,
|
|
2734
2737
|
timestamp: new Date(A.timestamp).getTime(),
|
|
@@ -2736,24 +2739,24 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2736
2739
|
}));
|
|
2737
2740
|
}, Ta = (e, a) => {
|
|
2738
2741
|
var A;
|
|
2739
|
-
const
|
|
2740
|
-
return
|
|
2742
|
+
const r = e.length;
|
|
2743
|
+
return r >= a && ((A = e[r - 1]) == null ? void 0 : A.timestamp) || 0;
|
|
2741
2744
|
}, wa = (e) => g(e.metadata.displayOnlyInputTokenPriceUSD).dividedBy(1e18).toFixed(), Ke = (e) => Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, Da = (e) => {
|
|
2742
|
-
const { triggerLower: a = "0", triggerUpper:
|
|
2745
|
+
const { triggerLower: a = "0", triggerUpper: r = "0" } = e.order.witness.output, A = Ke(e), d = e.metadata.expectedChunks || 1, b = g(r || 0).gt(0);
|
|
2743
2746
|
return {
|
|
2744
2747
|
dstMinAmountPerTrade: A,
|
|
2745
|
-
triggerPricePerTrade: b ?
|
|
2746
|
-
dstMinAmountTotal: g(A).multipliedBy(d).toFixed()
|
|
2748
|
+
triggerPricePerTrade: b ? r : a,
|
|
2749
|
+
dstMinAmountTotal: A ? g(A).multipliedBy(d).toFixed() : ""
|
|
2747
2750
|
};
|
|
2748
2751
|
}, Ba = (e) => {
|
|
2749
|
-
const a = Ke(e),
|
|
2752
|
+
const a = Ke(e), r = g(e.order.witness.output.stop || 0).eq(Je), A = e.metadata.expectedChunks || 1;
|
|
2750
2753
|
return {
|
|
2751
|
-
dstMinAmountPerTrade:
|
|
2752
|
-
triggerPricePerTrade:
|
|
2753
|
-
dstMinAmountTotal:
|
|
2754
|
+
dstMinAmountPerTrade: r ? "" : a,
|
|
2755
|
+
triggerPricePerTrade: r ? a : g(e.order.witness.output.stop || 0).toFixed(),
|
|
2756
|
+
dstMinAmountTotal: r || !a ? "" : g(a).multipliedBy(A).toFixed()
|
|
2754
2757
|
};
|
|
2755
2758
|
}, Sa = (e) => Number(ze) >= 2 ? Da(e) : Ba(e), nt = (e) => {
|
|
2756
|
-
const a = ga(e),
|
|
2759
|
+
const a = ga(e), r = Ke(e), A = e.metadata.expectedChunks || 1, d = Fa(e), b = xa(e);
|
|
2757
2760
|
return {
|
|
2758
2761
|
id: e.hash,
|
|
2759
2762
|
hash: e.hash,
|
|
@@ -2773,7 +2776,7 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2773
2776
|
srcAmount: e.order.witness.input.maxAmount,
|
|
2774
2777
|
srcAmountPerTrade: e.order.witness.input.amount,
|
|
2775
2778
|
totalTradesAmount: A,
|
|
2776
|
-
isMarketPrice: g(
|
|
2779
|
+
isMarketPrice: g(r || 0).lte(1),
|
|
2777
2780
|
chainId: e.order.witness.chainid,
|
|
2778
2781
|
filledOrderTimestamp: Ta(d, A),
|
|
2779
2782
|
status: Ca(e, a),
|
|
@@ -2785,23 +2788,23 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2785
2788
|
}, ka = async ({
|
|
2786
2789
|
chainId: e,
|
|
2787
2790
|
signal: a,
|
|
2788
|
-
account:
|
|
2791
|
+
account: r,
|
|
2789
2792
|
exchange: A,
|
|
2790
2793
|
partner: d,
|
|
2791
2794
|
isDev: b = !1
|
|
2792
2795
|
}) => {
|
|
2793
2796
|
try {
|
|
2794
|
-
if (!
|
|
2795
|
-
const h =
|
|
2797
|
+
if (!r) return [];
|
|
2798
|
+
const h = qt(b), x = /* @__PURE__ */ new Map();
|
|
2796
2799
|
return (await Promise.all(
|
|
2797
|
-
h.map(async (
|
|
2800
|
+
h.map(async (T) => {
|
|
2798
2801
|
try {
|
|
2799
2802
|
const S = jt({
|
|
2800
|
-
endpoint:
|
|
2803
|
+
endpoint: T,
|
|
2801
2804
|
exchange: A,
|
|
2802
2805
|
partner: d
|
|
2803
2806
|
}), F = S ? `&exchange=${S}` : "", R = await (await fetch(
|
|
2804
|
-
`${
|
|
2807
|
+
`${T}/orders?swapper=${r}&chainId=${e}${F}`,
|
|
2805
2808
|
{
|
|
2806
2809
|
signal: a
|
|
2807
2810
|
}
|
|
@@ -2809,9 +2812,9 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2809
2812
|
if (!R || !Array.isArray(R.orders))
|
|
2810
2813
|
return [];
|
|
2811
2814
|
const P = [];
|
|
2812
|
-
for (const
|
|
2815
|
+
for (const K of R.orders)
|
|
2813
2816
|
try {
|
|
2814
|
-
P.push(nt(
|
|
2817
|
+
P.push(nt(K));
|
|
2815
2818
|
} catch {
|
|
2816
2819
|
continue;
|
|
2817
2820
|
}
|
|
@@ -2820,13 +2823,13 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2820
2823
|
return [];
|
|
2821
2824
|
}
|
|
2822
2825
|
})
|
|
2823
|
-
)).flat().forEach((
|
|
2824
|
-
x.has(
|
|
2826
|
+
)).flat().forEach((T) => {
|
|
2827
|
+
x.has(T.id) || x.set(T.id, T);
|
|
2825
2828
|
}), Array.from(x.values());
|
|
2826
2829
|
} catch {
|
|
2827
2830
|
return [];
|
|
2828
2831
|
}
|
|
2829
|
-
}, In = async (e, a,
|
|
2832
|
+
}, In = async (e, a, r = !1) => {
|
|
2830
2833
|
try {
|
|
2831
2834
|
const A = {
|
|
2832
2835
|
signature: a,
|
|
@@ -2834,8 +2837,12 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2834
2837
|
status: "pending"
|
|
2835
2838
|
};
|
|
2836
2839
|
Me.onCreateOrderRequest();
|
|
2837
|
-
const d = await fetch(`${
|
|
2840
|
+
const d = await fetch(`${Gt(r)}/orders/new`, {
|
|
2838
2841
|
method: "POST",
|
|
2842
|
+
headers: {
|
|
2843
|
+
"Content-Type": "application/json",
|
|
2844
|
+
Accept: "application/json"
|
|
2845
|
+
},
|
|
2839
2846
|
body: JSON.stringify(A)
|
|
2840
2847
|
}), b = await d.json().catch(() => ({}));
|
|
2841
2848
|
if (!d.ok || !(b != null && b.success)) {
|
|
@@ -2849,13 +2856,13 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2849
2856
|
} catch (A) {
|
|
2850
2857
|
throw Me.onCreateOrderError(A), console.error(A), A;
|
|
2851
2858
|
}
|
|
2852
|
-
}, pe = (e, a) => e && e.length ? e.map(a || ((
|
|
2859
|
+
}, pe = (e, a) => e && e.length ? e.map(a || ((r) => `${r}`)) : void 0, Oa = (e) => {
|
|
2853
2860
|
if (e)
|
|
2854
2861
|
return Yt[e];
|
|
2855
2862
|
}, He = async ({
|
|
2856
2863
|
chainId: e,
|
|
2857
2864
|
buildQuery: a,
|
|
2858
|
-
extractResults:
|
|
2865
|
+
extractResults: r,
|
|
2859
2866
|
signal: A,
|
|
2860
2867
|
retries: d = 1,
|
|
2861
2868
|
limit: b = 1e3,
|
|
@@ -2864,8 +2871,8 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2864
2871
|
const x = Oa(e);
|
|
2865
2872
|
if (!x) throw new Ia();
|
|
2866
2873
|
const C = async (F) => {
|
|
2867
|
-
let
|
|
2868
|
-
for (;
|
|
2874
|
+
let w = 0;
|
|
2875
|
+
for (; w <= d; )
|
|
2869
2876
|
try {
|
|
2870
2877
|
const R = await fetch(x, {
|
|
2871
2878
|
method: "POST",
|
|
@@ -2877,14 +2884,14 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2877
2884
|
const P = await R.json();
|
|
2878
2885
|
if (P.errors)
|
|
2879
2886
|
throw new Error(P.errors[0].message);
|
|
2880
|
-
return
|
|
2887
|
+
return r(P);
|
|
2881
2888
|
} catch (R) {
|
|
2882
|
-
if (
|
|
2883
|
-
await new Promise((P) => setTimeout(P, 500 * 2 **
|
|
2889
|
+
if (w === d) throw R;
|
|
2890
|
+
await new Promise((P) => setTimeout(P, 500 * 2 ** w)), w++;
|
|
2884
2891
|
}
|
|
2885
2892
|
return [];
|
|
2886
2893
|
};
|
|
2887
|
-
let
|
|
2894
|
+
let T = 0;
|
|
2888
2895
|
const S = [];
|
|
2889
2896
|
if (h !== void 0) {
|
|
2890
2897
|
const F = a(h, b);
|
|
@@ -2900,20 +2907,20 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2900
2907
|
}
|
|
2901
2908
|
}
|
|
2902
2909
|
for (; ; ) {
|
|
2903
|
-
const F = a(
|
|
2904
|
-
let
|
|
2910
|
+
const F = a(T, b);
|
|
2911
|
+
let w;
|
|
2905
2912
|
try {
|
|
2906
|
-
|
|
2913
|
+
w = await C(F);
|
|
2907
2914
|
} catch {
|
|
2908
|
-
console.warn(`Page ${
|
|
2915
|
+
console.warn(`Page ${T} failed, retrying one final time...`);
|
|
2909
2916
|
try {
|
|
2910
|
-
|
|
2917
|
+
w = await C(F);
|
|
2911
2918
|
} catch {
|
|
2912
2919
|
return S;
|
|
2913
2920
|
}
|
|
2914
2921
|
}
|
|
2915
|
-
if (S.push(...
|
|
2916
|
-
|
|
2922
|
+
if (S.push(...w), w.length < b) break;
|
|
2923
|
+
T++;
|
|
2917
2924
|
}
|
|
2918
2925
|
return S;
|
|
2919
2926
|
}, st = (e) => e.map((a) => ({
|
|
@@ -2922,29 +2929,29 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2922
2929
|
timestamp: a.timestamp,
|
|
2923
2930
|
txHash: a.transactionHash
|
|
2924
2931
|
})), Qe = (e, a) => {
|
|
2925
|
-
const
|
|
2926
|
-
return !
|
|
2927
|
-
}, _a = (e, a,
|
|
2928
|
-
var
|
|
2929
|
-
const d = st(
|
|
2932
|
+
const r = g(e || 0).gt(1);
|
|
2933
|
+
return !r && a === 1 ? V.TWAP_MARKET : a > 1 && r ? V.TWAP_LIMIT : r ? V.LIMIT : V.TWAP_MARKET;
|
|
2934
|
+
}, _a = (e, a, r, A) => {
|
|
2935
|
+
var R;
|
|
2936
|
+
const d = st(r || []), b = new g(e.ask_srcBidAmount || 0), h = b.gt(0) ? new g(e.ask_srcAmount || 0).div(b).integerValue(g.ROUND_FLOOR).toNumber() : 1, C = (r == null ? void 0 : r.length) === h ? (R = r == null ? void 0 : r[(r == null ? void 0 : r.length) - 1]) == null ? void 0 : R.timestamp : void 0, T = d.reduce((P, K) => P.plus(K.inAmount), new g(0)).toFixed(), S = d.reduce((P, K) => P.plus(K.outAmount), new g(0)).toFixed(), F = rt(e.ask_srcAmount, T), w = Qe(e.ask_dstMinAmount, h);
|
|
2930
2937
|
return {
|
|
2931
2938
|
repermitDigest: "",
|
|
2932
2939
|
version: 1,
|
|
2933
2940
|
isTriggerPrice: !1,
|
|
2934
2941
|
id: e.Contract_id.toString(),
|
|
2935
2942
|
hash: "",
|
|
2936
|
-
type: Qe(e.ask_dstMinAmount,
|
|
2943
|
+
type: Qe(e.ask_dstMinAmount, h),
|
|
2937
2944
|
srcTokenAddress: e.ask_srcToken,
|
|
2938
2945
|
dstTokenAddress: e.ask_dstToken,
|
|
2939
2946
|
exchangeAddress: e.exchange,
|
|
2940
2947
|
twapAddress: e.twapAddress,
|
|
2941
2948
|
maker: e.maker,
|
|
2942
|
-
progress:
|
|
2943
|
-
dstAmountFilled:
|
|
2944
|
-
srcAmountFilled:
|
|
2949
|
+
progress: F,
|
|
2950
|
+
dstAmountFilled: S,
|
|
2951
|
+
srcAmountFilled: T,
|
|
2945
2952
|
orderDollarValueIn: g(e.dollarValueIn || 0).toFixed(6),
|
|
2946
2953
|
srcAmount: e.ask_srcAmount,
|
|
2947
|
-
dstMinAmountTotal: g(e.ask_dstMinAmount).multipliedBy(
|
|
2954
|
+
dstMinAmountTotal: g(e.ask_dstMinAmount).multipliedBy(h).toString(),
|
|
2948
2955
|
fills: d,
|
|
2949
2956
|
fillDelay: e.ask_fillDelay,
|
|
2950
2957
|
deadline: e.ask_deadline * 1e3,
|
|
@@ -2953,10 +2960,10 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2953
2960
|
triggerPricePerTrade: "",
|
|
2954
2961
|
srcAmountPerTrade: e.ask_srcBidAmount,
|
|
2955
2962
|
txHash: e.transactionHash,
|
|
2956
|
-
totalTradesAmount:
|
|
2957
|
-
isMarketPrice: [V.TWAP_MARKET].includes(
|
|
2963
|
+
totalTradesAmount: h,
|
|
2964
|
+
isMarketPrice: [V.TWAP_MARKET].includes(w),
|
|
2958
2965
|
chainId: a,
|
|
2959
|
-
filledOrderTimestamp:
|
|
2966
|
+
filledOrderTimestamp: C || 0,
|
|
2960
2967
|
status: A,
|
|
2961
2968
|
rawOrder: e
|
|
2962
2969
|
};
|
|
@@ -2965,32 +2972,32 @@ const Me = new Ea(), xa = (e) => {
|
|
|
2965
2972
|
if (!e) return "";
|
|
2966
2973
|
const a = pe(
|
|
2967
2974
|
e.accounts,
|
|
2968
|
-
(
|
|
2969
|
-
),
|
|
2975
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2976
|
+
), r = pe(
|
|
2970
2977
|
ca(e.configs),
|
|
2971
|
-
(
|
|
2978
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2972
2979
|
), A = pe(
|
|
2973
2980
|
e.inTokenSymbols,
|
|
2974
|
-
(
|
|
2981
|
+
(w) => `"${w.toUpperCase()}"`
|
|
2975
2982
|
), d = pe(
|
|
2976
2983
|
e.outTokenSymbols,
|
|
2977
|
-
(
|
|
2984
|
+
(w) => `"${w.toUpperCase()}"`
|
|
2978
2985
|
), b = pe(
|
|
2979
2986
|
e.inTokenAddresses,
|
|
2980
|
-
(
|
|
2987
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2981
2988
|
), h = pe(
|
|
2982
2989
|
e.outTokenAddresses,
|
|
2983
|
-
(
|
|
2990
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2984
2991
|
), x = pe(
|
|
2985
2992
|
e.transactionHashes,
|
|
2986
|
-
(
|
|
2987
|
-
), C = pe(e.orderIds, (
|
|
2988
|
-
(F = e.configs) == null ? void 0 : F.map((
|
|
2989
|
-
(
|
|
2993
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2994
|
+
), C = pe(e.orderIds, (w) => `"${w}"`), T = r != null && r.length ? "" : pe(
|
|
2995
|
+
(F = e.configs) == null ? void 0 : F.map((w) => w.twapAddress),
|
|
2996
|
+
(w) => `"${w.toLowerCase()}"`
|
|
2990
2997
|
), S = e.minDollarValueIn;
|
|
2991
2998
|
return [
|
|
2992
|
-
|
|
2993
|
-
|
|
2999
|
+
r ? `exchange_in: [${r.join(", ")}]` : "",
|
|
3000
|
+
T ? `twapAddress_in: [${T.join(", ")}]` : "",
|
|
2994
3001
|
a ? `maker_in: [${a.join(", ")}]` : "",
|
|
2995
3002
|
x ? `transactionHash_in: [${x.join(", ")}]` : "",
|
|
2996
3003
|
C ? `Contract_id_in: [${C.join(", ")}]` : "",
|
|
@@ -3008,7 +3015,7 @@ const Me = new Ea(), xa = (e) => {
|
|
|
3008
3015
|
async function Ra({
|
|
3009
3016
|
chainId: e,
|
|
3010
3017
|
signal: a,
|
|
3011
|
-
page:
|
|
3018
|
+
page: r,
|
|
3012
3019
|
limit: A,
|
|
3013
3020
|
filters: d
|
|
3014
3021
|
}) {
|
|
@@ -3017,13 +3024,13 @@ async function Ra({
|
|
|
3017
3024
|
chainId: e,
|
|
3018
3025
|
signal: a,
|
|
3019
3026
|
limit: b,
|
|
3020
|
-
page:
|
|
3021
|
-
buildQuery: (C,
|
|
3027
|
+
page: r,
|
|
3028
|
+
buildQuery: (C, T) => `
|
|
3022
3029
|
{
|
|
3023
3030
|
orderCreateds(
|
|
3024
3031
|
${h ? `where: { ${h} }` : ""},
|
|
3025
|
-
first: ${
|
|
3026
|
-
skip: ${C *
|
|
3032
|
+
first: ${T},
|
|
3033
|
+
skip: ${C * T},
|
|
3027
3034
|
orderBy: timestamp,
|
|
3028
3035
|
orderDirection: desc,
|
|
3029
3036
|
) {
|
|
@@ -3054,15 +3061,15 @@ async function Ra({
|
|
|
3054
3061
|
}
|
|
3055
3062
|
`,
|
|
3056
3063
|
extractResults: (C) => {
|
|
3057
|
-
var
|
|
3058
|
-
return ((
|
|
3064
|
+
var T;
|
|
3065
|
+
return ((T = C.data) == null ? void 0 : T.orderCreateds) || [];
|
|
3059
3066
|
}
|
|
3060
3067
|
});
|
|
3061
3068
|
}
|
|
3062
3069
|
const Pa = async ({
|
|
3063
3070
|
chainId: e,
|
|
3064
3071
|
orders: a,
|
|
3065
|
-
signal:
|
|
3072
|
+
signal: r
|
|
3066
3073
|
}) => {
|
|
3067
3074
|
if (a.length === 0) return [];
|
|
3068
3075
|
const A = Ve(a.map((x) => x.Contract_id.toString()));
|
|
@@ -3070,7 +3077,7 @@ const Pa = async ({
|
|
|
3070
3077
|
const b = `where: { twapId_in: [${A.map((x) => `"${x}"`).join(", ")}]}`;
|
|
3071
3078
|
return await He({
|
|
3072
3079
|
chainId: e,
|
|
3073
|
-
signal:
|
|
3080
|
+
signal: r,
|
|
3074
3081
|
limit: 1e3,
|
|
3075
3082
|
buildQuery: (x, C) => `
|
|
3076
3083
|
{
|
|
@@ -3097,21 +3104,21 @@ function Ve(e) {
|
|
|
3097
3104
|
const Na = async ({
|
|
3098
3105
|
chainId: e,
|
|
3099
3106
|
orders: a,
|
|
3100
|
-
signal:
|
|
3107
|
+
signal: r
|
|
3101
3108
|
}) => {
|
|
3102
3109
|
const A = Ve(a.map((F) => F.Contract_id)), d = Ve(a.map((F) => F.twapAddress)).filter(Boolean);
|
|
3103
3110
|
if (A.length === 0) return [];
|
|
3104
|
-
const b = A.join(", "), h = d.map((F) => `"${F}"`).join(", "), x = d.length ? `twapAddress_in: [${h}]` : "",
|
|
3111
|
+
const b = A.join(", "), h = d.map((F) => `"${F}"`).join(", "), x = d.length ? `twapAddress_in: [${h}]` : "", T = `where: { ${[
|
|
3105
3112
|
`TWAP_id_in: [${b}]`,
|
|
3106
3113
|
x
|
|
3107
3114
|
].filter(Boolean).join(", ")} }`;
|
|
3108
3115
|
return await He({
|
|
3109
3116
|
chainId: e,
|
|
3110
|
-
signal:
|
|
3117
|
+
signal: r,
|
|
3111
3118
|
limit: 1e3,
|
|
3112
|
-
buildQuery: (F,
|
|
3119
|
+
buildQuery: (F, w) => `
|
|
3113
3120
|
{
|
|
3114
|
-
orderFilleds(first: ${
|
|
3121
|
+
orderFilleds(first: ${w}, orderBy: timestamp, skip: ${F * w}, ${T}) {
|
|
3115
3122
|
id
|
|
3116
3123
|
dstAmountOut
|
|
3117
3124
|
dstFee
|
|
@@ -3128,8 +3135,8 @@ const Na = async ({
|
|
|
3128
3135
|
}
|
|
3129
3136
|
`,
|
|
3130
3137
|
extractResults: (F) => {
|
|
3131
|
-
var
|
|
3132
|
-
return (((
|
|
3138
|
+
var w;
|
|
3139
|
+
return (((w = F.data) == null ? void 0 : w.orderFilleds) || []).map((R) => ({
|
|
3133
3140
|
...R,
|
|
3134
3141
|
timestamp: new Date(R.timestamp).getTime()
|
|
3135
3142
|
}));
|
|
@@ -3144,7 +3151,7 @@ class Ia extends Error {
|
|
|
3144
3151
|
const Ma = async ({
|
|
3145
3152
|
chainId: e,
|
|
3146
3153
|
signal: a,
|
|
3147
|
-
page:
|
|
3154
|
+
page: r,
|
|
3148
3155
|
limit: A,
|
|
3149
3156
|
filters: d
|
|
3150
3157
|
}) => {
|
|
@@ -3152,7 +3159,7 @@ const Ma = async ({
|
|
|
3152
3159
|
const b = await Ra({
|
|
3153
3160
|
chainId: e,
|
|
3154
3161
|
signal: a,
|
|
3155
|
-
page:
|
|
3162
|
+
page: r,
|
|
3156
3163
|
limit: A,
|
|
3157
3164
|
filters: d
|
|
3158
3165
|
}), [h, x] = await Promise.all([
|
|
@@ -3160,7 +3167,7 @@ const Ma = async ({
|
|
|
3160
3167
|
Pa({ chainId: e, orders: b, signal: a })
|
|
3161
3168
|
]), C = b.map((S) => {
|
|
3162
3169
|
const F = h == null ? void 0 : h.filter(
|
|
3163
|
-
(
|
|
3170
|
+
(w) => w.TWAP_id === Number(S.Contract_id) && Be(w.exchange, S.exchange) && Be(w.twapAddress, S.twapAddress)
|
|
3164
3171
|
);
|
|
3165
3172
|
return _a(
|
|
3166
3173
|
S,
|
|
@@ -3168,25 +3175,25 @@ const Ma = async ({
|
|
|
3168
3175
|
F,
|
|
3169
3176
|
Ua(S, F || [], x)
|
|
3170
3177
|
);
|
|
3171
|
-
}).sort((S, F) => F.createdAt - S.createdAt),
|
|
3172
|
-
return C.filter((S) =>
|
|
3178
|
+
}).sort((S, F) => F.createdAt - S.createdAt), T = /* @__PURE__ */ new Set();
|
|
3179
|
+
return C.filter((S) => T.has(S.id) ? !1 : (T.add(S.id), !0));
|
|
3173
3180
|
} catch {
|
|
3174
3181
|
return [];
|
|
3175
3182
|
}
|
|
3176
|
-
}, Ua = (e, a,
|
|
3183
|
+
}, Ua = (e, a, r) => {
|
|
3177
3184
|
var x;
|
|
3178
|
-
const A = (x =
|
|
3185
|
+
const A = (x = r == null ? void 0 : r.find(
|
|
3179
3186
|
(C) => C.twapId === e.Contract_id.toString() && Be(C.twapAddress, e.twapAddress)
|
|
3180
|
-
)) == null ? void 0 : x.status, b = st(a).reduce((C,
|
|
3187
|
+
)) == null ? void 0 : x.status, b = st(a).reduce((C, T) => C.plus(T.inAmount), new g(0)).toFixed(), h = rt(e.ask_srcAmount, b);
|
|
3181
3188
|
return La(h, e.ask_deadline * 1e3, A);
|
|
3182
3189
|
}, rt = (e, a) => {
|
|
3183
3190
|
if (!a || !e) return 0;
|
|
3184
|
-
const
|
|
3185
|
-
return
|
|
3186
|
-
}, La = (e, a,
|
|
3191
|
+
const r = g(a).dividedBy(e).toNumber();
|
|
3192
|
+
return r >= 0.99 ? 100 : r <= 0 ? 0 : Number((r * 100).toFixed(2));
|
|
3193
|
+
}, La = (e, a, r) => e === 100 ? oe.Completed : r === "CANCELLED" ? oe.Cancelled : r === "COMPLETED" ? oe.Completed : a > Date.now() ? oe.Open : oe.Expired, Mn = async ({
|
|
3187
3194
|
signal: e,
|
|
3188
3195
|
page: a,
|
|
3189
|
-
chainId:
|
|
3196
|
+
chainId: r,
|
|
3190
3197
|
limit: A,
|
|
3191
3198
|
config: d,
|
|
3192
3199
|
account: b,
|
|
@@ -3194,7 +3201,7 @@ const Ma = async ({
|
|
|
3194
3201
|
includeV1GraphOrders: x = !0
|
|
3195
3202
|
}) => (await Promise.all([
|
|
3196
3203
|
!d || !x ? Promise.resolve([]) : Ma({
|
|
3197
|
-
chainId:
|
|
3204
|
+
chainId: r,
|
|
3198
3205
|
signal: e,
|
|
3199
3206
|
page: a,
|
|
3200
3207
|
limit: A,
|
|
@@ -3204,7 +3211,7 @@ const Ma = async ({
|
|
|
3204
3211
|
}
|
|
3205
3212
|
}),
|
|
3206
3213
|
ka({
|
|
3207
|
-
chainId:
|
|
3214
|
+
chainId: r,
|
|
3208
3215
|
signal: e,
|
|
3209
3216
|
account: b,
|
|
3210
3217
|
exchange: d == null ? void 0 : d.adapter,
|
|
@@ -3215,7 +3222,7 @@ const Ma = async ({
|
|
|
3215
3222
|
export {
|
|
3216
3223
|
rn as CRASH_ERROR_MESSAGE,
|
|
3217
3224
|
O as Configs,
|
|
3218
|
-
|
|
3225
|
+
Ge as DEFAULT_FILL_DELAY,
|
|
3219
3226
|
nn as DEFAULT_STOP_LOSS_LIMIT_PERCENTAGE,
|
|
3220
3227
|
tn as DEFAULT_STOP_LOSS_PERCENTAGE,
|
|
3221
3228
|
sn as DEFAULT_TAKE_PROFIT_LIMIT_PERCENTAGE,
|
|
@@ -3224,16 +3231,16 @@ export {
|
|
|
3224
3231
|
aa as EIP712_TYPES,
|
|
3225
3232
|
za as ERC20_ABI,
|
|
3226
3233
|
Xa as EXCLUSIVITY_OVERRIDE_BPS,
|
|
3227
|
-
|
|
3234
|
+
qa as FEES,
|
|
3228
3235
|
Wa as IWETH_ABI,
|
|
3229
3236
|
Ht as InputErrors,
|
|
3230
3237
|
ea as LEGACY_EXCHANGES_MAP,
|
|
3231
3238
|
De as MAX_ORDER_DURATION_MILLIS,
|
|
3232
|
-
|
|
3239
|
+
Ga as MIN_CHUNKS,
|
|
3233
3240
|
Ue as MIN_FILL_DELAY_MILLIS,
|
|
3234
3241
|
Qt as MIN_FILL_DELAY_MINUTES,
|
|
3235
3242
|
$e as MIN_ORDER_DURATION_MILLIS,
|
|
3236
|
-
|
|
3243
|
+
$ as Module,
|
|
3237
3244
|
Ya as ORBS_LOGO,
|
|
3238
3245
|
Za as ORBS_LOGO_FALLBACK,
|
|
3239
3246
|
Qa as ORBS_SLTP_FAQ_URL,
|
|
@@ -3256,7 +3263,7 @@ export {
|
|
|
3256
3263
|
nt as buildV2Order,
|
|
3257
3264
|
Be as eqIgnoreCase,
|
|
3258
3265
|
Mn as getAccountOrders,
|
|
3259
|
-
|
|
3266
|
+
Gt as getApiEndpoint,
|
|
3260
3267
|
hn as getChunks,
|
|
3261
3268
|
fa as getConfig,
|
|
3262
3269
|
xn as getDeadline,
|
|
@@ -3274,13 +3281,13 @@ export {
|
|
|
3274
3281
|
Sn as getMinOrderDurationError,
|
|
3275
3282
|
On as getMinTradeSizeError,
|
|
3276
3283
|
dn as getNetwork,
|
|
3277
|
-
|
|
3284
|
+
qt as getOrderApiEndpoints,
|
|
3278
3285
|
ln as getOrderExecutionRate,
|
|
3279
3286
|
cn as getOrderFillDelayMillis,
|
|
3280
3287
|
un as getOrderLimitPriceRate,
|
|
3281
3288
|
jt as getOrderSinkExchange,
|
|
3282
3289
|
pn as getPartnerChains,
|
|
3283
|
-
|
|
3290
|
+
X as getPartnerIdentifier,
|
|
3284
3291
|
ma as getPartners,
|
|
3285
3292
|
gn as getSrcTokenChunkAmount,
|
|
3286
3293
|
wn as getStopLossLimitPriceError,
|