@typus/typus-sdk 1.1.0 → 1.1.1
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.
|
@@ -44,8 +44,10 @@ export interface DeliveryInfos {
|
|
|
44
44
|
totalIncentiveBidValue: string;
|
|
45
45
|
totalIncentiveFee: string;
|
|
46
46
|
deliveryInfo: DeliveryInfo[];
|
|
47
|
+
u64Padding: string[];
|
|
47
48
|
}
|
|
48
49
|
export interface DeliveryInfo {
|
|
50
|
+
auctionType: string;
|
|
49
51
|
deliveryPrice: string;
|
|
50
52
|
deliverySize: string;
|
|
51
53
|
bidderBidValue: string;
|
|
@@ -53,6 +55,7 @@ export interface DeliveryInfo {
|
|
|
53
55
|
incentiveBidValue: string;
|
|
54
56
|
incentiveFee: string;
|
|
55
57
|
tsMs: string;
|
|
58
|
+
u64Padding: string[];
|
|
56
59
|
}
|
|
57
60
|
export interface SettlementInfo {
|
|
58
61
|
round: string;
|
|
@@ -63,6 +66,7 @@ export interface SettlementInfo {
|
|
|
63
66
|
sharePrice: string;
|
|
64
67
|
sharePriceDecimal: string;
|
|
65
68
|
tsMs: string;
|
|
69
|
+
u64Padding: string[];
|
|
66
70
|
}
|
|
67
71
|
export interface Config {
|
|
68
72
|
oracleId: string;
|
|
@@ -96,12 +100,14 @@ export interface VaultConfig {
|
|
|
96
100
|
decaySpeed: string;
|
|
97
101
|
initialPrice: string;
|
|
98
102
|
finalPrice: string;
|
|
103
|
+
u64Padding: string[];
|
|
99
104
|
}
|
|
100
105
|
export interface PayoffConfig {
|
|
101
106
|
strikeBp: string;
|
|
102
107
|
weight: string;
|
|
103
108
|
isBuyer: boolean;
|
|
104
109
|
strike: string | undefined;
|
|
110
|
+
u64Padding: string[];
|
|
105
111
|
}
|
|
106
112
|
export interface DepositVault {
|
|
107
113
|
id: string;
|
|
@@ -170,10 +176,3 @@ export interface DepositShare {
|
|
|
170
176
|
export declare function getDepositShares(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[]): Promise<{
|
|
171
177
|
[key: string]: DepositShare;
|
|
172
178
|
}>;
|
|
173
|
-
export interface BidShare {
|
|
174
|
-
index: string;
|
|
175
|
-
share: string;
|
|
176
|
-
}
|
|
177
|
-
export declare function getBidShares(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[]): Promise<{
|
|
178
|
-
[key: string]: BidShare;
|
|
179
|
-
}>;
|
|
@@ -52,7 +52,7 @@ var __read = (this && this.__read) || function (o, n) {
|
|
|
52
52
|
return ar;
|
|
53
53
|
};
|
|
54
54
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
55
|
-
exports.
|
|
55
|
+
exports.getDepositShares = exports.getAuctionBids = exports.getAuctions = exports.getVaults = exports.SENDER = void 0;
|
|
56
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
57
57
|
var bcs_1 = require("@mysten/bcs");
|
|
58
58
|
var tools_1 = require("../tools");
|
|
@@ -113,6 +113,7 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
113
113
|
totalIncentiveFee: reader.read64(),
|
|
114
114
|
deliveryInfo: reader.readVec(function (reader) {
|
|
115
115
|
return {
|
|
116
|
+
auctionType: reader.read64(),
|
|
116
117
|
deliveryPrice: reader.read64(),
|
|
117
118
|
deliverySize: reader.read64(),
|
|
118
119
|
bidderBidValue: reader.read64(),
|
|
@@ -120,8 +121,14 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
120
121
|
incentiveBidValue: reader.read64(),
|
|
121
122
|
incentiveFee: reader.read64(),
|
|
122
123
|
tsMs: reader.read64(),
|
|
124
|
+
u64Padding: reader.readVec(function (reader) {
|
|
125
|
+
return reader.read64();
|
|
126
|
+
}),
|
|
123
127
|
};
|
|
124
128
|
}),
|
|
129
|
+
u64Padding: reader.readVec(function (reader) {
|
|
130
|
+
return reader.read64();
|
|
131
|
+
}),
|
|
125
132
|
},
|
|
126
133
|
settlementInfo: reader
|
|
127
134
|
.readVec(function (reader) {
|
|
@@ -134,6 +141,9 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
134
141
|
sharePrice: reader.read64(),
|
|
135
142
|
sharePriceDecimal: reader.read64(),
|
|
136
143
|
tsMs: reader.read64(),
|
|
144
|
+
u64Padding: reader.readVec(function (reader) {
|
|
145
|
+
return reader.read64();
|
|
146
|
+
}),
|
|
137
147
|
};
|
|
138
148
|
})
|
|
139
149
|
.at(0),
|
|
@@ -180,12 +190,18 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
180
190
|
return reader.read64();
|
|
181
191
|
})
|
|
182
192
|
.at(0),
|
|
193
|
+
u64Padding: reader.readVec(function (reader) {
|
|
194
|
+
return reader.read64();
|
|
195
|
+
}),
|
|
183
196
|
};
|
|
184
197
|
}),
|
|
185
198
|
strikeIncrement: reader.read64(),
|
|
186
199
|
decaySpeed: reader.read64(),
|
|
187
200
|
initialPrice: reader.read64(),
|
|
188
201
|
finalPrice: reader.read64(),
|
|
202
|
+
u64Padding: reader.readVec(function (reader) {
|
|
203
|
+
return reader.read64();
|
|
204
|
+
}),
|
|
189
205
|
},
|
|
190
206
|
warmupVaultConfig: {
|
|
191
207
|
payoffConfigs: reader.readVec(function (reader) {
|
|
@@ -198,12 +214,18 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
198
214
|
return reader.read64();
|
|
199
215
|
})
|
|
200
216
|
.at(0),
|
|
217
|
+
u64Padding: reader.readVec(function (reader) {
|
|
218
|
+
return reader.read64();
|
|
219
|
+
}),
|
|
201
220
|
};
|
|
202
221
|
}),
|
|
203
222
|
strikeIncrement: reader.read64(),
|
|
204
223
|
decaySpeed: reader.read64(),
|
|
205
224
|
initialPrice: reader.read64(),
|
|
206
225
|
finalPrice: reader.read64(),
|
|
226
|
+
u64Padding: reader.readVec(function (reader) {
|
|
227
|
+
return reader.read64();
|
|
228
|
+
}),
|
|
207
229
|
},
|
|
208
230
|
u64Padding: reader.readVec(function (reader) {
|
|
209
231
|
return reader.read64();
|
|
@@ -429,49 +451,48 @@ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry
|
|
|
429
451
|
});
|
|
430
452
|
}
|
|
431
453
|
exports.getDepositShares = getDepositShares;
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
}
|
|
477
|
-
exports.getBidShares = getBidShares;
|
|
454
|
+
// export interface BidShare {
|
|
455
|
+
// index: string;
|
|
456
|
+
// share: string;
|
|
457
|
+
// }
|
|
458
|
+
// export async function getBidShares(
|
|
459
|
+
// provider: JsonRpcProvider,
|
|
460
|
+
// typusFrameworkPackageId: string,
|
|
461
|
+
// packageId: string,
|
|
462
|
+
// registry: string,
|
|
463
|
+
// receipts: string[]
|
|
464
|
+
// ): Promise<{ [key: string]: BidShare }> {
|
|
465
|
+
// let transactionBlock = new TransactionBlock();
|
|
466
|
+
// let target = `${packageId}::tds_view_function::get_bid_shares_bcs` as any;
|
|
467
|
+
// let transactionBlockArguments = [
|
|
468
|
+
// transactionBlock.pure(registry),
|
|
469
|
+
// transactionBlock.makeMoveVec({
|
|
470
|
+
// type: `${typusFrameworkPackageId}::vault::TypusBidReceipt`,
|
|
471
|
+
// objects: receipts.map((id) => transactionBlock.object(id)),
|
|
472
|
+
// }),
|
|
473
|
+
// ];
|
|
474
|
+
// transactionBlock.moveCall({
|
|
475
|
+
// target,
|
|
476
|
+
// typeArguments: [],
|
|
477
|
+
// arguments: transactionBlockArguments,
|
|
478
|
+
// });
|
|
479
|
+
// let results = (await provider.devInspectTransactionBlock({ transactionBlock, sender: SENDER })).results;
|
|
480
|
+
// // @ts-ignore
|
|
481
|
+
// let bytes = results[results.length - 1].returnValues[0][0];
|
|
482
|
+
// let reader = new BcsReader(new Uint8Array(bytes));
|
|
483
|
+
// let result = Array.from(new Map()).reduce((map, [key, value]) => {
|
|
484
|
+
// map[key] = value;
|
|
485
|
+
// return map;
|
|
486
|
+
// }, {});
|
|
487
|
+
// reader.readVec((reader, i) => {
|
|
488
|
+
// reader.read8();
|
|
489
|
+
// let index = reader.read64();
|
|
490
|
+
// let share = reader.read64();
|
|
491
|
+
// result[index] = {
|
|
492
|
+
// index: reader.read64(),
|
|
493
|
+
// share: reader.read64(),
|
|
494
|
+
// } as BidShare;
|
|
495
|
+
// });
|
|
496
|
+
// // @ts-ignore
|
|
497
|
+
// return result;
|
|
498
|
+
// }
|