@heliofi/launchpad-common 1.0.5 → 1.0.7-alpha.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 (74) hide show
  1. package/dist/src/domain/constants/blockchain.d.ts +2 -1
  2. package/dist/src/domain/constants/blockchain.js +3 -0
  3. package/dist/src/domain/constants/blockchain.js.map +1 -1
  4. package/dist/src/domain/constants/chainId.d.ts +4 -0
  5. package/dist/src/domain/constants/chainId.js +9 -0
  6. package/dist/src/domain/constants/chainId.js.map +1 -0
  7. package/dist/src/domain/constants/currency.d.ts +2 -1
  8. package/dist/src/domain/constants/currency.js +4 -0
  9. package/dist/src/domain/constants/currency.js.map +1 -1
  10. package/dist/src/domain/constants/curveType.d.ts +2 -1
  11. package/dist/src/domain/constants/curveType.js +1 -0
  12. package/dist/src/domain/constants/curveType.js.map +1 -1
  13. package/dist/src/domain/constants/dex.d.ts +2 -1
  14. package/dist/src/domain/constants/dex.js +1 -0
  15. package/dist/src/domain/constants/dex.js.map +1 -1
  16. package/dist/src/domain/constants/index.d.ts +2 -0
  17. package/dist/src/domain/constants/index.js +2 -0
  18. package/dist/src/domain/constants/index.js.map +1 -1
  19. package/dist/src/domain/constants/migrationDex.d.ts +3 -1
  20. package/dist/src/domain/constants/migrationDex.js +14 -1
  21. package/dist/src/domain/constants/migrationDex.js.map +1 -1
  22. package/dist/src/domain/constants/solanaNetwork.d.ts +4 -0
  23. package/dist/src/domain/constants/solanaNetwork.js +9 -0
  24. package/dist/src/domain/constants/solanaNetwork.js.map +1 -0
  25. package/dist/src/domain/curves/BaseConstantProductCurveV1.d.ts +23 -0
  26. package/dist/src/domain/curves/BaseConstantProductCurveV1.js +141 -0
  27. package/dist/src/domain/curves/BaseConstantProductCurveV1.js.map +1 -0
  28. package/dist/src/domain/curves/getCurve.js +4 -0
  29. package/dist/src/domain/curves/getCurve.js.map +1 -1
  30. package/dist/src/domain/curves/index.d.ts +1 -0
  31. package/dist/src/domain/curves/index.js +1 -0
  32. package/dist/src/domain/curves/index.js.map +1 -1
  33. package/dist/src/domain/model/index.d.ts +1 -0
  34. package/dist/src/domain/model/index.js +1 -0
  35. package/dist/src/domain/model/index.js.map +1 -1
  36. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.d.ts +7 -0
  37. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.js +38 -0
  38. package/dist/src/domain/model/lpLockDetails/dtos/AddAllocation.dto.js.map +1 -0
  39. package/dist/src/domain/model/lpLockDetails/index.d.ts +1 -0
  40. package/dist/src/domain/model/lpLockDetails/index.js +18 -0
  41. package/dist/src/domain/model/lpLockDetails/index.js.map +1 -0
  42. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapGetPrice.dto.d.ts +7 -0
  43. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapGetPrice.dto.js +47 -0
  44. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapGetPrice.dto.js.map +1 -0
  45. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapPrepare.dto.d.ts +13 -0
  46. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapPrepare.dto.js +73 -0
  47. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapPrepare.dto.js.map +1 -0
  48. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapSubmit.dto.d.ts +4 -0
  49. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapSubmit.dto.js +27 -0
  50. package/dist/src/domain/model/meteora-swap/dtos/MeteoraSwapSubmit.dto.js.map +1 -0
  51. package/dist/src/domain/model/meteora-swap/dtos/index.d.ts +3 -0
  52. package/dist/src/domain/model/meteora-swap/dtos/index.js +20 -0
  53. package/dist/src/domain/model/meteora-swap/dtos/index.js.map +1 -0
  54. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapPrepareResponse.entity.d.ts +5 -0
  55. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapPrepareResponse.entity.js +8 -0
  56. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapPrepareResponse.entity.js.map +1 -0
  57. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapSubmitResponse.entity.d.ts +6 -0
  58. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapSubmitResponse.entity.js +8 -0
  59. package/dist/src/domain/model/meteora-swap/entities/MeteoraSwapSubmitResponse.entity.js.map +1 -0
  60. package/dist/src/domain/model/meteora-swap/entities/index.d.ts +2 -0
  61. package/dist/src/domain/model/meteora-swap/entities/index.js +19 -0
  62. package/dist/src/domain/model/meteora-swap/entities/index.js.map +1 -0
  63. package/dist/src/domain/model/meteora-swap/index.d.ts +2 -0
  64. package/dist/src/domain/model/meteora-swap/index.js +19 -0
  65. package/dist/src/domain/model/meteora-swap/index.js.map +1 -0
  66. package/dist/src/domain/model/tx-token-payload/TxTokenPayload.d.ts +2 -1
  67. package/dist/src/domain/services/SlippageService.d.ts +4 -0
  68. package/dist/src/domain/services/SlippageService.js +13 -0
  69. package/dist/src/domain/services/SlippageService.js.map +1 -0
  70. package/dist/src/domain/services/index.d.ts +1 -0
  71. package/dist/src/domain/services/index.js +1 -0
  72. package/dist/src/domain/services/index.js.map +1 -1
  73. package/dist/tsconfig.tsbuildinfo +1 -1
  74. package/package.json +2 -2
@@ -2,7 +2,8 @@ export declare enum BlockchainSymbol {
2
2
  SOL = "SOL",
3
3
  ETH = "ETH",
4
4
  POLYGON = "POLYGON",
5
- BITCOIN = "BITCOIN"
5
+ BITCOIN = "BITCOIN",
6
+ BASE = "BASE"
6
7
  }
7
8
  export declare enum BlockchainEngineType {
8
9
  EVM = "EVM",
@@ -7,6 +7,7 @@ var BlockchainSymbol;
7
7
  BlockchainSymbol["ETH"] = "ETH";
8
8
  BlockchainSymbol["POLYGON"] = "POLYGON";
9
9
  BlockchainSymbol["BITCOIN"] = "BITCOIN";
10
+ BlockchainSymbol["BASE"] = "BASE";
10
11
  })(BlockchainSymbol = exports.BlockchainSymbol || (exports.BlockchainSymbol = {}));
11
12
  var BlockchainEngineType;
12
13
  (function (BlockchainEngineType) {
@@ -18,7 +19,9 @@ exports.blockchainEngineMap = new Map([
18
19
  [BlockchainSymbol.SOL, BlockchainEngineType.SOL],
19
20
  [BlockchainSymbol.ETH, BlockchainEngineType.EVM],
20
21
  [BlockchainSymbol.POLYGON, BlockchainEngineType.EVM],
22
+ [BlockchainSymbol.BASE, BlockchainEngineType.EVM],
21
23
  [BlockchainSymbol.BITCOIN, BlockchainEngineType.BTC],
24
+ [BlockchainSymbol.BASE, BlockchainEngineType.EVM],
22
25
  ]);
23
26
  function getDefaultBlockChainName() {
24
27
  return BlockchainSymbol.SOL;
@@ -1 +1 @@
1
- {"version":3,"file":"blockchain.js","sourceRoot":"","sources":["../../../../src/domain/constants/blockchain.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAKX;AALD,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;AACrB,CAAC,EALW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAK3B;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAEY,QAAA,mBAAmB,GAAG,IAAI,GAAG,CAGxC;IACA,CAAC,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC;IAChD,CAAC,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC;IAChD,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;IACpD,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;CACrD,CAAC,CAAC;AAEH,SAAgB,wBAAwB;IACtC,OAAO,gBAAgB,CAAC,GAAG,CAAC;AAC9B,CAAC;AAFD,4DAEC"}
1
+ {"version":3,"file":"blockchain.js","sourceRoot":"","sources":["../../../../src/domain/constants/blockchain.ts"],"names":[],"mappings":";;;AAAA,IAAY,gBAMX;AAND,WAAY,gBAAgB;IAC1B,+BAAW,CAAA;IACX,+BAAW,CAAA;IACX,uCAAmB,CAAA;IACnB,uCAAmB,CAAA;IACnB,iCAAa,CAAA;AACf,CAAC,EANW,gBAAgB,GAAhB,wBAAgB,KAAhB,wBAAgB,QAM3B;AAED,IAAY,oBAIX;AAJD,WAAY,oBAAoB;IAC9B,mCAAW,CAAA;IACX,mCAAW,CAAA;IACX,mCAAW,CAAA;AACb,CAAC,EAJW,oBAAoB,GAApB,4BAAoB,KAApB,4BAAoB,QAI/B;AAEY,QAAA,mBAAmB,GAAG,IAAI,GAAG,CAGxC;IACA,CAAC,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC;IAChD,CAAC,gBAAgB,CAAC,GAAG,EAAE,oBAAoB,CAAC,GAAG,CAAC;IAChD,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;IACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC;IACjD,CAAC,gBAAgB,CAAC,OAAO,EAAE,oBAAoB,CAAC,GAAG,CAAC;IACpD,CAAC,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,CAAC,GAAG,CAAC;CAClD,CAAC,CAAC;AAEH,SAAgB,wBAAwB;IACtC,OAAO,gBAAgB,CAAC,GAAG,CAAC;AAC9B,CAAC;AAFD,4DAEC"}
@@ -0,0 +1,4 @@
1
+ export declare enum ChainId {
2
+ BASE_SEPOLIA = 84532,
3
+ BASE = 8453
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ChainId = void 0;
4
+ var ChainId;
5
+ (function (ChainId) {
6
+ ChainId[ChainId["BASE_SEPOLIA"] = 84532] = "BASE_SEPOLIA";
7
+ ChainId[ChainId["BASE"] = 8453] = "BASE";
8
+ })(ChainId = exports.ChainId || (exports.ChainId = {}));
9
+ //# sourceMappingURL=chainId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chainId.js","sourceRoot":"","sources":["../../../../src/domain/constants/chainId.ts"],"names":[],"mappings":";;;AAAA,IAAY,OAGX;AAHD,WAAY,OAAO;IACjB,yDAAoB,CAAA;IACpB,wCAAW,CAAA;AACb,CAAC,EAHW,OAAO,GAAP,eAAO,KAAP,eAAO,QAGlB"}
@@ -3,6 +3,7 @@ export declare enum CurrencyType {
3
3
  DIGITAL = "DIGITAL"
4
4
  }
5
5
  export declare enum DefaultCurrencies {
6
- SOL = "SOL"
6
+ SOL = "SOL",
7
+ ETH = "ETH"
7
8
  }
8
9
  export declare const toDefaultCurrency: (currency: string) => DefaultCurrencies;
@@ -9,11 +9,15 @@ var CurrencyType;
9
9
  var DefaultCurrencies;
10
10
  (function (DefaultCurrencies) {
11
11
  DefaultCurrencies["SOL"] = "SOL";
12
+ DefaultCurrencies["ETH"] = "ETH";
12
13
  })(DefaultCurrencies = exports.DefaultCurrencies || (exports.DefaultCurrencies = {}));
13
14
  const toDefaultCurrency = (currency) => {
14
15
  if (currency === 'SOL') {
15
16
  return DefaultCurrencies.SOL;
16
17
  }
18
+ if (currency === 'ETH') {
19
+ return DefaultCurrencies.ETH;
20
+ }
17
21
  throw new Error(`Currency ${currency} is not supported`);
18
22
  };
19
23
  exports.toDefaultCurrency = toDefaultCurrency;
@@ -1 +1 @@
1
- {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../../src/domain/constants/currency.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,IAAY,iBAEX;AAFD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;AACb,CAAC,EAFW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAE5B;AAEM,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAqB,EAAE;IACvE,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,iBAAiB,CAAC,GAAG,CAAC;KAC9B;IACD,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,mBAAmB,CAAC,CAAC;AAC3D,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B"}
1
+ {"version":3,"file":"currency.js","sourceRoot":"","sources":["../../../../src/domain/constants/currency.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,6BAAa,CAAA;IACb,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB;AAED,IAAY,iBAGX;AAHD,WAAY,iBAAiB;IAC3B,gCAAW,CAAA;IACX,gCAAW,CAAA;AACb,CAAC,EAHW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAG5B;AAEM,MAAM,iBAAiB,GAAG,CAAC,QAAgB,EAAqB,EAAE;IACvE,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,iBAAiB,CAAC,GAAG,CAAC;KAC9B;IACD,IAAI,QAAQ,KAAK,KAAK,EAAE;QACtB,OAAO,iBAAiB,CAAC,GAAG,CAAC;KAC9B;IACD,MAAM,IAAI,KAAK,CAAC,YAAY,QAAQ,mBAAmB,CAAC,CAAC;AAC3D,CAAC,CAAC;AARW,QAAA,iBAAiB,qBAQ5B"}
@@ -1,4 +1,5 @@
1
1
  export declare enum CurveType {
2
2
  LINEAR_V1 = "LINEAR_V1",
3
- CONSTANT_PRODUCT_V1 = "CONSTANT_PRODUCT_V1"
3
+ CONSTANT_PRODUCT_V1 = "CONSTANT_PRODUCT_V1",
4
+ BASE_CONSTANT_PRODUCT_V1 = "BASE_CONSTANT_PRODUCT_V1"
4
5
  }
@@ -5,5 +5,6 @@ var CurveType;
5
5
  (function (CurveType) {
6
6
  CurveType["LINEAR_V1"] = "LINEAR_V1";
7
7
  CurveType["CONSTANT_PRODUCT_V1"] = "CONSTANT_PRODUCT_V1";
8
+ CurveType["BASE_CONSTANT_PRODUCT_V1"] = "BASE_CONSTANT_PRODUCT_V1";
8
9
  })(CurveType = exports.CurveType || (exports.CurveType = {}));
9
10
  //# sourceMappingURL=curveType.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"curveType.js","sourceRoot":"","sources":["../../../../src/domain/constants/curveType.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAGX;AAHD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,wDAA2C,CAAA;AAC7C,CAAC,EAHW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAGpB"}
1
+ {"version":3,"file":"curveType.js","sourceRoot":"","sources":["../../../../src/domain/constants/curveType.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAIX;AAJD,WAAY,SAAS;IACnB,oCAAuB,CAAA;IACvB,wDAA2C,CAAA;IAC3C,kEAAqD,CAAA;AACvD,CAAC,EAJW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAIpB"}
@@ -1,3 +1,4 @@
1
1
  export declare enum Dex {
2
- RAYDIUM = "RAYDIUM"
2
+ RAYDIUM = "RAYDIUM",
3
+ METEORA = "METEORA"
3
4
  }
@@ -4,5 +4,6 @@ exports.Dex = void 0;
4
4
  var Dex;
5
5
  (function (Dex) {
6
6
  Dex["RAYDIUM"] = "RAYDIUM";
7
+ Dex["METEORA"] = "METEORA";
7
8
  })(Dex = exports.Dex || (exports.Dex = {}));
8
9
  //# sourceMappingURL=dex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dex.js","sourceRoot":"","sources":["../../../../src/domain/constants/dex.ts"],"names":[],"mappings":";;;AAAA,IAAY,GAEX;AAFD,WAAY,GAAG;IACb,0BAAmB,CAAA;AACrB,CAAC,EAFW,GAAG,GAAH,WAAG,KAAH,WAAG,QAEd"}
1
+ {"version":3,"file":"dex.js","sourceRoot":"","sources":["../../../../src/domain/constants/dex.ts"],"names":[],"mappings":";;;AAAA,IAAY,GAGX;AAHD,WAAY,GAAG;IACb,0BAAmB,CAAA;IACnB,0BAAmB,CAAA;AACrB,CAAC,EAHW,GAAG,GAAH,WAAG,KAAH,WAAG,QAGd"}
@@ -19,3 +19,5 @@ export * from './fixedSide';
19
19
  export * from './migrationTarget';
20
20
  export * from './feeReceiverType';
21
21
  export * from './meteoraFees';
22
+ export * from './solanaNetwork';
23
+ export * from './chainId';
@@ -35,4 +35,6 @@ __exportStar(require("./fixedSide"), exports);
35
35
  __exportStar(require("./migrationTarget"), exports);
36
36
  __exportStar(require("./feeReceiverType"), exports);
37
37
  __exportStar(require("./meteoraFees"), exports);
38
+ __exportStar(require("./solanaNetwork"), exports);
39
+ __exportStar(require("./chainId"), exports);
38
40
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2DAAyC;AACzC,6CAA2B;AAC3B,8CAA4B;AAC5B,mDAAiC;AACjC,8CAA4B;AAC5B,mDAAiC;AACjC,6CAA2B;AAC3B,2CAAyB;AACzB,4DAA0C;AAC1C,0CAAwB;AACxB,oDAAkC;AAClC,6CAA2B;AAC3B,wCAAsB;AACtB,4CAA0B;AAC1B,mDAAiC;AACjC,iDAA+B;AAC/B,8CAA4B;AAC5B,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2DAAyC;AACzC,6CAA2B;AAC3B,8CAA4B;AAC5B,mDAAiC;AACjC,8CAA4B;AAC5B,mDAAiC;AACjC,6CAA2B;AAC3B,2CAAyB;AACzB,4DAA0C;AAC1C,0CAAwB;AACxB,oDAAkC;AAClC,6CAA2B;AAC3B,wCAAsB;AACtB,4CAA0B;AAC1B,mDAAiC;AACjC,iDAA+B;AAC/B,8CAA4B;AAC5B,oDAAkC;AAClC,oDAAkC;AAClC,gDAA8B;AAC9B,kDAAgC;AAChC,4CAA0B"}
@@ -1,4 +1,6 @@
1
1
  export declare enum MigrationDex {
2
2
  RAYDIUM = "RAYDIUM",
3
- METEORA = "METEORA"
3
+ METEORA = "METEORA",
4
+ UNISWAP = "UNISWAP"
4
5
  }
6
+ export declare const getDefaultMigrationDex: (symbol: string) => MigrationDex;
@@ -1,9 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MigrationDex = void 0;
3
+ exports.getDefaultMigrationDex = exports.MigrationDex = void 0;
4
+ const blockchain_1 = require("./blockchain");
4
5
  var MigrationDex;
5
6
  (function (MigrationDex) {
6
7
  MigrationDex["RAYDIUM"] = "RAYDIUM";
7
8
  MigrationDex["METEORA"] = "METEORA";
9
+ MigrationDex["UNISWAP"] = "UNISWAP";
8
10
  })(MigrationDex = exports.MigrationDex || (exports.MigrationDex = {}));
11
+ const getDefaultMigrationDex = (symbol) => {
12
+ switch (symbol) {
13
+ case blockchain_1.BlockchainSymbol.SOL:
14
+ return MigrationDex.RAYDIUM;
15
+ case blockchain_1.BlockchainSymbol.BASE:
16
+ return MigrationDex.UNISWAP;
17
+ default:
18
+ throw new Error(`Symbol ${symbol} is not supported`);
19
+ }
20
+ };
21
+ exports.getDefaultMigrationDex = getDefaultMigrationDex;
9
22
  //# sourceMappingURL=migrationDex.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"migrationDex.js","sourceRoot":"","sources":["../../../../src/domain/constants/migrationDex.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;AACrB,CAAC,EAHW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAGvB"}
1
+ {"version":3,"file":"migrationDex.js","sourceRoot":"","sources":["../../../../src/domain/constants/migrationDex.ts"],"names":[],"mappings":";;;AAAA,6CAAgD;AAEhD,IAAY,YAIX;AAJD,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;AACrB,CAAC,EAJW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAIvB;AAEM,MAAM,sBAAsB,GAAG,CAAC,MAAc,EAAgB,EAAE;IACrE,QAAQ,MAAM,EAAE;QACd,KAAK,6BAAgB,CAAC,GAAG;YACvB,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B,KAAK,6BAAgB,CAAC,IAAI;YACxB,OAAO,YAAY,CAAC,OAAO,CAAC;QAC9B;YACE,MAAM,IAAI,KAAK,CAAC,UAAU,MAAM,mBAAmB,CAAC,CAAC;KACxD;AACH,CAAC,CAAC;AATW,QAAA,sBAAsB,0BASjC"}
@@ -0,0 +1,4 @@
1
+ export declare enum SolanaNetwork {
2
+ MAINNET = "mainnet-beta",
3
+ DEVNET = "devnet"
4
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SolanaNetwork = void 0;
4
+ var SolanaNetwork;
5
+ (function (SolanaNetwork) {
6
+ SolanaNetwork["MAINNET"] = "mainnet-beta";
7
+ SolanaNetwork["DEVNET"] = "devnet";
8
+ })(SolanaNetwork = exports.SolanaNetwork || (exports.SolanaNetwork = {}));
9
+ //# sourceMappingURL=solanaNetwork.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"solanaNetwork.js","sourceRoot":"","sources":["../../../../src/domain/constants/solanaNetwork.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,yCAAwB,CAAA;IACxB,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
@@ -0,0 +1,23 @@
1
+ import BigNumber from '../../config/bigNumber';
2
+ import { AbstractCurve } from './AbstractCurve';
3
+ import { CalculationOptions, CurveDefaults, GetMarketCapOptions, GetPriceOptions } from './types';
4
+ export declare class BaseConstantProductCurveV1 extends AbstractCurve {
5
+ initialVirtualTokenReserves: bigint;
6
+ initialVirtualCollateralReserves: bigint;
7
+ collateralDecimals: number;
8
+ constantProduct: bigint;
9
+ dynamicThreshold: number;
10
+ maxThreshold: number;
11
+ marketCapToMinimalTokens: Map<bigint, bigint>;
12
+ readonly curveDefaults: CurveDefaults;
13
+ getTokensAmountFromCollateral(options: CalculationOptions): bigint;
14
+ getCollateralAmountFromTokens(options: CalculationOptions): bigint;
15
+ getCollateralPrice(options: GetPriceOptions): BigNumber;
16
+ getMarketCap(options: GetMarketCapOptions): bigint;
17
+ getDynamicThresholdFromMarketCap(marketCapThreshold: bigint): bigint;
18
+ private buyInToken;
19
+ private buyInCollateral;
20
+ private sellInToken;
21
+ private sellInCollateral;
22
+ private getCurrentReserves;
23
+ }
@@ -0,0 +1,141 @@
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.BaseConstantProductCurveV1 = void 0;
7
+ const bigNumber_1 = __importDefault(require("../../config/bigNumber"));
8
+ const AbstractCurve_1 = require("./AbstractCurve");
9
+ const constants_1 = require("../constants");
10
+ const services_1 = require("../services");
11
+ class BaseConstantProductCurveV1 extends AbstractCurve_1.AbstractCurve {
12
+ constructor() {
13
+ super(...arguments);
14
+ this.initialVirtualTokenReserves = BigInt(1e27);
15
+ this.initialVirtualCollateralReserves = BigInt(1e18);
16
+ this.collateralDecimals = 18;
17
+ this.constantProduct = this.initialVirtualTokenReserves * this.initialVirtualCollateralReserves;
18
+ this.dynamicThreshold = 80;
19
+ this.maxThreshold = 82;
20
+ this.marketCapToMinimalTokens = new Map([
21
+ [BigInt(30 * 1e18), BigInt(80 * 1e18)],
22
+ ]);
23
+ this.curveDefaults = {
24
+ type: constants_1.CurveType.BASE_CONSTANT_PRODUCT_V1,
25
+ totalSupply: BigInt(1e27),
26
+ tokenDecimals: 18,
27
+ minAllocationTokenAmount: (BigInt(1e27) * BigInt(this.dynamicThreshold)) / 100n,
28
+ maxAllocationTokenAmount: (BigInt(1e27) * BigInt(this.maxThreshold)) / 100n,
29
+ address: '0x0000000000000000000000000000000000000000',
30
+ };
31
+ }
32
+ getTokensAmountFromCollateral(options) {
33
+ const { amount, curvePosition, tradeDirection, platformFeeBps } = options;
34
+ if (tradeDirection === 'BUY') {
35
+ const collateralAmount = amount - (amount * BigInt(platformFeeBps)) / 10000n;
36
+ return this.buyInCollateral(collateralAmount, curvePosition);
37
+ }
38
+ const collateralAmount = amount + (amount * BigInt(platformFeeBps)) / 10000n;
39
+ return this.sellInCollateral(collateralAmount, curvePosition);
40
+ }
41
+ getCollateralAmountFromTokens(options) {
42
+ const { amount, curvePosition, tradeDirection, platformFeeBps } = options;
43
+ if (tradeDirection === 'BUY') {
44
+ const collateralAmount = this.buyInToken(amount, curvePosition);
45
+ return (collateralAmount + (collateralAmount * BigInt(platformFeeBps)) / 10000n);
46
+ }
47
+ const collateralAmount = this.sellInToken(amount, curvePosition);
48
+ return (collateralAmount - (collateralAmount * BigInt(platformFeeBps)) / 10000n);
49
+ }
50
+ getCollateralPrice(options) {
51
+ const { curvePosition, collateralDecimals } = options;
52
+ const finalCollateralDecimals = collateralDecimals ?? this.collateralDecimals;
53
+ const [currentVirtualTokenReserves, currentVirtualCollateralReserves] = this.getCurrentReserves(curvePosition);
54
+ const baseCollateral = BigInt(10 ** finalCollateralDecimals);
55
+ const price = new bigNumber_1.default(currentVirtualCollateralReserves.toString()).div(new bigNumber_1.default(currentVirtualTokenReserves.toString()));
56
+ const inBaseUnits = price.multipliedBy(new bigNumber_1.default(baseCollateral.toString()));
57
+ return inBaseUnits;
58
+ }
59
+ getMarketCap(options) {
60
+ try {
61
+ const { curvePosition, tokenDecimals, collateralDecimals } = options;
62
+ const base = new bigNumber_1.default(10);
63
+ const baseTokens = base.pow(tokenDecimals ?? this.curveDefaults.tokenDecimals);
64
+ const curvePositionDecimal = new bigNumber_1.default(curvePosition.toString());
65
+ const price = this.getCollateralPrice({
66
+ curvePosition,
67
+ collateralDecimals,
68
+ });
69
+ const cap = price
70
+ .multipliedBy(curvePositionDecimal)
71
+ .dividedBy(baseTokens);
72
+ return BigInt(cap.integerValue(bigNumber_1.default.ROUND_FLOOR).toString());
73
+ }
74
+ catch (error) {
75
+ throw new Error(`Calculation error: ${error}`);
76
+ }
77
+ }
78
+ getDynamicThresholdFromMarketCap(marketCapThreshold) {
79
+ const baseTokens = BigInt(10 ** this.curveDefaults.tokenDecimals);
80
+ let low = 300000000n * baseTokens;
81
+ let high = 1000000000n * baseTokens;
82
+ let mid;
83
+ while (low < high) {
84
+ mid = (low + high + 1n) / 2n;
85
+ const marketCap = this.getMarketCap({ curvePosition: mid });
86
+ if (marketCap === marketCapThreshold) {
87
+ low = mid;
88
+ break;
89
+ }
90
+ else if (marketCap < marketCapThreshold) {
91
+ low = mid;
92
+ }
93
+ else {
94
+ high = mid - 1n;
95
+ }
96
+ }
97
+ while (this.getMarketCap({ curvePosition: low }) >= marketCapThreshold &&
98
+ low > 0n) {
99
+ low -= 1n;
100
+ }
101
+ return low + 1n;
102
+ }
103
+ buyInToken(tokenAmount, curvePosition) {
104
+ const [currentVirtualTokenReserves, currentVirtualCollateralReserves] = this.getCurrentReserves(curvePosition);
105
+ const newTokenReserves = currentVirtualTokenReserves - tokenAmount;
106
+ const ratio = this.constantProduct / newTokenReserves;
107
+ const lamportsToSpend = ratio - currentVirtualCollateralReserves;
108
+ return lamportsToSpend;
109
+ }
110
+ buyInCollateral(collateralAmount, curvePosition) {
111
+ const [currentVirtualTokenReserves, currentVirtualCollateralReserves] = this.getCurrentReserves(curvePosition);
112
+ const newCollateralReserves = currentVirtualCollateralReserves + collateralAmount;
113
+ const ratio = this.constantProduct / newCollateralReserves;
114
+ const tokensToBuy = currentVirtualTokenReserves - ratio;
115
+ return tokensToBuy;
116
+ }
117
+ sellInToken(tokenAmount, curvePosition) {
118
+ const [currentVirtualTokenReserves, currentVirtualCollateralReserves] = this.getCurrentReserves(curvePosition);
119
+ const newTokenReserves = currentVirtualTokenReserves + tokenAmount;
120
+ const ratio = this.constantProduct / newTokenReserves;
121
+ const lamportsToReceive = currentVirtualCollateralReserves - ratio;
122
+ return lamportsToReceive;
123
+ }
124
+ sellInCollateral(collateralAmount, curvePosition) {
125
+ const [currentVirtualTokenReserves, currentVirtualCollateralReserves] = this.getCurrentReserves(curvePosition);
126
+ const newCollateralReserves = currentVirtualCollateralReserves - collateralAmount;
127
+ const ratio = this.constantProduct / newCollateralReserves;
128
+ const tokensToSell = ratio - currentVirtualTokenReserves;
129
+ return tokensToSell;
130
+ }
131
+ getCurrentReserves(curvePosition) {
132
+ const currentVirtualTokenReserves = this.initialVirtualTokenReserves - curvePosition;
133
+ const currentVirtualCollateralReserves = (0, bigNumber_1.default)(this.constantProduct.toString()).div((0, bigNumber_1.default)(currentVirtualTokenReserves.toString()));
134
+ return [
135
+ currentVirtualTokenReserves,
136
+ services_1.AmountService.decimalToBigInt(currentVirtualCollateralReserves),
137
+ ];
138
+ }
139
+ }
140
+ exports.BaseConstantProductCurveV1 = BaseConstantProductCurveV1;
141
+ //# sourceMappingURL=BaseConstantProductCurveV1.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BaseConstantProductCurveV1.js","sourceRoot":"","sources":["../../../../src/domain/curves/BaseConstantProductCurveV1.ts"],"names":[],"mappings":";;;;;;AAAA,uEAA+C;AAC/C,mDAAgD;AAOhD,4CAAyC;AACzC,0CAA4C;AAE5C,MAAa,0BAA2B,SAAQ,6BAAa;IAA7D;;QACE,gCAA2B,GAAW,MAAM,CAAC,IAAI,CAAC,CAA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zC,MAAM,gBAAgB,GAAG,2BAA2B,GAAG,WAAW,CAAC;QACnE,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,GAAG,gBAAgB,CAAC;QACtD,MAAM,iBAAiB,GAAG,gCAAgC,GAAG,KAAK,CAAC;QACnE,OAAO,iBAAiB,CAAC;IAC3B,CAAC;IAEO,gBAAgB,CACtB,gBAAwB,EACxB,aAAqB;QAErB,MAAM,CAAC,2BAA2B,EAAE,gCAAgC,CAAC,GACnE,IAAI,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,qBAAqB,GACzB,gCAAgC,GAAG,gBAAgB,CAAC;QACtD,MAAM,KAAK,GAAG,IAAI,CAAC,eAAe,GAAG,qBAAqB,CAAC;QAC3D,MAAM,YAAY,GAAG,KAAK,GAAG,2BAA2B,CAAC;QACzD,OAAO,YAAY,CAAC;IACtB,CAAC;IAEO,kBAAkB,CAAC,aAAqB;QAC9C,MAAM,2BAA2B,GAC/B,IAAI,CAAC,2BAA2B,GAAG,aAAa,CAAC;QACnD,MAAM,gCAAgC,GAAG,IAAA,mBAAS,EAChD,IAAI,CAAC,eAAe,CAAC,QAAQ,EAAE,CAChC,CAAC,GAAG,CAAC,IAAA,mBAAS,EAAC,2BAA2B,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC;QACzD,OAAO;YACL,2BAA2B;YAC3B,wBAAa,CAAC,eAAe,CAAC,gCAAgC,CAAC;SAChE,CAAC;IACJ,CAAC;CACF;AAvLD,gEAuLC"}
@@ -4,6 +4,7 @@ exports.getCurve = void 0;
4
4
  const constants_1 = require("../constants");
5
5
  const ConstantProductCurveV1_1 = require("./ConstantProductCurveV1");
6
6
  const LinearCurveV1_1 = require("./LinearCurveV1");
7
+ const BaseConstantProductCurveV1_1 = require("./BaseConstantProductCurveV1");
7
8
  const getCurve = (curveType) => {
8
9
  if (curveType === constants_1.CurveType.LINEAR_V1) {
9
10
  return new LinearCurveV1_1.LinearCurveV1();
@@ -11,6 +12,9 @@ const getCurve = (curveType) => {
11
12
  if (curveType === constants_1.CurveType.CONSTANT_PRODUCT_V1) {
12
13
  return new ConstantProductCurveV1_1.ConstantProductCurveV1();
13
14
  }
15
+ if (curveType === constants_1.CurveType.BASE_CONSTANT_PRODUCT_V1) {
16
+ return new BaseConstantProductCurveV1_1.BaseConstantProductCurveV1();
17
+ }
14
18
  throw new Error('Curve type not supported');
15
19
  };
16
20
  exports.getCurve = getCurve;
@@ -1 +1 @@
1
- {"version":3,"file":"getCurve.js","sourceRoot":"","sources":["../../../../src/domain/curves/getCurve.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAEzC,qEAAkE;AAElE,mDAAgD;AAEzC,MAAM,QAAQ,GAAG,CAAC,SAAoB,EAA6B,EAAE;IAC1E,IAAI,SAAS,KAAK,qBAAS,CAAC,SAAS,EAAE;QACrC,OAAO,IAAI,6BAAa,EAAE,CAAC;KAC5B;IAED,IAAI,SAAS,KAAK,qBAAS,CAAC,mBAAmB,EAAE;QAC/C,OAAO,IAAI,+CAAsB,EAAE,CAAC;KACrC;IACD,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAC9C,CAAC,CAAC;AATW,QAAA,QAAQ,YASnB"}
1
+ {"version":3,"file":"getCurve.js","sourceRoot":"","sources":["../../../../src/domain/curves/getCurve.ts"],"names":[],"mappings":";;;AAAA,4CAAyC;AAEzC,qEAAkE;AAElE,mDAAgD;AAChD,6EAA0E;AAEnE,MAAM,QAAQ,GAAG,CAAC,SAAoB,EAA6B,EAAE;IAC1E,IAAI,SAAS,KAAK,qBAAS,CAAC,SAAS,EAAE;QACrC,OAAO,IAAI,6BAAa,EAAE,CAAC;KAC5B;IAED,IAAI,SAAS,KAAK,qBAAS,CAAC,mBAAmB,EAAE;QAC/C,OAAO,IAAI,+CAAsB,EAAE,CAAC;KACrC;IAED,IAAI,SAAS,KAAK,qBAAS,CAAC,wBAAwB,EAAE;QACpD,OAAO,IAAI,uDAA0B,EAAE,CAAC;KACzC;IAED,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAC9C,CAAC,CAAC;AAdW,QAAA,QAAQ,YAcnB"}
@@ -4,3 +4,4 @@ export * from './types';
4
4
  export * from './getCurve';
5
5
  export * from './AbstractCurve';
6
6
  export * from './ConstantProductCurveV1';
7
+ export * from './BaseConstantProductCurveV1';
@@ -20,4 +20,5 @@ __exportStar(require("./types"), exports);
20
20
  __exportStar(require("./getCurve"), exports);
21
21
  __exportStar(require("./AbstractCurve"), exports);
22
22
  __exportStar(require("./ConstantProductCurveV1"), exports);
23
+ __exportStar(require("./BaseConstantProductCurveV1"), exports);
23
24
  //# 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"}
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,+DAA6C"}
@@ -13,3 +13,4 @@ export * from './tx-token-payload';
13
13
  export * from './raydium-swap';
14
14
  export * from './top-token-holders';
15
15
  export * from './lp-token-lock-details';
16
+ export * from './meteora-swap';
@@ -29,4 +29,5 @@ __exportStar(require("./tx-token-payload"), exports);
29
29
  __exportStar(require("./raydium-swap"), exports);
30
30
  __exportStar(require("./top-token-holders"), exports);
31
31
  __exportStar(require("./lp-token-lock-details"), exports);
32
+ __exportStar(require("./meteora-swap"), exports);
32
33
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,+CAA6B;AAC7B,sDAAoC;AACpC,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,uCAAqB;AACrB,qDAAmC;AACnC,iDAA+B;AAC/B,sDAAoC;AACpC,0DAAwC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/domain/model/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,+CAA6B;AAC7B,sDAAoC;AACpC,wCAAsB;AACtB,6CAA2B;AAC3B,0CAAwB;AACxB,4CAA0B;AAC1B,yCAAuB;AACvB,yCAAuB;AACvB,+CAA6B;AAC7B,uCAAqB;AACrB,qDAAmC;AACnC,iDAA+B;AAC/B,sDAAoC;AACpC,0DAAwC;AACxC,iDAA+B"}
@@ -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"}
@@ -0,0 +1,7 @@
1
+ export declare class MeteoraSwapGetPriceDto {
2
+ poolId: string;
3
+ mintFrom: string;
4
+ mintTo: string;
5
+ amountIn: string;
6
+ slippageBps: number;
7
+ }
@@ -0,0 +1,47 @@
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.MeteoraSwapGetPriceDto = void 0;
13
+ const class_transformer_1 = require("class-transformer");
14
+ const class_validator_1 = require("class-validator");
15
+ const validations_1 = require("../../../validations");
16
+ class MeteoraSwapGetPriceDto {
17
+ }
18
+ __decorate([
19
+ (0, class_validator_1.IsString)(),
20
+ (0, class_validator_1.IsNotEmpty)(),
21
+ __metadata("design:type", String)
22
+ ], MeteoraSwapGetPriceDto.prototype, "poolId", void 0);
23
+ __decorate([
24
+ (0, class_validator_1.IsString)(),
25
+ (0, class_validator_1.IsNotEmpty)(),
26
+ __metadata("design:type", String)
27
+ ], MeteoraSwapGetPriceDto.prototype, "mintFrom", void 0);
28
+ __decorate([
29
+ (0, class_validator_1.IsString)(),
30
+ (0, class_validator_1.IsNotEmpty)(),
31
+ __metadata("design:type", String)
32
+ ], MeteoraSwapGetPriceDto.prototype, "mintTo", void 0);
33
+ __decorate([
34
+ (0, class_transformer_1.Transform)(({ value }) => BigInt(value)),
35
+ (0, class_validator_1.IsNotEmpty)(),
36
+ (0, class_validator_1.Validate)(validations_1.MinBigInt),
37
+ __metadata("design:type", String)
38
+ ], MeteoraSwapGetPriceDto.prototype, "amountIn", void 0);
39
+ __decorate([
40
+ (0, class_validator_1.IsNumber)(),
41
+ (0, class_validator_1.IsNotEmpty)(),
42
+ (0, class_validator_1.Min)(0),
43
+ (0, class_validator_1.Max)(10000),
44
+ __metadata("design:type", Number)
45
+ ], MeteoraSwapGetPriceDto.prototype, "slippageBps", void 0);
46
+ exports.MeteoraSwapGetPriceDto = MeteoraSwapGetPriceDto;
47
+ //# sourceMappingURL=MeteoraSwapGetPrice.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MeteoraSwapGetPrice.dto.js","sourceRoot":"","sources":["../../../../../../src/domain/model/meteora-swap/dtos/MeteoraSwapGetPrice.dto.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yDAA8C;AAC9C,qDAOyB;AACzB,sDAAiD;AAEjD,MAAa,sBAAsB;CAuBlC;AAtBC;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACE;AAEf;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;wDACI;AAEjB;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;;sDACE;AAEf;IAAC,IAAA,6BAAS,EAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvC,IAAA,4BAAU,GAAE;IACZ,IAAA,0BAAQ,EAAC,uBAAS,CAAC;;wDACH;AAEjB;IAAC,IAAA,0BAAQ,GAAE;IACV,IAAA,4BAAU,GAAE;IACZ,IAAA,qBAAG,EAAC,CAAC,CAAC;IACN,IAAA,qBAAG,EAAC,KAAK,CAAC;;2DACS;AAtBtB,wDAuBC"}
@@ -0,0 +1,13 @@
1
+ import { TxPriorityDto } from '../../tx';
2
+ export declare class MeteoraSwapPrepareDto {
3
+ sender: string;
4
+ poolId: string;
5
+ mintFrom: string;
6
+ mintTo: string;
7
+ amountIn: string;
8
+ feeAmount: string;
9
+ feeMintAddress: string;
10
+ priorityFee?: number;
11
+ priority?: TxPriorityDto;
12
+ amountOut: string;
13
+ }