@sonarwatch/portfolio-plugins 0.14.20 → 0.14.22
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/src/index.js +16 -0
- package/src/index.js.map +1 -1
- package/src/plugins/cyberfrogs/constants.d.ts +5 -0
- package/src/plugins/cyberfrogs/constants.js +14 -0
- package/src/plugins/cyberfrogs/constants.js.map +1 -0
- package/src/plugins/cyberfrogs/index.d.ts +6 -0
- package/src/plugins/cyberfrogs/index.js +12 -0
- package/src/plugins/cyberfrogs/index.js.map +1 -0
- package/src/plugins/cyberfrogs/structs.d.ts +13 -0
- package/src/plugins/cyberfrogs/structs.js +15 -0
- package/src/plugins/cyberfrogs/structs.js.map +1 -0
- package/src/plugins/cyberfrogs/thorDepositFetcher.js +52 -0
- package/src/plugins/cyberfrogs/thorDepositFetcher.js.map +1 -0
- package/src/plugins/grass/constants.d.ts +6 -0
- package/src/plugins/grass/constants.js +15 -0
- package/src/plugins/grass/constants.js.map +1 -0
- package/src/plugins/grass/helpers.d.ts +2 -0
- package/src/plugins/grass/helpers.js +10 -0
- package/src/plugins/grass/helpers.js.map +1 -0
- package/src/plugins/grass/index.d.ts +6 -0
- package/src/plugins/grass/index.js +12 -0
- package/src/plugins/grass/index.js.map +1 -0
- package/src/plugins/grass/stakingFetcher.d.ts +3 -0
- package/src/plugins/grass/stakingFetcher.js +52 -0
- package/src/plugins/grass/stakingFetcher.js.map +1 -0
- package/src/plugins/grass/structs.d.ts +28 -0
- package/src/plugins/grass/structs.js +28 -0
- package/src/plugins/grass/structs.js.map +1 -0
- package/src/plugins/hxro/constants.d.ts +6 -0
- package/src/plugins/hxro/constants.js +16 -0
- package/src/plugins/hxro/constants.js.map +1 -0
- package/src/plugins/hxro/index.d.ts +6 -0
- package/src/plugins/hxro/index.js +12 -0
- package/src/plugins/hxro/index.js.map +1 -0
- package/src/plugins/hxro/stakingFetcher.d.ts +3 -0
- package/src/plugins/hxro/stakingFetcher.js +57 -0
- package/src/plugins/hxro/stakingFetcher.js.map +1 -0
- package/src/plugins/hxro/structs.d.ts +37 -0
- package/src/plugins/hxro/structs.js +36 -0
- package/src/plugins/hxro/structs.js.map +1 -0
- package/src/plugins/hxro/types.d.ts +5 -0
- package/src/plugins/hxro/types.js +3 -0
- package/src/plugins/hxro/types.js.map +1 -0
- package/src/plugins/jupiter/filters.d.ts +1 -0
- package/src/plugins/jupiter/filters.js +11 -1
- package/src/plugins/jupiter/filters.js.map +1 -1
- package/src/plugins/jupiter/governance/voteFetcher.js +25 -25
- package/src/plugins/jupiter/governance/voteFetcher.js.map +1 -1
- package/src/plugins/jupiter/helpers.js +22 -8
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/jupiter/launchpad/structs.d.ts +10 -1
- package/src/plugins/jupiter/launchpad/structs.js +9 -1
- package/src/plugins/jupiter/launchpad/structs.js.map +1 -1
- package/src/plugins/jupiter/pricingJob.js +0 -4
- package/src/plugins/jupiter/pricingJob.js.map +1 -1
- package/src/plugins/kamino/constants.js +12 -0
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/orca/getWhirlpoolPositions.js +10 -11
- package/src/plugins/orca/getWhirlpoolPositions.js.map +1 -1
- package/src/plugins/orca/helpers_fees.js +12 -3
- package/src/plugins/orca/helpers_fees.js.map +1 -1
- package/src/plugins/spdr/constants.d.ts +7 -0
- package/src/plugins/spdr/constants.js +17 -0
- package/src/plugins/spdr/constants.js.map +1 -0
- package/src/plugins/spdr/index.d.ts +6 -0
- package/src/plugins/spdr/index.js +12 -0
- package/src/plugins/spdr/index.js.map +1 -0
- package/src/plugins/spdr/stakingFetcher.d.ts +3 -0
- package/src/plugins/spdr/stakingFetcher.js +78 -0
- package/src/plugins/spdr/stakingFetcher.js.map +1 -0
- package/src/plugins/spdr/structs.d.ts +26 -0
- package/src/plugins/spdr/structs.js +26 -0
- package/src/plugins/spdr/structs.js.map +1 -0
- package/src/plugins/spdr/types.d.ts +21 -0
- package/src/plugins/spdr/types.js +3 -0
- package/src/plugins/spdr/types.js.map +1 -0
- package/src/plugins/tensor/index.js +0 -2
- package/src/plugins/tensor/index.js.map +1 -1
- package/src/plugins/tensor/locksFetcher.js +0 -62
- package/src/plugins/tensor/locksFetcher.js.map +0 -1
- /package/src/plugins/{tensor/locksFetcher.d.ts → cyberfrogs/thorDepositFetcher.d.ts} +0 -0
@@ -0,0 +1,78 @@
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
+
const constants_1 = require("./constants");
|
14
|
+
const clients_1 = require("../../utils/clients");
|
15
|
+
const solana_1 = require("../../utils/solana");
|
16
|
+
const structs_1 = require("./structs");
|
17
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
18
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const connection = (0, clients_1.getClientSolana)();
|
20
|
+
const [stakeAccounts, stakeLockAccounts] = yield Promise.all([
|
21
|
+
(0, solana_1.getParsedProgramAccounts)(connection, structs_1.stakeStruct, constants_1.pid, [
|
22
|
+
{
|
23
|
+
dataSize: 233,
|
24
|
+
},
|
25
|
+
{
|
26
|
+
memcmp: {
|
27
|
+
bytes: owner,
|
28
|
+
offset: 8,
|
29
|
+
},
|
30
|
+
},
|
31
|
+
]),
|
32
|
+
(0, solana_1.getParsedProgramAccounts)(connection, structs_1.stakeLockedStruct, constants_1.pid, [
|
33
|
+
{
|
34
|
+
dataSize: 429,
|
35
|
+
},
|
36
|
+
{
|
37
|
+
memcmp: {
|
38
|
+
bytes: owner,
|
39
|
+
offset: 8,
|
40
|
+
},
|
41
|
+
},
|
42
|
+
]),
|
43
|
+
]);
|
44
|
+
if ([...stakeAccounts, ...stakeLockAccounts].length === 0)
|
45
|
+
return [];
|
46
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
47
|
+
const element = elementRegistry.addElementMultiple({
|
48
|
+
label: 'Staked',
|
49
|
+
});
|
50
|
+
stakeAccounts.forEach((acc) => {
|
51
|
+
element.addAsset({
|
52
|
+
address: constants_1.spdrMint,
|
53
|
+
amount: acc.depositAmount.minus(acc.multiplierAmount),
|
54
|
+
});
|
55
|
+
});
|
56
|
+
stakeLockAccounts.forEach((acc) => {
|
57
|
+
acc.stakeLock.forEach((stakeLock) => {
|
58
|
+
element.addAsset({
|
59
|
+
address: constants_1.spdrMint,
|
60
|
+
amount: stakeLock.depositAmount,
|
61
|
+
attributes: {
|
62
|
+
lockedUntil: stakeLock.startTime
|
63
|
+
.plus(stakeLock.servingPeriod)
|
64
|
+
.times(1000)
|
65
|
+
.toNumber(),
|
66
|
+
},
|
67
|
+
});
|
68
|
+
});
|
69
|
+
});
|
70
|
+
return elementRegistry.getElements(cache);
|
71
|
+
});
|
72
|
+
const fetcher = {
|
73
|
+
id: `${constants_1.platformId}-staking`,
|
74
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
75
|
+
executor,
|
76
|
+
};
|
77
|
+
exports.default = fetcher;
|
78
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/stakingFetcher.ts"],"names":[],"mapp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iBAAiB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAChC,GAAG,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAClC,OAAO,CAAC,QAAQ,CAAC;gBACf,OAAO,EAAE,oBAAQ;gBACjB,MAAM,EAAE,SAAS,CAAC,aAAa;gBAC/B,UAAU,EAAE;oBACV,WAAW,EAAE,SAAS,CAAC,SAAS;yBAC7B,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC;yBAC7B,KAAK,CAAC,IAAI,CAAC;yBACX,QAAQ,EAAE;iBACd;aACF,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IACH,OAAO,eAAe,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5C,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"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { BeetStruct, FixableBeetStruct } from '@metaplex-foundation/beet';
|
3
|
+
import { PublicKey } from '@solana/web3.js';
|
4
|
+
import BigNumber from 'bignumber.js';
|
5
|
+
export type Stake = {
|
6
|
+
buffer: Buffer;
|
7
|
+
authority: PublicKey;
|
8
|
+
depositAmount: BigNumber;
|
9
|
+
reward: BigNumber;
|
10
|
+
rewardDebt: BigNumber;
|
11
|
+
bump: Buffer;
|
12
|
+
multiplierAmount: BigNumber;
|
13
|
+
};
|
14
|
+
export declare const stakeStruct: BeetStruct<Stake, Partial<Stake>>;
|
15
|
+
export type StakeLock = {
|
16
|
+
depositAmount: BigNumber;
|
17
|
+
servingPeriod: BigNumber;
|
18
|
+
startTime: BigNumber;
|
19
|
+
};
|
20
|
+
export declare const stakeLockStruct: BeetStruct<StakeLock, Partial<StakeLock>>;
|
21
|
+
export type StakeLocked = {
|
22
|
+
buffer: Buffer;
|
23
|
+
authority: PublicKey;
|
24
|
+
stakeLock: StakeLock[];
|
25
|
+
};
|
26
|
+
export declare const stakeLockedStruct: FixableBeetStruct<StakeLocked, Partial<StakeLocked>>;
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.stakeLockedStruct = exports.stakeLockStruct = exports.stakeStruct = 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.stakeStruct = new beet_1.BeetStruct([
|
8
|
+
['buffer', (0, solana_1.blob)(8)],
|
9
|
+
['authority', beet_solana_1.publicKey],
|
10
|
+
['depositAmount', solana_1.u128],
|
11
|
+
['reward', solana_1.u128],
|
12
|
+
['rewardDebt', solana_1.u128],
|
13
|
+
['bump', (0, solana_1.blob)(1)],
|
14
|
+
['multiplierAmount', solana_1.u128],
|
15
|
+
], (args) => args);
|
16
|
+
exports.stakeLockStruct = new beet_1.BeetStruct([
|
17
|
+
['depositAmount', solana_1.u128],
|
18
|
+
['servingPeriod', solana_1.i64],
|
19
|
+
['startTime', solana_1.i64],
|
20
|
+
], (args) => args);
|
21
|
+
exports.stakeLockedStruct = new beet_1.FixableBeetStruct([
|
22
|
+
['buffer', (0, solana_1.blob)(8)],
|
23
|
+
['authority', beet_solana_1.publicKey],
|
24
|
+
['stakeLock', (0, beet_1.array)(exports.stakeLockStruct)],
|
25
|
+
], (args) => args);
|
26
|
+
//# sourceMappingURL=structs.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"structs.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/structs.ts"],"names":[],"mappings":";;;AAAA,oDAImC;AACnC,kEAA6D;AAG7D,+CAAqD;AAYxC,QAAA,WAAW,GAAG,IAAI,iBAAU,CACvC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,QAAQ,EAAE,aAAI,CAAC;IAChB,CAAC,YAAY,EAAE,aAAI,CAAC;IACpB,CAAC,MAAM,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACjB,CAAC,kBAAkB,EAAE,aAAI,CAAC;CAC3B,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAa,CACxB,CAAC;AAQW,QAAA,eAAe,GAAG,IAAI,iBAAU,CAC3C;IACE,CAAC,eAAe,EAAE,aAAI,CAAC;IACvB,CAAC,eAAe,EAAE,YAAG,CAAC;IACtB,CAAC,WAAW,EAAE,YAAG,CAAC;CACnB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAiB,CAC5B,CAAC;AAQW,QAAA,iBAAiB,GAAG,IAAI,wBAAiB,CACpD;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,WAAW,EAAE,uBAAS,CAAC;IACxB,CAAC,WAAW,EAAE,IAAA,YAAK,EAAC,uBAAe,CAAC,CAAC;CACtC,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAmB,CAC9B,CAAC"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
import { ID } from '../../utils/sui/structs/id';
|
3
|
+
export type Receipt = {
|
4
|
+
id: ID;
|
5
|
+
amountDeposited: string;
|
6
|
+
};
|
7
|
+
export type Pool = {
|
8
|
+
publickey: string;
|
9
|
+
buffer: Buffer;
|
10
|
+
authority: string;
|
11
|
+
poolMint: string;
|
12
|
+
poolTokenAccount: string;
|
13
|
+
rewardMint: string;
|
14
|
+
rewardTokenAccount: string;
|
15
|
+
rewardPerSecond: string;
|
16
|
+
startTime: string;
|
17
|
+
lastRewardTime: string;
|
18
|
+
accPerShare: string;
|
19
|
+
supply: string;
|
20
|
+
bump: number;
|
21
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/spdr/types.ts"],"names":[],"mappings":""}
|
@@ -6,13 +6,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.fetchers = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const bidsFetcher_1 = __importDefault(require("./bidsFetcher"));
|
9
|
-
const locksFetcher_1 = __importDefault(require("./locksFetcher"));
|
10
9
|
const airdropPowerUsersFetcher_1 = __importDefault(require("./airdropPowerUsersFetcher"));
|
11
10
|
const sharedEscrowFetcher_1 = __importDefault(require("./sharedEscrowFetcher"));
|
12
11
|
exports.platforms = [constants_1.platform];
|
13
12
|
exports.fetchers = [
|
14
13
|
bidsFetcher_1.default,
|
15
|
-
locksFetcher_1.default,
|
16
14
|
airdropPowerUsersFetcher_1.default,
|
17
15
|
sharedEscrowFetcher_1.default,
|
18
16
|
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/index.ts"],"names":[],"mappings":";;;;;;AAIA,2CAAuC;AACvC,gEAAwC;AACxC,0FAAiE;AACjE,gFAAwD;AAE3C,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,QAAQ,GAAc;IACjC,qBAAW;IACX,kCAAuB;IACvB,6BAAmB;CACpB,CAAC"}
|
@@ -1,62 +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 struct_1 = require("./struct");
|
20
|
-
const filters_1 = require("./filters");
|
21
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
22
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
23
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
-
const client = (0, clients_1.getClientSolana)();
|
25
|
-
const locksAccounts = yield (0, solana_1.getParsedProgramAccounts)(client, struct_1.orderStateLockStruct, constants_1.locksPid, (0, filters_1.locksFilter)(owner));
|
26
|
-
const tokenPricesById = yield (0, getTokensPricesMap_1.default)([portfolio_core_1.solanaNativeAddress, solana_1.usdcSolanaMint], portfolio_core_1.NetworkId.solana, cache);
|
27
|
-
let solAmount = 0;
|
28
|
-
let usdcAmount = 0;
|
29
|
-
const assets = [];
|
30
|
-
for (const account of locksAccounts) {
|
31
|
-
if (account.currency.toString() !== solana_1.usdcSolanaMint) {
|
32
|
-
solAmount += account.price.dividedBy(Math.pow(10, 9)).toNumber();
|
33
|
-
}
|
34
|
-
else {
|
35
|
-
usdcAmount += account.price.dividedBy(Math.pow(10, 6)).toNumber();
|
36
|
-
}
|
37
|
-
}
|
38
|
-
if (usdcAmount)
|
39
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(solana_1.usdcSolanaMint, usdcAmount, portfolio_core_1.NetworkId.solana, tokenPricesById.get(solana_1.usdcSolanaMint)));
|
40
|
-
if (solAmount)
|
41
|
-
assets.push((0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, solAmount, portfolio_core_1.NetworkId.solana, tokenPricesById.get(portfolio_core_1.solanaNativeAddress)));
|
42
|
-
if (assets.length === 0)
|
43
|
-
return [];
|
44
|
-
return [
|
45
|
-
{
|
46
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
47
|
-
platformId: constants_1.platformId,
|
48
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
49
|
-
label: 'Deposit',
|
50
|
-
name: 'Locks',
|
51
|
-
data: { assets },
|
52
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((asset) => asset.value)),
|
53
|
-
},
|
54
|
-
];
|
55
|
-
});
|
56
|
-
const fetcher = {
|
57
|
-
id: `${constants_1.platformId}-locks`,
|
58
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
59
|
-
executor,
|
60
|
-
};
|
61
|
-
exports.default = fetcher;
|
62
|
-
//# sourceMappingURL=locksFetcher.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"locksFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/tensor/locksFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,2CAAmD;AACnD,iDAAsD;AACtD,+CAA8E;AAC9E,qCAAgD;AAChD,uCAAwC;AACxC,qGAA6E;AAC7E,6FAAoE;AAEpE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE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