@sonarwatch/portfolio-plugins 0.11.138 → 0.11.140
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1275 -1267
- package/README.md +3 -3
- package/package.json +3 -3
- package/src/index.js +4 -0
- package/src/index.js.map +1 -1
- package/src/plugins/aptin/depositsFetcher.js +9 -9
- package/src/plugins/aptin/depositsFetcher.js.map +1 -1
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/foo/constants.js +1 -1
- package/src/plugins/foo/constants.js.map +1 -1
- package/src/plugins/native-stake/activeValidatorsJob.js +9 -4
- package/src/plugins/native-stake/activeValidatorsJob.js.map +1 -1
- package/src/plugins/native-stake/aptosFetcher.js +5 -3
- package/src/plugins/native-stake/aptosFetcher.js.map +1 -1
- package/src/plugins/pancakeswap/aptosLpJob.js +22 -17
- package/src/plugins/pancakeswap/aptosLpJob.js.map +1 -1
- package/src/plugins/staratlas/constants.d.ts +12 -0
- package/src/plugins/staratlas/constants.js +22 -0
- package/src/plugins/staratlas/constants.js.map +1 -0
- package/src/plugins/staratlas/helpers.d.ts +4 -0
- package/src/plugins/staratlas/helpers.js +26 -0
- package/src/plugins/staratlas/helpers.js.map +1 -0
- package/src/plugins/staratlas/index.d.ts +6 -0
- package/src/plugins/staratlas/index.js +13 -0
- package/src/plugins/staratlas/index.js.map +1 -0
- package/src/plugins/{tokens/fetchers/aptos-nfts.d.ts → staratlas/lockersFetcher.d.ts} +1 -1
- package/src/plugins/staratlas/lockersFetcher.js +54 -0
- package/src/plugins/staratlas/lockersFetcher.js.map +1 -0
- package/src/plugins/staratlas/stakingFetcher.d.ts +3 -0
- package/src/plugins/staratlas/stakingFetcher.js +64 -0
- package/src/plugins/staratlas/stakingFetcher.js.map +1 -0
- package/src/plugins/staratlas/structs.d.ts +33 -0
- package/src/plugins/staratlas/structs.js +34 -0
- package/src/plugins/staratlas/structs.js.map +1 -0
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/thala/constants.d.ts +3 -10
- package/src/plugins/thala/constants.js +4 -4
- package/src/plugins/thala/constants.js.map +1 -1
- package/src/plugins/thala/stabilityPoolFetcher.js +4 -1
- package/src/plugins/thala/stabilityPoolFetcher.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/utils/aptos/getAccountCoinsData.d.ts +26 -0
- package/src/utils/aptos/getAccountCoinsData.js +10 -0
- package/src/utils/aptos/getAccountCoinsData.js.map +1 -0
- package/src/utils/aptos/getAccountResource.d.ts +2 -3
- package/src/utils/aptos/getAccountResource.js +4 -1
- package/src/utils/aptos/getAccountResource.js.map +1 -1
- package/src/utils/aptos/getAccountResources.d.ts +2 -5
- package/src/utils/aptos/getAccountResources.js +3 -1
- package/src/utils/aptos/getAccountResources.js.map +1 -1
- package/src/utils/aptos/getCoinInfoResource.d.ts +2 -2
- package/src/utils/aptos/getCoinStoreResource.d.ts +2 -2
- package/src/utils/aptos/getCoinStoreResources.d.ts +2 -5
- package/src/utils/aptos/getDecimals.d.ts +1 -1
- package/src/utils/aptos/getDecimals.js +1 -1
- package/src/utils/aptos/getDecimals.js.map +1 -1
- package/src/utils/aptos/getNestedType.d.ts +4 -0
- package/src/utils/aptos/getNestedType.js +4 -0
- package/src/utils/aptos/getNestedType.js.map +1 -1
- package/src/utils/aptos/getTableItem.d.ts +3 -3
- package/src/utils/aptos/getTableItem.js +1 -1
- package/src/utils/aptos/getTableItem.js.map +1 -1
- package/src/utils/aptos/getTableItemsByHandles.d.ts +3 -3
- package/src/utils/aptos/getTableItemsByHandles.js.map +1 -1
- package/src/utils/aptos/getTableItemsByKeys.d.ts +2 -2
- package/src/utils/aptos/getView.d.ts +3 -3
- package/src/utils/aptos/getView.js +1 -1
- package/src/utils/aptos/getView.js.map +1 -1
- package/src/utils/aptos/types.d.ts +0 -10
- package/src/utils/blank/isBlankAddressAptos.js +5 -1
- package/src/utils/blank/isBlankAddressAptos.js.map +1 -1
- package/src/utils/clients/constants.js +1 -1
- package/src/utils/clients/constants.js.map +1 -1
- package/src/utils/clients/getClientAptos.d.ts +1 -1
- package/src/utils/clients/getClientAptos.js +8 -3
- package/src/utils/clients/getClientAptos.js.map +1 -1
- package/src/utils/clients/types.d.ts +2 -0
- package/src/utils/misc/checkComputeAndStoreTokensPrices.d.ts +8 -0
- package/src/utils/misc/checkComputeAndStoreTokensPrices.js +8 -0
- package/src/utils/misc/checkComputeAndStoreTokensPrices.js.map +1 -1
- package/src/utils/misc/getDecimalsForToken.js +5 -3
- package/src/utils/misc/getDecimalsForToken.js.map +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/plugins/tokens/fetchers/aptos-nfts.js +0 -117
- package/src/plugins/tokens/fetchers/aptos-nfts.js.map +0 -1
@@ -24,7 +24,7 @@ function getUrlEndpoints() {
|
|
24
24
|
'https://api.avax.network/ext/bc/C/rpc',
|
25
25
|
polygon: process.env['PORTFOLIO_POLYGON_RPC'] || 'https://1rpc.io/matic',
|
26
26
|
aptos: process.env['PORTFOLIO_APTOS_RPC'] ||
|
27
|
-
'https://
|
27
|
+
'https://api.mainnet.aptoslabs.com/v1',
|
28
28
|
sui: process.env['PORTFOLIO_SUI_RPC'] || 'https://sui-rpc.publicnode.com',
|
29
29
|
};
|
30
30
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/constants.ts"],"names":[],"mappings":";;;;;;AAKA,wCAAsE;AACtE,0EAAkD;AAErC,QAAA,qBAAqB,GAAoC;IACpE,QAAQ,EAAE,gBAAO;IACjB,SAAS,EAAT,kBAAS;IACT,OAAO,EAAP,gBAAO;IACP,GAAG,EAAE,YAAG;CACT,CAAC;AAEF,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,+BAA+B;QACxE,OAAO,EACL,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,+BAA+B;QACzE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,8BAA8B;QACvE,MAAM,EACJ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;YACnC,qCAAqC;QACvC,QAAQ,EACN,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,0BAA0B;QACrE,SAAS,EACP,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;YACtC,uCAAuC;QACzC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,uBAAuB;QACxE,KAAK,EACH,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAClC,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/constants.ts"],"names":[],"mappings":";;;;;;AAKA,wCAAsE;AACtE,0EAAkD;AAErC,QAAA,qBAAqB,GAAoC;IACpE,QAAQ,EAAE,gBAAO;IACjB,SAAS,EAAT,kBAAS;IACT,OAAO,EAAP,gBAAO;IACP,GAAG,EAAE,YAAG;CACT,CAAC;AAEF,SAAgB,eAAe;IAC7B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,+BAA+B;QACxE,OAAO,EACL,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,+BAA+B;QACzE,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,8BAA8B;QACvE,MAAM,EACJ,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC;YACnC,qCAAqC;QACvC,QAAQ,EACN,OAAO,CAAC,GAAG,CAAC,wBAAwB,CAAC,IAAI,0BAA0B;QACrE,SAAS,EACP,OAAO,CAAC,GAAG,CAAC,yBAAyB,CAAC;YACtC,uCAAuC;QACzC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC,IAAI,uBAAuB;QACxE,KAAK,EACH,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;YAClC,sCAAsC;QACxC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,IAAI,gCAAgC;KAC1E,CAAC;AACJ,CAAC;AApBD,0CAoBC;AAED,SAAgB,cAAc,CAAC,SAAwB;IACrD,OAAO,eAAe,EAAE,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAFD,wCAEC;AAED,SAAgB,eAAe;IAC7B,MAAM,YAAY,GAAG,eAAe,EAAE,CAAC;IACvC,OAAO,MAAM,CAAC,WAAW,CACvB,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC;QACjD,GAAG;QACH,IAAA,0BAAgB,EAAC,KAAK,CAAC;KACxB,CAAC,CACmC,CAAC;AAC1C,CAAC;AARD,0CAQC;AAED,SAAgB,cAAc,CAAC,SAAwB;IACrD,OAAO,eAAe,EAAE,CAAC,SAAS,CAAC,CAAC;AACtC,CAAC;AAFD,wCAEC"}
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { AptosClient } from '
|
1
|
+
import { AptosClient } from './types';
|
2
2
|
export default function getClientAptos(): AptosClient;
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
4
|
-
const
|
4
|
+
const ts_sdk_1 = require("@aptos-labs/ts-sdk");
|
5
5
|
const constants_1 = require("./constants");
|
6
6
|
const getBasicAuthHeaders_1 = require("../misc/getBasicAuthHeaders");
|
7
7
|
function getClientAptos() {
|
@@ -10,9 +10,14 @@ function getClientAptos() {
|
|
10
10
|
const headers = rpcEndpoint.basicAuth
|
11
11
|
? (0, getBasicAuthHeaders_1.getBasicAuthHeaders)((_a = rpcEndpoint.basicAuth) === null || _a === void 0 ? void 0 : _a.username, (_b = rpcEndpoint.basicAuth) === null || _b === void 0 ? void 0 : _b.password)
|
12
12
|
: undefined;
|
13
|
-
|
14
|
-
|
13
|
+
const config = new ts_sdk_1.AptosConfig({
|
14
|
+
network: ts_sdk_1.Network.MAINNET,
|
15
|
+
clientConfig: {
|
16
|
+
HEADERS: headers,
|
17
|
+
},
|
18
|
+
fullnode: rpcEndpoint.url,
|
15
19
|
});
|
20
|
+
return new ts_sdk_1.Aptos(config);
|
16
21
|
}
|
17
22
|
exports.default = getClientAptos;
|
18
23
|
//# sourceMappingURL=getClientAptos.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getClientAptos.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/getClientAptos.ts"],"names":[],"mappings":";;AAAA,+DAAuD;AACvD
|
1
|
+
{"version":3,"file":"getClientAptos.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/getClientAptos.ts"],"names":[],"mappings":";;AAAA,+DAAuD;AACvD,+CAAiE;AACjE,2CAA6C;AAC7C,qEAAkE;AAGlE,SAAwB,cAAc;;IACpC,MAAM,WAAW,GAAG,IAAA,0BAAc,EAAC,0BAAS,CAAC,KAAK,CAAC,CAAC;IACpD,MAAM,OAAO,GAAG,WAAW,CAAC,SAAS;QACnC,CAAC,CAAC,IAAA,yCAAmB,EACjB,MAAA,WAAW,CAAC,SAAS,0CAAE,QAAQ,EAC/B,MAAA,WAAW,CAAC,SAAS,0CAAE,QAAQ,CAChC;QACH,CAAC,CAAC,SAAS,CAAC;IACd,MAAM,MAAM,GAAG,IAAI,oBAAW,CAAC;QAC7B,OAAO,EAAE,gBAAO,CAAC,OAAO;QACxB,YAAY,EAAE;YACZ,OAAO,EAAE,OAAO;SACjB;QACD,QAAQ,EAAE,WAAW,CAAC,GAAG;KAC1B,CAAC,CAAC;IACH,OAAO,IAAI,cAAK,CAAC,MAAM,CAAC,CAAC;AAC3B,CAAC;AAhBD,iCAgBC"}
|
@@ -1,6 +1,8 @@
|
|
1
|
+
import { Aptos } from '@aptos-labs/ts-sdk';
|
1
2
|
import { SuiClient as MystenSuiClient } from '@mysten/sui.js/client';
|
2
3
|
import { Connection } from '@solana/web3.js';
|
3
4
|
import { PublicClient } from 'viem';
|
4
5
|
export type EvmClient = PublicClient;
|
5
6
|
export type SuiClient = MystenSuiClient;
|
6
7
|
export type SolanaClient = Connection;
|
8
|
+
export type AptosClient = Aptos;
|
@@ -23,6 +23,14 @@ export type PartialTokenUnderlying = {
|
|
23
23
|
* If you think other tokens should be added to this list, please send a PR.
|
24
24
|
*/
|
25
25
|
export declare const tokensToRelyOnByNetwork: Map<NetworkIdType, string[]>;
|
26
|
+
/**
|
27
|
+
* @deprecated
|
28
|
+
* This function has been deprecated. Use the getLpUnderlyingTokenSource instead.
|
29
|
+
* This list is used to avoid calulating low liquidity tokens with others low liquidity tokens.
|
30
|
+
* To prevent wrong prices (with very low precision) to be calculated, we setup a list of tokens to rely on.
|
31
|
+
* These tokens have very low chance of having price manipulation.
|
32
|
+
* Therefore, they can be safely used to compute other tokens prices.
|
33
|
+
*/
|
26
34
|
export default function checkComputeAndStoreTokensPrices(cache: Cache, source: string, networkId: NetworkIdType, tokenX: TokenInfo, tokenY: TokenInfo): Promise<{
|
27
35
|
partialTokenUnderlyingX: PartialTokenUnderlying;
|
28
36
|
partialTokenUnderlyingY: PartialTokenUnderlying;
|
@@ -66,6 +66,14 @@ exports.tokensToRelyOnByNetwork = new Map([
|
|
66
66
|
],
|
67
67
|
],
|
68
68
|
]);
|
69
|
+
/**
|
70
|
+
* @deprecated
|
71
|
+
* This function has been deprecated. Use the getLpUnderlyingTokenSource instead.
|
72
|
+
* This list is used to avoid calulating low liquidity tokens with others low liquidity tokens.
|
73
|
+
* To prevent wrong prices (with very low precision) to be calculated, we setup a list of tokens to rely on.
|
74
|
+
* These tokens have very low chance of having price manipulation.
|
75
|
+
* Therefore, they can be safely used to compute other tokens prices.
|
76
|
+
*/
|
69
77
|
function checkComputeAndStoreTokensPrices(cache, source, networkId, tokenX, tokenY) {
|
70
78
|
return __awaiter(this, void 0, void 0, function* () {
|
71
79
|
const tokensToRelyOn = exports.tokensToRelyOnByNetwork.get(networkId);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"checkComputeAndStoreTokensPrices.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/checkComputeAndStoreTokensPrices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,wEAAgD;AAChD,+DAA4D;AAC5D,8DAAsE;AAetE;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAAiC,IAAI,GAAG,CAAC;IAC3E;QACE,0BAAS,CAAC,GAAG;QACb;YACE,yBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO;YAC3B,sEAAsE,EAAE,OAAO;YAC/E,qHAAqH,EAAE,SAAS;SACjI;KACF;IACD;QACE,0BAAS,CAAC,MAAM;QAChB;YACE,yBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO;YAC9B,2CAA0B,EAAE,OAAO;YACnC,8CAA8C,EAAE,WAAW;YAC3D,6CAA6C,EAAE,OAAO;YACtD,8CAA8C,EAAE,WAAW;YAC3D,8CAA8C,EAAE,OAAO;YACvD,8CAA8C,EAAE,OAAO;SACxD;KACF;IACD;QACE,0BAAS,CAAC,KAAK;QACf;YACE,yBAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;YAC7B,6EAA6E,EAAE,SAAS;YACxF,mFAAmF,EAAE,oBAAoB;SAC1G;KACF;IACD;QACE,0BAAS,CAAC,GAAG;QACb;YACE,yBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO;YAC3B,gFAAgF,EAAE,SAAS;YAC3F,iFAAiF,EAAE,QAAQ;YAC3F,eAAe;SAChB;KACF;CACF,CAAC,CAAC;AAEH,SAA8B,gCAAgC,CAC5D,KAAY,EACZ,MAAc,EACd,SAAwB,EACxB,MAAiB,EACjB,MAAiB;;QA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AAO,SAAS,CAAC;IACnB,CAAC;CAAA;AArID,mDAqIC"}
|
1
|
+
{"version":3,"file":"checkComputeAndStoreTokensPrices.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/checkComputeAndStoreTokensPrices.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,+DAMoC;AAGpC,wEAAgD;AAChD,+DAA4D;AAC5D,8DAAsE;AAetE;;;;;;;;;GASG;AACU,QAAA,uBAAuB,GAAiC,IAAI,GAAG,CAAC;IAC3E;QACE,0BAAS,CAAC,GAAG;QACb;YACE,yBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO;YAC3B,sEAAsE,EAAE,OAAO;YAC/E,qHAAqH,EAAE,SAAS;SACjI;KACF;IACD;QACE,0BAAS,CAAC,MAAM;QAChB;YACE,yBAAQ,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO;YAC9B,2CAA0B,EAAE,OAAO;YACnC,8CAA8C,EAAE,WAAW;YAC3D,6CAA6C,EAAE,OAAO;YACtD,8CAA8C,EAAE,WAAW;YAC3D,8CAA8C,EAAE,OAAO;YACvD,8CAA8C,EAAE,OAAO;SACxD;KACF;IACD;QACE,0BAAS,CAAC,KAAK;QACf;YACE,yBAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO;YAC7B,6EAA6E,EAAE,SAAS;YACxF,mFAAmF,EAAE,oBAAoB;SAC1G;KACF;IACD;QACE,0BAAS,CAAC,GAAG;QACb;YACE,yBAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,OAAO;YAC3B,gFAAgF,EAAE,SAAS;YAC3F,iFAAiF,EAAE,QAAQ;YAC3F,eAAe;SAChB;KACF;CACF,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,SAA8B,gCAAgC,CAC5D,KAAY,EACZ,MAAc,EACd,SAAwB,EACxB,MAAiB,EACjB,MAAiB;;QAQjB,MAAM,cAAc,GAAG,+BAAuB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;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 @@ function getDecimalsForToken(cache, address, networkId) {
|
|
40
40
|
case 'aptos': {
|
41
41
|
const client = (0, clients_1.getClientAptos)();
|
42
42
|
const viewRes = (yield client.view({
|
43
|
-
|
44
|
-
|
45
|
-
|
43
|
+
payload: {
|
44
|
+
function: aptos_1.coinDecimals,
|
45
|
+
typeArguments: [address],
|
46
|
+
functionArguments: [],
|
47
|
+
},
|
46
48
|
}));
|
47
49
|
if (viewRes.length !== 1)
|
48
50
|
return undefined;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDecimalsForToken.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getDecimalsForToken.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+DAMoC;AACpC,6CAA4C;AAC5C,uCAAiD;AACjD,wCAKoB;AACpB,oCAAwC;AACxC,oDAAsD;AACtD,gCAAsD;AAEtD,8DAAyE;AAGzE,MAAM,QAAQ,GAAG,CAAC,oCAAmB,EAAE,2CAA0B,CAAC,CAAC;AAEnE;;;;;;;;GAQG;AACH,SAAsB,mBAAmB,CACvC,KAAY,EACZ,OAAe,EACf,SAAwB;;QAExB,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CACtC,IAAA,mCAAkB,EAAC,OAAO,EAAE,SAAS,CAAC,EACtC;YACE,MAAM,EAAE,mCAAuB;YAC/B,SAAS;SACV,CACF,CAAC;QACF,IAAI,YAAY;YAAE,OAAO,YAAY,CAAC,QAAQ,CAAC;QAE/C,QAAQ,SAAS,EAAE,CAAC;YAClB,KAAK,OAAO,CAAC,CAAC,CAAC;gBACb,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;gBAChC,MAAM,OAAO,GAAG,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC;oBACjC,QAAQ,EAAE,oBAAY;
|
1
|
+
{"version":3,"file":"getDecimalsForToken.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/misc/getDecimalsForToken.ts"],"names":[],"mappings":";;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AC,CAAC;gBACzE,IAAI,YAAY;oBAAE,OAAO,YAAY,CAAC,QAAQ,CAAC;gBAC/C,OAAO,SAAS,CAAC;YACnB,CAAC;YACD;gBACE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;QACnE,CAAC;IACH,CAAC;CAAA;AAnED,kDAmEC"}
|
@@ -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;
|
@@ -1,117 +0,0 @@
|
|
1
|
-
"use strict";
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
-
});
|
10
|
-
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
15
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
16
|
-
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
17
|
-
const aptos_1 = require("aptos");
|
18
|
-
const runInBatch_1 = __importDefault(require("../../../utils/misc/runInBatch"));
|
19
|
-
const getImagefromUri_1 = require("../../../utils/misc/getImagefromUri");
|
20
|
-
const constants_1 = require("../constants");
|
21
|
-
const prefix = 'nft-images-aptos';
|
22
|
-
const noImageValue = 'noimage';
|
23
|
-
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
24
|
-
const provider = new aptos_1.Provider(aptos_1.Network.MAINNET);
|
25
|
-
const ownedTokensRes = yield provider.getOwnedTokens(owner);
|
26
|
-
const nfts = ownedTokensRes.current_token_ownerships_v2.filter((nft) => nft.current_token_data);
|
27
|
-
const cachedImages = yield cache.getItems(nfts
|
28
|
-
.map((o) => (o.current_token_data ? o.current_token_data.token_uri : []))
|
29
|
-
.flat(), {
|
30
|
-
prefix,
|
31
|
-
networkId: portfolio_core_1.NetworkId.aptos,
|
32
|
-
});
|
33
|
-
const images = new Map();
|
34
|
-
const missings = [];
|
35
|
-
nfts.forEach((o, i) => __awaiter(void 0, void 0, void 0, function* () {
|
36
|
-
if (!o.current_token_data)
|
37
|
-
return;
|
38
|
-
const cachedImage = cachedImages[i];
|
39
|
-
const address = o.current_token_data.token_uri;
|
40
|
-
if (cachedImage) {
|
41
|
-
images.set(address, cachedImage);
|
42
|
-
}
|
43
|
-
else
|
44
|
-
missings.push(o);
|
45
|
-
}));
|
46
|
-
const res = yield (0, runInBatch_1.default)(missings.map((o) => () => { var _a; return (0, getImagefromUri_1.getImagefromUri)((_a = o.current_token_data) === null || _a === void 0 ? void 0 : _a.token_uri, portfolio_core_1.NetworkId.aptos, cache); }), 10);
|
47
|
-
const promises = res.map((r, i) => {
|
48
|
-
var _a;
|
49
|
-
const image = r.status !== 'rejected' ? r.value : undefined;
|
50
|
-
const address = (_a = missings[i].current_token_data) === null || _a === void 0 ? void 0 : _a.token_uri;
|
51
|
-
if (!address)
|
52
|
-
return undefined;
|
53
|
-
if (r.status === 'rejected' || !image) {
|
54
|
-
return cache.setItem(address, noImageValue, {
|
55
|
-
prefix,
|
56
|
-
networkId: portfolio_core_1.NetworkId.aptos,
|
57
|
-
});
|
58
|
-
}
|
59
|
-
images.set(address, image);
|
60
|
-
return cache.setItem(address, image, {
|
61
|
-
prefix,
|
62
|
-
networkId: portfolio_core_1.NetworkId.aptos,
|
63
|
-
});
|
64
|
-
});
|
65
|
-
yield Promise.allSettled(promises);
|
66
|
-
const assets = nfts
|
67
|
-
.map((nft) => {
|
68
|
-
var _a;
|
69
|
-
if (!nft.current_token_data)
|
70
|
-
return [];
|
71
|
-
const address = nft.current_token_data.token_data_id;
|
72
|
-
const dataUri = nft.current_token_data.token_uri;
|
73
|
-
const { amount } = nft;
|
74
|
-
let image = images.get(dataUri);
|
75
|
-
if (image === noImageValue)
|
76
|
-
image = undefined;
|
77
|
-
return {
|
78
|
-
networkId: portfolio_core_1.NetworkId.aptos,
|
79
|
-
type: portfolio_core_1.PortfolioAssetType.collectible,
|
80
|
-
value: null,
|
81
|
-
attributes: {},
|
82
|
-
data: {
|
83
|
-
address,
|
84
|
-
amount,
|
85
|
-
dataUri,
|
86
|
-
price: null,
|
87
|
-
value: null,
|
88
|
-
floorPrice: null,
|
89
|
-
image,
|
90
|
-
imageUri: image,
|
91
|
-
name: nft.current_token_data.token_name,
|
92
|
-
collectionId: (_a = nft.current_token_data.current_collection) === null || _a === void 0 ? void 0 : _a.collection_id,
|
93
|
-
},
|
94
|
-
};
|
95
|
-
})
|
96
|
-
.flat();
|
97
|
-
if (assets.length === 0)
|
98
|
-
return [];
|
99
|
-
const element = {
|
100
|
-
type: portfolio_core_1.PortfolioElementType.multiple,
|
101
|
-
networkId: portfolio_core_1.NetworkId.aptos,
|
102
|
-
platformId: constants_1.walletNftsPlatform.id,
|
103
|
-
label: 'Wallet',
|
104
|
-
value: null,
|
105
|
-
data: {
|
106
|
-
assets,
|
107
|
-
},
|
108
|
-
};
|
109
|
-
return [element];
|
110
|
-
});
|
111
|
-
const fetcher = {
|
112
|
-
id: `${constants_1.walletNftsPlatform.id}-${portfolio_core_1.NetworkId.aptos}`,
|
113
|
-
networkId: portfolio_core_1.NetworkId.sui,
|
114
|
-
executor,
|
115
|
-
};
|
116
|
-
exports.default = fetcher;
|
117
|
-
//# sourceMappingURL=aptos-nfts.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"aptos-nfts.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/aptos-nfts.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,uDAAuD;AACvD,+DAMoC;AACpC,iCAA0C;AAG1C,gFAAwD;AACxD,yEAAsE;AACtE,4CAAkD;AAElD,MAAM,MAAM,GAAG,kBAAkB,CAAC;AAClC,MAAM,YAAY,GAAG,SAAS,CAAC;AA2C/B,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,QAAQ,GAAG,IAAI,gBA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