@sonarwatch/portfolio-plugins 0.14.145 → 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 (152) hide show
  1. package/CHANGELOG.md +2232 -2204
  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/ratex/getPool.d.ts +1 -2
  75. package/src/plugins/ratex/getPool.js +4 -3
  76. package/src/plugins/ratex/getPool.js.map +1 -1
  77. package/src/plugins/ratex/helpers.d.ts +7 -4
  78. package/src/plugins/ratex/helpers.js +11 -31
  79. package/src/plugins/ratex/helpers.js.map +1 -1
  80. package/src/plugins/ratex/marketsJob.js +4 -9
  81. package/src/plugins/ratex/marketsJob.js.map +1 -1
  82. package/src/plugins/ratex/positionsFetcher.js +2 -2
  83. package/src/plugins/ratex/positionsFetcher.js.map +1 -1
  84. package/src/plugins/ratex/structs.d.ts +211 -0
  85. package/src/plugins/ratex/structs.js +203 -0
  86. package/src/plugins/ratex/structs.js.map +1 -0
  87. package/src/plugins/ratex/types.d.ts +5 -76
  88. package/src/plugins/raydium/ammV2ApiJob.js +24 -0
  89. package/src/plugins/raydium/ammV2ApiJob.js.map +1 -1
  90. package/src/plugins/raydium/constants.d.ts +1 -0
  91. package/src/plugins/raydium/constants.js +2 -1
  92. package/src/plugins/raydium/constants.js.map +1 -1
  93. package/src/plugins/raydium/getRaydiumCLMMPositions.js +9 -5
  94. package/src/plugins/raydium/getRaydiumCLMMPositions.js.map +1 -1
  95. package/src/plugins/raydium/types.d.ts +14 -4
  96. package/src/plugins/sanctum/s1AirdropFetcher.js +2 -2
  97. package/src/plugins/sanctum/s1AirdropFetcher.js.map +1 -1
  98. package/src/plugins/sharky/collectionsJob.js +8 -9
  99. package/src/plugins/sharky/collectionsJob.js.map +1 -1
  100. package/src/plugins/sharky/constants.d.ts +0 -2
  101. package/src/plugins/sharky/constants.js +1 -7
  102. package/src/plugins/sharky/constants.js.map +1 -1
  103. package/src/plugins/sharky/loansFetcher.js +25 -19
  104. package/src/plugins/sharky/loansFetcher.js.map +1 -1
  105. package/src/plugins/sharky/structs.d.ts +96 -0
  106. package/src/plugins/sharky/structs.js +103 -0
  107. package/src/plugins/sharky/structs.js.map +1 -0
  108. package/src/plugins/sharky/types.d.ts +0 -15
  109. package/src/plugins/sharky/types.js +0 -8
  110. package/src/plugins/sharky/types.js.map +1 -1
  111. package/src/plugins/stabble/constants.d.ts +0 -3
  112. package/src/plugins/stabble/constants.js +1 -13
  113. package/src/plugins/stabble/constants.js.map +1 -1
  114. package/src/plugins/stabble/poolsJob.js +14 -9
  115. package/src/plugins/stabble/poolsJob.js.map +1 -1
  116. package/src/plugins/stabble/structs.d.ts +43 -0
  117. package/src/plugins/stabble/structs.js +42 -0
  118. package/src/plugins/stabble/structs.js.map +1 -0
  119. package/src/plugins/sushiswap/helpers.js +24 -24
  120. package/src/plugins/uniswap-v2/helpers.js +22 -22
  121. package/src/plugins/zeta/constants.d.ts +0 -2
  122. package/src/plugins/zeta/constants.js +1 -7
  123. package/src/plugins/zeta/constants.js.map +1 -1
  124. package/src/plugins/zeta/stakingFetcher.js +6 -3
  125. package/src/plugins/zeta/stakingFetcher.js.map +1 -1
  126. package/src/plugins/zeta/structs.d.ts +24 -1
  127. package/src/plugins/zeta/structs.js +30 -1
  128. package/src/plugins/zeta/structs.js.map +1 -1
  129. package/src/plugins/zeta/types.d.ts +0 -26
  130. package/src/plugins/zeta/types.js +0 -7
  131. package/src/plugins/zeta/types.js.map +1 -1
  132. package/src/utils/sei/constants.js +8 -8
  133. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  134. package/src/utils/solana/beets/ParsedGpa.d.ts +1 -0
  135. package/src/utils/solana/beets/ParsedGpa.js +9 -0
  136. package/src/utils/solana/beets/ParsedGpa.js.map +1 -1
  137. package/src/plugins/divvy/types.d.ts +0 -28
  138. package/src/plugins/divvy/types.js +0 -3
  139. package/src/plugins/divvy/types.js.map +0 -1
  140. package/src/plugins/picasso/types.d.ts +0 -17
  141. package/src/plugins/picasso/types.js +0 -3
  142. package/src/plugins/picasso/types.js.map +0 -1
  143. package/src/plugins/ratex/idl.json +0 -8806
  144. package/src/plugins/sharky/filters.d.ts +0 -8
  145. package/src/plugins/sharky/filters.js +0 -43
  146. package/src/plugins/sharky/filters.js.map +0 -1
  147. package/src/plugins/stabble/filters.d.ts +0 -5
  148. package/src/plugins/stabble/filters.js +0 -20
  149. package/src/plugins/stabble/filters.js.map +0 -1
  150. package/src/plugins/stabble/types.d.ts +0 -40
  151. package/src/plugins/stabble/types.js +0 -3
  152. package/src/plugins/stabble/types.js.map +0 -1
@@ -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,IAAI,4BAAqB,CACvB,CAAC,CAAC,KAAK,EAAE,UAAG,CAAC,CAAC,EACd,oBAAoB,CACrB;KACF;CACF,CAAqB,CAAC;AAWvB,MAAM,eAAe,GAAG,IAAA,eAAQ,EAAkB;IAChD;QACE,MAAM;QACN,IAAI,4BAAqB,CACvB;YACE,CAAC,OAAO,EAAE,YAAG,CAAC;YACd,CAAC,UAAU,EAAE,YAAG,CAAC;YACjB,CAAC,qBAAqB,EAAE,YAAG,CAAC;SAC7B,EACD,yBAAyB,CAC1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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"}
@@ -14,26 +14,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
16
  const bignumber_js_1 = __importDefault(require("bignumber.js"));
17
+ const web3_js_1 = require("@solana/web3.js");
17
18
  const constants_1 = require("./constants");
18
19
  const clients_1 = require("../../utils/clients");
19
- const solana_1 = require("../../utils/solana");
20
- const filters_1 = require("./filters");
21
20
  const getAssetBatchDas_1 = require("../../utils/solana/das/getAssetBatchDas");
22
21
  const getSolanaDasEndpoint_1 = __importDefault(require("../../utils/clients/getSolanaDasEndpoint"));
22
+ const structs_1 = require("./structs");
23
+ const ParsedGpa_1 = require("../../utils/solana/beets/ParsedGpa");
23
24
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
24
25
  const connection = (0, clients_1.getClientSolana)();
25
26
  const dasUrl = (0, getSolanaDasEndpoint_1.default)();
26
27
  const pools = (yield Promise.all([
27
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.stableIdlItem, filters_1.stableFilter),
28
- (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.weightedIdlItem, filters_1.weightedFilter),
28
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.stablePoolStruct, new web3_js_1.PublicKey(constants_1.stableProgramId))
29
+ .addFilter('vault', new web3_js_1.PublicKey('stab1io8dHvK26KoHmTwwHyYmHRbUWbyEJx6CdrGabC'))
30
+ .run(),
31
+ ParsedGpa_1.ParsedGpa.build(connection, structs_1.weightedPoolStruct, new web3_js_1.PublicKey(constants_1.weightedProgramId))
32
+ .addFilter('vault', new web3_js_1.PublicKey('w8edo9a9TDw52c1rBmVbP6dNakaAuFiPjDd52ZJwwVi'))
33
+ .run(),
29
34
  ])).flat();
30
35
  const mints = new Set();
31
36
  const lpMints = new Set();
32
37
  pools.forEach((pool) => {
33
38
  pool.tokens.forEach((token) => {
34
- mints.add(token.mint);
39
+ mints.add(token.mint.toString());
35
40
  });
36
- lpMints.add(pool.mint);
41
+ lpMints.add(pool.mint.toString());
37
42
  });
38
43
  const [tokenPrices, heliusAssets] = yield Promise.all([
39
44
  cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.solana),
@@ -41,13 +46,13 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
41
46
  ]);
42
47
  const sources = [];
43
48
  pools.forEach((pool) => {
44
- const heliusAsset = heliusAssets.get(pool.mint);
49
+ const heliusAsset = heliusAssets.get(pool.mint.toString());
45
50
  if (!(heliusAsset === null || heliusAsset === void 0 ? void 0 : heliusAsset.token_info))
46
51
  return;
47
52
  const supply = new bignumber_js_1.default(heliusAsset.token_info.supply).dividedBy(Math.pow(10, Number(heliusAsset.token_info.decimals)));
48
53
  const underlyings = [];
49
54
  for (const token of pool.tokens) {
50
- const tokenPrice = tokenPrices.get(token.mint);
55
+ const tokenPrice = tokenPrices.get(token.mint.toString());
51
56
  if (!tokenPrice)
52
57
  return;
53
58
  const tokenAmount = token.scalingUp
@@ -65,7 +70,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
65
70
  });
66
71
  }
67
72
  sources.push({
68
- address: pool.mint,
73
+ address: pool.mint.toString(),
69
74
  decimals: heliusAsset.token_info.decimals,
70
75
  id: constants_1.platformId,
71
76
  networkId: portfolio_core_1.NetworkId.solana,
@@ -1 +1 @@
1
- {"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAyE;AACzE,gEAAqC;AAGrC,2CAAyE;AACzE,iDAAsD;AACtD,+CAAkE;AAClE,uCAAyD;AAEzD,8EAAgF;AAChF,oGAA4E;AAE5E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,MAAM,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAEtC,MAAM,KAAK,GAAG,CACZ,MAAM,OAAO,CAAC,GAAG,CAAC;QAChB,IAAA,qCAA4B,EAC1B,UAAU,EACV,yBAAa,EACb,sBAAY,CACb;QACD,IAAA,qCAA4B,EAC1B,UAAU,EACV,2BAAe,EACf,wBAAc,CACf;KACF,CAAC,CACH,CAAC,IAAI,EAAE,CAAC;IAET,MAAM,KAAK,GAAgB,IAAI,GAAG,EAAE,CAAC;IACrC,MAAM,OAAO,GAAgB,IAAI,GAAG,EAAE,CAAC;IAEvC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YAC5B,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC,CAAC,CAAC;QACH,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC,CAAC;IAEH,MAAM,CAAC,WAAW,EAAE,YAAY,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACpD,KAAK,CAAC,mBAAmB,CAAC,KAAK,EAAE,0BAAS,CAAC,MAAM,CAAC;QAClD,IAAA,w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,UAAU,CAAC,QAAQ;gBAC7B,WAAW,EAAE,WAAW,CAAC,QAAQ,EAAE;gBACnC,SAAS,EAAE,0BAAS,CAAC,MAAM;gBAC3B,KAAK,EAAE,UAAU,CAAC,KAAK;aACxB,CAAC,CAAC;QACL,CAAC;QAED,OAAO,CAAC,IAAI,CAAC;YACX,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAC7B,QAAQ,EAAE,WAAW,CAAC,UAAU,CAAC,QAAQ;YACzC,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,WAAW,CAAC,MAAM,CACvB,CAAC,GAAW,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,WAAW,GAAG,GAAG,EACjD,CAAC,CACF;YACD,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,WAAW;YACX,UAAU,EAAE,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;SAChE,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,KAAK,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAC5C,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -0,0 +1,43 @@
1
+ /// <reference types="@drift-labs/sdk/node_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 { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
6
+ export type PoolToken = {
7
+ mint: PublicKey;
8
+ decimals: number;
9
+ scalingUp: boolean;
10
+ scalingFactor: BigNumber;
11
+ balance: BigNumber;
12
+ weight: BigNumber;
13
+ };
14
+ export declare const poolTokenStruct: BeetStruct<PoolToken, Partial<PoolToken>>;
15
+ export type WeightedPool = {
16
+ accountDiscriminator: number[];
17
+ owner: PublicKey;
18
+ vault: PublicKey;
19
+ mint: PublicKey;
20
+ authorityBump: number;
21
+ isActive: boolean;
22
+ invariant: BigNumber;
23
+ swapFee: BigNumber;
24
+ tokens: PoolToken[];
25
+ pendingOwner?: PublicKey;
26
+ };
27
+ export declare const weightedPoolStruct: FixableBeetStruct<WeightedPool, Partial<WeightedPool>>;
28
+ export type StablePool = {
29
+ accountDiscriminator: number[];
30
+ owner: PublicKey;
31
+ vault: PublicKey;
32
+ mint: PublicKey;
33
+ authorityBump: number;
34
+ isActive: boolean;
35
+ ampInitialFactor: number;
36
+ ampTargetFactor: number;
37
+ rampStartTs: BigNumber;
38
+ rampStopTs: BigNumber;
39
+ swapFee: BigNumber;
40
+ tokens: PoolToken[];
41
+ pendingOwner?: PublicKey;
42
+ };
43
+ export declare const stablePoolStruct: FixableBeetStruct<StablePool, Partial<StablePool>>;
@@ -0,0 +1,42 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.stablePoolStruct = exports.weightedPoolStruct = exports.poolTokenStruct = void 0;
4
+ const beet_solana_1 = require("@metaplex-foundation/beet-solana");
5
+ const beet_1 = require("@metaplex-foundation/beet");
6
+ const solana_1 = require("../../utils/solana");
7
+ exports.poolTokenStruct = new beet_1.BeetStruct([
8
+ ['mint', beet_solana_1.publicKey],
9
+ ['decimals', beet_1.u8],
10
+ ['scalingUp', beet_1.bool],
11
+ ['scalingFactor', solana_1.u64],
12
+ ['balance', solana_1.u64],
13
+ ['weight', solana_1.u64],
14
+ ], (args) => args);
15
+ exports.weightedPoolStruct = new beet_1.FixableBeetStruct([
16
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
17
+ ['owner', beet_solana_1.publicKey],
18
+ ['vault', beet_solana_1.publicKey],
19
+ ['mint', beet_solana_1.publicKey],
20
+ ['authorityBump', beet_1.u8],
21
+ ['isActive', beet_1.bool],
22
+ ['invariant', solana_1.u64],
23
+ ['swapFee', solana_1.u64],
24
+ ['tokens', (0, beet_1.array)(exports.poolTokenStruct)],
25
+ ['pendingOwner', beet_solana_1.publicKey],
26
+ ], (args) => args);
27
+ exports.stablePoolStruct = new beet_1.FixableBeetStruct([
28
+ ['accountDiscriminator', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 8)],
29
+ ['owner', beet_solana_1.publicKey],
30
+ ['vault', beet_solana_1.publicKey],
31
+ ['mint', beet_solana_1.publicKey],
32
+ ['authorityBump', beet_1.u8],
33
+ ['isActive', beet_1.bool],
34
+ ['ampInitialFactor', beet_1.u16],
35
+ ['ampTargetFactor', beet_1.u16],
36
+ ['rampStartTs', solana_1.i64],
37
+ ['rampStopTs', solana_1.i64],
38
+ ['swapFee', solana_1.u64],
39
+ ['tokens', (0, beet_1.array)(exports.poolTokenStruct)],
40
+ ['pendingOwner', beet_solana_1.publicKey],
41
+ ], (args) => args);
42
+ //# sourceMappingURL=structs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/stabble/structs.ts"],"names":[],"mappings":";;;AAEA,kEAA6D;AAC7D,oDAQmC;AACnC,+CAA8C;AAWjC,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,UAAU,EAAE,SAAE,CAAC;IAChB,CAAC,WAAW,EAAE,WAAI,CAAC;IACnB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,QAAQ,EAAE,YAAG,CAAC;CAChB,EACD,CAAC,IAAI,EAAE,EAA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-54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
54
54
  }
55
55
  function getV3PairsAddresses(url, length = 300) {
56
56
  return __awaiter(this, void 0, void 0, function* () {
57
- const query = (0, graphql_request_1.gql) `
58
- {
59
- pools(
60
- orderBy: totalValueLockedUSD
61
- first: ${length}
62
- orderDirection: desc
63
- where: { volumeUSD_not: "0", liquidity_not: "0" }
64
- ) {
65
- id
66
- token0Price
67
- token1Price
68
- liquidity
69
- token0 {
70
- id
71
- totalSupply
72
- decimals
73
- }
74
- token1 {
75
- id
76
- totalSupply
77
- decimals
78
- }
79
- }
80
- }
57
+ const query = (0, graphql_request_1.gql) `
58
+ {
59
+ pools(
60
+ orderBy: totalValueLockedUSD
61
+ first: ${length}
62
+ orderDirection: desc
63
+ where: { volumeUSD_not: "0", liquidity_not: "0" }
64
+ ) {
65
+ id
66
+ token0Price
67
+ token1Price
68
+ liquidity
69
+ token0 {
70
+ id
71
+ totalSupply
72
+ decimals
73
+ }
74
+ token1 {
75
+ id
76
+ totalSupply
77
+ decimals
78
+ }
79
+ }
80
+ }
81
81
  `;
82
82
  const res = yield (0, graphql_request_1.default)(url, query);
83
83
  const pools = res.pools;
@@ -40,28 +40,28 @@ function getPairKey(version) {
40
40
  exports.getPairKey = getPairKey;
41
41
  function getPairsV2FromTheGraph(url, length = 300) {
42
42
  return __awaiter(this, void 0, void 0, function* () {
43
- const query = (0, graphql_request_1.gql) `
44
- {
45
- pairs(
46
- orderBy: reserveUSD
47
- first: ${length}
48
- orderDirection: desc
49
- where: { trackedReserveETH_not: "0" }
50
- ) {
51
- id
52
- reserve0
53
- reserve1
54
- totalSupply
55
- token0 {
56
- id
57
- decimals
58
- }
59
- token1 {
60
- id
61
- decimals
62
- }
63
- }
64
- }
43
+ const query = (0, graphql_request_1.gql) `
44
+ {
45
+ pairs(
46
+ orderBy: reserveUSD
47
+ first: ${length}
48
+ orderDirection: desc
49
+ where: { trackedReserveETH_not: "0" }
50
+ ) {
51
+ id
52
+ reserve0
53
+ reserve1
54
+ totalSupply
55
+ token0 {
56
+ id
57
+ decimals
58
+ }
59
+ token1 {
60
+ id
61
+ decimals
62
+ }
63
+ }
64
+ }
65
65
  `;
66
66
  const res = yield (0, graphql_request_1.default)(url, query);
67
67
  const pairs = res.pairs;
@@ -2,7 +2,6 @@
2
2
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
3
3
  import { PublicKey } from '@solana/web3.js';
4
4
  import { Platform } from '@sonarwatch/portfolio-core';
5
- import { IdlItem } from '@solanafm/explorer-kit-idls';
6
5
  import { AirdropStatics } from '../../AirdropFetcher';
7
6
  export declare const zexMint = "ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo";
8
7
  export declare const platformId = "zeta";
@@ -14,4 +13,3 @@ export declare const zexDecimals = 6;
14
13
  export declare const distributorPid = "4JSALTb4QbipG7NNLryAFJg4y8X5C1ELErSncsVMA3gZ";
15
14
  export declare const distributors: string[];
16
15
  export declare const stakingPid: PublicKey;
17
- export declare const zetaIdlItem: IdlItem;
@@ -1,8 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.zetaIdlItem = exports.stakingPid = exports.distributors = exports.distributorPid = exports.zexDecimals = exports.airdropStatics = exports.graphqlApi = exports.programId = exports.platform = exports.platformId = exports.zexMint = void 0;
3
+ exports.stakingPid = exports.distributors = exports.distributorPid = exports.zexDecimals = exports.airdropStatics = exports.graphqlApi = exports.programId = exports.platform = exports.platformId = exports.zexMint = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
- const idls_1 = require("./idls");
6
5
  exports.zexMint = 'ZEXy1pqteRu3n13kdyh4LwPQknkFk3GzmMYMuNadWPo';
7
6
  exports.platformId = 'zeta';
8
7
  exports.platform = {
@@ -70,9 +69,4 @@ exports.distributors = [
70
69
  '6o1ZexNBJnQCDXiWtJgDPkE4u5WndgUb1wKDjofRuWme',
71
70
  ];
72
71
  exports.stakingPid = new web3_js_1.PublicKey('4DUapvWZDDCkfWJpdwvX2QjwAE9Yq4wU8792RMMv7Csg');
73
- exports.zetaIdlItem = {
74
- programId: exports.stakingPid.toString(),
75
- idl: idls_1.idls,
76
- idlType: 'anchor',
77
- };
78
72
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,iCAA+C;AAGlC,QAAA,OAAO,GAAG,6CAA6C,CAAC;AACxD,QAAA,UAAU,GAAG,MAAM,CAAC;AACpB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,MAAM;IACZ,KAAK,EACH,0EAA0E;IAC5E,WAAW,EAAE,MAAM;IACnB,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,2BAA2B;IACpC,aAAa,EAAE,4BAA4B;IAC3C,MAAM,EAAE,CAAC,eAAO,CAAC;IACjB,QAAQ,EAAE,8BAA8B;IACxC,OAAO,EAAE,+BAA+B;IACxC,MAAM,EAAE,gCAAgC;IACxC,WAAW,EAAE,6DAA6D;CAC3E,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,UAAU,GAAG,sCAAsC,CAAC;AAEpD,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,6BAA6B;IACxC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,MAAM;IACnB,EAAE,EAAE,cAAc;IAClB,KAAK,EACH,0EAA0E;IAC5E,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEW,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAChE,QAAA,YAAY,GAAG;IAC1B,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C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,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AACW,QAAA,UAAU,GAAG,sCAAsC,CAAC;AAEpD,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,6BAA6B;IACxC,WAAW,EAAE,2BAA2B;IACxC,WAAW,EAAE,MAAM;IACnB,EAAE,EAAE,cAAc;IAClB,KAAK,EACH,0EAA0E;IAC5E,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;CACxB,CAAC;AAEW,QAAA,WAAW,GAAG,CAAC,CAAC;AAChB,QAAA,cAAc,GAAG,8CAA8C,CAAC;AAChE,QAAA,YAAY,GAAG;IAC1B,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,6CAA6C;IAC7C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;IAC9C,8CAA8C;CAC/C,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,8CAA8C,CAC/C,CAAC"}
@@ -19,6 +19,7 @@ const clients_1 = require("../../utils/clients");
19
19
  const helpers_1 = require("./helpers");
20
20
  const solana_1 = require("../../utils/solana");
21
21
  const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
22
+ const structs_1 = require("./structs");
22
23
  const networkId = portfolio_core_1.NetworkId.solana;
23
24
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
24
25
  const client = (0, clients_1.getClientSolana)();
@@ -27,10 +28,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
27
28
  const accounts = [];
28
29
  do {
29
30
  const stakeAccountsAddresses = (0, helpers_1.getStakeAccountsAddresses)(owner, index, index + step);
30
- const stakeAccounts = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(client, constants_1.zetaIdlItem, stakeAccountsAddresses);
31
+ const stakeAccounts = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.stakeAccountStruct, stakeAccountsAddresses);
31
32
  index += step;
32
33
  accounts.push(...stakeAccounts);
33
34
  } while (!accounts.some((acc) => !acc));
35
+ if (!accounts.length)
36
+ return [];
34
37
  const registry = new ElementRegistry_1.ElementRegistry(networkId, constants_1.platformId);
35
38
  const stakingElement = registry.addElementMultiple({
36
39
  label: 'Staked',
@@ -42,8 +45,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
42
45
  const name = (0, solana_1.u8ArrayToString)(account.name);
43
46
  const amount = new bignumber_js_1.default(account.amountStillStaked).toNumber();
44
47
  const attributes = {
45
- lockedUntil: account.stakeState.vesting
46
- ? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.vesting.stakeStartEpoch)
48
+ lockedUntil: account.stakeState.__kind === 'Vesting'
49
+ ? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.stakeStartEpoch)
47
50
  : -1,
48
51
  tags: [name],
49
52
  };
@@ -1 +1 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAGoC;AACpC,gEAAqC;AAGrC,2CAA+D;AAC/D,iDAAsD;AACtD,uCAAoE;AACpE,+CAG4B;AAE5B,gFAA6E;AAE7E,MAAM,SAAS,GAAG,0B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C3B,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,eAAe,CAC3C;gBACH,CAAC,CAAC,CAAC,CAAC;YACN,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC;QAEF,cAAc,CAAC,QAAQ,CAAC;YACtB,OAAO,EAAE,mBAAO;YAChB,MAAM;YACN,UAAU;YACV,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC/B,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAGoC;AACpC,gEAAqC;AAGrC,2CAAkD;AAClD,iDAAsD;AACtD,uCAAoE;AACpE,+CAG4B;AAC5B,gFAA6E;AAC7E,uCAA+C;AAE/C,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,MAAM,IAAI,GAAG,CAAC,CAAC;IACf,MAAM,QAAQ,GAAG,EAAE,CAAC;IAEpB,GAAG,CAAC;QACF,MAAM,sBAAsB,GAAG,IAAA,mCAAyB,EACtD,KAAK,EACL,KAAK,EACL,KAAK,GAAG,IAAI,CACb,CAAC;QACF,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,4BAAkB,EAClB,sBAAsB,CACvB,CAAC;QAEF,KAAK,IAAI,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E,GAAG,sBAAU,UAAU;IAC3B,SAAS;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /// <reference types="node" />
2
2
  /// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
3
3
  /// <reference types="jito-ts/node_modules/@solana/web3.js" />
4
- import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
4
+ import { BeetStruct, FixableBeetStruct, DataEnumKeyAsKind } from '@metaplex-foundation/beet';
5
5
  import { PublicKey } from '@solana/web3.js';
6
6
  import BigNumber from 'bignumber.js';
7
7
  export declare enum MarginAccountType {
@@ -57,3 +57,26 @@ export type ClaimStatus = {
57
57
  claimedAmount: BigNumber;
58
58
  };
59
59
  export declare const claimStatusStruct: BeetStruct<ClaimStatus, Partial<ClaimStatus>>;
60
+ type StakeStateRecord = {
61
+ Uninitialized: NonNullable<unknown>;
62
+ Vesting: {
63
+ stakeStartEpoch: number;
64
+ lastClaimTs: BigNumber;
65
+ };
66
+ Locked: NonNullable<unknown>;
67
+ };
68
+ type StakeState = DataEnumKeyAsKind<StakeStateRecord>;
69
+ export type StakeAccount = {
70
+ accountDiscriminator: number[];
71
+ name: number[];
72
+ vaultNonce: number;
73
+ bitInUse: number;
74
+ stakeState: StakeState;
75
+ initialStakeAmount: BigNumber;
76
+ amountStillStaked: BigNumber;
77
+ amountClaimed: BigNumber;
78
+ stakeDurationEpochs: number;
79
+ authority: PublicKey;
80
+ };
81
+ export declare const stakeAccountStruct: FixableBeetStruct<StakeAccount, Partial<StakeAccount>>;
82
+ export {};