@sonarwatch/portfolio-plugins 0.14.124 → 0.14.126
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 +8 -0
- package/package.json +1 -1
- package/src/index.d.ts +1 -0
- package/src/index.js +7 -1
- 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/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/jupiter/index.d.ts +1 -0
- package/src/plugins/jupiter/index.js +7 -1
- package/src/plugins/jupiter/index.js.map +1 -1
- package/src/plugins/kamino/constants.js +4 -0
- package/src/plugins/kamino/constants.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/tokens/fetchers/solana.js +2 -7
- package/src/plugins/tokens/fetchers/solana.js.map +1 -1
- 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/stakingFetcher.js +14 -18
- 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/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
@@ -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":"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;QACf,IAAI,EAAE,2BAA2B;KAClC,CAAC,CAAC;IAEH,gBAAgB,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QAC/B,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC;QACrD,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,qBAAS;YAClB,MAAM,EAAE,GAAG,CAAC,MAAM;YAClB,UAAU,EAAE;gBACV,WAAW;aACZ;YACD,GAAG,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,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"}
|
@@ -35,12 +35,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
35
35
|
addresses.push(curr.id);
|
36
36
|
return addresses;
|
37
37
|
}, []);
|
38
|
-
const
|
39
|
-
const tokenPrices = new Map();
|
40
|
-
tokenPricesArray.forEach((tokenPrice) => {
|
41
|
-
if (tokenPrice)
|
42
|
-
tokenPrices.set(tokenPrice.address, tokenPrice);
|
43
|
-
});
|
38
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(fungibleAddresses, portfolio_core_1.NetworkId.solana);
|
44
39
|
const nftAssets = [];
|
45
40
|
const tokenAssets = [];
|
46
41
|
const liquiditiesByTag = {};
|
@@ -65,7 +60,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
65
60
|
}
|
66
61
|
// If it's a regular token
|
67
62
|
else if (tokenPrice && tokenPrice.platformId === constants_1.walletTokensPlatform.id) {
|
68
|
-
tokenAssets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(address, amount, portfolio_core_1.NetworkId.solana, tokenPrice)), { ref: (_a = asset.token_info) === null || _a === void 0 ? void 0 : _a.associated_token_address }));
|
63
|
+
tokenAssets.push(Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(address, amount, portfolio_core_1.NetworkId.solana, tokenPrice)), { ref: (_a = asset.token_info) === null || _a === void 0 ? void 0 : _a.associated_token_address, link: tokenPrice.link, sourceRefs: tokenPrice.sourceRefs }));
|
69
64
|
}
|
70
65
|
// If it's a NFT
|
71
66
|
else {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/solana.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAErC,4CAAwE;AAExE,wCAAkD;AAClD,wGAAgF;AAChF,sGAA8E;AAC9E,2GAAwG;AACxG,uFAAoF;AACpF,2FAAwF;AACxF,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,WAAW,GAAG,IAAA,8BAAoB,GAAE,CAAC;IAC3C,MAAM,KAAK,GAAG,MAAM,IAAA,yCAAmB,EAAC,WAAW,EAAE,KAAK,EAAE;QAC1D,iBAAiB,EAAE,KAAK;QACxB,cAAc,EAAE,KAAK;QACrB,eAAe,EAAE,KAAK;KACvB,CAAC,CAAC;IAEH,MAAM,iBAAiB,GAAG,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Q;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -26,6 +26,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
26
26
|
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
27
27
|
const element = elementRegistry.addElementMultiple({
|
28
28
|
label: 'Staked',
|
29
|
+
link: 'https://w.wormhole.com/',
|
29
30
|
});
|
30
31
|
tokenBalances.forEach((tokenBalance) => {
|
31
32
|
if (!tokenBalance)
|
@@ -33,6 +34,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
33
34
|
element.addAsset({
|
34
35
|
address: constants_1.wMint,
|
35
36
|
amount: tokenBalance === null || tokenBalance === void 0 ? void 0 : tokenBalance.balance,
|
37
|
+
ref: tokenBalance.pubkey.toString(),
|
36
38
|
});
|
37
39
|
});
|
38
40
|
return elementRegistry.getElements(cache);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/wormhole/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAkE;AAClE,iDAAsD;AACtD,gFAA6E;AAC7E,+CAAmE;AACnE,uCAA+C;AAE/C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,4BAAkB,EAClB;QACE,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAC9D,4BAAgB,CACjB,CAAC,CAAC,CAAC;KACL,CACF,CAAC;IAEF,IAAI,CAAC,aAAa,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAErC,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/wormhole/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AACvD,6CAA4C;AAG5C,2CAAkE;AAClE,iDAAsD;AACtD,gFAA6E;AAC7E,+CAAmE;AACnE,uCAA+C;AAE/C,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,yBAAe,GAAE,CAAC;IAEjC,MAAM,aAAa,GAAG,MAAM,IAAA,sCAA6B,EACvD,MAAM,EACN,4BAAkB,EAClB;QACE,mBAAS,CAAC,sBAAsB,CAC9B,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,EAAE,IAAI,mBAAS,CAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,EAC9D,4BAAgB,CACjB,CAAC,CAAC,CAAC;KACL,CACF,CAAC;IAEF,IAAI,CAAC,aAAa,CAAC,MAAM;QAAE,OAAO,EAAE,CAAC;IAErC,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;QACf,IAAI,EAAE,yBAAyB;KAChC,CAAC,CAAC;IAEH,aAAa,CAAC,OAAO,CAAC,CAAC,YAAY,EAAE,EAAE;QACrC,IAAI,CAAC,YAAY;YAAE,OAAO;QAC1B,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,iBAAK;YACd,MAAM,EAAE,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO;YAC7B,GAAG,EAAE,YAAY,CAAC,MAAM,CAAC,QAAQ,EAAE;SACpC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,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"}
|
@@ -7,6 +7,7 @@ const constants_3 = require("../whalesmarket/constants");
|
|
7
7
|
const constants_4 = require("../allbridge/constants");
|
8
8
|
const orphanPlatforms_1 = require("../../orphanPlatforms");
|
9
9
|
const constants_5 = require("../streamflow/constants");
|
10
|
+
const constants_6 = require("../sanctum/constants");
|
10
11
|
exports.xStakingConfigs = [
|
11
12
|
{
|
12
13
|
mint: constants_1.auryMint,
|
@@ -64,5 +65,13 @@ exports.xStakingConfigs = [
|
|
64
65
|
xDecimals: 6,
|
65
66
|
platformId: constants_5.platformId,
|
66
67
|
},
|
68
|
+
{
|
69
|
+
mint: 'CLoUDKc4Ane7HeQcPpE3YHnznRxhMimJ4MyaUqyHFzAu',
|
70
|
+
decimals: 9,
|
71
|
+
vault: '5jbzpJeGZFpPFrwXAdeWn25UJiParK8rayQYJY3r14cv',
|
72
|
+
xMint: 'sc1dNAxRBj5CNWaGC26AR7PEW75R36Umzt1V8vuP8kZ',
|
73
|
+
xDecimals: 9,
|
74
|
+
platformId: constants_6.platformId,
|
75
|
+
},
|
67
76
|
];
|
68
77
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/constants.ts"],"names":[],"mappings":";;;AAAA,mDAM6B;AAC7B,sDAA2E;AAC3E,yDAAiF;AACjF,sDAA2E;AAC3E,2DAA2E;AAC3E,uDAA4E;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/x-staking-solana/constants.ts"],"names":[],"mappings":";;;AAAA,mDAM6B;AAC7B,sDAA2E;AAC3E,yDAAiF;AACjF,sDAA2E;AAC3E,2DAA2E;AAC3E,uDAA4E;AAC5E,oDAAuE;AAE1D,QAAA,eAAe,GAAoB;IAC9C;QACE,IAAI,EAAE,oBAAQ;QACd,QAAQ,EAAR,oBAAQ;QACR,KAAK,EAAE,uBAAW;QAClB,KAAK,EAAE,qBAAS;QAChB,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAgB;KAC7B;IACD;QACE,IAAI,EAAE,8CAA8C;QACpD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,8CAA8C;QACrD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAsB;KACnC;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,qCAAmB,CAAC,EAAE;KACnC;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAmB;KAChC;IACD;QACE,IAAI,EAAE,8CAA8C;QACpD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAmB;KAChC;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,+BAAa,CAAC,EAAE;KAC7B;IACD;QACE,IAAI,EAAE,6CAA6C;QACnD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,8CAA8C;QACrD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAmB;KAChC;IACD;QACE,IAAI,EAAE,8CAA8C;QACpD,QAAQ,EAAE,CAAC;QACX,KAAK,EAAE,8CAA8C;QACrD,KAAK,EAAE,6CAA6C;QACpD,SAAS,EAAE,CAAC;QACZ,UAAU,EAAE,sBAAiB;KAC9B;CACF,CAAC"}
|
@@ -15,10 +15,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
16
|
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
17
17
|
const constants_1 = require("./constants");
|
18
|
-
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
19
18
|
const clients_1 = require("../../utils/clients");
|
20
19
|
const helpers_1 = require("./helpers");
|
21
20
|
const solana_1 = require("../../utils/solana");
|
21
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
22
22
|
const networkId = portfolio_core_1.NetworkId.solana;
|
23
23
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
24
|
const client = (0, clients_1.getClientSolana)();
|
@@ -31,34 +31,30 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
31
31
|
index += step;
|
32
32
|
accounts.push(...stakeAccounts);
|
33
33
|
} while (!accounts.some((acc) => !acc));
|
34
|
-
const
|
35
|
-
const
|
34
|
+
const registry = new ElementRegistry_1.ElementRegistry(networkId, constants_1.platformId);
|
35
|
+
const stakingElement = registry.addElementMultiple({
|
36
|
+
label: 'Staked',
|
37
|
+
link: 'https://dex.zeta.markets/staking',
|
38
|
+
});
|
36
39
|
for (const account of accounts) {
|
37
40
|
if (!account)
|
38
41
|
continue;
|
39
42
|
const name = (0, solana_1.u8ArrayToString)(account.name);
|
40
|
-
const amount = new bignumber_js_1.default(account.amountStillStaked)
|
41
|
-
.dividedBy(Math.pow(10, constants_1.zexDecimals))
|
42
|
-
.toNumber();
|
43
|
+
const amount = new bignumber_js_1.default(account.amountStillStaked).toNumber();
|
43
44
|
const attributes = {
|
44
45
|
lockedUntil: account.stakeState.vesting
|
45
46
|
? (0, helpers_1.getTimestamp)(account.stakeDurationEpochs, account.stakeState.vesting.stakeStartEpoch)
|
46
47
|
: -1,
|
48
|
+
tags: [name],
|
47
49
|
};
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
platformId: constants_1.platformId,
|
54
|
-
name,
|
55
|
-
data: {
|
56
|
-
assets: [asset],
|
57
|
-
},
|
58
|
-
value: asset.value,
|
50
|
+
stakingElement.addAsset({
|
51
|
+
address: constants_1.zexMint,
|
52
|
+
amount,
|
53
|
+
attributes,
|
54
|
+
ref: account.pubkey.toString(),
|
59
55
|
});
|
60
56
|
}
|
61
|
-
return
|
57
|
+
return registry.getElements(cache);
|
62
58
|
});
|
63
59
|
const fetcher = {
|
64
60
|
id: `${constants_1.platformId}-staking`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+
|
1
|
+
{"version":3,"file":"stakingFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/zeta/stakingFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAGoC;AACpC,gEAAqC;AAGrC,2CAA+D;AAC/D,iDAAsD;AACtD,uCAAoE;AACpE,+CAG4B;AAE5B,gFAA6E;AAE7E,MAAM,SAAS,GAAG,0BAAS,CAAC,MAAM,CAAC;AAEnC,MAAM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CAAC,eAAe,CAC3C;gBACH,CAAC,CAAC,CAAC,CAAC;YACN,IAAI,EAAE,CAAC,IAAI,CAAC;SACb,CAAC;QAEF,cAAc,CAAC,QAAQ,CAAC;YACtB,OAAO,EAAE,mBAAO;YAChB,MAAM;YACN,UAAU;YACV,GAAG,EAAE,OAAO,CAAC,MAAM,CAAC,QAAQ,EAAE;SAC/B,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;IACT,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -19,6 +19,7 @@ class AssetGenericBuilder extends AssetBuilder_1.AssetBuilder {
|
|
19
19
|
get(networkId,
|
20
20
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
21
21
|
tokenPrices) {
|
22
|
+
var _a;
|
22
23
|
let value = new bignumber_js_1.default(0);
|
23
24
|
if (this.params.value) {
|
24
25
|
value = new bignumber_js_1.default(this.params.value);
|
@@ -42,6 +43,9 @@ class AssetGenericBuilder extends AssetBuilder_1.AssetBuilder {
|
|
42
43
|
: undefined,
|
43
44
|
},
|
44
45
|
attributes: this.params.attributes || {},
|
46
|
+
link: this.params.link,
|
47
|
+
sourceRefs: this.params.sourceRefs,
|
48
|
+
ref: (_a = this.params.ref) === null || _a === void 0 ? void 0 : _a.toString(),
|
45
49
|
};
|
46
50
|
}
|
47
51
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AssetGenericBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetGenericBuilder.ts"],"names":[],"mappings":";;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAErC,iDAA8C;AAG9C,MAAa,mBAAoB,SAAQ,2BAAY;IAGnD,YAAY,MAAmC;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,GAAG,CACD,SAAwB;IACxB,6DAA6D;IAC7D,WAA0B
|
1
|
+
{"version":3,"file":"AssetGenericBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetGenericBuilder.ts"],"names":[],"mappings":";;;;;;AAAA,+DAIoC;AACpC,gEAAqC;AAErC,iDAA8C;AAG9C,MAAa,mBAAoB,SAAQ,2BAAY;IAGnD,YAAY,MAAmC;QAC7C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,kDAAkD;IAClD,cAAc;QACZ,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,GAAG,CACD,SAAwB;IACxB,6DAA6D;IAC7D,WAA0B;;QAE1B,IAAI,KAAK,GAAG,IAAI,sBAAS,CAAC,CAAC,CAAC,CAAC;QAC7B,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACtB,KAAK,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC3C,CAAC;aAAM,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YACnD,KAAK,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CACpD,IAAI,CAAC,MAAM,CAAC,MAAM,CACnB,CAAC;QACJ,CAAC;QAED,IAAI,KAAK,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QAEhC,OAAO;YACL,IAAI,EAAE,mCAAkB,CAAC,OAAO;YAChC,SAAS;YACT,KAAK,EAAE,KAAK,CAAC,QAAQ,EAAE;YACvB,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,IAAI,EAAE;gBACJ,OAAO,EAAE,IAAI,CAAC,MAAM,CAAC,OAAO;oBAC1B,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE;oBAChC,CAAC,CAAC,SAAS;gBACb,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,MAAM;oBACxB,CAAC,CAAC,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,QAAQ,EAAE;oBAC9C,CAAC,CAAC,SAAS;aACd;YACD,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU,IAAI,EAAE;YACxC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,IAAI;YACtB,UAAU,EAAE,IAAI,CAAC,MAAM,CAAC,UAAU;YAClC,GAAG,EAAE,MAAA,IAAI,CAAC,MAAM,CAAC,GAAG,0CAAE,QAAQ,EAAE;SACjC,CAAC;IACJ,CAAC;CACF;AAhDD,kDAgDC"}
|
@@ -1,5 +1,8 @@
|
|
1
|
-
|
1
|
+
/// <reference types="@drift-labs/sdk/node_modules/@solana/web3.js" />
|
2
|
+
/// <reference types="jito-ts/node_modules/@solana/web3.js" />
|
3
|
+
import { NetworkIdType, PortfolioAsset, PortfolioAssetAttributes, SourceRef } from '@sonarwatch/portfolio-core';
|
2
4
|
import BigNumber from 'bignumber.js';
|
5
|
+
import { PublicKey } from '@solana/web3.js';
|
3
6
|
import { TokenPriceMap } from '../../TokenPriceMap';
|
4
7
|
import { AssetBuilder } from './AssetBuilder';
|
5
8
|
import { PortfolioAssetTokenParams } from './Params';
|
@@ -8,6 +11,9 @@ export declare class AssetTokenBuilder extends AssetBuilder {
|
|
8
11
|
amount: number | BigNumber | string;
|
9
12
|
attributes: PortfolioAssetAttributes;
|
10
13
|
alreadyShifted: boolean;
|
14
|
+
sourceRefs?: SourceRef[];
|
15
|
+
ref?: string | PublicKey;
|
16
|
+
link?: string;
|
11
17
|
constructor(params: PortfolioAssetTokenParams);
|
12
18
|
tokenAddresses(): string[];
|
13
19
|
getUnderlyings(networkId: NetworkIdType, tokenPrices: TokenPriceMap): PortfolioAsset[];
|
@@ -15,6 +15,9 @@ class AssetTokenBuilder extends AssetBuilder_1.AssetBuilder {
|
|
15
15
|
this.amount = params.amount;
|
16
16
|
this.attributes = params.attributes || {};
|
17
17
|
this.alreadyShifted = params.alreadyShifted || false;
|
18
|
+
this.ref = params.ref;
|
19
|
+
this.sourceRefs = params.sourceRefs;
|
20
|
+
this.link = params.link;
|
18
21
|
}
|
19
22
|
tokenAddresses() {
|
20
23
|
return [this.address];
|
@@ -31,6 +34,7 @@ class AssetTokenBuilder extends AssetBuilder_1.AssetBuilder {
|
|
31
34
|
return (0, tokenPriceToAssetTokens_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes);
|
32
35
|
}
|
33
36
|
get(networkId, tokenPrices) {
|
37
|
+
var _a;
|
34
38
|
let amount = new bignumber_js_1.default(this.amount);
|
35
39
|
if (amount.isZero())
|
36
40
|
return null;
|
@@ -39,7 +43,7 @@ class AssetTokenBuilder extends AssetBuilder_1.AssetBuilder {
|
|
39
43
|
return null;
|
40
44
|
if (!this.alreadyShifted)
|
41
45
|
amount = amount.dividedBy(Math.pow(10, tokenPrice.decimals));
|
42
|
-
return (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes);
|
46
|
+
return Object.assign(Object.assign({}, (0, tokenPriceToAssetToken_1.default)(tokenPrice.address, amount.toNumber(), networkId, tokenPrice, undefined, this.attributes, this.link)), { sourceRefs: this.sourceRefs, ref: (_a = this.ref) === null || _a === void 0 ? void 0 : _a.toString() });
|
43
47
|
}
|
44
48
|
}
|
45
49
|
exports.AssetTokenBuilder = AssetTokenBuilder;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"AssetTokenBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetTokenBuilder.ts"],"names":[],"mappings":";;;;;;
|
1
|
+
{"version":3,"file":"AssetTokenBuilder.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/elementbuilder/AssetTokenBuilder.ts"],"names":[],"mappings":";;;;;;AAMA,gEAAqC;AAErC,4FAAoE;AAEpE,8FAAsE;AACtE,iDAA8C;AAG9C,MAAa,iBAAkB,SAAQ,2BAAY;IASjD,YAAY,MAAiC;QAC3C,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC;QACzC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;QAC1C,IAAI,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,IAAI,KAAK,CAAC;QACrD,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC;QACtB,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;QACpC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;IAC1B,CAAC;IAED,cAAc;QACZ,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACxB,CAAC;IAED,cAAc,CACZ,SAAwB,EACxB,WAA0B;QAE1B,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,EAAE,CAAC;QAE3B,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAExC,IAAI,MAAM,CAAC,MAAM,EAAE,IAAI,UAAU,CAAC,WAAW;YAAE,OAAO,EAAE,CAAC;QAEzD,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,OAAO,IAAA,iCAAuB,EAC5B,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,CAChB,CAAC;IACJ,CAAC;IAED,GAAG,CACD,SAAwB,EACxB,WAA0B;;QAE1B,IAAI,MAAM,GAAG,IAAI,sBAAS,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QACxC,IAAI,MAAM,CAAC,MAAM,EAAE;YAAE,OAAO,IAAI,CAAC;QACjC,MAAM,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACjD,IAAI,CAAC,UAAU;YAAE,OAAO,IAAI,CAAC;QAE7B,IAAI,CAAC,IAAI,CAAC,cAAc;YACtB,MAAM,GAAG,MAAM,CAAC,SAAS,CAAC,SAAA,EAAE,EAAI,UAAU,CAAC,QAAQ,CAAA,CAAC,CAAC;QAEvD,uCACK,IAAA,gCAAsB,EACvB,UAAU,CAAC,OAAO,EAClB,MAAM,CAAC,QAAQ,EAAE,EACjB,SAAS,EACT,UAAU,EACV,SAAS,EACT,IAAI,CAAC,UAAU,EACf,IAAI,CAAC,IAAI,CACV,KACD,UAAU,EAAE,IAAI,CAAC,UAAU,EAC3B,GAAG,EAAE,MAAA,IAAI,CAAC,GAAG,0CAAE,QAAQ,EAAE,IACzB;IACJ,CAAC;CACF;AA1ED,8CA0EC"}
|
@@ -43,12 +43,18 @@ export type PortfolioAssetGenericParams = {
|
|
43
43
|
attributes?: PortfolioAssetAttributes;
|
44
44
|
value?: number | BigNumber;
|
45
45
|
name?: string;
|
46
|
+
sourceRefs?: SourceRef[];
|
47
|
+
ref?: string | PublicKey;
|
48
|
+
link?: string;
|
46
49
|
};
|
47
50
|
export type PortfolioAssetTokenParams = {
|
48
51
|
address: string | PublicKey;
|
49
52
|
amount: number | BigNumber | string;
|
50
53
|
attributes?: PortfolioAssetAttributes;
|
51
54
|
alreadyShifted?: boolean;
|
55
|
+
sourceRefs?: SourceRef[];
|
56
|
+
ref?: string | PublicKey;
|
57
|
+
link?: string;
|
52
58
|
};
|
53
59
|
export type TradeParams = {
|
54
60
|
inputAsset: PortfolioAssetTokenParams;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tokenPriceToLiquidity.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/tokenPriceToLiquidity.ts"],"names":[],"mappings":";;;;;AAAA,+DAKoC;AACpC,wFAAgE;AAEhE,SAAwB,qBAAqB,CAC3C,OAAe,EACf,MAAc,EACd,SAAwB,EACxB,UAAsB;IAEtB,MAAM,MAAM,GAAG,IAAA,iCAAuB,EACpC,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,CACX,CAAC;IACF,OAAO;QACL,MAAM;QACN,WAAW,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACvD,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,CAAC;QACpB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU,CAAC,aAAa;QAC9B,UAAU,EAAE;YACV;gBACE,OAAO;gBACP,IAAI,EAAE,MAAM;aACb;SACF;KACF,CAAC;AACJ,CAAC;
|
1
|
+
{"version":3,"file":"tokenPriceToLiquidity.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/tokenPriceToLiquidity.ts"],"names":[],"mappings":";;;;;AAAA,+DAKoC;AACpC,wFAAgE;AAEhE,SAAwB,qBAAqB,CAC3C,OAAe,EACf,MAAc,EACd,SAAwB,EACxB,UAAsB;IAEtB,MAAM,MAAM,GAAG,IAAA,iCAAuB,EACpC,OAAO,EACP,MAAM,EACN,SAAS,EACT,UAAU,CACX,CAAC;IACF,OAAO;QACL,MAAM;QACN,WAAW,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACvD,YAAY,EAAE,EAAE;QAChB,iBAAiB,EAAE,CAAC;QACpB,KAAK,EAAE,IAAA,+BAAc,EAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;QACjD,MAAM,EAAE,EAAE;QACV,IAAI,EAAE,UAAU,CAAC,aAAa;QAC9B,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,UAAU,EAAE;YACV;gBACE,OAAO;gBACP,IAAI,EAAE,MAAM;aACb;SACF;KACF,CAAC;AACJ,CAAC;AA5BD,wCA4BC"}
|
@@ -1,52 +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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
-
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
|
-
const web3_js_1 = require("@solana/web3.js");
|
14
|
-
const constants_1 = require("./constants");
|
15
|
-
const clients_1 = require("../../utils/clients");
|
16
|
-
const solana_1 = require("../../utils/solana");
|
17
|
-
const structs_1 = require("./structs");
|
18
|
-
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
19
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
20
|
-
const connection = (0, clients_1.getClientSolana)();
|
21
|
-
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.liquidityStruct, new web3_js_1.PublicKey('pid'), [
|
22
|
-
{
|
23
|
-
dataSize: structs_1.liquidityStruct.byteSize,
|
24
|
-
},
|
25
|
-
{
|
26
|
-
memcmp: {
|
27
|
-
bytes: owner,
|
28
|
-
offset: 40,
|
29
|
-
},
|
30
|
-
},
|
31
|
-
]);
|
32
|
-
if (accounts.length === 0)
|
33
|
-
return [];
|
34
|
-
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
35
|
-
const element = elementRegistry.addElementMultiple({
|
36
|
-
label: 'Deposit',
|
37
|
-
});
|
38
|
-
accounts.forEach((acc) => {
|
39
|
-
element.addAsset({
|
40
|
-
address: portfolio_core_1.solanaNativeAddress,
|
41
|
-
amount: acc.amountDeposited,
|
42
|
-
});
|
43
|
-
});
|
44
|
-
return elementRegistry.getElements(cache);
|
45
|
-
});
|
46
|
-
const fetcher = {
|
47
|
-
id: `${constants_1.platformId}-positions-solana`,
|
48
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
49
|
-
executor,
|
50
|
-
};
|
51
|
-
exports.default = fetcher;
|
52
|
-
//# sourceMappingURL=positionsFetcher.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"positionsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/baskt/positionsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAAyC;AAEzC,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA4C;AAC5C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,E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