lynx-client 0.0.2 → 0.0.3

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 (142) hide show
  1. package/README.md +0 -1
  2. package/dist/cjs/index.js +1 -0
  3. package/dist/cjs/lib/addresses/lensAddresses.js +16 -16
  4. package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +0 -13
  5. package/dist/cjs/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +6 -26
  6. package/dist/cjs/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +0 -1
  7. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +3 -7
  8. package/dist/cjs/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +11 -47
  9. package/dist/cjs/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +28 -9
  10. package/dist/cjs/lib/contractsIntegration/TradingFloorService/index.js +5 -0
  11. package/dist/cjs/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.js +2 -0
  12. package/dist/cjs/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.js +2 -0
  13. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1854 -0
  14. package/dist/cjs/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  15. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  16. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +78 -6
  17. package/dist/cjs/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +297 -80
  18. package/dist/cjs/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  19. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +10 -109
  20. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
  21. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +51 -594
  22. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  23. package/dist/cjs/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.js +334 -0
  24. package/dist/esm/index.d.ts +1 -0
  25. package/dist/esm/index.d.ts.map +1 -1
  26. package/dist/esm/index.js +1 -0
  27. package/dist/esm/lib/addresses/lensAddresses.d.ts +16 -16
  28. package/dist/esm/lib/addresses/lensAddresses.js +16 -16
  29. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +3 -16
  30. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -1
  31. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.js +0 -13
  32. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +5 -5
  33. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -1
  34. package/dist/esm/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.js +6 -26
  35. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +0 -1
  36. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -1
  37. package/dist/esm/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.js +0 -1
  38. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +10 -21
  39. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  40. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.js +3 -7
  41. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +1 -4
  42. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  43. package/dist/esm/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.js +11 -47
  44. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +10 -4
  45. package/dist/esm/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  46. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +10 -4
  47. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  48. package/dist/esm/lib/contractsIntegration/TradingFloorService/TradingFloorService.js +28 -9
  49. package/dist/esm/lib/contractsIntegration/TradingFloorService/index.d.ts +3 -0
  50. package/dist/esm/lib/contractsIntegration/TradingFloorService/index.d.ts.map +1 -0
  51. package/dist/esm/lib/contractsIntegration/TradingFloorService/index.js +5 -0
  52. package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts +1084 -0
  53. package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts.map +1 -0
  54. package/dist/esm/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.js +2 -0
  55. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +42 -6
  56. package/dist/esm/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -1
  57. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +150 -59
  58. package/dist/esm/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  59. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +10 -65
  60. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -1
  61. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +34 -112
  62. package/dist/esm/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  63. package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts +158 -0
  64. package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts.map +1 -0
  65. package/dist/esm/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.js +2 -0
  66. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1425 -0
  67. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts.map +1 -0
  68. package/dist/esm/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.js +1854 -0
  69. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  70. package/dist/esm/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.js +1 -1
  71. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  72. package/dist/esm/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.js +1 -1
  73. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +60 -5
  74. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -1
  75. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.js +78 -6
  76. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +226 -64
  77. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  78. package/dist/esm/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.js +297 -80
  79. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  80. package/dist/esm/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.js +1 -1
  81. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +10 -85
  82. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -1
  83. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.js +10 -109
  84. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  85. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.js +1 -1
  86. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +13 -442
  87. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  88. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.js +51 -594
  89. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  90. package/dist/esm/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.js +1 -1
  91. package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts +251 -0
  92. package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts.map +1 -0
  93. package/dist/esm/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.js +334 -0
  94. package/dist/types/index.d.ts +1 -0
  95. package/dist/types/index.d.ts.map +1 -1
  96. package/dist/types/lib/addresses/lensAddresses.d.ts +16 -16
  97. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts +3 -16
  98. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IIntentsVerifierLensService.d.ts.map +1 -1
  99. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts +5 -5
  100. package/dist/types/lib/contractsIntegration/IntentsVerifierLensService/IntentsVerifierLensService.d.ts.map +1 -1
  101. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts +0 -1
  102. package/dist/types/lib/contractsIntegration/TradersPortalService/TradersPortalUtils.d.ts.map +1 -1
  103. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts +10 -21
  104. package/dist/types/lib/contractsIntegration/TradingFloorLensService/ITradingFloorLensService.d.ts.map +1 -1
  105. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts +1 -4
  106. package/dist/types/lib/contractsIntegration/TradingFloorLensService/TradingFloorLensService.d.ts.map +1 -1
  107. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts +10 -4
  108. package/dist/types/lib/contractsIntegration/TradingFloorService/ITradingFloorService.d.ts.map +1 -1
  109. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts +10 -4
  110. package/dist/types/lib/contractsIntegration/TradingFloorService/TradingFloorService.d.ts.map +1 -1
  111. package/dist/types/lib/contractsIntegration/TradingFloorService/index.d.ts +3 -0
  112. package/dist/types/lib/contractsIntegration/TradingFloorService/index.d.ts.map +1 -0
  113. package/dist/types/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts +1084 -0
  114. package/dist/types/lib/typechain/contracts/Lynx/Lex/LexPool/LexPoolV1.d.ts.map +1 -0
  115. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts +42 -6
  116. package/dist/types/lib/typechain/contracts/Lynx/TradersPortal/TradersPortalV1.d.ts.map +1 -1
  117. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts +150 -59
  118. package/dist/types/lib/typechain/contracts/Lynx/TradingFloor/TradingFloorV1.d.ts.map +1 -1
  119. package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts +10 -65
  120. package/dist/types/lib/typechain/contracts/Peripheral/Lens/IntentsVerifierLens.d.ts.map +1 -1
  121. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts +34 -112
  122. package/dist/types/lib/typechain/contracts/Peripheral/Lens/TradingFloorLens.d.ts.map +1 -1
  123. package/dist/types/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts +158 -0
  124. package/dist/types/lib/typechain/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor.d.ts.map +1 -0
  125. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts +1425 -0
  126. package/dist/types/lib/typechain/factories/contracts/Lynx/Lex/LexPool/LexPoolV1__factory.d.ts.map +1 -0
  127. package/dist/types/lib/typechain/factories/contracts/Lynx/OrderBook/OrderBookV1__factory.d.ts +1 -1
  128. package/dist/types/lib/typechain/factories/contracts/Lynx/Registry/RegistryV1__factory.d.ts +1 -1
  129. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts +60 -5
  130. package/dist/types/lib/typechain/factories/contracts/Lynx/TradersPortal/TradersPortalV1__factory.d.ts.map +1 -1
  131. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts +226 -64
  132. package/dist/types/lib/typechain/factories/contracts/Lynx/TradingFloor/TradingFloorV1__factory.d.ts.map +1 -1
  133. package/dist/types/lib/typechain/factories/contracts/Lynx/Triggers/TriggersV1__factory.d.ts +1 -1
  134. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts +10 -85
  135. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory.d.ts.map +1 -1
  136. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/LexLens__factory.d.ts +1 -1
  137. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts +13 -442
  138. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TradingFloorLens__factory.d.ts.map +1 -1
  139. package/dist/types/lib/typechain/factories/contracts/Peripheral/Lens/TriggersAndPortalLens__factory.d.ts +1 -1
  140. package/dist/types/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts +251 -0
  141. package/dist/types/lib/typechain/factories/contracts/Peripheral/TokensDistribution/SinglePhaseSingleTokenDistributor/SinglePhaseSingleTokenDistributor__factory.d.ts.map +1 -0
  142. package/package.json +1 -1
package/README.md CHANGED
@@ -105,7 +105,6 @@ const identifier = buildPositionRequestIdentifier({
105
105
  trader: await signer.getAddress(),
106
106
  pairId: 1, // BTC/USD
107
107
  settlementAsset: "0x...", // USDC address
108
- positionIndex: 0
109
108
  });
110
109
 
111
110
  const params = buildPositionRequestParams({
package/dist/cjs/index.js CHANGED
@@ -39,6 +39,7 @@ __exportStar(require("./lib/addresses/lensAddresses"), exports);
39
39
  __exportStar(require("./lib/addresses/systemAddresses"), exports);
40
40
  __exportStar(require("./lib/contractsIntegration/deployedContractsConnector"), exports);
41
41
  __exportStar(require("./lib/contractsIntegration/TradersPortalService"), exports);
42
+ __exportStar(require("./lib/contractsIntegration/TradingFloorService"), exports);
42
43
  __exportStar(require("./lib/contractsIntegration/IntentsVerifierLensService"), exports);
43
44
  __exportStar(require("./lib/contractsIntegration/TriggersAndPortalLensService"), exports);
44
45
  __exportStar(require("./lib/contractsIntegration/TradingFloorLensService"), exports);
@@ -3,27 +3,27 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LensAddresses = void 0;
4
4
  exports.LensAddresses = {
5
5
  boba: {
6
- lexLens: "0xCcFaDF4E72d5b2D382555E0eb72a1BF6F7f0EF7F",
7
- tradingFloorLensLens: "0xed9D263917921cb5f0B9a59c5083beA4075F33e7",
8
- intentsVerifierLens: "0x8F33670B7a076793D178D340AD70Cc097DD03739",
9
- triggersAndPortalLens: "0xA03312361D07dfAe0C517a441C69BFA9E84e38bf",
6
+ intentsVerifierLens: "0x7DfA2F609573AB8eD8cA231498FF4E8f1e7d31Fa",
7
+ lexLens: "0xE4Ebc518A2Fb771057E8E1e85296a72a4587e11E",
8
+ tradingFloorLensLens: "0x7f68e8Ba4176683594342d9C39De22b93daC45E3",
9
+ triggersAndPortalLens: "0x5c3d344C24e4Cd7DDCdd15C660095FFb160d42e5",
10
10
  },
11
11
  sonic: {
12
- lexLens: "0xBcb1D4ACbc844ba5FC0aA411b98aebD4A508B65F",
13
- tradingFloorLensLens: "0xa5802951D972372f1385e9Ac83df738b3323d0A8",
14
- intentsVerifierLens: "0xDBe9130AAe593Ec73a838ce286fa84c193bceFA1",
15
- triggersAndPortalLens: "0xaA96df0a4F01212169c2347dc23D5AEb89924839",
12
+ intentsVerifierLens: "0x0C1Fcd85856b5564a87ae378336b7CC0c139C5f7",
13
+ lexLens: "0xc8939875FeC9a0A2f1757272165f8F53659C47c4",
14
+ tradingFloorLensLens: "0x50631a46BEe1E63e46C3eDceE3d5af33E5904681",
15
+ triggersAndPortalLens: "0x7976e6E8145a11aB17D61497dfa0524999Ab6d3c",
16
16
  },
17
17
  fantom: {
18
- lexLens: "0xB5A5041654391a720953D346367D3A3BE9c3d47B",
19
- tradingFloorLensLens: "0x2B913d10452c93Bb7184B5B4fb7e3724452fE0fB",
20
- intentsVerifierLens: "0x5cf3613de36106C10674778C5748FAf9630c3D94",
21
- triggersAndPortalLens: "0x9544C73C97BD292a1F09ef671A5f8CcDf9Ff5429",
18
+ intentsVerifierLens: "",
19
+ lexLens: "",
20
+ tradingFloorLensLens: "",
21
+ triggersAndPortalLens: "",
22
22
  },
23
23
  flare: {
24
- lexLens: "0x812Ea46a0618f923ae473eb239a89A8169b34B85",
25
- tradingFloorLensLens: "0x13d878F3C3f32400A727662af7dfAdBc8b389637",
26
- intentsVerifierLens: "0x33576dFbA7Ed5E3F8F744132D6885cE106178161",
27
- triggersAndPortalLens: "0x625D49B0258BB8277516C07494910d420FA31B06",
24
+ intentsVerifierLens: "0x1CdA9C57526e0CDF97f63c2c0CD460a16f9855F5",
25
+ lexLens: "0x76CDbA9107a89af6Dda81655f26FBE67e1d4a749",
26
+ tradingFloorLensLens: "0x731cDbfF121a313c9af0146826E2A78cCBE9FF66",
27
+ triggersAndPortalLens: "0x36D550DbA557a930f0Dfcb4796c593b2215D52Af",
28
28
  },
29
29
  };
@@ -1,15 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EMPTY_HASH_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO = exports.EMPTY_ACCOUNT_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO = void 0;
4
- exports.EMPTY_ACCOUNT_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO = {
5
- verifier: "",
6
- account: "",
7
- actionType: 0,
8
- currentNonce: 0,
9
- };
10
- exports.EMPTY_HASH_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO = {
11
- verifier: "",
12
- hash: "",
13
- actionType: 0,
14
- currentNonce: 0,
15
- };
@@ -2,38 +2,18 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.IntentsVerifierLensService = void 0;
4
4
  const IntentsVerifierLens__factory_1 = require("../../typechain/factories/contracts/Peripheral/Lens/IntentsVerifierLens__factory");
5
- const ethersTypes_1 = require("../../utils/ethersTypes");
6
- const IIntentsVerifierLensService_1 = require("./IIntentsVerifierLensService");
7
5
  class IntentsVerifierLensService {
8
6
  constructor(signerOrProvider, address) {
9
7
  this.contract = IntentsVerifierLens__factory_1.IntentsVerifierLens__factory.connect(address, signerOrProvider);
10
8
  }
11
- async getRequestBuildingInfoForChipsIntentsVerifier(account, actionType) {
12
- const result = await this.contract.getRequestBuildingInfoForChipsIntentsVerifier(account, BigInt(actionType));
13
- const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, IIntentsVerifierLensService_1.EMPTY_ACCOUNT_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO);
14
- return {
15
- ...baseStruct,
16
- actionType: Number(baseStruct.actionType),
17
- currentNonce: Number(baseStruct.currentNonce),
18
- };
9
+ async getRequestBuildingInfoForChipsIntentsVerifier() {
10
+ return await this.contract.getRequestBuildingInfoForChipsIntentsVerifier();
19
11
  }
20
- async getRequestBuildingInfoForLiquidityIntentsVerifier(account, actionType) {
21
- const result = await this.contract.getRequestBuildingInfoForLiquidityIntentsVerifier(account, BigInt(actionType));
22
- const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, IIntentsVerifierLensService_1.EMPTY_ACCOUNT_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO);
23
- return {
24
- ...baseStruct,
25
- actionType: Number(baseStruct.actionType),
26
- currentNonce: Number(baseStruct.currentNonce),
27
- };
12
+ async getRequestBuildingInfoForLiquidityIntentsVerifier() {
13
+ return await this.contract.getRequestBuildingInfoForLiquidityIntentsVerifier();
28
14
  }
29
- async getRequestBuildingInfoForTradeIntentsVerifier(positionId, actionType) {
30
- const result = await this.contract.getRequestBuildingInfoForTradeIntentsVerifier(positionId, BigInt(actionType));
31
- const baseStruct = (0, ethersTypes_1.ethersStructResponseToObject)(result, IIntentsVerifierLensService_1.EMPTY_HASH_BASED_INTENTS_VERIFIER_REQUEST_BUILDING_INFO);
32
- return {
33
- ...baseStruct,
34
- actionType: Number(baseStruct.actionType),
35
- currentNonce: Number(baseStruct.currentNonce),
36
- };
15
+ async getRequestBuildingInfoForTradeIntentsVerifier() {
16
+ return await this.contract.getRequestBuildingInfoForTradeIntentsVerifier();
37
17
  }
38
18
  async registry() {
39
19
  return await this.contract.registry();
@@ -15,7 +15,6 @@ function buildPositionRequestIdentifier(params) {
15
15
  trader: params.trader,
16
16
  pairId: BigInt(params.pairId),
17
17
  settlementAsset: params.settlementAsset,
18
- positionIndex: BigInt(params.positionIndex),
19
18
  };
20
19
  }
21
20
  /**
@@ -32,9 +32,7 @@ exports.EMPTY_COMPLETE_POSITION_DATA = {
32
32
  exports.EMPTY_POSITIONS_RESULT = {
33
33
  positions: [],
34
34
  positionsCount: 0,
35
- settlementAssetsLastIndex: 0,
36
- pairIdsLastIndex: 0,
37
- pairTraderLastIndex: 0,
35
+ traderLastIndex: 0,
38
36
  done: false,
39
37
  };
40
38
  exports.EMPTY_POSITION_LIQUIDATION_INFO = {
@@ -47,15 +45,13 @@ exports.EMPTY_POSITION_LIQUIDATION_INFO = {
47
45
  exports.EMPTY_LIQUIDATION_RESULT = {
48
46
  positionsLiquidationInfo: [],
49
47
  positionsCount: 0,
50
- settlementAssetsLastIndex: 0,
51
- pairIdsLastIndex: 0,
52
- pairTraderLastIndex: 0,
48
+ traderLastIndex: 0,
53
49
  positionLastIndex: 0,
54
50
  done: false,
55
51
  };
56
52
  exports.EMPTY_TRADE_PARAMS = {
57
53
  tradingFloor: "",
58
- maxTradesPerPair: 0,
54
+ maxTradesPerTrader: 0,
59
55
  maxSlF: 0,
60
56
  maxSanityProfitF: 0,
61
57
  };
@@ -45,12 +45,9 @@ class TradingFloorLensService {
45
45
  async getAllPositionsDataForAllTraders(params) {
46
46
  const contractParams = {
47
47
  tradingFloor: params.tradingFloor,
48
- settlementAssetsStartIndex: BigInt(params.settlementAssetsStartIndex),
49
- pairIdsStartIndex: BigInt(params.pairIdsStartIndex),
50
- pairTraderStartIndex: BigInt(params.pairTraderStartIndex),
48
+ traderStartIndex: BigInt(params.traderStartIndex),
51
49
  positionsLimit: BigInt(params.positionsLimit),
52
50
  };
53
- // @ts-ignore
54
51
  const result = await this.contract.getAllPositionsDataForAllTraders.staticCall(contractParams);
55
52
  const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITradingFloorLensService_1.EMPTY_POSITIONS_RESULT);
56
53
  // Convert positions and filter out empty ones
@@ -61,44 +58,23 @@ class TradingFloorLensService {
61
58
  ...baseResult,
62
59
  positions: convertedPositions,
63
60
  positionsCount: Number(baseResult.positionsCount),
64
- settlementAssetsLastIndex: Number(baseResult.settlementAssetsLastIndex),
65
- pairIdsLastIndex: Number(baseResult.pairIdsLastIndex),
66
- pairTraderLastIndex: Number(baseResult.pairTraderLastIndex),
61
+ traderLastIndex: Number(baseResult.traderLastIndex),
67
62
  };
68
63
  }
69
- async getAllPositionsDataForAllTradersInDimension(tradingFloor, settlementAsset, arraySize) {
70
- // @ts-ignore
71
- const result = await this.contract.getAllPositionsDataForAllTradersInDimension.staticCall(tradingFloor, settlementAsset, BigInt(arraySize));
72
- // Convert and filter out empty positions (collateral = 0)
73
- return result
74
- .filter((pos) => pos.collateral > 0n)
75
- .map((pos) => convertPositionData(pos));
76
- }
77
- async getAllPositionsDataForTraderInDimension(tradingFloor, settlementAsset, trader) {
78
- // @ts-ignore
79
- const result = await this.contract.getAllPositionsDataForTraderInDimension.staticCall(tradingFloor, settlementAsset, trader);
80
- // Convert and filter out empty positions (collateral = 0)
81
- return result
82
- .filter((pos) => pos.collateral > 0n)
83
- .map((pos) => convertPositionData(pos));
84
- }
85
64
  async getAllPositionsLiquidationInfo(params, phases) {
86
65
  const contractParams = {
87
66
  tradingFloor: params.tradingFloor,
88
- settlementAssetsStartIndex: BigInt(params.settlementAssetsStartIndex),
89
- pairIdsStartIndex: BigInt(params.pairIdsStartIndex),
90
- pairTraderStartIndex: BigInt(params.pairTraderStartIndex),
67
+ traderStartIndex: BigInt(params.traderStartIndex),
91
68
  positionStartIndex: BigInt(params.positionStartIndex),
92
69
  positionsLimit: BigInt(params.positionsLimit),
93
70
  };
94
71
  let result;
95
72
  if (phases !== undefined) {
96
- // @ts-ignore
97
- result = await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint256,uint256,uint16,uint256),uint8[])"].staticCall(contractParams, phases.map(p => BigInt(p)));
73
+ result = await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint16,uint256),uint8[])"].staticCall(contractParams, phases.map((p) => BigInt(p)));
98
74
  }
99
75
  else {
100
- // @ts-ignore
101
- result = await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint256,uint256,uint16,uint256))"].staticCall(contractParams);
76
+ result =
77
+ await this.contract["getAllPositionsLiquidationInfo((address,uint256,uint16,uint256))"].staticCall(contractParams);
102
78
  }
103
79
  const baseResult = (0, ethersTypes_1.ethersStructResponseToObject)(result, ITradingFloorLensService_1.EMPTY_LIQUIDATION_RESULT);
104
80
  const convertedPositions = result.positionsLiquidationInfo.map((pos) => convertLiquidationInfo(pos));
@@ -106,39 +82,27 @@ class TradingFloorLensService {
106
82
  ...baseResult,
107
83
  positionsLiquidationInfo: convertedPositions,
108
84
  positionsCount: Number(baseResult.positionsCount),
109
- settlementAssetsLastIndex: Number(baseResult.settlementAssetsLastIndex),
110
- pairIdsLastIndex: Number(baseResult.pairIdsLastIndex),
111
- pairTraderLastIndex: Number(baseResult.pairTraderLastIndex),
85
+ traderLastIndex: Number(baseResult.traderLastIndex),
112
86
  positionLastIndex: Number(baseResult.positionLastIndex),
113
87
  };
114
88
  }
115
89
  async getCompletePositionData(tradingFloor, positionId) {
116
- // @ts-ignore
117
90
  const result = await this.contract.getCompletePositionData.staticCall(tradingFloor, positionId);
118
91
  return convertPositionData(result);
119
92
  }
120
- async getPositionDataInPairsForTrader(tradingFloor, settlementAsset, trader, pairIds) {
121
- // @ts-ignore
122
- const result = await this.contract.getPositionDataInPairsForTrader.staticCall(tradingFloor, settlementAsset, trader, pairIds.map(id => BigInt(id)));
123
- // Convert and filter out empty positions (collateral = 0)
124
- return result
125
- .filter((pos) => pos.collateral > 0n)
126
- .map((pos) => convertPositionData(pos));
127
- }
128
- async getPositionsDataInPairForTrader(tradingFloor, settlementAsset, trader, pairId) {
129
- // @ts-ignore
130
- const result = await this.contract.getPositionsDataInPairForTrader.staticCall(tradingFloor, settlementAsset, trader, BigInt(pairId));
93
+ async getPositionsDataForTrader(tradingFloor, trader) {
94
+ const result = await this.contract.getPositionsDataForTrader.staticCall(tradingFloor, trader);
131
95
  // Convert and filter out empty positions (collateral = 0)
132
96
  return result
133
97
  .filter((pos) => pos.collateral > 0n)
134
98
  .map((pos) => convertPositionData(pos));
135
99
  }
136
100
  async getTradingFloorTradeParams(tradingFloor) {
137
- const result = await this.contract.getTradingFloorTradeParams(tradingFloor);
101
+ const result = await this.contract.getTradingFloorTradeParams.staticCall(tradingFloor);
138
102
  // Result is a tuple/array-like object, extract the named properties
139
103
  return {
140
104
  tradingFloor: result.tradingFloor,
141
- maxTradesPerPair: Number(result.maxTradesPerPair),
105
+ maxTradesPerTrader: Number(result.maxTradesPerTrader),
142
106
  maxSlF: Number(result.maxSlF),
143
107
  maxSanityProfitF: Number(result.maxSanityProfitF),
144
108
  };
@@ -92,22 +92,41 @@ class TradingFloorService {
92
92
  return this.tradingFloorContract.poolAccountantForAsset(asset);
93
93
  }
94
94
  // Read-only Functions - Trading Pair Information
95
- async pairTraders(asset, pairId, index) {
96
- return this.tradingFloorContract.pairTraders(asset, pairId, index);
95
+ async deprecated_pairTraders(asset, pairId, index) {
96
+ return this.tradingFloorContract.deprecated_pairTraders(asset, pairId, index);
97
97
  }
98
- async pairTradersArray(asset, pairIndex) {
99
- return this.tradingFloorContract.pairTradersArray(asset, pairIndex);
98
+ async deprecated_pairTradersArray(asset, pairIndex) {
99
+ return this.tradingFloorContract.deprecated_pairTradersArray(asset, pairIndex);
100
100
  }
101
- async pairTradersInfo(asset, trader, pairId) {
102
- const result = await this.tradingFloorContract.pairTradersInfo(asset, trader, pairId);
101
+ async deprecated_pairTradersInfo(asset, trader, pairId) {
102
+ const result = await this.tradingFloorContract.deprecated_pairTradersInfo(asset, trader, pairId);
103
103
  return {
104
- positionsCounter: result.positionsCounter,
104
+ positionsCounter: result.deprecated_positionsCounter,
105
105
  positionInArray: result.positionInArray,
106
106
  };
107
107
  }
108
108
  async pausedPairs(pairId) {
109
109
  return this.tradingFloorContract.pausedPairs(pairId);
110
110
  }
111
+ // Read-only Functions - Global Trader Tracking (v1.01)
112
+ async traders(index) {
113
+ return this.tradingFloorContract.traders(index);
114
+ }
115
+ async tradersAmount() {
116
+ return this.tradingFloorContract.tradersAmount();
117
+ }
118
+ async tradersIndex(trader) {
119
+ return this.tradingFloorContract.tradersIndex(trader);
120
+ }
121
+ async getActivePositionsAmountForTrader(trader) {
122
+ return this.tradingFloorContract.getActivePositionsAmountForTrader(trader);
123
+ }
124
+ async activePositionIdsByTrader(trader, index) {
125
+ return this.tradingFloorContract.activePositionIdsByTrader(trader, index);
126
+ }
127
+ async positionIdToActivePositionIndex(trader, positionId) {
128
+ return this.tradingFloorContract.positionIdToActivePositionIndex(trader, positionId);
129
+ }
111
130
  // Read-only Functions - Trading Parameters
112
131
  async maxSanityProfitF() {
113
132
  return this.tradingFloorContract.maxSanityProfitF();
@@ -115,8 +134,8 @@ class TradingFloorService {
115
134
  async maxSlF() {
116
135
  return this.tradingFloorContract.maxSlF();
117
136
  }
118
- async maxTradesPerPair() {
119
- return this.tradingFloorContract.maxTradesPerPair();
137
+ async maxTradesPerTrader() {
138
+ return this.tradingFloorContract.maxTradesPerTrader();
120
139
  }
121
140
  // Read-only Functions - Fee Information
122
141
  async feesMap(asset, feeType) {
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TradingFloorService = void 0;
4
+ var TradingFloorService_1 = require("./TradingFloorService");
5
+ Object.defineProperty(exports, "TradingFloorService", { enumerable: true, get: function () { return TradingFloorService_1.TradingFloorService; } });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });