@sonarwatch/portfolio-plugins 0.11.111 → 0.11.112

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. package/CHANGELOG.md +1169 -1161
  2. package/README.md +3 -3
  3. package/package.json +2 -2
  4. package/src/index.js +5 -4
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/aurory/stakingFetcher.js +2 -3
  7. package/src/plugins/aurory/stakingFetcher.js.map +1 -1
  8. package/src/plugins/balancer/helpers/pools.js +21 -21
  9. package/src/plugins/flash/poolJob.js +14 -68
  10. package/src/plugins/flash/poolJob.js.map +1 -1
  11. package/src/plugins/hawksight/positionsFetcher.js +10 -8
  12. package/src/plugins/hawksight/positionsFetcher.js.map +1 -1
  13. package/src/plugins/jupiter/constants.d.ts +2 -0
  14. package/src/plugins/jupiter/constants.js +8 -1
  15. package/src/plugins/jupiter/constants.js.map +1 -1
  16. package/src/plugins/jupiter/index.d.ts +2 -0
  17. package/src/plugins/jupiter/index.js +3 -1
  18. package/src/plugins/jupiter/index.js.map +1 -1
  19. package/src/plugins/jupiter/poolJob.js +3 -5
  20. package/src/plugins/jupiter/poolJob.js.map +1 -1
  21. package/src/plugins/orders/index.js +2 -7
  22. package/src/plugins/orders/index.js.map +1 -1
  23. package/src/plugins/orders/jupiter/constants.d.ts +0 -2
  24. package/src/plugins/orders/jupiter/constants.js +1 -8
  25. package/src/plugins/orders/jupiter/constants.js.map +1 -1
  26. package/src/plugins/orders/jupiter/dcaFetcher.js +2 -1
  27. package/src/plugins/orders/jupiter/dcaFetcher.js.map +1 -1
  28. package/src/plugins/orders/jupiter/limitFetcher.js +2 -1
  29. package/src/plugins/orders/jupiter/limitFetcher.js.map +1 -1
  30. package/src/plugins/spl-staking/constants.d.ts +15 -0
  31. package/src/plugins/spl-staking/constants.js +51 -0
  32. package/src/plugins/spl-staking/constants.js.map +1 -0
  33. package/src/plugins/spl-staking/filters.js.map +1 -0
  34. package/src/plugins/{flowmatic → spl-staking}/index.js +3 -2
  35. package/src/plugins/spl-staking/index.js.map +1 -0
  36. package/src/plugins/spl-staking/poolsJob.d.ts +3 -0
  37. package/src/plugins/spl-staking/poolsJob.js +39 -0
  38. package/src/plugins/spl-staking/poolsJob.js.map +1 -0
  39. package/src/plugins/spl-staking/stakingFetcher.js +83 -0
  40. package/src/plugins/spl-staking/stakingFetcher.js.map +1 -0
  41. package/src/plugins/spl-staking/structs.d.ts +42 -0
  42. package/src/plugins/spl-staking/structs.js +42 -0
  43. package/src/plugins/spl-staking/structs.js.map +1 -0
  44. package/src/plugins/spl-staking/types.d.ts +4 -0
  45. package/src/plugins/spl-staking/types.js +3 -0
  46. package/src/plugins/spl-staking/types.js.map +1 -0
  47. package/src/plugins/sushiswap/helpers.js +24 -24
  48. package/src/plugins/tensor/bidsFetcher.js +2 -0
  49. package/src/plugins/tensor/bidsFetcher.js.map +1 -1
  50. package/src/plugins/tensor/singleListingFetcher.js +0 -79
  51. package/src/plugins/tensor/singleListingFetcher.js.map +1 -1
  52. package/src/plugins/uniswap-v2/helpers.js +22 -22
  53. package/src/plugins/x-staking-solana/constants.js +9 -0
  54. package/src/plugins/x-staking-solana/constants.js.map +1 -1
  55. package/src/utils/sei/constants.js +8 -8
  56. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  57. package/src/plugins/flowmatic/constants.d.ts +0 -6
  58. package/src/plugins/flowmatic/constants.js +0 -16
  59. package/src/plugins/flowmatic/constants.js.map +0 -1
  60. package/src/plugins/flowmatic/filters.js.map +0 -1
  61. package/src/plugins/flowmatic/index.js.map +0 -1
  62. package/src/plugins/flowmatic/stakingFetcher.js +0 -59
  63. package/src/plugins/flowmatic/stakingFetcher.js.map +0 -1
  64. package/src/plugins/flowmatic/structs.d.ts +0 -16
  65. package/src/plugins/flowmatic/structs.js +0 -18
  66. package/src/plugins/flowmatic/structs.js.map +0 -1
  67. /package/src/plugins/{flowmatic → spl-staking}/filters.d.ts +0 -0
  68. /package/src/plugins/{flowmatic → spl-staking}/filters.js +0 -0
  69. /package/src/plugins/{flowmatic → spl-staking}/index.d.ts +0 -0
  70. /package/src/plugins/{flowmatic → spl-staking}/stakingFetcher.d.ts +0 -0
@@ -1,16 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.flowmaticMint = exports.programId = exports.platform = exports.platformId = void 0;
4
- const web3_js_1 = require("@solana/web3.js");
5
- exports.platformId = 'flowmatic';
6
- exports.platform = {
7
- id: exports.platformId,
8
- name: 'Flowmatic',
9
- image: 'https://sonar.watch/img/platforms/flowmatic.png',
10
- // defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
11
- website: 'https://www.flowmatic.xyz/',
12
- twitter: 'https://twitter.com/FlowmaticXYZ',
13
- };
14
- exports.programId = new web3_js_1.PublicKey('STAKEGztX7S1MUHxcQHieZhELCntb9Ys9BgUbeEtMu1');
15
- exports.flowmaticMint = 'Eh1fXbAipe4k7CYR9UMb2bbWmBcpU3HcyX3LWuRVFBLz';
16
- //# sourceMappingURL=constants.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowmatic/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,WAAW,CAAC;AACzB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,iDAAiD;IACxD,qEAAqE;IACrE,OAAO,EAAE,4BAA4B;IACrC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AAEW,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,6CAA6C,CAC9C,CAAC;AAEW,QAAA,aAAa,GAAG,8CAA8C,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowmatic/filters.ts"],"names":[],"mappings":";;;AAEO,MAAM,YAAY,GAAG,CAAC,KAAa,EAA8B,EAAE,CAAC;IACzE;QACE,MAAM,EAAE;YACN,MAAM,EAAE,CAAC;YACT,KAAK,EAAE,KAAK;SACb;KACF;IACD,EAAE,QAAQ,EAAE,GAAG,EAAE;CAClB,CAAC;AARW,QAAA,YAAY,gBAQvB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowmatic/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,wBAAc,CAAC,CAAC"}
@@ -1,59 +0,0 @@
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 clients_1 = require("../../utils/clients");
18
- const solana_1 = require("../../utils/solana");
19
- const structs_1 = require("../bonkrewards/structs");
20
- const filters_1 = require("./filters");
21
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
- const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
23
- const client = (0, clients_1.getClientSolana)();
24
- const stakeAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, structs_1.stakeDepositReceiptStruct, constants_1.programId, (0, filters_1.stakeFilters)(owner));
25
- if (stakeAccounts.length === 0)
26
- return [];
27
- const tokenPrice = yield cache.getTokenPrice(constants_1.flowmaticMint, portfolio_core_1.NetworkId.solana);
28
- const assets = [];
29
- for (const stakeAccount of stakeAccounts) {
30
- if (stakeAccount.depositAmount.isZero())
31
- continue;
32
- const lockedUntil = new Date(stakeAccount.depositTimestamp
33
- .plus(stakeAccount.lockupDuration)
34
- .times(1000)
35
- .toNumber()).getTime();
36
- assets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(constants_1.flowmaticMint, stakeAccount.depositAmount.dividedBy(Math.pow(10, 4)).toNumber(), portfolio_core_1.NetworkId.solana, tokenPrice)), { attributes: {
37
- lockedUntil,
38
- } }));
39
- }
40
- if (assets.length === 0)
41
- return [];
42
- return [
43
- {
44
- type: portfolio_core_1.PortfolioElementType.multiple,
45
- label: 'Staked',
46
- networkId: portfolio_core_1.NetworkId.solana,
47
- platformId: constants_1.platformId,
48
- data: { assets },
49
- value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
50
- },
51
- ];
52
- });
53
- const fetcher = {
54
- id: `${constants_1.platformId}-staking`,
55
- networkId: portfolio_core_1.NetworkId.solana,
56
- executor,
57
- };
58
- exports.default = fetcher;
59
- //# sourceMappingURL=stakingFetcher.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowmatic/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAKoC;AAGpC,2CAAmE;AACnE,iDAAsD;AACtD,+CAA8D;AAC9D,oDAAmE;AACnE,uCAAyC;AACzC,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,aAAa,GAAG,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,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -1,16 +0,0 @@
1
- /// <reference types="node" />
2
- import { BeetStruct } from '@metaplex-foundation/beet';
3
- import { PublicKey } from '@solana/web3.js';
4
- import BigNumber from 'bignumber.js';
5
- export type StakeDepositReceipt = {
6
- buffer: Buffer;
7
- owner: PublicKey;
8
- payer: PublicKey;
9
- stakePool: PublicKey;
10
- lockupDuration: BigNumber;
11
- depositTimestamp: BigNumber;
12
- depositAmount: BigNumber;
13
- effectiveStake: BigNumber;
14
- claimedAmounts: BigNumber[];
15
- };
16
- export declare const StakeDepositReceiptStruct: BeetStruct<StakeDepositReceipt, Partial<StakeDepositReceipt>>;
@@ -1,18 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.StakeDepositReceiptStruct = 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
- exports.StakeDepositReceiptStruct = new beet_1.BeetStruct([
8
- ['buffer', (0, solana_1.blob)(8)],
9
- ['owner', beet_solana_1.publicKey],
10
- ['payer', beet_solana_1.publicKey],
11
- ['stakePool', beet_solana_1.publicKey],
12
- ['lockupDuration', solana_1.u64],
13
- ['depositTimestamp', solana_1.i64],
14
- ['depositAmount', solana_1.u64],
15
- ['effectiveStake', solana_1.u128],
16
- ['claimedAmounts', (0, beet_1.uniformFixedSizeArray)(solana_1.u128, 10)],
17
- ], (args) => args);
18
- //# sourceMappingURL=structs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowmatic/structs.ts"],"names":[],"mappings":";;;AAAA,oDAA8E;AAC9E,kEAA6D;AAG7D,+CAA0D;AAc7C,QAAA,yBAAyB,GAAG,IAAI,iBAAU,CACrD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,gBAAgB,EAAE,YAAG,CAAC;IACvB,CAAC,kBAAkB,EAAE,YAAG,CAAC;IACzB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,gBAAgB,EAAE,aAAI,CAAC;IACxB,CAAC,gBAAgB,EAAE,IAAA,4BAAqB,EAAC,aAAI,EAAE,EAAE,CAAC,CAAC;CACpD,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAA2B,CACtC,CAAC"}