@sonarwatch/portfolio-plugins 0.12.130 → 0.12.132

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +1 -1
  3. package/src/orphanPlatorms.js +7 -0
  4. package/src/orphanPlatorms.js.map +1 -1
  5. package/src/plugins/deepbook/constants.js +1 -2
  6. package/src/plugins/deepbook/constants.js.map +1 -1
  7. package/src/plugins/quarry/calculatePositions.d.ts +2 -2
  8. package/src/plugins/quarry/calculatePositions.js +35 -9
  9. package/src/plugins/quarry/calculatePositions.js.map +1 -1
  10. package/src/plugins/quarry/constants.d.ts +2 -0
  11. package/src/plugins/quarry/constants.js +9 -2
  12. package/src/plugins/quarry/constants.js.map +1 -1
  13. package/src/plugins/quarry/getClaimableRewards.d.ts +3 -0
  14. package/src/plugins/quarry/getClaimableRewards.js +18 -0
  15. package/src/plugins/quarry/getClaimableRewards.js.map +1 -0
  16. package/src/plugins/quarry/payroll.d.ts +29 -0
  17. package/src/plugins/quarry/payroll.js +54 -0
  18. package/src/plugins/quarry/payroll.js.map +1 -0
  19. package/src/plugins/quarry/positionsFetcher.js +27 -10
  20. package/src/plugins/quarry/positionsFetcher.js.map +1 -1
  21. package/src/plugins/quarry/quarryRedeemerIdl.d.ts +59 -0
  22. package/src/plugins/quarry/quarryRedeemerIdl.js +219 -0
  23. package/src/plugins/quarry/quarryRedeemerIdl.js.map +1 -0
  24. package/src/plugins/quarry/redeemerIdl.d.ts +18 -18
  25. package/src/plugins/quarry/redeemerIdl.js +186 -71
  26. package/src/plugins/quarry/redeemerIdl.js.map +1 -1
  27. package/src/plugins/quarry/redeemersJob.js +4 -1
  28. package/src/plugins/quarry/redeemersJob.js.map +1 -1
  29. package/src/plugins/quarry/types.d.ts +16 -2
  30. package/src/plugins/suins/constants.js +0 -1
  31. package/src/plugins/suins/constants.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
4
4
 
5
+ ## [0.12.132](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.131...plugins-0.12.132) (2024-08-13)
6
+
7
+
8
+
9
+ ## [0.12.131](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.130...plugins-0.12.131) (2024-08-12)
10
+
11
+
12
+
5
13
  ## [0.12.130](https://github.com/sonarwatch/portfolio/compare/plugins-0.12.129...plugins-0.12.130) (2024-08-12)
6
14
 
7
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sonarwatch/portfolio-plugins",
3
- "version": "0.12.130",
3
+ "version": "0.12.132",
4
4
  "type": "commonjs",
5
5
  "types": "./src/index.d.ts",
6
6
  "peerDependencies": {
@@ -57,6 +57,13 @@ const otphanPlatforms = [
57
57
  image: 'https://sonar.watch/img/platforms/stakewise.webp',
58
58
  website: 'https://stakewise.io/',
59
59
  },
60
+ {
61
+ id: 'ondo-finance',
62
+ defiLlamaId: 'ondo-finance',
63
+ name: 'Ondo Finance',
64
+ image: 'https://sonar.watch/img/platforms/ondo-finance.webp',
65
+ website: 'https://ondo.finance/',
66
+ },
60
67
  ];
61
68
  exports.default = otphanPlatforms;
62
69
  //# sourceMappingURL=orphanPlatorms.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"orphanPlatorms.js","sourceRoot":"","sources":["../../../../packages/plugins/src/orphanPlatorms.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GAAe;IAClC;QACE,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,SAAS,EAAE,sCAAsC;QAC9D,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,gDAAgD;QACvD,OAAO,EAAE,8BAA8B;KACxC;IACD;QACE,EAAE,EAAE,OAAO;QACX,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,8CAA8C;QACrD,OAAO,EAAE,gCAAgC;KAC1C;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,yDAAyD;QAChE,OAAO,EAAE,kCAAkC;KAC5C;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,+CAA+C;QACtD,OAAO,EAAE,0BAA0B;KACpC;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,6BAA6B;QAC1C,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,0DAA0D;QACjE,OAAO,EAAE,4DAA4D;KACtE;IACD;QACE,EAAE,EAAE,OAAO;QACX,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,8CAA8C;QACrD,OAAO,EAAE,6BAA6B;KACvC;IACD;QACE,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,6CAA6C;QACpD,OAAO,EAAE,uBAAuB;KACjC;IACD;QACE,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,kDAAkD;QACzD,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAC;AACF,kBAAe,eAAe,CAAC"}
1
+ {"version":3,"file":"orphanPlatorms.js","sourceRoot":"","sources":["../../../../packages/plugins/src/orphanPlatorms.ts"],"names":[],"mappings":";;AAEA,MAAM,eAAe,GAAe;IAClC;QACE,EAAE,EAAE,SAAS;QACb,WAAW,EAAE,SAAS,EAAE,sCAAsC;QAC9D,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,gDAAgD;QACvD,OAAO,EAAE,8BAA8B;KACxC;IACD;QACE,EAAE,EAAE,OAAO;QACX,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,8CAA8C;QACrD,OAAO,EAAE,gCAAgC;KAC1C;IACD;QACE,EAAE,EAAE,kBAAkB;QACtB,WAAW,EAAE,oBAAoB;QACjC,IAAI,EAAE,oBAAoB;QAC1B,KAAK,EAAE,yDAAyD;QAChE,OAAO,EAAE,kCAAkC;KAC5C;IACD;QACE,EAAE,EAAE,QAAQ;QACZ,WAAW,EAAE,QAAQ;QACrB,IAAI,EAAE,QAAQ;QACd,KAAK,EAAE,+CAA+C;QACtD,OAAO,EAAE,0BAA0B;KACpC;IACD;QACE,EAAE,EAAE,mBAAmB;QACvB,WAAW,EAAE,6BAA6B;QAC1C,IAAI,EAAE,qBAAqB;QAC3B,KAAK,EAAE,0DAA0D;QACjE,OAAO,EAAE,4DAA4D;KACtE;IACD;QACE,EAAE,EAAE,OAAO;QACX,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE,8CAA8C;QACrD,OAAO,EAAE,6BAA6B;KACvC;IACD;QACE,EAAE,EAAE,MAAM;QACV,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,iBAAiB;QACvB,KAAK,EAAE,6CAA6C;QACpD,OAAO,EAAE,uBAAuB;KACjC;IACD;QACE,EAAE,EAAE,WAAW;QACf,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,sBAAsB;QAC5B,KAAK,EAAE,kDAAkD;QACzD,OAAO,EAAE,uBAAuB;KACjC;IACD;QACE,EAAE,EAAE,cAAc;QAClB,WAAW,EAAE,cAAc;QAC3B,IAAI,EAAE,cAAc;QACpB,KAAK,EAAE,qDAAqD;QAC5D,OAAO,EAAE,uBAAuB;KACjC;CACF,CAAC;AACF,kBAAe,eAAe,CAAC"}
@@ -11,8 +11,7 @@ exports.platform = {
11
11
  defiLlamaId: 'deepbook', // from https://defillama.com/docs/api
12
12
  };
13
13
  exports.airdropStatics = {
14
- claimLink: undefined,
15
- emitterLink: 'https://deepbook.tech/#airdrop',
14
+ emitterLink: 'https://deepbook.tech',
16
15
  emitterName: 'DeepBook',
17
16
  id: `${exports.platformId}-token-launch`,
18
17
  image: 'https://sonar.watch/img/platforms/deepbook.webp',
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,gCAAgC;IAC7C,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,YAAY,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,uBAAuB;IAChC,OAAO,EAAE,6BAA6B;IACtC,WAAW,EAAE,UAAU,EAAE,sCAAsC;CAChE,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,WAAW,EAAE,uBAAuB;IACpC,WAAW,EAAE,UAAU;IACvB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,iDAAiD;IACxD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,QAAQ,GACnB,gFAAgF,CAAC;AACtE,QAAA,YAAY,GAAG,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import { MergeMiner, Miner, Position, Rewarder } from './types';
1
+ import { MergeMiner, Miner, Position, QuarryData, Rewarder } from './types';
2
2
  import { ParsedAccount } from '../../utils/solana';
3
- export declare const calculatePositions: (mergeMinerAccounts: ParsedAccount<MergeMiner>[], minerAccounts: ParsedAccount<Miner>[], replicaMinerAccounts: ParsedAccount<Miner>[][], allRewarders: Rewarder[], owner: string) => Position[];
3
+ export declare const calculatePositions: (mergeMinerAccounts: ParsedAccount<MergeMiner>[], minerAccounts: ParsedAccount<Miner>[], replicaMinerAccounts: ParsedAccount<Miner>[][], allRewarders: Rewarder[], quarryAccounts: ParsedAccount<QuarryData>[], owner: string) => Position[];
@@ -3,7 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calculatePositions = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const helpers_1 = require("./helpers");
6
- const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, owner) => {
6
+ const getClaimableRewards_1 = require("./getClaimableRewards");
7
+ const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, quarryAccounts, owner) => {
7
8
  const positions = [];
8
9
  const quarryPDAS = (0, helpers_1.getQuarryPDAs)(allRewarders, new web3_js_1.PublicKey(owner));
9
10
  [...mergeMinerAccounts, ...minerAccounts].forEach((account, i) => {
@@ -21,13 +22,38 @@ const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccou
21
22
  const primaryQuarry = primaryRewarder.quarries.find((q) => quarryPDA.primaryQuarry.toString() === q.quarry);
22
23
  if (!primaryQuarry)
23
24
  return;
24
- const rewardsToken = [
25
- quarryPDA.rewardsToken.toString(),
26
- ...quarryPDA.replicas.map((r) => r.rewardsMint.toString()),
27
- ];
28
- const rewardsBalance = (0, helpers_1.isMinerAccount)(account)
29
- ? [account.rewardsEarned]
30
- : replicaMinerAccounts[i].map((acc) => acc.rewardsEarned);
25
+ const rewardsBalance = [];
26
+ const rewardsTokenInfo = [];
27
+ const primaryQuarryAccount = quarryAccounts.find((q) => q.pubkey.toString() === primaryQuarry.quarry.toString());
28
+ if (!primaryQuarryAccount)
29
+ return;
30
+ if ((0, helpers_1.isMinerAccount)(account)) {
31
+ rewardsTokenInfo.push(primaryRewarder.rewardsTokenInfo);
32
+ rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(primaryQuarryAccount, account));
33
+ }
34
+ else {
35
+ const minerAccount = replicaMinerAccounts[i].find((a) => a.quarry === primaryQuarryAccount.pubkey.toString());
36
+ if (!minerAccount)
37
+ return;
38
+ rewardsTokenInfo.push(primaryRewarder.rewardsTokenInfo);
39
+ rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(primaryQuarryAccount, minerAccount));
40
+ primaryQuarry.replicaQuarries.forEach((r) => {
41
+ const quarryAccount = quarryAccounts.find((q) => q.pubkey.toString() === r.quarry);
42
+ if (!quarryAccount)
43
+ return;
44
+ const replicaMinerAccount = replicaMinerAccounts[i].find((a) => a.quarry === quarryAccount.pubkey.toString());
45
+ if (!replicaMinerAccount)
46
+ return;
47
+ const replicaQuarryPDA = quarryPDA.replicas.find((rq) => rq.replicaQuarry.toString() === r.quarry);
48
+ if (!replicaQuarryPDA)
49
+ return;
50
+ const replicaRewarder = allRewarders.find((rew) => rew.rewarder === replicaQuarryPDA.rewarder.toString());
51
+ if (!replicaRewarder)
52
+ return;
53
+ rewardsTokenInfo.push(replicaRewarder.rewardsTokenInfo);
54
+ rewardsBalance.push((0, getClaimableRewards_1.getClaimableRewards)(quarryAccount, replicaMinerAccount));
55
+ });
56
+ }
31
57
  positions.push({
32
58
  primaryRewarder: {
33
59
  slug: primaryRewarder.slug,
@@ -37,7 +63,7 @@ const calculatePositions = (mergeMinerAccounts, minerAccounts, replicaMinerAccou
37
63
  ? account.balance
38
64
  : account.primaryBalance,
39
65
  stakedTokenInfo: primaryQuarry.primaryTokenInfo,
40
- rewardsToken,
66
+ rewardsTokenInfo,
41
67
  rewardsBalance,
42
68
  });
43
69
  });
@@ -1 +1 @@
1
- {"version":3,"file":"calculatePositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/calculatePositions.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG5C,uCAA0D;AAEnD,MAAM,kBAAkB,GAAG,CAChC,kBAA+C,EAC/C,aAAqC,EACrC,oBAA8C,EAC9C,YAAwB,EACxB,KAAa,EACb,EAAE;IACF,MAAM,SAAS,GAAe,EAAE,CAAC;IAEjC,MAAM,UAAU,GAAG,IAAA,uBAAa,EAAC,YAAY,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAErE,CAAC,GAAG,kBAAkB,EAAE,GAAG,aAAa,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,EAAE,EAAE;;QAC/D,IAAI,CAAC,OAAO;YAAE,OAAO;QAErB,MAAM,SAAS,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CACtC,IAAA,wBAAc,EAAC,OAAO,CAAC;YACrB,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;YACvD,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,QAAQ,EAAE,KAAK,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE,CAClD,CAAC;QACF,IAAI,CAAC,SAAS;YAAE,OAAO;QAEvB,MAAM,eAAe,GAAG,YAAY,CAAC,IAAI,CACvC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,CACpD,CAAC;QACF,IAAI,CAAC,eAAe;YAAE,OAAO;QAE7B,MAAM,aAAa,GAAG,eAAe,CAAC,QAAQ,CAAC,IAAI,CACjD,CAAC,CAAC,EAAE,EAAE,CAAC,SAAS,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,MAAM,CACvD,CAAC;QACF,IAAI,CAAC,aAAa;YAAE,OAAO;QAE3B,MAAM,YAAY,GAAG;YACnB,SAAS,CAAC,YAAY,CAAC,QAAQ,EAAE;YACjC,GAAG,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC;SAC3D,CAAC;QAEF,MAAM,cAAc,GAAa,IAAA,wBAAc,EAAC,OAAO,CAAC;YACtD,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;YACzB,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;QAE5D,SAAS,CAAC,IAAI,CAAC;YACb,eAAe,EAAE;gBACf,IAAI,EAAE,eAAe,CAAC,IAAI;gBAC1B,IAAI,EAAE,MAAA,eAAe,CAAC,IAAI,0CAAE,IAAI;aACjC;YACD,aAAa,EAAE,IAAA,wBAAc,EAAC,OAAO,CAAC;gBACpC,CAAC,CAAC,OAAO,CAAC,OAAO;gBACjB,CAAC,CAAC,OAAO,CAAC,cAAc;YAC1B,eAAe,EAAE,aAAa,CAAC,gBAAgB;YAC/C,YAAY;YACZ,cAAc;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAvDW,QAAA,kBAAkB,sBAuD7B"}
1
+ {"version":3,"file":"calculatePositions.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/calculatePositions.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAW5C,uCAA0D;AAC1D,+DAA4D;AAErD,MAAM,kBAAkB,GAAG,CAChC,kBAA+C,EAC/C,aAAq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C,MAAM,gBAAgB,GAAG,SAAS,CAAC,QAAQ,CAAC,IAAI,CAC9C,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,MAAM,CACjD,CAAC;gBACF,IAAI,CAAC,gBAAgB;oBAAE,OAAO;gBAC9B,MAAM,eAAe,GAAG,YAAY,CAAC,IAAI,CACvC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,QAAQ,KAAK,gBAAgB,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAC/D,CAAC;gBACF,IAAI,CAAC,eAAe;oBAAE,OAAO;gBAE7B,gBAAgB,CAAC,IAAI,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;gBACxD,cAAc,CAAC,IAAI,CACjB,IAAA,yCAAmB,EAAC,aAAa,EAAE,mBAAmB,CAAC,CACxD,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC;QAED,SAAS,CAAC,IAAI,CAAC;YACb,eAAe,EAAE;gBACf,IAAI,EAAE,eAAe,CAAC,IAAI;gBAC1B,IAAI,EAAE,MAAA,eAAe,CAAC,IAAI,0CAAE,IAAI;aACjC;YACD,aAAa,EAAE,IAAA,wBAAc,EAAC,OAAO,CAAC;gBACpC,CAAC,CAAC,OAAO,CAAC,OAAO;gBACjB,CAAC,CAAC,OAAO,CAAC,cAAc;YAC1B,eAAe,EAAE,aAAa,CAAC,gBAAgB;YAC/C,gBAAgB;YAChB,cAAc;SACf,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AA7FW,QAAA,kBAAkB,sBA6F7B"}
@@ -8,7 +8,9 @@ export declare const rewardersCacheKey = "rewarders";
8
8
  export declare const rewardersUrl = "https://cdn.jsdelivr.net/gh/QuarryProtocol/rewarder-list-build@master/mainnet-beta/all-rewarders-with-info.json";
9
9
  export declare const mergeMineProgramId: PublicKey;
10
10
  export declare const mineProgramId: PublicKey;
11
+ export declare const quarryRedeemerProgramId: PublicKey;
11
12
  export declare const redeemerProgramId: PublicKey;
12
13
  export declare const mineIdlItem: IdlItem;
13
14
  export declare const mergeMineIdlItem: IdlItem;
15
+ export declare const quarryRedeemerIdlItem: IdlItem;
14
16
  export declare const redeemerIdlItem: IdlItem;
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.redeemerIdlItem = exports.mergeMineIdlItem = exports.mineIdlItem = exports.redeemerProgramId = exports.mineProgramId = exports.mergeMineProgramId = exports.rewardersUrl = exports.rewardersCacheKey = exports.IOUTokensElementName = exports.platform = exports.platformId = void 0;
3
+ exports.redeemerIdlItem = exports.quarryRedeemerIdlItem = exports.mergeMineIdlItem = exports.mineIdlItem = exports.redeemerProgramId = exports.quarryRedeemerProgramId = exports.mineProgramId = exports.mergeMineProgramId = exports.rewardersUrl = exports.rewardersCacheKey = exports.IOUTokensElementName = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  const mineIdl_1 = require("./mineIdl");
6
6
  const mergeMineIdl_1 = require("./mergeMineIdl");
7
+ const quarryRedeemerIdl_1 = require("./quarryRedeemerIdl");
7
8
  const redeemerIdl_1 = require("./redeemerIdl");
8
9
  exports.platformId = 'quarry';
9
10
  exports.platform = {
@@ -19,7 +20,8 @@ exports.rewardersCacheKey = `rewarders`;
19
20
  exports.rewardersUrl = `https://cdn.jsdelivr.net/gh/QuarryProtocol/rewarder-list-build@master/mainnet-beta/all-rewarders-with-info.json`;
20
21
  exports.mergeMineProgramId = new web3_js_1.PublicKey('QMMD16kjauP5knBwxNUJRZ1Z5o3deBuFrqVjBVmmqto');
21
22
  exports.mineProgramId = new web3_js_1.PublicKey('QMNeHCGYnLVDn1icRAfQZpjPLBNkfGbSKRB83G5d8KB');
22
- exports.redeemerProgramId = new web3_js_1.PublicKey('QRDxhMw1P2NEfiw5mYXG79bwfgHTdasY2xNP76XSea9');
23
+ exports.quarryRedeemerProgramId = new web3_js_1.PublicKey('QRDxhMw1P2NEfiw5mYXG79bwfgHTdasY2xNP76XSea9');
24
+ exports.redeemerProgramId = new web3_js_1.PublicKey('RDM23yr8pr1kEAmhnFpaabPny6C9UVcEcok3Py5v86X');
23
25
  exports.mineIdlItem = {
24
26
  programId: exports.mineProgramId.toString(),
25
27
  idl: mineIdl_1.mineIdl,
@@ -30,6 +32,11 @@ exports.mergeMineIdlItem = {
30
32
  idl: mergeMineIdl_1.mergeMineIdl,
31
33
  idlType: 'anchor',
32
34
  };
35
+ exports.quarryRedeemerIdlItem = {
36
+ programId: exports.quarryRedeemerProgramId.toString(),
37
+ idl: quarryRedeemerIdl_1.quarryRedeemerIdl,
38
+ idlType: 'anchor',
39
+ };
33
40
  exports.redeemerIdlItem = {
34
41
  programId: exports.redeemerProgramId.toString(),
35
42
  idl: redeemerIdl_1.redeemerIdl,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAE5C,uCAAoC;AACpC,iDAA8C;AAC9C,+CAA4C;AAE/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,+CAA+C;IACtD,OAAO,EAAE,wBAAwB;IACjC,2CAA2C;IAC3C,WAAW,EAAE,QAAQ,EAAE,sCAAsC;CAC9D,CAAC;AAEW,QAAA,oBAAoB,GAAG,YAAY,CAAC;AAEpC,QAAA,iBAAiB,GAAG,WAAW,CAAC;AAChC,QAAA,YAAY,GAAG,iHAAiH,CAAC;AACjI,QAAA,kBAAkB,GAAG,IAAI,mBAAS,CAC7C,6CAA6C,CAC9C,CAAC;AACW,QAAA,aAAa,GAAG,IAAI,mBAAS,CACxC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,i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AC;AAEW,QAAA,WAAW,GAAG;IACzB,SAAS,EAAE,qBAAa,CAAC,QAAQ,EAAE;IACnC,GAAG,EAAE,iBAAO;IACZ,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,gBAAgB,GAAG;IAC9B,SAAS,EAAE,0BAAkB,CAAC,QAAQ,EAAE;IACxC,GAAG,EAAE,2BAAY;IACjB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,qBAAqB,GAAG;IACnC,SAAS,EAAE,+BAAuB,CAAC,QAAQ,EAAE;IAC7C,GAAG,EAAE,qCAAiB;IACtB,OAAO,EAAE,QAAQ;CACP,CAAC;AAEA,QAAA,eAAe,GAAG;IAC7B,SAAS,EAAE,yBAAiB,CAAC,QAAQ,EAAE;IACvC,GAAG,EAAE,yBAAW;IAChB,OAAO,EAAE,QAAQ;CACP,CAAC"}
@@ -0,0 +1,3 @@
1
+ import BigNumber from 'bignumber.js';
2
+ import { Miner, QuarryData } from './types';
3
+ export declare const getClaimableRewards: (quarryAccount: QuarryData, minerAccount: Miner) => BigNumber;
@@ -0,0 +1,18 @@
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.getClaimableRewards = void 0;
7
+ const bn_js_1 = __importDefault(require("bn.js"));
8
+ const bignumber_js_1 = __importDefault(require("bignumber.js"));
9
+ const payroll_1 = require("./payroll");
10
+ const getClaimableRewards = (quarryAccount, minerAccount) => {
11
+ const timeInSec = new bn_js_1.default(Math.floor(Date.now() / 1000));
12
+ const payroll = new payroll_1.Payroll(new bn_js_1.default(quarryAccount.famineTs), new bn_js_1.default(quarryAccount.lastUpdateTs), new bn_js_1.default(quarryAccount.annualRewardsRate), new bn_js_1.default(quarryAccount.rewardsPerTokenStored), new bn_js_1.default(quarryAccount.totalTokensDeposited));
13
+ return new bignumber_js_1.default(payroll
14
+ .calculateRewardsEarned(timeInSec, new bn_js_1.default(minerAccount.balance), new bn_js_1.default(minerAccount.rewardsPerTokenPaid), new bn_js_1.default(minerAccount.rewardsEarned))
15
+ .toString());
16
+ };
17
+ exports.getClaimableRewards = getClaimableRewards;
18
+ //# sourceMappingURL=getClaimableRewards.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getClaimableRewards.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/getClaimableRewards.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AACvB,gEAAqC;AAErC,uCAAoC;AAE7B,MAAM,mBAAmB,GAAG,CACjC,aAAyB,EACzB,YAAmB,EACnB,EAAE;IACF,MAAM,SAAS,GAAG,IAAI,eAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC;IAExD,MAAM,OAAO,GAAG,IAAI,iBAAO,CACzB,IAAI,eAAE,CAAC,aAAa,CAAC,QAAQ,CAAC,EAC9B,IAAI,eAAE,CAAC,aAAa,CAAC,YAAY,CAAC,EAClC,IAAI,eAAE,CAAC,aAAa,CAAC,iBAAiB,CAAC,EACvC,IAAI,eAAE,CAAC,aAAa,CAAC,qBAAqB,CAAC,EAC3C,IAAI,eAAE,CAAC,aAAa,CAAC,oBAAoB,CAAC,CAC3C,CAAC;IAEF,OAAO,IAAI,sBAAS,CAClB,OAAO;SACJ,sBAAsB,CACrB,SAAS,EACT,IAAI,eAAE,CAAC,YAAY,CAAC,OAAO,CAAC,EAC5B,IAAI,eAAE,CAAC,YAAY,CAAC,mBAAmB,CAAC,EACxC,IAAI,eAAE,CAAC,YAAY,CAAC,aAAa,CAAC,CACnC;SACA,QAAQ,EAAE,CACd,CAAC;AACJ,CAAC,CAAC;AAxBW,QAAA,mBAAmB,uBAwB9B"}
@@ -0,0 +1,29 @@
1
+ import BN from 'bn.js';
2
+ export declare const MAX_U64 = "18446744073709551616";
3
+ export declare const ZERO: BN;
4
+ export declare const BASE_TEN: BN;
5
+ export declare const MAX_U64_BN: BN;
6
+ export declare const SECONDS_PER_YEAR: BN;
7
+ export declare class Payroll {
8
+ readonly famineTs: BN;
9
+ readonly lastCheckpointTs: BN;
10
+ readonly annualRewardsRate: BN;
11
+ readonly rewardsPerTokenStored: BN;
12
+ readonly totalTokensDeposited: BN;
13
+ constructor(famineTs: BN, lastCheckpointTs: BN, annualRewardsRate: BN, rewardsPerTokenStored: BN, totalTokensDeposited: BN);
14
+ /**
15
+ * Calculates the amount of tokens that this user can receive.
16
+ * @param currentTs
17
+ * @returns
18
+ */
19
+ calculateRewardPerToken(currentTs: BN): BN;
20
+ /**
21
+ * Calculates the amount of tokens that this user can claim.
22
+ * @param currentTs
23
+ * @param tokensDeposited
24
+ * @param rewardsPerTokenPaid
25
+ * @param rewardsEarned
26
+ * @returns
27
+ */
28
+ calculateRewardsEarned(currentTs: BN, tokensDeposited: BN, rewardsPerTokenPaid: BN, rewardsEarned: BN): BN;
29
+ }
@@ -0,0 +1,54 @@
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.Payroll = exports.SECONDS_PER_YEAR = exports.MAX_U64_BN = exports.BASE_TEN = exports.ZERO = exports.MAX_U64 = void 0;
7
+ const bn_js_1 = __importDefault(require("bn.js"));
8
+ exports.MAX_U64 = '18446744073709551616';
9
+ exports.ZERO = new bn_js_1.default(0);
10
+ exports.BASE_TEN = new bn_js_1.default(10);
11
+ exports.MAX_U64_BN = new bn_js_1.default(exports.MAX_U64);
12
+ exports.SECONDS_PER_YEAR = new bn_js_1.default(365 * 86400);
13
+ class Payroll {
14
+ constructor(famineTs, lastCheckpointTs, annualRewardsRate, rewardsPerTokenStored, totalTokensDeposited) {
15
+ this.famineTs = famineTs;
16
+ this.lastCheckpointTs = lastCheckpointTs;
17
+ this.annualRewardsRate = annualRewardsRate;
18
+ this.rewardsPerTokenStored = rewardsPerTokenStored;
19
+ this.totalTokensDeposited = totalTokensDeposited;
20
+ }
21
+ /**
22
+ * Calculates the amount of tokens that this user can receive.
23
+ * @param currentTs
24
+ * @returns
25
+ */
26
+ calculateRewardPerToken(currentTs) {
27
+ if (this.totalTokensDeposited.isZero()) {
28
+ return this.rewardsPerTokenStored;
29
+ }
30
+ const lastTimeRewardsApplicable = bn_js_1.default.min(currentTs, this.famineTs);
31
+ const timeWorked = bn_js_1.default.max(exports.ZERO, lastTimeRewardsApplicable.sub(this.lastCheckpointTs));
32
+ const reward = timeWorked
33
+ .mul(exports.MAX_U64_BN)
34
+ .mul(this.annualRewardsRate)
35
+ .div(exports.SECONDS_PER_YEAR)
36
+ .div(this.totalTokensDeposited);
37
+ return this.rewardsPerTokenStored.add(reward);
38
+ }
39
+ /**
40
+ * Calculates the amount of tokens that this user can claim.
41
+ * @param currentTs
42
+ * @param tokensDeposited
43
+ * @param rewardsPerTokenPaid
44
+ * @param rewardsEarned
45
+ * @returns
46
+ */
47
+ calculateRewardsEarned(currentTs, tokensDeposited, rewardsPerTokenPaid, rewardsEarned) {
48
+ const netNewRewards = this.calculateRewardPerToken(currentTs).sub(rewardsPerTokenPaid);
49
+ const earnedRewards = tokensDeposited.mul(netNewRewards).div(exports.MAX_U64_BN);
50
+ return earnedRewards.add(rewardsEarned);
51
+ }
52
+ }
53
+ exports.Payroll = Payroll;
54
+ //# sourceMappingURL=payroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"payroll.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/payroll.ts"],"names":[],"mappings":";;;;;;AAAA,kDAAuB;AAEV,QAAA,OAAO,GAAG,sBAAsB,CAAC;AAEjC,QAAA,IAAI,GAAG,IAAI,eAAE,CAAC,CAAC,CAAC,CAAC;AACjB,QAAA,QAAQ,GAAG,IAAI,eAAE,CAAC,EAAE,CAAC,CAAC;AAEtB,QAAA,UAAU,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AAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,GAAG,CAAC,kBAAU,CAAC,CAAC;QACzE,OAAO,aAAa,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;IAC1C,CAAC;CACF;AAnDD,0BAmDC"}
@@ -14,6 +14,7 @@ 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 constants_2 = require("../thevault/constants");
19
20
  const constants_3 = require("../saber/constants");
@@ -36,24 +37,23 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
36
37
  ]);
37
38
  if (mergeMinerAccounts.length === 0 && minerAccounts.length === 0)
38
39
  return [];
39
- const replicaMinerAccounts = yield Promise.all(mergeMinerAccounts.map((mmAcount) => {
40
- return (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mineIdlItem, (0, filters_1.minerFilters)(mmAcount.pubkey.toString()));
41
- }));
40
+ const replicaMinerAccounts = yield Promise.all(mergeMinerAccounts.map((mmAcount) => (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.mineIdlItem, (0, filters_1.minerFilters)(mmAcount.pubkey.toString()))));
41
+ const quarryAccounts = yield (0, solana_1.getAutoParsedMultipleAccountsInfo)(connection, constants_1.mineIdlItem, [...minerAccounts, ...[...replicaMinerAccounts.values()].flat()].map((m) => new web3_js_1.PublicKey(m.quarry))).then((accs) => accs.filter((acc) => acc !== null));
42
42
  const allRewarders = yield rewardersMemo.getItem(cache);
43
43
  if (!allRewarders)
44
44
  return [];
45
- const positions = (0, calculatePositions_1.calculatePositions)(mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, owner);
45
+ const positions = (0, calculatePositions_1.calculatePositions)(mergeMinerAccounts, minerAccounts, replicaMinerAccounts, allRewarders, quarryAccounts, owner);
46
46
  if (positions.length === 0)
47
47
  return [];
48
48
  const mints = new Set();
49
49
  positions.forEach((position) => {
50
50
  mints.add(position.stakedTokenInfo.address);
51
- position.rewardsToken.forEach((rewardToken) => mints.add(rewardToken.toString()));
51
+ position.rewardsTokenInfo.forEach((rewardTokenInfo) => mints.add(rewardTokenInfo.address.toString()));
52
52
  });
53
53
  const tokenPrices = yield cache.getTokenPricesAsMap([...mints], portfolio_core_1.NetworkId.solana);
54
54
  const elements = [];
55
55
  positions.forEach((position) => {
56
- const { rewardsToken, rewardsBalance, primaryRewarder, stakedBalance, stakedTokenInfo, } = position;
56
+ const { rewardsTokenInfo, rewardsBalance, primaryRewarder, stakedBalance, stakedTokenInfo, } = position;
57
57
  const assets = [];
58
58
  const rewardAssets = [];
59
59
  const stakedTokenPrice = tokenPrices.get(stakedTokenInfo.address);
@@ -78,19 +78,36 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
78
78
  imageUri: stakedTokenInfo.logoURI,
79
79
  });
80
80
  }
81
- rewardsToken.forEach((rewardToken, i) => {
81
+ rewardsTokenInfo.forEach((rewardTokenInfo, i) => {
82
82
  var _a;
83
- if (rewardsBalance[i] === '0')
83
+ if (rewardsBalance[i].isZero())
84
84
  return;
85
- const rewardTokenPrice = tokenPrices.get(rewardToken);
85
+ const rewardTokenPrice = tokenPrices.get(rewardTokenInfo.address);
86
86
  if (rewardTokenPrice) {
87
87
  rewardAssets.push((0, tokenPriceToAssetToken_1.default)(rewardTokenPrice.elementName === constants_1.IOUTokensElementName &&
88
88
  ((_a = rewardTokenPrice.underlyings) === null || _a === void 0 ? void 0 : _a.length) === 1
89
89
  ? rewardTokenPrice.underlyings[0].address
90
- : rewardTokenPrice.address, new bignumber_js_1.default(rewardsBalance[i])
90
+ : rewardTokenPrice.address, rewardsBalance[i]
91
91
  .dividedBy(Math.pow(10, rewardTokenPrice.decimals))
92
92
  .toNumber(), portfolio_core_1.NetworkId.solana, rewardTokenPrice));
93
93
  }
94
+ else {
95
+ rewardAssets.push({
96
+ networkId: portfolio_core_1.NetworkId.solana,
97
+ type: 'token',
98
+ value: null,
99
+ attributes: {},
100
+ name: rewardTokenInfo.symbol,
101
+ data: {
102
+ amount: new bignumber_js_1.default(rewardsBalance[i])
103
+ .dividedBy(Math.pow(10, rewardTokenInfo.decimals))
104
+ .toNumber(),
105
+ address: rewardTokenInfo.address,
106
+ price: null,
107
+ },
108
+ imageUri: rewardTokenInfo.logoURI,
109
+ });
110
+ }
94
111
  });
95
112
  const assetsValue = (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value));
96
113
  const rewardAssetsValue = (0, portfolio_core_1.getUsdValueSum)(rewardAssets.map((a) => a.value));
@@ -1 +1 @@
1
- {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAErC,2CAOqB;AACrB,qDAAyE;AACzE,kDAAmE;AAEnE,iDAAsD;AACtD,+CAG4B;AAE5B,kEAA+D;AAC/D,qGAA6E;AAC7E,uGAA+E;AAC/E,uCAA4D;AAC5D,6DAA0D;AAE1D,MAAM,aAAa,GAAG,IAAI,6BAAa,CAAa,6BAAiB,EAAE;IACrE,MAAM,EAAE,sBAAU;IAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;CAC5B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,CAAC,kBAAkB,EAAE,aAAa,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC5D,IAAA,qCAA4B,EAC1B,UAAU,EACV,4BAAgB,EAChB,IAAA,2BAAiB,EAAC,KAAK,CAAC,CACzB,CAAC,IAAI,CACJ,CAAC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W,CAAC;QAE1B,IAAI,iBAAiB,CAAC;QAEtB,QAAQ,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7B,KAAK,OAAO;gBACV,iBAAiB,GAAG,sBAAkB,CAAC;gBACvC,MAAM;YACR,KAAK,OAAO;gBACV,iBAAiB,GAAG,sBAAe,CAAC;gBACpC,MAAM;YACR;gBACE,iBAAiB,GAAG,sBAAU,CAAC;QACnC,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,iBAAiB;YAC7B,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,KAAK;YACL,IAAI,EACF,iBAAiB,KAAK,sBAAU,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAQ,CAAC,IAAI;YACzE,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX;wBACE,MAAM;wBACN,WAAW;wBACX,YAAY;wBACZ,iBAAiB;wBACjB,KAAK;wBACL,MAAM,EAAE,EAAE;qBACX;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AACrC,6CAA4C;AAE5C,2CAOqB;AACrB,qDAAyE;AACzE,kDAAmE;AAEnE,iDAAsD;AACtD,+CAI4B;AAQ5B,kEAA+D;AAC/D,qGAA6E;AAC7E,uGAA+E;AAC/E,uCAA4D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BAAiB,GAAG,IAAA,+BAAc,EAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3E,MAAM,KAAK,GAAG,WAAW,CAAC;QAE1B,IAAI,iBAAiB,CAAC;QAEtB,QAAQ,eAAe,CAAC,IAAI,EAAE,CAAC;YAC7B,KAAK,OAAO;gBACV,iBAAiB,GAAG,sBAAkB,CAAC;gBACvC,MAAM;YACR,KAAK,OAAO;gBACV,iBAAiB,GAAG,sBAAe,CAAC;gBACpC,MAAM;YACR;gBACE,iBAAiB,GAAG,sBAAU,CAAC;QACnC,CAAC;QAED,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,iBAAiB;YAC7B,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,KAAK;YACL,IAAI,EACF,iBAAiB,KAAK,sBAAU,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,CAAC,CAAC,CAAC,oBAAQ,CAAC,IAAI;YACzE,IAAI,EAAE;gBACJ,WAAW,EAAE;oBACX;wBACE,MAAM;wBACN,WAAW;wBACX,YAAY;wBACZ,iBAAiB;wBACjB,KAAK;wBACL,MAAM,EAAE,EAAE;qBACX;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,YAAY;IAC7B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -0,0 +1,59 @@
1
+ export declare const quarryRedeemerIdl: {
2
+ version: string;
3
+ name: string;
4
+ instructions: {
5
+ name: string;
6
+ accounts: ({
7
+ name: string;
8
+ isMut: boolean;
9
+ isSigner: boolean;
10
+ pda: {
11
+ seeds: ({
12
+ kind: string;
13
+ type: string;
14
+ value: string;
15
+ account?: undefined;
16
+ path?: undefined;
17
+ } | {
18
+ kind: string;
19
+ type: string;
20
+ account: string;
21
+ path: string;
22
+ value?: undefined;
23
+ })[];
24
+ };
25
+ } | {
26
+ name: string;
27
+ isMut: boolean;
28
+ isSigner: boolean;
29
+ pda?: undefined;
30
+ })[];
31
+ args: {
32
+ name: string;
33
+ type: string;
34
+ }[];
35
+ }[];
36
+ accounts: {
37
+ name: string;
38
+ type: {
39
+ kind: string;
40
+ fields: {
41
+ name: string;
42
+ type: string;
43
+ }[];
44
+ };
45
+ }[];
46
+ events: {
47
+ name: string;
48
+ fields: {
49
+ name: string;
50
+ type: string;
51
+ index: boolean;
52
+ }[];
53
+ }[];
54
+ errors: {
55
+ code: number;
56
+ name: string;
57
+ msg: string;
58
+ }[];
59
+ };
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.quarryRedeemerIdl = void 0;
4
+ exports.quarryRedeemerIdl = {
5
+ version: '5.0.2',
6
+ name: 'quarry_redeemer',
7
+ instructions: [
8
+ {
9
+ name: 'createRedeemer',
10
+ accounts: [
11
+ {
12
+ name: 'redeemer',
13
+ isMut: !0,
14
+ isSigner: !1,
15
+ pda: {
16
+ seeds: [
17
+ {
18
+ kind: 'const',
19
+ type: 'string',
20
+ value: 'Redeemer',
21
+ },
22
+ {
23
+ kind: 'account',
24
+ type: 'publicKey',
25
+ account: 'Mint',
26
+ path: 'iou_mint',
27
+ },
28
+ {
29
+ kind: 'account',
30
+ type: 'publicKey',
31
+ account: 'Mint',
32
+ path: 'redemption_mint',
33
+ },
34
+ ],
35
+ },
36
+ },
37
+ {
38
+ name: 'iouMint',
39
+ isMut: !1,
40
+ isSigner: !1,
41
+ },
42
+ {
43
+ name: 'redemptionMint',
44
+ isMut: !1,
45
+ isSigner: !1,
46
+ },
47
+ {
48
+ name: 'payer',
49
+ isMut: !0,
50
+ isSigner: !0,
51
+ },
52
+ {
53
+ name: 'systemProgram',
54
+ isMut: !1,
55
+ isSigner: !1,
56
+ },
57
+ ],
58
+ args: [
59
+ {
60
+ name: 'bump',
61
+ type: 'u8',
62
+ },
63
+ ],
64
+ },
65
+ {
66
+ name: 'redeemTokens',
67
+ accounts: [
68
+ {
69
+ name: 'redeemer',
70
+ isMut: !0,
71
+ isSigner: !1,
72
+ },
73
+ {
74
+ name: 'sourceAuthority',
75
+ isMut: !1,
76
+ isSigner: !0,
77
+ },
78
+ {
79
+ name: 'iouMint',
80
+ isMut: !0,
81
+ isSigner: !1,
82
+ },
83
+ {
84
+ name: 'iouSource',
85
+ isMut: !0,
86
+ isSigner: !1,
87
+ },
88
+ {
89
+ name: 'redemptionVault',
90
+ isMut: !0,
91
+ isSigner: !1,
92
+ },
93
+ {
94
+ name: 'redemptionDestination',
95
+ isMut: !0,
96
+ isSigner: !1,
97
+ },
98
+ {
99
+ name: 'tokenProgram',
100
+ isMut: !1,
101
+ isSigner: !1,
102
+ },
103
+ ],
104
+ args: [
105
+ {
106
+ name: 'amount',
107
+ type: 'u64',
108
+ },
109
+ ],
110
+ },
111
+ {
112
+ name: 'redeemAllTokens',
113
+ accounts: [
114
+ {
115
+ name: 'redeemer',
116
+ isMut: !0,
117
+ isSigner: !1,
118
+ },
119
+ {
120
+ name: 'sourceAuthority',
121
+ isMut: !1,
122
+ isSigner: !0,
123
+ },
124
+ {
125
+ name: 'iouMint',
126
+ isMut: !0,
127
+ isSigner: !1,
128
+ },
129
+ {
130
+ name: 'iouSource',
131
+ isMut: !0,
132
+ isSigner: !1,
133
+ },
134
+ {
135
+ name: 'redemptionVault',
136
+ isMut: !0,
137
+ isSigner: !1,
138
+ },
139
+ {
140
+ name: 'redemptionDestination',
141
+ isMut: !0,
142
+ isSigner: !1,
143
+ },
144
+ {
145
+ name: 'tokenProgram',
146
+ isMut: !1,
147
+ isSigner: !1,
148
+ },
149
+ ],
150
+ args: [],
151
+ },
152
+ ],
153
+ accounts: [
154
+ {
155
+ name: 'Redeemer',
156
+ type: {
157
+ kind: 'struct',
158
+ fields: [
159
+ {
160
+ name: 'iouMint',
161
+ type: 'publicKey',
162
+ },
163
+ {
164
+ name: 'redemptionMint',
165
+ type: 'publicKey',
166
+ },
167
+ {
168
+ name: 'bump',
169
+ type: 'u8',
170
+ },
171
+ {
172
+ name: 'totalTokensRedeemed',
173
+ type: 'u64',
174
+ },
175
+ ],
176
+ },
177
+ },
178
+ ],
179
+ events: [
180
+ {
181
+ name: 'RedeemTokensEvent',
182
+ fields: [
183
+ {
184
+ name: 'user',
185
+ type: 'publicKey',
186
+ index: !1,
187
+ },
188
+ {
189
+ name: 'iouMint',
190
+ type: 'publicKey',
191
+ index: !1,
192
+ },
193
+ {
194
+ name: 'redemptionMint',
195
+ type: 'publicKey',
196
+ index: !1,
197
+ },
198
+ {
199
+ name: 'amount',
200
+ type: 'u64',
201
+ index: !1,
202
+ },
203
+ {
204
+ name: 'timestamp',
205
+ type: 'i64',
206
+ index: !1,
207
+ },
208
+ ],
209
+ },
210
+ ],
211
+ errors: [
212
+ {
213
+ code: 6e3,
214
+ name: 'Unauthorized',
215
+ msg: 'Unauthorized.',
216
+ },
217
+ ],
218
+ };
219
+ //# sourceMappingURL=quarryRedeemerIdl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quarryRedeemerIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/quarryRedeemerIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG;IAC/B,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;oBACZ,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL;gCAC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,EAAE,UAAU;YAChB,IAAI,EAAE;gBACJ,IAAI,EAAE,QAAQ;gBACd,MAAM,EAAE;oBACN;wBACE,IAAI,EAAE,SAAS;wBACf,IAAI,EAAE,WAAW;qBAClB;oBACD;wBACE,IAAI,EAAE,gBAAgB;wBACtB,IAAI,EAAE,WAAW;qBAClB;oBACD;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,IAAI;qBACX;oBACD;wBACE,IAAI,EAAE,qBAAqB;wBAC3B,IAAI,EAAE,KAAK;qBACZ;iBACF;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,mBAAmB;YACzB,MAAM,EAAE;gBACN;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,eAAe;SACrB;KACF;CACF,CAAC"}
@@ -5,28 +5,28 @@ export declare const redeemerIdl: {
5
5
  name: string;
6
6
  accounts: ({
7
7
  name: string;
8
- isMut: boolean;
9
- isSigner: boolean;
10
- pda: {
11
- seeds: ({
12
- kind: string;
13
- type: string;
14
- value: string;
15
- account?: undefined;
16
- path?: undefined;
17
- } | {
18
- kind: string;
19
- type: string;
20
- account: string;
21
- path: string;
22
- value?: undefined;
23
- })[];
24
- };
8
+ accounts: ({
9
+ name: string;
10
+ isMut: boolean;
11
+ isSigner: boolean;
12
+ accounts?: undefined;
13
+ } | {
14
+ name: string;
15
+ accounts: {
16
+ name: string;
17
+ isMut: boolean;
18
+ isSigner: boolean;
19
+ }[];
20
+ isMut?: undefined;
21
+ isSigner?: undefined;
22
+ })[];
23
+ isMut?: undefined;
24
+ isSigner?: undefined;
25
25
  } | {
26
26
  name: string;
27
27
  isMut: boolean;
28
28
  isSigner: boolean;
29
- pda?: undefined;
29
+ accounts?: undefined;
30
30
  })[];
31
31
  args: {
32
32
  name: string;
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.redeemerIdl = void 0;
4
4
  exports.redeemerIdl = {
5
- version: '5.0.2',
6
- name: 'quarry_redeemer',
5
+ version: '1.1.2',
6
+ name: 'redeemer',
7
7
  instructions: [
8
8
  {
9
9
  name: 'createRedeemer',
@@ -12,37 +12,26 @@ exports.redeemerIdl = {
12
12
  name: 'redeemer',
13
13
  isMut: !0,
14
14
  isSigner: !1,
15
- pda: {
16
- seeds: [
17
- {
18
- kind: 'const',
19
- type: 'string',
20
- value: 'Redeemer',
21
- },
22
- {
23
- kind: 'account',
24
- type: 'publicKey',
25
- account: 'Mint',
26
- path: 'iou_mint',
27
- },
28
- {
29
- kind: 'account',
30
- type: 'publicKey',
31
- account: 'Mint',
32
- path: 'redemption_mint',
33
- },
34
- ],
35
- },
36
15
  },
37
16
  {
38
- name: 'iouMint',
39
- isMut: !1,
40
- isSigner: !1,
41
- },
42
- {
43
- name: 'redemptionMint',
44
- isMut: !1,
45
- isSigner: !1,
17
+ name: 'tokens',
18
+ accounts: [
19
+ {
20
+ name: 'iouMint',
21
+ isMut: !1,
22
+ isSigner: !1,
23
+ },
24
+ {
25
+ name: 'redemptionMint',
26
+ isMut: !1,
27
+ isSigner: !1,
28
+ },
29
+ {
30
+ name: 'redemptionVault',
31
+ isMut: !1,
32
+ isSigner: !1,
33
+ },
34
+ ],
46
35
  },
47
36
  {
48
37
  name: 'payer',
@@ -67,39 +56,130 @@ exports.redeemerIdl = {
67
56
  accounts: [
68
57
  {
69
58
  name: 'redeemer',
70
- isMut: !0,
59
+ isMut: !1,
71
60
  isSigner: !1,
72
61
  },
62
+ {
63
+ name: 'tokens',
64
+ accounts: [
65
+ {
66
+ name: 'iouMint',
67
+ isMut: !0,
68
+ isSigner: !1,
69
+ },
70
+ {
71
+ name: 'redemptionMint',
72
+ isMut: !0,
73
+ isSigner: !1,
74
+ },
75
+ {
76
+ name: 'redemptionVault',
77
+ isMut: !0,
78
+ isSigner: !1,
79
+ },
80
+ {
81
+ name: 'tokenProgram',
82
+ isMut: !1,
83
+ isSigner: !1,
84
+ },
85
+ ],
86
+ },
73
87
  {
74
88
  name: 'sourceAuthority',
75
89
  isMut: !1,
76
90
  isSigner: !0,
77
91
  },
78
92
  {
79
- name: 'iouMint',
93
+ name: 'iouSource',
80
94
  isMut: !0,
81
95
  isSigner: !1,
82
96
  },
83
97
  {
84
- name: 'iouSource',
98
+ name: 'redemptionDestination',
85
99
  isMut: !0,
86
100
  isSigner: !1,
87
101
  },
102
+ ],
103
+ args: [
88
104
  {
89
- name: 'redemptionVault',
90
- isMut: !0,
105
+ name: 'amount',
106
+ type: 'u64',
107
+ },
108
+ ],
109
+ },
110
+ {
111
+ name: 'redeemTokensFromMintProxy',
112
+ accounts: [
113
+ {
114
+ name: 'redeemCtx',
115
+ accounts: [
116
+ {
117
+ name: 'redeemer',
118
+ isMut: !1,
119
+ isSigner: !1,
120
+ },
121
+ {
122
+ name: 'tokens',
123
+ accounts: [
124
+ {
125
+ name: 'iouMint',
126
+ isMut: !0,
127
+ isSigner: !1,
128
+ },
129
+ {
130
+ name: 'redemptionMint',
131
+ isMut: !0,
132
+ isSigner: !1,
133
+ },
134
+ {
135
+ name: 'redemptionVault',
136
+ isMut: !0,
137
+ isSigner: !1,
138
+ },
139
+ {
140
+ name: 'tokenProgram',
141
+ isMut: !1,
142
+ isSigner: !1,
143
+ },
144
+ ],
145
+ },
146
+ {
147
+ name: 'sourceAuthority',
148
+ isMut: !1,
149
+ isSigner: !0,
150
+ },
151
+ {
152
+ name: 'iouSource',
153
+ isMut: !0,
154
+ isSigner: !1,
155
+ },
156
+ {
157
+ name: 'redemptionDestination',
158
+ isMut: !0,
159
+ isSigner: !1,
160
+ },
161
+ ],
162
+ },
163
+ {
164
+ name: 'mintProxyState',
165
+ isMut: !1,
91
166
  isSigner: !1,
92
167
  },
93
168
  {
94
- name: 'redemptionDestination',
95
- isMut: !0,
169
+ name: 'proxyMintAuthority',
170
+ isMut: !1,
96
171
  isSigner: !1,
97
172
  },
98
173
  {
99
- name: 'tokenProgram',
174
+ name: 'mintProxyProgram',
100
175
  isMut: !1,
101
176
  isSigner: !1,
102
177
  },
178
+ {
179
+ name: 'minterInfo',
180
+ isMut: !0,
181
+ isSigner: !1,
182
+ },
103
183
  ],
104
184
  args: [
105
185
  {
@@ -109,43 +189,78 @@ exports.redeemerIdl = {
109
189
  ],
110
190
  },
111
191
  {
112
- name: 'redeemAllTokens',
192
+ name: 'redeemAllTokensFromMintProxy',
113
193
  accounts: [
114
194
  {
115
- name: 'redeemer',
116
- isMut: !0,
117
- isSigner: !1,
195
+ name: 'redeemCtx',
196
+ accounts: [
197
+ {
198
+ name: 'redeemer',
199
+ isMut: !1,
200
+ isSigner: !1,
201
+ },
202
+ {
203
+ name: 'tokens',
204
+ accounts: [
205
+ {
206
+ name: 'iouMint',
207
+ isMut: !0,
208
+ isSigner: !1,
209
+ },
210
+ {
211
+ name: 'redemptionMint',
212
+ isMut: !0,
213
+ isSigner: !1,
214
+ },
215
+ {
216
+ name: 'redemptionVault',
217
+ isMut: !0,
218
+ isSigner: !1,
219
+ },
220
+ {
221
+ name: 'tokenProgram',
222
+ isMut: !1,
223
+ isSigner: !1,
224
+ },
225
+ ],
226
+ },
227
+ {
228
+ name: 'sourceAuthority',
229
+ isMut: !1,
230
+ isSigner: !0,
231
+ },
232
+ {
233
+ name: 'iouSource',
234
+ isMut: !0,
235
+ isSigner: !1,
236
+ },
237
+ {
238
+ name: 'redemptionDestination',
239
+ isMut: !0,
240
+ isSigner: !1,
241
+ },
242
+ ],
118
243
  },
119
244
  {
120
- name: 'sourceAuthority',
245
+ name: 'mintProxyState',
121
246
  isMut: !1,
122
- isSigner: !0,
123
- },
124
- {
125
- name: 'iouMint',
126
- isMut: !0,
127
247
  isSigner: !1,
128
248
  },
129
249
  {
130
- name: 'iouSource',
131
- isMut: !0,
250
+ name: 'proxyMintAuthority',
251
+ isMut: !1,
132
252
  isSigner: !1,
133
253
  },
134
254
  {
135
- name: 'redemptionVault',
136
- isMut: !0,
255
+ name: 'mintProxyProgram',
256
+ isMut: !1,
137
257
  isSigner: !1,
138
258
  },
139
259
  {
140
- name: 'redemptionDestination',
260
+ name: 'minterInfo',
141
261
  isMut: !0,
142
262
  isSigner: !1,
143
263
  },
144
- {
145
- name: 'tokenProgram',
146
- isMut: !1,
147
- isSigner: !1,
148
- },
149
264
  ],
150
265
  args: [],
151
266
  },
@@ -156,6 +271,10 @@ exports.redeemerIdl = {
156
271
  type: {
157
272
  kind: 'struct',
158
273
  fields: [
274
+ {
275
+ name: 'bump',
276
+ type: 'u8',
277
+ },
159
278
  {
160
279
  name: 'iouMint',
161
280
  type: 'publicKey',
@@ -165,12 +284,8 @@ exports.redeemerIdl = {
165
284
  type: 'publicKey',
166
285
  },
167
286
  {
168
- name: 'bump',
169
- type: 'u8',
170
- },
171
- {
172
- name: 'totalTokensRedeemed',
173
- type: 'u64',
287
+ name: 'redemptionVault',
288
+ type: 'publicKey',
174
289
  },
175
290
  ],
176
291
  },
@@ -191,7 +306,7 @@ exports.redeemerIdl = {
191
306
  index: !1,
192
307
  },
193
308
  {
194
- name: 'redemptionMint',
309
+ name: 'destinationMint',
195
310
  type: 'publicKey',
196
311
  index: !1,
197
312
  },
@@ -200,11 +315,6 @@ exports.redeemerIdl = {
200
315
  type: 'u64',
201
316
  index: !1,
202
317
  },
203
- {
204
- name: 'timestamp',
205
- type: 'i64',
206
- index: !1,
207
- },
208
318
  ],
209
319
  },
210
320
  ],
@@ -214,6 +324,11 @@ exports.redeemerIdl = {
214
324
  name: 'Unauthorized',
215
325
  msg: 'Unauthorized.',
216
326
  },
327
+ {
328
+ code: 6001,
329
+ name: 'DecimalsMismatch',
330
+ msg: 'Redemption token and IOU token decimals must match',
331
+ },
217
332
  ],
218
333
  };
219
334
  //# sourceMappingURL=redeemerIdl.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"redeemerIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemerIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,iBAAiB;IACvB,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;oBACZ,GAAG,EAAE;wBACH,KAAK,EAAE;4BACL;gCACE,IAAI,EAAE,OAAO;gCACb,IAAI,EAAE,QAAQ;gCACd,KAAK,EAAE,UAAU;6BAClB;4BACD;gCACE,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,WAAW;gCACjB,OAAO,EAAE,MAAM;gCACf,IAAI,EAAE,UAAU;6BACjB;4BACD;gCACE,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,WAAW;gCACjB,OAAO,EAAE,MAAM;gCACf,IAAI,EAAE,iBAAiB;6BACxB;yBACF;qBACF;iBACF;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;iBACb;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,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C,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,SAAS;oBACf,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,gBAAgB;oBACtB,IAAI,EAAE,WAAW;oBACjB,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;gBACD;oBACE,IAAI,EAAE,WAAW;oBACjB,IAAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,eAAe;SACrB;KACF;CACF,CAAC"}
1
+ {"version":3,"file":"redeemerIdl.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemerIdl.ts"],"names":[],"mappings":";;;AAAa,QAAA,WAAW,GAAG;IACzB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,UAAU;IAChB,YAAY,EAAE;QACZ;YACE,IAAI,EAAE,gBAAgB;YACtB,QAAQ,EAAE;gBACR;oBACE,IAAI,EAAE,UAAU;oBAChB,KAAK,EAAE,CAAC,CAAC;oBACT,QAAQ,EAAE,CAAC,CAAC;iBACb;gBACD;oBACE,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE;wBACR;4BACE,IAAI,EAAE,SAAS;4BACf,KAAK,EAAE,CAAC,CAAC;4BACT,QAAQ,EAAE,CAAC,CAAC;yBACb;wBACD;4BACE,IAAI,EAAE,gBAAgB;4BACtB,KAAK,EAAE,CAAC,CAAC;4BACT,QAAQ,EAAE,CAAC,CAAC;yBACb;wBACD;4BACE,IAAI,EAAE,iBAAiB;4BACvB,KAAK,EAAE,CAAC,CAAC;4BACT,QAAQ,EAAE,CAAC,CAAC;yBACb;qBACF;iBACF;gBACD;oBACE,IA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AAI,EAAE,KAAK;oBACX,KAAK,EAAE,CAAC,CAAC;iBACV;aACF;SACF;KACF;IACD,MAAM,EAAE;QACN;YACE,IAAI,EAAE,GAAG;YACT,IAAI,EAAE,cAAc;YACpB,GAAG,EAAE,eAAe;SACrB;QACD;YACE,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,kBAAkB;YACxB,GAAG,EAAE,oDAAoD;SAC1D;KACF;CACF,CAAC"}
@@ -15,7 +15,10 @@ const clients_1 = require("../../utils/clients");
15
15
  const solana_1 = require("../../utils/solana");
16
16
  const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
17
17
  const connection = (0, clients_1.getClientSolana)();
18
- const accounts = yield (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.redeemerIdlItem);
18
+ const accounts = (yield Promise.all([
19
+ (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.quarryRedeemerIdlItem),
20
+ (0, solana_1.getAutoParsedProgramAccounts)(connection, constants_1.redeemerIdlItem),
21
+ ])).flat();
19
22
  if (accounts.length === 0)
20
23
  return;
21
24
  const sources = [];
@@ -1 +1 @@
1
- {"version":3,"file":"redeemersJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemersJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAAgF;AAEhF,iDAAsD;AACtD,+CAAkE;AAElE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,QAAQ,GAAG,MAAM,IAAA,qCAA4B,EACjD,UAAU,EACV,2BAAe,CAChB,CAAC;IAEF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAElC,MAAM,OAAO,GAAuB,EAAE,CAAC;IAEvC,MAAM,WAAW,GAAG,MAAM,KAAK,CAAC,mBAAmB,CACjD,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,cAAc,CAAC,EACzC,0BAAS,CAAC,MAAM,CACjB,CAAC;IAEF,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,MAAM,oBAAoB,GAAG,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QACjE,IAAI,CAAC,oBAAoB;YAAE,OAAO;QAElC,OAAO,CAAC,IAAI,CAAC;YACX,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;YACvC,EAAE,EAAE,sBAAU;YACd,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,oBAAoB,CAAC,KAAK;YACjC,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;YACrB,MAAM,EAAE,CAAC;YACT,WAAW,EAAE,gCAAoB;YACjC,WAAW,EAAE;gBACX;oBACE,OAAO,EAAE,GAAG,CAAC,cAAc;oBAC3B,QAAQ,EAAE,oBAAoB,CAAC,QAAQ;oBACvC,WAAW,EAAE,CAAC;oBACd,SAAS,EAAE,0BAAS,CAAC,MAAM;oBAC3B,KAAK,EAAE,oBAAoB,CAAC,KAAK;iBAClC;aACF;SACF,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,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"redeemersJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/quarry/redeemersJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAyE;AAGzE,2CAKqB;AAErB,iDAAsD;AACtD,+CAAkE;AAElE,MAAM,Q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AK,EAAE,oBAAoB,CAAC,KAAK;iBAClC;aACF;SACF,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,YAAY;IAC7B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
@@ -1,4 +1,5 @@
1
1
  import { PublicKey } from '@solana/web3.js';
2
+ import BigNumber from 'bignumber.js';
2
3
  export type TokenInfo = {
3
4
  decimals: number;
4
5
  mint: string;
@@ -87,8 +88,21 @@ export type Position = {
87
88
  slug: string;
88
89
  name?: string;
89
90
  };
90
- rewardsToken: string[];
91
- rewardsBalance: string[];
91
+ rewardsTokenInfo: DetailedTokenInfo[];
92
+ rewardsBalance: BigNumber[];
92
93
  stakedTokenInfo: DetailedTokenInfo;
93
94
  stakedBalance: string;
94
95
  };
96
+ export type QuarryData = {
97
+ rewarder: string;
98
+ tokenMintKey: string;
99
+ index: number;
100
+ tokenMintDecimals: number;
101
+ famineTs: string;
102
+ lastUpdateTs: string;
103
+ rewardsPerTokenStored: string;
104
+ annualRewardsRate: string;
105
+ rewardsShare: string;
106
+ totalTokensDeposited: string;
107
+ numMiners: string;
108
+ };
@@ -11,7 +11,6 @@ exports.platform = {
11
11
  defiLlamaId: 'suins', // from https://defillama.com/docs/api
12
12
  };
13
13
  exports.airdropStatics = {
14
- claimLink: undefined,
15
14
  emitterLink: 'https://token.suins.io/',
16
15
  emitterName: 'Sui NS',
17
16
  id: `${exports.platformId}-token-launch`,
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suins/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,OAAO,EAAE,sCAAsC;CAC7D,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,QAAQ;IACrB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,8CAA8C;IACrD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,MAAM,GAAG,SAAS,CAAC;AACnB,QAAA,UAAU,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/suins/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,kBAAkB;IACxB,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,mBAAmB;IAC5B,OAAO,EAAE,yBAAyB;IAClC,WAAW,EAAE,OAAO,EAAE,sCAAsC;CAC7D,CAAC;AACW,QAAA,cAAc,GAAmB;IAC5C,WAAW,EAAE,yBAAyB;IACtC,WAAW,EAAE,QAAQ;IACrB,EAAE,EAAE,GAAG,kBAAU,eAAe;IAChC,KAAK,EAAE,8CAA8C;IACrD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,SAAS;CACtB,CAAC;AAEW,QAAA,MAAM,GAAG,SAAS,CAAC;AACnB,QAAA,UAAU,GAAG,CAAC,CAAC"}