@gmx-io/sdk 1.4.0 → 1.4.1

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 (151) hide show
  1. package/build/cjs/src/abis/GlvReader.js +940 -940
  2. package/build/cjs/src/abis/IStargate.js +603 -0
  3. package/build/cjs/src/abis/LayerZeroProvider.js +273 -46
  4. package/build/cjs/src/abis/index.js +2 -2
  5. package/build/cjs/src/configs/batch.js +29 -103
  6. package/build/cjs/src/configs/chainIds.js +2 -2
  7. package/build/cjs/src/configs/chains.js +230 -151
  8. package/build/cjs/src/configs/contracts.js +1 -5
  9. package/build/cjs/src/configs/dataStore.js +5 -4
  10. package/build/cjs/src/configs/express.js +1 -1
  11. package/build/cjs/src/configs/gasLimits.js +41 -0
  12. package/build/cjs/src/configs/markets.js +67 -1
  13. package/build/cjs/src/configs/multichain.js +1 -0
  14. package/build/cjs/src/configs/oracleKeeper.js +18 -20
  15. package/build/cjs/src/configs/tokens.js +53 -14
  16. package/build/cjs/src/modules/markets/index.js +6 -2
  17. package/build/cjs/src/modules/markets/markets.spec.js +5 -5
  18. package/build/cjs/src/modules/markets/query-builders.js +8 -0
  19. package/build/cjs/src/modules/orders/helpers.js +2 -2
  20. package/build/cjs/src/modules/orders/helpers.spec.js +1 -1
  21. package/build/cjs/src/modules/orders/orders.spec.js +1 -1
  22. package/build/cjs/src/modules/positions/positions.spec.js +2 -2
  23. package/build/cjs/src/modules/tokens/tokens.spec.js +2 -2
  24. package/build/cjs/src/modules/trades/trades.spec.js +1 -1
  25. package/build/cjs/src/modules/utils/utils.js +7 -6
  26. package/build/cjs/src/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  27. package/build/cjs/src/prebuilt/hashedMarketConfigKeys.json +495 -0
  28. package/build/cjs/src/prebuilt/hashedMarketValuesKeys.json +45 -0
  29. package/build/cjs/src/test/mock.js +2 -0
  30. package/build/cjs/src/types/chains.js +2 -0
  31. package/build/cjs/src/types/orders.js +8 -2
  32. package/build/cjs/src/types/subsquid.js +241 -1
  33. package/build/cjs/src/types/tokens.js +7 -0
  34. package/build/cjs/src/utils/__tests__/abort.spec.js +122 -0
  35. package/build/cjs/src/utils/__tests__/numbers.spec.js +94 -14
  36. package/build/cjs/src/utils/abort.js +31 -0
  37. package/build/cjs/src/utils/callContract.js +4 -4
  38. package/build/cjs/src/utils/fees/executionFee.js +14 -11
  39. package/build/cjs/src/utils/fees/index.js +8 -2
  40. package/build/cjs/src/utils/marketKeysAndConfigs.js +8 -0
  41. package/build/cjs/src/utils/markets.js +7 -1
  42. package/build/cjs/src/utils/multicall.js +54 -17
  43. package/build/cjs/src/utils/numbers.js +25 -14
  44. package/build/cjs/src/utils/orders.js +2 -2
  45. package/build/cjs/src/utils/swap/__tests__/mockRouting.spec.js +7 -6
  46. package/build/cjs/src/utils/swap/__tests__/swapRouting.spec.js +5 -4
  47. package/build/cjs/src/utils/swap/__tests__/swapStats.spec.js +10 -9
  48. package/build/cjs/src/utils/swap/buildSwapStrategy.js +10 -9
  49. package/build/cjs/src/utils/swap/swapPath.js +6 -6
  50. package/build/cjs/src/utils/swap/swapRouting.js +8 -4
  51. package/build/cjs/src/utils/swap/swapStats.js +6 -6
  52. package/build/cjs/src/utils/swap/swapValues.js +4 -0
  53. package/build/cjs/src/utils/tokens.js +17 -1
  54. package/build/cjs/src/utils/trade/decrease.js +1 -1
  55. package/build/esm/src/abis/GlvReader.js +940 -940
  56. package/build/esm/src/abis/IStargate.js +601 -0
  57. package/build/esm/src/abis/LayerZeroProvider.js +273 -46
  58. package/build/esm/src/abis/index.js +2 -2
  59. package/build/esm/src/configs/batch.js +30 -104
  60. package/build/esm/src/configs/chainIds.js +1 -1
  61. package/build/esm/src/configs/chains.js +212 -147
  62. package/build/esm/src/configs/contracts.js +1 -5
  63. package/build/esm/src/configs/dataStore.js +1 -0
  64. package/build/esm/src/configs/express.js +1 -1
  65. package/build/esm/src/configs/gasLimits.js +38 -0
  66. package/build/esm/src/configs/markets.js +60 -1
  67. package/build/esm/src/configs/multichain.js +2 -1
  68. package/build/esm/src/configs/oracleKeeper.js +17 -19
  69. package/build/esm/src/configs/tokens.js +52 -13
  70. package/build/esm/src/modules/markets/index.js +6 -2
  71. package/build/esm/src/modules/markets/markets.spec.js +5 -5
  72. package/build/esm/src/modules/markets/query-builders.js +8 -0
  73. package/build/esm/src/modules/orders/helpers.js +3 -3
  74. package/build/esm/src/modules/orders/helpers.spec.js +1 -1
  75. package/build/esm/src/modules/orders/orders.spec.js +1 -1
  76. package/build/esm/src/modules/positions/positions.spec.js +2 -2
  77. package/build/esm/src/modules/tokens/tokens.spec.js +2 -2
  78. package/build/esm/src/modules/trades/trades.spec.js +1 -1
  79. package/build/esm/src/modules/utils/utils.js +7 -6
  80. package/build/esm/src/prebuilt/hashedKinkModelMarketRatesKeys.json +24 -0
  81. package/build/esm/src/prebuilt/hashedMarketConfigKeys.json +495 -0
  82. package/build/esm/src/prebuilt/hashedMarketValuesKeys.json +45 -0
  83. package/build/esm/src/test/mock.js +2 -0
  84. package/build/esm/src/types/chains.js +1 -0
  85. package/build/esm/src/types/orders.js +8 -2
  86. package/build/esm/src/types/subsquid.js +240 -0
  87. package/build/esm/src/types/tokens.js +6 -1
  88. package/build/esm/src/utils/__tests__/abort.spec.js +120 -0
  89. package/build/esm/src/utils/__tests__/numbers.spec.js +95 -15
  90. package/build/esm/src/utils/abort.js +27 -0
  91. package/build/esm/src/utils/callContract.js +5 -5
  92. package/build/esm/src/utils/fees/executionFee.js +15 -12
  93. package/build/esm/src/utils/fees/index.js +8 -2
  94. package/build/esm/src/utils/marketKeysAndConfigs.js +9 -1
  95. package/build/esm/src/utils/markets.js +5 -0
  96. package/build/esm/src/utils/multicall.js +53 -16
  97. package/build/esm/src/utils/numbers.js +21 -12
  98. package/build/esm/src/utils/orders.js +3 -3
  99. package/build/esm/src/utils/swap/__tests__/mockRouting.spec.js +7 -6
  100. package/build/esm/src/utils/swap/__tests__/swapRouting.spec.js +5 -4
  101. package/build/esm/src/utils/swap/__tests__/swapStats.spec.js +10 -9
  102. package/build/esm/src/utils/swap/buildSwapStrategy.js +10 -9
  103. package/build/esm/src/utils/swap/swapPath.js +6 -6
  104. package/build/esm/src/utils/swap/swapRouting.js +8 -4
  105. package/build/esm/src/utils/swap/swapStats.js +6 -6
  106. package/build/esm/src/utils/swap/swapValues.js +4 -0
  107. package/build/esm/src/utils/tokens.js +15 -1
  108. package/build/esm/src/utils/trade/decrease.js +2 -2
  109. package/build/types/src/abis/IStargate.d.ts +464 -0
  110. package/build/types/src/abis/LayerZeroProvider.d.ts +12 -0
  111. package/build/types/src/abis/index.d.ts +475 -99
  112. package/build/types/src/configs/chainIds.d.ts +1 -1
  113. package/build/types/src/configs/chains.d.ts +170 -27
  114. package/build/types/src/configs/contracts.d.ts +0 -4
  115. package/build/types/src/configs/dataStore.d.ts +1 -0
  116. package/build/types/src/configs/express.d.ts +1 -1
  117. package/build/types/src/configs/gasLimits.d.ts +4 -0
  118. package/build/types/src/configs/markets.d.ts +10 -1
  119. package/build/types/src/configs/oracleKeeper.d.ts +13 -0
  120. package/build/types/src/configs/tokens.d.ts +3 -0
  121. package/build/types/src/index.d.ts +1 -1
  122. package/build/types/src/modules/base.d.ts +1 -1
  123. package/build/types/src/modules/markets/index.d.ts +2 -0
  124. package/build/types/src/modules/markets/query-builders.d.ts +1 -1
  125. package/build/types/src/modules/markets/types.d.ts +2 -2
  126. package/build/types/src/modules/utils/utils.d.ts +2 -3
  127. package/build/types/src/types/chains.d.ts +57 -0
  128. package/build/types/src/types/markets.d.ts +2 -0
  129. package/build/types/src/types/orders.d.ts +8 -2
  130. package/build/types/src/types/subsquid.d.ts +5987 -5172
  131. package/build/types/src/types/tokens.d.ts +11 -3
  132. package/build/types/src/types/trade.d.ts +5 -0
  133. package/build/types/src/utils/__tests__/abort.spec.d.ts +1 -0
  134. package/build/types/src/utils/abort.d.ts +1 -0
  135. package/build/types/src/utils/fees/estimateOraclePriceCount.d.ts +2 -2
  136. package/build/types/src/utils/fees/executionFee.d.ts +6 -6
  137. package/build/types/src/utils/fees/index.d.ts +2 -1
  138. package/build/types/src/utils/marketKeysAndConfigs.d.ts +2 -0
  139. package/build/types/src/utils/markets.d.ts +4 -2
  140. package/build/types/src/utils/multicall.d.ts +4 -2
  141. package/build/types/src/utils/numbers.d.ts +8 -1
  142. package/build/types/src/utils/swap/buildSwapStrategy.d.ts +6 -3
  143. package/build/types/src/utils/swap/swapPath.d.ts +2 -1
  144. package/build/types/src/utils/swap/swapRouting.d.ts +7 -2
  145. package/build/types/src/utils/swap/swapStats.d.ts +3 -2
  146. package/build/types/src/utils/swap/swapValues.d.ts +1 -1
  147. package/build/types/src/utils/tokens.d.ts +3 -0
  148. package/package.json +8 -2
  149. package/build/cjs/src/abis/MultichainUtils.js +0 -133
  150. package/build/esm/src/abis/MultichainUtils.js +0 -131
  151. package/build/types/src/abis/MultichainUtils.d.ts +0 -100
@@ -1756,6 +1756,51 @@
1756
1756
  "longInterestInTokensUsingShortToken": "0x6734f6e1ed79dbc103747ae3793283a241f5781bdedcee7ecc33e856c5dedb83",
1757
1757
  "shortInterestInTokensUsingLongToken": "0x3290d5bb740ead6457be88ecd3dc9fe14cabb45ae3b6f79c1348639e03fa16c6",
1758
1758
  "shortInterestInTokensUsingShortToken": "0xc6a4753ad0bccf47988451d2174e0bc5dbd2eb198aeb6e17426d3b8ce0e4b028"
1759
+ },
1760
+ "0x66AB9D61A0124b61C8892A4ac687Ac48DbA8ff2c": {
1761
+ "longPoolAmount": "0x5661e078962dbc784b7a17cecca12cfbd5600a21fa3297dc638cc6f1d1046493",
1762
+ "shortPoolAmount": "0xf9f13803349449db626ac6f6313e40aee5e825974ea5343fc20705f5717a4a63",
1763
+ "positionImpactPoolAmount": "0x85eb4f5f6c82d284dd0125e049e4d3d9644348f409db85d507b0976cf3f56e0b",
1764
+ "swapImpactPoolAmountLong": "0x1d359a85d48c70f0ee3cb93653f66445f8176f7ea40b8225543f55678a4cf16f",
1765
+ "swapImpactPoolAmountShort": "0x5bf55afb1627b36620f80515384ef3512044d0cb15bad2834257210b9fb831ad",
1766
+ "longInterestUsingLongToken": "0x5c9b7a26db46be6be52ff43c23ba724f7a611f1b1d6ea79bf0c31dafece2dd73",
1767
+ "longInterestUsingShortToken": "0xef06200611d7c2e17001b8eb0bef6c59e5fbb510807deda09442776b06172d8f",
1768
+ "shortInterestUsingLongToken": "0x0030ba0747b42bb6c7fc78299c003bf446a7b74928de19e27982c75470273bfb",
1769
+ "shortInterestUsingShortToken": "0x2fccdb93b869579e0ab3ba456b425ed1fe0ed3ec3d37e0fb02d1009c928683ef",
1770
+ "longInterestInTokensUsingLongToken": "0x4d0636fc30ec5d0946166825d3529ab8abec7a67dbf2f61d510d1c6a9b69db33",
1771
+ "longInterestInTokensUsingShortToken": "0xf754a35647b4bb1d0994dd139506d074624929e8603afc3d7a036f5c1ec29f4b",
1772
+ "shortInterestInTokensUsingLongToken": "0x2061e3bce5bec7ca22d0e6471341e4426e7e79ab3e1a5ef6b81d97e9acb0a47f",
1773
+ "shortInterestInTokensUsingShortToken": "0x524eee5972856af1944aa29eb2def1352092388483c22dee1afed3a2a622a7f8"
1774
+ },
1775
+ "0x587759c237acCa739bCE3911647BacF56C876E60": {
1776
+ "longPoolAmount": "0x405f450c6837127eea52cb7a5adf5174d032d48569888685d1f3fbbe73aaf4cf",
1777
+ "shortPoolAmount": "0x40b5e0dd2730bf75bccb83c22ef3b10a16caff60c68c82d14d09af6817b49c07",
1778
+ "positionImpactPoolAmount": "0xaa5713894d8e1a2dedc2b80a7e6e0aca11ffeb4516debea1209b8c91f5446b2c",
1779
+ "swapImpactPoolAmountLong": "0x60bc7e3f55cf4de3909d5c2f17bf420bfa968a579d346131a54ebe899b3b70a9",
1780
+ "swapImpactPoolAmountShort": "0x6002e6d197af4ba5bff4a852320894a939f8a7471d466825943d644e15c645bf",
1781
+ "longInterestUsingLongToken": "0xfaada052609aa4aeaee352d2c3653ded1546972dac675a5b0ef493b4b048ecd3",
1782
+ "longInterestUsingShortToken": "0x7828a689f759931f07d41023220ea95f211d8c78ae8ff51170bb662c2f69db3c",
1783
+ "shortInterestUsingLongToken": "0xf19626d23c99a52faf31420ff2d78490fb1d6796c521183cbee86f88f197ff62",
1784
+ "shortInterestUsingShortToken": "0x462ccab88cf00a39ec99b665f5cbddb507d04e1f9f299229418effcada93846f",
1785
+ "longInterestInTokensUsingLongToken": "0x8800845b00a19f74f245101c9c5300b63b580d3c0bedfa753a5c0dadd7a3c685",
1786
+ "longInterestInTokensUsingShortToken": "0x16737a49e9c8e4e4d3d9578a2cffc9d82ecd02cbdb3d1433f7733a5d348d97a4",
1787
+ "shortInterestInTokensUsingLongToken": "0x04b993baa9ecd37570c605022f54e2d6cae7eda955be07f5171e55755cbeb12c",
1788
+ "shortInterestInTokensUsingShortToken": "0xde53ce1b9f4ed36a3385cd7e862002c3a62c865d7e3981f8aa413b293097f5a0"
1789
+ },
1790
+ "0x00310c6d8A9F821e3FE991f4835f2cA4d87034Cf": {
1791
+ "longPoolAmount": "0x2a2e4cd11620eab1b42ba531fed7a20e24945042e4bbedf461731d9664b3f546",
1792
+ "shortPoolAmount": "0x9c04ed781c483037dc9bc153601d926fee1ddb383c1a678ced44310174ba5695",
1793
+ "positionImpactPoolAmount": "0xe02b77f5768c2ff82ccd91f56ec89b8f1b57735919ba6d889b8fa94b0ee0ad44",
1794
+ "swapImpactPoolAmountLong": "0xf4690c0911cd29cb5278909d852155e649f2a0863a9ea9c2e07d7fbf51b00a8e",
1795
+ "swapImpactPoolAmountShort": "0xbd3268b907d7351d5c7288aec636644f2088db232e8c97543c81e280fe8306a9",
1796
+ "longInterestUsingLongToken": "0x7bd795fa61c935e554e40934975be4042b9d8c0896aadf6e527c5ca7fc6db085",
1797
+ "longInterestUsingShortToken": "0x52fd08299b1456da39fa37efb8aa61a82e1ece3194820b1bab016badece6808a",
1798
+ "shortInterestUsingLongToken": "0xbb680a83b92776a2afc7ec3f3678f51636bcf6875fc08a5b900d2b9a5946bd00",
1799
+ "shortInterestUsingShortToken": "0x9a44bf9a70f91c4f9baeb32922722169dea930ddac234a59c9f9479bca9e17de",
1800
+ "longInterestInTokensUsingLongToken": "0x6a99806df5b157c5f981d3024d1642ee5a8a17713ef7d80b4958432553c3a2fa",
1801
+ "longInterestInTokensUsingShortToken": "0x10be684d3b02317e078f4c9f561ad313cbdf6701163346bb271543b58a6cfcc7",
1802
+ "shortInterestInTokensUsingLongToken": "0x74b8efa44465155c5fc9951e7518290fba4cbed2741539562502e86745b04058",
1803
+ "shortInterestInTokensUsingShortToken": "0x344592d78feae63ecf187af3a66c1e0d1b24afc5abdd978cf47dc7fca9928e97"
1759
1804
  }
1760
1805
  },
1761
1806
  "43113": {
@@ -204,6 +204,8 @@ export function mockMarketsInfoData(tokensData, marketKeys, overrides = {}) {
204
204
  swapImpactFactorPositive: expandDecimals(2, 23),
205
205
  swapImpactFactorNegative: expandDecimals(1, 23),
206
206
  swapImpactExponentFactor: expandDecimals(2, 30),
207
+ withdrawalFeeFactorBalanceWasImproved: expandDecimals(2, 27),
208
+ withdrawalFeeFactorBalanceWasNotImproved: expandDecimals(2, 27),
207
209
  // MarketInfo
208
210
  borrowingFactorPerSecondForLongs: 0n,
209
211
  borrowingFactorPerSecondForShorts: 0n,
@@ -0,0 +1 @@
1
+ export {};
@@ -21,11 +21,17 @@ export var OrderType;
21
21
  // @dev StopIncrease: increase position if the triggerPrice is reached and the acceptablePrice can be fulfilled
22
22
  OrderType[OrderType["StopIncrease"] = 8] = "StopIncrease";
23
23
  })(OrderType || (OrderType = {}));
24
+ /**
25
+ * @see https://github.com/gmx-io/gmx-synthetics/blob/a54f774198d79954d66d694af1be479bb6da61f1/contracts/pricing/ISwapPricingUtils.sol#L5
26
+ */
24
27
  export var SwapPricingType;
25
28
  (function (SwapPricingType) {
26
- SwapPricingType[SwapPricingType["TwoStep"] = 0] = "TwoStep";
29
+ SwapPricingType[SwapPricingType["Swap"] = 0] = "Swap";
27
30
  SwapPricingType[SwapPricingType["Shift"] = 1] = "Shift";
28
- SwapPricingType[SwapPricingType["Atomic"] = 2] = "Atomic";
31
+ SwapPricingType[SwapPricingType["AtomicWithdrawal"] = 2] = "AtomicWithdrawal";
32
+ SwapPricingType[SwapPricingType["Deposit"] = 3] = "Deposit";
33
+ SwapPricingType[SwapPricingType["Withdrawal"] = 4] = "Withdrawal";
34
+ SwapPricingType[SwapPricingType["AtomicSwap"] = 5] = "AtomicSwap";
29
35
  })(SwapPricingType || (SwapPricingType = {}));
30
36
  export var DecreasePositionSwapType;
31
37
  (function (DecreasePositionSwapType) {
@@ -1261,6 +1261,12 @@ export var MarketInfoOrderByInput;
1261
1261
  MarketInfoOrderByInput["totalBorrowingFees_DESC"] = "totalBorrowingFees_DESC";
1262
1262
  MarketInfoOrderByInput["totalBorrowingFees_DESC_NULLS_FIRST"] = "totalBorrowingFees_DESC_NULLS_FIRST";
1263
1263
  MarketInfoOrderByInput["totalBorrowingFees_DESC_NULLS_LAST"] = "totalBorrowingFees_DESC_NULLS_LAST";
1264
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_ASC"] = "useOpenInterestInTokensForBalance_ASC";
1265
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_ASC_NULLS_FIRST"] = "useOpenInterestInTokensForBalance_ASC_NULLS_FIRST";
1266
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_ASC_NULLS_LAST"] = "useOpenInterestInTokensForBalance_ASC_NULLS_LAST";
1267
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_DESC"] = "useOpenInterestInTokensForBalance_DESC";
1268
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_DESC_NULLS_FIRST"] = "useOpenInterestInTokensForBalance_DESC_NULLS_FIRST";
1269
+ MarketInfoOrderByInput["useOpenInterestInTokensForBalance_DESC_NULLS_LAST"] = "useOpenInterestInTokensForBalance_DESC_NULLS_LAST";
1264
1270
  MarketInfoOrderByInput["virtualIndexTokenId_ASC"] = "virtualIndexTokenId_ASC";
1265
1271
  MarketInfoOrderByInput["virtualIndexTokenId_ASC_NULLS_FIRST"] = "virtualIndexTokenId_ASC_NULLS_FIRST";
1266
1272
  MarketInfoOrderByInput["virtualIndexTokenId_ASC_NULLS_LAST"] = "virtualIndexTokenId_ASC_NULLS_LAST";
@@ -1961,6 +1967,18 @@ export var PositionChangeOrderByInput;
1961
1967
  PositionChangeOrderByInput["maxSize_DESC"] = "maxSize_DESC";
1962
1968
  PositionChangeOrderByInput["maxSize_DESC_NULLS_FIRST"] = "maxSize_DESC_NULLS_FIRST";
1963
1969
  PositionChangeOrderByInput["maxSize_DESC_NULLS_LAST"] = "maxSize_DESC_NULLS_LAST";
1970
+ PositionChangeOrderByInput["orderKey_ASC"] = "orderKey_ASC";
1971
+ PositionChangeOrderByInput["orderKey_ASC_NULLS_FIRST"] = "orderKey_ASC_NULLS_FIRST";
1972
+ PositionChangeOrderByInput["orderKey_ASC_NULLS_LAST"] = "orderKey_ASC_NULLS_LAST";
1973
+ PositionChangeOrderByInput["orderKey_DESC"] = "orderKey_DESC";
1974
+ PositionChangeOrderByInput["orderKey_DESC_NULLS_FIRST"] = "orderKey_DESC_NULLS_FIRST";
1975
+ PositionChangeOrderByInput["orderKey_DESC_NULLS_LAST"] = "orderKey_DESC_NULLS_LAST";
1976
+ PositionChangeOrderByInput["positionKey_ASC"] = "positionKey_ASC";
1977
+ PositionChangeOrderByInput["positionKey_ASC_NULLS_FIRST"] = "positionKey_ASC_NULLS_FIRST";
1978
+ PositionChangeOrderByInput["positionKey_ASC_NULLS_LAST"] = "positionKey_ASC_NULLS_LAST";
1979
+ PositionChangeOrderByInput["positionKey_DESC"] = "positionKey_DESC";
1980
+ PositionChangeOrderByInput["positionKey_DESC_NULLS_FIRST"] = "positionKey_DESC_NULLS_FIRST";
1981
+ PositionChangeOrderByInput["positionKey_DESC_NULLS_LAST"] = "positionKey_DESC_NULLS_LAST";
1964
1982
  PositionChangeOrderByInput["priceImpactAmount_ASC"] = "priceImpactAmount_ASC";
1965
1983
  PositionChangeOrderByInput["priceImpactAmount_ASC_NULLS_FIRST"] = "priceImpactAmount_ASC_NULLS_FIRST";
1966
1984
  PositionChangeOrderByInput["priceImpactAmount_ASC_NULLS_LAST"] = "priceImpactAmount_ASC_NULLS_LAST";
@@ -1997,6 +2015,12 @@ export var PositionChangeOrderByInput;
1997
2015
  PositionChangeOrderByInput["sizeDeltaUsd_DESC"] = "sizeDeltaUsd_DESC";
1998
2016
  PositionChangeOrderByInput["sizeDeltaUsd_DESC_NULLS_FIRST"] = "sizeDeltaUsd_DESC_NULLS_FIRST";
1999
2017
  PositionChangeOrderByInput["sizeDeltaUsd_DESC_NULLS_LAST"] = "sizeDeltaUsd_DESC_NULLS_LAST";
2018
+ PositionChangeOrderByInput["sizeInTokens_ASC"] = "sizeInTokens_ASC";
2019
+ PositionChangeOrderByInput["sizeInTokens_ASC_NULLS_FIRST"] = "sizeInTokens_ASC_NULLS_FIRST";
2020
+ PositionChangeOrderByInput["sizeInTokens_ASC_NULLS_LAST"] = "sizeInTokens_ASC_NULLS_LAST";
2021
+ PositionChangeOrderByInput["sizeInTokens_DESC"] = "sizeInTokens_DESC";
2022
+ PositionChangeOrderByInput["sizeInTokens_DESC_NULLS_FIRST"] = "sizeInTokens_DESC_NULLS_FIRST";
2023
+ PositionChangeOrderByInput["sizeInTokens_DESC_NULLS_LAST"] = "sizeInTokens_DESC_NULLS_LAST";
2000
2024
  PositionChangeOrderByInput["sizeInUsd_ASC"] = "sizeInUsd_ASC";
2001
2025
  PositionChangeOrderByInput["sizeInUsd_ASC_NULLS_FIRST"] = "sizeInUsd_ASC_NULLS_FIRST";
2002
2026
  PositionChangeOrderByInput["sizeInUsd_ASC_NULLS_LAST"] = "sizeInUsd_ASC_NULLS_LAST";
@@ -2422,6 +2446,45 @@ export var PositionOrderByInput;
2422
2446
  PositionOrderByInput["unrealizedPriceImpact_DESC_NULLS_FIRST"] = "unrealizedPriceImpact_DESC_NULLS_FIRST";
2423
2447
  PositionOrderByInput["unrealizedPriceImpact_DESC_NULLS_LAST"] = "unrealizedPriceImpact_DESC_NULLS_LAST";
2424
2448
  })(PositionOrderByInput || (PositionOrderByInput = {}));
2449
+ export var PositionVolumeInfoOrderByInput;
2450
+ (function (PositionVolumeInfoOrderByInput) {
2451
+ PositionVolumeInfoOrderByInput["collateralToken_ASC"] = "collateralToken_ASC";
2452
+ PositionVolumeInfoOrderByInput["collateralToken_ASC_NULLS_FIRST"] = "collateralToken_ASC_NULLS_FIRST";
2453
+ PositionVolumeInfoOrderByInput["collateralToken_ASC_NULLS_LAST"] = "collateralToken_ASC_NULLS_LAST";
2454
+ PositionVolumeInfoOrderByInput["collateralToken_DESC"] = "collateralToken_DESC";
2455
+ PositionVolumeInfoOrderByInput["collateralToken_DESC_NULLS_FIRST"] = "collateralToken_DESC_NULLS_FIRST";
2456
+ PositionVolumeInfoOrderByInput["collateralToken_DESC_NULLS_LAST"] = "collateralToken_DESC_NULLS_LAST";
2457
+ PositionVolumeInfoOrderByInput["id_ASC"] = "id_ASC";
2458
+ PositionVolumeInfoOrderByInput["id_ASC_NULLS_FIRST"] = "id_ASC_NULLS_FIRST";
2459
+ PositionVolumeInfoOrderByInput["id_ASC_NULLS_LAST"] = "id_ASC_NULLS_LAST";
2460
+ PositionVolumeInfoOrderByInput["id_DESC"] = "id_DESC";
2461
+ PositionVolumeInfoOrderByInput["id_DESC_NULLS_FIRST"] = "id_DESC_NULLS_FIRST";
2462
+ PositionVolumeInfoOrderByInput["id_DESC_NULLS_LAST"] = "id_DESC_NULLS_LAST";
2463
+ PositionVolumeInfoOrderByInput["indexToken_ASC"] = "indexToken_ASC";
2464
+ PositionVolumeInfoOrderByInput["indexToken_ASC_NULLS_FIRST"] = "indexToken_ASC_NULLS_FIRST";
2465
+ PositionVolumeInfoOrderByInput["indexToken_ASC_NULLS_LAST"] = "indexToken_ASC_NULLS_LAST";
2466
+ PositionVolumeInfoOrderByInput["indexToken_DESC"] = "indexToken_DESC";
2467
+ PositionVolumeInfoOrderByInput["indexToken_DESC_NULLS_FIRST"] = "indexToken_DESC_NULLS_FIRST";
2468
+ PositionVolumeInfoOrderByInput["indexToken_DESC_NULLS_LAST"] = "indexToken_DESC_NULLS_LAST";
2469
+ PositionVolumeInfoOrderByInput["period_ASC"] = "period_ASC";
2470
+ PositionVolumeInfoOrderByInput["period_ASC_NULLS_FIRST"] = "period_ASC_NULLS_FIRST";
2471
+ PositionVolumeInfoOrderByInput["period_ASC_NULLS_LAST"] = "period_ASC_NULLS_LAST";
2472
+ PositionVolumeInfoOrderByInput["period_DESC"] = "period_DESC";
2473
+ PositionVolumeInfoOrderByInput["period_DESC_NULLS_FIRST"] = "period_DESC_NULLS_FIRST";
2474
+ PositionVolumeInfoOrderByInput["period_DESC_NULLS_LAST"] = "period_DESC_NULLS_LAST";
2475
+ PositionVolumeInfoOrderByInput["timestamp_ASC"] = "timestamp_ASC";
2476
+ PositionVolumeInfoOrderByInput["timestamp_ASC_NULLS_FIRST"] = "timestamp_ASC_NULLS_FIRST";
2477
+ PositionVolumeInfoOrderByInput["timestamp_ASC_NULLS_LAST"] = "timestamp_ASC_NULLS_LAST";
2478
+ PositionVolumeInfoOrderByInput["timestamp_DESC"] = "timestamp_DESC";
2479
+ PositionVolumeInfoOrderByInput["timestamp_DESC_NULLS_FIRST"] = "timestamp_DESC_NULLS_FIRST";
2480
+ PositionVolumeInfoOrderByInput["timestamp_DESC_NULLS_LAST"] = "timestamp_DESC_NULLS_LAST";
2481
+ PositionVolumeInfoOrderByInput["volumeUsd_ASC"] = "volumeUsd_ASC";
2482
+ PositionVolumeInfoOrderByInput["volumeUsd_ASC_NULLS_FIRST"] = "volumeUsd_ASC_NULLS_FIRST";
2483
+ PositionVolumeInfoOrderByInput["volumeUsd_ASC_NULLS_LAST"] = "volumeUsd_ASC_NULLS_LAST";
2484
+ PositionVolumeInfoOrderByInput["volumeUsd_DESC"] = "volumeUsd_DESC";
2485
+ PositionVolumeInfoOrderByInput["volumeUsd_DESC_NULLS_FIRST"] = "volumeUsd_DESC_NULLS_FIRST";
2486
+ PositionVolumeInfoOrderByInput["volumeUsd_DESC_NULLS_LAST"] = "volumeUsd_DESC_NULLS_LAST";
2487
+ })(PositionVolumeInfoOrderByInput || (PositionVolumeInfoOrderByInput = {}));
2425
2488
  export var PriceOrderByInput;
2426
2489
  (function (PriceOrderByInput) {
2427
2490
  PriceOrderByInput["id_ASC"] = "id_ASC";
@@ -2507,6 +2570,93 @@ export var ProcessorStatusOrderByInput;
2507
2570
  ProcessorStatusOrderByInput["lastProcessorCallTimestamp_DESC_NULLS_FIRST"] = "lastProcessorCallTimestamp_DESC_NULLS_FIRST";
2508
2571
  ProcessorStatusOrderByInput["lastProcessorCallTimestamp_DESC_NULLS_LAST"] = "lastProcessorCallTimestamp_DESC_NULLS_LAST";
2509
2572
  })(ProcessorStatusOrderByInput || (ProcessorStatusOrderByInput = {}));
2573
+ export var SwapFeesInfoOrderByInput;
2574
+ (function (SwapFeesInfoOrderByInput) {
2575
+ SwapFeesInfoOrderByInput["feeReceiverAmount_ASC"] = "feeReceiverAmount_ASC";
2576
+ SwapFeesInfoOrderByInput["feeReceiverAmount_ASC_NULLS_FIRST"] = "feeReceiverAmount_ASC_NULLS_FIRST";
2577
+ SwapFeesInfoOrderByInput["feeReceiverAmount_ASC_NULLS_LAST"] = "feeReceiverAmount_ASC_NULLS_LAST";
2578
+ SwapFeesInfoOrderByInput["feeReceiverAmount_DESC"] = "feeReceiverAmount_DESC";
2579
+ SwapFeesInfoOrderByInput["feeReceiverAmount_DESC_NULLS_FIRST"] = "feeReceiverAmount_DESC_NULLS_FIRST";
2580
+ SwapFeesInfoOrderByInput["feeReceiverAmount_DESC_NULLS_LAST"] = "feeReceiverAmount_DESC_NULLS_LAST";
2581
+ SwapFeesInfoOrderByInput["feeUsdForPool_ASC"] = "feeUsdForPool_ASC";
2582
+ SwapFeesInfoOrderByInput["feeUsdForPool_ASC_NULLS_FIRST"] = "feeUsdForPool_ASC_NULLS_FIRST";
2583
+ SwapFeesInfoOrderByInput["feeUsdForPool_ASC_NULLS_LAST"] = "feeUsdForPool_ASC_NULLS_LAST";
2584
+ SwapFeesInfoOrderByInput["feeUsdForPool_DESC"] = "feeUsdForPool_DESC";
2585
+ SwapFeesInfoOrderByInput["feeUsdForPool_DESC_NULLS_FIRST"] = "feeUsdForPool_DESC_NULLS_FIRST";
2586
+ SwapFeesInfoOrderByInput["feeUsdForPool_DESC_NULLS_LAST"] = "feeUsdForPool_DESC_NULLS_LAST";
2587
+ SwapFeesInfoOrderByInput["id_ASC"] = "id_ASC";
2588
+ SwapFeesInfoOrderByInput["id_ASC_NULLS_FIRST"] = "id_ASC_NULLS_FIRST";
2589
+ SwapFeesInfoOrderByInput["id_ASC_NULLS_LAST"] = "id_ASC_NULLS_LAST";
2590
+ SwapFeesInfoOrderByInput["id_DESC"] = "id_DESC";
2591
+ SwapFeesInfoOrderByInput["id_DESC_NULLS_FIRST"] = "id_DESC_NULLS_FIRST";
2592
+ SwapFeesInfoOrderByInput["id_DESC_NULLS_LAST"] = "id_DESC_NULLS_LAST";
2593
+ SwapFeesInfoOrderByInput["marketAddress_ASC"] = "marketAddress_ASC";
2594
+ SwapFeesInfoOrderByInput["marketAddress_ASC_NULLS_FIRST"] = "marketAddress_ASC_NULLS_FIRST";
2595
+ SwapFeesInfoOrderByInput["marketAddress_ASC_NULLS_LAST"] = "marketAddress_ASC_NULLS_LAST";
2596
+ SwapFeesInfoOrderByInput["marketAddress_DESC"] = "marketAddress_DESC";
2597
+ SwapFeesInfoOrderByInput["marketAddress_DESC_NULLS_FIRST"] = "marketAddress_DESC_NULLS_FIRST";
2598
+ SwapFeesInfoOrderByInput["marketAddress_DESC_NULLS_LAST"] = "marketAddress_DESC_NULLS_LAST";
2599
+ SwapFeesInfoOrderByInput["swapFeeType_ASC"] = "swapFeeType_ASC";
2600
+ SwapFeesInfoOrderByInput["swapFeeType_ASC_NULLS_FIRST"] = "swapFeeType_ASC_NULLS_FIRST";
2601
+ SwapFeesInfoOrderByInput["swapFeeType_ASC_NULLS_LAST"] = "swapFeeType_ASC_NULLS_LAST";
2602
+ SwapFeesInfoOrderByInput["swapFeeType_DESC"] = "swapFeeType_DESC";
2603
+ SwapFeesInfoOrderByInput["swapFeeType_DESC_NULLS_FIRST"] = "swapFeeType_DESC_NULLS_FIRST";
2604
+ SwapFeesInfoOrderByInput["swapFeeType_DESC_NULLS_LAST"] = "swapFeeType_DESC_NULLS_LAST";
2605
+ SwapFeesInfoOrderByInput["tokenAddress_ASC"] = "tokenAddress_ASC";
2606
+ SwapFeesInfoOrderByInput["tokenAddress_ASC_NULLS_FIRST"] = "tokenAddress_ASC_NULLS_FIRST";
2607
+ SwapFeesInfoOrderByInput["tokenAddress_ASC_NULLS_LAST"] = "tokenAddress_ASC_NULLS_LAST";
2608
+ SwapFeesInfoOrderByInput["tokenAddress_DESC"] = "tokenAddress_DESC";
2609
+ SwapFeesInfoOrderByInput["tokenAddress_DESC_NULLS_FIRST"] = "tokenAddress_DESC_NULLS_FIRST";
2610
+ SwapFeesInfoOrderByInput["tokenAddress_DESC_NULLS_LAST"] = "tokenAddress_DESC_NULLS_LAST";
2611
+ SwapFeesInfoOrderByInput["tokenPrice_ASC"] = "tokenPrice_ASC";
2612
+ SwapFeesInfoOrderByInput["tokenPrice_ASC_NULLS_FIRST"] = "tokenPrice_ASC_NULLS_FIRST";
2613
+ SwapFeesInfoOrderByInput["tokenPrice_ASC_NULLS_LAST"] = "tokenPrice_ASC_NULLS_LAST";
2614
+ SwapFeesInfoOrderByInput["tokenPrice_DESC"] = "tokenPrice_DESC";
2615
+ SwapFeesInfoOrderByInput["tokenPrice_DESC_NULLS_FIRST"] = "tokenPrice_DESC_NULLS_FIRST";
2616
+ SwapFeesInfoOrderByInput["tokenPrice_DESC_NULLS_LAST"] = "tokenPrice_DESC_NULLS_LAST";
2617
+ SwapFeesInfoOrderByInput["transaction_blockNumber_ASC"] = "transaction_blockNumber_ASC";
2618
+ SwapFeesInfoOrderByInput["transaction_blockNumber_ASC_NULLS_FIRST"] = "transaction_blockNumber_ASC_NULLS_FIRST";
2619
+ SwapFeesInfoOrderByInput["transaction_blockNumber_ASC_NULLS_LAST"] = "transaction_blockNumber_ASC_NULLS_LAST";
2620
+ SwapFeesInfoOrderByInput["transaction_blockNumber_DESC"] = "transaction_blockNumber_DESC";
2621
+ SwapFeesInfoOrderByInput["transaction_blockNumber_DESC_NULLS_FIRST"] = "transaction_blockNumber_DESC_NULLS_FIRST";
2622
+ SwapFeesInfoOrderByInput["transaction_blockNumber_DESC_NULLS_LAST"] = "transaction_blockNumber_DESC_NULLS_LAST";
2623
+ SwapFeesInfoOrderByInput["transaction_from_ASC"] = "transaction_from_ASC";
2624
+ SwapFeesInfoOrderByInput["transaction_from_ASC_NULLS_FIRST"] = "transaction_from_ASC_NULLS_FIRST";
2625
+ SwapFeesInfoOrderByInput["transaction_from_ASC_NULLS_LAST"] = "transaction_from_ASC_NULLS_LAST";
2626
+ SwapFeesInfoOrderByInput["transaction_from_DESC"] = "transaction_from_DESC";
2627
+ SwapFeesInfoOrderByInput["transaction_from_DESC_NULLS_FIRST"] = "transaction_from_DESC_NULLS_FIRST";
2628
+ SwapFeesInfoOrderByInput["transaction_from_DESC_NULLS_LAST"] = "transaction_from_DESC_NULLS_LAST";
2629
+ SwapFeesInfoOrderByInput["transaction_hash_ASC"] = "transaction_hash_ASC";
2630
+ SwapFeesInfoOrderByInput["transaction_hash_ASC_NULLS_FIRST"] = "transaction_hash_ASC_NULLS_FIRST";
2631
+ SwapFeesInfoOrderByInput["transaction_hash_ASC_NULLS_LAST"] = "transaction_hash_ASC_NULLS_LAST";
2632
+ SwapFeesInfoOrderByInput["transaction_hash_DESC"] = "transaction_hash_DESC";
2633
+ SwapFeesInfoOrderByInput["transaction_hash_DESC_NULLS_FIRST"] = "transaction_hash_DESC_NULLS_FIRST";
2634
+ SwapFeesInfoOrderByInput["transaction_hash_DESC_NULLS_LAST"] = "transaction_hash_DESC_NULLS_LAST";
2635
+ SwapFeesInfoOrderByInput["transaction_id_ASC"] = "transaction_id_ASC";
2636
+ SwapFeesInfoOrderByInput["transaction_id_ASC_NULLS_FIRST"] = "transaction_id_ASC_NULLS_FIRST";
2637
+ SwapFeesInfoOrderByInput["transaction_id_ASC_NULLS_LAST"] = "transaction_id_ASC_NULLS_LAST";
2638
+ SwapFeesInfoOrderByInput["transaction_id_DESC"] = "transaction_id_DESC";
2639
+ SwapFeesInfoOrderByInput["transaction_id_DESC_NULLS_FIRST"] = "transaction_id_DESC_NULLS_FIRST";
2640
+ SwapFeesInfoOrderByInput["transaction_id_DESC_NULLS_LAST"] = "transaction_id_DESC_NULLS_LAST";
2641
+ SwapFeesInfoOrderByInput["transaction_timestamp_ASC"] = "transaction_timestamp_ASC";
2642
+ SwapFeesInfoOrderByInput["transaction_timestamp_ASC_NULLS_FIRST"] = "transaction_timestamp_ASC_NULLS_FIRST";
2643
+ SwapFeesInfoOrderByInput["transaction_timestamp_ASC_NULLS_LAST"] = "transaction_timestamp_ASC_NULLS_LAST";
2644
+ SwapFeesInfoOrderByInput["transaction_timestamp_DESC"] = "transaction_timestamp_DESC";
2645
+ SwapFeesInfoOrderByInput["transaction_timestamp_DESC_NULLS_FIRST"] = "transaction_timestamp_DESC_NULLS_FIRST";
2646
+ SwapFeesInfoOrderByInput["transaction_timestamp_DESC_NULLS_LAST"] = "transaction_timestamp_DESC_NULLS_LAST";
2647
+ SwapFeesInfoOrderByInput["transaction_to_ASC"] = "transaction_to_ASC";
2648
+ SwapFeesInfoOrderByInput["transaction_to_ASC_NULLS_FIRST"] = "transaction_to_ASC_NULLS_FIRST";
2649
+ SwapFeesInfoOrderByInput["transaction_to_ASC_NULLS_LAST"] = "transaction_to_ASC_NULLS_LAST";
2650
+ SwapFeesInfoOrderByInput["transaction_to_DESC"] = "transaction_to_DESC";
2651
+ SwapFeesInfoOrderByInput["transaction_to_DESC_NULLS_FIRST"] = "transaction_to_DESC_NULLS_FIRST";
2652
+ SwapFeesInfoOrderByInput["transaction_to_DESC_NULLS_LAST"] = "transaction_to_DESC_NULLS_LAST";
2653
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_ASC"] = "transaction_transactionIndex_ASC";
2654
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_ASC_NULLS_FIRST"] = "transaction_transactionIndex_ASC_NULLS_FIRST";
2655
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_ASC_NULLS_LAST"] = "transaction_transactionIndex_ASC_NULLS_LAST";
2656
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_DESC"] = "transaction_transactionIndex_DESC";
2657
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_DESC_NULLS_FIRST"] = "transaction_transactionIndex_DESC_NULLS_FIRST";
2658
+ SwapFeesInfoOrderByInput["transaction_transactionIndex_DESC_NULLS_LAST"] = "transaction_transactionIndex_DESC_NULLS_LAST";
2659
+ })(SwapFeesInfoOrderByInput || (SwapFeesInfoOrderByInput = {}));
2510
2660
  export var SwapInfoOrderByInput;
2511
2661
  (function (SwapInfoOrderByInput) {
2512
2662
  SwapInfoOrderByInput["amountInAfterFees_ASC"] = "amountInAfterFees_ASC";
@@ -2624,6 +2774,45 @@ export var SwapInfoOrderByInput;
2624
2774
  SwapInfoOrderByInput["transaction_transactionIndex_DESC_NULLS_FIRST"] = "transaction_transactionIndex_DESC_NULLS_FIRST";
2625
2775
  SwapInfoOrderByInput["transaction_transactionIndex_DESC_NULLS_LAST"] = "transaction_transactionIndex_DESC_NULLS_LAST";
2626
2776
  })(SwapInfoOrderByInput || (SwapInfoOrderByInput = {}));
2777
+ export var SwapVolumeInfoOrderByInput;
2778
+ (function (SwapVolumeInfoOrderByInput) {
2779
+ SwapVolumeInfoOrderByInput["id_ASC"] = "id_ASC";
2780
+ SwapVolumeInfoOrderByInput["id_ASC_NULLS_FIRST"] = "id_ASC_NULLS_FIRST";
2781
+ SwapVolumeInfoOrderByInput["id_ASC_NULLS_LAST"] = "id_ASC_NULLS_LAST";
2782
+ SwapVolumeInfoOrderByInput["id_DESC"] = "id_DESC";
2783
+ SwapVolumeInfoOrderByInput["id_DESC_NULLS_FIRST"] = "id_DESC_NULLS_FIRST";
2784
+ SwapVolumeInfoOrderByInput["id_DESC_NULLS_LAST"] = "id_DESC_NULLS_LAST";
2785
+ SwapVolumeInfoOrderByInput["period_ASC"] = "period_ASC";
2786
+ SwapVolumeInfoOrderByInput["period_ASC_NULLS_FIRST"] = "period_ASC_NULLS_FIRST";
2787
+ SwapVolumeInfoOrderByInput["period_ASC_NULLS_LAST"] = "period_ASC_NULLS_LAST";
2788
+ SwapVolumeInfoOrderByInput["period_DESC"] = "period_DESC";
2789
+ SwapVolumeInfoOrderByInput["period_DESC_NULLS_FIRST"] = "period_DESC_NULLS_FIRST";
2790
+ SwapVolumeInfoOrderByInput["period_DESC_NULLS_LAST"] = "period_DESC_NULLS_LAST";
2791
+ SwapVolumeInfoOrderByInput["timestamp_ASC"] = "timestamp_ASC";
2792
+ SwapVolumeInfoOrderByInput["timestamp_ASC_NULLS_FIRST"] = "timestamp_ASC_NULLS_FIRST";
2793
+ SwapVolumeInfoOrderByInput["timestamp_ASC_NULLS_LAST"] = "timestamp_ASC_NULLS_LAST";
2794
+ SwapVolumeInfoOrderByInput["timestamp_DESC"] = "timestamp_DESC";
2795
+ SwapVolumeInfoOrderByInput["timestamp_DESC_NULLS_FIRST"] = "timestamp_DESC_NULLS_FIRST";
2796
+ SwapVolumeInfoOrderByInput["timestamp_DESC_NULLS_LAST"] = "timestamp_DESC_NULLS_LAST";
2797
+ SwapVolumeInfoOrderByInput["tokenIn_ASC"] = "tokenIn_ASC";
2798
+ SwapVolumeInfoOrderByInput["tokenIn_ASC_NULLS_FIRST"] = "tokenIn_ASC_NULLS_FIRST";
2799
+ SwapVolumeInfoOrderByInput["tokenIn_ASC_NULLS_LAST"] = "tokenIn_ASC_NULLS_LAST";
2800
+ SwapVolumeInfoOrderByInput["tokenIn_DESC"] = "tokenIn_DESC";
2801
+ SwapVolumeInfoOrderByInput["tokenIn_DESC_NULLS_FIRST"] = "tokenIn_DESC_NULLS_FIRST";
2802
+ SwapVolumeInfoOrderByInput["tokenIn_DESC_NULLS_LAST"] = "tokenIn_DESC_NULLS_LAST";
2803
+ SwapVolumeInfoOrderByInput["tokenOut_ASC"] = "tokenOut_ASC";
2804
+ SwapVolumeInfoOrderByInput["tokenOut_ASC_NULLS_FIRST"] = "tokenOut_ASC_NULLS_FIRST";
2805
+ SwapVolumeInfoOrderByInput["tokenOut_ASC_NULLS_LAST"] = "tokenOut_ASC_NULLS_LAST";
2806
+ SwapVolumeInfoOrderByInput["tokenOut_DESC"] = "tokenOut_DESC";
2807
+ SwapVolumeInfoOrderByInput["tokenOut_DESC_NULLS_FIRST"] = "tokenOut_DESC_NULLS_FIRST";
2808
+ SwapVolumeInfoOrderByInput["tokenOut_DESC_NULLS_LAST"] = "tokenOut_DESC_NULLS_LAST";
2809
+ SwapVolumeInfoOrderByInput["volumeUsd_ASC"] = "volumeUsd_ASC";
2810
+ SwapVolumeInfoOrderByInput["volumeUsd_ASC_NULLS_FIRST"] = "volumeUsd_ASC_NULLS_FIRST";
2811
+ SwapVolumeInfoOrderByInput["volumeUsd_ASC_NULLS_LAST"] = "volumeUsd_ASC_NULLS_LAST";
2812
+ SwapVolumeInfoOrderByInput["volumeUsd_DESC"] = "volumeUsd_DESC";
2813
+ SwapVolumeInfoOrderByInput["volumeUsd_DESC_NULLS_FIRST"] = "volumeUsd_DESC_NULLS_FIRST";
2814
+ SwapVolumeInfoOrderByInput["volumeUsd_DESC_NULLS_LAST"] = "volumeUsd_DESC_NULLS_LAST";
2815
+ })(SwapVolumeInfoOrderByInput || (SwapVolumeInfoOrderByInput = {}));
2627
2816
  export var TradeActionOrderByInput;
2628
2817
  (function (TradeActionOrderByInput) {
2629
2818
  TradeActionOrderByInput["acceptablePrice_ASC"] = "acceptablePrice_ASC";
@@ -2972,3 +3161,54 @@ export var TransactionOrderByInput;
2972
3161
  TransactionOrderByInput["transactionIndex_DESC_NULLS_FIRST"] = "transactionIndex_DESC_NULLS_FIRST";
2973
3162
  TransactionOrderByInput["transactionIndex_DESC_NULLS_LAST"] = "transactionIndex_DESC_NULLS_LAST";
2974
3163
  })(TransactionOrderByInput || (TransactionOrderByInput = {}));
3164
+ export var VolumeInfoOrderByInput;
3165
+ (function (VolumeInfoOrderByInput) {
3166
+ VolumeInfoOrderByInput["depositVolumeUsd_ASC"] = "depositVolumeUsd_ASC";
3167
+ VolumeInfoOrderByInput["depositVolumeUsd_ASC_NULLS_FIRST"] = "depositVolumeUsd_ASC_NULLS_FIRST";
3168
+ VolumeInfoOrderByInput["depositVolumeUsd_ASC_NULLS_LAST"] = "depositVolumeUsd_ASC_NULLS_LAST";
3169
+ VolumeInfoOrderByInput["depositVolumeUsd_DESC"] = "depositVolumeUsd_DESC";
3170
+ VolumeInfoOrderByInput["depositVolumeUsd_DESC_NULLS_FIRST"] = "depositVolumeUsd_DESC_NULLS_FIRST";
3171
+ VolumeInfoOrderByInput["depositVolumeUsd_DESC_NULLS_LAST"] = "depositVolumeUsd_DESC_NULLS_LAST";
3172
+ VolumeInfoOrderByInput["id_ASC"] = "id_ASC";
3173
+ VolumeInfoOrderByInput["id_ASC_NULLS_FIRST"] = "id_ASC_NULLS_FIRST";
3174
+ VolumeInfoOrderByInput["id_ASC_NULLS_LAST"] = "id_ASC_NULLS_LAST";
3175
+ VolumeInfoOrderByInput["id_DESC"] = "id_DESC";
3176
+ VolumeInfoOrderByInput["id_DESC_NULLS_FIRST"] = "id_DESC_NULLS_FIRST";
3177
+ VolumeInfoOrderByInput["id_DESC_NULLS_LAST"] = "id_DESC_NULLS_LAST";
3178
+ VolumeInfoOrderByInput["marginVolumeUsd_ASC"] = "marginVolumeUsd_ASC";
3179
+ VolumeInfoOrderByInput["marginVolumeUsd_ASC_NULLS_FIRST"] = "marginVolumeUsd_ASC_NULLS_FIRST";
3180
+ VolumeInfoOrderByInput["marginVolumeUsd_ASC_NULLS_LAST"] = "marginVolumeUsd_ASC_NULLS_LAST";
3181
+ VolumeInfoOrderByInput["marginVolumeUsd_DESC"] = "marginVolumeUsd_DESC";
3182
+ VolumeInfoOrderByInput["marginVolumeUsd_DESC_NULLS_FIRST"] = "marginVolumeUsd_DESC_NULLS_FIRST";
3183
+ VolumeInfoOrderByInput["marginVolumeUsd_DESC_NULLS_LAST"] = "marginVolumeUsd_DESC_NULLS_LAST";
3184
+ VolumeInfoOrderByInput["period_ASC"] = "period_ASC";
3185
+ VolumeInfoOrderByInput["period_ASC_NULLS_FIRST"] = "period_ASC_NULLS_FIRST";
3186
+ VolumeInfoOrderByInput["period_ASC_NULLS_LAST"] = "period_ASC_NULLS_LAST";
3187
+ VolumeInfoOrderByInput["period_DESC"] = "period_DESC";
3188
+ VolumeInfoOrderByInput["period_DESC_NULLS_FIRST"] = "period_DESC_NULLS_FIRST";
3189
+ VolumeInfoOrderByInput["period_DESC_NULLS_LAST"] = "period_DESC_NULLS_LAST";
3190
+ VolumeInfoOrderByInput["swapVolumeUsd_ASC"] = "swapVolumeUsd_ASC";
3191
+ VolumeInfoOrderByInput["swapVolumeUsd_ASC_NULLS_FIRST"] = "swapVolumeUsd_ASC_NULLS_FIRST";
3192
+ VolumeInfoOrderByInput["swapVolumeUsd_ASC_NULLS_LAST"] = "swapVolumeUsd_ASC_NULLS_LAST";
3193
+ VolumeInfoOrderByInput["swapVolumeUsd_DESC"] = "swapVolumeUsd_DESC";
3194
+ VolumeInfoOrderByInput["swapVolumeUsd_DESC_NULLS_FIRST"] = "swapVolumeUsd_DESC_NULLS_FIRST";
3195
+ VolumeInfoOrderByInput["swapVolumeUsd_DESC_NULLS_LAST"] = "swapVolumeUsd_DESC_NULLS_LAST";
3196
+ VolumeInfoOrderByInput["timestamp_ASC"] = "timestamp_ASC";
3197
+ VolumeInfoOrderByInput["timestamp_ASC_NULLS_FIRST"] = "timestamp_ASC_NULLS_FIRST";
3198
+ VolumeInfoOrderByInput["timestamp_ASC_NULLS_LAST"] = "timestamp_ASC_NULLS_LAST";
3199
+ VolumeInfoOrderByInput["timestamp_DESC"] = "timestamp_DESC";
3200
+ VolumeInfoOrderByInput["timestamp_DESC_NULLS_FIRST"] = "timestamp_DESC_NULLS_FIRST";
3201
+ VolumeInfoOrderByInput["timestamp_DESC_NULLS_LAST"] = "timestamp_DESC_NULLS_LAST";
3202
+ VolumeInfoOrderByInput["volumeUsd_ASC"] = "volumeUsd_ASC";
3203
+ VolumeInfoOrderByInput["volumeUsd_ASC_NULLS_FIRST"] = "volumeUsd_ASC_NULLS_FIRST";
3204
+ VolumeInfoOrderByInput["volumeUsd_ASC_NULLS_LAST"] = "volumeUsd_ASC_NULLS_LAST";
3205
+ VolumeInfoOrderByInput["volumeUsd_DESC"] = "volumeUsd_DESC";
3206
+ VolumeInfoOrderByInput["volumeUsd_DESC_NULLS_FIRST"] = "volumeUsd_DESC_NULLS_FIRST";
3207
+ VolumeInfoOrderByInput["volumeUsd_DESC_NULLS_LAST"] = "volumeUsd_DESC_NULLS_LAST";
3208
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_ASC"] = "withdrawalVolumeUsd_ASC";
3209
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_ASC_NULLS_FIRST"] = "withdrawalVolumeUsd_ASC_NULLS_FIRST";
3210
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_ASC_NULLS_LAST"] = "withdrawalVolumeUsd_ASC_NULLS_LAST";
3211
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_DESC"] = "withdrawalVolumeUsd_DESC";
3212
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_DESC_NULLS_FIRST"] = "withdrawalVolumeUsd_DESC_NULLS_FIRST";
3213
+ VolumeInfoOrderByInput["withdrawalVolumeUsd_DESC_NULLS_LAST"] = "withdrawalVolumeUsd_DESC_NULLS_LAST";
3214
+ })(VolumeInfoOrderByInput || (VolumeInfoOrderByInput = {}));
@@ -1 +1,6 @@
1
- export {};
1
+ export var TokenBalanceType;
2
+ (function (TokenBalanceType) {
3
+ TokenBalanceType[TokenBalanceType["Wallet"] = 0] = "Wallet";
4
+ TokenBalanceType[TokenBalanceType["GmxAccount"] = 1] = "GmxAccount";
5
+ TokenBalanceType[TokenBalanceType["SourceChain"] = 2] = "SourceChain";
6
+ })(TokenBalanceType || (TokenBalanceType = {}));
@@ -0,0 +1,120 @@
1
+ import { describe, expect, it, vi } from "vitest";
2
+ import { combineAbortSignals } from "../abort";
3
+ describe("combineAbortSignals", () => {
4
+ it("should return an AbortController", () => {
5
+ const controller1 = new AbortController();
6
+ const controller2 = new AbortController();
7
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
8
+ expect(combined).toBeInstanceOf(AbortController);
9
+ expect(combined.signal.aborted).toBe(false);
10
+ });
11
+ it("should abort combined controller when first signal is aborted", () => {
12
+ const controller1 = new AbortController();
13
+ const controller2 = new AbortController();
14
+ controller1.abort();
15
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
16
+ expect(combined.signal.aborted).toBe(true);
17
+ });
18
+ it("should abort combined controller when second signal is aborted", () => {
19
+ const controller1 = new AbortController();
20
+ const controller2 = new AbortController();
21
+ controller2.abort();
22
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
23
+ expect(combined.signal.aborted).toBe(true);
24
+ });
25
+ it("should abort combined controller when any signal is aborted after creation", () => {
26
+ const controller1 = new AbortController();
27
+ const controller2 = new AbortController();
28
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
29
+ expect(combined.signal.aborted).toBe(false);
30
+ controller1.abort();
31
+ expect(combined.signal.aborted).toBe(true);
32
+ });
33
+ it("should abort combined controller when multiple signals are aborted", () => {
34
+ const controller1 = new AbortController();
35
+ const controller2 = new AbortController();
36
+ const controller3 = new AbortController();
37
+ const combined = combineAbortSignals(controller1.signal, controller2.signal, controller3.signal);
38
+ expect(combined.signal.aborted).toBe(false);
39
+ controller2.abort();
40
+ expect(combined.signal.aborted).toBe(true);
41
+ });
42
+ it("should clean up event listeners when combined controller is aborted", () => {
43
+ const controller1 = new AbortController();
44
+ const controller2 = new AbortController();
45
+ const removeEventListener1 = vi.spyOn(controller1.signal, "removeEventListener");
46
+ const removeEventListener2 = vi.spyOn(controller2.signal, "removeEventListener");
47
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
48
+ combined.abort();
49
+ expect(removeEventListener1).toHaveBeenCalled();
50
+ expect(removeEventListener2).toHaveBeenCalled();
51
+ });
52
+ it("should clean up event listeners when source signal is aborted", () => {
53
+ const controller1 = new AbortController();
54
+ const controller2 = new AbortController();
55
+ const removeEventListener1 = vi.spyOn(controller1.signal, "removeEventListener");
56
+ const removeEventListener2 = vi.spyOn(controller2.signal, "removeEventListener");
57
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
58
+ controller1.abort();
59
+ expect(combined.signal.aborted).toBe(true);
60
+ expect(removeEventListener1).toHaveBeenCalled();
61
+ expect(removeEventListener2).toHaveBeenCalled();
62
+ });
63
+ it("should work with single signal", () => {
64
+ const controller = new AbortController();
65
+ const combined = combineAbortSignals(controller.signal);
66
+ expect(combined.signal.aborted).toBe(false);
67
+ controller.abort();
68
+ expect(combined.signal.aborted).toBe(true);
69
+ });
70
+ it("should work with empty array", () => {
71
+ const combined = combineAbortSignals();
72
+ expect(combined).toBeInstanceOf(AbortController);
73
+ expect(combined.signal.aborted).toBe(false);
74
+ });
75
+ it("should handle multiple aborts gracefully", () => {
76
+ const controller1 = new AbortController();
77
+ const controller2 = new AbortController();
78
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
79
+ controller1.abort();
80
+ controller2.abort();
81
+ expect(combined.signal.aborted).toBe(true);
82
+ });
83
+ it("should not leak memory when signals are aborted multiple times", () => {
84
+ const controller1 = new AbortController();
85
+ const controller2 = new AbortController();
86
+ const removeEventListener1 = vi.spyOn(controller1.signal, "removeEventListener");
87
+ const removeEventListener2 = vi.spyOn(controller2.signal, "removeEventListener");
88
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
89
+ controller1.abort();
90
+ controller2.abort();
91
+ combined.abort();
92
+ const callCount1 = removeEventListener1.mock.calls.length;
93
+ const callCount2 = removeEventListener2.mock.calls.length;
94
+ expect(callCount1).toBeGreaterThan(0);
95
+ expect(callCount2).toBeGreaterThan(0);
96
+ });
97
+ it("should clean up listeners when later signal is already aborted", () => {
98
+ const controller1 = new AbortController();
99
+ const controller2 = new AbortController();
100
+ controller2.abort();
101
+ const removeEventListener1 = vi.spyOn(controller1.signal, "removeEventListener");
102
+ const addEventListener1 = vi.spyOn(controller1.signal, "addEventListener");
103
+ const combined = combineAbortSignals(controller1.signal, controller2.signal);
104
+ expect(combined.signal.aborted).toBe(true);
105
+ expect(addEventListener1).toHaveBeenCalled();
106
+ expect(removeEventListener1).toHaveBeenCalled();
107
+ });
108
+ it("should clean up listeners when middle signal is already aborted", () => {
109
+ const controller1 = new AbortController();
110
+ const controller2 = new AbortController();
111
+ const controller3 = new AbortController();
112
+ controller2.abort();
113
+ const removeEventListener1 = vi.spyOn(controller1.signal, "removeEventListener");
114
+ const addEventListener1 = vi.spyOn(controller1.signal, "addEventListener");
115
+ const combined = combineAbortSignals(controller1.signal, controller2.signal, controller3.signal);
116
+ expect(combined.signal.aborted).toBe(true);
117
+ expect(addEventListener1).toHaveBeenCalled();
118
+ expect(removeEventListener1).toHaveBeenCalled();
119
+ });
120
+ });