@sonarwatch/portfolio-plugins 0.11.191 → 0.11.193

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/CHANGELOG.md +9 -1
  2. package/package.json +2 -2
  3. package/src/index.js +5 -0
  4. package/src/index.js.map +1 -1
  5. package/src/orphanPlatorms.js +0 -8
  6. package/src/orphanPlatorms.js.map +1 -1
  7. package/src/plugins/aftermath/constants.d.ts +2 -0
  8. package/src/plugins/aftermath/constants.js +3 -1
  9. package/src/plugins/aftermath/constants.js.map +1 -1
  10. package/src/plugins/aftermath/index.js +2 -1
  11. package/src/plugins/aftermath/index.js.map +1 -1
  12. package/src/plugins/aftermath/stakingFetcher.d.ts +3 -0
  13. package/src/plugins/aftermath/stakingFetcher.js +102 -0
  14. package/src/plugins/aftermath/stakingFetcher.js.map +1 -0
  15. package/src/plugins/aftermath/types.d.ts +17 -0
  16. package/src/plugins/drift/airdropFetcher.d.ts +3 -0
  17. package/src/plugins/drift/airdropFetcher.js +79 -0
  18. package/src/plugins/drift/airdropFetcher.js.map +1 -0
  19. package/src/plugins/drift/constants.d.ts +2 -0
  20. package/src/plugins/drift/constants.js +3 -1
  21. package/src/plugins/drift/constants.js.map +1 -1
  22. package/src/plugins/drift/index.js +2 -1
  23. package/src/plugins/drift/index.js.map +1 -1
  24. package/src/plugins/drift/types.d.ts +12 -0
  25. package/src/plugins/flash/stakeFetcher.js +9 -10
  26. package/src/plugins/flash/stakeFetcher.js.map +1 -1
  27. package/src/plugins/flexlend/constants.js +4 -4
  28. package/src/plugins/flexlend/constants.js.map +1 -1
  29. package/src/plugins/jito/airdropFetcher.js +1 -2
  30. package/src/plugins/jito/airdropFetcher.js.map +1 -1
  31. package/src/plugins/jupiter/launchpad/allocationsFetcher.js +1 -1
  32. package/src/plugins/kamino/airdropFetcher.js +1 -1
  33. package/src/plugins/parcl/airdropFetcher.js +1 -2
  34. package/src/plugins/parcl/airdropFetcher.js.map +1 -1
  35. package/src/plugins/sandglass/constants.d.ts +6 -0
  36. package/src/plugins/sandglass/constants.js +16 -0
  37. package/src/plugins/sandglass/constants.js.map +1 -0
  38. package/src/plugins/sandglass/depositFetcher.d.ts +3 -0
  39. package/src/plugins/sandglass/depositFetcher.js +82 -0
  40. package/src/plugins/sandglass/depositFetcher.js.map +1 -0
  41. package/src/plugins/sandglass/filters.d.ts +3 -0
  42. package/src/plugins/sandglass/filters.js +21 -0
  43. package/src/plugins/sandglass/filters.js.map +1 -0
  44. package/src/plugins/sandglass/index.d.ts +6 -0
  45. package/src/plugins/sandglass/index.js +13 -0
  46. package/src/plugins/sandglass/index.js.map +1 -0
  47. package/src/plugins/{jupiter/exchange/poolJob.d.ts → sandglass/marketsJob.d.ts} +1 -1
  48. package/src/plugins/sandglass/marketsJob.js +96 -0
  49. package/src/plugins/sandglass/marketsJob.js.map +1 -0
  50. package/src/plugins/sandglass/structs.d.ts +150 -0
  51. package/src/plugins/sandglass/structs.js +144 -0
  52. package/src/plugins/sandglass/structs.js.map +1 -0
  53. package/src/plugins/sandglass/types.d.ts +7 -0
  54. package/src/plugins/sandglass/types.js +3 -0
  55. package/src/plugins/sandglass/types.js.map +1 -0
  56. package/src/plugins/tensor/airdropPowerUsersFetcher.d.ts +3 -0
  57. package/src/plugins/tensor/airdropPowerUsersFetcher.js +45 -0
  58. package/src/plugins/tensor/airdropPowerUsersFetcher.js.map +1 -0
  59. package/src/plugins/tensor/constants.d.ts +2 -0
  60. package/src/plugins/tensor/constants.js +3 -1
  61. package/src/plugins/tensor/constants.js.map +1 -1
  62. package/src/plugins/tensor/helpers.d.ts +1 -0
  63. package/src/plugins/tensor/helpers.js +16 -0
  64. package/src/plugins/tensor/helpers.js.map +1 -0
  65. package/src/plugins/tensor/index.js +6 -1
  66. package/src/plugins/tensor/index.js.map +1 -1
  67. package/src/plugins/tensor/powerUsers.json +2898 -0
  68. package/src/plugins/wormhole/airdropFetcher.js +1 -2
  69. package/src/plugins/wormhole/airdropFetcher.js.map +1 -1
  70. package/src/plugins/jupiter/exchange/poolJob.js +0 -77
  71. package/src/plugins/jupiter/exchange/poolJob.js.map +0 -1
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __importDefault = (this && this.__importDefault) || function (mod) {
12
+ return (mod && mod.__esModule) ? mod : { "default": mod };
13
+ };
14
+ Object.defineProperty(exports, "__esModule", { value: true });
15
+ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
+ const constants_1 = require("./constants");
17
+ const helpers_1 = require("./helpers");
18
+ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
19
+ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
20
+ const amount = (0, helpers_1.findPowerUserAllocation)(owner);
21
+ if (!amount)
22
+ return [];
23
+ const tokenPrice = yield cache.getTokenPrice(constants_1.tnsrMint, portfolio_core_1.NetworkId.solana);
24
+ const asset = (0, tokenPriceToAssetToken_1.default)(constants_1.tnsrMint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, undefined, { isClaimable: false });
25
+ return [
26
+ {
27
+ type: 'multiple',
28
+ label: 'Airdrop',
29
+ networkId: portfolio_core_1.NetworkId.solana,
30
+ platformId: constants_1.platformId,
31
+ name: 'Power User',
32
+ data: {
33
+ assets: [asset],
34
+ },
35
+ value: asset.value,
36
+ },
37
+ ];
38
+ });
39
+ const fetcher = {
40
+ id: `${constants_1.platformId}-airdrop-power-users`,
41
+ networkId: portfolio_core_1.NetworkId.solana,
42
+ executor,
43
+ };
44
+ exports.default = fetcher;
45
+ //# sourceMappingURL=airdropPowerUsersFetcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"airdropPowerUsersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/airdropPowerUsersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAmD;AACnD,uCAAoD;AACpD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,iCAAuB,EAAC,KAAK,CAAC,CAAC;IAC9C,IAAI,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAEvB,MAAM,UAAU,GAAG,MAAM,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC,CAAC;IAEzE,MAAM,KAAK,GAAG,IAAA,gCAAsB,EAClC,oBAAQ,EACR,MAAM,EACN,0BAAS,CAAC,MAAM,EAChB,UAAU,EACV,SAAS,EACT,EAAE,WAAW,EAAE,KAAK,EAAE,CACvB,CAAC;IAEF,OAAO;QACL;YACE,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,SAAS;YAChB,SAAS,EAAE,0BAAS,CAAC,MAAM;YAC3B,UAAU,EAAV,sBAAU;YACV,IAAI,EAAE,YAAY;YAClB,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;YACD,KAAK,EAAE,KAAK,CAAC,KAAK;SACnB;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,sBAAsB;IACvC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -5,3 +5,5 @@ export declare const platform: Platform;
5
5
  export declare const cachePrefix = "tensor";
6
6
  export declare const tensorPid: PublicKey;
7
7
  export declare const locksPid: PublicKey;
8
+ export declare const tnsrMint = "TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6";
9
+ export declare const tnsrDecimals = 9;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.locksPid = exports.tensorPid = exports.cachePrefix = exports.platform = exports.platformId = void 0;
3
+ exports.tnsrDecimals = exports.tnsrMint = exports.locksPid = exports.tensorPid = exports.cachePrefix = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'tensor';
6
6
  exports.platform = {
@@ -13,4 +13,6 @@ exports.platform = {
13
13
  exports.cachePrefix = 'tensor';
14
14
  exports.tensorPid = new web3_js_1.PublicKey('TSWAPaqyCSx2KABk68Shruf4rp7CxcNi8hAsbdwmHbN');
15
15
  exports.locksPid = new web3_js_1.PublicKey('TLoCKic2wGJm7VhZKumih4Lc35fUhYqVMgA4j389Buk');
16
+ exports.tnsrMint = 'TNSRxcUxoT9xBG3de7PiJyTDYu7kskLqcpddxnEJAS6';
17
+ exports.tnsrDecimals = 9;
16
18
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,2BAA2B;CACrC,CAAC;AACW,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,QAAQ,CAAC;AACtB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,8CAA8C;IACrD,OAAO,EAAE,+BAA+B;IACxC,OAAO,EAAE,2BAA2B;CACrC,CAAC;AACW,QAAA,WAAW,GAAG,QAAQ,CAAC;AAEvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,QAAQ,GAAG,IAAI,mBAAS,CACnC,6CAA6C,CAC9C,CAAC;AACW,QAAA,QAAQ,GAAG,6CAA6C,CAAC;AACzD,QAAA,YAAY,GAAG,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function findPowerUserAllocation(owner: string): number | undefined;
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.findPowerUserAllocation = void 0;
7
+ const powerUsers_json_1 = __importDefault(require("./powerUsers.json"));
8
+ function findPowerUserAllocation(owner) {
9
+ const users = powerUsers_json_1.default;
10
+ const amount = users[owner];
11
+ if (!amount)
12
+ return undefined;
13
+ return amount;
14
+ }
15
+ exports.findPowerUserAllocation = findPowerUserAllocation;
16
+ //# sourceMappingURL=helpers.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,wEAA2C;AAE3C,SAAgB,uBAAuB,CAAC,KAAa;IACnD,MAAM,KAAK,GAA8B,yBAAU,CAAC;IACpD,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;IAC5B,IAAI,CAAC,MAAM;QAAE,OAAO,SAAS,CAAC;IAC9B,OAAO,MAAM,CAAC;AAChB,CAAC;AALD,0DAKC"}
@@ -7,6 +7,11 @@ exports.fetchers = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
8
  const bidsFetcher_1 = __importDefault(require("./bidsFetcher"));
9
9
  const locksFetcher_1 = __importDefault(require("./locksFetcher"));
10
+ const airdropPowerUsersFetcher_1 = __importDefault(require("./airdropPowerUsersFetcher"));
10
11
  exports.platforms = [constants_1.platform];
11
- exports.fetchers = [bidsFetcher_1.default, locksFetcher_1.default];
12
+ exports.fetchers = [
13
+ bidsFetcher_1.default,
14
+ locksFetcher_1.default,
15
+ airdropPowerUsersFetcher_1.default,
16
+ ];
12
17
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc,CAAC,qBAAW,EAAE,sBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,kEAA0C;AAC1C,0FAAiE;AAEpD,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc;IACjC,qBAAW;IACX,sBAAY;IACZ,kCAAuB;CACxB,CAAC"}