@typus/typus-sdk 1.8.41 → 1.8.43-upgrade
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/auto-bid/view-function.d.ts +0 -2
- package/dist/src/auto-bid/view-function.js +7 -76
- package/dist/src/constants/constant.d.ts +0 -3
- package/dist/src/constants/constant.js +1 -8
- package/dist/src/constants/token.d.ts +1 -1
- package/dist/src/constants/token.js +12 -0
- package/dist/src/dice/fetch.d.ts +0 -4
- package/dist/src/dice/fetch.js +59 -116
- package/dist/src/typus/airdrop/view-function.js +5 -8
- package/dist/src/typus/leaderboard/view-function.js +5 -8
- package/dist/src/typus/tails-staking/view-function.js +10 -14
- package/dist/src/typus/user/view-function.js +5 -6
- package/dist/src/typus-dov-single-v2/function/bidding.d.ts +4 -3
- package/dist/src/typus-dov-single-v2/function/bidding.js +10 -11
- package/dist/src/typus-dov-single-v2/function/token.js +1 -1
- package/dist/src/typus-dov-single-v2/history/index.d.ts +0 -1
- package/dist/src/typus-dov-single-v2/history/index.js +0 -1
- package/dist/src/typus-dov-single-v2/history/user-history.d.ts +2 -3
- package/dist/src/typus-dov-single-v2/history/user-history.js +122 -184
- package/dist/src/typus-dov-single-v2/otc-entry.js +5 -6
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +1 -1
- package/dist/src/typus-dov-single-v2/view-function.js +29 -27
- package/dist/src/typus-hedge/view-function.js +10 -10
- package/dist/src/typus-launch/airdrop/view-function.js +3 -5
- package/dist/src/typus-launch/auction/view-function.js +17 -16
- package/dist/src/typus-launch/funding-vault/view-function.js +20 -18
- package/dist/src/typus-launch/improvement-proposal/view-function.js +17 -18
- package/dist/src/typus-launch/ve-typus/view-function.js +15 -15
- package/dist/src/typus-safu/view-function.js +13 -13
- package/dist/src/utils/api/price.js +1 -1
- package/dist/src/utils/graphQl.d.ts +24 -0
- package/dist/src/utils/graphQl.js +129 -0
- package/dist/src/utils/index.d.ts +1 -0
- package/dist/src/utils/index.js +1 -0
- package/dist/src/utils/oracle.js +13 -14
- package/dist/src/utils/pyth/constant.js +4 -0
- package/dist/src/utils/sponsoredTx.d.ts +2 -2
- package/dist/src/utils/typusConfig.d.ts +4 -0
- package/dist/src/utils/typusConfig.js +33 -31
- package/package.json +9 -10
- package/dist/src/dice/view-function.d.ts +0 -1
- package/dist/src/dice/view-function.js +0 -20
- package/dist/src/typus-dov-single-v2/history/vault-history.d.ts +0 -123
- package/dist/src/typus-dov-single-v2/history/vault-history.js +0 -307
- package/dist/src/typus-nft/fetch.d.ts +0 -70
- package/dist/src/typus-nft/fetch.js +0 -631
- package/dist/src/typus-nft/index.d.ts +0 -2
- package/dist/src/typus-nft/index.js +0 -18
- package/dist/src/typus-nft/user-entry.d.ts +0 -57
- package/dist/src/typus-nft/user-entry.js +0 -161
|
@@ -41,11 +41,9 @@ exports.removeOtcConfig = removeOtcConfig;
|
|
|
41
41
|
exports.otc = otc;
|
|
42
42
|
exports.getUserOtcConfigs = getUserOtcConfigs;
|
|
43
43
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
44
|
-
var client_1 = require("@mysten/sui/client");
|
|
45
44
|
var constants_1 = require("../../src/constants");
|
|
46
45
|
var utils_1 = require("../../src/utils");
|
|
47
46
|
var bcs_1 = require("@mysten/bcs");
|
|
48
|
-
var constants_2 = require("../../src/constants");
|
|
49
47
|
/**
|
|
50
48
|
entry fun add_otc_config(
|
|
51
49
|
registry: &mut Registry,
|
|
@@ -129,7 +127,7 @@ function getUserOtcConfigs(config, input) {
|
|
|
129
127
|
return __generator(this, function (_a) {
|
|
130
128
|
switch (_a.label) {
|
|
131
129
|
case 0:
|
|
132
|
-
provider =
|
|
130
|
+
provider = config.gRpcClient();
|
|
133
131
|
transaction = new transactions_1.Transaction();
|
|
134
132
|
transaction.moveCall({
|
|
135
133
|
target: "".concat(config.package.dovSingle, "::tds_otc_entry::get_user_otc_configs"),
|
|
@@ -140,10 +138,11 @@ function getUserOtcConfigs(config, input) {
|
|
|
140
138
|
transaction.pure.vector("u64", input.indexes),
|
|
141
139
|
],
|
|
142
140
|
});
|
|
143
|
-
return [4 /*yield*/, provider.
|
|
141
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
144
142
|
case 1:
|
|
145
|
-
results = (_a.sent())
|
|
146
|
-
|
|
143
|
+
results = (_a.sent())
|
|
144
|
+
.commandResults;
|
|
145
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
147
146
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
148
147
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
149
148
|
reader.readULEB();
|
|
@@ -126,7 +126,7 @@ export declare function getSplitBidReceiptTx(config: TypusConfig, tx: Transactio
|
|
|
126
126
|
receipts: string[];
|
|
127
127
|
share?: string;
|
|
128
128
|
recipient: string;
|
|
129
|
-
}): import("@mysten/sui/transactions").TransactionResult;
|
|
129
|
+
}): import("@mysten/sui/transactions", { with: { "resolution-mode": "import" } }).TransactionResult;
|
|
130
130
|
export declare function getMultiTransferBidReceiptTx(config: TypusConfig, input: {
|
|
131
131
|
typeArguments: string[];
|
|
132
132
|
index: string;
|
|
@@ -59,17 +59,15 @@ exports.getDepositShares = getDepositShares;
|
|
|
59
59
|
exports.getMyBids = getMyBids;
|
|
60
60
|
exports.getRefundShares = getRefundShares;
|
|
61
61
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
62
|
-
var client_1 = require("@mysten/sui/client");
|
|
63
62
|
var bcs_1 = require("@mysten/bcs");
|
|
64
63
|
var utils_1 = require("../../src/utils");
|
|
65
|
-
var constants_1 = require("../../src/constants");
|
|
66
64
|
function getVaults(config, input) {
|
|
67
65
|
return __awaiter(this, void 0, void 0, function () {
|
|
68
66
|
var provider, transaction, target, transactionBlockArguments, results, bytes, reader, result;
|
|
69
67
|
return __generator(this, function (_a) {
|
|
70
68
|
switch (_a.label) {
|
|
71
69
|
case 0:
|
|
72
|
-
provider =
|
|
70
|
+
provider = config.gRpcClient();
|
|
73
71
|
transaction = new transactions_1.Transaction();
|
|
74
72
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_vault_data_bcs");
|
|
75
73
|
transactionBlockArguments = [transaction.object(config.registry.dov.dovSingle), transaction.pure.vector("u64", input.indexes)];
|
|
@@ -78,10 +76,11 @@ function getVaults(config, input) {
|
|
|
78
76
|
typeArguments: [],
|
|
79
77
|
arguments: transactionBlockArguments,
|
|
80
78
|
});
|
|
81
|
-
return [4 /*yield*/, provider.
|
|
79
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
82
80
|
case 1:
|
|
83
|
-
results = (_a.sent())
|
|
84
|
-
|
|
81
|
+
results = (_a.sent())
|
|
82
|
+
.commandResults;
|
|
83
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
85
84
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
86
85
|
result = {};
|
|
87
86
|
reader.readVec(function (reader) {
|
|
@@ -300,7 +299,7 @@ function getAuctions(config, input) {
|
|
|
300
299
|
return __generator(this, function (_a) {
|
|
301
300
|
switch (_a.label) {
|
|
302
301
|
case 0:
|
|
303
|
-
provider =
|
|
302
|
+
provider = config.gRpcClient();
|
|
304
303
|
transaction = new transactions_1.Transaction();
|
|
305
304
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_auction_bcs");
|
|
306
305
|
transactionBlockArguments = [transaction.object(config.registry.dov.dovSingle), transaction.pure.vector("u64", input.indexes)];
|
|
@@ -309,10 +308,11 @@ function getAuctions(config, input) {
|
|
|
309
308
|
typeArguments: [],
|
|
310
309
|
arguments: transactionBlockArguments,
|
|
311
310
|
});
|
|
312
|
-
return [4 /*yield*/, provider.
|
|
311
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
313
312
|
case 1:
|
|
314
|
-
results = (_a.sent())
|
|
315
|
-
|
|
313
|
+
results = (_a.sent())
|
|
314
|
+
.commandResults;
|
|
315
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
316
316
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
317
317
|
result = {};
|
|
318
318
|
reader.readVec(function (reader) {
|
|
@@ -368,7 +368,7 @@ function getAuctionBids(config, input) {
|
|
|
368
368
|
return __generator(this, function (_a) {
|
|
369
369
|
switch (_a.label) {
|
|
370
370
|
case 0:
|
|
371
|
-
provider =
|
|
371
|
+
provider = config.gRpcClient();
|
|
372
372
|
transaction = new transactions_1.Transaction();
|
|
373
373
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_auction_bids_bcs");
|
|
374
374
|
transactionBlockArguments = [transaction.object(config.registry.dov.dovSingle), transaction.pure.u64(input.index)];
|
|
@@ -377,10 +377,11 @@ function getAuctionBids(config, input) {
|
|
|
377
377
|
typeArguments: [],
|
|
378
378
|
arguments: transactionBlockArguments,
|
|
379
379
|
});
|
|
380
|
-
return [4 /*yield*/, provider.
|
|
380
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
381
381
|
case 1:
|
|
382
|
-
results = (_a.sent())
|
|
383
|
-
|
|
382
|
+
results = (_a.sent())
|
|
383
|
+
.commandResults;
|
|
384
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
384
385
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
385
386
|
result = reader.readVec(function (reader, i) {
|
|
386
387
|
reader.read8();
|
|
@@ -407,7 +408,7 @@ function getDepositShares(config, input) {
|
|
|
407
408
|
return __generator(this, function (_a) {
|
|
408
409
|
switch (_a.label) {
|
|
409
410
|
case 0:
|
|
410
|
-
provider =
|
|
411
|
+
provider = config.gRpcClient();
|
|
411
412
|
transaction = new transactions_1.Transaction();
|
|
412
413
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_deposit_shares_bcs");
|
|
413
414
|
transactionBlockArguments = [
|
|
@@ -423,10 +424,11 @@ function getDepositShares(config, input) {
|
|
|
423
424
|
typeArguments: [],
|
|
424
425
|
arguments: transactionBlockArguments,
|
|
425
426
|
});
|
|
426
|
-
return [4 /*yield*/, provider.
|
|
427
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
427
428
|
case 1:
|
|
428
|
-
results = (_a.sent())
|
|
429
|
-
|
|
429
|
+
results = (_a.sent())
|
|
430
|
+
.commandResults;
|
|
431
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
430
432
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
431
433
|
depositShare = Array.from(new Map()).reduce(function (map, _a) {
|
|
432
434
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
@@ -478,7 +480,7 @@ function getMyBids(config, input) {
|
|
|
478
480
|
return __generator(this, function (_a) {
|
|
479
481
|
switch (_a.label) {
|
|
480
482
|
case 0:
|
|
481
|
-
provider =
|
|
483
|
+
provider = config.gRpcClient();
|
|
482
484
|
transaction = new transactions_1.Transaction();
|
|
483
485
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_my_bids_bcs");
|
|
484
486
|
transactionBlockArguments = [
|
|
@@ -493,9 +495,10 @@ function getMyBids(config, input) {
|
|
|
493
495
|
typeArguments: [],
|
|
494
496
|
arguments: transactionBlockArguments,
|
|
495
497
|
});
|
|
496
|
-
return [4 /*yield*/, provider.
|
|
498
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
497
499
|
case 1:
|
|
498
|
-
results = (_a.sent())
|
|
500
|
+
results = (_a.sent())
|
|
501
|
+
.commandResults;
|
|
499
502
|
if (!results) {
|
|
500
503
|
// early return if no results
|
|
501
504
|
return [2 /*return*/, {}];
|
|
@@ -545,7 +548,7 @@ function getRefundShares(config, input) {
|
|
|
545
548
|
return __generator(this, function (_a) {
|
|
546
549
|
switch (_a.label) {
|
|
547
550
|
case 0:
|
|
548
|
-
provider =
|
|
551
|
+
provider = config.gRpcClient();
|
|
549
552
|
transaction = new transactions_1.Transaction();
|
|
550
553
|
target = "".concat(config.package.dovSingle, "::tds_view_function::get_refund_shares_bcs");
|
|
551
554
|
transactionBlockArguments = [transaction.object(config.registry.dov.dovSingle)];
|
|
@@ -556,12 +559,11 @@ function getRefundShares(config, input) {
|
|
|
556
559
|
arguments: transactionBlockArguments,
|
|
557
560
|
});
|
|
558
561
|
});
|
|
559
|
-
return [4 /*yield*/, provider.
|
|
560
|
-
|
|
561
|
-
sender: input.user,
|
|
562
|
+
return [4 /*yield*/, provider.simulateTransaction({
|
|
563
|
+
transaction: transaction,
|
|
562
564
|
})];
|
|
563
565
|
case 1:
|
|
564
|
-
results = (_a.sent()).
|
|
566
|
+
results = (_a.sent()).commandResults;
|
|
565
567
|
refundShares = Array.from(new Map()).reduce(function (map, _a) {
|
|
566
568
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
567
569
|
map[key] = value;
|
|
@@ -570,7 +572,7 @@ function getRefundShares(config, input) {
|
|
|
570
572
|
// @ts-ignore
|
|
571
573
|
results.forEach(function (result) {
|
|
572
574
|
// @ts-ignore
|
|
573
|
-
var bytes = result.returnValues[0]
|
|
575
|
+
var bytes = result.returnValues[0].bcs;
|
|
574
576
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
575
577
|
reader.read8();
|
|
576
578
|
refundShares[String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.readULEB())))] = reader.read64();
|
|
@@ -39,27 +39,26 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.getVaultData = getVaultData;
|
|
40
40
|
exports.getShareData = getShareData;
|
|
41
41
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
42
|
-
var client_1 = require("@mysten/sui/client");
|
|
43
42
|
var bcs_1 = require("@mysten/bcs");
|
|
44
43
|
var utils_1 = require("../../src/utils");
|
|
45
|
-
var constants_1 = require("../../src/constants");
|
|
46
44
|
function getVaultData(config, input) {
|
|
47
45
|
return __awaiter(this, void 0, void 0, function () {
|
|
48
46
|
var provider, transaction, results, bytes, reader, result;
|
|
49
47
|
return __generator(this, function (_a) {
|
|
50
48
|
switch (_a.label) {
|
|
51
49
|
case 0:
|
|
52
|
-
provider =
|
|
50
|
+
provider = config.gRpcClient();
|
|
53
51
|
transaction = new transactions_1.Transaction();
|
|
54
52
|
transaction.moveCall({
|
|
55
53
|
target: "".concat(config.package.hedge.hedge, "::view_function::get_vault_data_bcs"),
|
|
56
54
|
typeArguments: [],
|
|
57
55
|
arguments: [transaction.object(config.registry.hedge.hedge), transaction.pure.vector("u64", input.indexes)],
|
|
58
56
|
});
|
|
59
|
-
return [4 /*yield*/, provider.
|
|
57
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
60
58
|
case 1:
|
|
61
|
-
results = (_a.sent())
|
|
62
|
-
|
|
59
|
+
results = (_a.sent())
|
|
60
|
+
.commandResults;
|
|
61
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
63
62
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
64
63
|
result = {};
|
|
65
64
|
reader.readVec(function (reader) {
|
|
@@ -138,7 +137,7 @@ function getShareData(config, input) {
|
|
|
138
137
|
return __generator(this, function (_a) {
|
|
139
138
|
switch (_a.label) {
|
|
140
139
|
case 0:
|
|
141
|
-
provider =
|
|
140
|
+
provider = config.gRpcClient();
|
|
142
141
|
transaction = new transactions_1.Transaction();
|
|
143
142
|
transaction.moveCall({
|
|
144
143
|
target: "".concat(config.package.hedge.hedge, "::view_function::get_user_share_data_bcs"),
|
|
@@ -149,10 +148,11 @@ function getShareData(config, input) {
|
|
|
149
148
|
transaction.pure.vector("u64", input.indexes),
|
|
150
149
|
],
|
|
151
150
|
});
|
|
152
|
-
return [4 /*yield*/, provider.
|
|
151
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
153
152
|
case 1:
|
|
154
|
-
results = (_a.sent())
|
|
155
|
-
|
|
153
|
+
results = (_a.sent())
|
|
154
|
+
.commandResults;
|
|
155
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
156
156
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
157
157
|
result = {};
|
|
158
158
|
reader.readVec(function (reader) {
|
|
@@ -38,9 +38,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.getAirdrop = getAirdrop;
|
|
40
40
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
41
|
-
var client_1 = require("@mysten/sui/client");
|
|
42
41
|
var bcs_1 = require("@mysten/bcs");
|
|
43
|
-
var constants_1 = require("../../../src/constants");
|
|
44
42
|
/**
|
|
45
43
|
public(package) fun get_airdrop_bcs(
|
|
46
44
|
registry: &Registry,
|
|
@@ -53,16 +51,16 @@ function getAirdrop(config, input) {
|
|
|
53
51
|
return __generator(this, function (_a) {
|
|
54
52
|
switch (_a.label) {
|
|
55
53
|
case 0:
|
|
56
|
-
provider =
|
|
54
|
+
provider = config.gRpcClient();
|
|
57
55
|
transaction = new transactions_1.Transaction();
|
|
58
56
|
transaction.moveCall({
|
|
59
57
|
target: "".concat(config.package.launch.airdrop, "::airdrop::get_airdrop_bcs"),
|
|
60
58
|
arguments: [transaction.object(config.registry.launch.airdrop), transaction.pure.address(input.user)],
|
|
61
59
|
});
|
|
62
|
-
return [4 /*yield*/, provider.
|
|
60
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction })];
|
|
63
61
|
case 1:
|
|
64
62
|
devInspectTransactionBlockResult = _a.sent();
|
|
65
|
-
bytes = devInspectTransactionBlockResult.
|
|
63
|
+
bytes = devInspectTransactionBlockResult.commandResults[0].returnValues[0].bcs;
|
|
66
64
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
67
65
|
reader.readULEB();
|
|
68
66
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
@@ -41,9 +41,7 @@ exports.getBidderInfo = getBidderInfo;
|
|
|
41
41
|
exports.getBiddersInfo = getBiddersInfo;
|
|
42
42
|
exports.getLaunchAuction = getLaunchAuction;
|
|
43
43
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
44
|
-
var client_1 = require("@mysten/sui/client");
|
|
45
44
|
var bcs_1 = require("@mysten/bcs");
|
|
46
|
-
var constants_1 = require("../../../src/constants");
|
|
47
45
|
var utils_1 = require("../../../src/utils");
|
|
48
46
|
function getLaunchAuctionBids(config) {
|
|
49
47
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -51,7 +49,7 @@ function getLaunchAuctionBids(config) {
|
|
|
51
49
|
return __generator(this, function (_a) {
|
|
52
50
|
switch (_a.label) {
|
|
53
51
|
case 0:
|
|
54
|
-
provider =
|
|
52
|
+
provider = config.gRpcClient();
|
|
55
53
|
transaction = new transactions_1.Transaction();
|
|
56
54
|
target = "".concat(config.package.launch.auction, "::auction::get_records_bcs");
|
|
57
55
|
transactionBlockArguments = [transaction.object(config.object.launchAuction)];
|
|
@@ -60,10 +58,11 @@ function getLaunchAuctionBids(config) {
|
|
|
60
58
|
typeArguments: [],
|
|
61
59
|
arguments: transactionBlockArguments,
|
|
62
60
|
});
|
|
63
|
-
return [4 /*yield*/, provider.
|
|
61
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
64
62
|
case 1:
|
|
65
|
-
results = (_a.sent())
|
|
66
|
-
|
|
63
|
+
results = (_a.sent())
|
|
64
|
+
.commandResults;
|
|
65
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
67
66
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
68
67
|
result = reader.readVec(function (reader, i) {
|
|
69
68
|
reader.read8();
|
|
@@ -87,7 +86,7 @@ function getBidderInfo(config, bidder) {
|
|
|
87
86
|
return __generator(this, function (_a) {
|
|
88
87
|
switch (_a.label) {
|
|
89
88
|
case 0:
|
|
90
|
-
provider =
|
|
89
|
+
provider = config.gRpcClient();
|
|
91
90
|
transaction = new transactions_1.Transaction();
|
|
92
91
|
target = "".concat(config.package.launch.auction, "::auction::get_bidder_info");
|
|
93
92
|
transactionBlockArguments = [transaction.object(config.object.launchAuction), transaction.pure.address(bidder)];
|
|
@@ -96,10 +95,11 @@ function getBidderInfo(config, bidder) {
|
|
|
96
95
|
typeArguments: [],
|
|
97
96
|
arguments: transactionBlockArguments,
|
|
98
97
|
});
|
|
99
|
-
return [4 /*yield*/, provider.
|
|
98
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
100
99
|
case 1:
|
|
101
|
-
results = (_a.sent())
|
|
102
|
-
|
|
100
|
+
results = (_a.sent())
|
|
101
|
+
.commandResults;
|
|
102
|
+
bytes = results[results.length - 1].returnValues[0].bcs;
|
|
103
103
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
104
104
|
reader.read8();
|
|
105
105
|
bid = {
|
|
@@ -121,7 +121,7 @@ function getBiddersInfo(config, bidders) {
|
|
|
121
121
|
return __generator(this, function (_a) {
|
|
122
122
|
switch (_a.label) {
|
|
123
123
|
case 0:
|
|
124
|
-
provider =
|
|
124
|
+
provider = config.gRpcClient();
|
|
125
125
|
transaction = new transactions_1.Transaction();
|
|
126
126
|
bidders.forEach(function (bidder) {
|
|
127
127
|
transaction.moveCall({
|
|
@@ -129,13 +129,14 @@ function getBiddersInfo(config, bidders) {
|
|
|
129
129
|
arguments: [transaction.object(config.object.launchAuction), transaction.pure.address(bidder)],
|
|
130
130
|
});
|
|
131
131
|
});
|
|
132
|
-
return [4 /*yield*/, provider.
|
|
132
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
133
133
|
case 1:
|
|
134
|
-
results = (_a.sent())
|
|
134
|
+
results = (_a.sent())
|
|
135
|
+
.commandResults;
|
|
135
136
|
bids = {};
|
|
136
137
|
results === null || results === void 0 ? void 0 : results.forEach(function (result, i) {
|
|
137
138
|
// @ts-ignore
|
|
138
|
-
var bytes = result.returnValues[0]
|
|
139
|
+
var bytes = result.returnValues[0].bcs;
|
|
139
140
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
140
141
|
reader.read8();
|
|
141
142
|
var bid = {
|
|
@@ -159,8 +160,8 @@ function getLaunchAuction(config) {
|
|
|
159
160
|
return __generator(this, function (_a) {
|
|
160
161
|
switch (_a.label) {
|
|
161
162
|
case 0:
|
|
162
|
-
provider =
|
|
163
|
-
return [4 /*yield*/, provider.getObject({
|
|
163
|
+
provider = config.gRpcClient();
|
|
164
|
+
return [4 /*yield*/, provider.getObject({ objectId: config.object.launchAuction, include: { content: true } })];
|
|
164
165
|
case 1:
|
|
165
166
|
response = _a.sent();
|
|
166
167
|
// @ts-ignore
|
|
@@ -41,9 +41,7 @@ exports.getFund = getFund;
|
|
|
41
41
|
exports.getRefund = getRefund;
|
|
42
42
|
exports.getAllFunds = getAllFunds;
|
|
43
43
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
44
|
-
var client_1 = require("@mysten/sui/client");
|
|
45
44
|
var bcs_1 = require("@mysten/bcs");
|
|
46
|
-
var constants_1 = require("../../../src/constants");
|
|
47
45
|
var utils_1 = require("../../../src/utils");
|
|
48
46
|
function getVault(config, input) {
|
|
49
47
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -51,7 +49,7 @@ function getVault(config, input) {
|
|
|
51
49
|
return __generator(this, function (_a) {
|
|
52
50
|
switch (_a.label) {
|
|
53
51
|
case 0:
|
|
54
|
-
provider =
|
|
52
|
+
provider = config.gRpcClient();
|
|
55
53
|
transaction = new transactions_1.Transaction();
|
|
56
54
|
input.indexes.forEach(function (index) {
|
|
57
55
|
transaction.moveCall({
|
|
@@ -59,13 +57,14 @@ function getVault(config, input) {
|
|
|
59
57
|
arguments: [transaction.object(config.registry.launch.fundingVault), transaction.pure.u64(index)],
|
|
60
58
|
});
|
|
61
59
|
});
|
|
62
|
-
return [4 /*yield*/, provider.
|
|
60
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
63
61
|
case 1:
|
|
64
|
-
results = (_a.sent())
|
|
62
|
+
results = (_a.sent())
|
|
63
|
+
.commandResults;
|
|
65
64
|
vaults = {};
|
|
66
65
|
results === null || results === void 0 ? void 0 : results.forEach(function (result) {
|
|
67
66
|
// @ts-ignore
|
|
68
|
-
var bytes = result.returnValues[0]
|
|
67
|
+
var bytes = result.returnValues[0].bcs;
|
|
69
68
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
70
69
|
reader.readULEB();
|
|
71
70
|
var id = (0, utils_1.AddressFromBytes)(reader.readBytes(32));
|
|
@@ -102,7 +101,7 @@ function getFund(config, input) {
|
|
|
102
101
|
return __generator(this, function (_a) {
|
|
103
102
|
switch (_a.label) {
|
|
104
103
|
case 0:
|
|
105
|
-
provider =
|
|
104
|
+
provider = config.gRpcClient();
|
|
106
105
|
transaction = new transactions_1.Transaction();
|
|
107
106
|
input.indexes.forEach(function (index) {
|
|
108
107
|
transaction.moveCall({
|
|
@@ -114,13 +113,14 @@ function getFund(config, input) {
|
|
|
114
113
|
],
|
|
115
114
|
});
|
|
116
115
|
});
|
|
117
|
-
return [4 /*yield*/, provider.
|
|
116
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
118
117
|
case 1:
|
|
119
|
-
results = (_a.sent())
|
|
118
|
+
results = (_a.sent())
|
|
119
|
+
.commandResults;
|
|
120
120
|
funds = {};
|
|
121
121
|
results === null || results === void 0 ? void 0 : results.forEach(function (result, i) {
|
|
122
122
|
// @ts-ignore
|
|
123
|
-
var bytes = result.returnValues[0]
|
|
123
|
+
var bytes = result.returnValues[0].bcs;
|
|
124
124
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
125
125
|
reader.readULEB();
|
|
126
126
|
var fund = reader.readVec(function (reader) {
|
|
@@ -142,7 +142,7 @@ function getRefund(config, input) {
|
|
|
142
142
|
return __generator(this, function (_a) {
|
|
143
143
|
switch (_a.label) {
|
|
144
144
|
case 0:
|
|
145
|
-
provider =
|
|
145
|
+
provider = config.gRpcClient();
|
|
146
146
|
transaction = new transactions_1.Transaction();
|
|
147
147
|
input.indexes.forEach(function (index) {
|
|
148
148
|
transaction.moveCall({
|
|
@@ -154,13 +154,14 @@ function getRefund(config, input) {
|
|
|
154
154
|
],
|
|
155
155
|
});
|
|
156
156
|
});
|
|
157
|
-
return [4 /*yield*/, provider.
|
|
157
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
158
158
|
case 1:
|
|
159
|
-
results = (_a.sent())
|
|
159
|
+
results = (_a.sent())
|
|
160
|
+
.commandResults;
|
|
160
161
|
funds = {};
|
|
161
162
|
results === null || results === void 0 ? void 0 : results.forEach(function (result, i) {
|
|
162
163
|
// @ts-ignore
|
|
163
|
-
var bytes = result.returnValues[0]
|
|
164
|
+
var bytes = result.returnValues[0].bcs;
|
|
164
165
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
165
166
|
reader.readULEB();
|
|
166
167
|
var fund = reader.readVec(function (reader) {
|
|
@@ -182,7 +183,7 @@ function getAllFunds(config, input) {
|
|
|
182
183
|
return __generator(this, function (_a) {
|
|
183
184
|
switch (_a.label) {
|
|
184
185
|
case 0:
|
|
185
|
-
provider =
|
|
186
|
+
provider = config.gRpcClient();
|
|
186
187
|
transaction = new transactions_1.Transaction();
|
|
187
188
|
input.users.forEach(function (user) {
|
|
188
189
|
transaction.moveCall({
|
|
@@ -194,13 +195,14 @@ function getAllFunds(config, input) {
|
|
|
194
195
|
],
|
|
195
196
|
});
|
|
196
197
|
});
|
|
197
|
-
return [4 /*yield*/, provider.
|
|
198
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
198
199
|
case 1:
|
|
199
|
-
results = (_a.sent())
|
|
200
|
+
results = (_a.sent())
|
|
201
|
+
.commandResults;
|
|
200
202
|
funds = [];
|
|
201
203
|
results === null || results === void 0 ? void 0 : results.forEach(function (result, i) {
|
|
202
204
|
// @ts-ignore
|
|
203
|
-
var bytes = result.returnValues[0]
|
|
205
|
+
var bytes = result.returnValues[0].bcs;
|
|
204
206
|
var reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
205
207
|
reader.readULEB();
|
|
206
208
|
var fund = reader.readVec(function (reader) {
|
|
@@ -42,10 +42,8 @@ exports.getOngoingTipVotes = getOngoingTipVotes;
|
|
|
42
42
|
exports.getEndedTipVotes = getEndedTipVotes;
|
|
43
43
|
exports.getTipVotes = getTipVotes;
|
|
44
44
|
var transactions_1 = require("@mysten/sui/transactions");
|
|
45
|
-
var client_1 = require("@mysten/sui/client");
|
|
46
45
|
var bcs_1 = require("@mysten/bcs");
|
|
47
46
|
var utils_1 = require("../../../src/utils");
|
|
48
|
-
var constants_1 = require("../../../src/constants");
|
|
49
47
|
/**
|
|
50
48
|
public(package) fun get_ongoing_tips_bcs(
|
|
51
49
|
registry: &Registry,
|
|
@@ -59,7 +57,7 @@ function getOngoingTips(config, input) {
|
|
|
59
57
|
return __generator(this, function (_a) {
|
|
60
58
|
switch (_a.label) {
|
|
61
59
|
case 0:
|
|
62
|
-
provider =
|
|
60
|
+
provider = config.gRpcClient();
|
|
63
61
|
transaction = new transactions_1.Transaction();
|
|
64
62
|
transaction.moveCall({
|
|
65
63
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_ongoing_tips_bcs"),
|
|
@@ -69,10 +67,11 @@ function getOngoingTips(config, input) {
|
|
|
69
67
|
transaction.pure.option("address", input.user),
|
|
70
68
|
],
|
|
71
69
|
});
|
|
72
|
-
return [4 /*yield*/, provider.
|
|
70
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction, checksEnabled: false, include: { commandResults: true } })];
|
|
73
71
|
case 1:
|
|
74
|
-
results = (_a.sent())
|
|
75
|
-
|
|
72
|
+
results = (_a.sent())
|
|
73
|
+
.commandResults;
|
|
74
|
+
bytes = results[0].returnValues[0].bcs;
|
|
76
75
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
77
76
|
reader.readULEB();
|
|
78
77
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
@@ -128,16 +127,16 @@ function getEndedTips(config) {
|
|
|
128
127
|
return __generator(this, function (_a) {
|
|
129
128
|
switch (_a.label) {
|
|
130
129
|
case 0:
|
|
131
|
-
provider =
|
|
130
|
+
provider = config.gRpcClient();
|
|
132
131
|
transaction = new transactions_1.Transaction();
|
|
133
132
|
transaction.moveCall({
|
|
134
133
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_ended_tips_bcs"),
|
|
135
134
|
arguments: [transaction.object(config.registry.launch.improvementProposal)],
|
|
136
135
|
});
|
|
137
|
-
return [4 /*yield*/, provider.
|
|
136
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction })];
|
|
138
137
|
case 1:
|
|
139
138
|
devInspectTransactionBlockResult = _a.sent();
|
|
140
|
-
bytes = devInspectTransactionBlockResult.
|
|
139
|
+
bytes = devInspectTransactionBlockResult.commandResults[0].returnValues[0].bcs;
|
|
141
140
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
142
141
|
reader.readULEB();
|
|
143
142
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
@@ -193,16 +192,16 @@ function getOngoingTipVotes(config, input) {
|
|
|
193
192
|
return __generator(this, function (_a) {
|
|
194
193
|
switch (_a.label) {
|
|
195
194
|
case 0:
|
|
196
|
-
provider =
|
|
195
|
+
provider = config.gRpcClient();
|
|
197
196
|
transaction = new transactions_1.Transaction();
|
|
198
197
|
transaction.moveCall({
|
|
199
198
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_ongoing_tip_votes_bcs"),
|
|
200
199
|
arguments: [transaction.object(config.registry.launch.improvementProposal), transaction.pure.address(input.user)],
|
|
201
200
|
});
|
|
202
|
-
return [4 /*yield*/, provider.
|
|
201
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction })];
|
|
203
202
|
case 1:
|
|
204
203
|
devInspectTransactionBlockResult = _a.sent();
|
|
205
|
-
bytes = devInspectTransactionBlockResult.
|
|
204
|
+
bytes = devInspectTransactionBlockResult.commandResults[0].returnValues[0].bcs;
|
|
206
205
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
207
206
|
reader.readULEB();
|
|
208
207
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
@@ -230,16 +229,16 @@ function getEndedTipVotes(config, input) {
|
|
|
230
229
|
return __generator(this, function (_a) {
|
|
231
230
|
switch (_a.label) {
|
|
232
231
|
case 0:
|
|
233
|
-
provider =
|
|
232
|
+
provider = config.gRpcClient();
|
|
234
233
|
transaction = new transactions_1.Transaction();
|
|
235
234
|
transaction.moveCall({
|
|
236
235
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_ended_tip_votes_bcs"),
|
|
237
236
|
arguments: [transaction.object(config.registry.launch.improvementProposal), transaction.pure.address(input.user)],
|
|
238
237
|
});
|
|
239
|
-
return [4 /*yield*/, provider.
|
|
238
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction })];
|
|
240
239
|
case 1:
|
|
241
240
|
devInspectTransactionBlockResult = _a.sent();
|
|
242
|
-
bytes = devInspectTransactionBlockResult.
|
|
241
|
+
bytes = devInspectTransactionBlockResult.commandResults[0].returnValues[0].bcs;
|
|
243
242
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
244
243
|
reader.readULEB();
|
|
245
244
|
return [2 /*return*/, reader.readVec(function (reader) {
|
|
@@ -267,16 +266,16 @@ function getTipVotes(config, input) {
|
|
|
267
266
|
return __generator(this, function (_a) {
|
|
268
267
|
switch (_a.label) {
|
|
269
268
|
case 0:
|
|
270
|
-
provider =
|
|
269
|
+
provider = config.gRpcClient();
|
|
271
270
|
transaction = new transactions_1.Transaction();
|
|
272
271
|
transaction.moveCall({
|
|
273
272
|
target: "".concat(config.package.launch.improvementProposal, "::improvement_proposal::get_tip_votes_bcs"),
|
|
274
273
|
arguments: [transaction.object(config.registry.launch.improvementProposal), transaction.pure.u64(input.index)],
|
|
275
274
|
});
|
|
276
|
-
return [4 /*yield*/, provider.
|
|
275
|
+
return [4 /*yield*/, provider.simulateTransaction({ transaction: transaction })];
|
|
277
276
|
case 1:
|
|
278
277
|
devInspectTransactionBlockResult = _a.sent();
|
|
279
|
-
bytes = devInspectTransactionBlockResult.
|
|
278
|
+
bytes = devInspectTransactionBlockResult.commandResults[0].returnValues[0].bcs;
|
|
280
279
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
281
280
|
reader.readULEB();
|
|
282
281
|
return [2 /*return*/, reader.readVec(function (reader) {
|