@sonarwatch/portfolio-plugins 0.12.179 → 0.12.181

Sign up to get free protection for your applications and to get access to all the features.
Files changed (61) hide show
  1. package/CHANGELOG.md +1514 -1506
  2. package/README.md +3 -3
  3. package/package.json +1 -1
  4. package/src/index.js +5 -0
  5. package/src/index.js.map +1 -1
  6. package/src/plugins/balancer/helpers/pools.js +21 -21
  7. package/src/plugins/bucket/bucketsJob.js +71 -0
  8. package/src/plugins/bucket/bucketsJob.js.map +1 -0
  9. package/src/plugins/bucket/collateralFetcher.js +46 -60
  10. package/src/plugins/bucket/collateralFetcher.js.map +1 -1
  11. package/src/plugins/bucket/constants.d.ts +8 -5
  12. package/src/plugins/bucket/constants.js +11 -20
  13. package/src/plugins/bucket/constants.js.map +1 -1
  14. package/src/plugins/bucket/index.js +5 -2
  15. package/src/plugins/bucket/index.js.map +1 -1
  16. package/src/plugins/bucket/sbuckJob.js +56 -0
  17. package/src/plugins/bucket/sbuckJob.js.map +1 -0
  18. package/src/plugins/bucket/stakingFetcher.d.ts +3 -0
  19. package/src/plugins/bucket/stakingFetcher.js +47 -0
  20. package/src/plugins/bucket/stakingFetcher.js.map +1 -0
  21. package/src/plugins/bucket/types.d.ts +113 -0
  22. package/src/plugins/loopscale/constants.d.ts +3 -1
  23. package/src/plugins/loopscale/constants.js +4 -4
  24. package/src/plugins/loopscale/constants.js.map +1 -1
  25. package/src/plugins/loopscale/filters.d.ts +7 -0
  26. package/src/plugins/loopscale/filters.js +62 -0
  27. package/src/plugins/loopscale/filters.js.map +1 -0
  28. package/src/plugins/loopscale/helpers.d.ts +33 -0
  29. package/src/plugins/loopscale/helpers.js +162 -0
  30. package/src/plugins/loopscale/helpers.js.map +1 -0
  31. package/src/plugins/loopscale/index.js +1 -2
  32. package/src/plugins/loopscale/index.js.map +1 -1
  33. package/src/plugins/loopscale/positionsFetcher.js +89 -40
  34. package/src/plugins/loopscale/positionsFetcher.js.map +1 -1
  35. package/src/plugins/loopscale/structs.d.ts +95 -14
  36. package/src/plugins/loopscale/structs.js +87 -13
  37. package/src/plugins/loopscale/structs.js.map +1 -1
  38. package/src/plugins/moonwalk/constants.d.ts +1 -0
  39. package/src/plugins/moonwalk/constants.js +2 -1
  40. package/src/plugins/moonwalk/constants.js.map +1 -1
  41. package/src/plugins/moonwalk/gamesFetcher.js +24 -61
  42. package/src/plugins/moonwalk/gamesFetcher.js.map +1 -1
  43. package/src/plugins/moonwalk/index.js +1 -2
  44. package/src/plugins/moonwalk/index.js.map +1 -1
  45. package/src/plugins/moonwalk/types.d.ts +12 -0
  46. package/src/plugins/moonwalk/types.js +3 -0
  47. package/src/plugins/moonwalk/types.js.map +1 -0
  48. package/src/plugins/save/obligationsFetcher.js +3 -3
  49. package/src/plugins/save/obligationsFetcher.js.map +1 -1
  50. package/src/plugins/stabble/constants.js +1 -1
  51. package/src/plugins/sushiswap/helpers.js +24 -24
  52. package/src/plugins/uniswap-v2/helpers.js +22 -22
  53. package/src/plugins/zeta/airdropFetcher.js +14 -14
  54. package/src/utils/sei/constants.js +8 -8
  55. package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
  56. package/src/plugins/loopscale/marketsJob.js +0 -26
  57. package/src/plugins/loopscale/marketsJob.js.map +0 -1
  58. package/src/plugins/moonwalk/gamesJob.js +0 -37
  59. package/src/plugins/moonwalk/gamesJob.js.map +0 -1
  60. /package/src/plugins/{loopscale/marketsJob.d.ts → bucket/bucketsJob.d.ts} +0 -0
  61. /package/src/plugins/{moonwalk/gamesJob.d.ts → bucket/sbuckJob.d.ts} +0 -0
@@ -1,19 +1,100 @@
1
1
  /// <reference types="node" />
2
- import { BeetStruct } from '@metaplex-foundation/beet';
3
2
  import { PublicKey } from '@solana/web3.js';
4
3
  import BigNumber from 'bignumber.js';
5
- export declare enum State {
6
- Uninitialized = 0,
7
- StakePool = 1,
8
- InactiveStakePool = 2,
9
- StakeAccount = 3
10
- }
11
- export type Liquidity = {
4
+ import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
5
+ export type RoleAccount = {
12
6
  buffer: Buffer;
13
- state: State;
14
- mint: PublicKey;
15
- owner: PublicKey;
16
- amountDeposited: BigNumber;
17
- space: number[];
7
+ user: PublicKey;
8
+ organization: PublicKey;
9
+ type: number;
18
10
  };
19
- export declare const liquidityStruct: BeetStruct<Liquidity, Partial<Liquidity>>;
11
+ export declare const roleAccountStruct: BeetStruct<RoleAccount, Partial<RoleAccount>>;
12
+ export type LoanVault = {
13
+ buffer: Buffer;
14
+ order: PublicKey;
15
+ lender: PublicKey;
16
+ borrower: PublicKey;
17
+ collateral: PublicKey;
18
+ debt_note: PublicKey;
19
+ credit_note: PublicKey;
20
+ credit_claimed: boolean;
21
+ debt_claimed: boolean;
22
+ loan_start_time: BigNumber;
23
+ num_fees_outstanding: BigNumber;
24
+ fees_received: BigNumber;
25
+ };
26
+ export declare const loanVaultStruct: BeetStruct<LoanVault, Partial<LoanVault>>;
27
+ export type EscrowAccount = {
28
+ buffer: Buffer;
29
+ organization_identifier: PublicKey;
30
+ num_escrowed: BigNumber;
31
+ nonce: PublicKey;
32
+ origination_cap: BigNumber;
33
+ cumulative_amount_originated: BigNumber;
34
+ external_yield_source: number;
35
+ };
36
+ export declare const escrowAccountStruct: BeetStruct<EscrowAccount, Partial<EscrowAccount>>;
37
+ export type Order = {
38
+ buffer: Buffer;
39
+ version: number;
40
+ nonce: PublicKey;
41
+ maker: PublicKey;
42
+ designated_taker: PublicKey;
43
+ principal_mint: PublicKey;
44
+ principal_amount: BigNumber;
45
+ collateral_mint: PublicKey;
46
+ collateral_amount: BigNumber;
47
+ maker_role: number;
48
+ last_updated_slot: BigNumber;
49
+ max_outstanding_payments: BigNumber;
50
+ last_payment_id: BigNumber;
51
+ final_payment_id: BigNumber;
52
+ final_payment_time_offset: BigNumber;
53
+ status: number;
54
+ default_type: number;
55
+ created_at: BigNumber;
56
+ funding_type: number;
57
+ allow_early_repayments: boolean;
58
+ origination_fee: BigNumber;
59
+ liquidation_manager: PublicKey;
60
+ market_manager: PublicKey;
61
+ liquidation_threshold: BigNumber;
62
+ refinance_enabled: boolean;
63
+ max_refinance_apy: BigNumber;
64
+ refinance_duration: BigNumber;
65
+ refinance_duration_type: number;
66
+ };
67
+ export declare const orderStruct: BeetStruct<Order, Partial<Order>>;
68
+ export type Ledger = {
69
+ ledger_id: BigNumber;
70
+ principal_due: BigNumber;
71
+ principal_repaid: BigNumber;
72
+ interest_due: BigNumber;
73
+ interest_repaid: BigNumber;
74
+ due_time_offset: BigNumber;
75
+ paid_time: BigNumber;
76
+ payment_type: number;
77
+ is_filled: boolean;
78
+ grace_period: BigNumber;
79
+ late_payment_fee: BigNumber;
80
+ early_payment_fee: BigNumber;
81
+ payment_window: BigNumber;
82
+ reserve: number[];
83
+ };
84
+ export declare const ledgerStruct: BeetStruct<Ledger, Partial<Ledger>>;
85
+ export type OrderLedger = {
86
+ buffer: Buffer;
87
+ version: number;
88
+ order: PublicKey;
89
+ ledgers: Ledger[];
90
+ };
91
+ export declare const orderLedgerStruct: FixableBeetStruct<OrderLedger, Partial<OrderLedger>>;
92
+ export type Lockbox = {
93
+ buffer: Buffer;
94
+ nonce: PublicKey;
95
+ name: Buffer;
96
+ initialization_time: BigNumber;
97
+ nft_mint: PublicKey;
98
+ state: number;
99
+ };
100
+ export declare const lockboxStruct: FixableBeetStruct<Lockbox, Partial<Lockbox>>;
@@ -1,22 +1,96 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.liquidityStruct = exports.State = void 0;
3
+ exports.lockboxStruct = exports.orderLedgerStruct = exports.ledgerStruct = exports.orderStruct = exports.escrowAccountStruct = exports.loanVaultStruct = exports.roleAccountStruct = void 0;
4
4
  const beet_1 = require("@metaplex-foundation/beet");
5
5
  const beet_solana_1 = require("@metaplex-foundation/beet-solana");
6
6
  const solana_1 = require("../../utils/solana");
7
- var State;
8
- (function (State) {
9
- State[State["Uninitialized"] = 0] = "Uninitialized";
10
- State[State["StakePool"] = 1] = "StakePool";
11
- State[State["InactiveStakePool"] = 2] = "InactiveStakePool";
12
- State[State["StakeAccount"] = 3] = "StakeAccount";
13
- })(State || (exports.State = State = {}));
14
- exports.liquidityStruct = new beet_1.BeetStruct([
7
+ exports.roleAccountStruct = new beet_1.BeetStruct([
15
8
  ['buffer', (0, solana_1.blob)(8)],
9
+ ['user', beet_solana_1.publicKey],
10
+ ['organization', beet_solana_1.publicKey],
11
+ ['type', beet_1.u32],
12
+ ], (args) => args);
13
+ exports.loanVaultStruct = new beet_1.BeetStruct([
14
+ ['buffer', (0, solana_1.blob)(8)],
15
+ ['order', beet_solana_1.publicKey],
16
+ ['lender', beet_solana_1.publicKey],
17
+ ['borrower', beet_solana_1.publicKey],
18
+ ['collateral', beet_solana_1.publicKey],
19
+ ['debt_note', beet_solana_1.publicKey],
20
+ ['credit_note', beet_solana_1.publicKey],
21
+ ['credit_claimed', beet_1.bool],
22
+ ['debt_claimed', beet_1.bool],
23
+ ['loan_start_time', solana_1.i64],
24
+ ['num_fees_outstanding', solana_1.u64],
25
+ ['fees_received', solana_1.u64],
26
+ ], (args) => args);
27
+ exports.escrowAccountStruct = new beet_1.BeetStruct([
28
+ ['buffer', (0, solana_1.blob)(8)],
29
+ ['organization_identifier', beet_solana_1.publicKey],
30
+ ['num_escrowed', solana_1.u64],
31
+ ['nonce', beet_solana_1.publicKey],
32
+ ['origination_cap', solana_1.u64],
33
+ ['cumulative_amount_originated', solana_1.u64],
34
+ ['external_yield_source', beet_1.u8],
35
+ ], (args) => args);
36
+ exports.orderStruct = new beet_1.BeetStruct([
37
+ ['buffer', (0, solana_1.blob)(8)],
38
+ ['version', beet_1.u8],
39
+ ['nonce', beet_solana_1.publicKey],
40
+ ['maker', beet_solana_1.publicKey],
41
+ ['designated_taker', beet_solana_1.publicKey],
42
+ ['principal_mint', beet_solana_1.publicKey],
43
+ ['principal_amount', solana_1.u64],
44
+ ['collateral_mint', beet_solana_1.publicKey],
45
+ ['collateral_amount', solana_1.u64],
46
+ ['maker_role', beet_1.u8],
47
+ ['last_updated_slot', solana_1.u64],
48
+ ['max_outstanding_payments', solana_1.u64],
49
+ ['last_payment_id', solana_1.u64],
50
+ ['final_payment_id', solana_1.u64],
51
+ ['final_payment_time_offset', solana_1.i64],
52
+ ['status', beet_1.u8],
53
+ ['default_type', beet_1.u8],
54
+ ['created_at', solana_1.i64],
55
+ ['funding_type', beet_1.u8],
56
+ ['allow_early_repayments', beet_1.bool],
57
+ ['origination_fee', solana_1.u64],
58
+ ['liquidation_manager', beet_solana_1.publicKey],
59
+ ['market_manager', beet_solana_1.publicKey],
60
+ ['liquidation_threshold', solana_1.u64],
61
+ ['refinance_enabled', beet_1.bool],
62
+ ['max_refinance_apy', solana_1.u64],
63
+ ['refinance_duration', solana_1.i64],
64
+ ['refinance_duration_type', beet_1.u8],
65
+ ], (args) => args);
66
+ exports.ledgerStruct = new beet_1.BeetStruct([
67
+ ['ledger_id', solana_1.u64],
68
+ ['principal_due', solana_1.u64],
69
+ ['principal_repaid', solana_1.u64],
70
+ ['interest_due', solana_1.u64],
71
+ ['interest_repaid', solana_1.u64],
72
+ ['due_time_offset', solana_1.i64],
73
+ ['paid_time', solana_1.i64],
74
+ ['payment_type', beet_1.u8],
75
+ ['is_filled', beet_1.bool],
76
+ ['grace_period', solana_1.i64],
77
+ ['late_payment_fee', solana_1.u64],
78
+ ['early_payment_fee', solana_1.u64],
79
+ ['payment_window', solana_1.i64],
80
+ ['reserve', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 32)],
81
+ ], (args) => args);
82
+ exports.orderLedgerStruct = new beet_1.FixableBeetStruct([
83
+ ['buffer', (0, solana_1.blob)(8)],
84
+ ['version', beet_1.u8],
85
+ ['order', beet_solana_1.publicKey],
86
+ ['ledgers', (0, beet_1.array)(exports.ledgerStruct)],
87
+ ], (args) => args);
88
+ exports.lockboxStruct = new beet_1.FixableBeetStruct([
89
+ ['buffer', (0, solana_1.blob)(8)],
90
+ ['nonce', beet_solana_1.publicKey],
91
+ ['name', (0, solana_1.blob)(24)],
92
+ ['initialization_time', solana_1.i64],
93
+ ['nft_mint', beet_solana_1.publicKey],
16
94
  ['state', beet_1.u8],
17
- ['mint', beet_solana_1.publicKey],
18
- ['owner', beet_solana_1.publicKey],
19
- ['amountDeposited', solana_1.u64],
20
- ['space', (0, beet_1.uniformFixedSizeArray)(beet_1.u8, 128)],
21
95
  ], (args) => args);
22
96
  //# sourceMappingURL=structs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAA+C;AAE/C,IAAY,KAKX;AALD,WAAY,KAAK;IACf,mDAAa,CAAA;IACb,2CAAS,CAAA;IACT,2DAAiB,CAAA;IACjB,iDAAY,CAAA;AACd,CAAC,EALW,KAAK,qBAAL,KAAK,QAKhB;AAWY,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,OAAO,EAAE,SAAE,CAAC;IACb,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,iBAAiB,EAAE,YAAG,CAAC;IACxB,CAAC,OAAO,EAAE,IAAA,4BAAqB,EAAC,SAAE,EAAE,GAAG,CAAC,CAAC;CAC1C,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC"}
1
+ {"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/loopscale/structs.ts"],"names":[],"mappings":";;;AAEA,oDAQmC;AACnC,kEAA6D;AAC7D,+CAAoD;AASvC,QAAA,iBAAiB,GAAG,IAAI,iBAAU,CAC7C;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,uBAAS,CAA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";
4
4
  export declare const platform: Platform;
5
5
  export declare const gamesCacheId = "games";
6
6
  export declare const programId: PublicKey;
7
+ export declare const api = "https://api.moonwalk.fit/api/users/tokens/";
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.programId = exports.gamesCacheId = exports.platform = exports.platformId = void 0;
3
+ exports.api = exports.programId = exports.gamesCacheId = exports.platform = exports.platformId = void 0;
4
4
  const web3_js_1 = require("@solana/web3.js");
5
5
  exports.platformId = 'moonwalk';
6
6
  exports.platform = {
@@ -13,4 +13,5 @@ exports.platform = {
13
13
  };
14
14
  exports.gamesCacheId = `games`;
15
15
  exports.programId = new web3_js_1.PublicKey('FitAFk15vtx2PBjfr7QTnefaHRx6HwajRiZMt1DdSSKU');
16
+ exports.api = 'https://api.moonwalk.fit/api/users/tokens/';
16
17
  //# sourceMappingURL=constants.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,qEAAqE;CACtE,CAAC;AACW,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC"}
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/constants.ts"],"names":[],"mappings":";;;AAAA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,UAAU,CAAC;AACxB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,iDAAiD;IACxD,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,qCAAqC;IAC9C,qEAAqE;CACtE,CAAC;AACW,QAAA,YAAY,GAAG,OAAO,CAAC;AACvB,QAAA,SAAS,GAAG,IAAI,mBAAS,CACpC,8CAA8C,CAC/C,CAAC;AAEW,QAAA,GAAG,GAAG,4CAA4C,CAAC"}
@@ -13,72 +13,35 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
13
13
  };
14
14
  Object.defineProperty(exports, "__esModule", { value: true });
15
15
  const portfolio_core_1 = require("@sonarwatch/portfolio-core");
16
- const bignumber_js_1 = __importDefault(require("bignumber.js"));
16
+ const axios_1 = __importDefault(require("axios"));
17
17
  const constants_1 = require("./constants");
18
- const clients_1 = require("../../utils/clients");
19
- const solana_1 = require("../../utils/solana");
20
- const structs_1 = require("./structs");
21
- const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
22
- const constants_2 = require("../bonkrewards/constants");
23
- const helpers_1 = require("./helpers");
24
- const cachedGames = new Map();
25
- let lastCachedGames = 0;
18
+ const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
26
19
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
27
- const connection = (0, clients_1.getClientSolana)();
28
- const now = Date.now();
29
- if (lastCachedGames + 600000 < now) {
30
- const cCachedGames = yield cache.getItem(constants_1.gamesCacheId, {
31
- prefix: constants_1.platformId,
32
- networkId: portfolio_core_1.NetworkId.solana,
20
+ const apiResponse = yield axios_1.default.get(constants_1.api + owner, {
21
+ timeout: 3000,
22
+ });
23
+ if (!apiResponse.data)
24
+ return [];
25
+ const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
26
+ for (const game of apiResponse.data) {
27
+ const element = registry.addElementMultiple({
28
+ label: 'Deposit',
29
+ name: game.game,
33
30
  });
34
- lastCachedGames = now;
35
- cCachedGames === null || cCachedGames === void 0 ? void 0 : cCachedGames.forEach((c) => {
36
- cachedGames.set(c.gameId, c);
31
+ element.addAsset({
32
+ address: game.token,
33
+ amount: game.claimable,
34
+ alreadyShifted: true,
35
+ attributes: { isClaimable: true },
37
36
  });
38
- }
39
- const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.gamePlayerStruct, constants_1.programId, [
40
- {
41
- dataSize: structs_1.gamePlayerStruct.byteSize,
42
- },
43
- {
44
- memcmp: {
45
- bytes: owner,
46
- offset: 9,
47
- },
48
- },
49
- ]);
50
- if (accounts.length === 0)
51
- return [];
52
- const tokenPrices = yield cache.getTokenPricesAsMap([portfolio_core_1.solanaNativeAddress, solana_1.usdcSolanaMint, constants_2.bonkMint], portfolio_core_1.NetworkId.solana);
53
- const assets = [];
54
- accounts.forEach((acc) => {
55
- if (acc.claimed)
56
- return;
57
- const game = cachedGames.get(acc.gameId.toString());
58
- if (!game)
59
- return;
60
- const { mint } = (0, helpers_1.getMintFromCurrency)(game.currency);
61
- const tokenPrice = tokenPrices.get(mint);
62
- const amount = new bignumber_js_1.default(game.playerDeposit).toNumber();
63
- const lockedUntil = Number(game.blocktimeEnd);
64
- const asset = (0, tokenPriceToAssetToken_1.default)(mint, amount, portfolio_core_1.NetworkId.solana, tokenPrice, tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.price, {
65
- lockedUntil,
37
+ element.addAsset({
38
+ address: game.token,
39
+ amount: game.locked,
40
+ alreadyShifted: true,
41
+ attributes: { lockedUntil: game.end * 1000 },
66
42
  });
67
- assets.push(asset);
68
- });
69
- if (assets.length === 0)
70
- return [];
71
- const element = {
72
- networkId: portfolio_core_1.NetworkId.solana,
73
- label: 'Deposit',
74
- platformId: constants_1.platformId,
75
- type: portfolio_core_1.PortfolioElementType.multiple,
76
- value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
77
- data: {
78
- assets,
79
- },
80
- };
81
- return [element];
43
+ }
44
+ return registry.getElements(cache);
82
45
  });
83
46
  const fetcher = {
84
47
  id: `${constants_1.platformId}-games`,
@@ -1 +1 @@
1
- {"version":3,"file":"gamesFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/gamesFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAErC,2CAAkE;AAElE,iDAAsD;AACtD,+CAA8E;AAC9E,uCAAyD;AACzD,qGAA6E;AAC7E,wDAAoD;AACpD,uCAAgD;AAEhD,MAAM,WAAW,GAA4B,IAAI,GAAG,EAAE,CAAC;AACvD,IAAI,eAAe,GAAG,CAAC,CAAC;AAExB,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACvB,IAAI,eAAe,GAAG,MAAM,GAAG,GAAG,EAAE,CAAC;QACnC,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,wBAAY,EAAE;YACnE,MAAM,EAAE,sBAAU;YAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,eAAe,GAAG,GAAG,CAAC;QACtB,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;YAC1B,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,UAAU,EACV,0BAAgB,EAChB,qBAAS,EACT;QACE;YACE,QAAQ,EAAE,0BAAgB,CAAC,QAAQ;SACpC;QACD;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,CAAC;aACV;SACF;KACF,CACF,CAAC;IACF,IAAI,QAAQ,CAAC,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EAAE,WAAW,EAAE,IAAI,EAAE;SAClC,CAAC,CAAC;QACH,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,IAAI,CAAC,KAAK;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,IAAI;YACpB,UAAU,EAAE,EAAE,WAAW,EAAE,IAAI,CAAC,GAAG,GAAG,IAAI,EAAE;SAC7C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -5,9 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.fetchers = exports.jobs = exports.platforms = void 0;
7
7
  const constants_1 = require("./constants");
8
- const gamesJob_1 = __importDefault(require("./gamesJob"));
9
8
  const gamesFetcher_1 = __importDefault(require("./gamesFetcher"));
10
9
  exports.platforms = [constants_1.platform];
11
- exports.jobs = [gamesJob_1.default];
10
+ exports.jobs = [];
12
11
  exports.fetchers = [gamesFetcher_1.default];
13
12
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,0DAAkC;AAClC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,kEAA0C;AAE7B,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,EAAE,CAAC;AACjB,QAAA,QAAQ,GAAc,CAAC,sBAAY,CAAC,CAAC"}
@@ -0,0 +1,12 @@
1
+ export type Games = {
2
+ game: string;
3
+ claimable: number;
4
+ locked: number;
5
+ token: string;
6
+ end: number;
7
+ sponsors: {
8
+ name: string;
9
+ claimable: number;
10
+ token: string;
11
+ }[];
12
+ }[];
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/moonwalk/types.ts"],"names":[],"mappings":""}
@@ -31,9 +31,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
31
31
  if (market)
32
32
  marketsByAddress.set(market.address.toString(), market);
33
33
  });
34
- yield marketsByAddress.forEach((marketInfo) => __awaiter(void 0, void 0, void 0, function* () {
34
+ for (const marketInfo of marketsByAddress.values()) {
35
35
  if (!marketInfo)
36
- return;
36
+ continue;
37
37
  const seeds = [
38
38
  (0, helpers_1.getObligationSeed)(marketInfo.address, 0),
39
39
  (0, helpers_1.getObligationSeed)(marketInfo.address, 1),
@@ -44,7 +44,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
44
44
  const obligationAddress = yield web3_js_1.PublicKey.createWithSeed(new web3_js_1.PublicKey(owner), seed, constants_1.pid);
45
45
  obligationAddresses.push(obligationAddress);
46
46
  }
47
- }));
47
+ }
48
48
  const obligationsRaw = yield (0, solana_1.getParsedMultipleAccountsInfo)(client, structs_1.obligationStruct, obligationAddresses);
49
49
  if (obligationsRaw.length === 0)
50
50
  return [];
@@ -1 +1 @@
1
- {"version":3,"file":"obligationsFetcher.js","s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CACjB,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"obligationsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/save/obligationsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAAyD;AAGzD,2CAA0E;AAC1E,uCAA0E;AAE1E,+CAG4B;AAC5B,iDAAsD;AACtD,uCAAyD;AACzD,gGAA6F;AAE7F,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,mBAAmB,GAAgB,EAAE,CAAC;IAE5C,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,sBAAU,EAAE;QAC5D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;IACH,IAAI,CAAC,OAAO;QAAE,OAAO,EAAE,CAAC;IAExB,MAAM,gBAAgB,GAA4B,IAAI,GAAG,EAAE,CAAC;IAC5D,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;QACzB,IAAI,MAAM;YAAE,gBAAgB,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IAEH,KAAK,MAAM,UAAU,IAAI,gBAAgB,CAAC,MAAM,EAAE,EAAE,CAAC;QACnD,IAAI,CAAC,UAAU;YAAE,SAAS;QAC1B,MAAM,KAAK,GAAG;YACZ,IAAA,2BAAiB,EAAC,UAAU,CAAC,OAAO,EAAE,CAAC,CAAC;YACxC,IAAA,2BAAiB,EAA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AE/B,gBAAgB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAE,OAAO,CAAC,CAAC;IAC7D,CAAC;IAED,OAAO,IAAA,oCAA0B,EAC/B,WAAW,EACX,gBAAgB,EAChB,gBAAgB,EAChB,mBAAmB,EACnB,gBAAgB,CACjB,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,cAAc;IAC/B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
@@ -6,7 +6,7 @@ const weightedIdl_1 = require("./weightedIdl");
6
6
  exports.platformId = 'stabble';
7
7
  exports.platform = {
8
8
  id: exports.platformId,
9
- name: 'stabble',
9
+ name: 'Stabble',
10
10
  image: 'https://sonar.watch/img/platforms/stabble.webp',
11
11
  website: 'https://app.stabble.org/',
12
12
  twitter: 'https://x.com/stabbleorg',
@@ -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;
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
42
42
  const clients_1 = require("../../utils/clients");
43
43
  const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
44
44
  const helpers_1 = require("./helpers");
45
- const query = (0, graphql_request_1.gql) `
46
- query GetAirdropFinalFrontend($authority: String!) {
47
- getAirdropFinalFrontend(authority: $authority) {
48
- authority
49
- community_allocation
50
- eligibility
51
- main_allocation
52
- og_allocation
53
- s1_allocation
54
- s2_allocation
55
- total_allocation
56
- __typename
57
- }
58
- }
45
+ const query = (0, graphql_request_1.gql) `
46
+ query GetAirdropFinalFrontend($authority: String!) {
47
+ getAirdropFinalFrontend(authority: $authority) {
48
+ authority
49
+ community_allocation
50
+ eligibility
51
+ main_allocation
52
+ og_allocation
53
+ s1_allocation
54
+ s2_allocation
55
+ total_allocation
56
+ __typename
57
+ }
58
+ }
59
59
  `;
60
60
  const networkId = portfolio_core_1.NetworkId.solana;
61
61
  const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
4
- exports.infoQueryMsg = JSON.parse(`{
5
- "info": {}
4
+ exports.infoQueryMsg = JSON.parse(`{
5
+ "info": {}
6
6
  }`);
7
- exports.tokenInfoQueryMsg = JSON.parse(`{
8
- "token_info": {}
7
+ exports.tokenInfoQueryMsg = JSON.parse(`{
8
+ "token_info": {}
9
9
  }`);
10
- exports.minterQueryMsg = JSON.parse(`{
11
- "minter": {}
10
+ exports.minterQueryMsg = JSON.parse(`{
11
+ "minter": {}
12
12
  }`);
13
- exports.poolQueryMsg = JSON.parse(`{
14
- "pool": {}
13
+ exports.poolQueryMsg = JSON.parse(`{
14
+ "pool": {}
15
15
  }`);
16
16
  //# sourceMappingURL=constants.js.map