@sonarwatch/portfolio-plugins 0.12.170 → 0.12.172
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/Cache.d.ts +2 -1
- package/src/Cache.js +3 -3
- package/src/Cache.js.map +1 -1
- package/src/TokenPriceMap.d.ts +8 -0
- package/src/TokenPriceMap.js +21 -0
- package/src/TokenPriceMap.js.map +1 -0
- package/src/index.js +16 -0
- package/src/index.js.map +1 -1
- package/src/plugins/adrastea/constants.d.ts +9 -0
- package/src/plugins/adrastea/constants.js +19 -0
- package/src/plugins/adrastea/constants.js.map +1 -0
- package/src/plugins/adrastea/index.d.ts +6 -0
- package/src/plugins/adrastea/index.js +13 -0
- package/src/plugins/adrastea/index.js.map +1 -0
- package/src/plugins/adrastea/positionsFetcher.js +61 -0
- package/src/plugins/adrastea/positionsFetcher.js.map +1 -0
- package/src/plugins/adrastea/positionsJob.d.ts +3 -0
- package/src/plugins/adrastea/positionsJob.js +53 -0
- package/src/plugins/adrastea/positionsJob.js.map +1 -0
- package/src/plugins/adrastea/structs.d.ts +45 -0
- package/src/plugins/adrastea/structs.js +44 -0
- package/src/plugins/adrastea/structs.js.map +1 -0
- package/src/plugins/adrastea/types.d.ts +4 -0
- package/src/plugins/adrastea/types.js +3 -0
- package/src/plugins/adrastea/types.js.map +1 -0
- package/src/plugins/banx/stakingFetcher.js +11 -15
- package/src/plugins/banx/stakingFetcher.js.map +1 -1
- package/src/plugins/bluemove/constants.d.ts +7 -0
- package/src/plugins/bluemove/constants.js +17 -0
- package/src/plugins/bluemove/constants.js.map +1 -0
- package/src/plugins/bluemove/index.d.ts +6 -0
- package/src/plugins/bluemove/index.js +12 -0
- package/src/plugins/bluemove/index.js.map +1 -0
- package/src/plugins/bluemove/poolsJob.d.ts +3 -0
- package/src/plugins/bluemove/poolsJob.js +97 -0
- package/src/plugins/bluemove/poolsJob.js.map +1 -0
- package/src/plugins/bluemove/types.d.ts +21 -0
- package/src/plugins/bluemove/types.js +3 -0
- package/src/plugins/bluemove/types.js.map +1 -0
- package/src/plugins/cetus/clmmsFetcher.js +3 -3
- package/src/plugins/cetus/clmmsFetcher.js.map +1 -1
- package/src/plugins/cetus/constants.d.ts +4 -0
- package/src/plugins/cetus/constants.js +5 -1
- package/src/plugins/cetus/constants.js.map +1 -1
- package/src/plugins/cetus/dcaFetcher.js +77 -0
- package/src/plugins/cetus/dcaFetcher.js.map +1 -0
- package/src/plugins/cetus/farmsFetcher.js +2 -4
- package/src/plugins/cetus/farmsFetcher.js.map +1 -1
- package/src/plugins/cetus/index.js +8 -1
- package/src/plugins/cetus/index.js.map +1 -1
- package/src/plugins/cetus/limitFetcher.d.ts +3 -0
- package/src/plugins/cetus/limitFetcher.js +66 -0
- package/src/plugins/cetus/limitFetcher.js.map +1 -0
- package/src/plugins/cetus/types.d.ts +32 -0
- package/src/plugins/deepbook/constants.d.ts +3 -0
- package/src/plugins/deepbook/constants.js +4 -1
- package/src/plugins/deepbook/constants.js.map +1 -1
- package/src/plugins/deepbook/helpers.d.ts +4 -0
- package/src/plugins/deepbook/helpers.js +142 -0
- package/src/plugins/deepbook/helpers.js.map +1 -0
- package/src/plugins/deepbook/index.js +7 -2
- package/src/plugins/deepbook/index.js.map +1 -1
- package/src/plugins/deepbook/ordersFetcher.d.ts +3 -0
- package/src/plugins/deepbook/ordersFetcher.js +74 -0
- package/src/plugins/deepbook/ordersFetcher.js.map +1 -0
- package/src/plugins/deepbook/poolsJob.d.ts +3 -0
- package/src/plugins/deepbook/poolsJob.js +30 -0
- package/src/plugins/deepbook/poolsJob.js.map +1 -0
- package/src/plugins/deepbook/types.d.ts +12 -0
- package/src/plugins/deepbook/types.js +3 -0
- package/src/plugins/deepbook/types.js.map +1 -0
- package/src/plugins/flowx/stakingPoolFetcher.js +1 -1
- package/src/plugins/flowx/stakingPoolFetcher.js.map +1 -1
- package/src/plugins/flowx/stakingPoolV3Fetcher.js +1 -1
- package/src/plugins/flowx/stakingPoolV3Fetcher.js.map +1 -1
- package/src/plugins/foo/constants.d.ts +1 -1
- package/src/plugins/foo/constants.js +2 -2
- package/src/plugins/foo/constants.js.map +1 -1
- package/src/plugins/foo/index.js +2 -2
- package/src/plugins/foo/index.js.map +1 -1
- package/src/plugins/foo/marketsJob.js +3 -3
- package/src/plugins/foo/marketsJob.js.map +1 -1
- package/src/plugins/foo/positionsEthereumFetcher.d.ts +3 -0
- package/src/plugins/foo/positionsEthereumFetcher.js +33 -0
- package/src/plugins/foo/positionsEthereumFetcher.js.map +1 -0
- package/src/plugins/foo/positionsSolanaFetcher.js +10 -26
- package/src/plugins/foo/positionsSolanaFetcher.js.map +1 -1
- package/src/plugins/foo/positionsSuiFetcher.d.ts +3 -0
- package/src/plugins/foo/positionsSuiFetcher.js +46 -0
- package/src/plugins/foo/positionsSuiFetcher.js.map +1 -0
- package/src/plugins/foo/types.d.ts +5 -0
- package/src/plugins/foo/types.js +3 -0
- package/src/plugins/foo/types.js.map +1 -0
- package/src/plugins/francium/constants.d.ts +19 -0
- package/src/plugins/francium/constants.js +839 -0
- package/src/plugins/francium/constants.js.map +1 -0
- package/src/plugins/francium/helpers.d.ts +14 -0
- package/src/plugins/francium/helpers.js +85 -0
- package/src/plugins/francium/helpers.js.map +1 -0
- package/src/plugins/francium/index.d.ts +6 -0
- package/src/plugins/francium/index.js +13 -0
- package/src/plugins/francium/index.js.map +1 -0
- package/src/plugins/francium/lendingFetcher.d.ts +3 -0
- package/src/plugins/francium/lendingFetcher.js +70 -0
- package/src/plugins/francium/lendingFetcher.js.map +1 -0
- package/src/plugins/francium/lendingPoolJob.d.ts +3 -0
- package/src/plugins/francium/lendingPoolJob.js +49 -0
- package/src/plugins/francium/lendingPoolJob.js.map +1 -0
- package/src/plugins/francium/structs.d.ts +59 -0
- package/src/plugins/francium/structs.js +49 -0
- package/src/plugins/francium/structs.js.map +1 -0
- package/src/plugins/francium/tokens.d.ts +9 -0
- package/src/plugins/francium/tokens.js +524 -0
- package/src/plugins/francium/tokens.js.map +1 -0
- package/src/plugins/francium/types.d.ts +16 -0
- package/src/plugins/francium/types.js +3 -0
- package/src/plugins/francium/types.js.map +1 -0
- package/src/plugins/kamino/constants.js +4 -0
- package/src/plugins/kamino/constants.js.map +1 -1
- package/src/plugins/kamino/lendsFetcher.js +64 -167
- package/src/plugins/kamino/lendsFetcher.js.map +1 -1
- package/src/plugins/kriya/farmsFetcher.js +23 -48
- package/src/plugins/kriya/farmsFetcher.js.map +1 -1
- package/src/plugins/kriya/leverageVaultsFetcher.js +5 -5
- package/src/plugins/kriya/leverageVaultsFetcher.js.map +1 -1
- package/src/plugins/meteora/farmsFetcher.js +19 -68
- package/src/plugins/meteora/farmsFetcher.js.map +1 -1
- package/src/plugins/nxfinance/positionsFetcher.js +32 -80
- package/src/plugins/nxfinance/positionsFetcher.js.map +1 -1
- package/src/plugins/quarry/positionsFetcher.js +1 -1
- package/src/plugins/quarry/positionsFetcher.js.map +1 -1
- package/src/plugins/raydium/farmsFetcher.js +30 -74
- package/src/plugins/raydium/farmsFetcher.js.map +1 -1
- package/src/plugins/raydium/helpers.d.ts +3 -2
- package/src/plugins/raydium/helpers.js +5 -7
- package/src/plugins/raydium/helpers.js.map +1 -1
- package/src/plugins/raydium/index.js +1 -2
- package/src/plugins/raydium/index.js.map +1 -1
- package/src/plugins/raydium/lpTokensJob.js +1 -1
- package/src/plugins/raydium/lpTokensJob.js.map +1 -1
- package/src/plugins/stabble/constants.d.ts +8 -0
- package/src/plugins/stabble/constants.js +27 -0
- package/src/plugins/stabble/constants.js.map +1 -0
- package/src/plugins/stabble/filters.d.ts +3 -0
- package/src/plugins/stabble/filters.js +20 -0
- package/src/plugins/stabble/filters.js.map +1 -0
- package/src/plugins/stabble/index.d.ts +6 -0
- package/src/plugins/stabble/index.js +12 -0
- package/src/plugins/stabble/index.js.map +1 -0
- package/src/plugins/stabble/poolsJob.d.ts +3 -0
- package/src/plugins/stabble/poolsJob.js +84 -0
- package/src/plugins/stabble/poolsJob.js.map +1 -0
- package/src/plugins/stabble/stableIdl.d.ts +40 -0
- package/src/plugins/stabble/stableIdl.js +104 -0
- package/src/plugins/stabble/stableIdl.js.map +1 -0
- package/src/plugins/stabble/types.d.ts +40 -0
- package/src/plugins/stabble/types.js +3 -0
- package/src/plugins/stabble/types.js.map +1 -0
- package/src/plugins/stabble/weightedIdl.d.ts +40 -0
- package/src/plugins/stabble/weightedIdl.js +96 -0
- package/src/plugins/stabble/weightedIdl.js.map +1 -0
- package/src/utils/bitcoin/getBalance.js +1 -0
- package/src/utils/bitcoin/getBalance.js.map +1 -1
- package/src/utils/elementbuilder/AssetBuilder.d.ts +11 -0
- package/src/utils/elementbuilder/AssetBuilder.js +28 -0
- package/src/utils/elementbuilder/AssetBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.d.ts +27 -0
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js +110 -0
- package/src/utils/elementbuilder/ElementBorrowlendBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementBuilder.d.ts +12 -0
- package/src/utils/elementbuilder/ElementBuilder.js +13 -0
- package/src/utils/elementbuilder/ElementBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementLiquidityBuilder.d.ts +12 -0
- package/src/utils/elementbuilder/ElementLiquidityBuilder.js +42 -0
- package/src/utils/elementbuilder/ElementLiquidityBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementMultipleBuilder.d.ts +13 -0
- package/src/utils/elementbuilder/ElementMultipleBuilder.js +40 -0
- package/src/utils/elementbuilder/ElementMultipleBuilder.js.map +1 -0
- package/src/utils/elementbuilder/ElementParams.d.ts +7 -0
- package/src/utils/elementbuilder/ElementParams.js +3 -0
- package/src/utils/elementbuilder/ElementParams.js.map +1 -0
- package/src/utils/elementbuilder/ElementRegistry.d.ts +17 -0
- package/src/utils/elementbuilder/ElementRegistry.js +49 -0
- package/src/utils/elementbuilder/ElementRegistry.js.map +1 -0
- package/src/utils/elementbuilder/LiquidityBuilder.d.ts +15 -0
- package/src/utils/elementbuilder/LiquidityBuilder.js +52 -0
- package/src/utils/elementbuilder/LiquidityBuilder.js.map +1 -0
- package/src/utils/elementbuilder/PortfolioAssetParams.d.ts +7 -0
- package/src/utils/elementbuilder/PortfolioAssetParams.js +3 -0
- package/src/utils/elementbuilder/PortfolioAssetParams.js.map +1 -0
- package/src/plugins/foo/positionsFetcher.js +0 -49
- package/src/plugins/foo/positionsFetcher.js.map +0 -1
- package/src/plugins/raydium/stakingFetcher.js +0 -50
- package/src/plugins/raydium/stakingFetcher.js.map +0 -1
- /package/src/plugins/{foo → adrastea}/positionsFetcher.d.ts +0 -0
- /package/src/plugins/{raydium/stakingFetcher.d.ts → cetus/dcaFetcher.d.ts} +0 -0
@@ -0,0 +1,142 @@
|
|
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
|
+
exports.getAllPools = exports.getUserPosition = void 0;
|
16
|
+
const bcs_1 = require("@mysten/bcs");
|
17
|
+
const transactions_1 = require("@mysten/sui.js/transactions");
|
18
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
19
|
+
const constants_1 = require("./constants");
|
20
|
+
const queryEventsSafe_1 = require("../../utils/sui/queryEventsSafe");
|
21
|
+
const SUI_ADDRESS_LENGTH = 32;
|
22
|
+
const DUMMY_ADDRESS = normalizeSuiAddress('0x0');
|
23
|
+
function normalizeSuiAddress(value, forceAdd0x = false) {
|
24
|
+
let address = value.toLowerCase();
|
25
|
+
if (!forceAdd0x && address.startsWith('0x')) {
|
26
|
+
address = address.slice(2);
|
27
|
+
}
|
28
|
+
return `0x${address.padStart(SUI_ADDRESS_LENGTH * 2, '0')}`;
|
29
|
+
}
|
30
|
+
function normalizeSuiObjectId(value, forceAdd0x = false) {
|
31
|
+
return normalizeSuiAddress(value, forceAdd0x);
|
32
|
+
}
|
33
|
+
function parseTypeTag(type) {
|
34
|
+
if (!type.includes('::'))
|
35
|
+
return type;
|
36
|
+
return parseStructTag(type);
|
37
|
+
}
|
38
|
+
function parseStructTag(type) {
|
39
|
+
const [address, module] = type.split('::');
|
40
|
+
const rest = type.slice(address.length + module.length + 4);
|
41
|
+
const name = rest.includes('<') ? rest.slice(0, rest.indexOf('<')) : rest;
|
42
|
+
const typeParams = rest.includes('<')
|
43
|
+
? (0, bcs_1.splitGenericParameters)(rest.slice(rest.indexOf('<') + 1, rest.lastIndexOf('>'))).map((typeParam) => parseTypeTag(typeParam.trim()))
|
44
|
+
: [];
|
45
|
+
return {
|
46
|
+
address: normalizeSuiAddress(address),
|
47
|
+
module,
|
48
|
+
name,
|
49
|
+
typeParams,
|
50
|
+
};
|
51
|
+
}
|
52
|
+
function normalizeStructTag(type) {
|
53
|
+
const { address, module, name, typeParams } = typeof type === 'string' ? parseStructTag(type) : type;
|
54
|
+
const formattedTypeParams = (typeParams === null || typeParams === void 0 ? void 0 : typeParams.length) > 0
|
55
|
+
? `<${typeParams
|
56
|
+
.map((typeParam) => typeof typeParam === 'string'
|
57
|
+
? typeParam
|
58
|
+
: normalizeStructTag(typeParam))
|
59
|
+
.join(',')}>`
|
60
|
+
: '';
|
61
|
+
return `${address}::${module}::${name}${formattedTypeParams}`;
|
62
|
+
}
|
63
|
+
const checkAccountCap = (accountCap) => {
|
64
|
+
if (accountCap === undefined) {
|
65
|
+
throw new Error('accountCap is undefined, please call setAccountCap() first');
|
66
|
+
}
|
67
|
+
return normalizeSuiObjectId(accountCap);
|
68
|
+
};
|
69
|
+
/* const BcsOrder = bcs.struct('Order', {
|
70
|
+
orderId: bcs.u64(),
|
71
|
+
clientOrderId: bcs.u64(),
|
72
|
+
price: bcs.u64(),
|
73
|
+
originalQuantity: bcs.u64(),
|
74
|
+
quantity: bcs.u64(),
|
75
|
+
isBid: bcs.bool(),
|
76
|
+
owner: bcs.bytes(32),
|
77
|
+
expireTimestamp: bcs.u64(),
|
78
|
+
selfMatchingPrevention: bcs.u8(),
|
79
|
+
});
|
80
|
+
|
81
|
+
export const listOpenOrders = async (
|
82
|
+
pool: PoolSummary,
|
83
|
+
accountCap: string,
|
84
|
+
suiClient: SuiClient
|
85
|
+
): Promise<Order[]> => {
|
86
|
+
const tx = new TransactionBlock();
|
87
|
+
const cap = checkAccountCap(accountCap);
|
88
|
+
|
89
|
+
tx.moveCall({
|
90
|
+
typeArguments: [pool.baseAsset, pool.quoteAsset],
|
91
|
+
target: `${PACKAGE_ID}::${MODULE_CLOB}::list_open_orders`,
|
92
|
+
arguments: [tx.object(pool.poolId), tx.object(cap)],
|
93
|
+
});
|
94
|
+
|
95
|
+
const { results } = await suiClient.devInspectTransactionBlock({
|
96
|
+
transactionBlock: tx,
|
97
|
+
sender: DUMMY_ADDRESS,
|
98
|
+
});
|
99
|
+
|
100
|
+
if (!results) {
|
101
|
+
return [];
|
102
|
+
}
|
103
|
+
|
104
|
+
return bcs
|
105
|
+
.vector(BcsOrder)
|
106
|
+
.parse(Uint8Array.from(results![0].returnValues![0][0]));
|
107
|
+
}; */
|
108
|
+
const getUserPosition = (pool, accountCap, suiClient) => __awaiter(void 0, void 0, void 0, function* () {
|
109
|
+
var _a, _b;
|
110
|
+
const tx = new transactions_1.TransactionBlock();
|
111
|
+
const cap = checkAccountCap(accountCap);
|
112
|
+
tx.moveCall({
|
113
|
+
typeArguments: [pool.baseAsset, pool.quoteAsset],
|
114
|
+
target: `${constants_1.PACKAGE_ID}::${constants_1.MODULE_CLOB}::account_balance`,
|
115
|
+
arguments: [tx.object(normalizeSuiObjectId(pool.poolId)), tx.object(cap)],
|
116
|
+
});
|
117
|
+
const [availableBaseAmount, lockedBaseAmount, availableQuoteAmount, lockedQuoteAmount,] = (_b = (_a = (yield suiClient.devInspectTransactionBlock({
|
118
|
+
transactionBlock: tx,
|
119
|
+
sender: DUMMY_ADDRESS,
|
120
|
+
})).results) === null || _a === void 0 ? void 0 : _a[0].returnValues) === null || _b === void 0 ? void 0 : _b.map(([bytes]) => new bignumber_js_1.default(new bcs_1.BcsReader(Uint8Array.from(bytes)).read64()));
|
121
|
+
return {
|
122
|
+
availableBaseAmount,
|
123
|
+
lockedBaseAmount,
|
124
|
+
availableQuoteAmount,
|
125
|
+
lockedQuoteAmount,
|
126
|
+
};
|
127
|
+
});
|
128
|
+
exports.getUserPosition = getUserPosition;
|
129
|
+
const getAllPools = (suiClient) => __awaiter(void 0, void 0, void 0, function* () {
|
130
|
+
const events = yield (0, queryEventsSafe_1.queryEventsSafe)(suiClient, {
|
131
|
+
MoveEventType: `${constants_1.PACKAGE_ID}::${constants_1.MODULE_CLOB}::PoolCreated`,
|
132
|
+
});
|
133
|
+
return events
|
134
|
+
.map((e) => e.parsedJson && {
|
135
|
+
poolId: e.parsedJson.pool_id,
|
136
|
+
baseAsset: normalizeStructTag(e.parsedJson.base_asset.name),
|
137
|
+
quoteAsset: normalizeStructTag(e.parsedJson.quote_asset.name),
|
138
|
+
})
|
139
|
+
.filter((p) => p !== null);
|
140
|
+
});
|
141
|
+
exports.getAllPools = getAllPools;
|
142
|
+
//# sourceMappingURL=helpers.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;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AoB,EACI,EAAE;IAC1B,MAAM,MAAM,GAAG,MAAM,IAAA,iCAAe,EAIjC,SAAS,EAAE;QACZ,aAAa,EAAE,GAAG,sBAAU,KAAK,uBAAW,eAAe;KAC5D,CAAC,CAAC;IAEH,OAAO,MAAM;SACV,GAAG,CACF,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,UAAU,IAAI;QACd,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,OAAiB;QACtC,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,UAAU,CAAC,IAAI,CAAC;QAC3D,UAAU,EAAE,kBAAkB,CAAC,CAAC,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC;KAC9D,CACJ;SACA,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,IAAI,CAAkB,CAAC;AAChD,CAAC,CAAA,CAAC;AArBW,QAAA,WAAW,eAqBtB"}
|
@@ -1,10 +1,15 @@
|
|
1
1
|
"use strict";
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
4
|
+
};
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
6
|
exports.airdropFetcher = exports.fetchers = exports.jobs = exports.platforms = void 0;
|
4
7
|
const constants_1 = require("./constants");
|
5
8
|
const airdropFetcher_1 = require("./airdropFetcher");
|
6
9
|
Object.defineProperty(exports, "airdropFetcher", { enumerable: true, get: function () { return airdropFetcher_1.airdropFetcher; } });
|
10
|
+
const ordersFetcher_1 = __importDefault(require("./ordersFetcher"));
|
11
|
+
const poolsJob_1 = __importDefault(require("./poolsJob"));
|
7
12
|
exports.platforms = [constants_1.platform];
|
8
|
-
exports.jobs = [];
|
9
|
-
exports.fetchers = [];
|
13
|
+
exports.jobs = [poolsJob_1.default];
|
14
|
+
exports.fetchers = [ordersFetcher_1.default];
|
10
15
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/index.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,qDAAkD;AAOzC,+FAPA,+BAAc,OAOA;AANvB,oEAA4C;AAC5C,0DAAkC;AAErB,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,kBAAQ,CAAC,CAAC;AACzB,QAAA,QAAQ,GAAc,CAAC,uBAAa,CAAC,CAAC"}
|
@@ -0,0 +1,74 @@
|
|
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 getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
16
|
+
const helpers_1 = require("./helpers");
|
17
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
18
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
19
|
+
const client = (0, clients_1.getClientSui)();
|
20
|
+
const accountCaps = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
21
|
+
options: {
|
22
|
+
showType: true,
|
23
|
+
showContent: true,
|
24
|
+
showDisplay: true,
|
25
|
+
showOwner: true,
|
26
|
+
},
|
27
|
+
filter: {
|
28
|
+
MoveModule: {
|
29
|
+
module: 'custodian_v2',
|
30
|
+
package: constants_1.PACKAGE_ID,
|
31
|
+
},
|
32
|
+
},
|
33
|
+
});
|
34
|
+
if (!accountCaps[0].data)
|
35
|
+
return [];
|
36
|
+
const accountCapId = accountCaps[0].data.objectId;
|
37
|
+
const pools = yield cache.getItem(constants_1.poolsCacheKey, {
|
38
|
+
prefix: constants_1.platformId,
|
39
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
40
|
+
});
|
41
|
+
if (!pools)
|
42
|
+
return [];
|
43
|
+
const positions = yield Promise.all(pools.map((pool) => (0, helpers_1.getUserPosition)(pool, accountCapId, client)));
|
44
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
45
|
+
pools.forEach((pool, i) => {
|
46
|
+
if (!positions[i])
|
47
|
+
return;
|
48
|
+
const poolPosition = positions[i];
|
49
|
+
if (poolPosition.availableBaseAmount.isZero() &&
|
50
|
+
poolPosition.lockedBaseAmount.isZero() &&
|
51
|
+
poolPosition.availableQuoteAmount.isZero() &&
|
52
|
+
poolPosition.lockedQuoteAmount.isZero())
|
53
|
+
return;
|
54
|
+
const element = elementRegistry.addElementMultiple({
|
55
|
+
label: 'Deposit',
|
56
|
+
});
|
57
|
+
element.addAsset({
|
58
|
+
address: pool.baseAsset,
|
59
|
+
amount: poolPosition.availableBaseAmount.plus(poolPosition.lockedBaseAmount),
|
60
|
+
});
|
61
|
+
element.addAsset({
|
62
|
+
address: pool.quoteAsset,
|
63
|
+
amount: poolPosition.availableQuoteAmount.plus(poolPosition.lockedBaseAmount),
|
64
|
+
});
|
65
|
+
});
|
66
|
+
return elementRegistry.dump(cache);
|
67
|
+
});
|
68
|
+
const fetcher = {
|
69
|
+
id: `${constants_1.platformId}-orders`,
|
70
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
71
|
+
executor,
|
72
|
+
};
|
73
|
+
exports.default = fetcher;
|
74
|
+
//# sourceMappingURL=ordersFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ordersFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/ordersFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAAoE;AAEpE,iDAAmD;AACnD,qEAAkE;AAClE,uCAA4C;AAE5C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,WAAW,GAAG,MAAM,IAAA,iCAAe,EAAC,MAAM,EAAE,KAAK,EAAE;QACvD,OAAO,EAAE;YACP,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,IAAI;YACjB,WAAW,EAAE,IAAI;YACjB,SAAS,EAAE,IAAI;SAChB;QACD,MAAM,EAAE;YACN,UAAU,EAAE;gBACV,MAAM,EAAE,cAAc;gBACtB,OAAO,EAAE,sBAAU;aACpB;SACF;KACF,CAAC,CAAC;IAEH,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IAEpC,MAAM,YAAY,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC;IAElD,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAgB,yBAAa,EAAE;QAC9D,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IAEH,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,MAAM,SAAS,GAAG,MAAM,OAAO,C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AG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,30 @@
|
|
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 constants_1 = require("./constants");
|
15
|
+
const helpers_1 = require("./helpers");
|
16
|
+
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
17
|
+
const client = (0, clients_1.getClientSui)();
|
18
|
+
const pools = yield (0, helpers_1.getAllPools)(client);
|
19
|
+
yield cache.setItem(constants_1.poolsCacheKey, pools, {
|
20
|
+
prefix: constants_1.platformId,
|
21
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
22
|
+
});
|
23
|
+
});
|
24
|
+
const job = {
|
25
|
+
id: `${constants_1.platformId}-pools`,
|
26
|
+
executor,
|
27
|
+
label: 'normal',
|
28
|
+
};
|
29
|
+
exports.default = job;
|
30
|
+
//# sourceMappingURL=poolsJob.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"poolsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/poolsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAmD;AACnD,2CAAwD;AACxD,uCAAwC;AAExC,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,KAAK,GAAG,MAAM,IAAA,qBAAW,EAAC,MAAM,CAAC,CAAC;IAExC,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,KAAK,EAAE;QACxC,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import BigNumber from 'bignumber.js';
|
2
|
+
export interface PoolSummary {
|
3
|
+
poolId: string;
|
4
|
+
baseAsset: string;
|
5
|
+
quoteAsset: string;
|
6
|
+
}
|
7
|
+
export interface UserPosition {
|
8
|
+
availableBaseAmount: BigNumber;
|
9
|
+
lockedBaseAmount: BigNumber;
|
10
|
+
availableQuoteAmount: BigNumber;
|
11
|
+
lockedQuoteAmount: BigNumber;
|
12
|
+
}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/deepbook/types.ts"],"names":[],"mappings":""}
|
@@ -43,7 +43,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
43
43
|
const token = (0, portfolio_core_1.formatMoveTokenAddress)(pool.lpToken);
|
44
44
|
mints.add(token);
|
45
45
|
});
|
46
|
-
const tokenPrices = yield cache.getTokenPricesAsMap(
|
46
|
+
const tokenPrices = yield cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui);
|
47
47
|
const liquidities = [];
|
48
48
|
for (const position of activePositions) {
|
49
49
|
if (!((_b = (_a = position.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.pool_idx) ||
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingPoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingPoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAOoC;AACpC,gEAAqC;AAGrC,2CAA2E;AAC3E,iDAAmD;AAEnD,qEAAkE;AAClE,uGAA+E;AAE/E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,eAAe,GAAG,MAAM,IAAA,iCAAe,EAAiB,MAAM,EAAE,KAAK,EAAE;QAC3E,MAAM,EAAE;YACN,UAAU,EAAE,GAAG,qBAAS,sBAAsB;SAC/C;KACF,CAAC,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CACpB,SAAS,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,EAAE,eAAC,OAAA,MAAM,CAAC,MAAA,MAAA,GAAG,CAAC,IAAI,0CAAE,OAAO,0CAAE,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAA,EAAA,CAAC,CACxE,CAAC;IACF,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAE5C,MAAM,KAAK,GAAG,MAAM,KAAK,CAAC,OAAO,CAAS,oBAAQ,EAAE;QAClD,MAAM,EAAE,uBAAW;QACnB,SAAS,EAAE,0BAAS,CAAC,GAAG;KACzB,CAAC,CAAC;IACH,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IAEtB,MAAM,KAAK,GAAG,IAAI,GAAG,EAAU,CAAC;IAChC,eAAe,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;;QACnC,IAAI,CAAC,CAAA,MAAA,MAAA,QAAQ,CAAC,IAAI,0CA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CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,eAAe;IAChC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -42,7 +42,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
42
42
|
poolsIds.add((_h = (_g = position.data) === null || _g === void 0 ? void 0 : _g.content) === null || _h === void 0 ? void 0 : _h.fields.pool_id);
|
43
43
|
});
|
44
44
|
const [tokenPrices, pools] = yield Promise.all([
|
45
|
-
cache.getTokenPricesAsMap(
|
45
|
+
cache.getTokenPricesAsMap(mints, portfolio_core_1.NetworkId.sui),
|
46
46
|
(0, multiGetObjects_1.multiGetObjects)(client, Array.from(poolsIds.values())),
|
47
47
|
]);
|
48
48
|
const liquidities = [];
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stakingPoolV3Fetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/flowx/stakingPoolV3Fetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAMoC;AACpC,gEAAqC;AAGrC,2CAAsD;AACtD,iDAAmD;AAEnD,qEAAkE;AAClE,wFAAyF;AACzF,qGAA6E;AAC7E,qEAAkE;AAClE,+DAA4D;AAE5D,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAE9B,MAAM,SAAS,GAAG,MAAM,IAAA,iCAAe,EAAmB,MAAM,EAAE,KAAK,EAAE;QACvE,MAAM,EAAE;YACN,UAAU,EAAE,GAAG,uBAAW,sBAAsB;SACjD;KACF,CA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IAAA,+BAAc,EAAC,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC3D,WAAW,CAAC,IAAI,CAAC;YACf,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;YACxB,WAAW,EAAE,KAAK;YAClB,YAAY,EAAE,EAAE;YAChB,iBAAiB,EAAE,IAAI;YACvB,KAAK;YACL,MAAM,EAAE,EAAE;SACX,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACxC,OAAO;QACL;YACE,IAAI,EAAE,qCAAoB,CAAC,SAAS;YACpC,SAAS,EAAE,0BAAS,CAAC,GAAG;YACxB,UAAU,EAAV,sBAAU;YACV,KAAK,EAAE,eAAe;YACtB,KAAK,EAAE,IAAA,+BAAc,EAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;YACtD,IAAI,EAAE;gBACJ,WAAW;aACZ;SACF;KACF,CAAC;AACJ,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,kBAAkB;IACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -2,5 +2,5 @@ import { Platform } from '@sonarwatch/portfolio-core';
|
|
2
2
|
import { AirdropStatics } from '../../AirdropFetcher';
|
3
3
|
export declare const platformId = "foo";
|
4
4
|
export declare const platform: Platform;
|
5
|
-
export declare const
|
5
|
+
export declare const marketsCacheKey = "markets";
|
6
6
|
export declare const airdropStatics: AirdropStatics;
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
exports.airdropStatics = exports.
|
3
|
+
exports.airdropStatics = exports.marketsCacheKey = exports.platform = exports.platformId = void 0;
|
4
4
|
exports.platformId = 'foo';
|
5
5
|
exports.platform = {
|
6
6
|
id: exports.platformId,
|
@@ -10,7 +10,7 @@ exports.platform = {
|
|
10
10
|
twitter: 'https://x.com/foo_finance',
|
11
11
|
defiLlamaId: 'foo-finance', // from https://defillama.com/docs/api
|
12
12
|
};
|
13
|
-
exports.
|
13
|
+
exports.marketsCacheKey = `markets`;
|
14
14
|
exports.airdropStatics = {
|
15
15
|
claimLink: 'https://foo.com/claim',
|
16
16
|
emitterLink: 'https://foo.com',
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,aAAa,EAAE,sCAAsC;CACnE,CAAC;AACW,QAAA,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/constants.ts"],"names":[],"mappings":";;;AAGa,QAAA,UAAU,GAAG,KAAK,CAAC;AACnB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,4CAA4C;IACnD,OAAO,EAAE,kBAAkB;IAC3B,OAAO,EAAE,2BAA2B;IACpC,WAAW,EAAE,aAAa,EAAE,sCAAsC;CACnE,CAAC;AACW,QAAA,eAAe,GAAG,SAAS,CAAC;AAE5B,QAAA,cAAc,GAAmB;IAC5C,SAAS,EAAE,uBAAuB;IAClC,WAAW,EAAE,iBAAiB;IAC9B,WAAW,EAAE,cAAc;IAC3B,EAAE,EAAE,QAAQ;IACZ,KAAK,EAAE,4CAA4C;IACnD,QAAQ,EAAE,SAAS;IACnB,UAAU,EAAE,aAAa;CAC1B,CAAC"}
|
package/src/plugins/foo/index.js
CHANGED
@@ -6,10 +6,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.s1AirdropFetcher = exports.fetchers = exports.jobs = exports.platforms = void 0;
|
7
7
|
const constants_1 = require("./constants");
|
8
8
|
const marketsJob_1 = __importDefault(require("./marketsJob"));
|
9
|
-
const positionsFetcher_1 = __importDefault(require("./positionsFetcher"));
|
10
9
|
const airdropFetcher_1 = require("./airdropFetcher");
|
11
10
|
Object.defineProperty(exports, "s1AirdropFetcher", { enumerable: true, get: function () { return airdropFetcher_1.airdropFetcher; } });
|
11
|
+
const positionsSolanaFetcher_1 = __importDefault(require("./positionsSolanaFetcher"));
|
12
12
|
exports.platforms = [constants_1.platform];
|
13
13
|
exports.jobs = [marketsJob_1.default];
|
14
|
-
exports.fetchers = [
|
14
|
+
exports.fetchers = [positionsSolanaFetcher_1.default, airdropFetcher_1.fetcher];
|
15
15
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/index.ts"],"names":[],"mappings":";;;;;;AAGA,2CAAuC;AACvC,8DAAsC;AACtC,qDAG0B;AAMjB,iGARW,+BAAgB,OAQX;AALzB,sFAA8D;AAEjD,QAAA,SAAS,GAAe,CAAC,oBAAQ,CAAC,CAAC;AACnC,QAAA,IAAI,GAAU,CAAC,oBAAU,CAAC,CAAC;AAC3B,QAAA,QAAQ,GAAc,CAAC,gCAAsB,EAAE,wBAAS,CAAC,CAAC"}
|
@@ -12,9 +12,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
13
13
|
const constants_1 = require("./constants");
|
14
14
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
-
yield cache.setItem(
|
16
|
-
prefix: constants_1.
|
17
|
-
networkId: portfolio_core_1.NetworkId.
|
15
|
+
yield cache.setItem(constants_1.marketsCacheKey, 'market_object', {
|
16
|
+
prefix: constants_1.platformId,
|
17
|
+
networkId: portfolio_core_1.NetworkId.solana,
|
18
18
|
});
|
19
19
|
});
|
20
20
|
const job = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,
|
1
|
+
{"version":3,"file":"marketsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/marketsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,2CAA0D;AAE1D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,KAAK,CAAC,OAAO,CAAC,2BAAe,EAAE,eAAe,EAAE;QACpD,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,MAAM;KAC5B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AACF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,UAAU;IAC3B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -0,0 +1,33 @@
|
|
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 ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
15
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
16
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.ethereum, constants_1.platformId);
|
17
|
+
const element = elementRegistry.addElementMultiple({
|
18
|
+
label: 'Deposit',
|
19
|
+
});
|
20
|
+
element.addAsset({
|
21
|
+
address: portfolio_core_1.ethereumNativeAddress,
|
22
|
+
amount: 2,
|
23
|
+
alreadyShifted: true,
|
24
|
+
});
|
25
|
+
return elementRegistry.dump(cache);
|
26
|
+
});
|
27
|
+
const fetcher = {
|
28
|
+
id: `${constants_1.platformId}-positions-ethereum`,
|
29
|
+
networkId: portfolio_core_1.NetworkId.ethereum,
|
30
|
+
executor,
|
31
|
+
};
|
32
|
+
exports.default = fetcher;
|
33
|
+
//# sourceMappingURL=positionsEthereumFetcher.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"positionsEthereumFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/positionsEthereumFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA8E;AAE9E,2CAAyC;AAEzC,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,eAAe,GAAG,IAAI,iCAAe,CAAC,0BAAS,CAAC,QAAQ,EAAE,sBAAU,CAAC,CAAC;IAC5E,MAAM,OAAO,GAAG,eAAe,CAAC,kBAAkB,CAAC;QACjD,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;IACH,OAAO,CAAC,QAAQ,CAAC;QACf,OAAO,EAAE,sCAAqB;QAC9B,MAAM,EAAE,CAAC;QACT,cAAc,EAAE,IAAI;KACrB,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,qBAAqB;IACtC,SAAS,EAAE,0BAAS,CAAC,QAAQ;IAC7B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -8,9 +8,6 @@ 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
13
|
const web3_js_1 = require("@solana/web3.js");
|
@@ -18,7 +15,7 @@ const constants_1 = require("./constants");
|
|
18
15
|
const clients_1 = require("../../utils/clients");
|
19
16
|
const solana_1 = require("../../utils/solana");
|
20
17
|
const structs_1 = require("./structs");
|
21
|
-
const
|
18
|
+
const ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
22
19
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
23
20
|
const connection = (0, clients_1.getClientSolana)();
|
24
21
|
const accounts = yield (0, solana_1.getParsedProgramAccounts)(connection, structs_1.liquidityStruct, new web3_js_1.PublicKey('pid'), [
|
@@ -34,30 +31,17 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
34
31
|
]);
|
35
32
|
if (accounts.length === 0)
|
36
33
|
return [];
|
37
|
-
const
|
38
|
-
const
|
34
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.solana, constants_1.platformId);
|
35
|
+
const element = elementRegistry.addElementMultiple({
|
36
|
+
label: 'Deposit',
|
37
|
+
});
|
39
38
|
accounts.forEach((acc) => {
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
.toNumber();
|
45
|
-
const asset = (0, tokenPriceToAssetToken_1.default)(portfolio_core_1.solanaNativeAddress, amount, portfolio_core_1.NetworkId.solana, solTokenPrice);
|
46
|
-
assets.push(asset);
|
39
|
+
element.addAsset({
|
40
|
+
address: portfolio_core_1.solanaNativeAddress,
|
41
|
+
amount: acc.amountDeposited,
|
42
|
+
});
|
47
43
|
});
|
48
|
-
|
49
|
-
return [];
|
50
|
-
const element = {
|
51
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
52
|
-
label: 'Deposit',
|
53
|
-
platformId: constants_1.platformId,
|
54
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
55
|
-
value: (0, portfolio_core_1.getUsdValueSum)(assets.map((a) => a.value)),
|
56
|
-
data: {
|
57
|
-
assets,
|
58
|
-
},
|
59
|
-
};
|
60
|
-
return [element];
|
44
|
+
return elementRegistry.dump(cache);
|
61
45
|
});
|
62
46
|
const fetcher = {
|
63
47
|
id: `${constants_1.platformId}-positions-solana`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"positionsSolanaFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/positionsSolanaFetcher.ts"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"positionsSolanaFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/foo/positionsSolanaFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAA4E;AAC5E,6CAA4C;AAE5C,2CAAyC;AAEzC,iDAAsD;AACtD,+CAA8D;AAC9D,uCAA4C;AAC5C,gFAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,yBAAe,GAAE,CAAC;IACrC,MAAM,QAAQ,GAAG,MAAM,IAAA,iCAAwB,EAC7C,UAAU,EACV,yBAAe,EACf,IAAI,mBAAS,CAAC,KAAK,CAAC,EACpB;QACE;YACE,QAAQ,EAAE,yBAAe,CAAC,QAAQ;SACnC;QACD;YACE,MAAM,EAAE;gBACN,KAAK,EAAE,KAAK;gBACZ,MAAM,EAAE,EAAE;aACX;SACF;KACF,CACF,CAAC;IACF,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;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,SAAS;KACjB,CAAC,CAAC;IAEH,QAAQ,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACvB,OAAO,CAAC,QAAQ,CAAC;YACf,OAAO,EAAE,oCAAmB;YAC5B,MAAM,EAAE,GAAG,CAAC,eAAe;SAC5B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACrC,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,mBAAmB;IACpC,SAAS,EAAE,0BAAS,CAAC,MAAM;IAC3B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,46 @@
|
|
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 ElementRegistry_1 = require("../../utils/elementbuilder/ElementRegistry");
|
16
|
+
const getOwnedObjects_1 = require("../../utils/sui/getOwnedObjects");
|
17
|
+
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
+
const client = (0, clients_1.getClientSui)();
|
19
|
+
const receipts = yield (0, getOwnedObjects_1.getOwnedObjects)(client, owner, {
|
20
|
+
filter: {
|
21
|
+
StructType: '0x9bbd650b8442abb082c20f3bc95a9434a8d47b4bef98b0832dab57c1a8ba0000::foo::Receipt',
|
22
|
+
},
|
23
|
+
});
|
24
|
+
if (receipts.length === 0)
|
25
|
+
return [];
|
26
|
+
const elementRegistry = new ElementRegistry_1.ElementRegistry(portfolio_core_1.NetworkId.sui, constants_1.platformId);
|
27
|
+
const element = elementRegistry.addElementMultiple({
|
28
|
+
label: 'Deposit',
|
29
|
+
});
|
30
|
+
receipts.forEach((r) => {
|
31
|
+
var _a, _b, _c, _d;
|
32
|
+
if ((_b = (_a = r.data) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.fields.amountDeposited)
|
33
|
+
element.addAsset({
|
34
|
+
address: portfolio_core_1.suiNativeAddress,
|
35
|
+
amount: (_d = (_c = r.data) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.fields.amountDeposited,
|
36
|
+
});
|
37
|
+
});
|
38
|
+
return elementRegistry.dump(cache);
|
39
|
+
});
|
40
|
+
const fetcher = {
|
41
|
+
id: `${constants_1.platformId}-positions-sui`,
|
42
|
+
networkId: portfolio_core_1.NetworkId.sui,
|
43
|
+
executor,
|
44
|
+
};
|
45
|
+
exports.default = fetcher;
|
46
|
+
//# sourceMappingURL=positionsSuiFetcher.js.map
|