@heliofi/launchpad-common 1.3.2 → 1.3.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 (54) hide show
  1. package/dist/src/domain/constants/curveType.d.ts +2 -1
  2. package/dist/src/domain/constants/curveType.js +1 -0
  3. package/dist/src/domain/constants/curveType.js.map +1 -1
  4. package/dist/src/domain/curves/BaseConstantProductCurveV1.d.ts +23 -0
  5. package/dist/src/domain/curves/BaseConstantProductCurveV1.js +141 -0
  6. package/dist/src/domain/curves/BaseConstantProductCurveV1.js.map +1 -0
  7. package/dist/src/domain/curves/BaseCurve.d.ts +2 -1
  8. package/dist/src/domain/curves/BaseCurve.js.map +1 -1
  9. package/dist/src/domain/curves/ConstantProductCurve.d.ts +20 -0
  10. package/dist/src/domain/curves/ConstantProductCurve.js +120 -0
  11. package/dist/src/domain/curves/ConstantProductCurve.js.map +1 -0
  12. package/dist/src/domain/curves/ConstantProductCurveV2.d.ts +6 -0
  13. package/dist/src/domain/curves/ConstantProductCurveV2.js +32 -0
  14. package/dist/src/domain/curves/ConstantProductCurveV2.js.map +1 -0
  15. package/dist/src/domain/curves/FlatCurveV1.d.ts +14 -0
  16. package/dist/src/domain/curves/FlatCurveV1.js +60 -0
  17. package/dist/src/domain/curves/FlatCurveV1.js.map +1 -0
  18. package/dist/src/domain/curves/LinearCurveV1.d.ts +1 -0
  19. package/dist/src/domain/curves/LinearCurveV1.js +3 -0
  20. package/dist/src/domain/curves/LinearCurveV1.js.map +1 -1
  21. package/dist/src/domain/curves/SonicConstantProductCurveV1.d.ts +11 -0
  22. package/dist/src/domain/curves/SonicConstantProductCurveV1.js +29 -0
  23. package/dist/src/domain/curves/SonicConstantProductCurveV1.js.map +1 -0
  24. package/dist/src/domain/curves/getCurve.js +4 -0
  25. package/dist/src/domain/curves/getCurve.js.map +1 -1
  26. package/dist/src/domain/curves/getDefaultCurveByBlockchain.d.ts +5 -0
  27. package/dist/src/domain/curves/getDefaultCurveByBlockchain.js +21 -0
  28. package/dist/src/domain/curves/getDefaultCurveByBlockchain.js.map +1 -0
  29. package/dist/src/domain/curves/index.d.ts +1 -0
  30. package/dist/src/domain/curves/index.js +1 -0
  31. package/dist/src/domain/curves/index.js.map +1 -1
  32. package/dist/src/domain/curves/tests/BaseConstantProductCurveV1.spec.d.ts +1 -0
  33. package/dist/src/domain/curves/tests/BaseConstantProductCurveV1.spec.js +56 -0
  34. package/dist/src/domain/curves/tests/BaseConstantProductCurveV1.spec.js.map +1 -0
  35. package/dist/src/domain/curves/tests/FlatCurveV1.spec.d.ts +1 -0
  36. package/dist/src/domain/curves/tests/FlatCurveV1.spec.js +130 -0
  37. package/dist/src/domain/curves/tests/FlatCurveV1.spec.js.map +1 -0
  38. package/dist/src/domain/curves/typeUtils.d.ts +3 -0
  39. package/dist/src/domain/curves/typeUtils.js +24 -0
  40. package/dist/src/domain/curves/typeUtils.js.map +1 -0
  41. package/dist/src/domain/curves/utils.d.ts +3 -0
  42. package/dist/src/domain/curves/utils.js +16 -0
  43. package/dist/src/domain/curves/utils.js.map +1 -0
  44. package/dist/src/domain/model/airlock/entities/TotalClaimedResponse.entity.d.ts +4 -0
  45. package/dist/src/domain/model/airlock/entities/TotalClaimedResponse.entity.js +8 -0
  46. package/dist/src/domain/model/airlock/entities/TotalClaimedResponse.entity.js.map +1 -0
  47. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.d.ts +7 -0
  48. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.js +38 -0
  49. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.js.map +1 -0
  50. package/dist/src/domain/model/lpLockDetails/index.d.ts +1 -0
  51. package/dist/src/domain/model/lpLockDetails/index.js +18 -0
  52. package/dist/src/domain/model/lpLockDetails/index.js.map +1 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/package.json +3 -3
@@ -0,0 +1,5 @@
1
+ import { BlockchainSymbol } from '../constants';
2
+ import { ConstantProductCurveV1 } from './ConstantProductCurveV1';
3
+ import { EvmConstantProductCurveV1 } from './EvmConstantProductCurveV1';
4
+ import { SonicConstantProductCurveV1 } from './SonicConstantProductCurveV1';
5
+ export declare const getDefaultCurveByBlockchain: (symbol: BlockchainSymbol) => ConstantProductCurveV1 | EvmConstantProductCurveV1 | SonicConstantProductCurveV1;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getDefaultCurveByBlockchain = void 0;
4
+ const constants_1 = require("../constants");
5
+ const ConstantProductCurveV1_1 = require("./ConstantProductCurveV1");
6
+ const EvmConstantProductCurveV1_1 = require("./EvmConstantProductCurveV1");
7
+ const SonicConstantProductCurveV1_1 = require("./SonicConstantProductCurveV1");
8
+ const getDefaultCurveByBlockchain = (symbol) => {
9
+ if (symbol === constants_1.BlockchainSymbol.SOL) {
10
+ return new ConstantProductCurveV1_1.ConstantProductCurveV1();
11
+ }
12
+ if (symbol === constants_1.BlockchainSymbol.ETH || symbol === constants_1.BlockchainSymbol.BASE) {
13
+ return new EvmConstantProductCurveV1_1.EvmConstantProductCurveV1();
14
+ }
15
+ if (symbol === constants_1.BlockchainSymbol.SONIC) {
16
+ return new SonicConstantProductCurveV1_1.SonicConstantProductCurveV1();
17
+ }
18
+ throw new Error('Blockchain not supported');
19
+ };
20
+ exports.getDefaultCurveByBlockchain = getDefaultCurveByBlockchain;
21
+ //# sourceMappingURL=getDefaultCurveByBlockchain.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getDefaultCurveByBlockchain.js","sourceRoot":"","sources":["../../../../src/domain/curves/getDefaultCurveByBlockchain.ts"],"names":[],"mappings":";;;AAAA,4CAAgD;AAChD,qEAAkE;AAClE,2EAAwE;AACxE,+EAA4E;AAErE,MAAM,2BAA2B,GAAG,CACzC,MAAwB,EAIM,EAAE;IAChC,IAAI,MAAM,KAAK,4BAAgB,CAAC,GAAG,EAAE;QACnC,OAAO,IAAI,+CAAsB,EAAE,CAAC;KACrC;IAED,IAAI,MAAM,KAAK,4BAAgB,CAAC,GAAG,IAAI,MAAM,KAAK,4BAAgB,CAAC,IAAI,EAAE;QACvE,OAAO,IAAI,qDAAyB,EAAE,CAAC;KACxC;IAED,IAAI,MAAM,KAAK,4BAAgB,CAAC,KAAK,EAAE;QACrC,OAAO,IAAI,yDAA2B,EAAE,CAAC;KAC1C;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAC9C,CAAC,CAAC;AAnBW,QAAA,2BAA2B,+BAmBtC"}
@@ -5,3 +5,4 @@ export * from './getCurve';
5
5
  export * from './AbstractCurve';
6
6
  export * from './ConstantProductCurveV1';
7
7
  export * from './EvmConstantProductCurveV1';
8
+ export * from './getDefaultCurveByBlockchain';
@@ -21,4 +21,5 @@ __exportStar(require("./getCurve"), exports);
21
21
  __exportStar(require("./AbstractCurve"), exports);
22
22
  __exportStar(require("./ConstantProductCurveV1"), exports);
23
23
  __exportStar(require("./EvmConstantProductCurveV1"), exports);
24
+ __exportStar(require("./getDefaultCurveByBlockchain"), exports);
24
25
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/curves/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC;AAChC,0CAAwB;AACxB,6CAA2B;AAC3B,kDAAgC;AAChC,2DAAyC;AACzC,8DAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/curves/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,kDAAgC;AAChC,0CAAwB;AACxB,6CAA2B;AAC3B,kDAAgC;AAChC,2DAAyC;AACzC,8DAA4C;AAC5C,gEAA8C"}
@@ -0,0 +1,56 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const tradeDirection_1 = require("../../constants/tradeDirection");
4
+ const BaseConstantProductCurveV1_1 = require("../BaseConstantProductCurveV1");
5
+ describe('ConstantProductCurveV1', () => {
6
+ let curve;
7
+ const expectedTokensForOneEth = 407692307692307720983826117n;
8
+ beforeAll(() => {
9
+ curve = new BaseConstantProductCurveV1_1.BaseConstantProductCurveV1();
10
+ });
11
+ describe('getTokensAmountFromCollateral', () => {
12
+ it('should calculate nr of tokens for 1 ETH for buy without tax', () => {
13
+ const params = {
14
+ amount: BigInt(1e18),
15
+ curvePosition: 0n,
16
+ platformFeeBps: 0,
17
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
18
+ };
19
+ const result = curve.getTokensAmountFromCollateral(params);
20
+ expect(result).toBe(expectedTokensForOneEth);
21
+ });
22
+ it('should calculate tokens for selling 1 ETH of supply', () => {
23
+ const params = {
24
+ amount: BigInt(1e18),
25
+ curvePosition: expectedTokensForOneEth,
26
+ platformFeeBps: 0,
27
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
28
+ };
29
+ const result = curve.getTokensAmountFromCollateral(params);
30
+ expect(result).toBe(expectedTokensForOneEth);
31
+ });
32
+ });
33
+ describe('getCollateralAmountFromTokens', () => {
34
+ it('should calculate amount of collateral to buy tokens worth 1 ETH', () => {
35
+ const params = {
36
+ amount: expectedTokensForOneEth,
37
+ curvePosition: 0n,
38
+ platformFeeBps: 0,
39
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
40
+ };
41
+ const result = curve.getCollateralAmountFromTokens(params);
42
+ expect(result).toBe(BigInt(1e18));
43
+ });
44
+ it('should calculate collateral for selling tokens worth 1 ETH', () => {
45
+ const params = {
46
+ amount: expectedTokensForOneEth,
47
+ curvePosition: expectedTokensForOneEth,
48
+ platformFeeBps: 0,
49
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
50
+ };
51
+ const result = curve.getCollateralAmountFromTokens(params);
52
+ expect(result).toBe(BigInt(1e18));
53
+ });
54
+ });
55
+ });
56
+ //# sourceMappingURL=BaseConstantProductCurveV1.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseConstantProductCurveV1.spec.js","sourceRoot":"","sources":["../../../../../src/domain/curves/tests/BaseConstantProductCurveV1.spec.ts"],"names":[],"mappings":";;AACA,mEAAgE;AAEhE,8EAA2E;AAE3E,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;IACtC,IAAI,KAAoB,CAAC;IACzB,MAAM,uBAAuB,GAAG,4BAA4B,CAAC;IAE7D,SAAS,CAAC,GAAG,EAAE;QACb,KAAK,GAAG,IAAI,uDAA0B,EAAE,CAAC;IAC3C,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;YACrE,MAAM,MAAM,GAAG;gBACb,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;gBACpB,aAAa,EAAE,EAAE;gBACjB,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,+BAAc,CAAC,GAAG;aACnC,CAAC;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,qDAAqD,EAAE,GAAG,EAAE;YAC7D,MAAM,MAAM,GAAG;gBACb,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC;gBACpB,aAAa,EAAE,uBAAuB;gBACtC,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,+BAAc,CAAC,IAAI;aACpC,CAAC;YAEF,MAAM,MAAM,GAAG,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;QAC/C,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;YACzE,MAAM,MAAM,GAAG;gBACb,MAAM,EAAE,uBAAuB;gBAC/B,aAAa,EAAE,EAAE;gBACjB,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,+BAAc,CAAC,GAAG;aACnC,CAAC;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,MAAM,GAAG;gBACb,MAAM,EAAE,uBAAuB;gBAC/B,aAAa,EAAE,uBAAuB;gBACtC,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,+BAAc,CAAC,IAAI;aACpC,CAAC;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,130 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const bigNumber_1 = __importDefault(require("../../../config/bigNumber"));
7
+ const tradeDirection_1 = require("../../constants/tradeDirection");
8
+ const FlatCurveV1_1 = require("../FlatCurveV1");
9
+ describe('FlatCurveV1', () => {
10
+ const curve = new FlatCurveV1_1.FlatCurveV1(BigInt(1e9));
11
+ const platformFeeBps = 100;
12
+ const collateralAmount = BigInt(1e9);
13
+ describe('getTokensAmountFromCollateral', () => {
14
+ const expectedTokensWithoutTax = curve.curveDefaults.minAllocationTokenAmount - 1n;
15
+ it('should calculate nr of tokens for 1 SOL for buy without tax', () => {
16
+ const params = {
17
+ amount: collateralAmount,
18
+ platformFeeBps: 0,
19
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
20
+ curvePosition: 0n,
21
+ };
22
+ const result = curve.getTokensAmountFromCollateral(params);
23
+ expect(result).toBe(expectedTokensWithoutTax);
24
+ });
25
+ it('should calculate nr of tokens for 1 SOL for sell without tax', () => {
26
+ const params = {
27
+ amount: collateralAmount,
28
+ platformFeeBps: 0,
29
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
30
+ curvePosition: BigInt(3e17),
31
+ };
32
+ const result = curve.getTokensAmountFromCollateral(params);
33
+ expect(result).toBe(expectedTokensWithoutTax);
34
+ });
35
+ it('should calculate nr of tokens for 1 SOL for buy with tax', () => {
36
+ const amountWithTax = (collateralAmount * 10000n) / (10000n - BigInt(platformFeeBps));
37
+ const params = {
38
+ amount: amountWithTax,
39
+ platformFeeBps,
40
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
41
+ curvePosition: 1n,
42
+ };
43
+ const result = curve.getTokensAmountFromCollateral(params);
44
+ expect(result).toBe(expectedTokensWithoutTax);
45
+ });
46
+ it('should calculate nr of tokens for 1 SOL for sell with tax', () => {
47
+ const amountWithTax = (collateralAmount * 10000n) / (10000n + BigInt(platformFeeBps));
48
+ const params = {
49
+ amount: amountWithTax,
50
+ platformFeeBps,
51
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
52
+ curvePosition: 0n,
53
+ };
54
+ const result = curve.getTokensAmountFromCollateral(params);
55
+ expect(result).toBeLessThan((expectedTokensWithoutTax * 10001n) / 10000n);
56
+ expect(result).toBeGreaterThan((expectedTokensWithoutTax * 9999n) / 10000n);
57
+ });
58
+ });
59
+ describe('getCollateralAmountFromTokens', () => {
60
+ const tokenAmount = BigInt(1e15);
61
+ it('should calculate collateral for tokens for buy without tax', () => {
62
+ const params = {
63
+ amount: tokenAmount,
64
+ platformFeeBps: 0,
65
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
66
+ curvePosition: 0n,
67
+ };
68
+ const result = curve.getCollateralAmountFromTokens(params);
69
+ const expectedCollateral = (collateralAmount * tokenAmount) /
70
+ curve.curveDefaults.minAllocationTokenAmount;
71
+ expect(result).toBe(expectedCollateral);
72
+ });
73
+ it('should calculate collateral for tokens for sell without tax', () => {
74
+ const params = {
75
+ amount: tokenAmount,
76
+ platformFeeBps: 0,
77
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
78
+ curvePosition: BigInt(1e17),
79
+ };
80
+ const result = curve.getCollateralAmountFromTokens(params);
81
+ const expectedCollateral = (collateralAmount * tokenAmount) /
82
+ curve.curveDefaults.minAllocationTokenAmount;
83
+ expect(result).toBe(expectedCollateral);
84
+ });
85
+ it('should calculate collateral with platform fees for buy', () => {
86
+ const params = {
87
+ amount: tokenAmount,
88
+ platformFeeBps,
89
+ tradeDirection: tradeDirection_1.TradeDirection.BUY,
90
+ curvePosition: 0n,
91
+ };
92
+ const result = curve.getCollateralAmountFromTokens(params);
93
+ const baseAmount = (collateralAmount * tokenAmount) /
94
+ curve.curveDefaults.minAllocationTokenAmount;
95
+ const expectedWithFee = baseAmount + (baseAmount * BigInt(platformFeeBps)) / 10000n;
96
+ expect(result).toBe(expectedWithFee);
97
+ });
98
+ it('should calculate collateral with platform fees for sell', () => {
99
+ const params = {
100
+ amount: tokenAmount,
101
+ platformFeeBps,
102
+ tradeDirection: tradeDirection_1.TradeDirection.SELL,
103
+ curvePosition: 0n,
104
+ };
105
+ const result = curve.getCollateralAmountFromTokens(params);
106
+ const baseAmount = (collateralAmount * tokenAmount) /
107
+ curve.curveDefaults.minAllocationTokenAmount;
108
+ const expectedWithFee = baseAmount - (baseAmount * BigInt(platformFeeBps)) / 10000n;
109
+ expect(result).toBe(expectedWithFee);
110
+ });
111
+ });
112
+ describe('getMarketCap', () => {
113
+ it('should return 0', () => {
114
+ const result = curve.getMarketCap({ curvePosition: 0n });
115
+ expect(result).toBe(0n);
116
+ });
117
+ it('should return collateral collected', () => {
118
+ const result = curve.getMarketCap({ curvePosition: BigInt(49 * 1e16) });
119
+ expect(result).toBe(collateralAmount);
120
+ });
121
+ });
122
+ describe('getCollateralPrice', () => {
123
+ it('should return constant price based on collateral collected', () => {
124
+ const result = curve.getCollateralPrice();
125
+ const expectedPrice = (0, bigNumber_1.default)(2.04e-9);
126
+ expect(result.toFixed(11)).toBe(expectedPrice.toFixed(11));
127
+ });
128
+ });
129
+ });
130
+ //# sourceMappingURL=FlatCurveV1.spec.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlatCurveV1.spec.js","sourceRoot":"","sources":["../../../../../src/domain/curves/tests/FlatCurveV1.spec.ts"],"names":[],"mappings":";;;;;AAAA,0EAAkD;AAClD,mEAAgE;AAChE,gDAA6C;AAE7C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,MAAM,KAAK,GAAG,IAAI,yBAAW,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3C,MAAM,cAAc,GAAG,GAAG,CAAC;IAC3B,MAAM,gBAAgB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAErC,QAAQ,CAAC,+BAA+B,EAAE,GAAG,EAAE;QAC7C,MAAM,wBAAwB,GAC5B,KAAK,CAAC,aAAa,CAAC,wBAAwB,GAAG,EAAE,CAAC;QAEpD,EAAE,CAAC,6DAA6D,EAAE,GAAG,EAAE;YACrE,MAAM,MAAM,GAAG;gBACb,MAAM,EAAE,gBAAgB;gBACxB,cAAc,EAAE,CAAC;gBACjB,cAAc,EAAE,+BAAc,CAAC,GAAG;gBAClC,aAAa,EAAE,EAAE;aAClB,CAAC;YACF,MAAM,MAAM,GAAG,KAAK,CAAC,6BAA6B,CAAC,MAAM,CAAC,CAAC;YAC3D,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,w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G,EAAE;QAC5B,EAAE,CAAC,iBAAiB,EAAE,GAAG,EAAE;YACzB,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,CAAC;YACzD,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC1B,CAAC,CAAC,CAAC;QACH,EAAE,CAAC,oCAAoC,EAAE,GAAG,EAAE;YAC5C,MAAM,MAAM,GAAG,KAAK,CAAC,YAAY,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC,CAAC;YACxE,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACxC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAClC,EAAE,CAAC,4DAA4D,EAAE,GAAG,EAAE;YACpE,MAAM,MAAM,GAAG,KAAK,CAAC,kBAAkB,EAAE,CAAC;YAC1C,MAAM,aAAa,GAAG,IAAA,mBAAS,EAAC,OAAO,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC;QAC7D,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { CurveType } from '../constants';
2
+ import { AbstractCurve } from './AbstractCurve';
3
+ export declare const toCurveObject: (curveType: CurveType, collateralCollected?: bigint, collateralDecimals?: number) => AbstractCurve;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toCurveObject = void 0;
4
+ const constants_1 = require("../constants");
5
+ const FlatCurveV1_1 = require("./FlatCurveV1");
6
+ const ConstantProductCurveV2_1 = require("./ConstantProductCurveV2");
7
+ const ConstantProductCurveV1_1 = require("./ConstantProductCurveV1");
8
+ const EvmConstantProductCurveV1_1 = require("./EvmConstantProductCurveV1");
9
+ const toCurveObject = (curveType, collateralCollected = 0n, collateralDecimals) => {
10
+ switch (curveType) {
11
+ case constants_1.CurveType.CONSTANT_PRODUCT_V1:
12
+ return new ConstantProductCurveV1_1.ConstantProductCurveV1();
13
+ case constants_1.CurveType.CONSTANT_PRODUCT_V2:
14
+ return new ConstantProductCurveV2_1.ConstantProductCurveV2();
15
+ case constants_1.CurveType.EVM_CONSTANT_PRODUCT_V1:
16
+ return new EvmConstantProductCurveV1_1.EvmConstantProductCurveV1();
17
+ case constants_1.CurveType.FLAT_V1:
18
+ return new FlatCurveV1_1.FlatCurveV1(collateralCollected, collateralDecimals);
19
+ default:
20
+ throw new Error(`Unsupported curve type: ${curveType}`);
21
+ }
22
+ };
23
+ exports.toCurveObject = toCurveObject;
24
+ //# sourceMappingURL=typeUtils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typeUtils.js","sourceRoot":"","sources":["../../../../src/domain/curves/typeUtils.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAEzC,+CAA4C;AAC5C,qEAAkE;AAClE,qEAAkE;AAClE,2EAAwE;AAEjE,MAAM,aAAa,GAAG,CAC3B,SAAoB,EACpB,sBAA8B,EAAE,EAChC,kBAA2B,EACZ,EAAE;IACjB,QAAQ,SAAS,EAAE;QACjB,KAAK,qBAAS,CAAC,mBAAmB;YAChC,OAAO,IAAI,+CAAsB,EAAE,CAAC;QACtC,KAAK,qBAAS,CAAC,mBAAmB;YAChC,OAAO,IAAI,+CAAsB,EAAE,CAAC;QACtC,KAAK,qBAAS,CAAC,uBAAuB;YACpC,OAAO,IAAI,qDAAyB,EAAE,CAAC;QACzC,KAAK,qBAAS,CAAC,OAAO;YACpB,OAAO,IAAI,yBAAW,CAAC,mBAAmB,EAAE,kBAAkB,CAAC,CAAC;QAClE;YACE,MAAM,IAAI,KAAK,CAAC,2BAA2B,SAAS,EAAE,CAAC,CAAC;KAC3D;AACH,CAAC,CAAC;AAjBW,QAAA,aAAa,iBAiBxB"}
@@ -0,0 +1,3 @@
1
+ import BigNumber from 'bignumber.js';
2
+ export declare const bigIntToBigNumber: (value: bigint) => BigNumber;
3
+ export declare const bigNumberToBigInt: (value: BigNumber) => bigint;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.bigNumberToBigInt = exports.bigIntToBigNumber = void 0;
7
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
8
+ const bigIntToBigNumber = (value) => {
9
+ return (0, bignumber_js_1.default)(value.toString());
10
+ };
11
+ exports.bigIntToBigNumber = bigIntToBigNumber;
12
+ const bigNumberToBigInt = (value) => {
13
+ return BigInt(value.integerValue(bignumber_js_1.default.ROUND_FLOOR).toFixed(0));
14
+ };
15
+ exports.bigNumberToBigInt = bigNumberToBigInt;
16
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/domain/curves/utils.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AAE9B,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAa,EAAE;IAC5D,OAAO,IAAA,sBAAS,EAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC;AACrC,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B;AAEK,MAAM,iBAAiB,GAAG,CAAC,KAAgB,EAAU,EAAE;IAC5D,OAAO,MAAM,CAAC,KAAK,CAAC,YAAY,CAAC,sBAAS,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AACtE,CAAC,CAAC;AAFW,QAAA,iBAAiB,qBAE5B"}
@@ -0,0 +1,4 @@
1
+ import { Entity } from '../../entity';
2
+ export declare class TotalClaimedResponse extends Entity {
3
+ totalClaimInSOL: number;
4
+ }
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TotalClaimedResponse = void 0;
4
+ const entity_1 = require("../../entity");
5
+ class TotalClaimedResponse extends entity_1.Entity {
6
+ }
7
+ exports.TotalClaimedResponse = TotalClaimedResponse;
8
+ //# sourceMappingURL=TotalClaimedResponse.entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TotalClaimedResponse.entity.js","sourceRoot":"","sources":["../../../../../../src/domain/model/airlock/entities/TotalClaimedResponse.entity.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AAEtC,MAAa,oBAAqB,SAAQ,eAAM;CAE/C;AAFD,oDAEC"}
@@ -0,0 +1,7 @@
1
+ import { LpTokenAllocationState } from '../../../constants';
2
+ export declare class AddAllocationDto {
3
+ state: LpTokenAllocationState;
4
+ walletAddress: string;
5
+ txHash: string;
6
+ allocationAmount: bigint;
7
+ }
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.AddAllocationDto = void 0;
13
+ const class_validator_1 = require("class-validator");
14
+ const constants_1 = require("../../../constants");
15
+ class AddAllocationDto {
16
+ }
17
+ __decorate([
18
+ (0, class_validator_1.IsString)(),
19
+ (0, class_validator_1.IsEnum)(constants_1.LpTokenAllocationState),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], AddAllocationDto.prototype, "state", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ __metadata("design:type", String)
27
+ ], AddAllocationDto.prototype, "walletAddress", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", String)
32
+ ], AddAllocationDto.prototype, "txHash", void 0);
33
+ __decorate([
34
+ (0, class_validator_1.IsNotEmpty)(),
35
+ __metadata("design:type", BigInt)
36
+ ], AddAllocationDto.prototype, "allocationAmount", void 0);
37
+ exports.AddAllocationDto = AddAllocationDto;
38
+ //# sourceMappingURL=AddAllocation.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AddAllocation.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/lpLockDetails/dtos/AddAllocation.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qDAA+D;AAC/D,kDAA4D;AAE5D,MAAa,gBAAgB;CAgB5B;AAfC;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,wBAAM,EAAC,kCAAsB,CAAC;IAC9B,IAAA,4BAAU,GAAE;;+CACiB;AAE9B;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;uDACS;AAEtB;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;gDACE;AAEf;IAAC,IAAA,4BAAU,GAAE;;0DACY;AAf3B,4CAgBC"}
@@ -0,0 +1 @@
1
+ export * from './dtos/AddAllocation.dto';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./dtos/AddAllocation.dto"), exports);
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/domain/model/lpLockDetails/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2DAAyC"}