@sonarwatch/portfolio-plugins 0.12.36 → 0.12.38
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1847 -1839
- package/README.md +3 -3
- package/package.json +1 -1
- package/src/plugins/allbridge/constants.d.ts +0 -1
- package/src/plugins/allbridge/constants.js +1 -2
- package/src/plugins/allbridge/constants.js.map +1 -1
- package/src/plugins/allbridge/positionsFetcher.js +6 -2
- package/src/plugins/allbridge/positionsFetcher.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/banx/constants.d.ts +0 -1
- package/src/plugins/banx/constants.js +1 -2
- package/src/plugins/banx/constants.js.map +1 -1
- package/src/plugins/banx/idl.d.ts +15 -7
- package/src/plugins/banx/idl.js +199 -268
- package/src/plugins/banx/idl.js.map +1 -1
- package/src/plugins/banx/loansFetcher.js +19 -23
- package/src/plugins/banx/loansFetcher.js.map +1 -1
- package/src/plugins/banx/offersFetcher.js +10 -15
- package/src/plugins/banx/offersFetcher.js.map +1 -1
- package/src/plugins/citrus/collectionsJob.js.map +1 -1
- package/src/plugins/citrus/constants.d.ts +0 -1
- package/src/plugins/citrus/constants.js +1 -2
- package/src/plugins/citrus/constants.js.map +1 -1
- package/src/plugins/citrus/loansFetcher.js +14 -20
- package/src/plugins/citrus/loansFetcher.js.map +1 -1
- package/src/plugins/drift/constants.d.ts +1 -0
- package/src/plugins/drift/constants.js +2 -1
- package/src/plugins/drift/constants.js.map +1 -1
- package/src/plugins/drift/depositsFetcher.js +63 -1
- package/src/plugins/drift/depositsFetcher.js.map +1 -1
- package/src/plugins/drift/filters.d.ts +1 -0
- package/src/plugins/drift/filters.js +4 -1
- package/src/plugins/drift/filters.js.map +1 -1
- package/src/plugins/drift/index.js +2 -1
- package/src/plugins/drift/index.js.map +1 -1
- package/src/plugins/drift/perpHelpers/amm.d.ts +74 -0
- package/src/plugins/drift/perpHelpers/amm.js +567 -0
- package/src/plugins/drift/perpHelpers/amm.js.map +1 -0
- package/src/plugins/drift/perpHelpers/assert.d.ts +1 -0
- package/src/plugins/drift/perpHelpers/assert.js +10 -0
- package/src/plugins/drift/perpHelpers/assert.js.map +1 -0
- package/src/plugins/drift/perpHelpers/constants.d.ts +27 -0
- package/src/plugins/drift/perpHelpers/constants.js +35 -0
- package/src/plugins/drift/perpHelpers/constants.js.map +1 -0
- package/src/plugins/drift/perpHelpers/convert.d.ts +0 -0
- package/src/plugins/drift/perpHelpers/convert.js +2 -0
- package/src/plugins/drift/perpHelpers/convert.js.map +1 -0
- package/src/plugins/drift/perpHelpers/getOraclePrice.d.ts +4 -0
- package/src/plugins/drift/perpHelpers/getOraclePrice.js +61 -0
- package/src/plugins/drift/perpHelpers/getOraclePrice.js.map +1 -0
- package/src/plugins/drift/perpHelpers/getPerpMarket.d.ts +4 -0
- package/src/plugins/drift/perpHelpers/getPerpMarket.js +33 -0
- package/src/plugins/drift/perpHelpers/getPerpMarket.js.map +1 -0
- package/src/plugins/drift/perpHelpers/margin.d.ts +10 -0
- package/src/plugins/drift/perpHelpers/margin.js +82 -0
- package/src/plugins/drift/perpHelpers/margin.js.map +1 -0
- package/src/plugins/drift/perpHelpers/math.d.ts +4 -0
- package/src/plugins/drift/perpHelpers/math.js +29 -0
- package/src/plugins/drift/perpHelpers/math.js.map +1 -0
- package/src/plugins/drift/perpHelpers/oracle.d.ts +6 -0
- package/src/plugins/drift/perpHelpers/oracle.js +54 -0
- package/src/plugins/drift/perpHelpers/oracle.js.map +1 -0
- package/src/plugins/drift/perpHelpers/orders.d.ts +2 -0
- package/src/plugins/drift/perpHelpers/orders.js +9 -0
- package/src/plugins/drift/perpHelpers/orders.js.map +1 -0
- package/src/plugins/drift/perpHelpers/position.d.ts +44 -0
- package/src/plugins/drift/perpHelpers/position.js +184 -0
- package/src/plugins/drift/perpHelpers/position.js.map +1 -0
- package/src/plugins/drift/perpHelpers/prelaunchOracle.d.ts +3 -0
- package/src/plugins/drift/perpHelpers/prelaunchOracle.js +20 -0
- package/src/plugins/drift/perpHelpers/prelaunchOracle.js.map +1 -0
- package/src/plugins/drift/perpHelpers/pyth.d.ts +5 -0
- package/src/plugins/drift/perpHelpers/pyth.js +42 -0
- package/src/plugins/drift/perpHelpers/pyth.js.map +1 -0
- package/src/plugins/drift/perpHelpers/repeg.d.ts +14 -0
- package/src/plugins/drift/perpHelpers/repeg.js +162 -0
- package/src/plugins/drift/perpHelpers/repeg.js.map +1 -0
- package/src/plugins/drift/perpHelpers/switchboard.d.ts +3 -0
- package/src/plugins/drift/perpHelpers/switchboard.js +31 -0
- package/src/plugins/drift/perpHelpers/switchboard.js.map +1 -0
- package/src/plugins/drift/perpHelpers/types.d.ts +28 -0
- package/src/plugins/drift/perpHelpers/types.js +19 -0
- package/src/plugins/drift/perpHelpers/types.js.map +1 -0
- package/src/plugins/drift/prepMarketsJob.d.ts +3 -0
- package/src/plugins/drift/prepMarketsJob.js +38 -0
- package/src/plugins/drift/prepMarketsJob.js.map +1 -0
- package/src/plugins/drift/struct.d.ts +82 -76
- package/src/plugins/drift/struct.js +79 -74
- package/src/plugins/drift/struct.js.map +1 -1
- package/src/plugins/drift/types.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.d.ts +1 -0
- package/src/plugins/jupiter/exchange/constants.js +2 -1
- package/src/plugins/jupiter/exchange/constants.js.map +1 -1
- package/src/plugins/jupiter/exchange/limitFetcher.js +9 -6
- package/src/plugins/jupiter/exchange/limitFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/perpetualFetcher.js +3 -6
- package/src/plugins/jupiter/exchange/perpetualFetcher.js.map +1 -1
- package/src/plugins/jupiter/exchange/structs.d.ts +21 -0
- package/src/plugins/jupiter/exchange/structs.js +21 -1
- package/src/plugins/jupiter/exchange/structs.js.map +1 -1
- package/src/plugins/jupiter/exchange/valueAverageFetcher.js.map +1 -1
- package/src/plugins/jupiter/helpers.d.ts +2 -2
- package/src/plugins/jupiter/helpers.js.map +1 -1
- package/src/plugins/rain/collectionsJob.js +6 -10
- package/src/plugins/rain/collectionsJob.js.map +1 -1
- package/src/plugins/rain/helpers.js +3 -1
- package/src/plugins/rain/helpers.js.map +1 -1
- package/src/plugins/rain/index.js +2 -1
- package/src/plugins/rain/index.js.map +1 -1
- package/src/plugins/rain/loansFetcher.js +60 -25
- package/src/plugins/rain/loansFetcher.js.map +1 -1
- package/src/plugins/rain/types.d.ts +3 -0
- package/src/plugins/sharky/constants.d.ts +0 -1
- package/src/plugins/sharky/constants.js +3 -4
- package/src/plugins/sharky/constants.js.map +1 -1
- package/src/plugins/sharky/loansFetcher.js +17 -20
- package/src/plugins/sharky/loansFetcher.js.map +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/misc/MemoizedCache.d.ts +12 -0
- package/src/utils/misc/MemoizedCache.js +35 -0
- package/src/utils/misc/MemoizedCache.js.map +1 -0
- package/src/utils/misc/arrayToMap.d.ts +1 -0
- package/src/utils/misc/arrayToMap.js +12 -0
- package/src/utils/misc/arrayToMap.js.map +1 -0
- package/src/utils/misc/pick.d.ts +2 -0
- package/src/utils/misc/pick.js +16 -0
- package/src/utils/misc/pick.js.map +1 -0
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js +8 -3
- package/src/utils/solana/getAutoParsedMultipleAccountsInfo.js.map +1 -1
- package/src/plugins/allbridge/getPoolInfo.d.ts +0 -3
- package/src/plugins/allbridge/getPoolInfo.js +0 -28
- package/src/plugins/allbridge/getPoolInfo.js.map +0 -1
@@ -39,20 +39,20 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
39
39
|
const graphql_request_1 = __importStar(require("graphql-request"));
|
40
40
|
const constants_1 = require("./constants");
|
41
41
|
const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/tokenPriceToAssetToken"));
|
42
|
-
const query = (0, graphql_request_1.gql) `
|
43
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
44
|
-
getAirdropFinalFrontend(authority: $authority) {
|
45
|
-
authority
|
46
|
-
community_allocation
|
47
|
-
eligibility
|
48
|
-
main_allocation
|
49
|
-
og_allocation
|
50
|
-
s1_allocation
|
51
|
-
s2_allocation
|
52
|
-
total_allocation
|
53
|
-
__typename
|
54
|
-
}
|
55
|
-
}
|
42
|
+
const query = (0, graphql_request_1.gql) `
|
43
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
44
|
+
getAirdropFinalFrontend(authority: $authority) {
|
45
|
+
authority
|
46
|
+
community_allocation
|
47
|
+
eligibility
|
48
|
+
main_allocation
|
49
|
+
og_allocation
|
50
|
+
s1_allocation
|
51
|
+
s2_allocation
|
52
|
+
total_allocation
|
53
|
+
__typename
|
54
|
+
}
|
55
|
+
}
|
56
56
|
`;
|
57
57
|
const networkId = portfolio_core_1.NetworkId.solana;
|
58
58
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import { StorageValue } from 'unstorage';
|
2
|
+
import { Cache, TransactionOptions } from '../../Cache';
|
3
|
+
export declare class MemoizedCache<T extends StorageValue, K = T> {
|
4
|
+
private readonly key;
|
5
|
+
private readonly opts;
|
6
|
+
private readonly transform;
|
7
|
+
private readonly ttl;
|
8
|
+
private item;
|
9
|
+
private lastUpdate;
|
10
|
+
constructor(key: string, opts: TransactionOptions, transform?: (i: T | undefined) => K, ttl?: number);
|
11
|
+
getItem: (cache: Cache) => Promise<K>;
|
12
|
+
}
|
@@ -0,0 +1,35 @@
|
|
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
|
+
exports.MemoizedCache = void 0;
|
13
|
+
const defaultMemoizedCacheRefreshInterval = 3600000;
|
14
|
+
// T is the type of stored item in cache
|
15
|
+
// K is the type of the item after transformation
|
16
|
+
class MemoizedCache {
|
17
|
+
constructor(key, opts, transform, ttl = defaultMemoizedCacheRefreshInterval) {
|
18
|
+
this.getItem = (cache) => __awaiter(this, void 0, void 0, function* () {
|
19
|
+
const now = Date.now();
|
20
|
+
if (!this.item || this.lastUpdate + this.ttl < now) {
|
21
|
+
const rawItem = yield cache.getItem(this.key, this.opts);
|
22
|
+
this.item = this.transform ? this.transform(rawItem) : rawItem;
|
23
|
+
this.lastUpdate = now;
|
24
|
+
}
|
25
|
+
return this.item;
|
26
|
+
});
|
27
|
+
this.key = key;
|
28
|
+
this.opts = opts;
|
29
|
+
this.transform = transform;
|
30
|
+
this.ttl = ttl;
|
31
|
+
this.lastUpdate = 0;
|
32
|
+
}
|
33
|
+
}
|
34
|
+
exports.MemoizedCache = MemoizedCache;
|
35
|
+
//# sourceMappingURL=MemoizedCache.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"MemoizedCache.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/MemoizedCache.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAM,mCAAmC,GAAG,OAAO,CAAC;AAEpD,wCAAwC;AACxC,iDAAiD;AACjD,MAAa,aAAa;IASxB,YACE,GAAW,EACX,IAAwB,EACxB,SAAmC,EACnC,MAAc,mCAAmC;QASnD,YAAO,GAAG,CAAO,KAAY,EAAE,EAAE;YAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;YAEvB,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;gBACnD,MAAM,OAAO,GAAG,MAAM,KAAK,CAAC,OAAO,CAAI,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5D,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,CAAE,OAAa,CAAC;gBACtE,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;YACxB,CAAC;YAED,OAAO,IAAI,CAAC,IAAI,CAAC;QACnB,CAAC,CAAA,CAAC;QAjBA,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;CAaF;AAjCD,sCAiCC"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export declare const arrayToMap: <T>(array: T[], keyField: keyof T) => Map<string, T>;
|
@@ -0,0 +1,12 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.arrayToMap = void 0;
|
4
|
+
const arrayToMap = (array, keyField) => {
|
5
|
+
const map = new Map();
|
6
|
+
array.forEach((item) => {
|
7
|
+
map.set(item[keyField], item);
|
8
|
+
});
|
9
|
+
return map;
|
10
|
+
};
|
11
|
+
exports.arrayToMap = arrayToMap;
|
12
|
+
//# sourceMappingURL=arrayToMap.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"arrayToMap.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/arrayToMap.ts"],"names":[],"mappings":";;;AAAO,MAAM,UAAU,GAAG,CACxB,KAAU,EACV,QAAiB,EACD,EAAE;IAClB,MAAM,GAAG,GAAG,IAAI,GAAG,EAAa,CAAC;IACjC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACrB,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,QAAQ,CAAW,EAAE,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;IACH,OAAO,GAAG,CAAC;AACb,CAAC,CAAC;AATW,QAAA,UAAU,cASrB"}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.pickFromArray = exports.pick = void 0;
|
4
|
+
const pick = (obj, keys) => {
|
5
|
+
const result = {};
|
6
|
+
keys.forEach((key) => {
|
7
|
+
if (key in obj) {
|
8
|
+
result[key] = obj[key];
|
9
|
+
}
|
10
|
+
});
|
11
|
+
return result;
|
12
|
+
};
|
13
|
+
exports.pick = pick;
|
14
|
+
const pickFromArray = (items, keys) => items.map((item) => (0, exports.pick)(item, keys));
|
15
|
+
exports.pickFromArray = pickFromArray;
|
16
|
+
//# sourceMappingURL=pick.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"pick.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/pick.ts"],"names":[],"mappings":";;;AAAO,MAAM,IAAI,GAAG,CAClB,GAAM,EACN,IAAS,EACG,EAAE;IACd,MAAM,MAAM,GAAG,EAAgB,CAAC;IAChC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;QACnB,IAAI,GAAG,IAAI,GAAG,EAAE,CAAC;YACf,MAAM,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC;QACzB,CAAC;IACH,CAAC,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAXW,QAAA,IAAI,QAWf;AAEK,MAAM,aAAa,GAAG,CAC3B,KAAU,EACV,IAAS,EACK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAA,YAAI,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAH5C,QAAA,aAAa,iBAG+B"}
|
@@ -1,16 +1,16 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.poolQueryMsg = exports.minterQueryMsg = exports.tokenInfoQueryMsg = exports.infoQueryMsg = void 0;
|
4
|
-
exports.infoQueryMsg = JSON.parse(`{
|
5
|
-
"info": {}
|
4
|
+
exports.infoQueryMsg = JSON.parse(`{
|
5
|
+
"info": {}
|
6
6
|
}`);
|
7
|
-
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
-
"token_info": {}
|
7
|
+
exports.tokenInfoQueryMsg = JSON.parse(`{
|
8
|
+
"token_info": {}
|
9
9
|
}`);
|
10
|
-
exports.minterQueryMsg = JSON.parse(`{
|
11
|
-
"minter": {}
|
10
|
+
exports.minterQueryMsg = JSON.parse(`{
|
11
|
+
"minter": {}
|
12
12
|
}`);
|
13
|
-
exports.poolQueryMsg = JSON.parse(`{
|
14
|
-
"pool": {}
|
13
|
+
exports.poolQueryMsg = JSON.parse(`{
|
14
|
+
"pool": {}
|
15
15
|
}`);
|
16
16
|
//# sourceMappingURL=constants.js.map
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
function getQueryBalanceByOwner(owner) {
|
4
|
-
return JSON.parse(`{
|
5
|
-
"balance": {
|
6
|
-
"address": "${owner}"
|
7
|
-
}
|
4
|
+
return JSON.parse(`{
|
5
|
+
"balance": {
|
6
|
+
"address": "${owner}"
|
7
|
+
}
|
8
8
|
}`);
|
9
9
|
}
|
10
10
|
exports.default = getQueryBalanceByOwner;
|
@@ -22,10 +22,15 @@ function getAutoParsedMultipleAccountsInfo(connection, idlItem, publicKeys, comm
|
|
22
22
|
return accountsInfo.map((accountInfo, i) => {
|
23
23
|
if (!accountInfo)
|
24
24
|
return null;
|
25
|
-
|
26
|
-
|
25
|
+
try {
|
26
|
+
const parsedAccount = eventParser.parseAccount(accountInfo.data.toString('base64'));
|
27
|
+
if (parsedAccount === null)
|
28
|
+
return null;
|
29
|
+
return Object.assign({ pubkey: publicKeys[i], lamports: accountInfo.lamports }, parsedAccount.data);
|
30
|
+
}
|
31
|
+
catch (err) {
|
27
32
|
return null;
|
28
|
-
|
33
|
+
}
|
29
34
|
});
|
30
35
|
});
|
31
36
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getAutoParsedMultipleAccountsInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getAutoParsedMultipleAccountsInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,yDAIgC;AAChC,+EAA4E;AAG5E,SAAsB,iCAAiC,CACrD,UAAsB,EACtB,OAAgB,EAChB,UAAuB,EACvB,kBAA2D;;QAE3D,MAAM,MAAM,GAAG,IAAI,6BAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAU,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC;YAAE,OAAO,EAAE,CAAC;QAElE,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EACpD,UAAU,EACV,UAAU,EACV,kBAAkB,CACnB,CAAC;QAEF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAC;YAE9B,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAC5C,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACpC,CAAC;
|
1
|
+
{"version":3,"file":"getAutoParsedMultipleAccountsInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/solana/getAutoParsedMultipleAccountsInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,yDAIgC;AAChC,+EAA4E;AAG5E,SAAsB,iCAAiC,CACrD,UAAsB,EACtB,OAAgB,EAChB,UAAuB,EACvB,kBAA2D;;QAE3D,MAAM,MAAM,GAAG,IAAI,6BAAc,CAAC,OAAO,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,EAAE,CAAC,CAAC;QACzE,MAAM,WAAW,GAAG,MAAM,CAAC,YAAY,CAAC,yBAAU,CAAC,OAAO,CAAC,CAAC;QAE5D,IAAI,CAAC,WAAW,IAAI,CAAC,IAAA,mCAAoB,EAAC,WAAW,CAAC;YAAE,OAAO,EAAE,CAAC;QAElE,MAAM,YAAY,GAAG,MAAM,IAAA,yDAA2B,EACpD,UAAU,EACV,UAAU,EACV,kBAAkB,CACnB,CAAC;QAEF,OAAO,YAAY,CAAC,GAAG,CAAC,CAAC,WAAW,EAAE,CAAC,EAAE,EAAE;YACzC,IAAI,CAAC,WAAW;gBAAE,OAAO,IAAI,CAAC;YAE9B,IAAI,CAAC;gBACH,MAAM,aAAa,GAAG,WAAW,CAAC,YAAY,CAC5C,WAAW,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,CACpC,CAAC;gBACF,IAAI,aAAa,KAAK,IAAI;oBAAE,OAAO,IAAI,CAAC;gBAExC,uBACE,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,EACrB,QAAQ,EAAE,WAAW,CAAC,QAAQ,IAC1B,aAAa,CAAC,IAAU,EAC5B;YACJ,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACb,OAAO,IAAI,CAAC;YACd,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAnCD,8EAmCC"}
|
@@ -1,28 +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
|
-
exports.getPoolInfo = void 0;
|
13
|
-
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
14
|
-
const constants_1 = require("./constants");
|
15
|
-
let poolInfo;
|
16
|
-
let poolInfoLastUpdate = 0;
|
17
|
-
const getPoolInfo = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
18
|
-
if (!poolInfo || poolInfoLastUpdate + constants_1.poolInfoRefreshInterval < Date.now()) {
|
19
|
-
poolInfo = yield cache.getItem(constants_1.poolsCacheKey, {
|
20
|
-
prefix: constants_1.cachePrefix,
|
21
|
-
networkId: portfolio_core_1.NetworkId.solana,
|
22
|
-
});
|
23
|
-
poolInfoLastUpdate = Date.now();
|
24
|
-
}
|
25
|
-
return poolInfo;
|
26
|
-
});
|
27
|
-
exports.getPoolInfo = getPoolInfo;
|
28
|
-
//# sourceMappingURL=getPoolInfo.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getPoolInfo.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/allbridge/getPoolInfo.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAAuD;AAEvD,2CAIqB;AAGrB,IAAI,QAA2B,CAAC;AAChC,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAEpB,MAAM,WAAW,GAAG,CAAO,KAAY,EAAE,EAAE;IAChD,IAAI,CAAC,QAAQ,IAAI,kBAAkB,GAAG,mCAAuB,GAAG,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC;QAC3E,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAQ,yBAAa,EAAE;YACnD,MAAM,EAAE,uBAAW;YACnB,SAAS,EAAE,0BAAS,CAAC,MAAM;SAC5B,CAAC,CAAC;QACH,kBAAkB,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAClC,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AATW,QAAA,WAAW,eAStB"}
|