@sonarwatch/portfolio-plugins 0.12.183 → 0.12.184
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +1534 -1530
- package/README.md +3 -3
- package/package.json +8 -8
- package/src/plugins/balancer/helpers/pools.js +21 -21
- package/src/plugins/cetus/dcaFetcher.js +2 -2
- package/src/plugins/cetus/dcaFetcher.js.map +1 -1
- package/src/plugins/cetus/helpers.js +1 -1
- package/src/plugins/cetus/helpers.js.map +1 -1
- package/src/plugins/cetus/limitFetcher.js +4 -4
- package/src/plugins/cetus/limitFetcher.js.map +1 -1
- package/src/plugins/deepbook/helpers.js +4 -4
- package/src/plugins/deepbook/helpers.js.map +1 -1
- package/src/plugins/haedal/vaultFetcher.js +2 -2
- package/src/plugins/haedal/vaultFetcher.js.map +1 -1
- package/src/plugins/mole/farmsFetcher.js +3 -3
- package/src/plugins/mole/farmsFetcher.js.map +1 -1
- package/src/plugins/navi/getAvailableRewards.js +5 -5
- package/src/plugins/navi/getAvailableRewards.js.map +1 -1
- package/src/plugins/scallop/lendingsFetcher.js +3 -5
- package/src/plugins/scallop/lendingsFetcher.js.map +1 -1
- package/src/plugins/scallop/obligationsFetcher.js +1 -1
- package/src/plugins/scallop/obligationsFetcher.js.map +1 -1
- package/src/plugins/scallop/poolsJob.js +1 -1
- package/src/plugins/scallop/poolsJob.js.map +1 -1
- package/src/plugins/scallop/types/coin.d.ts +1 -1
- package/src/plugins/sushiswap/helpers.js +24 -24
- package/src/plugins/tokens/fetchers/sui-nfts.js +2 -2
- package/src/plugins/tokens/fetchers/sui-nfts.js.map +1 -1
- package/src/plugins/typus/constants.js +30 -5
- package/src/plugins/typus/constants.js.map +1 -1
- package/src/plugins/typus/helpers.js +5 -6
- package/src/plugins/typus/helpers.js.map +1 -1
- package/src/plugins/typus/safu_helpers.js +14 -13
- package/src/plugins/typus/safu_helpers.js.map +1 -1
- package/src/plugins/uniswap-v2/helpers.js +22 -22
- package/src/plugins/zeta/airdropFetcher.js +14 -14
- package/src/utils/clients/getClientSui.js +1 -1
- package/src/utils/clients/getClientSui.js.map +1 -1
- package/src/utils/clients/types.d.ts +1 -1
- package/src/utils/sei/constants.js +8 -8
- package/src/utils/sei/getQueryBalanceByOwner.js +4 -4
- package/src/utils/sui/getDynamicFieldObject.d.ts +1 -1
- package/src/utils/sui/getDynamicFieldObjects.d.ts +1 -1
- package/src/utils/sui/getDynamicFieldObjects.js +1 -1
- package/src/utils/sui/getDynamicFieldObjects.js.map +1 -1
- package/src/utils/sui/getDynamicFieldObjectsSafe.d.ts +4 -0
- package/src/utils/sui/getDynamicFieldObjectsSafe.js +23 -0
- package/src/utils/sui/getDynamicFieldObjectsSafe.js.map +1 -0
- package/src/utils/sui/getDynamicFields.d.ts +1 -1
- package/src/utils/sui/getDynamicFields.js +1 -4
- package/src/utils/sui/getDynamicFields.js.map +1 -1
- package/src/utils/sui/getDynamicFieldsSafe.d.ts +3 -0
- package/src/utils/sui/getDynamicFieldsSafe.js +38 -0
- package/src/utils/sui/getDynamicFieldsSafe.js.map +1 -0
- package/src/utils/sui/getObject.d.ts +1 -1
- package/src/utils/sui/getObjectDeletedResponse.d.ts +1 -1
- package/src/utils/sui/getOwnedObjects.d.ts +1 -1
- package/src/utils/sui/mulitpleGetBalances.d.ts +1 -1
- package/src/utils/sui/multiGetObjects.d.ts +1 -1
- package/src/utils/sui/multipleGetDynamicFieldsObjects.d.ts +1 -1
- package/src/utils/sui/multipleGetDynamicFieldsObjects.js.map +1 -1
- package/src/utils/sui/multipleGetDynamicFieldsObjectsSafe.d.ts +4 -0
- package/src/utils/sui/multipleGetDynamicFieldsObjectsSafe.js +25 -0
- package/src/utils/sui/multipleGetDynamicFieldsObjectsSafe.js.map +1 -0
- package/src/utils/sui/queryEvents.d.ts +1 -1
- package/src/utils/sui/queryEventsSafe.d.ts +1 -1
- package/src/utils/sui/types.d.ts +7 -1
@@ -54,30 +54,30 @@ function sushiV3PairToUniV2(pair) {
|
|
54
54
|
}
|
55
55
|
function getV3PairsAddresses(url, length = 300) {
|
56
56
|
return __awaiter(this, void 0, void 0, function* () {
|
57
|
-
const query = (0, graphql_request_1.gql) `
|
58
|
-
{
|
59
|
-
pools(
|
60
|
-
orderBy: totalValueLockedUSD
|
61
|
-
first: ${length}
|
62
|
-
orderDirection: desc
|
63
|
-
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
-
) {
|
65
|
-
id
|
66
|
-
token0Price
|
67
|
-
token1Price
|
68
|
-
liquidity
|
69
|
-
token0 {
|
70
|
-
id
|
71
|
-
totalSupply
|
72
|
-
decimals
|
73
|
-
}
|
74
|
-
token1 {
|
75
|
-
id
|
76
|
-
totalSupply
|
77
|
-
decimals
|
78
|
-
}
|
79
|
-
}
|
80
|
-
}
|
57
|
+
const query = (0, graphql_request_1.gql) `
|
58
|
+
{
|
59
|
+
pools(
|
60
|
+
orderBy: totalValueLockedUSD
|
61
|
+
first: ${length}
|
62
|
+
orderDirection: desc
|
63
|
+
where: { volumeUSD_not: "0", liquidity_not: "0" }
|
64
|
+
) {
|
65
|
+
id
|
66
|
+
token0Price
|
67
|
+
token1Price
|
68
|
+
liquidity
|
69
|
+
token0 {
|
70
|
+
id
|
71
|
+
totalSupply
|
72
|
+
decimals
|
73
|
+
}
|
74
|
+
token1 {
|
75
|
+
id
|
76
|
+
totalSupply
|
77
|
+
decimals
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
81
|
`;
|
82
82
|
const res = yield (0, graphql_request_1.default)(url, query);
|
83
83
|
const pools = res.pools;
|
@@ -14,7 +14,7 @@ const clients_1 = require("../../../utils/clients");
|
|
14
14
|
const constants_1 = require("../constants");
|
15
15
|
const constants_2 = require("../../../utils/sui/constants");
|
16
16
|
const getOwnedObjects_1 = require("../../../utils/sui/getOwnedObjects");
|
17
|
-
const
|
17
|
+
const getDynamicFieldsSafe_1 = require("../../../utils/sui/getDynamicFieldsSafe");
|
18
18
|
const multiGetObjects_1 = require("../../../utils/sui/multiGetObjects");
|
19
19
|
const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
20
20
|
var _a;
|
@@ -29,7 +29,7 @@ const executor = (owner) => __awaiter(void 0, void 0, void 0, function* () {
|
|
29
29
|
const nftObjects = [...ownedObjects.filter((o) => { var _a, _b; return (_b = (_a = o.data) === null || _a === void 0 ? void 0 : _a.display) === null || _b === void 0 ? void 0 : _b.data; })];
|
30
30
|
const obKioskObject = ownedObjects.find((o) => { var _a; return ((_a = o.data) === null || _a === void 0 ? void 0 : _a.type) === constants_2.obKioskStructType; });
|
31
31
|
if (obKioskObject) {
|
32
|
-
const kioskDynamicObjects = yield (0,
|
32
|
+
const kioskDynamicObjects = yield (0, getDynamicFieldsSafe_1.getDynamicFieldsSafe)(client, ((_a = obKioskObject === null || obKioskObject === void 0 ? void 0 : obKioskObject.data) === null || _a === void 0 ? void 0 : _a.content).fields.kiosk, true);
|
33
33
|
const ownerKioskObjects = yield (0, multiGetObjects_1.multiGetObjects)(client, kioskDynamicObjects.map((o) => o.objectId));
|
34
34
|
nftObjects.push(...ownerKioskObjects);
|
35
35
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"sui-nfts.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/sui-nfts.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAOoC;AAEpC,oDAAsD;AACtD,4CAAkD;AAClD,4DAAiE;AACjE,wEAAqE;AAIrE,
|
1
|
+
{"version":3,"file":"sui-nfts.js","sourceRoot":"","sources":["../../../../../../../packages/plugins/src/plugins/tokens/fetchers/sui-nfts.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,+DAOoC;AAEpC,oDAAsD;AACtD,4CAAkD;AAClD,4DAAiE;AACjE,wEAAqE;AAIrE,kFAA+E;AAC/E,wEAAqE;AAErE,MAAM,QAAQ,GAAoB,CAAO,KAAa,EAAE,EAAE;;IACxD,MAAM,MAAM,GAAG,IAAA,sBAAY,GAAE,CAAC;IAC9B,MAAM,YAAY,GAAG,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,IAAI,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,KAAI,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI;gBACjE,UAAU;aACX;SACF,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,IAAI,MAAM,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAC;IACnC,MAAM,OAAO,GAA6B;QACxC,IAAI,EAAE,qCAAoB,CAAC,QAAQ;QACnC,SAAS,EAAE,0BAAS,CAAC,GAAG;QACxB,UAAU,EAAE,8BAAkB,CAAC,EAAE;QACjC,KAAK,EAAE,QAAQ;QACf,KAAK,EAAE,IAAI;QACX,IAAI,EAAE;YACJ,MAAM;SACP;KACF,CAAC;IACF,OAAO,CAAC,OAAO,CAAC,CAAC;AACnB,CAAC,CAAA,CAAC;AAEF,MAAM,OAAO,GAAY;IACvB,EAAE,EAAE,GAAG,8BAAkB,CAAC,EAAE,IAAI,0BAAS,CAAC,GAAG,EAAE;IAC/C,SAAS,EAAE,0BAAS,CAAC,GAAG;IACxB,QAAQ;CACT,CAAC;AAEF,kBAAe,OAAO,CAAC"}
|
@@ -20,11 +20,36 @@ exports.safuPackage = '0x8bde4eedabbdaf0c4c463c4eb35f00456dbac5fdccb94ce9c2d7a77
|
|
20
20
|
exports.frameworkPackage = '0x5c6648fb219c046256488486d23d4af7bc562d5ab5c382e1f4b558066a327fe8';
|
21
21
|
exports.safuRegistryId = '0xdc970d638d1489385e49ddb76889748011bac4616b95a51aa63633972b841706';
|
22
22
|
exports.safuVaultsKey = 'safu-vaults';
|
23
|
-
exports.vaultsIndexes = [
|
23
|
+
exports.vaultsIndexes = [
|
24
|
+
'0',
|
25
|
+
'1',
|
26
|
+
'2',
|
27
|
+
'3',
|
28
|
+
'4',
|
29
|
+
'5',
|
30
|
+
'6',
|
31
|
+
'7',
|
32
|
+
'8',
|
33
|
+
'9',
|
34
|
+
'10',
|
35
|
+
'11',
|
36
|
+
'12',
|
37
|
+
'13',
|
38
|
+
];
|
24
39
|
exports.safuVaultsNames = {
|
25
|
-
'0': 'Bull',
|
26
|
-
'1': 'Bear',
|
27
|
-
'2': 'All Weather
|
28
|
-
'3': 'All Weather
|
40
|
+
'0': 'SUI Daily Bull',
|
41
|
+
'1': 'SUI Daily Bear',
|
42
|
+
'2': 'Daily All Weather',
|
43
|
+
'3': 'Daily All Weather',
|
44
|
+
'4': 'SUI Hourly Bull',
|
45
|
+
'5': 'SUI Hourly Bear',
|
46
|
+
'6': 'BTC Daily Bull',
|
47
|
+
'7': 'BTC Daily Bear',
|
48
|
+
'8': 'ETH Daily Bull',
|
49
|
+
'9': 'ETH Daily Bear',
|
50
|
+
'10': 'SOL Daily Bull',
|
51
|
+
'11': 'SOL Daily Bear',
|
52
|
+
'12': 'SUI Daily Bull',
|
53
|
+
'13': 'SUI Daily Bull',
|
29
54
|
};
|
30
55
|
//# sourceMappingURL=constants.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,sBAAsB,EAAE,sCAAsC;IAC3E,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC;AAEzF,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,aAAa,GAAG,
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/constants.ts"],"names":[],"mappings":";;;AAEa,QAAA,UAAU,GAAG,OAAO,CAAC;AACrB,QAAA,QAAQ,GAAa;IAChC,EAAE,EAAE,kBAAU;IACd,IAAI,EAAE,OAAO;IACb,KAAK,EAAE,8CAA8C;IACrD,WAAW,EAAE,sBAAsB,EAAE,sCAAsC;IAC3E,OAAO,EAAE,wBAAwB;IACjC,OAAO,EAAE,kCAAkC;CAC5C,CAAC;AACW,QAAA,SAAS,GACpB,oEAAoE,CAAC;AAC1D,QAAA,kBAAkB,GAAG,GAAG,iBAAS,8BAA8B,CAAC;AAChE,QAAA,MAAM,GACjB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,iBAAiB,GAC5B,oEAAoE,CAAC;AAC1D,QAAA,qBAAqB,GAAG,GAAG,wBAAgB,6CAA6C,CAAC;AAEzF,QAAA,WAAW,GACtB,oEAAoE,CAAC;AAC1D,QAAA,gBAAgB,GAC3B,oEAAoE,CAAC;AAC1D,QAAA,cAAc,GACzB,oEAAoE,CAAC;AAC1D,QAAA,aAAa,GAAG,aAAa,CAAC;AAE9B,QAAA,aAAa,GAAG;IAC3B,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,GAAG;IACH,IAAI;IACJ,IAAI;IACJ,IAAI;IACJ,IAAI;CACL,CAAC;AACW,QAAA,eAAe,GAA8B;IACxD,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,mBAAmB;IACxB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,iBAAiB;IACtB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,GAAG,EAAE,gBAAgB;IACrB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,gBAAgB;IACtB,IAAI,EAAE,gBAAgB;CACvB,CAAC"}
|
@@ -11,17 +11,17 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.getDepositShares = void 0;
|
13
13
|
const bcs_1 = require("@mysten/bcs");
|
14
|
-
const transactions_1 = require("@mysten/sui
|
14
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
15
15
|
const constants_1 = require("./constants");
|
16
16
|
function getDepositShares(provider, receipts) {
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
18
|
-
const transactionBlock = new transactions_1.
|
18
|
+
const transactionBlock = new transactions_1.Transaction();
|
19
19
|
const target = constants_1.viewDepositSharesType;
|
20
20
|
const transactionBlockArguments = [
|
21
|
-
transactionBlock.
|
21
|
+
transactionBlock.object(constants_1.registryDovSingle),
|
22
22
|
transactionBlock.makeMoveVec({
|
23
23
|
type: constants_1.depositReceiptType,
|
24
|
-
|
24
|
+
elements: receipts.map((id) => transactionBlock.object(id)),
|
25
25
|
}),
|
26
26
|
];
|
27
27
|
transactionBlock.moveCall({
|
@@ -40,7 +40,7 @@ function getDepositShares(provider, receipts) {
|
|
40
40
|
return undefined;
|
41
41
|
const bytes = returnValues[0][0];
|
42
42
|
const reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
43
|
-
|
43
|
+
return reader.readVec((bcsReader) => {
|
44
44
|
bcsReader.read8();
|
45
45
|
const index = bcsReader.read64();
|
46
46
|
const activeSubVaultUserShare = bcsReader.read64();
|
@@ -59,7 +59,6 @@ function getDepositShares(provider, receipts) {
|
|
59
59
|
incentiveShare,
|
60
60
|
};
|
61
61
|
});
|
62
|
-
return res;
|
63
62
|
});
|
64
63
|
}
|
65
64
|
exports.getDepositShares = getDepositShares;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwC;AACxC,
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAwC;AACxC,2DAAuD;AAGvD,2CAKqB;AAErB,SAAsB,gBAAgB,CACpC,QAAmB,EACnB,QAAkB;;QAElB,MAAM,gBAAgB,GAAG,IAAI,0BAAW,EAAE,CAAC;QAC3C,MAAM,MAAM,GAAG,iCAA0D,CAAC;QAC1E,MAAM,yBAAyB,GAAG;YAChC,gBAAgB,CAAC,MAAM,CAAC,6BAAiB,CAAC;YAC1C,gBAAgB,CAAC,WAAW,CAAC;gBAC3B,IAAI,EAAE,8BAAkB;gBACxB,QAAQ,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;aAC5D,CAAC;SACH,CAAC;QACF,gBAAgB,CAAC,QAAQ,CAAC;YACxB,MAAM;YACN,aAAa,EAAE,EAAE;YACjB,SAAS,EAAE,yBAAyB;SACrC,CAAC,CAAC;QACH,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,QAAQ,CAAC,0BAA0B,CAAC;YAC5D,gBAAgB;YAChB,MAAM,EAAN,kBAAM;SACP,CAAC,CAAC;QACH,IAAI,CAAC,OAAO,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,SAAS,CAAC;QAEvD,MAAM,EAAE,YAAY,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;QACrD,IAAI,CAAC,YAAY;YAAE,OAAO,SAAS,CAAC;QAEpC,MAAM,KAAK,GAAG,YAAY,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACjC,MAAM,MAAM,GAAG,IAAI,eAAS,CAAC,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,EAAE,EAAE;YAClC,SAAS,CAAC,KAAK,EAAE,CAAC;YAClB,MAAM,KAAK,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACjC,MAAM,uBAAuB,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACnD,MAAM,6BAA6B,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACzD,MAAM,yBAAyB,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACrD,MAAM,uBAAuB,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACnD,MAAM,wBAAwB,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YACpD,MAAM,cAAc,GAAG,SAAS,CAAC,MAAM,EAAE,CAAC;YAC1C,OAAO;gBACL,KAAK;gBACL,uBAAuB;gBACvB,6BAA6B;gBAC7B,yBAAyB;gBACzB,uBAAuB;gBACvB,wBAAwB;gBACxB,cAAc;aACC,CAAC;QACpB,CAAC,CAAC,CAAC;IACL,CAAC;CAAA;AAhDD,4CAgDC"}
|
@@ -10,30 +10,31 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.getShareData = exports.getVaultData = void 0;
|
13
|
-
const transactions_1 = require("@mysten/sui
|
13
|
+
const transactions_1 = require("@mysten/sui/transactions");
|
14
14
|
const constants_1 = require("./constants");
|
15
|
-
const bcs_1 = require("@mysten/bcs");
|
15
|
+
const bcs_1 = require("@mysten/sui/bcs");
|
16
|
+
const bcs_2 = require("@mysten/bcs");
|
16
17
|
const SENDER = '0xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA';
|
17
18
|
function getVaultData(provider) {
|
18
19
|
return __awaiter(this, void 0, void 0, function* () {
|
19
|
-
let
|
20
|
-
|
20
|
+
let transaction = new transactions_1.Transaction();
|
21
|
+
transaction.moveCall({
|
21
22
|
target: `${constants_1.safuPackage}::view_function::get_vault_data_bcs`,
|
22
23
|
typeArguments: [`${constants_1.frameworkPackage}::vault::TypusBidReceipt`],
|
23
24
|
arguments: [
|
24
|
-
|
25
|
-
|
25
|
+
transaction.object(constants_1.safuRegistryId),
|
26
|
+
transaction.pure(bcs_1.bcs.vector(bcs_1.bcs.U64).serialize(constants_1.vaultsIndexes)),
|
26
27
|
],
|
27
28
|
});
|
28
29
|
let results = (yield provider.devInspectTransactionBlock({
|
29
30
|
sender: SENDER,
|
30
|
-
transactionBlock,
|
31
|
+
transactionBlock: transaction,
|
31
32
|
})).results;
|
32
33
|
// console.log(JSON.stringify(results));
|
33
34
|
// @ts-ignore
|
34
35
|
let bytes = results[results.length - 1].returnValues[0][0];
|
35
36
|
// console.log(JSON.stringify(bytes));
|
36
|
-
let reader = new
|
37
|
+
let reader = new bcs_2.BcsReader(new Uint8Array(bytes));
|
37
38
|
let result = {};
|
38
39
|
reader.readVec((reader) => {
|
39
40
|
reader.readULEB();
|
@@ -148,15 +149,15 @@ function AddressFromBytes(x) {
|
|
148
149
|
}
|
149
150
|
function getShareData(provider, owner) {
|
150
151
|
return __awaiter(this, void 0, void 0, function* () {
|
151
|
-
let transactionBlock = new transactions_1.
|
152
|
+
let transactionBlock = new transactions_1.Transaction();
|
152
153
|
const indexes = constants_1.vaultsIndexes.slice();
|
153
154
|
transactionBlock.moveCall({
|
154
155
|
target: `${constants_1.safuPackage}::view_function::get_share_data_bcs`,
|
155
156
|
typeArguments: [],
|
156
157
|
arguments: [
|
157
|
-
transactionBlock.
|
158
|
-
transactionBlock.pure(owner),
|
159
|
-
transactionBlock.pure(indexes),
|
158
|
+
transactionBlock.object(constants_1.safuRegistryId),
|
159
|
+
transactionBlock.pure.address(owner),
|
160
|
+
transactionBlock.pure(bcs_1.bcs.vector(bcs_1.bcs.U64).serialize(indexes)),
|
160
161
|
],
|
161
162
|
});
|
162
163
|
let results = (yield provider.devInspectTransactionBlock({
|
@@ -167,7 +168,7 @@ function getShareData(provider, owner) {
|
|
167
168
|
// @ts-ignore
|
168
169
|
let bytes = results[results.length - 1].returnValues[0][0];
|
169
170
|
// console.log(JSON.stringify(bytes));
|
170
|
-
let reader = new
|
171
|
+
let reader = new bcs_2.BcsReader(new Uint8Array(bytes));
|
171
172
|
let result = {};
|
172
173
|
reader.readVec((reader, i) => {
|
173
174
|
reader.read8();
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"safu_helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/safu_helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,
|
1
|
+
{"version":3,"file":"safu_helpers.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/plugins/typus/safu_helpers.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,2DAAuD;AAEvD,2CAKqB;AACrB,yCAAsC;AACtC,qCAAwC;AAExC,MAAM,MAAM,GACV,oEAAoE,CAAC;AAEvE,SAAsB,YAAY,CAChC,QAAmB;;QAEnB,IAAI,WAAW,GAAG,IAAI,0BAAW,EAAE,CAAC;QACpC,WAAW,CAAC,QAAQ,CAAC;YACnB,MAAM,EAAE,GAAG,uBAAW,qCAAqC;YAC3D,aAAa,EAAE,CAAC,GAAG,4BAAgB,0BAA0B,CAAC;YAC9D,SAAS,EAAE;gBACT,WAAW,CAAC,MAAM,CAAC,0BAAc,CAAC;gBAClC,WAAW,CAAC,IAAI,CAAC,SAAG,CAA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M,EAAE,CAAC;gBACzB,CAAC,CAAC,CAAC;gBACH,IAAI,WAAW,GAAG;oBAChB,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACjC,kBAAkB,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACvC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACnC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACjC,cAAc,EAAE,gBAAgB,CAAC,CAAC,CAAC;oBACnC,YAAY,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC;iBACxC,CAAC;gBACF,OAAO;oBACL,IAAI;oBACJ,KAAK,EAAE,WAAW;oBAClB,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;wBACpC,OAAO,MAAM,CAAC,MAAM,EAAE,CAAC;oBACzB,CAAC,CAAC;oBACF,UAAU,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;wBACpC,OAAO,MAAM,CAAC,KAAK,EAAE,CAAC;oBACxB,CAAC,CAAC;iBACH,CAAC;YACJ,CAAC,CAAC,CAAC;YACH,IAAI,KAAK,GAAG,OAAO,CAAC,GAAG,EAAG,CAAC;YAC3B,MAAM,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC;QACxB,CAAC,CAAC,CAAC;QAEH,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AA5DD,oCA4DC"}
|
@@ -40,28 +40,28 @@ function getPairKey(version) {
|
|
40
40
|
exports.getPairKey = getPairKey;
|
41
41
|
function getPairsV2FromTheGraph(url, length = 300) {
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
43
|
-
const query = (0, graphql_request_1.gql) `
|
44
|
-
{
|
45
|
-
pairs(
|
46
|
-
orderBy: reserveUSD
|
47
|
-
first: ${length}
|
48
|
-
orderDirection: desc
|
49
|
-
where: { trackedReserveETH_not: "0" }
|
50
|
-
) {
|
51
|
-
id
|
52
|
-
reserve0
|
53
|
-
reserve1
|
54
|
-
totalSupply
|
55
|
-
token0 {
|
56
|
-
id
|
57
|
-
decimals
|
58
|
-
}
|
59
|
-
token1 {
|
60
|
-
id
|
61
|
-
decimals
|
62
|
-
}
|
63
|
-
}
|
64
|
-
}
|
43
|
+
const query = (0, graphql_request_1.gql) `
|
44
|
+
{
|
45
|
+
pairs(
|
46
|
+
orderBy: reserveUSD
|
47
|
+
first: ${length}
|
48
|
+
orderDirection: desc
|
49
|
+
where: { trackedReserveETH_not: "0" }
|
50
|
+
) {
|
51
|
+
id
|
52
|
+
reserve0
|
53
|
+
reserve1
|
54
|
+
totalSupply
|
55
|
+
token0 {
|
56
|
+
id
|
57
|
+
decimals
|
58
|
+
}
|
59
|
+
token1 {
|
60
|
+
id
|
61
|
+
decimals
|
62
|
+
}
|
63
|
+
}
|
64
|
+
}
|
65
65
|
`;
|
66
66
|
const res = yield (0, graphql_request_1.default)(url, query);
|
67
67
|
const pairs = res.pairs;
|
@@ -42,20 +42,20 @@ const tokenPriceToAssetToken_1 = __importDefault(require("../../utils/misc/token
|
|
42
42
|
const clients_1 = require("../../utils/clients");
|
43
43
|
const getMultipleAccountsInfoSafe_1 = require("../../utils/solana/getMultipleAccountsInfoSafe");
|
44
44
|
const helpers_1 = require("./helpers");
|
45
|
-
const query = (0, graphql_request_1.gql) `
|
46
|
-
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
-
getAirdropFinalFrontend(authority: $authority) {
|
48
|
-
authority
|
49
|
-
community_allocation
|
50
|
-
eligibility
|
51
|
-
main_allocation
|
52
|
-
og_allocation
|
53
|
-
s1_allocation
|
54
|
-
s2_allocation
|
55
|
-
total_allocation
|
56
|
-
__typename
|
57
|
-
}
|
58
|
-
}
|
45
|
+
const query = (0, graphql_request_1.gql) `
|
46
|
+
query GetAirdropFinalFrontend($authority: String!) {
|
47
|
+
getAirdropFinalFrontend(authority: $authority) {
|
48
|
+
authority
|
49
|
+
community_allocation
|
50
|
+
eligibility
|
51
|
+
main_allocation
|
52
|
+
og_allocation
|
53
|
+
s1_allocation
|
54
|
+
s2_allocation
|
55
|
+
total_allocation
|
56
|
+
__typename
|
57
|
+
}
|
58
|
+
}
|
59
59
|
`;
|
60
60
|
const networkId = portfolio_core_1.NetworkId.solana;
|
61
61
|
const executor = (owner, cache) => __awaiter(void 0, void 0, void 0, function* () {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
const client_1 = require("@mysten/sui
|
3
|
+
const client_1 = require("@mysten/sui/client");
|
4
4
|
const portfolio_core_1 = require("@sonarwatch/portfolio-core");
|
5
5
|
const getBasicAuthHeaders_1 = require("../misc/getBasicAuthHeaders");
|
6
6
|
const constants_1 = require("./constants");
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getClientSui.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/getClientSui.ts"],"names":[],"mappings":";;AAAA
|
1
|
+
{"version":3,"file":"getClientSui.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/clients/getClientSui.ts"],"names":[],"mappings":";;AAAA,+CAG4B;AAC5B,+DAAuD;AACvD,qEAAkE;AAClE,2CAA6C;AAG7C,SAAwB,YAAY;IAClC,MAAM,WAAW,GAAG,IAAA,0BAAc,EAAC,0BAAS,CAAC,GAAG,CAAC,CAAC;IAClD,MAAM,WAAW,GAAG,WAAW,CAAC,SAAS;QACvC,CAAC,CAAC,IAAA,yCAAmB,EACjB,WAAW,CAAC,SAAS,CAAC,QAAQ,EAC9B,WAAW,CAAC,SAAS,CAAC,QAAQ,CAC/B;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,IAAI,kBAAe,CAAC;QACzB,SAAS,EAAE,IAAI,yBAAgB,CAAC;YAC9B,GAAG,EAAE,WAAW,CAAC,GAAG;YACpB,GAAG,EAAE;gBACH,OAAO,EAAE,WAAW;aACrB;SACF,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAjBD,+BAiBC"}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import { Aptos } from '@aptos-labs/ts-sdk';
|
2
|
-
import { SuiClient as MystenSuiClient } from '@mysten/sui
|
2
|
+
import { SuiClient as MystenSuiClient } from '@mysten/sui/client';
|
3
3
|
import { Connection } from '@solana/web3.js';
|
4
4
|
import { PublicClient } from 'viem';
|
5
5
|
export type EvmClient = PublicClient;
|
@@ -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,4 +1,4 @@
|
|
1
|
-
import { GetDynamicFieldObjectParams } from '@mysten/sui
|
1
|
+
import { GetDynamicFieldObjectParams } from '@mysten/sui/client';
|
2
2
|
import { SuiClient } from '../clients/types';
|
3
3
|
import { ObjectResponse } from './types';
|
4
4
|
export declare function getDynamicFieldObject<K>(client: SuiClient, params: GetDynamicFieldObjectParams): Promise<ObjectResponse<K>>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SuiObjectDataOptions } from '@mysten/sui
|
1
|
+
import { SuiObjectDataOptions } from '@mysten/sui/client';
|
2
2
|
import { SuiClient } from '../clients/types';
|
3
3
|
import { ObjectResponse } from './types';
|
4
4
|
export declare function getDynamicFieldObjects<K>(client: SuiClient, parentId: string, options?: SuiObjectDataOptions): Promise<ObjectResponse<K>[]>;
|
@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.getDynamicFieldObjects = void 0;
|
13
|
-
const getDynamicFields_1 = require("./getDynamicFields");
|
14
13
|
const multiGetObjects_1 = require("./multiGetObjects");
|
14
|
+
const getDynamicFields_1 = require("./getDynamicFields");
|
15
15
|
function getDynamicFieldObjects(client, parentId, options) {
|
16
16
|
return __awaiter(this, void 0, void 0, function* () {
|
17
17
|
const res = yield (0, getDynamicFields_1.getDynamicFields)(client, parentId);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDynamicFieldObjects.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFieldObjects.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,
|
1
|
+
{"version":3,"file":"getDynamicFieldObjects.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFieldObjects.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,uDAAoD;AACpD,yDAAsD;AAEtD,SAAsB,sBAAsB,CAC1C,MAAiB,EACjB,QAAgB,EAChB,OAA8B;;QAE9B,MAAM,GAAG,GAAG,MAAM,IAAA,mCAAgB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACrD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACvC,OAAO,IAAA,iCAAe,EAAI,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CAAA;AARD,wDAQC"}
|
@@ -0,0 +1,4 @@
|
|
1
|
+
import { SuiObjectDataOptions } from '@mysten/sui/client';
|
2
|
+
import { SuiClient } from '../clients/types';
|
3
|
+
import { ObjectResponse } from './types';
|
4
|
+
export declare function getDynamicFieldObjectsSafe<K>(client: SuiClient, parentId: string, options?: SuiObjectDataOptions): Promise<ObjectResponse<K>[]>;
|
@@ -0,0 +1,23 @@
|
|
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.getDynamicFieldObjectsSafe = void 0;
|
13
|
+
const getDynamicFieldsSafe_1 = require("./getDynamicFieldsSafe");
|
14
|
+
const multiGetObjects_1 = require("./multiGetObjects");
|
15
|
+
function getDynamicFieldObjectsSafe(client, parentId, options) {
|
16
|
+
return __awaiter(this, void 0, void 0, function* () {
|
17
|
+
const res = yield (0, getDynamicFieldsSafe_1.getDynamicFieldsSafe)(client, parentId);
|
18
|
+
const ids = res.map((r) => r.objectId);
|
19
|
+
return (0, multiGetObjects_1.multiGetObjects)(client, ids, options);
|
20
|
+
});
|
21
|
+
}
|
22
|
+
exports.getDynamicFieldObjectsSafe = getDynamicFieldObjectsSafe;
|
23
|
+
//# sourceMappingURL=getDynamicFieldObjectsSafe.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getDynamicFieldObjectsSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFieldObjectsSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,iEAA8D;AAC9D,uDAAoD;AAEpD,SAAsB,0BAA0B,CAC9C,MAAiB,EACjB,QAAgB,EAChB,OAA8B;;QAE9B,MAAM,GAAG,GAAG,MAAM,IAAA,2CAAoB,EAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QACzD,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;QACvC,OAAO,IAAA,iCAAe,EAAI,MAAM,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;IAClD,CAAC;CAAA;AARD,gEAQC"}
|
@@ -1,3 +1,3 @@
|
|
1
|
-
import { DynamicFieldInfo } from '@mysten/sui
|
1
|
+
import { DynamicFieldInfo } from '@mysten/sui/client';
|
2
2
|
import { SuiClient } from '../clients/types';
|
3
3
|
export declare function getDynamicFields(client: SuiClient, parentId: string, objectOnly?: boolean): Promise<DynamicFieldInfo[]>;
|
@@ -10,10 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
10
10
|
};
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
12
12
|
exports.getDynamicFields = void 0;
|
13
|
-
const maxPage = 25;
|
14
13
|
function getDynamicFields(client, parentId, objectOnly) {
|
15
14
|
return __awaiter(this, void 0, void 0, function* () {
|
16
|
-
let page = 0;
|
17
15
|
let hasNextPage = true;
|
18
16
|
let cursor;
|
19
17
|
const objects = [];
|
@@ -29,8 +27,7 @@ function getDynamicFields(client, parentId, objectOnly) {
|
|
29
27
|
});
|
30
28
|
cursor = res.nextCursor;
|
31
29
|
hasNextPage = res.hasNextPage;
|
32
|
-
|
33
|
-
} while (hasNextPage && page <= maxPage);
|
30
|
+
} while (hasNextPage);
|
34
31
|
return objects;
|
35
32
|
});
|
36
33
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getDynamicFields.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFields.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,
|
1
|
+
{"version":3,"file":"getDynamicFields.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFields.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,SAAsB,gBAAgB,CACpC,MAAiB,EACjB,QAAgB,EAChB,UAAoB;;QAEpB,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAiC,CAAC;QAEtC,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,GAAG,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;gBACxC,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;YACH,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACrB,IAAI,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe;oBAAE,OAAO;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;QAChC,CAAC,QAAQ,WAAW,EAAE;QACtB,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAtBD,4CAsBC"}
|
@@ -0,0 +1,38 @@
|
|
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.getDynamicFieldsSafe = void 0;
|
13
|
+
const maxPage = 25;
|
14
|
+
function getDynamicFieldsSafe(client, parentId, objectOnly) {
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
16
|
+
let page = 0;
|
17
|
+
let hasNextPage = true;
|
18
|
+
let cursor;
|
19
|
+
const objects = [];
|
20
|
+
do {
|
21
|
+
const res = yield client.getDynamicFields({
|
22
|
+
parentId,
|
23
|
+
cursor,
|
24
|
+
});
|
25
|
+
res.data.forEach((o) => {
|
26
|
+
if (objectOnly && o.type !== 'DynamicObject')
|
27
|
+
return;
|
28
|
+
objects.push(o);
|
29
|
+
});
|
30
|
+
cursor = res.nextCursor;
|
31
|
+
hasNextPage = res.hasNextPage;
|
32
|
+
page += 1;
|
33
|
+
} while (hasNextPage && page <= maxPage);
|
34
|
+
return objects;
|
35
|
+
});
|
36
|
+
}
|
37
|
+
exports.getDynamicFieldsSafe = getDynamicFieldsSafe;
|
38
|
+
//# sourceMappingURL=getDynamicFieldsSafe.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getDynamicFieldsSafe.js","sourceRoot":"","sources":["../../../../../../packages/plugins/src/utils/sui/getDynamicFieldsSafe.ts"],"names":[],"mappings":";;;;;;;;;;;;AAGA,MAAM,OAAO,GAAG,EAAE,CAAC;AACnB,SAAsB,oBAAoB,CACxC,MAAiB,EACjB,QAAgB,EAChB,UAAoB;;QAEpB,IAAI,IAAI,GAAG,CAAC,CAAC;QACb,IAAI,WAAW,GAAG,IAAI,CAAC;QACvB,IAAI,MAAiC,CAAC;QAEtC,MAAM,OAAO,GAAuB,EAAE,CAAC;QACvC,GAAG,CAAC;YACF,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,gBAAgB,CAAC;gBACxC,QAAQ;gBACR,MAAM;aACP,CAAC,CAAC;YACH,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE;gBACrB,IAAI,UAAU,IAAI,CAAC,CAAC,IAAI,KAAK,eAAe;oBAAE,OAAO;gBACrD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAClB,CAAC,CAAC,CAAC;YACH,MAAM,GAAG,GAAG,CAAC,UAAU,CAAC;YACxB,WAAW,GAAG,GAAG,CAAC,WAAW,CAAC;YAC9B,IAAI,IAAI,CAAC,CAAC;QACZ,CAAC,QAAQ,WAAW,IAAI,IAAI,IAAI,OAAO,EAAE;QACzC,OAAO,OAAO,CAAC;IACjB,CAAC;CAAA;AAxBD,oDAwBC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SuiObjectDataOptions } from '@mysten/sui
|
1
|
+
import { SuiObjectDataOptions } from '@mysten/sui/client';
|
2
2
|
import { SuiClient } from '../clients/types';
|
3
3
|
import { ObjectResponse } from './types';
|
4
4
|
export declare function getObject<K>(client: SuiClient, id: string, options?: SuiObjectDataOptions): Promise<ObjectResponse<K>>;
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { SuiObjectResponseQuery } from '@mysten/sui
|
1
|
+
import { SuiObjectResponseQuery } from '@mysten/sui/client';
|
2
2
|
import { SuiClient } from '../clients/types';
|
3
3
|
import { ObjectResponse } from './types';
|
4
4
|
export declare function getOwnedObjects<K>(client: SuiClient, owner: string, query?: SuiObjectResponseQuery): Promise<ObjectResponse<K>[]>;
|