@sonarwatch/portfolio-plugins 0.14.124 → 0.14.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2102 -2098
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/adrena/stakingFetcher.js +2 -0
- package/src/plugins/adrena/stakingFetcher.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/baskt/constants.d.ts +4 -1
- package/src/plugins/baskt/constants.js +3 -2
- package/src/plugins/baskt/constants.js.map +1 -1
- package/src/plugins/baskt/index.js +1 -5
- package/src/plugins/baskt/index.js.map +1 -1
- package/src/plugins/baskt/marketsJob.js +62 -4
- package/src/plugins/baskt/marketsJob.js.map +1 -1
- package/src/plugins/baskt/structs.d.ts +29 -14
- package/src/plugins/baskt/structs.js +27 -14
- package/src/plugins/baskt/structs.js.map +1 -1
- package/src/plugins/debridge/constants.js +2 -2
- package/src/plugins/debridge/constants.js.map +1 -1
- package/src/plugins/grass/stakingFetcher.js +2 -0
- package/src/plugins/grass/stakingFetcher.js.map +1 -1
- package/src/plugins/jupiter/governance/voteFetcher.js +6 -1
- package/src/plugins/jupiter/governance/voteFetcher.js.map +1 -1
- package/src/plugins/lulo/depositsFetcher.js +46 -29
- package/src/plugins/lulo/depositsFetcher.js.map +1 -1
- package/src/plugins/lulo/poolsJob.d.ts +2 -0
- package/src/plugins/lulo/poolsJob.js +12 -1
- package/src/plugins/lulo/poolsJob.js.map +1 -1
- package/src/plugins/lulo/types.d.ts +20 -0
- package/src/plugins/lulo/types.js +3 -0
- package/src/plugins/lulo/types.js.map +1 -0
- package/src/plugins/magiceden/stakingFetcher.js +5 -1
- package/src/plugins/magiceden/stakingFetcher.js.map +1 -1
- package/src/plugins/marginfi/banksJob.js +1 -1
- package/src/plugins/marginfi/banksJob.js.map +1 -1
- package/src/plugins/marginfi/helpers.js +5 -0
- package/src/plugins/marginfi/helpers.js.map +1 -1
- package/src/plugins/nosana/stakingFetcher.js +16 -22
- package/src/plugins/nosana/stakingFetcher.js.map +1 -1
- package/src/plugins/nxfinance/stakingFetcher.js +3 -0
- package/src/plugins/nxfinance/stakingFetcher.js.map +1 -1
- package/src/plugins/nxfinance/types.d.ts +1 -0
- package/src/plugins/pyth/stakingFetcher.js +5 -1
- package/src/plugins/pyth/stakingFetcher.js.map +1 -1
- package/src/plugins/sanctum/constants.d.ts +4 -0
- package/src/plugins/sanctum/constants.js +3 -1
- package/src/plugins/sanctum/constants.js.map +1 -1
- package/src/plugins/sanctum/index.js +2 -1
- package/src/plugins/sanctum/index.js.map +1 -1
- package/src/plugins/sanctum/stakingFetcher.js +54 -0
- package/src/plugins/sanctum/stakingFetcher.js.map +1 -0
- package/src/plugins/sanctum/struct.d.ts +29 -0
- package/src/plugins/sanctum/struct.js +28 -0
- package/src/plugins/sanctum/struct.js.map +1 -0
- package/src/plugins/sonic/stakingFetcher.js +2 -0
- package/src/plugins/sonic/stakingFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/tokens/fetchers/solana.js +2 -7
- package/src/plugins/tokens/fetchers/solana.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/wormhole/stakingFetcher.js +2 -0
- package/src/plugins/wormhole/stakingFetcher.js.map +1 -1
- package/src/plugins/x-staking-solana/constants.js +9 -0
- package/src/plugins/x-staking-solana/constants.js.map +1 -1
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/plugins/zeta/stakingFetcher.js +13 -15
- package/src/plugins/zeta/stakingFetcher.js.map +1 -1
- package/src/utils/elementbuilder/AssetGenericBuilder.js +4 -0
- package/src/utils/elementbuilder/AssetGenericBuilder.js.map +1 -1
- package/src/utils/elementbuilder/AssetTokenBuilder.d.ts +7 -1
- package/src/utils/elementbuilder/AssetTokenBuilder.js +5 -1
- package/src/utils/elementbuilder/AssetTokenBuilder.js.map +1 -1
- package/src/utils/elementbuilder/Params.d.ts +6 -0
- package/src/utils/misc/tokenPriceToLiquidity.js +1 -0
- package/src/utils/misc/tokenPriceToLiquidity.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/baskt/positionsFetcher.js +0 -52
- package/src/plugins/baskt/positionsFetcher.js.map +0 -1
- /package/src/plugins/{baskt/positionsFetcher.d.ts → sanctum/stakingFetcher.d.ts} +0 -0
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAIoC;AACpC,6CAA4C;AAG5C,2CAAmD;AACnD,uCAA0E;AAC1E,+EAA4D;AAC5D,0EAA8D;AAC9D,mFAA6D;AAC7D,mDAA2D;AAC3D,kFAA+E;AAC/E,iDAAsD;AACtD,qCAAsE;AACtE,6CAAmD;AACnD,iDAA8E;AAE9E,6CAA6D;AAC7D,yEAA4E;AAC5E,+CAG4B;AAE5B,qDAA2D;AAC3D,iDAA4D;AAE5D,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IACjC,MAAM,GAAG,GAAG,IAAA,2BAAiB,EAAC,KAAK,CAAC,CAAC;IAErC,MAAM,CAAC,WAAW,EAAE,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACvD,IAAA,2CAAoB,EAAC,MAAM,EAAE,0BAAiB,EAAE,IAAI,mBAAS,CAAC,GAAG,CAAC,CAAC;QACnE,K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,GAAG,WAAW,CAAC,CAAC;IAChC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -8,14 +8,23 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
+
};
|
11
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
+
const axios_1 = __importDefault(require("axios"));
|
12
16
|
const clients_1 = require("../../utils/clients");
|
13
17
|
const solana_1 = require("../../utils/solana");
|
14
18
|
const constants_1 = require("./constants");
|
15
19
|
const struct_1 = require("./struct");
|
16
20
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
21
|
const client = (0, clients_1.getClientSolana)();
|
18
|
-
const pools = yield
|
22
|
+
const [pools, apiInfo] = yield Promise.all([
|
23
|
+
(0, solana_1.getParsedProgramAccounts)(client, struct_1.poolStruct, constants_1.luloProgramId, [
|
24
|
+
{ dataSize: struct_1.poolStruct.byteSize },
|
25
|
+
]),
|
26
|
+
axios_1.default.get('https://api.lulo.fi/v1/pool.getPools'),
|
27
|
+
]);
|
19
28
|
const allocations = [];
|
20
29
|
for (const pool of pools) {
|
21
30
|
for (const allocation of pool.allocations) {
|
@@ -28,6 +37,8 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
28
37
|
.minus(allocation.pendingWithdrawals)
|
29
38
|
.dividedBy(pool.regularTotalSupply)
|
30
39
|
.toNumber(),
|
40
|
+
pApy: apiInfo.data.protected.apy,
|
41
|
+
lApy: apiInfo.data.regular.apy,
|
31
42
|
});
|
32
43
|
}
|
33
44
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/poolsJob.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,kDAA0B;AAG1B,iDAAsD;AACtD,+CAA8D;AAC9D,2CAAkE;AAClE,qCAAsC;AAWtC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,KAAK,EAAE,OAAO,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACzC,IAAA,iCAAwB,EAAC,MAAM,EAAE,mBAAU,EAAE,yBAAa,EAAE;YAC1D,EAAE,QAAQ,EAAE,mBAAU,CAAC,QAAQ,EAAE;SAClC,CAAC;QACF,eAAK,CAAC,GAAG,CAAc,sCAAsC,CAAC;KAC/D,CAAC,CAAC;IAEH,MAAM,WAAW,GAAqB,EAAE,CAAC;IACzC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,UAAU,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC1C,WAAW,CAAC,IAAI,CAAC;gBACf,IAAI,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAChC,MAAM,EAAE,UAAU,CAAC,eAAe;qBAC/B,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC;qBACpC,QAAQ,EAAE;gBACb,MAAM,EAAE,UAAU,CAAC,aAAa;qBAC7B,KAAK,CAAC,UAAU,CAAC,kBAAkB,CAAC;qBACpC,SAAS,CAAC,IAAI,CAAC,kBAAkB,CAAC;qBAClC,QAAQ,EAAE;gBACb,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG;gBAChC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG;aAC/B,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,MAAM,KAAK,CAAC,OAAO,CAAmB,oBAAQ,EAAE,WAAW,EAAE;QAC3D,MAAM,EAAE,sBAAU;KACnB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,MAAM,EAAE,CAAC,QAAQ,CAAC;CACnB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
export type APIResponse = {
|
2
|
+
regular: Regular;
|
3
|
+
protected: Protected;
|
4
|
+
averagePoolRate: number;
|
5
|
+
totalLiquidity: number;
|
6
|
+
availableLiquidity: number;
|
7
|
+
regularLiquidityAmount: number;
|
8
|
+
protectedLiquidityAmount: number;
|
9
|
+
regularAvailableAmount: number;
|
10
|
+
};
|
11
|
+
export type Protected = {
|
12
|
+
type: string;
|
13
|
+
apy: number;
|
14
|
+
openCapacity: number;
|
15
|
+
};
|
16
|
+
export type Regular = {
|
17
|
+
type: string;
|
18
|
+
apy: number;
|
19
|
+
maxWithdrawalAmount: number;
|
20
|
+
};
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/lulo/types.ts"],"names":[],"mappings":""}
|
@@ -22,7 +22,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
22
22
|
if (!lockupAccount)
|
23
23
|
return [];
|
24
24
|
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
25
|
-
const element = registry.addElementMultiple({
|
25
|
+
const element = registry.addElementMultiple({
|
26
|
+
label: 'Staked',
|
27
|
+
link: 'https://magiceden.io/earn',
|
28
|
+
ref: lockupAccount.pubkey.toString(),
|
29
|
+
});
|
26
30
|
element.addAsset({
|
27
31
|
address: constants_1.meMint,
|
28
32
|
amount: lockupAccount.amount,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/magiceden/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAiD;AACjD,iDAAsD;AACtD,uCAAyC;AACzC,gFAA6E;AAC7E,uCAA8C;AAC9C,kFAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,2CAAoB,EAC9C,MAAM,EACN,sBAAY,EACZ,IAAA,2BAAiB,EAAC,KAAK,CAAC,CACzB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAE9B,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IACnE,MAAM,OAAO,GAAG,QAAQ,CAAC,kBAAkB,CAAC,EAAE,
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/magiceden/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAiD;AACjD,iDAAsD;AACtD,uCAAyC;AACzC,gFAA6E;AAC7E,uCAA8C;AAC9C,kFAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,2CAAoB,EAC9C,MAAM,EACN,sBAAY,EACZ,IAAA,2BAAiB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KAAK,CAAC;qBACrB,SAAS,CAAC,MAAM,CAAC;qBACjB,QAAQ,EAAE,CAAC;gBACd,OAAO,CAAC,IAAI,CAAC;oBACX,OAAO,EAAE,YAAY;oBACrB,QAAQ,EAAE,WAAW,CAAC,QAAQ;oBAC9B,EAAE,EAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE;oBAC1B,SAAS,EAAE,0BAAS,CAAC,MAAM;oBAC3B,UAAU,EAAE,uCAAsB;oBAClC,KAAK;oBACL,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE;oBACrB,MAAM,EAAE,CAAC;oBACT,
|
1
|
+
{"version":3,"file":"banksJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/banksJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAQoC;AACpC,6CAAmD;AACnD,2CAAoE;AACpE,yCAA4C;AAC5C,uCAAyC;AACzC,uCAA2E;AAC3E,+CAG4B;AAC5B,iDAAsD;AAItD,kFAA+E;AAC/E,4DAAoE;AAEpE,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,YAAY,GAAG,MAAM,IAAA,iCAAwB,EACjD,UAAU,EACV,iBAAU,EACV,2BAAe,EACf,IAAA,sBAAY,GAAE,CACf,CAAC;IAEF,MAAM,KAAK,GAAe,EAAE,CAAC;IAC7B,MAAM,SAAS,GAAG,EAAE,CAAC;IACrB,MAAM,OAAO,GAAuB,EAAE,CAAC;IACvC,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,aAAa,CACxC,oCAAmB,EACnB,0BAAS,CAAC,MAAM,CACjB,CAAC;IACF,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,YAAY,CAAC,MAAM,EAAE,KAAK,IAAI,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC;QACj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rowedWeights = [];
|
75
|
+
let name;
|
75
76
|
for (let index = 0; index < balances.length; index += 1) {
|
76
77
|
const balance = balances[index];
|
77
78
|
if (balance.bankPk.toString() === '11111111111111111111111111111111')
|
@@ -85,6 +86,9 @@ function getElementFromAccount(marginfiAccount, banksInfoByAddress, tokenPriceBy
|
|
85
86
|
const suppliedAmount = wrappedI80F48toBigNumber(balance.assetShares)
|
86
87
|
.times(bankInfo.dividedAssetShareValue)
|
87
88
|
.toNumber();
|
89
|
+
// If one of the deposited asset is a stake collateral, show it inside the element name
|
90
|
+
if ((tokenPrice === null || tokenPrice === void 0 ? void 0 : tokenPrice.elementName) === 'Stake Collateral')
|
91
|
+
name = 'Stake Collateral';
|
88
92
|
suppliedAssets.push((0, tokenPriceToAssetToken_1.default)(bankInfo.mint.toString(), suppliedAmount, portfolio_core_1.NetworkId.solana, tokenPrice));
|
89
93
|
suppliedYields.push(bankInfo.suppliedYields);
|
90
94
|
}
|
@@ -124,6 +128,7 @@ function getElementFromAccount(marginfiAccount, banksInfoByAddress, tokenPriceBy
|
|
124
128
|
rewardValue,
|
125
129
|
value,
|
126
130
|
},
|
131
|
+
name,
|
127
132
|
};
|
128
133
|
}
|
129
134
|
exports.getElementFromAccount = getElementFromAccount;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,4DAAiC;AACjC,+DAQoC;AAIpC,qGAA6E;AAC7E,2CAAyC;AAEzC,SAAgB,wBAAwB,CACtC,EAAE,KAAK,EAAwB,EAC/B,YAAY,GAAG,CAAC;IAEhB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,oBAAO,CACzB,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CA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,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/marginfi/helpers.ts"],"names":[],"mappings":";;;;;;AAAA,gEAAqC;AACrC,4DAAiC;AACjC,+DAQoC;AAIpC,qGAA6E;AAC7E,2CAAyC;AAEzC,SAAgB,wBAAwB,CACtC,EAAE,KAAK,EAAwB,EAC/B,YAAY,GAAG,CAAC;IAEhB,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;IAEpC,MAAM,OAAO,GAAG,IAAI,oBAAO,CACzB,GAAG,KAAK,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,KAAK,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CACnE,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,YAAY,CAAA,CAAC,CAAC;IAChC,OAAO,IAAI,sBAAS,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,CAAC;AAC3C,CAAC;AAVD,4DAUC;AAED,SAAS,yBAAyB,CAAC,IAAU;IAC3C,OAAO,wBAAwB,CAAC,IAAI,CAAC,oBAAoB,CAAC,CAAC,KAAK,CAC9D,wBAAwB,CAAC,IAAI,CAAC,mBAAmB,CAAC,CACnD,CAAC;AACJ,CAAC;AACD,SAAS,qBAAqB,CAAC,IAAU;IACvC,OAAO,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,KAAK,CAC1D,wBAAwB,CAAC,IAAI,CAAC,eAAe,CAAC,CAC/C,CAAC;AACJ,CAAC;AACD,SAAS,sBAAsB,CAAC,IAAU;IACxC,MAAM,MAAM,GAAG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,wBAAwB,CAAC,OAAO,CAAC,eAAe,CAAC;iBACrE,KAAK,CAAC,QAAQ,CAAC,0BAA0B,CAAC;iBAC1C,QAAQ,EAAE,CAAC;YAEd,cAAc,CAAC,IAAI,CACjB,IAAA,gCAAsB,EACpB,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,EACxB,cAAc,EACd,0BAAS,CAAC,MAAM,EAChB,UAAU,CACX,CACF,CAAC;YACF,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,cAAc,CAAC,CAAC;QAC/C,CAAC;IACH,CAAC;IAED,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC,IAAI,cAAc,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAE5E,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EAAC;QACtB,cAAc;QACd,cAAc;QACd,YAAY;QACZ,YAAY;QACZ,eAAe;KAChB,CAAC,CAAC;IAEL,OAAO;QACL,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,MAAM;QAC3B,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;QACD,IAAI;KACL,CAAC;AACJ,CAAC;AA/FD,sDA+FC"}
|
@@ -8,50 +8,44 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
-
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
13
|
const constants_1 = require("./constants");
|
18
14
|
const clients_1 = require("../../utils/clients");
|
19
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
20
15
|
const structs_1 = require("./structs");
|
21
16
|
const helpers_1 = require("./helpers");
|
22
17
|
const getParsedAccountInfo_1 = require("../../utils/solana/getParsedAccountInfo");
|
23
18
|
const solana_1 = require("../../utils/solana");
|
24
|
-
const
|
19
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
25
20
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
26
21
|
const client = (0, clients_1.getClientSolana)();
|
27
22
|
const stakeAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, structs_1.stakeStruct, (0, helpers_1.getStakePubKey)(owner));
|
28
23
|
if (!stakeAccount || stakeAccount.amount.isZero())
|
29
24
|
return [];
|
30
|
-
const
|
31
|
-
(0, getParsedAccountInfo_1.getParsedAccountInfo)(client, solana_1.tokenAccountStruct, stakeAccount.vault),
|
32
|
-
cache.getTokenPrice(constants_1.nosMint, portfolio_core_1.NetworkId.solana),
|
33
|
-
]);
|
25
|
+
const vaultAccount = yield (0, getParsedAccountInfo_1.getParsedAccountInfo)(client, solana_1.tokenAccountStruct, stakeAccount.vault);
|
34
26
|
if (!vaultAccount || vaultAccount.amount.isZero())
|
35
27
|
return [];
|
28
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
29
|
+
const stakingElement = elementRegistry.addElementMultiple({
|
30
|
+
label: 'Staked',
|
31
|
+
ref: stakeAccount.pubkey.toString(),
|
32
|
+
link: 'https://dashboard.nosana.com/stake',
|
33
|
+
sourceRefs: [{ name: 'Vault', address: vaultAccount.pubkey.toString() }],
|
34
|
+
});
|
36
35
|
const lockedUntil = stakeAccount.timeUnstake.isZero()
|
37
36
|
? undefined
|
38
37
|
: stakeAccount.timeUnstake
|
39
38
|
.plus(stakeAccount.duration)
|
40
39
|
.times(1000)
|
41
40
|
.toNumber();
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
48
|
-
label: 'Staked',
|
49
|
-
value: asset.value,
|
50
|
-
data: {
|
51
|
-
assets: [asset],
|
52
|
-
},
|
41
|
+
stakingElement.addAsset({
|
42
|
+
address: constants_1.nosMint,
|
43
|
+
amount: stakeAccount.amount,
|
44
|
+
attributes: {
|
45
|
+
lockedUntil,
|
53
46
|
},
|
54
|
-
|
47
|
+
});
|
48
|
+
return elementRegistry.getElements(cache);
|
55
49
|
});
|
56
50
|
const fetcher = {
|
57
51
|
id: `${constants_1.platformId}-staking`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nosana/stakingFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nosana/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAAkD;AAClD,iDAAsD;AACtD,uCAAwC;AACxC,uCAA2C;AAC3C,kFAA+E;AAC/E,+CAAwD;AACxD,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,YAAY,GAAG,MAAM,IAAA,2CAAoB,EAC7C,MAAM,EACN,qBAAW,EACX,IAAA,wBAAc,EAAC,KAAK,CAAC,CACtB,CAAC;IACF,IAAI,CAAC,YAAY,IAAI,YAAY,CAAC,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,EAAE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0, void 0, function* (
|
|
39
39
|
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
40
40
|
const element = elementRegistry.addElementMultiple({
|
41
41
|
label: 'Staked',
|
42
|
+
link: 'https://nxfinance.io/stake',
|
43
|
+
ref: stakingAccount.pubkey.toString(),
|
44
|
+
sourceRefs: [{ name: 'Pool', address: stakePoolAccount.pubkey }],
|
42
45
|
});
|
43
46
|
element.addAsset({
|
44
47
|
address: stakePoolAccount.stakeTokenMint,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,cAAc,GAAG,CACrB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,mCAAuB,EACvB;QACE,mBAAS,CAAC,sBAAsB,CAC9B;YACE,IAAI,mBAAS,CAAC,qBAAS,CAAC,CAAC,QAAQ,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;YACjC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;SAChC,EACD,IAAI,mBAAS,CAAC,4BAAgB,CAAC,CAChC,CAAC,CAAC,CAAC;KACL,CACF,CACF,CAAC,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC;IAEtE,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAC1C,0BAAc,EACd;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CACF,CAAC;IAEF,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,QAAQ;
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/nxfinance/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAC5C,gEAAqC;AAErC,2CAMqB;AAErB,iDAAsD;AACtD,+CAAuE;AAEvE,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IAErC,MAAM,cAAc,GAAG,CACrB,MAAM,IAAA,0CAAiC,EACrC,UAAU,EACV,mCAAuB,EACvB;QACE,mBAAS,CAAC,sBAAsB,CAC9B;YACE,IAAI,mBAAS,CAAC,qBAAS,CAAC,CAAC,QAAQ,EAAE;YACnC,MAAM,CAAC,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC;YACjC,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,QAAQ,EAAE;SAChC,EACD,IAAI,mBAAS,CAAC,4BAAgB,CAAC,CAChC,CAAC,CAAC,CAAC;KACL,CACF,CACF,CAAC,CAAC,CAAC,CAAC;IACL,IAAI,CAAC,cAAc,IAAI,cAAc,CAAC,YAAY,KAAK,GAAG;QAAE,OAAO,EAAE,CAAC;IAEtE,MAAM,gBAAgB,GAAG,MAAM,KAAK,CAAC,OAAO,CAC1C,0BAAc,EACd;QACE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CA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C3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -42,7 +42,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
42
|
label: 'Staked',
|
43
43
|
networkId: portfolio_core_1.NetworkId.solana,
|
44
44
|
platformId: constants_1.platformId,
|
45
|
-
data: {
|
45
|
+
data: {
|
46
|
+
assets: [asset],
|
47
|
+
ref: stakingAccounts[0].pubkey.toString(),
|
48
|
+
link: 'https://staking.pyth.network/',
|
49
|
+
},
|
46
50
|
value: asset.value,
|
47
51
|
},
|
48
52
|
];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pyth/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAA6E;AAC7E,6CAA4C;AAG5C,2CAAqE;AACrE,iDAAsD;AACtD,+CAAwD;AACxD,uCAAgD;AAChD,kFAA+E;AAC/E,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,eAAe,EAAE,UAAU,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QACtD,MAAM,CAAC,kBAAkB,CAAC,4BAAgB,EAAE;YAC1C,OAAO,EAAE,IAAA,6BAAmB,EAAC,KAAK,CAAC;SACpC,CAAC;QACF,KAAK,CAAC,aAAa,CAAC,oBAAQ,EAAE,0BAAS,CAAC,MAAM,CAAC;KAChD,CAAC,CAAC;IAEH,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,YAAY,GAAG,mBAAS,CAAC,sBAAsB,CACnD,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,eAAe,C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E,EAAE,GAAG,sBAAU,UAAU;IAC3B,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -1,4 +1,7 @@
|
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
1
3
|
import { Platform } from '@sonarwatch/portfolio-core';
|
4
|
+
import { PublicKey } from '@solana/web3.js';
|
2
5
|
import { AirdropStatics } from '../../AirdropFetcher';
|
3
6
|
export declare const platformId = "sanctum";
|
4
7
|
export declare const platformImage = "https://sonar.watch/img/platforms/sanctum.webp";
|
@@ -9,3 +12,4 @@ export declare const cloudMint = "CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu";
|
|
9
12
|
export declare const cloudDecimals = 9;
|
10
13
|
export declare const s1AirdropStatics: AirdropStatics;
|
11
14
|
export declare const nclbAirdropStatics: AirdropStatics;
|
15
|
+
export declare const stakingPid: PublicKey;
|
@@ -1,6 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.nclbAirdropStatics = exports.s1AirdropStatics = exports.cloudDecimals = exports.cloudMint = exports.lstsKey = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformId = void 0;
|
3
|
+
exports.stakingPid = exports.nclbAirdropStatics = exports.s1AirdropStatics = exports.cloudDecimals = exports.cloudMint = exports.lstsKey = exports.platform = exports.platformWebsite = exports.platformImage = exports.platformId = void 0;
|
4
|
+
const web3_js_1 = require("@solana/web3.js");
|
4
5
|
exports.platformId = 'sanctum';
|
5
6
|
exports.platformImage = 'https://sonar.watch/img/platforms/sanctum.webp';
|
6
7
|
exports.platformWebsite = 'https://www.sanctum.so/';
|
@@ -33,4 +34,5 @@ exports.nclbAirdropStatics = {
|
|
33
34
|
claimLink: 'https://appeal.sanctum.so/results',
|
34
35
|
image: exports.platformImage,
|
35
36
|
};
|
37
|
+
exports.stakingPid = new web3_js_1.PublicKey('bon4Kh3x1uQK16w9b9DKgz3Aw4AP1pZxBJk55Q6Sosb');
|
36
38
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/constants.ts"],"names":[],"mappings":";;;AACA,6CAA4C;AAG/B,QAAA,UAAU,GAAG,SAAS,CAAC;AACvB,QAAA,aAAa,GAAG,gDAAgD,CAAC;AACjE,QAAA,eAAe,GAAG,yBAAyB,CAAC;AAC5C,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,WAAW,EAAE,gBAAgB,EAAE,sCAAsC;IACrE,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,qBAAa;IACpB,OAAO,EAAE,uBAAe;IACxB,OAAO,EAAE,+BAA+B;CACzC,CAAC;AACW,QAAA,OAAO,GAAG,MAAM,CAAC;AAEjB,QAAA,SAAS,GAAG,8CAA8C,CAAC;AAC3D,QAAA,aAAa,GAAG,CAAC,CAAC;AAClB,QAAA,gBAAgB,GAAmB;IAC9C,EAAE,EAAE,SAAS;IACb,UAAU,EAAE,aAAa;IACzB,QAAQ,EAAE,aAAa;IACvB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,uBAAe;IAC5B,SAAS,EAAE,4BAA4B;IACvC,KAAK,EAAE,qBAAa;CACrB,CAAC;AAEW,QAAA,kBAAkB,GAAmB;IAChD,EAAE,EAAE,cAAc;IAClB,UAAU,EAAE,SAAS;IACrB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,SAAS;IACtB,WAAW,EAAE,uBAAe;IAC5B,SAAS,EAAE,mCAAmC;IAC9C,KAAK,EAAE,qBAAa;CACrB,CAAC;AAEW,QAAA,UAAU,GAAG,IAAI,mBAAS,CACrC,6CAA6C,CAC9C,CAAC"}
|
@@ -8,9 +8,10 @@ const constants_1 = require("./constants");
|
|
8
8
|
const lstsJob_1 = __importDefault(require("./lstsJob"));
|
9
9
|
const s1AirdropFetcher_1 = require("./s1AirdropFetcher");
|
10
10
|
const nclbAirdropFetcher_1 = require("./nclbAirdropFetcher");
|
11
|
+
const stakingFetcher_1 = __importDefault(require("./stakingFetcher"));
|
11
12
|
exports.platforms = [constants_1.platform];
|
12
13
|
exports.jobs = [lstsJob_1.default];
|
13
|
-
exports.fetchers = [s1AirdropFetcher_1.fetcher, nclbAirdropFetcher_1.fetcher];
|
14
|
+
exports.fetchers = [s1AirdropFetcher_1.fetcher, nclbAirdropFetcher_1.fetcher, stakingFetcher_1.default];
|
14
15
|
exports.airdropFetchers = [
|
15
16
|
s1AirdropFetcher_1.airdropFetcher,
|
16
17
|
nclbAirdropFetcher_1.airdropFetcher,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wDAAgC;AAChC,yDAG4B;AAE5B,6DAG8B;
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,wDAAgC;AAChC,yDAG4B;AAE5B,6DAG8B;AAC9B,sEAA8C;AAEjC,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,iBAAO,CAAC,CAAC;AACxB,QAAA,QAAQ,GAAc,CAAC,0BAAS,EAAE,4BAAW,EAAE,wBAAc,CAAC,CAAC;AAC/D,QAAA,eAAe,GAAqB;IAC/C,iCAAgB;IAChB,mCAAkB;CACnB,CAAC"}
|
@@ -0,0 +1,54 @@
|
|
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 clients_1 = require("../../utils/clients");
|
14
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
15
|
+
const constants_1 = require("./constants");
|
16
|
+
const solana_1 = require("../../utils/solana");
|
17
|
+
const struct_1 = require("./struct");
|
18
|
+
const vestingTime = 60 * 60 * 24 * 30; // 30 days
|
19
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
+
const client = (0, clients_1.getClientSolana)();
|
21
|
+
const [vestingAccounts] = yield Promise.all([
|
22
|
+
(0, solana_1.getParsedProgramAccounts)(client, struct_1.vestingStruct, constants_1.stakingPid, [
|
23
|
+
{ memcmp: { offset: 8, bytes: owner } },
|
24
|
+
{ dataSize: struct_1.vestingStruct.byteSize },
|
25
|
+
]),
|
26
|
+
]);
|
27
|
+
const registry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
28
|
+
const stakingElement = registry.addElementMultiple({
|
29
|
+
label: 'Staked',
|
30
|
+
link: 'https://vote.sanctum.so/cloud-staking?tab=stake',
|
31
|
+
});
|
32
|
+
for (const vestingAccount of vestingAccounts) {
|
33
|
+
stakingElement.addAsset({
|
34
|
+
address: constants_1.cloudMint,
|
35
|
+
amount: vestingAccount.amount.minus(vestingAccount.claimed).toNumber(),
|
36
|
+
attributes: {
|
37
|
+
lockedUntil: vestingAccount.start
|
38
|
+
.plus(vestingTime)
|
39
|
+
.times(1000)
|
40
|
+
.toNumber(),
|
41
|
+
tags: ['Unstaking'],
|
42
|
+
},
|
43
|
+
ref: vestingAccount.pubkey.toString(),
|
44
|
+
});
|
45
|
+
}
|
46
|
+
return registry.getElements(cache);
|
47
|
+
});
|
48
|
+
const fetcher = {
|
49
|
+
id: `${constants_1.platformId}-staking`,
|
50
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
51
|
+
executor,
|
52
|
+
};
|
53
|
+
exports.default = fetcher;
|
54
|
+
//# sourceMappingURL=stakingFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAsD;AACtD,gFAA6E;AAC7E,2CAAgE;AAChE,+CAA8D;AAC9D,qCAAyC;AAEzC,MAAM,WAAW,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,UAAU;AAEjD,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,CAAC,eAAe,CAAC,GAAG,MAAM,OAAO,CAAC,GAAG,CAAC;QAC1C,IAAA,iCAAwB,EAAC,MAAM,EAAE,sBAAa,EAAE,sBAAU,EAAE;YAC1D,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;YACvC,EAAE,QAAQ,EAAE,sBAAa,CAAC,QAAQ,EAAE;SACrC,CAAC;KACH,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAEnE,MAAM,cAAc,GAAG,QAAQ,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,QAAQ;QACf,IAAI,EAAE,iDAAiD;KACxD,CAAC,CAAC;IAEH,KAAK,MAAM,cAAc,IAAI,eAAe,EAAE,CAAC;QAC7C,cAAc,CAAC,QAAQ,CAAC;YACtB,OAAO,EAAE,qBAAS;YAClB,MAAM,EAAE,cAAc,CAAC,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE;YACtE,UAAU,EAAE;gBACV,WAAW,EAAE,cAAc,CAAC,KAAK;qBAC9B,IAAI,CAAC,WAAW,CAAC;qBACjB,KAAK,CAAC,IAAI,CAAC;qBACX,QAAQ,EAAE;gBACb,IAAI,EAAE,CAAC,WAAW,CAAC;aACpB;YACD,GAAG,EAAE,cAAc,CAAC,MAAM,CAAC,QAAQ,EAAE;SACtC,CAAC,CAAC;IACL,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AACrC,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,29 @@
|
|
1
|
+
/// <reference types="node" />
|
2
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
3
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
4
|
+
import { BeetStruct } from '@metaplex-foundation/beet';
|
5
|
+
import { PublicKey } from '@solana/web3.js';
|
6
|
+
import BigNumber from 'bignumber.js';
|
7
|
+
export type BondPool = {
|
8
|
+
owner: PublicKey;
|
9
|
+
bondedMint: PublicKey;
|
10
|
+
bondMintAuthorityBump: number;
|
11
|
+
targetMint: PublicKey;
|
12
|
+
vault: PublicKey;
|
13
|
+
vaultAuthorityBump: number;
|
14
|
+
vestingSeconds: number;
|
15
|
+
};
|
16
|
+
export declare const bondPoolStruct: BeetStruct<BondPool, Partial<BondPool>>;
|
17
|
+
export type Vesting = {
|
18
|
+
buffer: Buffer;
|
19
|
+
user: PublicKey;
|
20
|
+
bondPool: PublicKey;
|
21
|
+
start: BigNumber;
|
22
|
+
claimed: BigNumber;
|
23
|
+
seed: number;
|
24
|
+
bump: number;
|
25
|
+
holdingBump: number;
|
26
|
+
amount: BigNumber;
|
27
|
+
padding: Buffer;
|
28
|
+
};
|
29
|
+
export declare const vestingStruct: BeetStruct<Vesting, Partial<Vesting>>;
|
@@ -0,0 +1,28 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.vestingStruct = exports.bondPoolStruct = 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.bondPoolStruct = new beet_1.BeetStruct([
|
8
|
+
['owner', beet_solana_1.publicKey],
|
9
|
+
['bondedMint', beet_solana_1.publicKey],
|
10
|
+
['bondMintAuthorityBump', beet_1.u8],
|
11
|
+
['targetMint', beet_solana_1.publicKey],
|
12
|
+
['vault', beet_solana_1.publicKey],
|
13
|
+
['vaultAuthorityBump', beet_1.u8],
|
14
|
+
['vestingSeconds', beet_1.u32],
|
15
|
+
], (args) => args);
|
16
|
+
exports.vestingStruct = new beet_1.BeetStruct([
|
17
|
+
['buffer', (0, solana_1.blob)(8)],
|
18
|
+
['user', beet_solana_1.publicKey],
|
19
|
+
['bondPool', beet_solana_1.publicKey],
|
20
|
+
['start', solana_1.i64],
|
21
|
+
['claimed', solana_1.u64],
|
22
|
+
['seed', beet_1.u8],
|
23
|
+
['bump', beet_1.u8],
|
24
|
+
['holdingBump', beet_1.u8],
|
25
|
+
['amount', solana_1.u64],
|
26
|
+
['padding', (0, solana_1.blob)(5)],
|
27
|
+
], (args) => args);
|
28
|
+
//# sourceMappingURL=struct.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"struct.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sanctum/struct.ts"],"names":[],"mappings":";;;AAAA,oDAAgE;AAChE,kEAA6D;AAG7D,+CAAoD;AAavC,QAAA,cAAc,GAAG,IAAI,iBAAU,CAC1C;IACE,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,uBAAuB,EAAE,SAAE,CAAC;IAC7B,CAAC,YAAY,EAAE,uBAAS,CAAC;IACzB,CAAC,OAAO,EAAE,uBAAS,CAAC;IACpB,CAAC,oBAAoB,EAAE,SAAE,CAAC;IAC1B,CAAC,gBAAgB,EAAE,UAAG,CAAC;CACxB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAgB,CAC3B,CAAC;AAgBW,QAAA,aAAa,GAAG,IAAI,iBAAU,CACzC;IACE,CAAC,QAAQ,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;IACnB,CAAC,MAAM,EAAE,uBAAS,CAAC;IACnB,CAAC,UAAU,EAAE,uBAAS,CAAC;IACvB,CAAC,OAAO,EAAE,YAAG,CAAC;IACd,CAAC,SAAS,EAAE,YAAG,CAAC;IAChB,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,MAAM,EAAE,SAAE,CAAC;IACZ,CAAC,aAAa,EAAE,SAAE,CAAC;IACnB,CAAC,QAAQ,EAAE,YAAG,CAAC;IACf,CAAC,SAAS,EAAE,IAAA,aAAI,EAAC,CAAC,CAAC,CAAC;CACrB,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,IAAe,CAC1B,CAAC"}
|
@@ -33,6 +33,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
33
33
|
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
34
34
|
const element = elementRegistry.addElementMultiple({
|
35
35
|
label: 'Staked',
|
36
|
+
link: 'https://stake.sonic.game/',
|
36
37
|
});
|
37
38
|
userStakeAccount.forEach((acc) => {
|
38
39
|
const lockedUntil = acc.endAt.times(1000).toNumber();
|
@@ -42,6 +43,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
43
|
attributes: {
|
43
44
|
lockedUntil,
|
44
45
|
},
|
46
|
+
ref: acc.pubkey.toString(),
|
45
47
|
});
|
46
48
|
});
|
47
49
|
return elementRegistry.getElements(cache);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/sonic/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAgE;AAEhE,iDAAsD;AACtD,gFAA6E;AAC7E,uCAAiD;AACjD,+CAA8D;AAE9D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,gBAAgB,GAAG,MAAM,IAAA,iCAAwB,EACrD,UAAU,EACV,8BAAoB,EACpB,sBAAU,EACV;QACE;YACE,QAAQ,EAAE,EAAE;SACb;QACD;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IACF,IAAI,CAAC,gBAAgB;QAAE,OAAO,EAAE,CAAC;IAEjC,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,MAAM,EAAE,sBAAU,CAAC,CAAC;IAC1E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,QAAQ;
|
1
|
+
{"version":3,"file":"stakingFet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