@orbs-network/spot-ui 0.1.0 → 1.0.0

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.
Files changed (36) hide show
  1. package/dist/index.d.ts +2 -7
  2. package/dist/spot-ui.js +3285 -0
  3. package/dist/spot-ui.umd.cjs +64 -0
  4. package/dist/src/index.d.ts +14 -0
  5. package/dist/src/index.d.ts.map +1 -0
  6. package/dist/src/lib/abi/erc20.json.d.ts +291 -0
  7. package/dist/src/lib/abi/index.d.ts +260 -0
  8. package/dist/src/lib/abi/index.d.ts.map +1 -0
  9. package/dist/src/lib/abi/iweth.json.d.ts +41 -0
  10. package/dist/src/lib/abi/repermit.json.d.ts +315 -0
  11. package/dist/src/lib/analytics.d.ts +108 -0
  12. package/dist/src/lib/analytics.d.ts.map +1 -0
  13. package/dist/src/lib/build-repermit-order-data.d.ts +55 -0
  14. package/dist/src/lib/build-repermit-order-data.d.ts.map +1 -0
  15. package/dist/src/lib/consts.d.ts +118 -0
  16. package/dist/src/lib/consts.d.ts.map +1 -0
  17. package/dist/src/lib/lib.d.ts +67 -0
  18. package/dist/src/lib/lib.d.ts.map +1 -0
  19. package/dist/src/lib/networks.d.ts +445 -0
  20. package/dist/src/lib/networks.d.ts.map +1 -0
  21. package/dist/src/lib/orders/index.d.ts +11 -0
  22. package/dist/src/lib/orders/index.d.ts.map +1 -0
  23. package/dist/src/lib/orders/v1-orders.d.ts +34 -0
  24. package/dist/src/lib/orders/v1-orders.d.ts.map +1 -0
  25. package/dist/src/lib/orders/v2-orders.d.ts +10 -0
  26. package/dist/src/lib/orders/v2-orders.d.ts.map +1 -0
  27. package/dist/src/lib/submit-order.d.ts +3 -0
  28. package/dist/src/lib/submit-order.d.ts.map +1 -0
  29. package/dist/src/lib/types.d.ts +308 -0
  30. package/dist/src/lib/types.d.ts.map +1 -0
  31. package/dist/src/lib/utils.d.ts +458 -0
  32. package/dist/src/lib/utils.d.ts.map +1 -0
  33. package/package.json +32 -9
  34. package/dist/index.d.ts.map +0 -1
  35. package/dist/index.js +0 -8
  36. package/dist/index.js.map +0 -1
@@ -0,0 +1,3285 @@
1
+ var st = Object.defineProperty;
2
+ var rt = (e, n, i) => n in e ? st(e, n, { enumerable: !0, configurable: !0, writable: !0, value: i }) : e[n] = i;
3
+ var Ce = (e, n, i) => rt(e, typeof n != "symbol" ? n + "" : n, i);
4
+ const it = { 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: "" }, ot = { 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: "" }, dt = { 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" }, ct = { 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: "" }, pt = { 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" }, ut = { 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" }, lt = { 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" }, ft = { 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" }, mt = { 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: "" }, At = { 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: "" }, bt = { 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" }, Et = { 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" }, gt = { 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" }, xt = { 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: "" }, Ct = { 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: "" }, Ft = { 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: "" }, Dt = { 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" }, St = { 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" }, kt = { 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: "" }, Bt = { 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: "" }, _t = { 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" }, Ot = { 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" }, Rt = { 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" }, vt = { 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" }, Pt = { 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" }, It = { 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" }, Nt = { 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" }, _ = {
5
+ SpookySwap: it,
6
+ SpookySwapSonic: ot,
7
+ QuickSwap: dt,
8
+ QuickSwapBase: ct,
9
+ Chronos: pt,
10
+ BaseSwap: ut,
11
+ Arbidex: lt,
12
+ Thena: ft,
13
+ PancakeSwap: mt,
14
+ PancakeSwapArbitrum: yt,
15
+ PancakeSwapBase: ht,
16
+ PancakeSwapLinea: At,
17
+ Lynex: bt,
18
+ SyncSwap: Et,
19
+ Retro: gt,
20
+ SushiArb: xt,
21
+ SushiBase: Tt,
22
+ SushiEth: wt,
23
+ SushiKatana: Ct,
24
+ DragonSwap: Ft,
25
+ TeaFi: Dt,
26
+ SparkDEX: St,
27
+ Ramses: kt,
28
+ SwapX: Bt,
29
+ H2Finance: _t,
30
+ Shadow: Ot,
31
+ Kodiak: Rt,
32
+ OmniBase: vt,
33
+ OmniArb: Pt,
34
+ BlackholeAvax: It,
35
+ NewEraBnb: Nt
36
+ }, Mt = [
37
+ {
38
+ constant: !1,
39
+ inputs: [
40
+ {
41
+ name: "wad",
42
+ type: "uint256"
43
+ }
44
+ ],
45
+ name: "withdraw",
46
+ outputs: [],
47
+ payable: !1,
48
+ stateMutability: "nonpayable",
49
+ type: "function"
50
+ },
51
+ {
52
+ constant: !1,
53
+ inputs: [],
54
+ name: "deposit",
55
+ outputs: [],
56
+ payable: !0,
57
+ stateMutability: "payable",
58
+ type: "function"
59
+ },
60
+ {
61
+ anonymous: !1,
62
+ inputs: [
63
+ {
64
+ indexed: !0,
65
+ name: "dst",
66
+ type: "address"
67
+ },
68
+ {
69
+ indexed: !1,
70
+ name: "wad",
71
+ type: "uint256"
72
+ }
73
+ ],
74
+ name: "Deposit",
75
+ type: "event"
76
+ },
77
+ {
78
+ anonymous: !1,
79
+ inputs: [
80
+ {
81
+ indexed: !0,
82
+ name: "src",
83
+ type: "address"
84
+ },
85
+ {
86
+ indexed: !1,
87
+ name: "wad",
88
+ type: "uint256"
89
+ }
90
+ ],
91
+ name: "Withdrawal",
92
+ type: "event"
93
+ }
94
+ ], Lt = [
95
+ {
96
+ inputs: [
97
+ {
98
+ internalType: "string",
99
+ name: "name_",
100
+ type: "string"
101
+ },
102
+ {
103
+ internalType: "string",
104
+ name: "symbol_",
105
+ type: "string"
106
+ }
107
+ ],
108
+ stateMutability: "nonpayable",
109
+ type: "constructor"
110
+ },
111
+ {
112
+ anonymous: !1,
113
+ inputs: [
114
+ {
115
+ indexed: !0,
116
+ internalType: "address",
117
+ name: "owner",
118
+ type: "address"
119
+ },
120
+ {
121
+ indexed: !0,
122
+ internalType: "address",
123
+ name: "spender",
124
+ type: "address"
125
+ },
126
+ {
127
+ indexed: !1,
128
+ internalType: "uint256",
129
+ name: "value",
130
+ type: "uint256"
131
+ }
132
+ ],
133
+ name: "Approval",
134
+ type: "event"
135
+ },
136
+ {
137
+ anonymous: !1,
138
+ inputs: [
139
+ {
140
+ indexed: !0,
141
+ internalType: "address",
142
+ name: "from",
143
+ type: "address"
144
+ },
145
+ {
146
+ indexed: !0,
147
+ internalType: "address",
148
+ name: "to",
149
+ type: "address"
150
+ },
151
+ {
152
+ indexed: !1,
153
+ internalType: "uint256",
154
+ name: "value",
155
+ type: "uint256"
156
+ }
157
+ ],
158
+ name: "Transfer",
159
+ type: "event"
160
+ },
161
+ {
162
+ inputs: [
163
+ {
164
+ internalType: "address",
165
+ name: "owner",
166
+ type: "address"
167
+ },
168
+ {
169
+ internalType: "address",
170
+ name: "spender",
171
+ type: "address"
172
+ }
173
+ ],
174
+ name: "allowance",
175
+ outputs: [
176
+ {
177
+ internalType: "uint256",
178
+ name: "",
179
+ type: "uint256"
180
+ }
181
+ ],
182
+ stateMutability: "view",
183
+ type: "function"
184
+ },
185
+ {
186
+ inputs: [
187
+ {
188
+ internalType: "address",
189
+ name: "spender",
190
+ type: "address"
191
+ },
192
+ {
193
+ internalType: "uint256",
194
+ name: "amount",
195
+ type: "uint256"
196
+ }
197
+ ],
198
+ name: "approve",
199
+ outputs: [
200
+ {
201
+ internalType: "bool",
202
+ name: "",
203
+ type: "bool"
204
+ }
205
+ ],
206
+ stateMutability: "nonpayable",
207
+ type: "function"
208
+ },
209
+ {
210
+ inputs: [
211
+ {
212
+ internalType: "address",
213
+ name: "account",
214
+ type: "address"
215
+ }
216
+ ],
217
+ name: "balanceOf",
218
+ outputs: [
219
+ {
220
+ internalType: "uint256",
221
+ name: "",
222
+ type: "uint256"
223
+ }
224
+ ],
225
+ stateMutability: "view",
226
+ type: "function"
227
+ },
228
+ {
229
+ inputs: [],
230
+ name: "decimals",
231
+ outputs: [
232
+ {
233
+ internalType: "uint8",
234
+ name: "",
235
+ type: "uint8"
236
+ }
237
+ ],
238
+ stateMutability: "view",
239
+ type: "function"
240
+ },
241
+ {
242
+ inputs: [
243
+ {
244
+ internalType: "address",
245
+ name: "spender",
246
+ type: "address"
247
+ },
248
+ {
249
+ internalType: "uint256",
250
+ name: "subtractedValue",
251
+ type: "uint256"
252
+ }
253
+ ],
254
+ name: "decreaseAllowance",
255
+ outputs: [
256
+ {
257
+ internalType: "bool",
258
+ name: "",
259
+ type: "bool"
260
+ }
261
+ ],
262
+ stateMutability: "nonpayable",
263
+ type: "function"
264
+ },
265
+ {
266
+ inputs: [
267
+ {
268
+ internalType: "address",
269
+ name: "spender",
270
+ type: "address"
271
+ },
272
+ {
273
+ internalType: "uint256",
274
+ name: "addedValue",
275
+ type: "uint256"
276
+ }
277
+ ],
278
+ name: "increaseAllowance",
279
+ outputs: [
280
+ {
281
+ internalType: "bool",
282
+ name: "",
283
+ type: "bool"
284
+ }
285
+ ],
286
+ stateMutability: "nonpayable",
287
+ type: "function"
288
+ },
289
+ {
290
+ inputs: [],
291
+ name: "name",
292
+ outputs: [
293
+ {
294
+ internalType: "string",
295
+ name: "",
296
+ type: "string"
297
+ }
298
+ ],
299
+ stateMutability: "view",
300
+ type: "function"
301
+ },
302
+ {
303
+ inputs: [],
304
+ name: "symbol",
305
+ outputs: [
306
+ {
307
+ internalType: "string",
308
+ name: "",
309
+ type: "string"
310
+ }
311
+ ],
312
+ stateMutability: "view",
313
+ type: "function"
314
+ },
315
+ {
316
+ inputs: [],
317
+ name: "totalSupply",
318
+ outputs: [
319
+ {
320
+ internalType: "uint256",
321
+ name: "",
322
+ type: "uint256"
323
+ }
324
+ ],
325
+ stateMutability: "view",
326
+ type: "function"
327
+ },
328
+ {
329
+ inputs: [
330
+ {
331
+ internalType: "address",
332
+ name: "recipient",
333
+ type: "address"
334
+ },
335
+ {
336
+ internalType: "uint256",
337
+ name: "amount",
338
+ type: "uint256"
339
+ }
340
+ ],
341
+ name: "transfer",
342
+ outputs: [
343
+ {
344
+ internalType: "bool",
345
+ name: "",
346
+ type: "bool"
347
+ }
348
+ ],
349
+ stateMutability: "nonpayable",
350
+ type: "function"
351
+ },
352
+ {
353
+ inputs: [
354
+ {
355
+ internalType: "address",
356
+ name: "sender",
357
+ type: "address"
358
+ },
359
+ {
360
+ internalType: "address",
361
+ name: "recipient",
362
+ type: "address"
363
+ },
364
+ {
365
+ internalType: "uint256",
366
+ name: "amount",
367
+ type: "uint256"
368
+ }
369
+ ],
370
+ name: "transferFrom",
371
+ outputs: [
372
+ {
373
+ internalType: "bool",
374
+ name: "",
375
+ type: "bool"
376
+ }
377
+ ],
378
+ stateMutability: "nonpayable",
379
+ type: "function"
380
+ }
381
+ ], Ut = /* @__PURE__ */ JSON.parse('[{"inputs":[{"internalType":"address","name":"_iweth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"name":"OrderBid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"address","name":"sender","type":"address"}],"name":"OrderCanceled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"}],"name":"OrderCompleted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"indexed":false,"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"}],"name":"OrderCreated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint64","name":"id","type":"uint64"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"exchange","type":"address"},{"indexed":false,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"uint256","name":"srcAmountIn","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstAmountOut","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"dstFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"srcFilledAmount","type":"uint256"}],"name":"OrderFilled","type":"event"},{"inputs":[],"name":"MIN_BID_DELAY_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MIN_OUTBID_PERCENT","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PERCENT_BASE","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STALE_BID_SECONDS","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_CANCELED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"STATUS_COMPLETED","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VERSION","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"_ask","type":"tuple"}],"name":"ask","outputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"uint32","name":"slippagePercent","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"bid","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"book","outputs":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"cancel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"fill","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"iweth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"length","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"makerOrders","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"order","outputs":[{"components":[{"internalType":"uint64","name":"id","type":"uint64"},{"internalType":"uint32","name":"status","type":"uint32"},{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"uint32","name":"filledTime","type":"uint32"},{"internalType":"uint256","name":"srcFilledAmount","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"components":[{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"srcToken","type":"address"},{"internalType":"address","name":"dstToken","type":"address"},{"internalType":"uint256","name":"srcAmount","type":"uint256"},{"internalType":"uint256","name":"srcBidAmount","type":"uint256"},{"internalType":"uint256","name":"dstMinAmount","type":"uint256"},{"internalType":"uint32","name":"deadline","type":"uint32"},{"internalType":"uint32","name":"bidDelay","type":"uint32"},{"internalType":"uint32","name":"fillDelay","type":"uint32"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Ask","name":"ask","type":"tuple"},{"components":[{"internalType":"uint32","name":"time","type":"uint32"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"uint256","name":"dstAmount","type":"uint256"},{"internalType":"uint256","name":"dstFee","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.Bid","name":"bid","type":"tuple"}],"internalType":"struct OrderLib.Order","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"maker","type":"address"}],"name":"orderIdsByMaker","outputs":[{"internalType":"uint64[]","name":"","type":"uint64[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint64","name":"id","type":"uint64"}],"name":"prune","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"status","outputs":[{"internalType":"uint32","name":"","type":"uint32"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]'), Vt = [
382
+ {
383
+ type: "constructor",
384
+ inputs: [],
385
+ stateMutability: "nonpayable"
386
+ },
387
+ {
388
+ type: "function",
389
+ name: "DOMAIN_SEPARATOR",
390
+ inputs: [],
391
+ outputs: [
392
+ {
393
+ name: "",
394
+ type: "bytes32",
395
+ internalType: "bytes32"
396
+ }
397
+ ],
398
+ stateMutability: "view"
399
+ },
400
+ {
401
+ type: "function",
402
+ name: "cancel",
403
+ inputs: [
404
+ {
405
+ name: "digests",
406
+ type: "bytes32[]",
407
+ internalType: "bytes32[]"
408
+ }
409
+ ],
410
+ outputs: [],
411
+ stateMutability: "nonpayable"
412
+ },
413
+ {
414
+ type: "function",
415
+ name: "eip712Domain",
416
+ inputs: [],
417
+ outputs: [
418
+ {
419
+ name: "fields",
420
+ type: "bytes1",
421
+ internalType: "bytes1"
422
+ },
423
+ {
424
+ name: "name",
425
+ type: "string",
426
+ internalType: "string"
427
+ },
428
+ {
429
+ name: "version",
430
+ type: "string",
431
+ internalType: "string"
432
+ },
433
+ {
434
+ name: "chainId",
435
+ type: "uint256",
436
+ internalType: "uint256"
437
+ },
438
+ {
439
+ name: "verifyingContract",
440
+ type: "address",
441
+ internalType: "address"
442
+ },
443
+ {
444
+ name: "salt",
445
+ type: "bytes32",
446
+ internalType: "bytes32"
447
+ },
448
+ {
449
+ name: "extensions",
450
+ type: "uint256[]",
451
+ internalType: "uint256[]"
452
+ }
453
+ ],
454
+ stateMutability: "view"
455
+ },
456
+ {
457
+ type: "function",
458
+ name: "hashTypedData",
459
+ inputs: [
460
+ {
461
+ name: "structHash",
462
+ type: "bytes32",
463
+ internalType: "bytes32"
464
+ }
465
+ ],
466
+ outputs: [
467
+ {
468
+ name: "digest",
469
+ type: "bytes32",
470
+ internalType: "bytes32"
471
+ }
472
+ ],
473
+ stateMutability: "view"
474
+ },
475
+ {
476
+ type: "function",
477
+ name: "repermitWitnessTransferFrom",
478
+ inputs: [
479
+ {
480
+ name: "permit",
481
+ type: "tuple",
482
+ internalType: "struct RePermitLib.RePermitTransferFrom",
483
+ components: [
484
+ {
485
+ name: "permitted",
486
+ type: "tuple",
487
+ internalType: "struct RePermitLib.TokenPermissions",
488
+ components: [
489
+ {
490
+ name: "token",
491
+ type: "address",
492
+ internalType: "address"
493
+ },
494
+ {
495
+ name: "amount",
496
+ type: "uint256",
497
+ internalType: "uint256"
498
+ }
499
+ ]
500
+ },
501
+ {
502
+ name: "nonce",
503
+ type: "uint256",
504
+ internalType: "uint256"
505
+ },
506
+ {
507
+ name: "deadline",
508
+ type: "uint256",
509
+ internalType: "uint256"
510
+ }
511
+ ]
512
+ },
513
+ {
514
+ name: "request",
515
+ type: "tuple",
516
+ internalType: "struct RePermitLib.TransferRequest",
517
+ components: [
518
+ {
519
+ name: "to",
520
+ type: "address",
521
+ internalType: "address"
522
+ },
523
+ {
524
+ name: "amount",
525
+ type: "uint256",
526
+ internalType: "uint256"
527
+ }
528
+ ]
529
+ },
530
+ {
531
+ name: "signer",
532
+ type: "address",
533
+ internalType: "address"
534
+ },
535
+ {
536
+ name: "witness",
537
+ type: "bytes32",
538
+ internalType: "bytes32"
539
+ },
540
+ {
541
+ name: "witnessTypeString",
542
+ type: "string",
543
+ internalType: "string"
544
+ },
545
+ {
546
+ name: "signature",
547
+ type: "bytes",
548
+ internalType: "bytes"
549
+ }
550
+ ],
551
+ outputs: [],
552
+ stateMutability: "nonpayable"
553
+ },
554
+ {
555
+ type: "function",
556
+ name: "spent",
557
+ inputs: [
558
+ {
559
+ name: "",
560
+ type: "address",
561
+ internalType: "address"
562
+ },
563
+ {
564
+ name: "",
565
+ type: "bytes32",
566
+ internalType: "bytes32"
567
+ }
568
+ ],
569
+ outputs: [
570
+ {
571
+ name: "",
572
+ type: "uint256",
573
+ internalType: "uint256"
574
+ }
575
+ ],
576
+ stateMutability: "view"
577
+ },
578
+ {
579
+ type: "event",
580
+ name: "Cancel",
581
+ inputs: [
582
+ {
583
+ name: "signer",
584
+ type: "address",
585
+ indexed: !0,
586
+ internalType: "address"
587
+ },
588
+ {
589
+ name: "digest",
590
+ type: "bytes32",
591
+ indexed: !1,
592
+ internalType: "bytes32"
593
+ }
594
+ ],
595
+ anonymous: !1
596
+ },
597
+ {
598
+ type: "event",
599
+ name: "EIP712DomainChanged",
600
+ inputs: [],
601
+ anonymous: !1
602
+ },
603
+ {
604
+ type: "event",
605
+ name: "Spend",
606
+ inputs: [
607
+ {
608
+ name: "signer",
609
+ type: "address",
610
+ indexed: !0,
611
+ internalType: "address"
612
+ },
613
+ {
614
+ name: "permitHash",
615
+ type: "bytes32",
616
+ indexed: !0,
617
+ internalType: "bytes32"
618
+ },
619
+ {
620
+ name: "token",
621
+ type: "address",
622
+ indexed: !0,
623
+ internalType: "address"
624
+ },
625
+ {
626
+ name: "to",
627
+ type: "address",
628
+ indexed: !1,
629
+ internalType: "address"
630
+ },
631
+ {
632
+ name: "amount",
633
+ type: "uint256",
634
+ indexed: !1,
635
+ internalType: "uint256"
636
+ },
637
+ {
638
+ name: "totalSpent",
639
+ type: "uint256",
640
+ indexed: !1,
641
+ internalType: "uint256"
642
+ }
643
+ ],
644
+ anonymous: !1
645
+ },
646
+ {
647
+ type: "error",
648
+ name: "Canceled",
649
+ inputs: []
650
+ },
651
+ {
652
+ type: "error",
653
+ name: "Expired",
654
+ inputs: []
655
+ },
656
+ {
657
+ type: "error",
658
+ name: "InsufficientAllowance",
659
+ inputs: []
660
+ },
661
+ {
662
+ type: "error",
663
+ name: "InvalidShortString",
664
+ inputs: []
665
+ },
666
+ {
667
+ type: "error",
668
+ name: "InvalidSignature",
669
+ inputs: []
670
+ },
671
+ {
672
+ type: "error",
673
+ name: "SafeERC20FailedOperation",
674
+ inputs: [
675
+ {
676
+ name: "token",
677
+ type: "address",
678
+ internalType: "address"
679
+ }
680
+ ]
681
+ },
682
+ {
683
+ type: "error",
684
+ name: "StringTooLong",
685
+ inputs: [
686
+ {
687
+ name: "str",
688
+ type: "string",
689
+ internalType: "string"
690
+ }
691
+ ]
692
+ }
693
+ ], Vn = Mt, Wn = Lt, zn = Vt, $n = Ut;
694
+ var z = /* @__PURE__ */ ((e) => (e.TWAP = "TWAP", e.LIMIT = "LIMIT", e.STOP_LOSS = "STOP_LOSS", e.TAKE_PROFIT = "TAKE_PROFIT", e))(z || {}), re = /* @__PURE__ */ ((e) => (e.Open = "OPEN", e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Expired = "EXPIRED", e))(re || {}), Wt = /* @__PURE__ */ ((e) => (e.All = "ALL", e.Open = "OPEN", e.Cancelled = "CANCELLED", e.Completed = "COMPLETED", e.Expired = "EXPIRED", e))(Wt || {}), ae = /* @__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))(ae || {}), q = /* @__PURE__ */ ((e) => (e.LIMIT = "limit", e.TWAP_LIMIT = "twap-limit", e.TWAP_MARKET = "twap-market", e.TAKE_PROFIT = "take-profit", e.STOP_LOSS_LIMIT = "stop-loss-limit", e.STOP_LOSS_MARKET = "stop-loss-market", e))(q || {}), pe = /* @__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))(pe || {}), zt = /* @__PURE__ */ ((e) => (e[e.EMPTY_LIMIT_PRICE = 0] = "EMPTY_LIMIT_PRICE", e[e.MAX_CHUNKS = 1] = "MAX_CHUNKS", e[e.MIN_CHUNKS = 2] = "MIN_CHUNKS", e[e.MIN_TRADE_SIZE = 3] = "MIN_TRADE_SIZE", e[e.MAX_FILL_DELAY = 4] = "MAX_FILL_DELAY", e[e.MIN_FILL_DELAY = 5] = "MIN_FILL_DELAY", e[e.MAX_ORDER_DURATION = 6] = "MAX_ORDER_DURATION", e[e.MIN_ORDER_DURATION = 7] = "MIN_ORDER_DURATION", e[e.MISSING_LIMIT_PRICE = 8] = "MISSING_LIMIT_PRICE", e[e.STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE = 9] = "STOP_LOSS_TRIGGER_PRICE_GREATER_THAN_MARKET_PRICE", e[e.TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE = 10] = "TRIGGER_LIMIT_PRICE_GREATER_THAN_TRIGGER_PRICE", e[e.TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE = 11] = "TAKE_PROFIT_TRIGGER_PRICE_LESS_THAN_MARKET_PRICE", e[e.EMPTY_TRIGGER_PRICE = 12] = "EMPTY_TRIGGER_PRICE", e[e.INSUFFICIENT_BALANCE = 13] = "INSUFFICIENT_BALANCE", e[e.MAX_ORDER_SIZE = 14] = "MAX_ORDER_SIZE", e[e.MIN_TRADE_SIZE_ERROR = 15] = "MIN_TRADE_SIZE_ERROR", e))(zt || {});
695
+ const U = "0x0000000000000000000000000000000000000000", K = {
696
+ eth: {
697
+ id: 1,
698
+ name: "Ethereum",
699
+ shortname: "eth",
700
+ native: {
701
+ address: U,
702
+ symbol: "ETH",
703
+ decimals: 18,
704
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
705
+ },
706
+ wToken: {
707
+ symbol: "WETH",
708
+ address: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
709
+ decimals: 18,
710
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
711
+ },
712
+ publicRpcUrl: "https://eth.llamarpc.com",
713
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg",
714
+ explorer: "https://etherscan.io",
715
+ eip1559: !0
716
+ },
717
+ bsc: {
718
+ id: 56,
719
+ name: "BinanceSmartChain",
720
+ shortname: "bsc",
721
+ native: {
722
+ address: U,
723
+ symbol: "BNB",
724
+ decimals: 18,
725
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"
726
+ },
727
+ wToken: {
728
+ symbol: "WBNB",
729
+ address: "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",
730
+ decimals: 18,
731
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/128x128/1839.png"
732
+ },
733
+ publicRpcUrl: "https://bsc-dataseed.binance.org",
734
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/bsc_2.svg",
735
+ explorer: "https://bscscan.com",
736
+ eip1559: !1
737
+ },
738
+ poly: {
739
+ id: 137,
740
+ name: "Polygon",
741
+ shortname: "poly",
742
+ native: {
743
+ address: U,
744
+ symbol: "POL",
745
+ decimals: 18,
746
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/64x64/28321.png"
747
+ },
748
+ wToken: {
749
+ symbol: "WPOL",
750
+ address: "0x0d500B1d8E8eF31E21C99d1Db9A6444d3ADf1270",
751
+ decimals: 18,
752
+ logoUrl: "https://tokens-data.1inch.io/images/0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270.png"
753
+ },
754
+ publicRpcUrl: "https://polygon-rpc.com",
755
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/polygon.svg",
756
+ explorer: "https://polygonscan.com",
757
+ eip1559: !0
758
+ },
759
+ arb: {
760
+ id: 42161,
761
+ name: "Arbitrum",
762
+ shortname: "arb",
763
+ native: {
764
+ address: U,
765
+ symbol: "ETH",
766
+ decimals: 18,
767
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
768
+ },
769
+ wToken: {
770
+ symbol: "WETH",
771
+ address: "0x82af49447d8a07e3bd95bd0d56f35241523fbab1",
772
+ decimals: 18,
773
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
774
+ },
775
+ publicRpcUrl: "https://arb1.arbitrum.io/rpc",
776
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/arbitrum.svg",
777
+ explorer: "https://arbiscan.io",
778
+ eip1559: !0
779
+ },
780
+ sei: {
781
+ id: 1329,
782
+ name: "Sei",
783
+ shortname: "sei",
784
+ native: {
785
+ address: U,
786
+ symbol: "SEI",
787
+ decimals: 18,
788
+ logoUrl: "https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png"
789
+ },
790
+ wToken: {
791
+ symbol: "WSEI",
792
+ address: "0xE30feDd158A2e3b13e9badaeABaFc5516e95e8C7",
793
+ decimals: 18,
794
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
795
+ },
796
+ publicRpcUrl: "https://evm-rpc.sei-apis.com",
797
+ logoUrl: "https://assets.coingecko.com/coins/images/28205/standard/Sei_Logo_-_Transparent.png",
798
+ explorer: "https://seitrace.com",
799
+ eip1559: !1
800
+ },
801
+ avax: {
802
+ id: 43114,
803
+ name: "Avalanche",
804
+ shortname: "avax",
805
+ native: {
806
+ address: U,
807
+ symbol: "AVAX",
808
+ decimals: 18,
809
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/avalanche.svg"
810
+ },
811
+ wToken: {
812
+ symbol: "WAVAX",
813
+ address: "0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",
814
+ decimals: 18,
815
+ logoUrl: "https://tokens-data.1inch.io/images/0xb31f66aa3c1e785363f0875a1b74e27b85fd66c7.png"
816
+ },
817
+ publicRpcUrl: "https://api.avax.network/ext/bc/C/rpc",
818
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/avalanche.svg",
819
+ explorer: "https://snowtrace.io",
820
+ eip1559: !0
821
+ },
822
+ ftm: {
823
+ id: 250,
824
+ name: "Fantom",
825
+ shortname: "ftm",
826
+ native: {
827
+ address: U,
828
+ symbol: "FTM",
829
+ decimals: 18,
830
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/fantom.svg"
831
+ },
832
+ wToken: {
833
+ symbol: "WFTM",
834
+ address: "0x21be370D5312f44cB42ce377BC9b8a0cEF1A4C83",
835
+ decimals: 18,
836
+ logoUrl: "https://tokens-data.1inch.io/images/0x4e15361fd6b4bb609fa63c81a2be19d873717870.png"
837
+ },
838
+ publicRpcUrl: "https://rpc.ftm.tools",
839
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/fantom.svg",
840
+ explorer: "https://ftmscan.com",
841
+ eip1559: !0
842
+ },
843
+ base: {
844
+ id: 8453,
845
+ name: "Base",
846
+ shortname: "base",
847
+ native: {
848
+ address: U,
849
+ symbol: "ETH",
850
+ decimals: 18,
851
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
852
+ },
853
+ wToken: {
854
+ symbol: "WETH",
855
+ address: "0x4200000000000000000000000000000000000006",
856
+ decimals: 18,
857
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
858
+ },
859
+ publicRpcUrl: "https://mainnet.base.org",
860
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/base.svg",
861
+ explorer: "https://basescan.org",
862
+ eip1559: !1
863
+ },
864
+ linea: {
865
+ id: 59144,
866
+ name: "Linea",
867
+ shortname: "linea",
868
+ native: {
869
+ address: U,
870
+ symbol: "ETH",
871
+ decimals: 18,
872
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
873
+ },
874
+ wToken: {
875
+ symbol: "WETH",
876
+ address: "0xe5D7C2a44FfDDf6b295A15c148167daaAf5Cf34f",
877
+ decimals: 18,
878
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
879
+ },
880
+ publicRpcUrl: "https://rpc.linea.build",
881
+ logoUrl: "https://lineascan.build/images/logo.svg",
882
+ explorer: "https://lineascan.build",
883
+ eip1559: !1
884
+ },
885
+ zksync: {
886
+ id: 324,
887
+ name: "zksync",
888
+ shortname: "zksync",
889
+ native: {
890
+ address: U,
891
+ symbol: "ETH",
892
+ decimals: 18,
893
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
894
+ },
895
+ wToken: {
896
+ symbol: "WETH",
897
+ address: "0x5AEa5775959fBC2557Cc8789bC1bf90A239D9a91",
898
+ decimals: 18,
899
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
900
+ },
901
+ publicRpcUrl: "https://mainnet.era.zksync.io",
902
+ logoUrl: "https://raw.githubusercontent.com/matter-labs/zksync/0a4ca2145a0c95b5bafa84c2f095c644907a8825/zkSyncLogo.svg",
903
+ explorer: "https://explorer.zksync.io/",
904
+ eip1559: !0
905
+ },
906
+ zkevm: {
907
+ id: 1101,
908
+ name: "zkevm",
909
+ shortname: "zkevm",
910
+ native: {
911
+ address: U,
912
+ symbol: "ETH",
913
+ decimals: 18,
914
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
915
+ },
916
+ wToken: {
917
+ symbol: "WETH",
918
+ address: "0x4F9A0e7FD2Bf6067db6994CF12E4495Df938E6e9",
919
+ decimals: 18,
920
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
921
+ },
922
+ publicRpcUrl: "https://zkevm-rpc.com",
923
+ logoUrl: "https://user-images.githubusercontent.com/18598517/235932702-bc47eae5-d672-4dd9-9da2-8ea8f51a93f3.png",
924
+ explorer: "https://zkevm.polygonscan.com/",
925
+ eip1559: !0
926
+ },
927
+ manta: {
928
+ id: 169,
929
+ name: "manta",
930
+ shortname: "manta",
931
+ native: {
932
+ address: U,
933
+ symbol: "ETH",
934
+ decimals: 18,
935
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_manta.jpg"
936
+ },
937
+ wToken: {
938
+ symbol: "WETH",
939
+ address: "0x0Dc808adcE2099A9F62AA87D9670745AbA741746",
940
+ decimals: 18,
941
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
942
+ },
943
+ publicRpcUrl: "https://pacific-rpc.manta.network/http",
944
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_manta.jpg",
945
+ explorer: "https://manta.socialscan.io/",
946
+ eip1559: !0
947
+ },
948
+ blast: {
949
+ id: 81457,
950
+ name: "blast",
951
+ shortname: "blast",
952
+ native: {
953
+ address: U,
954
+ symbol: "ETH",
955
+ decimals: 18,
956
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_blast"
957
+ },
958
+ wToken: {
959
+ symbol: "WETH",
960
+ address: "0x4300000000000000000000000000000000000004",
961
+ decimals: 18,
962
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
963
+ },
964
+ publicRpcUrl: "https://rpc.ankr.com/blast",
965
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_blast",
966
+ explorer: "https://blastscan.io/",
967
+ eip1559: !0
968
+ },
969
+ sonic: {
970
+ id: 146,
971
+ name: "sonic",
972
+ shortname: "sonic",
973
+ native: {
974
+ address: U,
975
+ symbol: "S",
976
+ decimals: 18,
977
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_sonic"
978
+ },
979
+ wToken: {
980
+ symbol: "WS",
981
+ address: "0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38",
982
+ decimals: 18,
983
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_sonic"
984
+ },
985
+ publicRpcUrl: "https://rpc.soniclabs.com",
986
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_sonic",
987
+ explorer: "https://www.sonicscan.org/",
988
+ eip1559: !0
989
+ },
990
+ scroll: {
991
+ id: 534352,
992
+ name: "scroll",
993
+ shortname: "scroll",
994
+ native: {
995
+ address: U,
996
+ symbol: "ETH",
997
+ decimals: 18,
998
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_scroll"
999
+ },
1000
+ wToken: {
1001
+ symbol: "WETH",
1002
+ address: "0x5300000000000000000000000000000000000004",
1003
+ decimals: 18,
1004
+ logoUrl: "https://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
1005
+ },
1006
+ publicRpcUrl: "https://scroll-rpc.publicnode.com",
1007
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_scroll",
1008
+ explorer: "https://scrollscan.com/",
1009
+ eip1559: !0
1010
+ },
1011
+ zircuit: {
1012
+ id: 48900,
1013
+ name: "Zircuit",
1014
+ shortname: "zircuit",
1015
+ native: {
1016
+ address: U,
1017
+ symbol: "ETH",
1018
+ decimals: 18,
1019
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg"
1020
+ },
1021
+ wToken: {
1022
+ symbol: "WETH",
1023
+ address: "0x4200000000000000000000000000000000000006",
1024
+ decimals: 18,
1025
+ logoUrl: "hhttps://tokens-data.1inch.io/images/0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.png"
1026
+ },
1027
+ publicRpcUrl: "https://zircuit-mainnet.drpc.org",
1028
+ logoUrl: "https://app.1inch.io/assets/images/network-logos/ethereum.svg",
1029
+ explorer: "https://explorer.zircuit.com/",
1030
+ eip1559: !0
1031
+ },
1032
+ flare: {
1033
+ id: 14,
1034
+ name: "flare",
1035
+ shortname: "flare",
1036
+ native: {
1037
+ address: U,
1038
+ symbol: "FLR",
1039
+ decimals: 18,
1040
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48"
1041
+ },
1042
+ wToken: {
1043
+ symbol: "WFLR",
1044
+ address: "0x1D80c49BbBCd1C0911346656B529DF9E5c2F783d",
1045
+ decimals: 18,
1046
+ logoUrl: "https://res.cloudinary.com/sparkdex/image/upload/q_100/v1/website-assets/coins/wflr?_a=DATAg1AAZAA0"
1047
+ },
1048
+ publicRpcUrl: "https://flare.network",
1049
+ logoUrl: "https://icons.llamao.fi/icons/chains/rsz_flare?w=48&h=48",
1050
+ explorer: "https://flarescan.com",
1051
+ eip1559: !0
1052
+ },
1053
+ cronosZkEvm: {
1054
+ id: 388,
1055
+ name: "Cronos zkEVM",
1056
+ shortname: "cronosZkEvm",
1057
+ native: {
1058
+ address: "0x000000000000000000000000000000000000800a",
1059
+ symbol: "zkCRO",
1060
+ decimals: 18,
1061
+ logoUrl: "https://cryptologos.cc/logos/cronos-cro-logo.png"
1062
+ // Replace with the official logo URL if available
1063
+ },
1064
+ wToken: {
1065
+ symbol: "wzkCRO",
1066
+ address: "0xC1bF55EE54E16229d9b369a5502Bfe5fC9F20b6d",
1067
+ decimals: 18,
1068
+ logoUrl: "https://cryptologos.cc/logos/cronos-cro-logo.png"
1069
+ // Replace with the official logo URL if available
1070
+ },
1071
+ publicRpcUrl: "https://rpc.zkevm.cronos.org",
1072
+ logoUrl: "https://cryptologos.cc/logos/cronos-cro-logo.png",
1073
+ // Replace with the official logo URL if available
1074
+ explorer: "https://explorer.zkevm.cronos.org",
1075
+ eip1559: !0
1076
+ },
1077
+ katana: {
1078
+ id: 747474,
1079
+ name: "Katana",
1080
+ shortname: "katana",
1081
+ native: {
1082
+ address: U,
1083
+ symbol: "ETH",
1084
+ decimals: 18,
1085
+ logoUrl: "https://katana.network/assets/katana-logo.svg"
1086
+ },
1087
+ wToken: {
1088
+ symbol: "WETH",
1089
+ address: "0xee7d8bcfb72bc1880d0cf19822eb0a2e6577ab62",
1090
+ // standard L2 WETH address (example, verify if custom)
1091
+ decimals: 18,
1092
+ logoUrl: "https://katana.network/assets/weth-logo.svg"
1093
+ },
1094
+ publicRpcUrl: "https://rpc.katanarpc.com",
1095
+ logoUrl: "https://katana.network/assets/katana-logo.svg",
1096
+ explorer: "https://explorer.katana.garden",
1097
+ // placeholder — replace with actual if known
1098
+ eip1559: !0
1099
+ },
1100
+ bera: {
1101
+ id: 80094,
1102
+ name: "Bera",
1103
+ shortname: "bera",
1104
+ native: {
1105
+ address: U,
1106
+ symbol: "BERA",
1107
+ decimals: 18,
1108
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/128x128/24647.png"
1109
+ },
1110
+ wToken: {
1111
+ symbol: "WBERA",
1112
+ address: "0x6969696969696969696969696969696969696969",
1113
+ // standard L2 WETH address (example, verify if custom)
1114
+ decimals: 18,
1115
+ logoUrl: "https://berascan.com/token/images/wrappedbera_ofc_64.png"
1116
+ },
1117
+ publicRpcUrl: "wss://rpc.berachain-apis.com",
1118
+ logoUrl: "https://katana.network/assets/katana-logo.svg",
1119
+ explorer: "https://berascan.com",
1120
+ // placeholder — replace with actual if known
1121
+ eip1559: !0
1122
+ },
1123
+ monad: {
1124
+ id: 143,
1125
+ name: "Monad",
1126
+ shortname: "monad",
1127
+ native: {
1128
+ address: U,
1129
+ symbol: "MONAD",
1130
+ decimals: 18,
1131
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png"
1132
+ },
1133
+ wToken: {
1134
+ symbol: "WMON",
1135
+ address: "0x3bd359c1119da7da1d913d1c4d2b7c461115433a",
1136
+ decimals: 18,
1137
+ logoUrl: "https://assets.coingecko.com/coins/images/70784/standard/wmon.png?1766028904"
1138
+ },
1139
+ publicRpcUrl: "https://monad-mainnet.drpc.org",
1140
+ logoUrl: "https://s2.coinmarketcap.com/static/img/coins/128x128/30495.png",
1141
+ explorer: "https://monad.network",
1142
+ eip1559: !0
1143
+ }
1144
+ }, $t = "2.0.1", Ht = {
1145
+ version: $t
1146
+ }, Kt = "https://order-sink-dev.orbs.network", Gt = "https://order-sink.orbs.network", qt = "https://order-sink-v2.orbs.network", xe = Ht.version.split(".")[0], Le = (e) => {
1147
+ const n = Number(xe) >= 2;
1148
+ return e ? Kt : n ? qt : Gt;
1149
+ }, Hn = 100, Kn = 1, Ue = 300 * 1e3, ge = 365 * 24 * 60 * 60 * 1e3, Ke = 300 * 1e3, Xt = new Date(
1150
+ Ue
1151
+ ).getMinutes(), Oe = (e) => `https://hub.orbs.network/api/private/project_cm7nb67z86nyr01z12gs0fxpf/subgraphs/orbs-twap-${e}/prod/gn`, te = "https://hub.orbs.network/api/apikey/subgraphs/id", jt = {
1152
+ [K.eth.id]: `${te}/Bf7bvMYcJbDAvYWJmhMpHZ4cpFjqzkhK6GXXEpnPRq6`,
1153
+ [K.bsc.id]: `${te}/4NfXEi8rreQsnAr4aJ45RLCKgnjcWX46Lbt9SadiCcz6`,
1154
+ [K.poly.id]: `${te}/3PyRPWSvDnMowGbeBy7aNsvUkD5ZuxdXQw2RdJq4NdXi`,
1155
+ [K.arb.id]: `${te}/83bpQexEaqBjHaQbKoFTbtvCXuo5RudRkfLgtRUYqo2c`,
1156
+ [K.base.id]: `${te}/DFhaPQb3HATXkpsWNZw3gydYHehLBVEDiSk4iBdZJyps`,
1157
+ [K.sei.id]: `${te}/5zjzRnURzoddyFSZBw5E5NAM3oBgPq3NasTYbtMk6EL6`,
1158
+ [K.linea.id]: `${te}/6VsNPEYfFLPZCqdMMDadoXQjLHWJdjEwiD768GAtb7j6`,
1159
+ [K.sonic.id]: `${te}/DtBr6a5vsoDd2oAXdPszcn4gLgrr1XC68Q3AJQKXnNLV`,
1160
+ [K.ftm.id]: `${te}/DdRo1pmJkrJC9fjsjEBWnNE1uqrbh7Diz4tVKd7rfupp`,
1161
+ [K.katana.id]: `${te}/CGi9sDFMQcnBwF3C3NoCFqnaE34sssbgwPLTwiskSXmW`,
1162
+ [K.avax.id]: `${te}/FxZ1vMwE5Xy1qvKvZENUMz4vhW8Sh4vXJf9Vp7o17pTx`,
1163
+ [K.bera.id]: Oe("berachain"),
1164
+ [K.flare.id]: Oe("flare"),
1165
+ [K.cronosZkEvm.id]: Oe("cronos-zkevm")
1166
+ }, Qt = "0x0000000000000000000000000000000000000000", Yt = [
1167
+ Qt,
1168
+ "0x0000000000000000000000000000000000001010",
1169
+ "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
1170
+ "0x000000000000000000000000000000000000dEaD",
1171
+ "0x000000000000000000000000000000000000800A",
1172
+ "0x000000000000000000000000000000000000800a"
1173
+ ], ze = "115792089237316195423570985008687907853269984665640564039457584007913129639935", G = (e) => `${e.name}_${e.chainId}`, Zt = {
1174
+ [G(_.SushiArb)]: [
1175
+ "0x846F2B29ef314bF3D667981b4ffdADc5B858312a",
1176
+ "0x08c41f5D1C844061f6D952E25827eeAA576c6536"
1177
+ ],
1178
+ [G(_.SushiBase)]: [
1179
+ "0x846F2B29ef314bF3D667981b4ffdADc5B858312a",
1180
+ "0x08c41f5D1C844061f6D952E25827eeAA576c6536"
1181
+ ],
1182
+ [G(_.SushiEth)]: [
1183
+ "0xc55943Fa6509004B2903ED8F8ab7347BfC47D0bA",
1184
+ "0x08c41f5D1C844061f6D952E25827eeAA576c6536"
1185
+ ],
1186
+ [G(_.PancakeSwap)]: [
1187
+ "0xb2BAFe188faD927240038cC4FfF2d771d8A58905",
1188
+ "0xE2a0c3b9aD19A18c4bBa7fffBe5bC1b0E58Db1CE"
1189
+ ],
1190
+ [G(_.PancakeSwapArbitrum)]: [
1191
+ "0xE20167871dB616DdfFD0Fd870d9bC068C350DD1F",
1192
+ "0x807488ADAD033e95C438F998277bE654152594dc"
1193
+ ],
1194
+ [G(_.PancakeSwapBase)]: [
1195
+ "0x10ed1F36e4eBE76E161c9AADDa20BE841bc0082c",
1196
+ "0x3A9df3eE209b802D0337383f5abCe3204d623588"
1197
+ ],
1198
+ [G(_.PancakeSwapLinea)]: [
1199
+ "0x3A9df3eE209b802D0337383f5abCe3204d623588"
1200
+ ],
1201
+ [G(_.QuickSwap)]: [
1202
+ "0x26D0ec4Be402BCE03AAa8aAf0CF67e9428ba54eF"
1203
+ ],
1204
+ [G(_.Thena)]: [
1205
+ "0xc2aBC02acd77Bb2407efA22348dA9afC8B375290"
1206
+ ],
1207
+ [G(_.Lynex)]: [
1208
+ "0x72e3e1fD5D2Ee2F1C2Eb695206D490a1D45C3835"
1209
+ ],
1210
+ [G(_.DragonSwap)]: [
1211
+ "0x101e1B65Bb516FB5f4547C80BAe0b51f1b8D7a22"
1212
+ ],
1213
+ [G(_.SpookySwapSonic)]: [
1214
+ "0xAd97B770ad64aE47fc7d64B3bD820dCDbF9ff7DA"
1215
+ ],
1216
+ [G(_.SpookySwap)]: [
1217
+ "0x3924d62219483015f982b160d48c0fa5Fd436Cba"
1218
+ ],
1219
+ [G(_.SwapX)]: [
1220
+ "0xE5012eBDe5e26EE3Ea41992154731a03023CF274"
1221
+ ]
1222
+ }, Ge = {
1223
+ unit: ae.Minutes,
1224
+ value: Xt
1225
+ }, Gn = 0.25, qn = "100", Ye = "RePermitWitnessTransferFrom", Jt = {
1226
+ RePermitWitnessTransferFrom: [
1227
+ {
1228
+ name: "permitted",
1229
+ type: "TokenPermissions"
1230
+ },
1231
+ {
1232
+ name: "spender",
1233
+ type: "address"
1234
+ },
1235
+ {
1236
+ name: "nonce",
1237
+ type: "uint256"
1238
+ },
1239
+ {
1240
+ name: "deadline",
1241
+ type: "uint256"
1242
+ },
1243
+ {
1244
+ name: "witness",
1245
+ type: "Order"
1246
+ }
1247
+ ],
1248
+ Exchange: [
1249
+ {
1250
+ name: "adapter",
1251
+ type: "address"
1252
+ },
1253
+ {
1254
+ name: "ref",
1255
+ type: "address"
1256
+ },
1257
+ {
1258
+ name: "share",
1259
+ type: "uint32"
1260
+ },
1261
+ {
1262
+ name: "data",
1263
+ type: "bytes"
1264
+ }
1265
+ ],
1266
+ Input: [
1267
+ {
1268
+ name: "token",
1269
+ type: "address"
1270
+ },
1271
+ {
1272
+ name: "amount",
1273
+ type: "uint256"
1274
+ },
1275
+ {
1276
+ name: "maxAmount",
1277
+ type: "uint256"
1278
+ }
1279
+ ],
1280
+ Order: [
1281
+ {
1282
+ name: "reactor",
1283
+ type: "address"
1284
+ },
1285
+ {
1286
+ name: "executor",
1287
+ type: "address"
1288
+ },
1289
+ {
1290
+ name: "exchange",
1291
+ type: "Exchange"
1292
+ },
1293
+ {
1294
+ name: "swapper",
1295
+ type: "address"
1296
+ },
1297
+ {
1298
+ name: "nonce",
1299
+ type: "uint256"
1300
+ },
1301
+ {
1302
+ name: "deadline",
1303
+ type: "uint256"
1304
+ },
1305
+ {
1306
+ name: "chainid",
1307
+ type: "uint256"
1308
+ },
1309
+ {
1310
+ name: "exclusivity",
1311
+ type: "uint32"
1312
+ },
1313
+ {
1314
+ name: "epoch",
1315
+ type: "uint32"
1316
+ },
1317
+ {
1318
+ name: "slippage",
1319
+ type: "uint32"
1320
+ },
1321
+ {
1322
+ name: "freshness",
1323
+ type: "uint32"
1324
+ },
1325
+ {
1326
+ name: "input",
1327
+ type: "Input"
1328
+ },
1329
+ {
1330
+ name: "output",
1331
+ type: "Output"
1332
+ }
1333
+ ],
1334
+ Output: [
1335
+ { name: "token", type: "address" },
1336
+ { name: "limit", type: "uint256" },
1337
+ { name: "stop", type: "uint256" },
1338
+ { name: "recipient", type: "address" }
1339
+ ],
1340
+ TokenPermissions: [
1341
+ {
1342
+ name: "token",
1343
+ type: "address"
1344
+ },
1345
+ {
1346
+ name: "amount",
1347
+ type: "uint256"
1348
+ }
1349
+ ]
1350
+ }, en = {
1351
+ RePermitWitnessTransferFrom: [
1352
+ {
1353
+ name: "permitted",
1354
+ type: "TokenPermissions"
1355
+ },
1356
+ {
1357
+ name: "spender",
1358
+ type: "address"
1359
+ },
1360
+ {
1361
+ name: "nonce",
1362
+ type: "uint256"
1363
+ },
1364
+ {
1365
+ name: "deadline",
1366
+ type: "uint256"
1367
+ },
1368
+ {
1369
+ name: "witness",
1370
+ type: "Order"
1371
+ }
1372
+ ],
1373
+ Exchange: [
1374
+ {
1375
+ name: "adapter",
1376
+ type: "address"
1377
+ },
1378
+ {
1379
+ name: "ref",
1380
+ type: "address"
1381
+ },
1382
+ {
1383
+ name: "share",
1384
+ type: "uint32"
1385
+ },
1386
+ {
1387
+ name: "data",
1388
+ type: "bytes"
1389
+ }
1390
+ ],
1391
+ Input: [
1392
+ {
1393
+ name: "token",
1394
+ type: "address"
1395
+ },
1396
+ {
1397
+ name: "amount",
1398
+ type: "uint256"
1399
+ },
1400
+ {
1401
+ name: "maxAmount",
1402
+ type: "uint256"
1403
+ }
1404
+ ],
1405
+ Order: [
1406
+ {
1407
+ name: "reactor",
1408
+ type: "address"
1409
+ },
1410
+ {
1411
+ name: "executor",
1412
+ type: "address"
1413
+ },
1414
+ {
1415
+ name: "exchange",
1416
+ type: "Exchange"
1417
+ },
1418
+ {
1419
+ name: "swapper",
1420
+ type: "address"
1421
+ },
1422
+ {
1423
+ name: "nonce",
1424
+ type: "uint256"
1425
+ },
1426
+ {
1427
+ name: "start",
1428
+ type: "uint256"
1429
+ },
1430
+ {
1431
+ name: "deadline",
1432
+ type: "uint256"
1433
+ },
1434
+ {
1435
+ name: "chainid",
1436
+ type: "uint256"
1437
+ },
1438
+ {
1439
+ name: "exclusivity",
1440
+ type: "uint32"
1441
+ },
1442
+ {
1443
+ name: "epoch",
1444
+ type: "uint32"
1445
+ },
1446
+ {
1447
+ name: "slippage",
1448
+ type: "uint32"
1449
+ },
1450
+ {
1451
+ name: "freshness",
1452
+ type: "uint32"
1453
+ },
1454
+ {
1455
+ name: "input",
1456
+ type: "Input"
1457
+ },
1458
+ {
1459
+ name: "output",
1460
+ type: "Output"
1461
+ }
1462
+ ],
1463
+ Output: [
1464
+ { name: "token", type: "address" },
1465
+ { name: "limit", type: "uint256" },
1466
+ { name: "triggerLower", type: "uint256" },
1467
+ { name: "triggerUpper", type: "uint256" },
1468
+ { name: "recipient", type: "address" }
1469
+ ],
1470
+ TokenPermissions: [
1471
+ {
1472
+ name: "token",
1473
+ type: "address"
1474
+ },
1475
+ {
1476
+ name: "amount",
1477
+ type: "uint256"
1478
+ }
1479
+ ]
1480
+ }, Xn = "https://www.orbs.com/dtwap-and-dlimit-faq/", jn = "https://www.orbs.com/dtwap-and-dlimit-faq/#dSLTP", Qn = "https://raw.githubusercontent.com/orbs-network/twap-ui/master/logo/orbslogo.svg", Yn = "https://www.orbs.com/assets/img/common/logo.svg", Zn = "https://www.orbs.com/", Jn = "https://www.orbs.com/dtwap-dlimit-disclaimer";
1481
+ var Te = /* @__PURE__ */ ((e) => (e.FRESHNESS = "freshness", e.MIN_CHUNK_SIZE_USD = "minChunkSizeUsd", e.ENV = "env", e.DURATION = "duration", e.IGNORE_ERRORS = "ignore-errors", e))(Te || {});
1482
+ const ea = "-5", ta = "10", na = "-10", aa = "5", sa = "Something went wrong";
1483
+ var tn = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, Re = Math.ceil, Z = Math.floor, X = "[BigNumber Error] ", qe = X + "Number primitive has more than 15 significant digits: ", ne = 1e14, B = 14, ve = 9007199254740991, Pe = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13], ue = 1e7, W = 1e9;
1484
+ function Ze(e) {
1485
+ var n, i, m, d = b.prototype = { constructor: b, toString: null, valueOf: null }, h = new b(1), E = 20, x = 4, w = -7, D = 21, k = -1e7, T = 1e7, C = !1, v = 1, I = 0, ie = {
1486
+ prefix: "",
1487
+ groupSize: 3,
1488
+ secondaryGroupSize: 0,
1489
+ groupSeparator: ",",
1490
+ decimalSeparator: ".",
1491
+ fractionGroupSize: 0,
1492
+ fractionGroupSeparator: " ",
1493
+ // non-breaking space
1494
+ suffix: ""
1495
+ }, ee = "0123456789abcdefghijklmnopqrstuvwxyz", fe = !0;
1496
+ function b(t, a) {
1497
+ var s, l, o, p, y, r, c, f, u = this;
1498
+ if (!(u instanceof b)) return new b(t, a);
1499
+ if (a == null) {
1500
+ if (t && t._isBigNumber === !0) {
1501
+ u.s = t.s, !t.c || t.e > T ? u.c = u.e = null : t.e < k ? u.c = [u.e = 0] : (u.e = t.e, u.c = t.c.slice());
1502
+ return;
1503
+ }
1504
+ if ((r = typeof t == "number") && t * 0 == 0) {
1505
+ if (u.s = 1 / t < 0 ? (t = -t, -1) : 1, t === ~~t) {
1506
+ for (p = 0, y = t; y >= 10; y /= 10, p++) ;
1507
+ p > T ? u.c = u.e = null : (u.e = p, u.c = [t]);
1508
+ return;
1509
+ }
1510
+ f = String(t);
1511
+ } else {
1512
+ if (!tn.test(f = String(t))) return m(u, f, r);
1513
+ u.s = f.charCodeAt(0) == 45 ? (f = f.slice(1), -1) : 1;
1514
+ }
1515
+ (p = f.indexOf(".")) > -1 && (f = f.replace(".", "")), (y = f.search(/e/i)) > 0 ? (p < 0 && (p = y), p += +f.slice(y + 1), f = f.substring(0, y)) : p < 0 && (p = f.length);
1516
+ } else {
1517
+ if (N(a, 2, ee.length, "Base"), a == 10 && fe)
1518
+ return u = new b(t), j(u, E + u.e + 1, x);
1519
+ if (f = String(t), r = typeof t == "number") {
1520
+ if (t * 0 != 0) return m(u, f, r, a);
1521
+ if (u.s = 1 / t < 0 ? (f = f.slice(1), -1) : 1, b.DEBUG && f.replace(/^0\.0*|\./, "").length > 15)
1522
+ throw Error(qe + t);
1523
+ } else
1524
+ u.s = f.charCodeAt(0) === 45 ? (f = f.slice(1), -1) : 1;
1525
+ for (s = ee.slice(0, a), p = y = 0, c = f.length; y < c; y++)
1526
+ if (s.indexOf(l = f.charAt(y)) < 0) {
1527
+ if (l == ".") {
1528
+ if (y > p) {
1529
+ p = c;
1530
+ continue;
1531
+ }
1532
+ } else if (!o && (f == f.toUpperCase() && (f = f.toLowerCase()) || f == f.toLowerCase() && (f = f.toUpperCase()))) {
1533
+ o = !0, y = -1, p = 0;
1534
+ continue;
1535
+ }
1536
+ return m(u, String(t), r, a);
1537
+ }
1538
+ r = !1, f = i(f, a, 10, u.s), (p = f.indexOf(".")) > -1 ? f = f.replace(".", "") : p = f.length;
1539
+ }
1540
+ for (y = 0; f.charCodeAt(y) === 48; y++) ;
1541
+ for (c = f.length; f.charCodeAt(--c) === 48; ) ;
1542
+ if (f = f.slice(y, ++c)) {
1543
+ if (c -= y, r && b.DEBUG && c > 15 && (t > ve || t !== Z(t)))
1544
+ throw Error(qe + u.s * t);
1545
+ if ((p = p - y - 1) > T)
1546
+ u.c = u.e = null;
1547
+ else if (p < k)
1548
+ u.c = [u.e = 0];
1549
+ else {
1550
+ if (u.e = p, u.c = [], y = (p + 1) % B, p < 0 && (y += B), y < c) {
1551
+ for (y && u.c.push(+f.slice(0, y)), c -= B; y < c; )
1552
+ u.c.push(+f.slice(y, y += B));
1553
+ y = B - (f = f.slice(y)).length;
1554
+ } else
1555
+ y -= c;
1556
+ for (; y--; f += "0") ;
1557
+ u.c.push(+f);
1558
+ }
1559
+ } else
1560
+ u.c = [u.e = 0];
1561
+ }
1562
+ b.clone = Ze, b.ROUND_UP = 0, b.ROUND_DOWN = 1, b.ROUND_CEIL = 2, b.ROUND_FLOOR = 3, b.ROUND_HALF_UP = 4, b.ROUND_HALF_DOWN = 5, b.ROUND_HALF_EVEN = 6, b.ROUND_HALF_CEIL = 7, b.ROUND_HALF_FLOOR = 8, b.EUCLID = 9, b.config = b.set = function(t) {
1563
+ var a, s;
1564
+ if (t != null)
1565
+ if (typeof t == "object") {
1566
+ if (t.hasOwnProperty(a = "DECIMAL_PLACES") && (s = t[a], N(s, 0, W, a), E = s), t.hasOwnProperty(a = "ROUNDING_MODE") && (s = t[a], N(s, 0, 8, a), x = s), t.hasOwnProperty(a = "EXPONENTIAL_AT") && (s = t[a], s && s.pop ? (N(s[0], -W, 0, a), N(s[1], 0, W, a), w = s[0], D = s[1]) : (N(s, -W, W, a), w = -(D = s < 0 ? -s : s))), t.hasOwnProperty(a = "RANGE"))
1567
+ if (s = t[a], s && s.pop)
1568
+ N(s[0], -W, -1, a), N(s[1], 1, W, a), k = s[0], T = s[1];
1569
+ else if (N(s, -W, W, a), s)
1570
+ k = -(T = s < 0 ? -s : s);
1571
+ else
1572
+ throw Error(X + a + " cannot be zero: " + s);
1573
+ if (t.hasOwnProperty(a = "CRYPTO"))
1574
+ if (s = t[a], s === !!s)
1575
+ if (s)
1576
+ if (typeof crypto < "u" && crypto && (crypto.getRandomValues || crypto.randomBytes))
1577
+ C = s;
1578
+ else
1579
+ throw C = !s, Error(X + "crypto unavailable");
1580
+ else
1581
+ C = s;
1582
+ else
1583
+ throw Error(X + a + " not true or false: " + s);
1584
+ if (t.hasOwnProperty(a = "MODULO_MODE") && (s = t[a], N(s, 0, 9, a), v = s), t.hasOwnProperty(a = "POW_PRECISION") && (s = t[a], N(s, 0, W, a), I = s), t.hasOwnProperty(a = "FORMAT"))
1585
+ if (s = t[a], typeof s == "object") ie = s;
1586
+ else throw Error(X + a + " not an object: " + s);
1587
+ if (t.hasOwnProperty(a = "ALPHABET"))
1588
+ if (s = t[a], typeof s == "string" && !/^.?$|[+\-.\s]|(.).*\1/.test(s))
1589
+ fe = s.slice(0, 10) == "0123456789", ee = s;
1590
+ else
1591
+ throw Error(X + a + " invalid: " + s);
1592
+ } else
1593
+ throw Error(X + "Object expected: " + t);
1594
+ return {
1595
+ DECIMAL_PLACES: E,
1596
+ ROUNDING_MODE: x,
1597
+ EXPONENTIAL_AT: [w, D],
1598
+ RANGE: [k, T],
1599
+ CRYPTO: C,
1600
+ MODULO_MODE: v,
1601
+ POW_PRECISION: I,
1602
+ FORMAT: ie,
1603
+ ALPHABET: ee
1604
+ };
1605
+ }, b.isBigNumber = function(t) {
1606
+ if (!t || t._isBigNumber !== !0) return !1;
1607
+ if (!b.DEBUG) return !0;
1608
+ var a, s, l = t.c, o = t.e, p = t.s;
1609
+ e: if ({}.toString.call(l) == "[object Array]") {
1610
+ if ((p === 1 || p === -1) && o >= -W && o <= W && o === Z(o)) {
1611
+ if (l[0] === 0) {
1612
+ if (o === 0 && l.length === 1) return !0;
1613
+ break e;
1614
+ }
1615
+ if (a = (o + 1) % B, a < 1 && (a += B), String(l[0]).length == a) {
1616
+ for (a = 0; a < l.length; a++)
1617
+ if (s = l[a], s < 0 || s >= ne || s !== Z(s)) break e;
1618
+ if (s !== 0) return !0;
1619
+ }
1620
+ }
1621
+ } else if (l === null && o === null && (p === null || p === 1 || p === -1))
1622
+ return !0;
1623
+ throw Error(X + "Invalid BigNumber: " + t);
1624
+ }, b.maximum = b.max = function() {
1625
+ return Ae(arguments, -1);
1626
+ }, b.minimum = b.min = function() {
1627
+ return Ae(arguments, 1);
1628
+ }, b.random = (function() {
1629
+ var t = 9007199254740992, a = Math.random() * t & 2097151 ? function() {
1630
+ return Z(Math.random() * t);
1631
+ } : function() {
1632
+ return (Math.random() * 1073741824 | 0) * 8388608 + (Math.random() * 8388608 | 0);
1633
+ };
1634
+ return function(s) {
1635
+ var l, o, p, y, r, c = 0, f = [], u = new b(h);
1636
+ if (s == null ? s = E : N(s, 0, W), y = Re(s / B), C)
1637
+ if (crypto.getRandomValues) {
1638
+ for (l = crypto.getRandomValues(new Uint32Array(y *= 2)); c < y; )
1639
+ r = l[c] * 131072 + (l[c + 1] >>> 11), r >= 9e15 ? (o = crypto.getRandomValues(new Uint32Array(2)), l[c] = o[0], l[c + 1] = o[1]) : (f.push(r % 1e14), c += 2);
1640
+ c = y / 2;
1641
+ } else if (crypto.randomBytes) {
1642
+ for (l = crypto.randomBytes(y *= 7); c < y; )
1643
+ r = (l[c] & 31) * 281474976710656 + l[c + 1] * 1099511627776 + l[c + 2] * 4294967296 + l[c + 3] * 16777216 + (l[c + 4] << 16) + (l[c + 5] << 8) + l[c + 6], r >= 9e15 ? crypto.randomBytes(7).copy(l, c) : (f.push(r % 1e14), c += 7);
1644
+ c = y / 7;
1645
+ } else
1646
+ throw C = !1, Error(X + "crypto unavailable");
1647
+ if (!C)
1648
+ for (; c < y; )
1649
+ r = a(), r < 9e15 && (f[c++] = r % 1e14);
1650
+ for (y = f[--c], s %= B, y && s && (r = Pe[B - s], f[c] = Z(y / r) * r); f[c] === 0; f.pop(), c--) ;
1651
+ if (c < 0)
1652
+ f = [p = 0];
1653
+ else {
1654
+ for (p = -1; f[0] === 0; f.splice(0, 1), p -= B) ;
1655
+ for (c = 1, r = f[0]; r >= 10; r /= 10, c++) ;
1656
+ c < B && (p -= B - c);
1657
+ }
1658
+ return u.e = p, u.c = f, u;
1659
+ };
1660
+ })(), b.sum = function() {
1661
+ for (var t = 1, a = arguments, s = new b(a[0]); t < a.length; ) s = s.plus(a[t++]);
1662
+ return s;
1663
+ }, i = /* @__PURE__ */ (function() {
1664
+ var t = "0123456789";
1665
+ function a(s, l, o, p) {
1666
+ for (var y, r = [0], c, f = 0, u = s.length; f < u; ) {
1667
+ for (c = r.length; c--; r[c] *= l) ;
1668
+ for (r[0] += p.indexOf(s.charAt(f++)), y = 0; y < r.length; y++)
1669
+ r[y] > o - 1 && (r[y + 1] == null && (r[y + 1] = 0), r[y + 1] += r[y] / o | 0, r[y] %= o);
1670
+ }
1671
+ return r.reverse();
1672
+ }
1673
+ return function(s, l, o, p, y) {
1674
+ var r, c, f, u, A, F, S, R, M = s.indexOf("."), V = E, O = x;
1675
+ for (M >= 0 && (u = I, I = 0, s = s.replace(".", ""), R = new b(l), F = R.pow(s.length - M), I = u, R.c = a(
1676
+ de(Y(F.c), F.e, "0"),
1677
+ 10,
1678
+ o,
1679
+ t
1680
+ ), R.e = R.c.length), S = a(s, l, o, y ? (r = ee, t) : (r = t, ee)), f = u = S.length; S[--u] == 0; S.pop()) ;
1681
+ if (!S[0]) return r.charAt(0);
1682
+ if (M < 0 ? --f : (F.c = S, F.e = f, F.s = p, F = n(F, R, V, O, o), S = F.c, A = F.r, f = F.e), c = f + V + 1, M = S[c], u = o / 2, A = A || c < 0 || S[c + 1] != null, A = O < 4 ? (M != null || A) && (O == 0 || O == (F.s < 0 ? 3 : 2)) : M > u || M == u && (O == 4 || A || O == 6 && S[c - 1] & 1 || O == (F.s < 0 ? 8 : 7)), c < 1 || !S[0])
1683
+ s = A ? de(r.charAt(1), -V, r.charAt(0)) : r.charAt(0);
1684
+ else {
1685
+ if (S.length = c, A)
1686
+ for (--o; ++S[--c] > o; )
1687
+ S[c] = 0, c || (++f, S = [1].concat(S));
1688
+ for (u = S.length; !S[--u]; ) ;
1689
+ for (M = 0, s = ""; M <= u; s += r.charAt(S[M++])) ;
1690
+ s = de(s, f, r.charAt(0));
1691
+ }
1692
+ return s;
1693
+ };
1694
+ })(), n = /* @__PURE__ */ (function() {
1695
+ function t(l, o, p) {
1696
+ var y, r, c, f, u = 0, A = l.length, F = o % ue, S = o / ue | 0;
1697
+ for (l = l.slice(); A--; )
1698
+ c = l[A] % ue, f = l[A] / ue | 0, y = S * c + f * F, r = F * c + y % ue * ue + u, u = (r / p | 0) + (y / ue | 0) + S * f, l[A] = r % p;
1699
+ return u && (l = [u].concat(l)), l;
1700
+ }
1701
+ function a(l, o, p, y) {
1702
+ var r, c;
1703
+ if (p != y)
1704
+ c = p > y ? 1 : -1;
1705
+ else
1706
+ for (r = c = 0; r < p; r++)
1707
+ if (l[r] != o[r]) {
1708
+ c = l[r] > o[r] ? 1 : -1;
1709
+ break;
1710
+ }
1711
+ return c;
1712
+ }
1713
+ function s(l, o, p, y) {
1714
+ for (var r = 0; p--; )
1715
+ l[p] -= r, r = l[p] < o[p] ? 1 : 0, l[p] = r * y + l[p] - o[p];
1716
+ for (; !l[0] && l.length > 1; l.splice(0, 1)) ;
1717
+ }
1718
+ return function(l, o, p, y, r) {
1719
+ var c, f, u, A, F, S, R, M, V, O, P, $, we, Be, _e, se, Ee, Q = l.s == o.s ? 1 : -1, H = l.c, L = o.c;
1720
+ if (!H || !H[0] || !L || !L[0])
1721
+ return new b(
1722
+ // Return NaN if either NaN, or both Infinity or 0.
1723
+ !l.s || !o.s || (H ? L && H[0] == L[0] : !L) ? NaN : (
1724
+ // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.
1725
+ H && H[0] == 0 || !L ? Q * 0 : Q / 0
1726
+ )
1727
+ );
1728
+ for (M = new b(Q), V = M.c = [], f = l.e - o.e, Q = p + f + 1, r || (r = ne, f = J(l.e / B) - J(o.e / B), Q = Q / B | 0), u = 0; L[u] == (H[u] || 0); u++) ;
1729
+ if (L[u] > (H[u] || 0) && f--, Q < 0)
1730
+ V.push(1), A = !0;
1731
+ else {
1732
+ for (Be = H.length, se = L.length, u = 0, Q += 2, F = Z(r / (L[0] + 1)), F > 1 && (L = t(L, F, r), H = t(H, F, r), se = L.length, Be = H.length), we = se, O = H.slice(0, se), P = O.length; P < se; O[P++] = 0) ;
1733
+ Ee = L.slice(), Ee = [0].concat(Ee), _e = L[0], L[1] >= r / 2 && _e++;
1734
+ do {
1735
+ if (F = 0, c = a(L, O, se, P), c < 0) {
1736
+ if ($ = O[0], se != P && ($ = $ * r + (O[1] || 0)), F = Z($ / _e), F > 1)
1737
+ for (F >= r && (F = r - 1), S = t(L, F, r), R = S.length, P = O.length; a(S, O, R, P) == 1; )
1738
+ F--, s(S, se < R ? Ee : L, R, r), R = S.length, c = 1;
1739
+ else
1740
+ F == 0 && (c = F = 1), S = L.slice(), R = S.length;
1741
+ if (R < P && (S = [0].concat(S)), s(O, S, P, r), P = O.length, c == -1)
1742
+ for (; a(L, O, se, P) < 1; )
1743
+ F++, s(O, se < P ? Ee : L, P, r), P = O.length;
1744
+ } else c === 0 && (F++, O = [0]);
1745
+ V[u++] = F, O[0] ? O[P++] = H[we] || 0 : (O = [H[we]], P = 1);
1746
+ } while ((we++ < Be || O[0] != null) && Q--);
1747
+ A = O[0] != null, V[0] || V.splice(0, 1);
1748
+ }
1749
+ if (r == ne) {
1750
+ for (u = 1, Q = V[0]; Q >= 10; Q /= 10, u++) ;
1751
+ j(M, p + (M.e = u + f * B - 1) + 1, y, A);
1752
+ } else
1753
+ M.e = f, M.r = +A;
1754
+ return M;
1755
+ };
1756
+ })();
1757
+ function me(t, a, s, l) {
1758
+ var o, p, y, r, c;
1759
+ if (s == null ? s = x : N(s, 0, 8), !t.c) return t.toString();
1760
+ if (o = t.c[0], y = t.e, a == null)
1761
+ c = Y(t.c), c = l == 1 || l == 2 && (y <= w || y >= D) ? De(c, y) : de(c, y, "0");
1762
+ else if (t = j(new b(t), a, s), p = t.e, c = Y(t.c), r = c.length, l == 1 || l == 2 && (a <= p || p <= w)) {
1763
+ for (; r < a; c += "0", r++) ;
1764
+ c = De(c, p);
1765
+ } else if (a -= y + (l === 2 && p > y), c = de(c, p, "0"), p + 1 > r) {
1766
+ if (--a > 0) for (c += "."; a--; c += "0") ;
1767
+ } else if (a += p - r, a > 0)
1768
+ for (p + 1 == r && (c += "."); a--; c += "0") ;
1769
+ return t.s < 0 && o ? "-" + c : c;
1770
+ }
1771
+ function Ae(t, a) {
1772
+ for (var s, l, o = 1, p = new b(t[0]); o < t.length; o++)
1773
+ l = new b(t[o]), (!l.s || (s = ye(p, l)) === a || s === 0 && p.s === a) && (p = l);
1774
+ return p;
1775
+ }
1776
+ function be(t, a, s) {
1777
+ for (var l = 1, o = a.length; !a[--o]; a.pop()) ;
1778
+ for (o = a[0]; o >= 10; o /= 10, l++) ;
1779
+ return (s = l + s * B - 1) > T ? t.c = t.e = null : s < k ? t.c = [t.e = 0] : (t.e = s, t.c = a), t;
1780
+ }
1781
+ m = /* @__PURE__ */ (function() {
1782
+ var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, a = /^([^.]+)\.$/, s = /^\.([^.]+)$/, l = /^-?(Infinity|NaN)$/, o = /^\s*\+(?=[\w.])|^\s+|\s+$/g;
1783
+ return function(p, y, r, c) {
1784
+ var f, u = r ? y : y.replace(o, "");
1785
+ if (l.test(u))
1786
+ p.s = isNaN(u) ? null : u < 0 ? -1 : 1;
1787
+ else {
1788
+ if (!r && (u = u.replace(t, function(A, F, S) {
1789
+ return f = (S = S.toLowerCase()) == "x" ? 16 : S == "b" ? 2 : 8, !c || c == f ? F : A;
1790
+ }), c && (f = c, u = u.replace(a, "$1").replace(s, "0.$1")), y != u))
1791
+ return new b(u, f);
1792
+ if (b.DEBUG)
1793
+ throw Error(X + "Not a" + (c ? " base " + c : "") + " number: " + y);
1794
+ p.s = null;
1795
+ }
1796
+ p.c = p.e = null;
1797
+ };
1798
+ })();
1799
+ function j(t, a, s, l) {
1800
+ var o, p, y, r, c, f, u, A = t.c, F = Pe;
1801
+ if (A) {
1802
+ e: {
1803
+ for (o = 1, r = A[0]; r >= 10; r /= 10, o++) ;
1804
+ if (p = a - o, p < 0)
1805
+ p += B, y = a, c = A[f = 0], u = Z(c / F[o - y - 1] % 10);
1806
+ else if (f = Re((p + 1) / B), f >= A.length)
1807
+ if (l) {
1808
+ for (; A.length <= f; A.push(0)) ;
1809
+ c = u = 0, o = 1, p %= B, y = p - B + 1;
1810
+ } else
1811
+ break e;
1812
+ else {
1813
+ for (c = r = A[f], o = 1; r >= 10; r /= 10, o++) ;
1814
+ p %= B, y = p - B + o, u = y < 0 ? 0 : Z(c / F[o - y - 1] % 10);
1815
+ }
1816
+ if (l = l || a < 0 || // Are there any non-zero digits after the rounding digit?
1817
+ // The expression n % pows10[d - j - 1] returns all digits of n to the right
1818
+ // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.
1819
+ A[f + 1] != null || (y < 0 ? c : c % F[o - y - 1]), l = s < 4 ? (u || l) && (s == 0 || s == (t.s < 0 ? 3 : 2)) : u > 5 || u == 5 && (s == 4 || l || s == 6 && // Check whether the digit to the left of the rounding digit is odd.
1820
+ (p > 0 ? y > 0 ? c / F[o - y] : 0 : A[f - 1]) % 10 & 1 || s == (t.s < 0 ? 8 : 7)), a < 1 || !A[0])
1821
+ return A.length = 0, l ? (a -= t.e + 1, A[0] = F[(B - a % B) % B], t.e = -a || 0) : A[0] = t.e = 0, t;
1822
+ if (p == 0 ? (A.length = f, r = 1, f--) : (A.length = f + 1, r = F[B - p], A[f] = y > 0 ? Z(c / F[o - y] % F[y]) * r : 0), l)
1823
+ for (; ; )
1824
+ if (f == 0) {
1825
+ for (p = 1, y = A[0]; y >= 10; y /= 10, p++) ;
1826
+ for (y = A[0] += r, r = 1; y >= 10; y /= 10, r++) ;
1827
+ p != r && (t.e++, A[0] == ne && (A[0] = 1));
1828
+ break;
1829
+ } else {
1830
+ if (A[f] += r, A[f] != ne) break;
1831
+ A[f--] = 0, r = 1;
1832
+ }
1833
+ for (p = A.length; A[--p] === 0; A.pop()) ;
1834
+ }
1835
+ t.e > T ? t.c = t.e = null : t.e < k && (t.c = [t.e = 0]);
1836
+ }
1837
+ return t;
1838
+ }
1839
+ function oe(t) {
1840
+ var a, s = t.e;
1841
+ return s === null ? t.toString() : (a = Y(t.c), a = s <= w || s >= D ? De(a, s) : de(a, s, "0"), t.s < 0 ? "-" + a : a);
1842
+ }
1843
+ return d.absoluteValue = d.abs = function() {
1844
+ var t = new b(this);
1845
+ return t.s < 0 && (t.s = 1), t;
1846
+ }, d.comparedTo = function(t, a) {
1847
+ return ye(this, new b(t, a));
1848
+ }, d.decimalPlaces = d.dp = function(t, a) {
1849
+ var s, l, o, p = this;
1850
+ if (t != null)
1851
+ return N(t, 0, W), a == null ? a = x : N(a, 0, 8), j(new b(p), t + p.e + 1, a);
1852
+ if (!(s = p.c)) return null;
1853
+ if (l = ((o = s.length - 1) - J(this.e / B)) * B, o = s[o]) for (; o % 10 == 0; o /= 10, l--) ;
1854
+ return l < 0 && (l = 0), l;
1855
+ }, d.dividedBy = d.div = function(t, a) {
1856
+ return n(this, new b(t, a), E, x);
1857
+ }, d.dividedToIntegerBy = d.idiv = function(t, a) {
1858
+ return n(this, new b(t, a), 0, 1);
1859
+ }, d.exponentiatedBy = d.pow = function(t, a) {
1860
+ var s, l, o, p, y, r, c, f, u, A = this;
1861
+ if (t = new b(t), t.c && !t.isInteger())
1862
+ throw Error(X + "Exponent not an integer: " + oe(t));
1863
+ if (a != null && (a = new b(a)), r = t.e > 14, !A.c || !A.c[0] || A.c[0] == 1 && !A.e && A.c.length == 1 || !t.c || !t.c[0])
1864
+ return u = new b(Math.pow(+oe(A), r ? t.s * (2 - Fe(t)) : +oe(t))), a ? u.mod(a) : u;
1865
+ if (c = t.s < 0, a) {
1866
+ if (a.c ? !a.c[0] : !a.s) return new b(NaN);
1867
+ l = !c && A.isInteger() && a.isInteger(), l && (A = A.mod(a));
1868
+ } else {
1869
+ if (t.e > 9 && (A.e > 0 || A.e < -1 || (A.e == 0 ? A.c[0] > 1 || r && A.c[1] >= 24e7 : A.c[0] < 8e13 || r && A.c[0] <= 9999975e7)))
1870
+ return p = A.s < 0 && Fe(t) ? -0 : 0, A.e > -1 && (p = 1 / p), new b(c ? 1 / p : p);
1871
+ I && (p = Re(I / B + 2));
1872
+ }
1873
+ for (r ? (s = new b(0.5), c && (t.s = 1), f = Fe(t)) : (o = Math.abs(+oe(t)), f = o % 2), u = new b(h); ; ) {
1874
+ if (f) {
1875
+ if (u = u.times(A), !u.c) break;
1876
+ p ? u.c.length > p && (u.c.length = p) : l && (u = u.mod(a));
1877
+ }
1878
+ if (o) {
1879
+ if (o = Z(o / 2), o === 0) break;
1880
+ f = o % 2;
1881
+ } else if (t = t.times(s), j(t, t.e + 1, 1), t.e > 14)
1882
+ f = Fe(t);
1883
+ else {
1884
+ if (o = +oe(t), o === 0) break;
1885
+ f = o % 2;
1886
+ }
1887
+ A = A.times(A), p ? A.c && A.c.length > p && (A.c.length = p) : l && (A = A.mod(a));
1888
+ }
1889
+ return l ? u : (c && (u = h.div(u)), a ? u.mod(a) : p ? j(u, I, x, y) : u);
1890
+ }, d.integerValue = function(t) {
1891
+ var a = new b(this);
1892
+ return t == null ? t = x : N(t, 0, 8), j(a, a.e + 1, t);
1893
+ }, d.isEqualTo = d.eq = function(t, a) {
1894
+ return ye(this, new b(t, a)) === 0;
1895
+ }, d.isFinite = function() {
1896
+ return !!this.c;
1897
+ }, d.isGreaterThan = d.gt = function(t, a) {
1898
+ return ye(this, new b(t, a)) > 0;
1899
+ }, d.isGreaterThanOrEqualTo = d.gte = function(t, a) {
1900
+ return (a = ye(this, new b(t, a))) === 1 || a === 0;
1901
+ }, d.isInteger = function() {
1902
+ return !!this.c && J(this.e / B) > this.c.length - 2;
1903
+ }, d.isLessThan = d.lt = function(t, a) {
1904
+ return ye(this, new b(t, a)) < 0;
1905
+ }, d.isLessThanOrEqualTo = d.lte = function(t, a) {
1906
+ return (a = ye(this, new b(t, a))) === -1 || a === 0;
1907
+ }, d.isNaN = function() {
1908
+ return !this.s;
1909
+ }, d.isNegative = function() {
1910
+ return this.s < 0;
1911
+ }, d.isPositive = function() {
1912
+ return this.s > 0;
1913
+ }, d.isZero = function() {
1914
+ return !!this.c && this.c[0] == 0;
1915
+ }, d.minus = function(t, a) {
1916
+ var s, l, o, p, y = this, r = y.s;
1917
+ if (t = new b(t, a), a = t.s, !r || !a) return new b(NaN);
1918
+ if (r != a)
1919
+ return t.s = -a, y.plus(t);
1920
+ var c = y.e / B, f = t.e / B, u = y.c, A = t.c;
1921
+ if (!c || !f) {
1922
+ if (!u || !A) return u ? (t.s = -a, t) : new b(A ? y : NaN);
1923
+ if (!u[0] || !A[0])
1924
+ return A[0] ? (t.s = -a, t) : new b(u[0] ? y : (
1925
+ // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity
1926
+ x == 3 ? -0 : 0
1927
+ ));
1928
+ }
1929
+ if (c = J(c), f = J(f), u = u.slice(), r = c - f) {
1930
+ for ((p = r < 0) ? (r = -r, o = u) : (f = c, o = A), o.reverse(), a = r; a--; o.push(0)) ;
1931
+ o.reverse();
1932
+ } else
1933
+ for (l = (p = (r = u.length) < (a = A.length)) ? r : a, r = a = 0; a < l; a++)
1934
+ if (u[a] != A[a]) {
1935
+ p = u[a] < A[a];
1936
+ break;
1937
+ }
1938
+ if (p && (o = u, u = A, A = o, t.s = -t.s), a = (l = A.length) - (s = u.length), a > 0) for (; a--; u[s++] = 0) ;
1939
+ for (a = ne - 1; l > r; ) {
1940
+ if (u[--l] < A[l]) {
1941
+ for (s = l; s && !u[--s]; u[s] = a) ;
1942
+ --u[s], u[l] += ne;
1943
+ }
1944
+ u[l] -= A[l];
1945
+ }
1946
+ for (; u[0] == 0; u.splice(0, 1), --f) ;
1947
+ return u[0] ? be(t, u, f) : (t.s = x == 3 ? -1 : 1, t.c = [t.e = 0], t);
1948
+ }, d.modulo = d.mod = function(t, a) {
1949
+ var s, l, o = this;
1950
+ return t = new b(t, a), !o.c || !t.s || t.c && !t.c[0] ? new b(NaN) : !t.c || o.c && !o.c[0] ? new b(o) : (v == 9 ? (l = t.s, t.s = 1, s = n(o, t, 0, 3), t.s = l, s.s *= l) : s = n(o, t, 0, v), t = o.minus(s.times(t)), !t.c[0] && v == 1 && (t.s = o.s), t);
1951
+ }, d.multipliedBy = d.times = function(t, a) {
1952
+ var s, l, o, p, y, r, c, f, u, A, F, S, R, M, V, O = this, P = O.c, $ = (t = new b(t, a)).c;
1953
+ if (!P || !$ || !P[0] || !$[0])
1954
+ return !O.s || !t.s || P && !P[0] && !$ || $ && !$[0] && !P ? t.c = t.e = t.s = null : (t.s *= O.s, !P || !$ ? t.c = t.e = null : (t.c = [0], t.e = 0)), t;
1955
+ for (l = J(O.e / B) + J(t.e / B), t.s *= O.s, c = P.length, A = $.length, c < A && (R = P, P = $, $ = R, o = c, c = A, A = o), o = c + A, R = []; o--; R.push(0)) ;
1956
+ for (M = ne, V = ue, o = A; --o >= 0; ) {
1957
+ for (s = 0, F = $[o] % V, S = $[o] / V | 0, y = c, p = o + y; p > o; )
1958
+ f = P[--y] % V, u = P[y] / V | 0, r = S * f + u * F, f = F * f + r % V * V + R[p] + s, s = (f / M | 0) + (r / V | 0) + S * u, R[p--] = f % M;
1959
+ R[p] = s;
1960
+ }
1961
+ return s ? ++l : R.splice(0, 1), be(t, R, l);
1962
+ }, d.negated = function() {
1963
+ var t = new b(this);
1964
+ return t.s = -t.s || null, t;
1965
+ }, d.plus = function(t, a) {
1966
+ var s, l = this, o = l.s;
1967
+ if (t = new b(t, a), a = t.s, !o || !a) return new b(NaN);
1968
+ if (o != a)
1969
+ return t.s = -a, l.minus(t);
1970
+ var p = l.e / B, y = t.e / B, r = l.c, c = t.c;
1971
+ if (!p || !y) {
1972
+ if (!r || !c) return new b(o / 0);
1973
+ if (!r[0] || !c[0]) return c[0] ? t : new b(r[0] ? l : o * 0);
1974
+ }
1975
+ if (p = J(p), y = J(y), r = r.slice(), o = p - y) {
1976
+ for (o > 0 ? (y = p, s = c) : (o = -o, s = r), s.reverse(); o--; s.push(0)) ;
1977
+ s.reverse();
1978
+ }
1979
+ for (o = r.length, a = c.length, o - a < 0 && (s = c, c = r, r = s, a = o), o = 0; a; )
1980
+ o = (r[--a] = r[a] + c[a] + o) / ne | 0, r[a] = ne === r[a] ? 0 : r[a] % ne;
1981
+ return o && (r = [o].concat(r), ++y), be(t, r, y);
1982
+ }, d.precision = d.sd = function(t, a) {
1983
+ var s, l, o, p = this;
1984
+ if (t != null && t !== !!t)
1985
+ return N(t, 1, W), a == null ? a = x : N(a, 0, 8), j(new b(p), t, a);
1986
+ if (!(s = p.c)) return null;
1987
+ if (o = s.length - 1, l = o * B + 1, o = s[o]) {
1988
+ for (; o % 10 == 0; o /= 10, l--) ;
1989
+ for (o = s[0]; o >= 10; o /= 10, l++) ;
1990
+ }
1991
+ return t && p.e + 1 > l && (l = p.e + 1), l;
1992
+ }, d.shiftedBy = function(t) {
1993
+ return N(t, -ve, ve), this.times("1e" + t);
1994
+ }, d.squareRoot = d.sqrt = function() {
1995
+ var t, a, s, l, o, p = this, y = p.c, r = p.s, c = p.e, f = E + 4, u = new b("0.5");
1996
+ if (r !== 1 || !y || !y[0])
1997
+ return new b(!r || r < 0 && (!y || y[0]) ? NaN : y ? p : 1 / 0);
1998
+ if (r = Math.sqrt(+oe(p)), r == 0 || r == 1 / 0 ? (a = Y(y), (a.length + c) % 2 == 0 && (a += "0"), r = Math.sqrt(+a), c = J((c + 1) / 2) - (c < 0 || c % 2), r == 1 / 0 ? a = "5e" + c : (a = r.toExponential(), a = a.slice(0, a.indexOf("e") + 1) + c), s = new b(a)) : s = new b(r + ""), s.c[0]) {
1999
+ for (c = s.e, r = c + f, r < 3 && (r = 0); ; )
2000
+ if (o = s, s = u.times(o.plus(n(p, o, f, 1))), Y(o.c).slice(0, r) === (a = Y(s.c)).slice(0, r))
2001
+ if (s.e < c && --r, a = a.slice(r - 3, r + 1), a == "9999" || !l && a == "4999") {
2002
+ if (!l && (j(o, o.e + E + 2, 0), o.times(o).eq(p))) {
2003
+ s = o;
2004
+ break;
2005
+ }
2006
+ f += 4, r += 4, l = 1;
2007
+ } else {
2008
+ (!+a || !+a.slice(1) && a.charAt(0) == "5") && (j(s, s.e + E + 2, 1), t = !s.times(s).eq(p));
2009
+ break;
2010
+ }
2011
+ }
2012
+ return j(s, s.e + E + 1, x, t);
2013
+ }, d.toExponential = function(t, a) {
2014
+ return t != null && (N(t, 0, W), t++), me(this, t, a, 1);
2015
+ }, d.toFixed = function(t, a) {
2016
+ return t != null && (N(t, 0, W), t = t + this.e + 1), me(this, t, a);
2017
+ }, d.toFormat = function(t, a, s) {
2018
+ var l, o = this;
2019
+ if (s == null)
2020
+ t != null && a && typeof a == "object" ? (s = a, a = null) : t && typeof t == "object" ? (s = t, t = a = null) : s = ie;
2021
+ else if (typeof s != "object")
2022
+ throw Error(X + "Argument not an object: " + s);
2023
+ if (l = o.toFixed(t, a), o.c) {
2024
+ var p, y = l.split("."), r = +s.groupSize, c = +s.secondaryGroupSize, f = s.groupSeparator || "", u = y[0], A = y[1], F = o.s < 0, S = F ? u.slice(1) : u, R = S.length;
2025
+ if (c && (p = r, r = c, c = p, R -= p), r > 0 && R > 0) {
2026
+ for (p = R % r || r, u = S.substr(0, p); p < R; p += r) u += f + S.substr(p, r);
2027
+ c > 0 && (u += f + S.slice(p)), F && (u = "-" + u);
2028
+ }
2029
+ l = A ? u + (s.decimalSeparator || "") + ((c = +s.fractionGroupSize) ? A.replace(
2030
+ new RegExp("\\d{" + c + "}\\B", "g"),
2031
+ "$&" + (s.fractionGroupSeparator || "")
2032
+ ) : A) : u;
2033
+ }
2034
+ return (s.prefix || "") + l + (s.suffix || "");
2035
+ }, d.toFraction = function(t) {
2036
+ var a, s, l, o, p, y, r, c, f, u, A, F, S = this, R = S.c;
2037
+ if (t != null && (r = new b(t), !r.isInteger() && (r.c || r.s !== 1) || r.lt(h)))
2038
+ throw Error(X + "Argument " + (r.isInteger() ? "out of range: " : "not an integer: ") + oe(r));
2039
+ if (!R) return new b(S);
2040
+ for (a = new b(h), f = s = new b(h), l = c = new b(h), F = Y(R), p = a.e = F.length - S.e - 1, a.c[0] = Pe[(y = p % B) < 0 ? B + y : y], t = !t || r.comparedTo(a) > 0 ? p > 0 ? a : f : r, y = T, T = 1 / 0, r = new b(F), c.c[0] = 0; u = n(r, a, 0, 1), o = s.plus(u.times(l)), o.comparedTo(t) != 1; )
2041
+ s = l, l = o, f = c.plus(u.times(o = f)), c = o, a = r.minus(u.times(o = a)), r = o;
2042
+ return o = n(t.minus(s), l, 0, 1), c = c.plus(o.times(f)), s = s.plus(o.times(l)), c.s = f.s = S.s, p = p * 2, A = n(f, l, p, x).minus(S).abs().comparedTo(
2043
+ n(c, s, p, x).minus(S).abs()
2044
+ ) < 1 ? [f, l] : [c, s], T = y, A;
2045
+ }, d.toNumber = function() {
2046
+ return +oe(this);
2047
+ }, d.toPrecision = function(t, a) {
2048
+ return t != null && N(t, 1, W), me(this, t, a, 2);
2049
+ }, d.toString = function(t) {
2050
+ var a, s = this, l = s.s, o = s.e;
2051
+ return o === null ? l ? (a = "Infinity", l < 0 && (a = "-" + a)) : a = "NaN" : (t == null ? a = o <= w || o >= D ? De(Y(s.c), o) : de(Y(s.c), o, "0") : t === 10 && fe ? (s = j(new b(s), E + o + 1, x), a = de(Y(s.c), s.e, "0")) : (N(t, 2, ee.length, "Base"), a = i(de(Y(s.c), o, "0"), 10, t, l, !0)), l < 0 && s.c[0] && (a = "-" + a)), a;
2052
+ }, d.valueOf = d.toJSON = function() {
2053
+ return oe(this);
2054
+ }, d._isBigNumber = !0, d[Symbol.toStringTag] = "BigNumber", d[Symbol.for("nodejs.util.inspect.custom")] = d.valueOf, e != null && b.set(e), b;
2055
+ }
2056
+ function J(e) {
2057
+ var n = e | 0;
2058
+ return e > 0 || e === n ? n : n - 1;
2059
+ }
2060
+ function Y(e) {
2061
+ for (var n, i, m = 1, d = e.length, h = e[0] + ""; m < d; ) {
2062
+ for (n = e[m++] + "", i = B - n.length; i--; n = "0" + n) ;
2063
+ h += n;
2064
+ }
2065
+ for (d = h.length; h.charCodeAt(--d) === 48; ) ;
2066
+ return h.slice(0, d + 1 || 1);
2067
+ }
2068
+ function ye(e, n) {
2069
+ var i, m, d = e.c, h = n.c, E = e.s, x = n.s, w = e.e, D = n.e;
2070
+ if (!E || !x) return null;
2071
+ if (i = d && !d[0], m = h && !h[0], i || m) return i ? m ? 0 : -x : E;
2072
+ if (E != x) return E;
2073
+ if (i = E < 0, m = w == D, !d || !h) return m ? 0 : !d ^ i ? 1 : -1;
2074
+ if (!m) return w > D ^ i ? 1 : -1;
2075
+ for (x = (w = d.length) < (D = h.length) ? w : D, E = 0; E < x; E++) if (d[E] != h[E]) return d[E] > h[E] ^ i ? 1 : -1;
2076
+ return w == D ? 0 : w > D ^ i ? 1 : -1;
2077
+ }
2078
+ function N(e, n, i, m) {
2079
+ if (e < n || e > i || e !== Z(e))
2080
+ throw Error(X + (m || "Argument") + (typeof e == "number" ? e < n || e > i ? " out of range: " : " not an integer: " : " not a primitive number: ") + String(e));
2081
+ }
2082
+ function Fe(e) {
2083
+ var n = e.c.length - 1;
2084
+ return J(e.e / B) == n && e.c[n] % 2 != 0;
2085
+ }
2086
+ function De(e, n) {
2087
+ return (e.length > 1 ? e.charAt(0) + "." + e.slice(1) : e) + (n < 0 ? "e" : "e+") + n;
2088
+ }
2089
+ function de(e, n, i) {
2090
+ var m, d;
2091
+ if (n < 0) {
2092
+ for (d = i + "."; ++n; d += i) ;
2093
+ e = d + e;
2094
+ } else if (m = e.length, ++n > m) {
2095
+ for (d = i, n -= m; --n; d += i) ;
2096
+ e += d;
2097
+ } else n < m && (e = e.slice(0, n) + "." + e.slice(n));
2098
+ return e;
2099
+ }
2100
+ var g = Ze();
2101
+ function nn(e) {
2102
+ throw new Error('Could not dynamically require "' + e + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
2103
+ }
2104
+ const an = {
2105
+ 1: { dex: { agent: { type: "default:odos-v2", router: "0xCf5540fFFCdC3d510B18bFcA6d2b9987b0772559", adapter: "0xC1bB4d5071Fe7109ae2D67AE05826A3fe9116cfc", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, sushiswap: { type: "default:sushi", router: "0xAC4c6e212A361c968F1725b4d055b47E63F80b75", adapter: "0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5", fee: "0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc" } } },
2106
+ 14: { dex: { spark: { type: "default:spark", adapter: "0xB18c633B6584A33E45a8840a759f56dF17117b1D", fee: "0xaeA8C3e1a129A77686E115b1a46D9aD8405F7D2b" } } },
2107
+ 56: { dex: { agent: { type: "default:odos-v2", router: "0x89b8AA89FDd0507a99d334CBe3C808fAFC7d850E", adapter: "0x67Feba015c968c76cCB2EEabf197b4578640BE2C", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, thena: { type: "default:odos-v2", adapter: "0xB75218ba5A99bF57Fd02556B70F05A4A0f1Dbe67", fee: "0x15eBc8b5b3877512FFF23650188694A9a8891FAc" }, pancake: { type: "p2:pancakeswap-v2", adapter: "0x654272F7e6e6E912D38650f783eFd44452fD6ee5", fee: "0x37A957f10F458e0d7fDECBE2917971b57F15c927" }, newera: { type: "default:odos-v2", adapter: "0x845f459271D800f6Ab32D78400b8Aa18414E80b0", fee: "0x4E7454909eB6D539111D56b50d68897E933D2d11" } } },
2108
+ 137: { dex: { agent: { type: "default:odos-v2", router: "0x4E3288c9ca110bCC82bf38F09A7b425c095d92Bf", adapter: "0x75A3d70Fa6d054d31C896b9Cf8AB06b1c1B829B8", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, quick: { type: "paraswap:paraswap-v5", adapter: "0x023fD6848234f2655818705237F77F02215FEfe5", fee: "0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f" }, teafi: { type: "paraswap:paraswap-v5", adapter: "0xe95db7a60164B112C64cE67bA8587b1d4a0E0D29", fee: "0x04Ff96e2c4D62b5771795d307AD679a25b3D2D50" } } },
2109
+ 143: { dex: { yowie: { type: "default:openocean-v2", adapter: "0x18bc9533c3539073B9A9acF12b0AbF7cB73e0F1f", fee: "0x6AF3eE77A3A3257777F5649aFa611b4C7Fd975Ef" }, pangolin: { type: "default:kyber-v2", adapter: "0xd7D9CAA2910f49F37AC3447f5cAd27153944354A", fee: "0xde92da99D188Ceb54A11ec711EF52D808A6260B5" } } },
2110
+ 146: { dex: { agent: { type: "default:odos-v2", router: "0xaC041Df48dF9791B0654f1Dbbf2CC8450C5f2e9D", adapter: "0x58fD209C81D84739BaD9c72C082350d67E713EEa", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, spooky: { type: "default:magpie-v3", adapter: "0xdCee7FDdB932104329d528144Cd17A408722B7e2", fee: "0x840Df4684B35BC68BcdA3F6707A3c82A0D662f8b" }, swapx: { type: "default:openocean-v2", adapter: "0xecc733D6F6f2DEa341832D650E30822118884FEb", fee: "0x6E03f7BC0f141894612AA017796096399623895F" }, shadow: { type: "default:magpie-v3", adapter: "0x5f3E5F6ACCfc65243A01Da3E93b5A700285592C3", fee: "0xb9e3751fAF3187E1bC468E56a707a8A91754460e" } } },
2111
+ 1329: { dex: { dragon: { type: "default:dragon", adapter: "0x02d9d5882129241b67ec21Ebc2C86e1BE9BC9890", fee: "0x0dc1E0525202b32e89bA78ed55b1e5cEdB751334" }, nami: { type: "default:openocean-v2", adapter: "0x2D4A1237A98f8cb03C3C85960e859aA44036a306", fee: "0xeB58450e23632003f013568703F54446070E2E80" } } },
2112
+ 8453: { dex: { agent: { type: "default:odos-v2", router: "0x19cEeAd7105607Cd444F5ad10dd51356436095a1", adapter: "0x5906C4dD71D5afFe1a8f0215409E912eB5d593AD", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, quick: { type: "default:kyber-v2", adapter: "0xc73F03c929A123Ee2f3A98EC18BB240f03980AE5", fee: "0xd207DC6a6dA88f27c8DB78201F974161b1d84b1f" }, sushiswap: { type: "default:sushi", router: "0xAC4c6e212A361c968F1725b4d055b47E63F80b75", adapter: "0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5", fee: "0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc" } } },
2113
+ 42161: { dex: { agent: { type: "default:odos-v2", router: "0xa669e7A0d4b3e4Fa48af2dE86BD4CD7126Be4e13", adapter: "0x026B8977319F67078e932a08feAcB59182B5380f", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, arbidex: { type: "default:odos-v2", adapter: "0xa734b32151108139e48dCA06eE721538d90A9Ef6", fee: "0xa0c11852f8A44e32F9EC10AD25986A53842f72Ca" }, ramses: { type: "paraswap:paraswap-v5", adapter: "0x023fD6848234f2655818705237F77F02215FEfe5", fee: "0xB5BaCB60ECDa0bEF809B2A26eC9B4B926835D7af" }, omni: { type: "paraswap:paraswap-v5", adapter: "0xa1baE146161223cd9dCa7137F68eb385934130BE", fee: "0xba5291526c30B097E9F1Fd1Be301E2ab6E0782aa" }, chronos: { type: "default:odos-v2", adapter: "0x4Ff90F32aceD08b3e3257B018EA495Fd1Bfe4455", fee: "0x5729af83240EFecAa18eafaAE82961c2DD045Dbe" }, sushiswap: { type: "default:sushi", router: "0xAC4c6e212A361c968F1725b4d055b47E63F80b75", adapter: "0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5", fee: "0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc" } } },
2114
+ 43114: { dex: { agent: { type: "default:odos-v2", router: "0x88de50B233052e4Fb783d4F6db78Cc34fEa3e9FC", adapter: "0x4F48041842827823D3750399eCa2832fC2E29201", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, blackhole: { type: "default:kyber-v2", adapter: "0x426ec4bc0d58B80959CDE77576a1942dd40592Fa", fee: "0x7f8B62520D9B5DA0ED517cc36e8dcb2a356f1928" }, pangolin: { type: "default:kyber-v2", adapter: "0xd7D9CAA2910f49F37AC3447f5cAd27153944354A", fee: "0xde92da99D188Ceb54A11ec711EF52D808A6260B5" } } },
2115
+ 59144: { dex: { agent: { type: "default:odos-v2", router: "0x2d8879046f1559E53eb052E949e9544bCB72f414", adapter: "0x55E4da2cd634729064bEb294EC682Dc94f5c3f24", fee: "0x03A70aC8126340d3cd6b5828816172693C398661" }, lynex: { type: "default:openocean", adapter: "0x4FF6A97A67fe395212f168f011D71fE79E4396f2", fee: "0xcb36ed1B1BfAD8F7FC9651f52d21f04A68677423" } } },
2116
+ 80094: { dex: { kodiak: { type: "default:kodiak", adapter: "0xBbaa527Aac00b1Ee9A3909D4D8c4447630E29B1F", fee: "0xBA47Ec15aFbCF6e7e9F52900632049530bB6bAe4" } } },
2117
+ 747474: { dex: { sushiswap: { type: "default:sushi", router: "0xAC4c6e212A361c968F1725b4d055b47E63F80b75", adapter: "0x3Ee50D79e6D0205f325928AAFb041b63E1767Bc5", fee: "0x28F6C9dBE21fFc146Af8d5D15c49Cf48F61140Dc" } } },
2118
+ "*": { 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" } }
2119
+ };
2120
+ var Ie, Xe;
2121
+ function sn() {
2122
+ if (Xe) return Ie;
2123
+ Xe = 1;
2124
+ const e = an, n = (d) => nn(`./out/${d}.sol/${d}.json`).abi, i = () => ({
2125
+ wm: n("WM"),
2126
+ repermit: n("RePermit"),
2127
+ reactor: n("OrderReactor"),
2128
+ executor: n("Executor"),
2129
+ refinery: n("Refinery"),
2130
+ settler: n("Settler"),
2131
+ adapter: n("DefaultDexAdapter")
2132
+ });
2133
+ function m(d, h) {
2134
+ if (!d) return;
2135
+ const { dex: E, ...x } = e["*"] ?? {}, w = e[d];
2136
+ if (!w) return;
2137
+ const { dex: D, ...k } = w;
2138
+ if (!(h != null && h.trim()))
2139
+ return { ...x, ...k };
2140
+ const T = D == null ? void 0 : D[h];
2141
+ if (T)
2142
+ return { ...x, ...k, ...T };
2143
+ }
2144
+ return Ie = { config: m, abis: i, raw: e }, Ie;
2145
+ }
2146
+ var Je = sn();
2147
+ const he = (e, n) => {
2148
+ if (!e || !n) return "";
2149
+ const i = g(10).pow(e || 0);
2150
+ return g(n).times(i).idiv(i).div(i).toFixed();
2151
+ };
2152
+ g(0);
2153
+ g(1);
2154
+ g(10);
2155
+ g(1e18);
2156
+ function Se(e, n) {
2157
+ return e == n || e.toLowerCase() == n.toLowerCase();
2158
+ }
2159
+ const ra = (e) => !!Yt.find((n) => Se(n, e || ""));
2160
+ function rn(e) {
2161
+ return [
2162
+ ae.Years,
2163
+ ae.Months,
2164
+ ae.Weeks,
2165
+ ae.Days,
2166
+ ae.Hours,
2167
+ ae.Minutes
2168
+ ].find((i) => i <= e) || ae.Minutes;
2169
+ }
2170
+ const le = (e) => e ? e.value * e.unit : 0, on = (e) => !e || e === "NaN" ? "0" : g(e).decimalPlaces(0).toFixed(), ia = (e) => Object.values(K).find((n) => n.id === e), dn = (e) => {
2171
+ if (!e) return;
2172
+ const n = e.map((h) => G(h)), i = Object.entries(Zt).filter(([h]) => n.includes(h)).flatMap(([, h]) => h), m = e.map((h) => h.exchangeAddress), d = new Set(
2173
+ [...m, ...i].map((h) => h.toLowerCase())
2174
+ );
2175
+ return Array.from(d);
2176
+ }, oa = (e, n) => e.version === 1 ? (e.fillDelay || 0) * 1e3 + cn(n) : (e.fillDelay || 0) * 1e3, ke = (e) => typeof window > "u" ? null : new URLSearchParams(window.location.search).get(e), da = (e) => ln().filter((n) => n.name === e).map((n) => n.chainId), ca = (e = "", n = "", i = 18, m = 18) => {
2177
+ if (!g(e || 0).gt(0) || !g(n || 0).gt(0))
2178
+ return "";
2179
+ const d = he(i, e), h = he(m, n);
2180
+ return g(h).div(d).toFixed();
2181
+ }, pa = (e, n, i) => {
2182
+ if (e.type === q.TWAP_MARKET) return "";
2183
+ const m = he(n, e.srcAmountPerTrade), d = he(i, e.dstMinAmountPerTrade);
2184
+ return g(d).div(m).toFixed();
2185
+ }, ua = (e, n, i) => {
2186
+ if (e.type === q.TWAP_MARKET) return "";
2187
+ const m = he(n, e.srcAmountPerTrade), d = he(i, e.triggerPricePerTrade);
2188
+ return g(d).div(m).toFixed();
2189
+ }, la = (e, n, i) => {
2190
+ if (!e || !n || !i) return;
2191
+ const m = g(e).times(n), d = g(10).pow(i);
2192
+ return m.div(d).toFixed(0);
2193
+ }, fa = (e, n, i, m) => {
2194
+ if (i || !m || !e || !n)
2195
+ return g(0).toString();
2196
+ const d = g(e).times(g(n)), h = g(10).pow(m), E = d.div(h);
2197
+ return g.max(1, E).integerValue(g.ROUND_FLOOR).toFixed(0);
2198
+ }, ma = (e, n, i, m) => {
2199
+ if (e === z.TWAP || e === z.LIMIT)
2200
+ return "0";
2201
+ if (!m || !n || !i) return;
2202
+ const d = g(n).times(g(i)), h = g(10).pow(m), E = d.div(h);
2203
+ return g.max(1, E).integerValue(g.ROUND_FLOOR).toFixed(0) || "0";
2204
+ }, ya = (e, n, i, m) => {
2205
+ const d = le(i) * 2 * n, h = ke(Te.DURATION), E = rn(h ? Number(h) : d);
2206
+ return h ? { unit: E, value: Number(g(Number(h) / E).toFixed(2)) } : m || (e === z.LIMIT ? { unit: ae.Days, value: 7 } : e === z.STOP_LOSS || e === z.TAKE_PROFIT ? { unit: ae.Days, value: 1 } : { unit: E, value: Number(g(d / E).toFixed(2)) });
2207
+ }, ha = (e, n, i) => n !== z.TWAP ? 1 : i !== void 0 ? i : e, Aa = (e, n, i, m) => {
2208
+ if (!n || !i || !m) return 1;
2209
+ const h = g(i).times(n).div(m).integerValue(g.ROUND_FLOOR).toNumber(), E = Math.floor(
2210
+ ge / 2 / le(e)
2211
+ );
2212
+ return Math.max(1, Math.min(h, E));
2213
+ }, ba = (e, n) => e + le(n) + 6e4, cn = (e) => e.bidDelaySeconds * 1e3 * 2, Ea = (e = "", n = 0) => !e || !n ? "0" : g(e).div(n).integerValue(g.ROUND_FLOOR).toFixed(0), ga = (e, n) => ({
2214
+ isError: !(e.unit === Ge.unit && e.value === Ge.value) && le(e) * n > ge,
2215
+ value: Math.floor(ge / n)
2216
+ }), xa = (e = "", n = "", i) => {
2217
+ if (i === z.STOP_LOSS)
2218
+ return {
2219
+ isError: g(n || 0).gte(g(e || 0)),
2220
+ value: e
2221
+ };
2222
+ }, Ta = (e = "", n = "", i) => {
2223
+ if (i === z.TAKE_PROFIT)
2224
+ return {
2225
+ isError: g(n || 0).lte(g(e || 0)),
2226
+ value: e
2227
+ };
2228
+ }, wa = (e = "", n = "", i = !1, m) => {
2229
+ if (!i && m === z.STOP_LOSS)
2230
+ return {
2231
+ isError: g(n || 0).gte(g(e || 0)),
2232
+ value: e
2233
+ };
2234
+ }, Ca = (e = "", n = "", i = !1, m) => {
2235
+ if (!i && m === z.TAKE_PROFIT)
2236
+ return {
2237
+ isError: g(n || 0).gte(g(e || 0)),
2238
+ value: e
2239
+ };
2240
+ }, Fa = (e, n) => e === z.STOP_LOSS || e === z.TAKE_PROFIT ? {
2241
+ isError: le(n) > 5184e6,
2242
+ value: 5184e6
2243
+ } : {
2244
+ isError: le(n) > ge,
2245
+ // 365 days
2246
+ value: ge
2247
+ }, Da = (e) => ({
2248
+ isError: le(e) < Ke,
2249
+ value: Ke
2250
+ }), Sa = (e) => ({
2251
+ isError: le(e) < Ue,
2252
+ value: Ue
2253
+ }), ka = (e, n, i) => ({
2254
+ isError: g(n || 0).multipliedBy(e || 0).isLessThan(i),
2255
+ value: i
2256
+ }), Ba = (e, n, i) => ({
2257
+ isError: i === z.TWAP && g(e).isGreaterThan(n),
2258
+ value: n
2259
+ }), pn = (e, n) => {
2260
+ if (e === pe.Pancake)
2261
+ switch (n) {
2262
+ case 56:
2263
+ return _.PancakeSwap;
2264
+ case 42161:
2265
+ return _.PancakeSwapArbitrum;
2266
+ case 8453:
2267
+ return _.PancakeSwapBase;
2268
+ case 59144:
2269
+ return _.PancakeSwapLinea;
2270
+ default:
2271
+ return _.PancakeSwap;
2272
+ }
2273
+ if (e === pe.Sushiswap)
2274
+ switch (n) {
2275
+ case 1:
2276
+ return _.SushiEth;
2277
+ case 42161:
2278
+ return _.SushiArb;
2279
+ case 137:
2280
+ return _.SushiBase;
2281
+ case 747474:
2282
+ return _.SushiKatana;
2283
+ default:
2284
+ return _.SushiEth;
2285
+ }
2286
+ if (e === pe.Quick)
2287
+ switch (n) {
2288
+ case 137:
2289
+ return _.QuickSwap;
2290
+ case 8453:
2291
+ return _.QuickSwapBase;
2292
+ default:
2293
+ return _.QuickSwap;
2294
+ }
2295
+ if (e === pe.Thena)
2296
+ switch (n) {
2297
+ case 56:
2298
+ return _.Thena;
2299
+ default:
2300
+ return _.Thena;
2301
+ }
2302
+ if (e === pe.Spooky)
2303
+ switch (n) {
2304
+ case 250:
2305
+ return _.SpookySwap;
2306
+ case 146:
2307
+ return _.SpookySwapSonic;
2308
+ default:
2309
+ return _.SpookySwap;
2310
+ }
2311
+ if (e === pe.Lynex)
2312
+ switch (n) {
2313
+ case 59144:
2314
+ return _.Lynex;
2315
+ default:
2316
+ return _.Lynex;
2317
+ }
2318
+ if (e === pe.Swapx)
2319
+ switch (n) {
2320
+ case 146:
2321
+ return _.SwapX;
2322
+ default:
2323
+ return _.SwapX;
2324
+ }
2325
+ if (e === pe.Blackhole)
2326
+ switch (n) {
2327
+ case 43114:
2328
+ return _.BlackholeAvax;
2329
+ default:
2330
+ return _.BlackholeAvax;
2331
+ }
2332
+ }, un = (e, n = 0) => {
2333
+ const { abi: i, ...m } = Je.config(n, e);
2334
+ return {
2335
+ ...m,
2336
+ partner: e,
2337
+ twapConfig: pn(e, n)
2338
+ };
2339
+ }, ln = () => {
2340
+ const e = Je.raw;
2341
+ return Object.entries(e).filter(([n]) => n !== "*").flatMap(([n, i]) => {
2342
+ const m = i == null ? void 0 : i.dex;
2343
+ return !m || typeof m != "object" ? [] : Object.entries(m).map(([d]) => ({
2344
+ chainId: Number(n),
2345
+ name: d,
2346
+ config: un(d, Number(n))
2347
+ }));
2348
+ }).sort((n, i) => n.name.localeCompare(i.name));
2349
+ }, _a = (e) => {
2350
+ const n = ke(
2351
+ Te.MIN_CHUNK_SIZE_USD
2352
+ );
2353
+ return n ? parseInt(n) : e;
2354
+ }, Oa = ({
2355
+ marketPrice: e,
2356
+ typedInputAmount: n,
2357
+ srcUsd1Token: i,
2358
+ marketPriceLoading: m,
2359
+ triggerPriceError: d,
2360
+ limitPriceError: h,
2361
+ tradesError: E,
2362
+ fillDelayError: x,
2363
+ durationError: w,
2364
+ balanceError: D,
2365
+ minTradeSizeError: k
2366
+ }) => {
2367
+ if (!ke(Te.IGNORE_ERRORS) && !(g(e || 0).isZero() || g(n || 0).isZero() || g(i || "0").isZero() || m))
2368
+ return k || d || h || E || x || w || D;
2369
+ }, et = (e, n) => {
2370
+ const i = Date.now().toString(), m = parseInt((e / 1e3).toFixed(0)), d = on(n / 1e3), h = ke(Te.FRESHNESS), E = h ? parseInt(h) : 60;
2371
+ return {
2372
+ nonce: i,
2373
+ epoch: m,
2374
+ deadline: d,
2375
+ freshness: E
2376
+ };
2377
+ }, fn = ({
2378
+ chainId: e,
2379
+ srcToken: n,
2380
+ dstToken: i,
2381
+ srcAmount: m,
2382
+ deadlineMillis: d,
2383
+ fillDelayMillis: h,
2384
+ slippage: E,
2385
+ account: x,
2386
+ srcAmountPerTrade: w,
2387
+ dstMinAmountPerTrade: D = "0",
2388
+ triggerAmountPerTrade: k = "0",
2389
+ config: T,
2390
+ module: C
2391
+ }) => {
2392
+ const { nonce: v, epoch: I, deadline: ie, freshness: ee } = et(
2393
+ h,
2394
+ d
2395
+ ), fe = C === z.TAKE_PROFIT ? ze : k, b = C === z.TAKE_PROFIT ? k : D, me = {
2396
+ permitted: {
2397
+ token: n,
2398
+ amount: m
2399
+ },
2400
+ spender: T.reactor,
2401
+ nonce: v,
2402
+ deadline: ie,
2403
+ witness: {
2404
+ reactor: T.reactor,
2405
+ executor: T.executor,
2406
+ exchange: {
2407
+ adapter: T.adapter,
2408
+ ref: T.fee,
2409
+ share: 0,
2410
+ data: "0x"
2411
+ },
2412
+ swapper: x,
2413
+ nonce: v,
2414
+ deadline: ie,
2415
+ chainid: e,
2416
+ exclusivity: 0,
2417
+ epoch: I,
2418
+ slippage: E,
2419
+ freshness: ee,
2420
+ input: {
2421
+ token: n,
2422
+ amount: w,
2423
+ maxAmount: m
2424
+ },
2425
+ output: {
2426
+ token: i,
2427
+ limit: g(b || 0).toFixed(),
2428
+ stop: g(fe || 0).toFixed(),
2429
+ recipient: x
2430
+ }
2431
+ }
2432
+ };
2433
+ return {
2434
+ domain: {
2435
+ name: "RePermit",
2436
+ version: "1",
2437
+ chainId: e,
2438
+ verifyingContract: T.repermit
2439
+ },
2440
+ order: me,
2441
+ types: Jt,
2442
+ primaryType: Ye
2443
+ };
2444
+ }, mn = ({
2445
+ chainId: e,
2446
+ srcToken: n,
2447
+ dstToken: i,
2448
+ srcAmount: m,
2449
+ deadlineMillis: d,
2450
+ fillDelayMillis: h,
2451
+ slippage: E,
2452
+ account: x,
2453
+ srcAmountPerTrade: w,
2454
+ dstMinAmountPerTrade: D = "0",
2455
+ triggerAmountPerTrade: k = "0",
2456
+ config: T,
2457
+ module: C
2458
+ }) => {
2459
+ const { nonce: v, epoch: I, deadline: ie, freshness: ee } = et(
2460
+ h,
2461
+ d
2462
+ ), fe = Math.floor(Date.now() / 1e3).toString(), b = D, me = C === z.STOP_LOSS ? k : "0", Ae = C === z.TAKE_PROFIT ? k : "0", be = {
2463
+ permitted: {
2464
+ token: n,
2465
+ amount: m
2466
+ },
2467
+ spender: T.reactor,
2468
+ nonce: v,
2469
+ deadline: ie,
2470
+ witness: {
2471
+ reactor: T.reactor,
2472
+ executor: T.executor,
2473
+ exchange: {
2474
+ adapter: T.adapter,
2475
+ ref: T.fee,
2476
+ share: 0,
2477
+ data: "0x"
2478
+ },
2479
+ swapper: x,
2480
+ nonce: v,
2481
+ start: fe,
2482
+ deadline: ie,
2483
+ chainid: e,
2484
+ exclusivity: 0,
2485
+ epoch: I,
2486
+ slippage: E,
2487
+ freshness: ee,
2488
+ input: {
2489
+ token: n,
2490
+ amount: w,
2491
+ maxAmount: m
2492
+ },
2493
+ output: {
2494
+ token: i,
2495
+ limit: g(b || 0).toFixed(),
2496
+ triggerLower: g(me || 0).toFixed(),
2497
+ triggerUpper: g(Ae || 0).toFixed(),
2498
+ recipient: x
2499
+ }
2500
+ }
2501
+ };
2502
+ return {
2503
+ domain: {
2504
+ name: "RePermit",
2505
+ version: "1",
2506
+ chainId: e,
2507
+ verifyingContract: T.repermit
2508
+ },
2509
+ order: be,
2510
+ types: en,
2511
+ primaryType: Ye
2512
+ };
2513
+ }, Ra = (e) => Number(xe) >= 2 ? mn(e) : fn(e), yn = 0.7, hn = `https://bi.orbs.network/putes/twap-ui-${yn}`;
2514
+ let Ve = "unknown";
2515
+ function va(e) {
2516
+ Ve = e;
2517
+ }
2518
+ function Ne() {
2519
+ const e = Math.random().toString(36).substring(2, 16), n = Math.random().toString(36).substring(2, 16), i = Date.now().toString(36);
2520
+ return `id_${e + n + i}`;
2521
+ }
2522
+ const An = (e, n, i) => {
2523
+ var m, d, h, E, x, w, D, k, T;
2524
+ return {
2525
+ spotVersion: xe,
2526
+ partner: e.partner,
2527
+ adapter: e.adapter,
2528
+ cosigner: e.cosigner,
2529
+ executor: e.executor,
2530
+ fee: e.fee,
2531
+ reactor: e.reactor,
2532
+ refinery: e.refinery,
2533
+ repermit: e.repermit,
2534
+ router: e.router,
2535
+ type: e.type,
2536
+ wm: e.wm,
2537
+ chainName: ((m = e.twapConfig) == null ? void 0 : m.chainName) || "",
2538
+ chainId: i || 0,
2539
+ twapVersion: ((d = e.twapConfig) == null ? void 0 : d.twapVersion) || 0,
2540
+ twapAddress: ((h = e.twapConfig) == null ? void 0 : h.twapAddress) || "",
2541
+ lensAddress: ((E = e.twapConfig) == null ? void 0 : E.lensAddress) || "",
2542
+ bidDelaySeconds: ((x = e.twapConfig) == null ? void 0 : x.bidDelaySeconds) || 0,
2543
+ minChunkSizeUsd: n,
2544
+ name: ((w = e.twapConfig) == null ? void 0 : w.name) || "",
2545
+ exchangeAddress: ((D = e.twapConfig) == null ? void 0 : D.exchangeAddress) || "",
2546
+ exchangeType: ((k = e.twapConfig) == null ? void 0 : k.exchangeType) || "",
2547
+ pathfinderKey: ((T = e.twapConfig) == null ? void 0 : T.pathfinderKey) || ""
2548
+ };
2549
+ }, je = async (e) => {
2550
+ try {
2551
+ await fetch(hn, {
2552
+ method: "POST",
2553
+ headers: {
2554
+ Accept: "application/json",
2555
+ "Content-Type": "application/json"
2556
+ },
2557
+ body: JSON.stringify(e)
2558
+ }).then();
2559
+ } catch (n) {
2560
+ console.error("Failed to send BI", n);
2561
+ }
2562
+ };
2563
+ class bn {
2564
+ constructor() {
2565
+ Ce(this, "timeout");
2566
+ Ce(this, "config");
2567
+ Ce(this, "data", {
2568
+ _id: Ne()
2569
+ });
2570
+ }
2571
+ async updateAndSend(n = {}, i = !1, m) {
2572
+ try {
2573
+ this.data = {
2574
+ ...this.data,
2575
+ ...n
2576
+ }, i ? (await je(this.data), m == null || m()) : (clearTimeout(this.timeout), this.timeout = setTimeout(() => {
2577
+ je(this.data), m == null || m();
2578
+ }, 1e3));
2579
+ } catch (d) {
2580
+ console.error("Failed to update and send BI", d);
2581
+ }
2582
+ }
2583
+ onCancelOrderRequest(n, i) {
2584
+ this.updateAndSend({
2585
+ cancelOrderIdsV1: i === 1 ? n : void 0,
2586
+ cancelOrderIdsV2: i === 2 ? n : void 0,
2587
+ action: "cancel order",
2588
+ cancelOrderSuccess: !1,
2589
+ cancelOrderTxHash: void 0,
2590
+ actionError: void 0
2591
+ });
2592
+ }
2593
+ onCancelOrderSuccess(n) {
2594
+ this.updateAndSend({
2595
+ cancelOrderTxHash: n,
2596
+ cancelOrderSuccess: !0
2597
+ });
2598
+ }
2599
+ onCancelOrderError(n) {
2600
+ this.onTxError(n);
2601
+ }
2602
+ onWrapSuccess(n) {
2603
+ this.updateAndSend({
2604
+ wrapTxHash: n
2605
+ });
2606
+ }
2607
+ onWrapRequest() {
2608
+ this.updateAndSend({
2609
+ action: "wrap"
2610
+ });
2611
+ }
2612
+ onWrapError(n) {
2613
+ this.onTxError(n);
2614
+ }
2615
+ onApproveRequest() {
2616
+ this.updateAndSend({
2617
+ action: "approve"
2618
+ });
2619
+ }
2620
+ onApproveSuccess(n) {
2621
+ this.updateAndSend({
2622
+ approvalTxHash: n
2623
+ });
2624
+ }
2625
+ onApproveError(n) {
2626
+ this.onTxError(n);
2627
+ }
2628
+ onCrash(n) {
2629
+ var i;
2630
+ this.updateAndSend({ action: "crash", actionError: ((i = n == null ? void 0 : n.message) == null ? void 0 : i.toLowerCase()) || (n == null ? void 0 : n.toLowerCase()) });
2631
+ }
2632
+ onTxError(n) {
2633
+ var m;
2634
+ const i = ((m = n == null ? void 0 : n.message) == null ? void 0 : m.toLowerCase()) || (n == null ? void 0 : n.toLowerCase());
2635
+ this.updateAndSend({ actionError: i });
2636
+ }
2637
+ onRequestOrder({
2638
+ account: n,
2639
+ chainId: i,
2640
+ module: m,
2641
+ srcToken: d,
2642
+ dstToken: h,
2643
+ fromTokenAmount: E,
2644
+ srcChunkAmount: x,
2645
+ minDstAmountOutPerTrade: w = "",
2646
+ triggerPricePerTrade: D = "",
2647
+ deadline: k,
2648
+ fillDelay: T,
2649
+ slippage: C,
2650
+ isMarketOrder: v,
2651
+ chunksAmount: I
2652
+ }) {
2653
+ this.updateAndSend({
2654
+ toTokenAddress: h.address,
2655
+ toTokenSymbol: h.symbol,
2656
+ fromTokenAddress: d.address,
2657
+ fromTokenSymbol: d.symbol,
2658
+ fromTokenAmount: E,
2659
+ chunksAmount: I,
2660
+ srcChunkAmount: x,
2661
+ minDstAmountOutPerTrade: w,
2662
+ triggerPricePerTrade: D,
2663
+ deadline: k,
2664
+ fillDelay: T,
2665
+ slippage: C,
2666
+ chainId: i,
2667
+ walletAddress: n,
2668
+ module: m,
2669
+ orderType: v ? "market" : "limit",
2670
+ actionError: void 0
2671
+ });
2672
+ }
2673
+ onSignOrderRequest(n) {
2674
+ this.updateAndSend({
2675
+ action: "sign order",
2676
+ order: n
2677
+ });
2678
+ }
2679
+ onSignOrderError(n) {
2680
+ this.onTxError(n);
2681
+ }
2682
+ onSignOrderSuccess(n) {
2683
+ this.updateAndSend({
2684
+ action: "sign order",
2685
+ signature: n
2686
+ });
2687
+ }
2688
+ init(n, i, m) {
2689
+ var d;
2690
+ this.config = n, m !== ((d = this.data) == null ? void 0 : d.chainId) && (this.data = {
2691
+ _id: Ne(),
2692
+ action: "module-import",
2693
+ uiVersion: Ve,
2694
+ ...An(n, i, m),
2695
+ origin: window.location.origin
2696
+ }, this.updateAndSend(this.data));
2697
+ }
2698
+ onCreateOrderError(n) {
2699
+ this.onTxError(n);
2700
+ }
2701
+ onCreateOrderRequest() {
2702
+ this.updateAndSend({
2703
+ action: "create order"
2704
+ });
2705
+ }
2706
+ async onCreateOrderSuccess(n) {
2707
+ this.updateAndSend(
2708
+ {
2709
+ orderHash: n,
2710
+ orderSuccess: !0
2711
+ },
2712
+ void 0,
2713
+ () => {
2714
+ this.data = {
2715
+ _id: Ne(),
2716
+ action: "reset",
2717
+ uiVersion: Ve,
2718
+ origin: this.data.origin,
2719
+ spotVersion: xe,
2720
+ partner: this.data.partner,
2721
+ adapter: this.data.adapter,
2722
+ cosigner: this.data.cosigner,
2723
+ executor: this.data.executor,
2724
+ fee: this.data.fee,
2725
+ reactor: this.data.reactor,
2726
+ refinery: this.data.refinery,
2727
+ repermit: this.data.repermit,
2728
+ router: this.data.router,
2729
+ type: this.data.type,
2730
+ wm: this.data.wm,
2731
+ chainName: this.data.chainName || "",
2732
+ chainId: this.data.chainId || 0,
2733
+ twapVersion: this.data.twapVersion || 0,
2734
+ twapAddress: this.data.twapAddress || "",
2735
+ lensAddress: this.data.lensAddress || "",
2736
+ bidDelaySeconds: this.data.bidDelaySeconds || 0,
2737
+ minChunkSizeUsd: this.data.minChunkSizeUsd || 0,
2738
+ name: this.data.name || "",
2739
+ exchangeAddress: this.data.exchangeAddress || "",
2740
+ exchangeType: this.data.exchangeType || "",
2741
+ pathfinderKey: this.data.pathfinderKey || ""
2742
+ };
2743
+ }
2744
+ );
2745
+ }
2746
+ onLoad() {
2747
+ this.updateAndSend({
2748
+ action: "module-import",
2749
+ origin: window.location.origin
2750
+ });
2751
+ }
2752
+ }
2753
+ const Me = new bn(), En = (e) => {
2754
+ var x;
2755
+ const n = g(e.order.witness.output.limit || 0).gt(1), i = e.order.witness.output.stop, m = e.order.witness.output.triggerUpper, d = g(i || 0).eq(ze) || g(m || 0).gt(0), h = g(i || 0).gt(0), E = ((x = e.metadata.chunks) == null ? void 0 : x.length) || g(e.order.witness.input.maxAmount).div(g(e.order.witness.input.amount)).toNumber();
2756
+ return d ? q.TAKE_PROFIT : h ? n ? q.STOP_LOSS_LIMIT : q.STOP_LOSS_MARKET : n ? E > 1 && n ? q.TWAP_LIMIT : n ? q.LIMIT : q.TWAP_MARKET : q.TWAP_MARKET;
2757
+ }, gn = (e) => {
2758
+ var d;
2759
+ const n = ((d = e.metadata.chunks) == null ? void 0 : d.filter((h) => h.status === "success").length) || 0, i = e.metadata.expectedChunks || 0, m = g(n).dividedBy(i).toNumber();
2760
+ return m >= 0.99 ? 100 : m <= 0 ? 0 : Number((m * 100).toFixed(2));
2761
+ }, xn = (e, n) => e.metadata.status === "completed" || n >= 99 ? re.Completed : ["pending", "eligible"].includes(e.metadata.status) ? re.Open : e.metadata.description.toLowerCase() === "cancelled by contract" ? re.Cancelled : re.Expired, Tn = (e) => {
2762
+ var i;
2763
+ return (((i = e.metadata.chunks) == null ? void 0 : i.filter((m) => m.status === "success")) || []).map((m) => ({
2764
+ inAmount: m.inAmount,
2765
+ outAmount: m.outAmount,
2766
+ timestamp: new Date(m.timestamp).getTime(),
2767
+ txHash: m.txHash
2768
+ }));
2769
+ }, wn = (e, n) => {
2770
+ var m;
2771
+ const i = e.length;
2772
+ return i >= n && ((m = e[i - 1]) == null ? void 0 : m.timestamp) || 0;
2773
+ }, Cn = (e) => g(e.metadata.displayOnlyInputTokenPriceUSD).dividedBy(1e18).toFixed(), $e = (e) => Number(e.order.witness.output.limit) === 1 ? "" : e.order.witness.output.limit, Fn = (e) => {
2774
+ const {
2775
+ triggerLower: n = "0",
2776
+ triggerUpper: i = "0"
2777
+ } = e.order.witness.output, m = $e(e), d = e.metadata.expectedChunks || 1, h = g(i || 0).gt(0);
2778
+ return {
2779
+ dstMinAmountPerTrade: m,
2780
+ triggerPricePerTrade: h ? i : n,
2781
+ dstMinAmountTotal: g(m).multipliedBy(d).toFixed()
2782
+ };
2783
+ }, Dn = (e) => {
2784
+ const n = $e(e), i = g(e.order.witness.output.stop || 0).eq(ze), m = e.metadata.expectedChunks || 1;
2785
+ return {
2786
+ dstMinAmountPerTrade: i ? "" : n,
2787
+ triggerPricePerTrade: i ? n : g(e.order.witness.output.stop || "").toFixed(),
2788
+ dstMinAmountTotal: i ? "" : g(n).multipliedBy(m).toFixed()
2789
+ };
2790
+ }, Sn = (e) => Number(xe) >= 2 ? Fn(e) : Dn(e), tt = (e) => {
2791
+ const n = gn(e), i = $e(e), m = e.metadata.expectedChunks || 1, d = Tn(e);
2792
+ return {
2793
+ id: e.hash,
2794
+ hash: e.hash,
2795
+ version: 2,
2796
+ type: En(e),
2797
+ maker: e.order.witness.swapper,
2798
+ progress: n,
2799
+ srcAmountFilled: d.reduce((h, E) => h.plus(E.inAmount), new g(0)).toFixed() || "",
2800
+ dstAmountFilled: d.reduce((h, E) => h.plus(E.outAmount), new g(0)).toFixed() || "",
2801
+ fills: d,
2802
+ srcTokenAddress: e.order.witness.input.token,
2803
+ dstTokenAddress: e.order.witness.output.token,
2804
+ orderDollarValueIn: Cn(e),
2805
+ fillDelay: e.order.witness.epoch * 1e3,
2806
+ deadline: Number(e.order.deadline) * 1e3,
2807
+ createdAt: new Date(e.timestamp).getTime(),
2808
+ srcAmount: e.order.witness.input.maxAmount,
2809
+ srcAmountPerTrade: e.order.witness.input.amount,
2810
+ totalTradesAmount: m,
2811
+ isMarketPrice: g(i || 0).lte(1),
2812
+ chainId: e.order.witness.chainid,
2813
+ filledOrderTimestamp: wn(d, m),
2814
+ status: xn(e, n),
2815
+ rawOrder: e,
2816
+ ...Sn(e)
2817
+ };
2818
+ }, kn = async ({
2819
+ chainId: e,
2820
+ signal: n,
2821
+ account: i,
2822
+ exchange: m,
2823
+ isDev: d = !1
2824
+ }) => {
2825
+ try {
2826
+ if (!i) return [];
2827
+ const h = m ? `&exchange=${m}` : "";
2828
+ return (await (await fetch(
2829
+ `${Le(d)}/orders?swapper=${i}&chainId=${e}${h}`,
2830
+ {
2831
+ signal: n
2832
+ }
2833
+ )).json()).orders.map(tt);
2834
+ } catch {
2835
+ return [];
2836
+ }
2837
+ }, Pa = async (e, n, i = !1) => {
2838
+ try {
2839
+ const m = {
2840
+ signature: n,
2841
+ order: e,
2842
+ status: "pending"
2843
+ };
2844
+ Me.onCreateOrderRequest(), console.log(`${Le(i)}/orders/new`);
2845
+ const d = await fetch(`${Le(i)}/orders/new`, {
2846
+ method: "POST",
2847
+ body: JSON.stringify(m)
2848
+ }), h = await d.json().catch(() => ({}));
2849
+ if (!d.ok || !(h != null && h.success)) {
2850
+ const x = (h == null ? void 0 : h.message) ?? d.statusText ?? "Request failed", w = (h == null ? void 0 : h.code) ?? d.status;
2851
+ throw new Error(`error:${x}, code:${w}`);
2852
+ }
2853
+ const E = tt(h.signedOrder);
2854
+ return Me.onCreateOrderSuccess(E.id), E;
2855
+ } catch (m) {
2856
+ throw Me.onCreateOrderError(m), console.error(m), m;
2857
+ }
2858
+ }, ce = (e, n) => e && e.length ? e.map(n || ((i) => `${i}`)) : void 0, Bn = (e) => {
2859
+ if (e)
2860
+ return jt[e];
2861
+ }, He = async ({
2862
+ chainId: e,
2863
+ buildQuery: n,
2864
+ extractResults: i,
2865
+ signal: m,
2866
+ retries: d = 1,
2867
+ limit: h = 1e3,
2868
+ page: E
2869
+ }) => {
2870
+ const x = Bn(e);
2871
+ if (!x) throw new In();
2872
+ const w = async (T) => {
2873
+ let C = 0;
2874
+ for (; C <= d; )
2875
+ try {
2876
+ const v = await fetch(x, {
2877
+ method: "POST",
2878
+ body: JSON.stringify({ query: T }),
2879
+ signal: m,
2880
+ headers: { "Content-Type": "application/json" }
2881
+ });
2882
+ if (!v.ok) throw new Error(`HTTP error: ${v.status}`);
2883
+ const I = await v.json();
2884
+ if (I.errors)
2885
+ throw new Error(I.errors[0].message);
2886
+ return i(I);
2887
+ } catch (v) {
2888
+ if (C === d) throw v;
2889
+ await new Promise((I) => setTimeout(I, 500 * 2 ** C)), C++;
2890
+ }
2891
+ return [];
2892
+ };
2893
+ let D = 0;
2894
+ const k = [];
2895
+ if (E !== void 0) {
2896
+ const T = n(E, h);
2897
+ try {
2898
+ return await w(T);
2899
+ } catch {
2900
+ console.warn(`Page ${E} failed, retrying one final time...`);
2901
+ try {
2902
+ return await w(T);
2903
+ } catch {
2904
+ return [];
2905
+ }
2906
+ }
2907
+ }
2908
+ for (; ; ) {
2909
+ const T = n(D, h);
2910
+ let C;
2911
+ try {
2912
+ C = await w(T);
2913
+ } catch {
2914
+ console.warn(`Page ${D} failed, retrying one final time...`);
2915
+ try {
2916
+ C = await w(T);
2917
+ } catch {
2918
+ return k;
2919
+ }
2920
+ }
2921
+ if (k.push(...C), C.length < h) break;
2922
+ D++;
2923
+ }
2924
+ return k;
2925
+ }, nt = (e) => e.map((n) => ({
2926
+ inAmount: n.srcAmountIn,
2927
+ outAmount: n.dstAmountOut,
2928
+ timestamp: n.timestamp,
2929
+ txHash: n.transactionHash
2930
+ })), Qe = (e, n) => {
2931
+ const i = g(e || 0).gt(1);
2932
+ return !i && n === 1 ? q.TWAP_MARKET : n > 1 && i ? q.TWAP_LIMIT : i ? q.LIMIT : q.TWAP_MARKET;
2933
+ }, _n = (e, n, i, m) => {
2934
+ var C;
2935
+ const d = nt(i || []), h = new g(e.ask_srcAmount || 0).div(e.ask_srcBidAmount).integerValue(g.ROUND_FLOOR).toNumber(), x = (i == null ? void 0 : i.length) === h ? (C = i == null ? void 0 : i[(i == null ? void 0 : i.length) - 1]) == null ? void 0 : C.timestamp : void 0, w = d.reduce((v, I) => v.plus(I.inAmount), new g(0)).toFixed(), D = d.reduce((v, I) => v.plus(I.outAmount), new g(0)).toFixed(), k = at(e.ask_srcAmount, w), T = Qe(e.ask_dstMinAmount, h);
2936
+ return {
2937
+ version: 1,
2938
+ id: e.Contract_id.toString(),
2939
+ hash: "",
2940
+ type: Qe(e.ask_dstMinAmount, h),
2941
+ srcTokenAddress: e.ask_srcToken,
2942
+ dstTokenAddress: e.ask_dstToken,
2943
+ exchangeAddress: e.exchange,
2944
+ twapAddress: e.twapAddress,
2945
+ maker: e.maker,
2946
+ progress: k,
2947
+ dstAmountFilled: D,
2948
+ srcAmountFilled: w,
2949
+ orderDollarValueIn: g(e.dollarValueIn || 0).toFixed(6),
2950
+ srcAmount: e.ask_srcAmount,
2951
+ dstMinAmountTotal: g(e.ask_dstMinAmount).multipliedBy(h).toString(),
2952
+ fills: d,
2953
+ fillDelay: e.ask_fillDelay,
2954
+ deadline: e.ask_deadline * 1e3,
2955
+ createdAt: new Date(e.timestamp).getTime(),
2956
+ dstMinAmountPerTrade: g(e.ask_dstMinAmount).eq(1) ? "" : e.ask_dstMinAmount,
2957
+ triggerPricePerTrade: "",
2958
+ srcAmountPerTrade: e.ask_srcBidAmount,
2959
+ txHash: e.transactionHash,
2960
+ totalTradesAmount: h,
2961
+ isMarketPrice: [q.TWAP_MARKET].includes(T),
2962
+ chainId: n,
2963
+ filledOrderTimestamp: x || 0,
2964
+ status: m,
2965
+ rawOrder: e
2966
+ };
2967
+ }, On = (e) => {
2968
+ var T;
2969
+ if (!e) return "";
2970
+ const n = ce(
2971
+ e.accounts,
2972
+ (C) => `"${C.toLowerCase()}"`
2973
+ ), i = ce(
2974
+ dn(e.configs),
2975
+ (C) => `"${C.toLowerCase()}"`
2976
+ ), m = ce(
2977
+ e.inTokenSymbols,
2978
+ (C) => `"${C.toUpperCase()}"`
2979
+ ), d = ce(
2980
+ e.outTokenSymbols,
2981
+ (C) => `"${C.toUpperCase()}"`
2982
+ ), h = ce(
2983
+ e.inTokenAddresses,
2984
+ (C) => `"${C.toLowerCase()}"`
2985
+ ), E = ce(
2986
+ e.outTokenAddresses,
2987
+ (C) => `"${C.toLowerCase()}"`
2988
+ ), x = ce(
2989
+ e.transactionHashes,
2990
+ (C) => `"${C.toLowerCase()}"`
2991
+ ), w = ce(e.orderIds, (C) => `"${C}"`), D = i != null && i.length ? "" : ce(
2992
+ (T = e.configs) == null ? void 0 : T.map((C) => C.twapAddress),
2993
+ (C) => `"${C.toLowerCase()}"`
2994
+ ), k = e.minDollarValueIn;
2995
+ return [
2996
+ i ? `exchange_in: [${i.join(", ")}]` : "",
2997
+ D ? `twapAddress_in: [${D.join(", ")}]` : "",
2998
+ n ? `maker_in: [${n.join(", ")}]` : "",
2999
+ x ? `transactionHash_in: [${x.join(", ")}]` : "",
3000
+ w ? `Contract_id_in: [${w.join(", ")}]` : "",
3001
+ k ? `dollarValueIn_gte: ${k}` : "",
3002
+ m ? `srcTokenSymbol_in: [${m.join(", ")}]` : "",
3003
+ d ? `dstTokenSymbol_in: [${d.join(", ")}]` : "",
3004
+ h ? `srcTokenAddress_in: [${h.join(", ")}]` : "",
3005
+ E ? `dstTokenAddress_in: [${E.join(", ")}]` : "",
3006
+ e != null && e.startDate ? `blockTimestamp_gte: ${e.startDate}` : "",
3007
+ e != null && e.endDate ? `blockTimestamp_lte: ${e.endDate}` : "",
3008
+ (e == null ? void 0 : e.orderType) === "limit" ? "ask_dstMinAmount_gt: 1" : "",
3009
+ (e == null ? void 0 : e.orderType) === "market" ? "ask_dstMinAmount_lte: 1" : ""
3010
+ ].filter(Boolean).join(", ");
3011
+ };
3012
+ async function Rn({
3013
+ chainId: e,
3014
+ signal: n,
3015
+ page: i,
3016
+ limit: m,
3017
+ filters: d
3018
+ }) {
3019
+ const h = m || 1e3, E = On(d);
3020
+ return await He({
3021
+ chainId: e,
3022
+ signal: n,
3023
+ limit: h,
3024
+ page: i,
3025
+ buildQuery: (w, D) => `
3026
+ {
3027
+ orderCreateds(
3028
+ ${E ? `where: { ${E} }` : ""},
3029
+ first: ${D},
3030
+ skip: ${w * D},
3031
+ orderBy: timestamp,
3032
+ orderDirection: desc,
3033
+ ) {
3034
+ id
3035
+ twapAddress
3036
+ Contract_id
3037
+ ask_bidDelay
3038
+ ask_data
3039
+ ask_deadline
3040
+ ask_dstMinAmount
3041
+ ask_dstToken
3042
+ ask_fillDelay
3043
+ ask_exchange
3044
+ ask_srcToken
3045
+ ask_srcBidAmount
3046
+ ask_srcAmount
3047
+ blockNumber
3048
+ blockTimestamp
3049
+ dex
3050
+ dollarValueIn
3051
+ dstTokenSymbol
3052
+ exchange
3053
+ maker
3054
+ srcTokenSymbol
3055
+ timestamp
3056
+ transactionHash
3057
+ }
3058
+ }
3059
+ `,
3060
+ extractResults: (w) => {
3061
+ var D;
3062
+ return ((D = w.data) == null ? void 0 : D.orderCreateds) || [];
3063
+ }
3064
+ });
3065
+ }
3066
+ const vn = async ({
3067
+ chainId: e,
3068
+ orders: n,
3069
+ signal: i
3070
+ }) => {
3071
+ if (n.length === 0) return [];
3072
+ const m = We(n.map((x) => x.Contract_id.toString()));
3073
+ if (!m.length) return [];
3074
+ const h = `where: { twapId_in: [${m.map((x) => `"${x}"`).join(", ")}]}`;
3075
+ return await He({
3076
+ chainId: e,
3077
+ signal: i,
3078
+ limit: 1e3,
3079
+ buildQuery: (x, w) => `
3080
+ {
3081
+ statusNews(
3082
+ first: ${w},
3083
+ skip: ${x * w},
3084
+ ${h}
3085
+ ) {
3086
+ twapId
3087
+ twapAddress
3088
+ status
3089
+ }
3090
+ }
3091
+ `,
3092
+ extractResults: (x) => {
3093
+ var w;
3094
+ return ((w = x.data) == null ? void 0 : w.statusNews) || [];
3095
+ }
3096
+ });
3097
+ };
3098
+ function We(e) {
3099
+ return Array.from(new Set(e));
3100
+ }
3101
+ const Pn = async ({
3102
+ chainId: e,
3103
+ orders: n,
3104
+ signal: i
3105
+ }) => {
3106
+ const m = We(n.map((T) => T.Contract_id)), d = We(n.map((T) => T.twapAddress)).filter(Boolean);
3107
+ if (m.length === 0) return [];
3108
+ const h = m.join(", "), E = d.map((T) => `"${T}"`).join(", "), x = d.length ? `twapAddress_in: [${E}]` : "", D = `where: { ${[
3109
+ `TWAP_id_in: [${h}]`,
3110
+ x
3111
+ ].filter(Boolean).join(", ")} }`;
3112
+ return await He({
3113
+ chainId: e,
3114
+ signal: i,
3115
+ limit: 1e3,
3116
+ buildQuery: (T, C) => `
3117
+ {
3118
+ orderFilleds(first: ${C}, orderBy: timestamp, skip: ${T * C}, ${D}) {
3119
+ id
3120
+ dstAmountOut
3121
+ dstFee
3122
+ srcFilledAmount
3123
+ twapAddress
3124
+ exchange
3125
+ TWAP_id
3126
+ srcAmountIn
3127
+ timestamp
3128
+ transactionHash
3129
+ dollarValueIn
3130
+ dollarValueOut
3131
+ }
3132
+ }
3133
+ `,
3134
+ extractResults: (T) => {
3135
+ var C;
3136
+ return (((C = T.data) == null ? void 0 : C.orderFilleds) || []).map((v) => ({
3137
+ ...v,
3138
+ timestamp: new Date(v.timestamp).getTime()
3139
+ }));
3140
+ }
3141
+ });
3142
+ };
3143
+ class In extends Error {
3144
+ constructor() {
3145
+ super("No graph endpoint found"), this.name = "NoGraphEndpointError";
3146
+ }
3147
+ }
3148
+ const Nn = async ({
3149
+ chainId: e,
3150
+ signal: n,
3151
+ page: i,
3152
+ limit: m,
3153
+ filters: d
3154
+ }) => {
3155
+ try {
3156
+ const h = await Rn({
3157
+ chainId: e,
3158
+ signal: n,
3159
+ page: i,
3160
+ limit: m,
3161
+ filters: d
3162
+ }), [E, x] = await Promise.all([
3163
+ Pn({ chainId: e, orders: h, signal: n }),
3164
+ vn({ chainId: e, orders: h, signal: n })
3165
+ ]), w = h.map((k) => {
3166
+ const T = E == null ? void 0 : E.filter(
3167
+ (C) => C.TWAP_id === Number(k.Contract_id) && Se(C.exchange, k.exchange) && Se(C.twapAddress, k.twapAddress)
3168
+ );
3169
+ return _n(
3170
+ k,
3171
+ e,
3172
+ T,
3173
+ Mn(k, T || [], x)
3174
+ );
3175
+ }).sort((k, T) => T.createdAt - k.createdAt), D = /* @__PURE__ */ new Set();
3176
+ return w.filter((k) => D.has(k.id) ? !1 : (D.add(k.id), !0));
3177
+ } catch {
3178
+ return [];
3179
+ }
3180
+ }, Mn = (e, n, i) => {
3181
+ var x;
3182
+ const m = (x = i == null ? void 0 : i.find(
3183
+ (w) => w.twapId === e.Contract_id.toString() && Se(w.twapAddress, e.twapAddress)
3184
+ )) == null ? void 0 : x.status, h = nt(n).reduce((w, D) => w.plus(D.inAmount), new g(0)).toFixed(), E = at(e.ask_srcAmount, h);
3185
+ return Ln(E, e.ask_deadline * 1e3, m);
3186
+ }, at = (e, n) => {
3187
+ if (!n || !e) return 0;
3188
+ const i = g(n).dividedBy(e).toNumber();
3189
+ return i >= 0.99 ? 100 : i <= 0 ? 0 : Number((i * 100).toFixed(2));
3190
+ }, Ln = (e, n, i) => e === 100 ? re.Completed : i === "CANCELLED" ? re.Cancelled : i === "COMPLETED" ? re.Completed : n > Date.now() ? re.Open : re.Expired, Ia = async ({
3191
+ signal: e,
3192
+ page: n,
3193
+ chainId: i,
3194
+ limit: m,
3195
+ config: d,
3196
+ account: h,
3197
+ isDev: E = !1
3198
+ }) => (await Promise.all([
3199
+ d ? Nn({ chainId: i, signal: e, page: n, limit: m, filters: { accounts: [h], configs: d.twapConfig ? [d.twapConfig] : [] } }) : Promise.resolve([]),
3200
+ kn({ chainId: i, signal: e, account: h, exchange: d == null ? void 0 : d.adapter, isDev: E })
3201
+ ]).then(([D, k]) => [...D, ...k])).sort((D, k) => k.createdAt - D.createdAt);
3202
+ export {
3203
+ sa as CRASH_ERROR_MESSAGE,
3204
+ _ as Configs,
3205
+ Ge as DEFAULT_FILL_DELAY,
3206
+ na as DEFAULT_STOP_LOSS_LIMIT_PERCENTAGE,
3207
+ ea as DEFAULT_STOP_LOSS_PERCENTAGE,
3208
+ aa as DEFAULT_TAKE_PROFIT_LIMIT_PERCENTAGE,
3209
+ ta as DEFAULT_TAKE_PROFIT_PERCENTAGE,
3210
+ Jn as DISCLAIMER_URL,
3211
+ Jt as EIP712_TYPES,
3212
+ en as EIP712_TYPES_DEV,
3213
+ Wn as ERC20_ABI,
3214
+ qn as EXCLUSIVITY_OVERRIDE_BPS,
3215
+ Gn as FEES,
3216
+ Vn as IWETH_ABI,
3217
+ zt as InputErrors,
3218
+ Zt as LEGACY_EXCHANGES_MAP,
3219
+ ge as MAX_ORDER_DURATION_MILLIS,
3220
+ Kn as MIN_CHUNKS,
3221
+ Ue as MIN_FILL_DELAY_MILLIS,
3222
+ Xt as MIN_FILL_DELAY_MINUTES,
3223
+ Ke as MIN_ORDER_DURATION_MILLIS,
3224
+ z as Module,
3225
+ Qn as ORBS_LOGO,
3226
+ Yn as ORBS_LOGO_FALLBACK,
3227
+ jn as ORBS_SLTP_FAQ_URL,
3228
+ Xn as ORBS_TWAP_FAQ_URL,
3229
+ Zn as ORBS_WEBSITE_URL,
3230
+ Wt as OrderFilter,
3231
+ re as OrderStatus,
3232
+ q as OrderType,
3233
+ pe as Partners,
3234
+ Te as QUERY_PARAMS,
3235
+ zn as REPERMIT_ABI,
3236
+ Ye as REPERMIT_PRIMARY_TYPE,
3237
+ xe as SPOT_VERSION,
3238
+ Hn as SUGGEST_CHUNK_VALUE,
3239
+ jt as THE_GRAPH_ORDERS_API,
3240
+ $n as TWAP_ABI,
3241
+ ae as TimeUnit,
3242
+ Me as analytics,
3243
+ Ra as buildRePermitOrderData,
3244
+ tt as buildV2Order,
3245
+ Se as eqIgnoreCase,
3246
+ Ia as getAccountOrders,
3247
+ Le as getApiEndpoint,
3248
+ ha as getChunks,
3249
+ un as getConfig,
3250
+ ba as getDeadline,
3251
+ la as getDestTokenAmount,
3252
+ fa as getDestTokenMinAmountPerChunk,
3253
+ ya as getDuration,
3254
+ Oa as getErrors,
3255
+ cn as getEstimatedDelayBetweenChunksMillis,
3256
+ Ba as getMaxChunksError,
3257
+ ga as getMaxFillDelayError,
3258
+ Fa as getMaxOrderDurationError,
3259
+ Aa as getMaxPossibleChunks,
3260
+ _a as getMinChunkSizeUsd,
3261
+ Sa as getMinFillDelayError,
3262
+ Da as getMinOrderDurationError,
3263
+ ka as getMinTradeSizeError,
3264
+ ia as getNetwork,
3265
+ ca as getOrderExecutionRate,
3266
+ oa as getOrderFillDelayMillis,
3267
+ pa as getOrderLimitPriceRate,
3268
+ da as getPartnerChains,
3269
+ G as getPartnerIdentifier,
3270
+ ln as getPartners,
3271
+ Ea as getSrcTokenChunkAmount,
3272
+ wa as getStopLossLimitPriceError,
3273
+ xa as getStopLossPriceError,
3274
+ Ca as getTakeProfitLimitPriceError,
3275
+ Ta as getTakeProfitPriceError,
3276
+ ma as getTriggerPricePerChunk,
3277
+ ua as getTriggerPricePerTrade,
3278
+ ra as isNativeAddress,
3279
+ ze as maxUint256,
3280
+ Yt as nativeTokenAddresses,
3281
+ K as networks,
3282
+ va as setUIVersion,
3283
+ Pa as submitOrder,
3284
+ Qt as zeroAddress
3285
+ };