@sonarwatch/portfolio-plugins 0.11.139 → 0.11.141
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 +3 -3
- package/src/plugins/aptin/depositsFetcher.js +9 -9
- package/src/plugins/aptin/depositsFetcher.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/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/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 +9 -1
- package/src/utils/misc/checkComputeAndStoreTokensPrices.js.map +1 -1
- package/src/utils/misc/getDecimalsForToken.d.ts +1 -1
- package/src/utils/misc/getDecimalsForToken.js +9 -22
- package/src/utils/misc/getDecimalsForToken.js.map +1 -1
- package/src/utils/solana/getMultipleDecimals.js +2 -13
- package/src/utils/solana/getMultipleDecimals.js.map +1 -1
- package/src/utils/solana/getMultipleDecimalsAsMap.d.ts +3 -0
- package/src/utils/solana/getMultipleDecimalsAsMap.js +39 -0
- package/src/utils/solana/getMultipleDecimalsAsMap.js.map +1 -0
- package/src/utils/sui/getDecimals.d.ts +2 -0
- package/src/utils/sui/getDecimals.js +22 -0
- package/src/utils/sui/getDecimals.js.map +1 -0
- package/src/plugins/tokens/fetchers/aptos-nfts.d.ts +0 -3
- package/src/plugins/tokens/fetchers/aptos-nfts.js +0 -117
- package/src/plugins/tokens/fetchers/aptos-nfts.js.map +0 -1
package/CHANGELOG.md
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
This file was generated using [@jscutlery/semver](https://github.com/jscutlery/semver).
|
4
4
|
|
5
|
+
## [0.11.141](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.140...plugins-0.11.141) (2024-03-21)
|
6
|
+
|
7
|
+
|
8
|
+
|
9
|
+
## [0.11.140](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.139...plugins-0.11.140) (2024-03-21)
|
10
|
+
|
11
|
+
|
12
|
+
|
5
13
|
## [0.11.139](https://github.com/sonarwatch/portfolio/compare/plugins-0.11.138...plugins-0.11.139) (2024-03-21)
|
6
14
|
|
7
15
|
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sonarwatch/portfolio-plugins",
|
3
|
-
"version": "0.11.
|
3
|
+
"version": "0.11.141",
|
4
4
|
"type": "commonjs",
|
5
5
|
"generators": "./generators.json",
|
6
6
|
"dependencies": {
|
7
7
|
"@aave/contract-helpers": "^1.18.3",
|
8
8
|
"@aave/math-utils": "^1.18.3",
|
9
|
+
"@aptos-labs/ts-sdk": "^1.10.0",
|
9
10
|
"@bonfida/spl-name-service": "^1.0.10",
|
10
11
|
"@cosmjs/cosmwasm-stargate": "^0.31.1",
|
11
12
|
"@ethersproject/address": "^5.7.0",
|
@@ -23,7 +24,6 @@
|
|
23
24
|
"@sei-js/core": "^3.0.1",
|
24
25
|
"@sei-js/proto": "^3.0.1",
|
25
26
|
"@solana/web3.js": "^1.89.1",
|
26
|
-
"aptos": "^1.13.1",
|
27
27
|
"axios": "^1.4.0",
|
28
28
|
"bignumber.js": "^9.1.1",
|
29
29
|
"bitcoin-address-validation": "^2.2.1",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"web3-v1": "npm:web3@^1.5.0"
|
42
42
|
},
|
43
43
|
"peerDependencies": {
|
44
|
-
"@sonarwatch/portfolio-core": "0.11.
|
44
|
+
"@sonarwatch/portfolio-core": "0.11.141"
|
45
45
|
},
|
46
46
|
"main": "./src/index.js",
|
47
47
|
"types": "./src/index.d.ts"
|
@@ -23,8 +23,8 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
23
23
|
const poolPositions = yield (0, aptos_1.getAccountResource)(client, owner, constants_1.poolPositionsType);
|
24
24
|
if (!poolPositions)
|
25
25
|
return [];
|
26
|
-
if (poolPositions.
|
27
|
-
poolPositions.
|
26
|
+
if (poolPositions.supply_coins.length === 0 &&
|
27
|
+
poolPositions.borrow_coins.length === 0)
|
28
28
|
return [];
|
29
29
|
const configStores = yield cache.getItem(constants_1.configStoresKey, {
|
30
30
|
prefix: constants_1.platformId,
|
@@ -32,12 +32,12 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
32
32
|
});
|
33
33
|
if (!configStores)
|
34
34
|
return [];
|
35
|
-
const supplyPositions = poolPositions.
|
35
|
+
const supplyPositions = poolPositions.supply_coins.length === 0
|
36
36
|
? []
|
37
|
-
: yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.
|
38
|
-
const borrowPositions = poolPositions.
|
37
|
+
: yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.supply_position.handle, poolPositions.supply_coins, '0x1::string::String', '0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::SupplyPosition');
|
38
|
+
const borrowPositions = poolPositions.borrow_coins.length === 0
|
39
39
|
? []
|
40
|
-
: yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.
|
40
|
+
: yield (0, aptos_1.getTableItemsByKeys)(client, poolPositions.borrow_position.handle, poolPositions.borrow_coins, '0x1::string::String', '0x3c1d4a86594d681ff7e5d5a233965daeabdc6a15fe5672ceeda5260038857183::pool::BorrowPosition');
|
41
41
|
const borrowedAssets = [];
|
42
42
|
const borrowedYields = [];
|
43
43
|
const suppliedAssets = [];
|
@@ -45,7 +45,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
45
45
|
const rewardAssets = [];
|
46
46
|
const suppliedLtvs = [];
|
47
47
|
// Token prices
|
48
|
-
const tokenPricesRes = yield cache.getTokenPrices([...poolPositions.
|
48
|
+
const tokenPricesRes = yield cache.getTokenPrices([...poolPositions.supply_coins, ...poolPositions.borrow_coins], portfolio_core_1.NetworkId.aptos);
|
49
49
|
const tokenPrices = {};
|
50
50
|
tokenPricesRes.forEach((tp) => {
|
51
51
|
if (!tp)
|
@@ -58,7 +58,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
58
58
|
continue;
|
59
59
|
if (supplyPosition.amount === '0')
|
60
60
|
continue;
|
61
|
-
const coinType = poolPositions.
|
61
|
+
const coinType = poolPositions.supply_coins[i];
|
62
62
|
const address = (0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.aptos);
|
63
63
|
const { decimals, ltv } = configStores[coinType];
|
64
64
|
const amount = new bignumber_js_1.default(supplyPosition.amount)
|
@@ -74,7 +74,7 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
74
74
|
continue;
|
75
75
|
if (borrowPosition.amount === '0')
|
76
76
|
continue;
|
77
|
-
const coinType = poolPositions.
|
77
|
+
const coinType = poolPositions.borrow_coins[i];
|
78
78
|
const address = (0, portfolio_core_1.formatTokenAddress)(coinType, portfolio_core_1.NetworkId.aptos);
|
79
79
|
const { decimals } = configStores[coinType];
|
80
80
|
const amount = new bignumber_js_1.default(borrowPosition.amount)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA6E;AAO7E,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAkB,EAC5C,MAAM,EACN,KAAK,EACL,6BAAiB,CAClB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,IACE,aAAa,CAAC,
|
1
|
+
{"version":3,"file":"depositsFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/aptin/depositsFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DASoC;AACpC,gEAAqC;AAGrC,2CAA6E;AAO7E,qGAA6E;AAC7E,iDAAqD;AACrD,6CAA4E;AAE5E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAEhC,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAkB,EAC5C,MAAM,EACN,KAAK,EACL,6BAAiB,CAClB,CAAC;IACF,IAAI,CAAC,aAAa;QAAE,OAAO,EAAE,CAAC;IAC9B,IACE,aAAa,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QACvC,aAAa,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QAEvC,OAAO,EAAE,CAAC;IAEZ,MAAM,YAAY,GAAG,MAAM,KAAK,CAAC,OAAO,CAAe,2BAAe,EAAE;QACtE,MAAM,EAAE,sBAAU;QAClB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;IACH,IAAI,CAAC,YAAY;QAAE,OAAO,EAAE,CAAC;IAE7B,MAAM,eAAe,GACnB,aAAa,CAAC,YAAY,CAAC,MAAM,KAAK,CAAC;QACrC,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,MAAM,IAAA,2BAAmB,EACvB,MAAM,EACN,aAAa,CAAC,eAAe,CAAC,MAAM,EACpC,aAAa,CAAC,YAAY,EAC1B,qBAAqB,EACrB,0FAA0F,CAC3F,CAAC;IACR,MAAM,eAAe,GACnB,aAAa,CAAC,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AAA,gCAAsB,EACpB,QAAQ,EACR,MAAM,EACN,0BAAS,CAAC,KAAK,EACf,WAAW,CAAC,OAAO,CAAC,IAAI,SAAS,CAClC,CACF,CAAC;QACF,cAAc,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC1B,CAAC;IAED,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,GACrE,IAAA,wCAAuB,EACrB,cAAc,EACd,cAAc,EACd,YAAY,EACZ,YAAY,CACb,CAAC;IAEJ,MAAM,OAAO,GAAqB;QAChC,IAAI,EAAE,qCAAoB,CAAC,UAAU;QACrC,SAAS,EAAE,0BAAS,CAAC,KAAK;QAC1B,UAAU,EAAV,sBAAU;QACV,KAAK,EAAE,SAAS;QAChB,KAAK;QACL,IAAI,EAAE;YACJ,cAAc;YACd,aAAa;YACb,cAAc;YACd,cAAc;YACd,aAAa;YACb,cAAc;YACd,eAAe,EAAE,IAAI;YACrB,WAAW;YACX,YAAY;YACZ,WAAW;YACX,KAAK;SACN;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -14,16 +14,21 @@ const clients_1 = require("../../utils/clients");
|
|
14
14
|
const constants_1 = require("./constants");
|
15
15
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
16
16
|
const client = (0, clients_1.getClientAptos)();
|
17
|
-
const resources = (yield client.getAccountResource(
|
17
|
+
const resources = (yield client.getAccountResource({
|
18
|
+
accountAddress: '0x1',
|
19
|
+
resourceType: '0x1::stake::ValidatorSet',
|
20
|
+
}));
|
18
21
|
const activeValidators = resources.data.active_validators;
|
19
22
|
const validatorsWithStake = [];
|
20
23
|
for (let i = 0; i < activeValidators.length; i++) {
|
21
24
|
const validator = activeValidators[i];
|
22
25
|
const hasStake = yield client
|
23
26
|
.view({
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
+
payload: {
|
28
|
+
function: '0x1::delegation_pool::operator_commission_percentage',
|
29
|
+
typeArguments: [],
|
30
|
+
functionArguments: [validator.addr],
|
31
|
+
},
|
27
32
|
})
|
28
33
|
.catch(() => { });
|
29
34
|
if (hasStake)
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"activeValidatorsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/native-stake/activeValidatorsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAqD;AACrD,2CAA0E;AAG1E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,
|
1
|
+
{"version":3,"file":"activeValidatorsJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/native-stake/activeValidatorsJob.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAAuD;AAGvD,iDAAqD;AACrD,2CAA0E;AAG1E,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,CAAC,MAAM,MAAM,CAAC,kBAAkB,CAAC;QACjD,cAAc,EAAE,KAAK;QACrB,YAAY,EAAE,0BAA0B;KACzC,CAAC,CAAiB,CAAC;IACpB,MAAM,gBAAgB,GAAG,SAAS,CAAC,IAAI,CAAC,iBAAiB,CAAC;IAC1D,MAAM,mBAAmB,GAAa,EAAE,CAAC;IACzC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,gBAAgB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACjD,MAAM,SAAS,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG,MAAM,MAAM;aAC1B,IAAI,CAAC;YACJ,OAAO,EAAE;gBACP,QAAQ,EAAE,sDAAsD;gBAChE,aAAa,EAAE,EAAE;gBACjB,iBAAiB,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC;aACpC;SACF,CAAC;aACD,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACnB,IAAI,QAAQ;YAAE,mBAAmB,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,KAAK,CAAC,OAAO,CAAC,yBAAa,EAAE,mBAAmB,EAAE;QACtD,MAAM,EAAE,4BAAgB;QACxB,SAAS,EAAE,0BAAS,CAAC,KAAK;KAC3B,CAAC,CAAC;AACL,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,oBAAoB;IACrC,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -32,9 +32,11 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
32
32
|
for (let i = 0; i < activeValidators.length; i++) {
|
33
33
|
const validatorAddress = activeValidators[i];
|
34
34
|
const stakedValuesInValidator = (yield client.view({
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
payload: {
|
36
|
+
function: '0x1::delegation_pool::get_stake',
|
37
|
+
typeArguments: [],
|
38
|
+
functionArguments: [validatorAddress, owner],
|
39
|
+
},
|
38
40
|
}));
|
39
41
|
const amount = stakedValuesInValidator
|
40
42
|
.filter((item) => item !== '0')
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/native-stake/aptosFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;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U,CACX,CAAC;QACF,QAAQ,CAAC,IAAI,CAAC;YACZ,SAAS,EAAE,0BAAS,CAAC,KAAK;YAC1B,UAAU,EAAE,+BAAmB,CAAC,EAAE;YAClC,IAAI,EAAE,UAAU;YAChB,KAAK,EAAE,QAAQ;YACf,IAAI,EAAE,CAAC,cAAc,CAAC;YACtB,KAAK,EAAE,KAAK,CAAC,KAAK;YAClB,IAAI,EAAE;gBACJ,MAAM,EAAE,CAAC,KAAK,CAAC;aAChB;SACF,CAAC,CAAC;IACL,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,QAAQ;IACzB,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -17,12 +17,11 @@ const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
|
17
17
|
const constants_1 = require("./constants");
|
18
18
|
const clients_1 = require("../../utils/clients");
|
19
19
|
const aptos_1 = require("../../utils/aptos");
|
20
|
-
const getTokensPricesMap_1 = __importDefault(require("../../utils/misc/getTokensPricesMap"));
|
21
20
|
const getLpUnderlyingTokenSource_1 = __importDefault(require("../../utils/misc/getLpUnderlyingTokenSource"));
|
22
|
-
const getDecimalsForToken_1 = require("../../utils/misc/getDecimalsForToken");
|
23
21
|
const getLpTokenSourceRaw_1 = __importDefault(require("../../utils/misc/getLpTokenSourceRaw"));
|
22
|
+
const getDecimals_1 = require("../../utils/aptos/getDecimals");
|
24
23
|
const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
25
|
-
var _a, _b, _c;
|
24
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
|
26
25
|
const client = (0, clients_1.getClientAptos)();
|
27
26
|
const resources = yield (0, aptos_1.getAccountResources)(client, constants_1.programAddress);
|
28
27
|
if (!resources)
|
@@ -31,34 +30,39 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
30
|
resources.forEach((resource) => {
|
32
31
|
resourcesByType.set(resource.type, resource);
|
33
32
|
});
|
34
|
-
const tokenPriceById = yield
|
33
|
+
const tokenPriceById = yield cache.getTokenPricesAsMap(resources
|
35
34
|
.map((ressource) => {
|
36
35
|
const { keys } = (0, aptos_1.parseTypeString)(ressource.type);
|
37
36
|
return keys ? keys.map((key) => key.type) : [];
|
38
37
|
})
|
39
|
-
.flat(), portfolio_core_1.NetworkId.aptos
|
38
|
+
.flat(), portfolio_core_1.NetworkId.aptos);
|
39
|
+
const lpSources = [];
|
40
40
|
for (let i = 0; i < resources.length; i++) {
|
41
41
|
const resource = resources[i];
|
42
42
|
if (!resource.type.startsWith(constants_1.lpCoinInfoTypePrefix))
|
43
43
|
continue;
|
44
|
-
const lpType = (0, aptos_1.
|
44
|
+
const lpType = (_b = (_a = (0, aptos_1.parseTypeString)(resource.type).keys) === null || _a === void 0 ? void 0 : _a.at(0)) === null || _b === void 0 ? void 0 : _b.type;
|
45
|
+
if (!lpType)
|
46
|
+
continue;
|
45
47
|
const lpInfoData = resource.data;
|
46
|
-
const lpSupplyString = (
|
48
|
+
const lpSupplyString = (_e = (_d = (_c = lpInfoData.supply) === null || _c === void 0 ? void 0 : _c.vec[0]) === null || _d === void 0 ? void 0 : _d.integer.vec[0]) === null || _e === void 0 ? void 0 : _e.value;
|
47
49
|
if (!lpSupplyString)
|
48
50
|
continue;
|
49
51
|
const lpDecimals = lpInfoData.decimals;
|
50
52
|
const lpSupply = new bignumber_js_1.default(lpSupplyString);
|
51
53
|
if (lpSupply.isZero())
|
52
54
|
continue;
|
53
|
-
const tokenPairId = (0, aptos_1.
|
55
|
+
const tokenPairId = (_f = (0, aptos_1.parseTypeString)(lpType)
|
56
|
+
.keys) === null || _f === void 0 ? void 0 : _f.map((t) => t.type).join(', ');
|
57
|
+
if (!tokenPairId)
|
58
|
+
continue;
|
54
59
|
// TODO : get ride of those by using parseTypeString() instead of getNestedType()
|
55
60
|
if (tokenPairId.includes('swap::LPToken') ||
|
56
61
|
tokenPairId.includes('LPCoinV1::LPCoin') ||
|
57
62
|
tokenPairId.includes('lp_coin::LP'))
|
58
63
|
continue;
|
59
|
-
const
|
60
|
-
const
|
61
|
-
const typeY = splits.at(1);
|
64
|
+
const typeX = (_h = (_g = (0, aptos_1.parseTypeString)(lpType).keys) === null || _g === void 0 ? void 0 : _g.at(0)) === null || _h === void 0 ? void 0 : _h.type;
|
65
|
+
const typeY = (_k = (_j = (0, aptos_1.parseTypeString)(lpType).keys) === null || _j === void 0 ? void 0 : _j.at(1)) === null || _k === void 0 ? void 0 : _k.type;
|
62
66
|
const tokenPairResource = resourcesByType.get(`${constants_1.programAddress}::swap::TokenPairMetadata<${tokenPairId}>`);
|
63
67
|
if (!tokenPairResource)
|
64
68
|
throw new Error(`Failed to get tokenPairResource: ${lpType}`);
|
@@ -73,12 +77,12 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
73
77
|
tokenPairData.balance_y.value === '0')
|
74
78
|
continue;
|
75
79
|
const [tokenPriceX, tokenPriceY] = [
|
76
|
-
tokenPriceById.get(typeX),
|
77
|
-
tokenPriceById.get(typeY),
|
80
|
+
tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(typeX, portfolio_core_1.NetworkId.aptos)),
|
81
|
+
tokenPriceById.get((0, portfolio_core_1.formatTokenAddress)(typeY, portfolio_core_1.NetworkId.aptos)),
|
78
82
|
];
|
79
83
|
const [decimalsX, decimalsY] = yield Promise.all([
|
80
|
-
(0,
|
81
|
-
(0,
|
84
|
+
(0, getDecimals_1.getDecimals)(client, typeX),
|
85
|
+
(0, getDecimals_1.getDecimals)(client, typeY),
|
82
86
|
]);
|
83
87
|
const [reserveAmountRawX, reserveAmountRawY] = [
|
84
88
|
new bignumber_js_1.default(tokenPairData.balance_x.value),
|
@@ -98,7 +102,7 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
98
102
|
tokenPrice: tokenPriceY,
|
99
103
|
});
|
100
104
|
if (underlyingSource)
|
101
|
-
|
105
|
+
lpSources.push(underlyingSource);
|
102
106
|
if (!tokenPriceX || !tokenPriceY)
|
103
107
|
continue;
|
104
108
|
const lpSource = (0, getLpTokenSourceRaw_1.default)(portfolio_core_1.NetworkId.aptos, lpType, constants_1.platformId, {
|
@@ -119,8 +123,9 @@ const executor = (cache) => __awaiter(void 0, void 0, void 0, function* () {
|
|
119
123
|
reserveAmountRaw: reserveAmountRawY,
|
120
124
|
},
|
121
125
|
], '');
|
122
|
-
|
126
|
+
lpSources.push(lpSource);
|
123
127
|
}
|
128
|
+
yield cache.setTokenPriceSources(lpSources);
|
124
129
|
});
|
125
130
|
const job = {
|
126
131
|
id: `${constants_1.platformId}-aptos-lp`,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pancakeswap/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+
|
1
|
+
{"version":3,"file":"aptosLpJob.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/pancakeswap/aptosLpJob.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,gEAAqC;AACrC,+DAIoC;AAGpC,2CAA+E;AAE/E,iDAAqD;AACrD,6CAK2B;AAC3B,6GAAqF;AACrF,+FAAuE;AACvE,+DAA4D;AAE5D,MAAM,QAAQ,GAAgB,CAAO,KAAY,EAAE,EAAE;;IACnD,MAAM,MAAM,GAAG,IAAA,wBAAc,GAAE,CAAC;IAChC,MAAM,SAAS,GAAG,MAAM,IAAA,2BAAmB,EAAC,MAAM,EAAE,0BAAc,CAAC,CAAC;IACpE,IAAI,CAAC,SAAS;QAAE,OAAO;IAEvB,MAAM,eAAe,GAAuC,IAAI,GAAG,EAAE,CAAC;IACtE,SAAS,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE;Q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,CAAC,CAAC;QAEvD,IAAI,CAAC,WAAW,IAAI,CAAC,WAAW;YAAE,SAAS;QAC3C,MAAM,QAAQ,GAAG,IAAA,6BAAmB,EAClC,0BAAS,CAAC,KAAK,EACf,MAAM,EACN,sBAAU,EACV;YACE,OAAO,EAAE,MAAM;YACf,QAAQ,EAAE,UAAU;YACpB,SAAS,EAAE,QAAQ;SACpB,EACD;YACE;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;YACD;gBACE,OAAO,EAAE,WAAW,CAAC,OAAO;gBAC5B,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,WAAW,CAAC,KAAK;gBACxB,gBAAgB,EAAE,iBAAiB;aACpC;SACF,EACD,EAAE,CACH,CAAC;QACF,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,KAAK,CAAC,oBAAoB,CAAC,SAAS,CAAC,CAAC;AAC9C,CAAC,CAAA,CAAC;AAEF,MAAM,GAAG,GAAQ;IACf,EAAE,EAAE,GAAG,sBAAU,WAAW;IAC5B,QAAQ;IACR,KAAK,EAAE,QAAQ;CAChB,CAAC;AACF,kBAAe,GAAG,CAAC"}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { Platform } from '@sonarwatch/portfolio-core';
|
2
|
+
import { InputViewRequestData } from '@aptos-labs/ts-sdk';
|
2
3
|
export declare const platformId = "thala";
|
3
4
|
export declare const thalaPlatform: Platform;
|
4
5
|
export declare const programAdressThala = "0x6f986d146e4a90b828d8c12c14b6f4e003fdff11a8eecceceb63744363eaac01";
|
@@ -14,13 +15,5 @@ export declare const lpStableTypePrefix = "0x48271d39d0b05bd6efca2278f22277d6fcc
|
|
14
15
|
export declare const lpWeightedTypePrefix = "0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::WeightedPool";
|
15
16
|
export declare const lpStableCoinInfoTypePrefix = "0x1::coin::CoinInfo<0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::stable_pool::StablePoolToken";
|
16
17
|
export declare const lpWeightedCoinInfoTypePrefix = "0x1::coin::CoinInfo<0x48271d39d0b05bd6efca2278f22277d6fcc375504f9839fd73f74ace240861af::weighted_pool::WeightedPoolToken";
|
17
|
-
export declare const stabilityDepositPayload: (owner: string) =>
|
18
|
-
|
19
|
-
type_arguments: string[];
|
20
|
-
arguments: string[];
|
21
|
-
};
|
22
|
-
export declare const stabilityClaimablePayload: (owner: string) => {
|
23
|
-
function: string;
|
24
|
-
type_arguments: never[];
|
25
|
-
arguments: string[];
|
26
|
-
};
|
18
|
+
export declare const stabilityDepositPayload: (owner: string) => InputViewRequestData;
|
19
|
+
export declare const stabilityClaimablePayload: (owner: string) => InputViewRequestData;
|
@@ -30,14 +30,14 @@ exports.lpStableCoinInfoTypePrefix = `${aptos_1.coinInfo}<${exports.lpStableType
|
|
30
30
|
exports.lpWeightedCoinInfoTypePrefix = `${aptos_1.coinInfo}<${exports.lpWeightedTypeTokenPrefix}`;
|
31
31
|
const stabilityDepositPayload = (owner) => ({
|
32
32
|
function: liquidityDeposit,
|
33
|
-
|
34
|
-
|
33
|
+
typeArguments: [cryptoType],
|
34
|
+
functionArguments: [owner],
|
35
35
|
});
|
36
36
|
exports.stabilityDepositPayload = stabilityDepositPayload;
|
37
37
|
const stabilityClaimablePayload = (owner) => ({
|
38
38
|
function: liquidityClaimable,
|
39
|
-
|
40
|
-
|
39
|
+
typeArguments: [],
|
40
|
+
functionArguments: [owner],
|
41
41
|
});
|
42
42
|
exports.stabilityClaimablePayload = stabilityClaimablePayload;
|
43
43
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/thala/constants.ts"],"names":[],"mappings":";;;
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/thala/constants.ts"],"names":[],"mappings":";;;AAEA,6CAA6C;AAEhC,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,aAAa,GAAa;IACrC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,6CAA6C;IACpD,WAAW,EAAE,mBAAmB;IAChC,OAAO,EAAE,uBAAuB;CACjC,CAAC;AACW,QAAA,kBAAkB,GAC7B,oEAAoE,CAAC;AAEvE,MAAM,eAAe,GAAG,gBAAgB,CAAC;AACzC,MAAM,WAAW,GAAG,OAAO,CAAC;AAE5B,MAAM,gBAAgB,GAAG,GAAG,0BAAkB,KAAK,eAAe,mBAAmB,CAAC;AACtF,MAAM,kBAAkB,GAAG,GAAG,0BAAkB,KAAK,eAAe,iBAAiB,CAAC;AAEtF,MAAM,UAAU,GAAG,GAAG,0BAAkB,KAAK,eAAe,UAAU,CAAC;AAC1D,QAAA,WAAW,GAAG,GAAG,0BAAkB,KAAK,WAAW,UAAU,CAAC;AAC9D,QAAA,2BAA2B,GAAG,GAAG,0BAAkB,KAAK,WAAW,0BAA0B,CAAC;AAE9F,QAAA,OAAO,GAAG,kFAAkF,CAAC;AAC7F,QAAA,OAAO,GAAG,GAAG,0BAAkB,iBAAiB,CAAC;AAEjD,QAAA,iBAAiB,GAAG,0CAA0C,CAAC;AAE/D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,uBAAuB,GAAG,GAAG,wBAAgB,gCAAgC,CAAC;AAC9E,QAAA,yBAAyB,GAAG,GAAG,wBAAgB,oCAAoC,CAAC;AACpF,QAAA,kBAAkB,GAAG,GAAG,wBAAgB,2BAA2B,CAAC;AACpE,QAAA,oBAAoB,GAAG,GAAG,wBAAgB,+BAA+B,CAAC;AAC1E,QAAA,0BAA0B,GAAG,GAAG,gBAAQ,IAAI,+BAAuB,EAAE,CAAC;AACtE,QAAA,4BAA4B,GAAG,GAAG,gBAAQ,IAAI,iCAAyB,EAAE,CAAC;AAEhF,MAAM,uBAAuB,GAAG,CACrC,KAAa,EACS,EAAE,CAAC,CAAC;IAC1B,QAAQ,EAAE,gBAAgB;IAC1B,aAAa,EAAE,CAAC,UAAU,CAAC;IAC3B,iBAAiB,EAAE,CAAC,KAAK,CAAC;CAC3B,CAAC,CAAC;AANU,QAAA,uBAAuB,2BAMjC;AAEI,MAAM,yBAAyB,GAAG,CACvC,KAAa,EACS,EAAE,CAAC,CAAC;IAC1B,QAAQ,EAAE,kBAAkB;IAC5B,aAAa,EAAE,EAAE;IACjB,iBAAiB,EAAE,CAAC,KAAK,CAAC;CAC3B,CAAC,CAAC;AANU,QAAA,yBAAyB,6BAMnC"}
|
@@ -13,6 +13,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
13
13
|
};
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
15
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
16
|
+
const bignumber_js_1 = __importDefault(require("bignumber.js"));
|
16
17
|
const constants_1 = require("./constants");
|
17
18
|
const aptos_1 = require("../../utils/aptos");
|
18
19
|
const clients_1 = require("../../utils/clients");
|
@@ -25,7 +26,9 @@ const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* (
|
|
25
26
|
const depositAmountString = stabilityPoolDepositView.at(0);
|
26
27
|
if (!depositAmountString)
|
27
28
|
return [];
|
28
|
-
const depositAmount =
|
29
|
+
const depositAmount = new bignumber_js_1.default(depositAmountString.toString())
|
30
|
+
.div(Math.pow(10, portfolio_core_1.aptosNetwork.native.decimals))
|
31
|
+
.toNumber();
|
29
32
|
if (depositAmount === 0)
|
30
33
|
return [];
|
31
34
|
const depositTokenPrice = yield cache.getTokenPrice(constants_1.modCoin.toString(), portfolio_core_1.NetworkId.aptos);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"stabilityPoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/thala/stabilityPoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;
|
1
|
+
{"version":3,"file":"stabilityPoolFetcher.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/thala/stabilityPoolFetcher.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,+DAQoC;AACpC,gEAAqC;AAGrC,2CAMqB;AACrB,6CAA4C;AAC5C,iDAAqD;AACrD,qGAA6E;AAE7E,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,KAAY,EAAE,EAAE;IACtE,MAAM,UAAU,GAAG,IAAA,wBAAc,GAAE,CAAC;IACpC,MAAM,wBAAwB,GAAG,MAAM,IAAA,eAAO,EAC5C,UAAU,EACV,IAAA,mCAAuB,EAAC,KAAK,CAAC,CAC/B,CAAC;IACF,IAAI,CAAC,wBAAwB,IAAI,wBAAwB,CAAC,MAAM,KAAK,CAAC;QACpE,OAAO,EAAE,CAAC;IAEZ,MAAM,mBAAmB,GAAG,wBAAwB,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3D,IAAI,CAAC,mBAAmB;QAAE,OAAO,EAAE,CAAC;IAEpC,MAAM,aAAa,GAAG,IAAI,sBAAS,CAAC,mBAAmB,CAAC,QAAQ,EAAE,CAAC;SAChE,GAAG,CAAC,SAAA,EAAE,EAAI,6BAAY,CAAC,MAAM,CAAC,QAAQ,CAAA,CAAC;SACvC,QAAQ,EAAE,CAAC;IACd,IAAI,aAAa,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IAEnC,MAAM,iBAAiB,GAAG,MAAM,KAAK,CAAC,aAAa,CACjD,mBAAO,CAAC,QAAQ,EAAE,EAClB,0BAAS,CAAC,KAAK,CAChB,CAAC;IAEF,MAAM,MAAM,GAAG,IAAA,gCAAsB,EACnC,mBAAO,CAAC,QAAQ,EAAE,EAClB,aAAa,EACb,0BAAS,CAA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G,EAAE,CAAC;QACR,MAAM,CAAC,IAAI,CAAC;YACV,GAAG;YACH,GAAG,EAAE,IAAA,yBAAQ,EAAC,GAAG,CAAC;SACnB,CAAC,CAAC;IACL,CAAC;IAED,MAAM,SAAS,GAAuB;QACpC,KAAK;QACL,MAAM,EAAE,CAAC,MAAM,CAAC;QAChB,WAAW;QACX,YAAY,EAAE,CAAC,YAAY,CAAC;QAC5B,iBAAiB;QACjB,MAAM;KACP,CAAC;IACF,MAAM,WAAW,GAAyB,CAAC,SAAS,CAAC,CAAC;IAEtD,MAAM,eAAe,GAA8B;QACjD,SAAS,EAAE,0BAAS,CAAC,KAAK;QAC1B,UAAU,EAAE,OAAO;QACnB,IAAI,EAAE,qCAAoB,CAAC,SAAS;QACpC,KAAK,EAAE,QAAQ;QACf,KAAK;QACL,IAAI,EAAE;YACJ,WAAW;SACZ;KACF,CAAC;IACF,OAAO,CAAC,eAAe,CAAC,CAAC;AAC3B,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,sBAAU,iBAAiB;IAClC,SAAS,EAAE,0BAAS,CAAC,KAAK;IAC1B,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
|
+
export declare function getAccountCoinsData(client: AptosClient, coinType: string): Promise<{
|
3
|
+
amount: any;
|
4
|
+
asset_type: string;
|
5
|
+
is_frozen: boolean;
|
6
|
+
is_primary: boolean;
|
7
|
+
last_transaction_timestamp: any;
|
8
|
+
last_transaction_version: any;
|
9
|
+
owner_address: string;
|
10
|
+
storage_id: string;
|
11
|
+
token_standard: string;
|
12
|
+
metadata?: {
|
13
|
+
token_standard: string;
|
14
|
+
symbol: string;
|
15
|
+
supply_aggregator_table_key_v1?: string | null | undefined;
|
16
|
+
supply_aggregator_table_handle_v1?: string | null | undefined;
|
17
|
+
project_uri?: string | null | undefined;
|
18
|
+
name: string;
|
19
|
+
last_transaction_version: any;
|
20
|
+
last_transaction_timestamp: any;
|
21
|
+
icon_uri?: string | null | undefined;
|
22
|
+
decimals: number;
|
23
|
+
creator_address: string;
|
24
|
+
asset_type: string;
|
25
|
+
} | null | undefined;
|
26
|
+
}[]>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getAccountCoinsData = void 0;
|
4
|
+
function getAccountCoinsData(client, coinType) {
|
5
|
+
return client.getAccountCoinsData({
|
6
|
+
accountAddress: coinType,
|
7
|
+
});
|
8
|
+
}
|
9
|
+
exports.getAccountCoinsData = getAccountCoinsData;
|
10
|
+
//# sourceMappingURL=getAccountCoinsData.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getAccountCoinsData.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getAccountCoinsData.ts"],"names":[],"mappings":";;;AAEA,SAAgB,mBAAmB,CAAC,MAAmB,EAAE,QAAgB;IACvE,OAAO,MAAM,CAAC,mBAAmB,CAAC;QAChC,cAAc,EAAE,QAAQ;KACzB,CAAC,CAAC;AACL,CAAC;AAJD,kDAIC"}
|
@@ -1,3 +1,2 @@
|
|
1
|
-
import { AptosClient } from '
|
2
|
-
|
3
|
-
export declare function getAccountResource<T>(client: AptosClient, accountAddress: string, resourceType: string): Promise<MoveResource<T> | null>;
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
|
+
export declare function getAccountResource<T extends object>(client: AptosClient, accountAddress: string, resourceType: `${string}::${string}::${string}`): Promise<T | null>;
|
@@ -13,7 +13,10 @@ exports.getAccountResource = void 0;
|
|
13
13
|
function getAccountResource(client, accountAddress, resourceType) {
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
15
15
|
const resource = yield client
|
16
|
-
.getAccountResource(
|
16
|
+
.getAccountResource({
|
17
|
+
accountAddress,
|
18
|
+
resourceType,
|
19
|
+
})
|
17
20
|
.catch((e) => {
|
18
21
|
if (!e.status || e.status !== 404)
|
19
22
|
throw e;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getAccountResource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getAccountResource.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
1
|
+
{"version":3,"file":"getAccountResource.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getAccountResource.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,SAAsB,kBAAkB,CACtC,MAAmB,EACnB,cAAsB,EACtB,YAA+C;;QAE/C,MAAM,QAAQ,GAAG,MAAM,MAAM;aAC1B,kBAAkB,CAAI;YACrB,cAAc;YACd,YAAY;SACb,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG;gBAAE,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACL,IAAI,CAAC,QAAQ;YAAE,OAAO,IAAI,CAAC;QAC3B,OAAO,QAAQ,CAAC;IAClB,CAAC;CAAA;AAfD,gDAeC"}
|
@@ -1,5 +1,2 @@
|
|
1
|
-
import { AptosClient } from '
|
2
|
-
export declare function getAccountResources(client: AptosClient, accountAddress: string): Promise<
|
3
|
-
type: string;
|
4
|
-
data: {};
|
5
|
-
}[] | null>;
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
|
+
export declare function getAccountResources(client: AptosClient, accountAddress: string): Promise<import("@aptos-labs/ts-sdk").MoveResource[] | null>;
|
@@ -13,7 +13,9 @@ exports.getAccountResources = void 0;
|
|
13
13
|
function getAccountResources(client, accountAddress) {
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
15
15
|
const resources = yield client
|
16
|
-
.getAccountResources(
|
16
|
+
.getAccountResources({
|
17
|
+
accountAddress,
|
18
|
+
})
|
17
19
|
.catch((e) => {
|
18
20
|
if (!e.status || e.status !== 404)
|
19
21
|
throw e;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getAccountResources.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getAccountResources.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,SAAsB,mBAAmB,CACvC,MAAmB,EACnB,cAAsB;;QAEtB,MAAM,SAAS,GAAG,MAAM,MAAM;aAC3B,mBAAmB,CAAC,cAAc,CAAC;
|
1
|
+
{"version":3,"file":"getAccountResources.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getAccountResources.ts"],"names":[],"mappings":";;;;;;;;;;;;AAEA,SAAsB,mBAAmB,CACvC,MAAmB,EACnB,cAAsB;;QAEtB,MAAM,SAAS,GAAG,MAAM,MAAM;aAC3B,mBAAmB,CAAC;YACnB,cAAc;SACf,CAAC;aACD,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACX,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG;gBAAE,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACL,OAAO,SAAS,IAAI,IAAI,CAAC;IAC3B,CAAC;CAAA;AAZD,kDAYC"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { AptosClient } from '
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
2
|
import { CoinInfoData } from './resources/coinInfo';
|
3
|
-
export declare function getCoinInfoResource(client: AptosClient, coinType: string): Promise<
|
3
|
+
export declare function getCoinInfoResource(client: AptosClient, coinType: string): Promise<CoinInfoData | null>;
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { AptosClient } from '
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
2
|
import { CoinStoreData } from './resources/coinStore';
|
3
|
-
export declare function getCoinStoreResource(client: AptosClient, owner: string, coinType: string): Promise<
|
3
|
+
export declare function getCoinStoreResource(client: AptosClient, owner: string, coinType: string): Promise<CoinStoreData | null>;
|
@@ -1,5 +1,2 @@
|
|
1
|
-
import { AptosClient } from '
|
2
|
-
export declare function getCoinStoreResources(client: AptosClient, owner: string): Promise<
|
3
|
-
type: string;
|
4
|
-
data: {};
|
5
|
-
}[] | null>;
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
|
+
export declare function getCoinStoreResources(client: AptosClient, owner: string): Promise<import("@aptos-labs/ts-sdk").MoveResource[] | null>;
|
@@ -1,2 +1,2 @@
|
|
1
|
-
import { AptosClient } from '
|
1
|
+
import { AptosClient } from '../clients/types';
|
2
2
|
export declare function getDecimals(client: AptosClient, coinType: string): Promise<number | null>;
|
@@ -16,7 +16,7 @@ function getDecimals(client, coinType) {
|
|
16
16
|
const coinInfoResource = yield (0, getCoinInfoResource_1.getCoinInfoResource)(client, coinType);
|
17
17
|
if (!coinInfoResource)
|
18
18
|
return null;
|
19
|
-
return coinInfoResource.
|
19
|
+
return coinInfoResource.decimals;
|
20
20
|
});
|
21
21
|
}
|
22
22
|
exports.getDecimals = getDecimals;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDecimals.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getDecimals.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAA4D;AAE5D,SAAsB,WAAW,CAAC,MAAmB,EAAE,QAAgB;;QACrE,MAAM,gBAAgB,GAAG,MAAM,IAAA,yCAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC;QACnC,OAAO,gBAAgB,CAAC,
|
1
|
+
{"version":3,"file":"getDecimals.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getDecimals.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,+DAA4D;AAE5D,SAAsB,WAAW,CAAC,MAAmB,EAAE,QAAgB;;QACrE,MAAM,gBAAgB,GAAG,MAAM,IAAA,yCAAmB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrE,IAAI,CAAC,gBAAgB;YAAE,OAAO,IAAI,CAAC;QACnC,OAAO,gBAAgB,CAAC,QAAQ,CAAC;IACnC,CAAC;CAAA;AAJD,kCAIC"}
|
@@ -1,6 +1,10 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
3
|
exports.getNestedType = void 0;
|
4
|
+
/**
|
5
|
+
* @deprecated
|
6
|
+
* This function has been deprecated. Use the parseTypeString instead.
|
7
|
+
*/
|
4
8
|
function getNestedType(type) {
|
5
9
|
const index = type.indexOf('<');
|
6
10
|
return type.slice(index + 1, -1);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getNestedType.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getNestedType.ts"],"names":[],"mappings":";;;AAAA,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAHD,sCAGC"}
|
1
|
+
{"version":3,"file":"getNestedType.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getNestedType.ts"],"names":[],"mappings":";;;AAAA;;;GAGG;AACH,SAAgB,aAAa,CAAC,IAAY;IACxC,MAAM,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACnC,CAAC;AAHD,sCAGC"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
export declare function getTableItem<T>(client: AptosClient, handle: string, data: TableItemRequest): Promise<NonNullable<T
|
1
|
+
import { TableItemRequest } from '@aptos-labs/ts-sdk';
|
2
|
+
import { AptosClient } from '../clients/types';
|
3
|
+
export declare function getTableItem<T>(client: AptosClient, handle: string, data: TableItemRequest): Promise<NonNullable<Awaited<T>> | null>;
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getTableItem = void 0;
|
13
13
|
function getTableItem(client, handle, data) {
|
14
14
|
return __awaiter(this, void 0, void 0, function* () {
|
15
|
-
const item = yield client.getTableItem(handle, data).catch((e) => {
|
15
|
+
const item = yield client.getTableItem({ handle, data }).catch((e) => {
|
16
16
|
if (!e.status || e.status !== 404)
|
17
17
|
throw e;
|
18
18
|
});
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getTableItem.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getTableItem.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,SAAsB,YAAY,CAChC,MAAmB,EACnB,MAAc,EACd,IAAsB;;QAEtB,MAAM,IAAI,
|
1
|
+
{"version":3,"file":"getTableItem.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/aptos/getTableItem.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,SAAsB,YAAY,CAChC,MAAmB,EACnB,MAAc,EACd,IAAsB;;QAEtB,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,YAAY,CAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE;YACtE,IAAI,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,MAAM,KAAK,GAAG;gBAAE,MAAM,CAAC,CAAC;QAC7C,CAAC,CAAC,CAAC;QACH,OAAO,IAAI,IAAI,IAAI,CAAC;IACtB,CAAC;CAAA;AATD,oCASC"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import {
|
2
|
-
import {
|
3
|
-
export declare function getTableItemsByHandles<T>(client: AptosClient, handles: string[], data: TableItemRequest): Promise<(Awaited<NonNullable<T
|
1
|
+
import { TableItemRequest } from '@aptos-labs/ts-sdk';
|
2
|
+
import { AptosClient } from '../clients/types';
|
3
|
+
export declare function getTableItemsByHandles<T>(client: AptosClient, handles: string[], data: TableItemRequest): Promise<(Awaited<NonNullable<Awaited<T>>> | null)[]>;
|