@sonarwatch/portfolio-plugins 0.14.151 → 0.14.152

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 (126) hide show
  1. package/CHANGELOG.md +2232 -2228
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/plugins/allbridge/constants.d.ts +0 -6
  5. package/src/plugins/allbridge/constants.js +1 -9
  6. package/src/plugins/allbridge/constants.js.map +1 -1
  7. package/src/plugins/allbridge/helpers.d.ts +1 -1
  8. package/src/plugins/allbridge/helpers.js +1 -3
  9. package/src/plugins/allbridge/helpers.js.map +1 -1
  10. package/src/plugins/allbridge/positionsFetcher.js +2 -1
  11. package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
  12. package/src/plugins/allbridge/structs.d.ts +13 -0
  13. package/src/plugins/allbridge/structs.js +14 -0
  14. package/src/plugins/allbridge/structs.js.map +1 -0
  15. package/src/plugins/allbridge/types.d.ts +0 -6
  16. package/src/plugins/balancer/helpers/pools.js +21 -21
  17. package/src/plugins/bonfida/constants.js +1 -1
  18. package/src/plugins/bonfida/constants.js.map +1 -1
  19. package/src/plugins/divvy/constants.d.ts +0 -2
  20. package/src/plugins/divvy/constants.js +1 -7
  21. package/src/plugins/divvy/constants.js.map +1 -1
  22. package/src/plugins/divvy/houseJob.js +6 -3
  23. package/src/plugins/divvy/houseJob.js.map +1 -1
  24. package/src/plugins/divvy/housePoolFetcher.js +9 -11
  25. package/src/plugins/divvy/housePoolFetcher.js.map +1 -1
  26. package/src/plugins/divvy/stakingFetcher.js +7 -12
  27. package/src/plugins/divvy/stakingFetcher.js.map +1 -1
  28. package/src/plugins/divvy/structs.d.ts +57 -0
  29. package/src/plugins/divvy/structs.js +57 -0
  30. package/src/plugins/divvy/structs.js.map +1 -0
  31. package/src/plugins/elemental/constants.d.ts +4 -2
  32. package/src/plugins/elemental/constants.js +3 -7
  33. package/src/plugins/elemental/constants.js.map +1 -1
  34. package/src/plugins/elemental/filters.d.ts +0 -1
  35. package/src/plugins/elemental/filters.js +1 -6
  36. package/src/plugins/elemental/filters.js.map +1 -1
  37. package/src/plugins/elemental/helpers.js +2 -2
  38. package/src/plugins/elemental/helpers.js.map +1 -1
  39. package/src/plugins/elemental/poolsJob.js +4 -4
  40. package/src/plugins/elemental/poolsJob.js.map +1 -1
  41. package/src/plugins/ensofi/constants.d.ts +4 -2
  42. package/src/plugins/ensofi/constants.js +3 -7
  43. package/src/plugins/ensofi/constants.js.map +1 -1
  44. package/src/plugins/ensofi/idl.d.ts +149 -6
  45. package/src/plugins/ensofi/idl.js +1074 -61
  46. package/src/plugins/ensofi/idl.js.map +1 -1
  47. package/src/plugins/ensofi/solanaLoansFetcher.js +23 -37
  48. package/src/plugins/ensofi/solanaLoansFetcher.js.map +1 -1
  49. package/src/plugins/ensofi/structs.d.ts +58 -0
  50. package/src/plugins/ensofi/structs.js +60 -0
  51. package/src/plugins/ensofi/structs.js.map +1 -0
  52. package/src/plugins/jupiter/governance/constants.js +3 -3
  53. package/src/plugins/jupiter/governance/constants.js.map +1 -1
  54. package/src/plugins/jupiter/launchpad/constants.d.ts +1 -0
  55. package/src/plugins/jupiter/launchpad/constants.js +8 -7
  56. package/src/plugins/jupiter/launchpad/constants.js.map +1 -1
  57. package/src/plugins/jupiter/pricingJob.js +2 -1
  58. package/src/plugins/jupiter/pricingJob.js.map +1 -1
  59. package/src/plugins/orca/getWhirlpoolPositions.js +7 -7
  60. package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
  61. package/src/plugins/orca/types.d.ts +2 -0
  62. package/src/plugins/picasso/constants.d.ts +0 -2
  63. package/src/plugins/picasso/constants.js +1 -7
  64. package/src/plugins/picasso/constants.js.map +1 -1
  65. package/src/plugins/picasso/helpers.js +7 -4
  66. package/src/plugins/picasso/helpers.js.map +1 -1
  67. package/src/plugins/picasso/structs.d.ts +39 -0
  68. package/src/plugins/picasso/structs.js +37 -0
  69. package/src/plugins/picasso/structs.js.map +1 -0
  70. package/src/plugins/picasso/unstakingNftsJob.js +2 -1
  71. package/src/plugins/picasso/unstakingNftsJob.js.map +1 -1
  72. package/src/plugins/picasso/unstakingPositionsFetcher.js +4 -4
  73. package/src/plugins/picasso/unstakingPositionsFetcher.js.map +1 -1
  74. package/src/plugins/raydium/ammV2ApiJob.js +24 -0
  75. package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
  76. package/src/plugins/raydium/constants.d.ts +1 -0
  77. package/src/plugins/raydium/constants.js +2 -1
  78. package/src/plugins/raydium/constants.js.map +1 -1
  79. package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
  80. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  81. package/src/plugins/raydium/types.d.ts +14 -4
  82. package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
  83. package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
  84. package/src/plugins/sharky/collectionsJob.js +8 -9
  85. package/src/plugins/sharky/collectionsJob.js.map +1 -1
  86. package/src/plugins/sharky/constants.d.ts +0 -2
  87. package/src/plugins/sharky/constants.js +1 -7
  88. package/src/plugins/sharky/constants.js.map +1 -1
  89. package/src/plugins/sharky/loansFetcher.js +25 -19
  90. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  91. package/src/plugins/sharky/structs.d.ts +96 -0
  92. package/src/plugins/sharky/structs.js +103 -0
  93. package/src/plugins/sharky/structs.js.map +1 -0
  94. package/src/plugins/sharky/types.d.ts +0 -15
  95. package/src/plugins/sharky/types.js +0 -8
  96. package/src/plugins/sharky/types.js.map +1 -1
  97. package/src/plugins/stabble/constants.d.ts +0 -3
  98. package/src/plugins/stabble/constants.js +1 -13
  99. package/src/plugins/stabble/constants.js.map +1 -1
  100. package/src/plugins/stabble/poolsJob.js +14 -9
  101. package/src/plugins/stabble/poolsJob.js.map +1 -1
  102. package/src/plugins/stabble/structs.d.ts +43 -0
  103. package/src/plugins/stabble/structs.js +42 -0
  104. package/src/plugins/stabble/structs.js.map +1 -0
  105. package/src/plugins/sushiswap/helpers.js +24 -24
  106. package/src/plugins/uniswap-v2/helpers.js +22 -22
  107. package/src/utils/sei/constants.js +8 -8
  108. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  109. package/src/utils/solana/beets/ParsedGpa.d.ts +1 -0
  110. package/src/utils/solana/beets/ParsedGpa.js +9 -0
  111. package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
  112. package/src/plugins/divvy/types.d.ts +0 -28
  113. package/src/plugins/divvy/types.js +0 -3
  114. package/src/plugins/divvy/types.js.map +0 -1
  115. package/src/plugins/picasso/types.d.ts +0 -17
  116. package/src/plugins/picasso/types.js +0 -3
  117. package/src/plugins/picasso/types.js.map +0 -1
  118. package/src/plugins/sharky/filters.d.ts +0 -8
  119. package/src/plugins/sharky/filters.js +0 -43
  120. package/src/plugins/sharky/filters.js.map +0 -1
  121. package/src/plugins/stabble/filters.d.ts +0 -5
  122. package/src/plugins/stabble/filters.js +0 -20
  123. package/src/plugins/stabble/filters.js.map +0 -1
  124. package/src/plugins/stabble/types.d.ts +0 -40
  125. package/src/plugins/stabble/types.js +0 -3
  126. package/src/plugins/stabble/types.js.map +0 -1
@@ -201,9 +201,9 @@ export type PoolInfo = {
201
201
  feeRate: number;
202
202
  openTime: string;
203
203
  tvl: number;
204
- day: Day;
205
- week: Day;
206
- month: Day;
204
+ day: Stats;
205
+ week: Stats;
206
+ month: Stats;
207
207
  pooltype: string[];
208
208
  rewardDefaultInfos: number[];
209
209
  farmUpcomingCount: number;
@@ -214,8 +214,18 @@ export type PoolInfo = {
214
214
  lpPrice: number;
215
215
  lpAmount: number;
216
216
  burnPercent: number;
217
+ config?: {
218
+ id: string;
219
+ index: number;
220
+ protocolFeeRate: number;
221
+ tradeFeeRate: number;
222
+ tickSpacing: number;
223
+ fundFeeRate: number;
224
+ defaultRange: number;
225
+ defaultRangePoint: number[];
226
+ };
217
227
  };
218
- export type Day = {
228
+ export type Stats = {
219
229
  volume: number;
220
230
  volumeQuote: number;
221
231
  volumeFee: number;
@@ -28,7 +28,7 @@ const capitalClaimDuration = 14 * 24 * 60 * 60 * 1000;
28
28
  const capitalClaimEnd = claimStart.plus(capitalClaimDuration);
29
29
  const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
30
30
  const claimProofBase = yield axios_1.default
31
- .get(`${constants_1.lfgApiBaseUrl}/CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}`, {
31
+ .get(`${constants_1.lfgApiBaseUrl}/CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}?${constants_1.jupApiToken !== null && constants_1.jupApiToken !== void 0 ? constants_1.jupApiToken : ''}`, {
32
32
  timeout: 5000,
33
33
  })
34
34
  .catch((e) => {
@@ -88,7 +88,7 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
88
88
  ];
89
89
  // Check Earnestness
90
90
  const claimProofEarn = yield axios_1.default
91
- .get(`${constants_1.lfgApiBaseUrl}/earnestness-CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}`, {
91
+ .get(`${constants_1.lfgApiBaseUrl}/earnestness-CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu/${owner}?${constants_1.jupApiToken !== null && constants_1.jupApiToken !== void 0 ? constants_1.jupApiToken : ''}`, {
92
92
  timeout: 5000,
93
93
  })
94
94
  .catch((e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"s1AirdropFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/s1AirdropFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,kDAA6C;AAC7C,+DAAuD;AACvD,yDAK8B;AAC9B,oFAAiF;AACjF,iDAAsD;AAEtD,8DAA8E;AAC9E,2CAKqB;AAErB,MAAM,UAAU,GAAG,IAAI,sBAAS,CAAC,aAAa,CAAC,CAAC;AAChD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AAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACrE,CAAC;aAAM,CAAC;YACN,MAAM,KAAK,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;iBACpC,KAAK,CAAC,UAAU,CAAC;iBACjB,SAAS,CAAC,oBAAoB,CAAC;iBAC/B,IAAI,CAAC,CAAC,CAAC,CAAC;YACX,aAAa,GAAG,IAAI,sBAAS,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACzE,CAAC;QACD,KAAK,CAAC,IAAI,CAAC;YACT,MAAM,EAAE,aAAa,CAAC,GAAG,CAAC,SAAA,EAAE,EAAI,yBAAa,CAAA,CAAC,CAAC,QAAQ,EAAE;YACzD,SAAS,EAAE,sBAAsB,KAAK,IAAI;YAC1C,KAAK,EAAE,OAAO;YACd,OAAO,EAAE,qBAAS;SACnB,CAAC,CAAC;IACL,CAAC;IAED,OAAO,IAAA,8BAAa,EAAC;QACnB,OAAO,EAAE,4BAAgB;QACzB,KAAK;KACN,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEW,QAAA,cAAc,GAAmB;IAC5C,EAAE,EAAE,4BAAgB,CAAC,EAAE;IACvB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEW,QAAA,OAAO,GAAG,IAAA,wCAAuB,EAC5C,sBAAc,EACd,oBAAQ,CAAC,EAAE,EACX,GAAG,oBAAQ,CAAC,EAAE,UAAU,EACxB,4BAAgB,CAAC,QAAQ,CAC1B,CAAC"}
@@ -16,9 +16,10 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const axios_1 = __importDefault(require("axios"));
17
17
  const web3_js_1 = require("@solana/web3.js");
18
18
  const constants_1 = require("./constants");
19
- const types_1 = require("./types");
20
19
  const solana_1 = require("../../utils/solana");
21
20
  const clients_1 = require("../../utils/clients");
21
+ const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
22
+ const structs_1 = require("./structs");
22
23
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
23
24
  const connection = (0, clients_1.getClientSolana)();
24
25
  const [floorPrices, orderBooks] = yield Promise.all([
@@ -29,15 +30,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
29
30
  .catch((err) => {
30
31
  throw Error(`SHARKY_API ERR: ${err}`);
31
32
  }),
32
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, [
33
- {
34
- dataSize: constants_1.orderBookDataSize,
35
- },
36
- ]),
33
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.orderBookStruct, constants_1.sharkyProgram)
34
+ .addDataSizeFilter(constants_1.orderBookDataSize)
35
+ .run(),
37
36
  ]);
38
37
  if (!floorPrices.data || !orderBooks)
39
38
  return;
40
- const nftLists = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, types_1.nftListStruct, orderBooks.map((ob) => new web3_js_1.PublicKey(ob.orderBookType.nftList.listAccount)), {
39
+ const nftLists = yield (0, solana_1.getParsedMultipleAccountsInfo)(connection, structs_1.nftListStruct, orderBooks.map((ob) => new web3_js_1.PublicKey(ob.orderBookType.collectionKey)), {
41
40
  dataSlice: { offset: 0, length: 231 },
42
41
  });
43
42
  const collectionNamesAsMap = new Map();
@@ -49,9 +48,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
49
48
  const collections = [];
50
49
  orderBooks.forEach((orderBook) => {
51
50
  var _a, _b, _c;
52
- if (!orderBook || !orderBook.orderBookType.nftList.listAccount)
51
+ if (!orderBook || !orderBook.orderBookType.collectionKey)
53
52
  return;
54
- const collectionName = collectionNamesAsMap.get(orderBook.orderBookType.nftList.listAccount);
53
+ const collectionName = collectionNamesAsMap.get(orderBook.orderBookType.collectionKey.toString());
55
54
  if (!collectionName)
56
55
  return;
57
56
  collections.push({
@@ -1 +1 @@
1
- {"version":3,"file":"collectionsJob.js","sour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oB,CAAC,GAAG,CACtB,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,EACzB,IAAA,wBAAe,EAAC,OAAO,CAAC,cAAc,CAAC,CACxC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAiB,EAAE,CAAC;IAErC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;;QAC/B,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW;YAAE,OAAO;QACvE,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAC7C,SAAS,CAAC,aAAa,CAAC,OAAO,CAAC,WAAW,CAC5C,CAAC;QACF,IAAI,CAAC,cAAc;YAAE,OAAO;QAC5B,WAAW,CAAC,IAAI,CAAC;YACf,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;YACtC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,aAAa;YAClE,SAAS,EAAE,MAAA,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,MAAM,0CAAE,IAAI;SACtE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,WAAW,EAAE;QACpD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"collectionsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/collectionsJob.ts"],"names":[],"mappings":";;;;;;;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AAE,EACzB,IAAA,wBAAe,EAAC,OAAO,CAAC,cAAc,CAAC,CACxC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAiB,EAAE,CAAC;IAErC,UAAU,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;;QAC/B,IAAI,CAAC,SAAS,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,aAAa;YAAE,OAAO;QACjE,MAAM,cAAc,GAAG,oBAAoB,CAAC,GAAG,CAC7C,SAAS,CAAC,aAAa,CAAC,aAAa,CAAC,QAAQ,EAAE,CACjD,CAAC;QACF,IAAI,CAAC,cAAc;YAAE,OAAO;QAC5B,WAAW,CAAC,IAAI,CAAC;YACf,SAAS,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE;YACtC,IAAI,EAAE,cAAc;YACpB,KAAK,EAAE,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,aAAa;YAClE,SAAS,EAAE,MAAA,MAAA,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,0CAAE,MAAM,0CAAE,IAAI;SACtE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,OAAO,CAAC,+BAAmB,EAAE,WAAW,EAAE;QACpD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -2,7 +2,6 @@
2
2
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
3
  import { Platform } from '@sonarwatch/portfolio-core';
4
4
  import { PublicKey } from '@solana/web3.js';
5
- import { IdlItem } from '@solanafm/explorer-kit-idls';
6
5
  export declare const platformId = "sharky";
7
6
  export declare const platform: Platform;
8
7
  export declare const collectionsCacheKey = "sharky-collections";
@@ -10,4 +9,3 @@ export declare const cachePrefix = "sharky";
10
9
  export declare const sharkyProgram: PublicKey;
11
10
  export declare const loanDataSize = 338;
12
11
  export declare const orderBookDataSize = 10240;
13
- export declare const sharkyIdlItem: IdlItem;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.sharkyIdlItem = exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
3
+ exports.orderBookDataSize = exports.loanDataSize = exports.sharkyProgram = exports.cachePrefix = exports.collectionsCacheKey = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
- const idl_1 = require("./idl");
6
5
  exports.platformId = 'sharky';
7
6
  exports.platform = {
8
7
  id: exports.platformId,
@@ -21,9 +20,4 @@ exports.cachePrefix = `${exports.platformId}`;
21
20
  exports.sharkyProgram = new web3_js_1.PublicKey('SHARKobtfF1bHhxD2eqftjHBdVSCbKo9JtgK71FhELP');
22
21
  exports.loanDataSize = 338;
23
22
  exports.orderBookDataSize = 10240;
24
- exports.sharkyIdlItem = {
25
- programId: exports.sharkyProgram.toString(),
26
- idl: idl_1.SharkyIDL,
27
- idlType: 'anchor',
28
- };
29
23
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,+BAAkC;AAErB,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EACH,4EAA4E;IAC9E,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;IAC7D,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EACT,yJAAyJ;CAC5J,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC;AAE1B,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,eAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EACH,4EAA4E;IAC9E,OAAO,EAAE,oBAAoB;IAC7B,OAAO,EAAE,8BAA8B;IACvC,WAAW,EAAE,QAAQ,EAAE,sCAAsC;IAC7D,OAAO,EAAE,6BAA6B;IACtC,MAAM,EAAE,6BAA6B;IACrC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EACT,yJAAyJ;CAC5J,CAAC;AACW,QAAA,mBAAmB,GAAG,GAAG,kBAAU,cAAc,CAAC;AAClD,QAAA,WAAW,GAAG,GAAG,kBAAU,EAAE,CAAC;AAE9B,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,YAAY,GAAG,GAAG,CAAC;AACnB,QAAA,iBAAiB,GAAG,KAAK,CAAC"}
@@ -16,22 +16,30 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
17
  const constants_1 = require("./constants");
18
18
  const clients_1 = require("../../utils/clients");
19
- const solana_1 = require("../../utils/solana");
20
- const filters_1 = require("./filters");
21
19
  const MemoizedCache_1 = require("../../utils/misc/MemoizedCache");
22
20
  const arrayToMap_1 = require("../../utils/misc/arrayToMap");
23
21
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
22
+ const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
23
+ const structs_1 = require("./structs");
24
24
  const collectionsMemo = new MemoizedCache_1.MemoizedCache(constants_1.collectionsCacheKey, {
25
25
  prefix: constants_1.cachePrefix,
26
26
  networkId: portfolio_core_1.NetworkId.solana,
27
27
  }, (arr) => (0, arrayToMap_1.arrayToMap)(arr || [], 'orderBook'));
28
28
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
29
29
  const connection = (0, clients_1.getClientSolana)();
30
- const [filterA, filterB, filterC] = (0, filters_1.getLoanFilters)(owner);
31
30
  const accounts = (yield Promise.all([
32
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterA),
33
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterB),
34
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.sharkyIdlItem, filterC),
31
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
32
+ .addRawFilter(115, owner)
33
+ .addDataSizeFilter(constants_1.loanDataSize)
34
+ .run(),
35
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
36
+ .addRawFilter(147, owner)
37
+ .addDataSizeFilter(constants_1.loanDataSize)
38
+ .run(),
39
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.loanStruct, constants_1.sharkyProgram)
40
+ .addRawFilter(83, owner)
41
+ .addDataSizeFilter(constants_1.loanDataSize)
42
+ .run(),
35
43
  ])).flat();
36
44
  if (accounts.length === 0)
37
45
  return [];
@@ -45,17 +53,16 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
45
53
  throw new Error('Sol price not cached');
46
54
  const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
47
55
  accounts.forEach((acc) => {
48
- var _a;
49
- const collection = collections.get(acc.orderBook);
56
+ const collection = collections.get(acc.orderBook.toString());
50
57
  if (!collection)
51
58
  return;
52
59
  const element = elementRegistry.addElementBorrowlend({
53
60
  label: 'Lending',
54
61
  });
55
62
  let mintAsset = null;
56
- if ((_a = acc.loanState.taken) === null || _a === void 0 ? void 0 : _a.taken.nftCollateralMint) {
63
+ if (acc.loanState.__kind === 'Taken') {
57
64
  mintAsset = {
58
- address: acc.loanState.taken.taken.nftCollateralMint,
65
+ address: acc.loanState.nftCollateralMint,
59
66
  collection: {
60
67
  name: collection.name,
61
68
  floorPrice: new bignumber_js_1.default(collection.floor).multipliedBy(solTokenPrice.price),
@@ -68,13 +75,13 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
68
75
  amount: acc.principalLamports,
69
76
  };
70
77
  let name;
71
- if (acc.loanState.offer) {
78
+ if (acc.loanState.__kind === 'Offer') {
72
79
  // LENDER
73
80
  element.addSuppliedAsset(solAsset);
74
81
  name = `Lend Offer on ${collection.name}`;
75
82
  }
76
- else if (acc.loanState.taken) {
77
- if (acc.loanState.taken.taken.lenderNoteMint === owner.toString()) {
83
+ else if (acc.loanState.__kind === 'Taken') {
84
+ if (acc.loanState.lenderNoteMint.toString() === owner.toString()) {
78
85
  // LENDER
79
86
  element.addSuppliedAsset(solAsset);
80
87
  if (mintAsset)
@@ -92,12 +99,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
92
99
  }
93
100
  if (name)
94
101
  element.setName(name);
95
- element.setFixedTerms(acc.loanState.offer !== undefined ||
96
- (acc.loanState.taken
97
- ? acc.loanState.taken.taken.lenderNoteMint === owner.toString()
98
- : false), acc.loanState.taken
99
- ? (Number(acc.loanState.taken.taken.terms.time.start) +
100
- Number(acc.loanState.taken.taken.terms.time.duration)) *
102
+ element.setFixedTerms((acc.loanState.__kind === 'Taken'
103
+ ? acc.loanState.lenderNoteMint.toString() === owner.toString()
104
+ : false) || acc.loanState.__kind !== 'Offer', acc.loanState.__kind === 'Taken'
105
+ ? (Number(acc.loanState.terms.start) +
106
+ Number(acc.loanState.terms.duration)) *
101
107
  1000
102
108
  : undefined);
103
109
  });
@@ -1 +1 @@
1
- {"version":3,"file":"loansFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/loansFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAErC,2CAKqB;AAErB,iDAAsD;AACtD,+CAG4B;AAE5B,uCAA2C;AAC3C,kEAA+D;AAC/D,4DAAyD;AACzD,gFAA6E;AAG7E,MAAM,eAAe,GAAG,IAAI,6BAAa,CAIvC,+BAAmB,EACnB;IACE,MAAM,EAAE,uBAAW;IACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,EACD,CAAC,GAAG,EAAE,EAAE,CAAC,IAAA,uBAAU,EAAC,GAAG,IAAI,EAAE,EAAE,WAAW,CAAC,CAC5C,CAAC;AAEF,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,GAAG,IAAA,wBAAc,EAAC,KAAK,CAAC,CAAC;IAC1D,MAAM,QAAQ,GAAG,CACf,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAAO,UAAU,EAAE,yBAAa,EAAE,OAAO,CA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_modules/@solana/web3.js" />
2
+ /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
+ import { PublicKey } from '@solana/web3.js';
4
+ import BigNumber from 'bignumber.js';
5
+ import { FixableBeetStruct, DataEnumKeyAsKind } from '@metaplex-foundation/beet';
6
+ type APYRecord = {
7
+ Fixed: {
8
+ apy: number;
9
+ };
10
+ };
11
+ type APY = DataEnumKeyAsKind<APYRecord>;
12
+ type LoanTermsRecord = {
13
+ Time: {
14
+ start: BigNumber;
15
+ duration: BigNumber;
16
+ total_owed_lamports: BigNumber;
17
+ };
18
+ };
19
+ type LoanTerms = DataEnumKeyAsKind<LoanTermsRecord>;
20
+ type OrderBookTypeRecord = {
21
+ Collection: {
22
+ collectionKey: PublicKey;
23
+ };
24
+ NFTList: {
25
+ collectionKey: PublicKey;
26
+ };
27
+ };
28
+ type OrderBookType = DataEnumKeyAsKind<OrderBookTypeRecord>;
29
+ type LoanTermsSpecRecord = {
30
+ Time: {
31
+ duration: BigNumber;
32
+ };
33
+ };
34
+ type LoanTermsSpec = DataEnumKeyAsKind<LoanTermsSpecRecord>;
35
+ type BookLoanTermsRecord = {
36
+ Fixed: {
37
+ terms: LoanTermsSpec;
38
+ };
39
+ LenderChooses: NonNullable<unknown>;
40
+ };
41
+ type BookLoanTerms = DataEnumKeyAsKind<BookLoanTermsRecord>;
42
+ export type OrderBook = {
43
+ accountDiscriminator: number[];
44
+ version: number;
45
+ orderBookType: OrderBookType;
46
+ apy: APY;
47
+ loanTerms: BookLoanTerms;
48
+ feePermillicentage: number;
49
+ feeAuthority: PublicKey;
50
+ };
51
+ export declare const orderBookStruct: FixableBeetStruct<OrderBook, Partial<OrderBook>>;
52
+ export type NftList = {
53
+ accountDiscriminator: number[];
54
+ version: number;
55
+ collectionName: number[];
56
+ };
57
+ export declare const nftListStruct: FixableBeetStruct<NftList, Partial<NftList>>;
58
+ type LoanStateRecord = {
59
+ Offer: {
60
+ lenderWallet: PublicKey;
61
+ termsSpec: LoanTermsSpec;
62
+ offerTime: BigNumber;
63
+ };
64
+ Taken: {
65
+ nftCollateralMint: PublicKey;
66
+ lenderNoteMint: PublicKey;
67
+ borrowerNoteMint: PublicKey;
68
+ apy: APY;
69
+ terms: LoanTerms;
70
+ isCollateralFrozen: number;
71
+ };
72
+ };
73
+ type LoanState = DataEnumKeyAsKind<LoanStateRecord>;
74
+ export type Loan = {
75
+ accountDiscriminator: number[];
76
+ version: number;
77
+ principalLamports: BigNumber;
78
+ orderBook: PublicKey;
79
+ valueTokenMint: PublicKey;
80
+ escrowBumpSeed: number;
81
+ loanState: LoanState;
82
+ };
83
+ export declare const loanStruct: FixableBeetStruct<Loan, Partial<Loan>>;
84
+ export type EscrowPda = {
85
+ accountDiscriminator: number[];
86
+ bump: number;
87
+ };
88
+ export declare const escrowPdaStruct: FixableBeetStruct<EscrowPda, Partial<EscrowPda>>;
89
+ export type ProgramVersion = {
90
+ accountDiscriminator: number[];
91
+ version: number;
92
+ bump: number;
93
+ updated: BigNumber;
94
+ };
95
+ export declare const programVersionStruct: FixableBeetStruct<ProgramVersion, Partial<ProgramVersion>>;
96
+ export {};
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.programVersionStruct = exports.escrowPdaStruct = exports.loanStruct = exports.nftListStruct = exports.orderBookStruct = void 0;
4
+ const beet_1 = require("@metaplex-foundation/beet");
5
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
+ const solana_1 = require("../../utils/solana");
7
+ const apyStruct = (0, beet_1.dataEnum)([
8
+ [
9
+ 'Fixed',
10
+ new beet_1.FixableBeetArgsStruct([['apy', beet_1.u32]], 'APYRecord["Fixed"]'),
11
+ ],
12
+ ]);
13
+ const loanTermsStruct = (0, beet_1.dataEnum)([
14
+ [
15
+ 'Time',
16
+ new beet_1.FixableBeetArgsStruct([
17
+ ['start', solana_1.i64],
18
+ ['duration', solana_1.u64],
19
+ ['total_owed_lamports', solana_1.u64],
20
+ ], 'LoanTermsRecord["Time"]'),
21
+ ],
22
+ ]);
23
+ const orderBookTypeStruct = (0, beet_1.dataEnum)([
24
+ [
25
+ 'Collection',
26
+ new beet_1.FixableBeetArgsStruct([['collectionKey', beet_solana_1.publicKey]], 'OrderBookTypeRecord["Collection"]'),
27
+ ],
28
+ [
29
+ 'NFTList',
30
+ new beet_1.FixableBeetArgsStruct([['collectionKey', beet_solana_1.publicKey]], 'OrderBookTypeRecord["NFTList"]'),
31
+ ],
32
+ ]);
33
+ const loanTermsSpecStruct = (0, beet_1.dataEnum)([
34
+ [
35
+ 'Time',
36
+ new beet_1.FixableBeetArgsStruct([['duration', solana_1.u64]], 'LoanTermsSpecRecord["Time"]'),
37
+ ],
38
+ ]);
39
+ const bookLoanTermsStruct = (0, beet_1.dataEnum)([
40
+ [
41
+ 'Fixed',
42
+ new beet_1.FixableBeetArgsStruct([['terms', loanTermsSpecStruct]], 'BookLoanTermsRecord["Fixed"]'),
43
+ ],
44
+ [
45
+ 'LenderChooses',
46
+ new beet_1.FixableBeetArgsStruct([], 'BookLoanTermsRecord["LenderChooses"]'),
47
+ ],
48
+ ]);
49
+ exports.orderBookStruct = new beet_1.FixableBeetStruct([
50
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
51
+ ['version', beet_1.u8],
52
+ ['orderBookType', orderBookTypeStruct],
53
+ ['apy', apyStruct],
54
+ ['loanTerms', bookLoanTermsStruct],
55
+ ['feePermillicentage', beet_1.u16],
56
+ ['feeAuthority', beet_solana_1.publicKey],
57
+ ], (args) => args);
58
+ exports.nftListStruct = new beet_1.FixableBeetStruct([
59
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
60
+ ['version', beet_1.u8],
61
+ ['collectionName', (0, beet_1.array)(beet_1.u8)],
62
+ ], (args) => args);
63
+ const loanStateStruct = (0, beet_1.dataEnum)([
64
+ [
65
+ 'Offer',
66
+ new beet_1.FixableBeetArgsStruct([
67
+ ['lenderWallet', beet_solana_1.publicKey],
68
+ ['termsSpec', loanTermsSpecStruct],
69
+ ['offerTime', solana_1.i64],
70
+ ], 'OrderBookTypeRecord["Offer"]'),
71
+ ],
72
+ [
73
+ 'Taken',
74
+ new beet_1.FixableBeetArgsStruct([
75
+ ['nftCollateralMint', beet_solana_1.publicKey],
76
+ ['lenderNoteMint', beet_solana_1.publicKey],
77
+ ['borrowerNoteMint', beet_solana_1.publicKey],
78
+ ['apy', apyStruct],
79
+ ['terms', loanTermsStruct],
80
+ ['isCollateralFrozen', beet_1.u8],
81
+ ], 'OrderBookTypeRecord["Taken"]'),
82
+ ],
83
+ ]);
84
+ exports.loanStruct = new beet_1.FixableBeetStruct([
85
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
86
+ ['version', beet_1.u8],
87
+ ['principalLamports', solana_1.u64],
88
+ ['orderBook', beet_solana_1.publicKey],
89
+ ['valueTokenMint', beet_solana_1.publicKey],
90
+ ['escrowBumpSeed', beet_1.u8],
91
+ ['loanState', loanStateStruct],
92
+ ], (args) => args);
93
+ exports.escrowPdaStruct = new beet_1.FixableBeetStruct([
94
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
95
+ ['bump', beet_1.u8],
96
+ ], (args) => args);
97
+ exports.programVersionStruct = new beet_1.FixableBeetStruct([
98
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
99
+ ['version', beet_1.u8],
100
+ ['bump', beet_1.u8],
101
+ ['updated', solana_1.i64],
102
+ ], (args) => args);
103
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/structs.ts"],"names":[],"mappings":";;;AAEA,oDAWmC;AACnC,kEAA6D;AAC7D,+CAA8C;AAS9C,MAAM,SAAS,GAAG,IAAA,eAAQ,EAAY;IACpC;QACE,OAAO;QACP,I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AC;IACf,CAAC,mBAAmB,EAAE,YAAG,CAAC;IAC1B,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,gBAAgB,EAAE,uBAAS,CAAC;IAC7B,CAAC,gBAAgB,EAAE,SAAE,CAAC;IACtB,CAAC,WAAW,EAAE,eAAe,CAAC;CAC/B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAY,CACvB,CAAC;AAQW,QAAA,eAAe,GAAG,IAAI,wBAAiB,CAClD;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,MAAM,EAAE,SAAE,CAAC;CACb,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC;AAUW,QAAA,oBAAoB,GAAG,IAAI,wBAAiB,CACvD;IACE,CAAC,sBAAsB,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,CAAC,CAAC,CAAC;IACtD,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,SAAS,EAAE,YAAG,CAAC;CACjB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAsB,CACjC,CAAC"}
@@ -1,5 +1,3 @@
1
- /// <reference types="node" />
2
- import { FixableBeetStruct } from '@metaplex-foundation/beet';
3
1
  export type Loan = {
4
2
  version: number;
5
3
  principalLamports: string;
@@ -45,22 +43,9 @@ export type LoanTermsSpec = {
45
43
  duration: string;
46
44
  };
47
45
  };
48
- export type OrderBook = {
49
- orderBookType: {
50
- nftList: {
51
- listAccount: string;
52
- };
53
- };
54
- };
55
46
  export type Collection = {
56
47
  orderBook: string;
57
48
  name: string;
58
49
  floor: number;
59
50
  tensor_id: string;
60
51
  };
61
- export type NftList = {
62
- buffer: Buffer;
63
- version: number;
64
- collectionName: number[];
65
- };
66
- export declare const nftListStruct: FixableBeetStruct<NftList, Partial<NftList>>;
@@ -1,11 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.nftListStruct = void 0;
4
- const beet_1 = require("@metaplex-foundation/beet");
5
- const solana_1 = require("../../utils/solana");
6
- exports.nftListStruct = new beet_1.FixableBeetStruct([
7
- ['buffer', (0, solana_1.blob)(8)],
8
- ['version', beet_1.u8],
9
- ['collectionName', (0, beet_1.array)(beet_1.u8)],
10
- ], (args) => args);
11
3
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/types.ts"],"names":[],"mappings":";;;AAAA,oDAAyE;AACzE,+CAA0C;AA0E7B,QAAA,aAAa,GAAG,IAAI,wBAAiB,CAChD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,SAAS,EAAE,SAAE,CAAC;IACf,CAAC,gBAAgB,EAAE,IAAA,YAAK,EAAC,SAAE,CAAC,CAAC;CAC9B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sharky/types.ts"],"names":[],"mappings":""}
@@ -1,8 +1,5 @@
1
1
  import { Platform } from '@sonarwatch/portfolio-core';
2
- import { IdlItem } from '@solanafm/explorer-kit-idls';
3
2
  export declare const platformId = "stabble";
4
3
  export declare const platform: Platform;
5
4
  export declare const stableProgramId = "swapNyd8XiQwJ6ianp9snpu4brUqFxadzvHebnAXjJZ";
6
- export declare const stableIdlItem: IdlItem;
7
5
  export declare const weightedProgramId = "swapFpHZwjELNnjvThjajtiVmkz3yPQEHjLtka2fwHW";
8
- export declare const weightedIdlItem: IdlItem;
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.weightedIdlItem = exports.weightedProgramId = exports.stableIdlItem = exports.stableProgramId = exports.platform = exports.platformId = void 0;
4
- const stableIdl_1 = require("./stableIdl");
5
- const weightedIdl_1 = require("./weightedIdl");
3
+ exports.weightedProgramId = exports.stableProgramId = exports.platform = exports.platformId = void 0;
6
4
  exports.platformId = 'stabble';
7
5
  exports.platform = {
8
6
  id: exports.platformId,
@@ -19,15 +17,5 @@ exports.platform = {
19
17
  description: "Solana's first frictionless liquidity and trading layer",
20
18
  };
21
19
  exports.stableProgramId = 'swapNyd8XiQwJ6ianp9snpu4brUqFxadzvHebnAXjJZ';
22
- exports.stableIdlItem = {
23
- programId: exports.stableProgramId,
24
- idl: stableIdl_1.StableIdl,
25
- idlType: 'anchor',
26
- };
27
20
  exports.weightedProgramId = 'swapFpHZwjELNnjvThjajtiVmkz3yPQEHjLtka2fwHW';
28
- exports.weightedIdlItem = {
29
- programId: exports.weightedProgramId,
30
- idl: weightedIdl_1.WeightedIdl,
31
- idlType: 'anchor',
32
- };
33
21
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/constants.ts"],"names":[],"mappings":";;;AAEA,2CAAwC;AACxC,+CAA4C;AAE/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EACH,6EAA6E;IAC/E,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,gCAAgC;IAC1C,aAAa,EAAE,2BAA2B;IAC1C,OAAO,EAAE,uCAAuC;IAChD,MAAM,EAAE,+BAA+B;IACvC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EAAE,yDAAyD;CACvE,CAAC;AAEW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAEhE,QAAA,aAAa,GAAG;IAC3B,SAAS,EAAE,uBAAe;IAC1B,GAAG,EAAE,qBAAS;IACd,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,iBAAiB,GAAG,6CAA6C,CAAC;AAElE,QAAA,eAAe,GAAG;IAC7B,SAAS,EAAE,yBAAiB;IAC5B,GAAG,EAAE,yBAAW;IAChB,OAAO,EAAE,QAAQ;CACP,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,SAAS;IACf,KAAK,EACH,6EAA6E;IAC/E,OAAO,EAAE,0BAA0B;IACnC,OAAO,EAAE,0BAA0B;IACnC,WAAW,EAAE,SAAS;IACtB,QAAQ,EAAE,gCAAgC;IAC1C,aAAa,EAAE,2BAA2B;IAC1C,OAAO,EAAE,uCAAuC;IAChD,MAAM,EAAE,+BAA+B;IACvC,MAAM,EAAE,CAAC,6CAA6C,CAAC;IACvD,WAAW,EAAE,yDAAyD;CACvE,CAAC;AAEW,QAAA,eAAe,GAAG,6CAA6C,CAAC;AAEhE,QAAA,iBAAiB,GAAG,6CAA6C,CAAC"}