@typus/typus-sdk 1.1.0 → 1.1.2
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,21 @@ 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
|
|
179
|
+
export interface BidVault {
|
|
180
|
+
id: string;
|
|
181
|
+
depositToken: string;
|
|
182
|
+
bidToken: string;
|
|
183
|
+
incentiveToken: string | undefined;
|
|
174
184
|
index: string;
|
|
185
|
+
shareSupply: string;
|
|
186
|
+
metadata: string;
|
|
187
|
+
u64Padding: string[];
|
|
188
|
+
bcsPadding: string[];
|
|
189
|
+
}
|
|
190
|
+
export interface BidShare {
|
|
191
|
+
bidVault: BidVault;
|
|
175
192
|
share: string;
|
|
176
193
|
}
|
|
177
|
-
export declare function
|
|
194
|
+
export declare function getMyBids(provider: JsonRpcProvider, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[]): Promise<{
|
|
178
195
|
[key: string]: BidShare;
|
|
179
196
|
}>;
|
|
@@ -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.getMyBids = 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,14 +451,14 @@ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry
|
|
|
429
451
|
});
|
|
430
452
|
}
|
|
431
453
|
exports.getDepositShares = getDepositShares;
|
|
432
|
-
function
|
|
454
|
+
function getMyBids(provider, typusFrameworkPackageId, packageId, registry, receipts) {
|
|
433
455
|
return __awaiter(this, void 0, void 0, function () {
|
|
434
456
|
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, result;
|
|
435
457
|
return __generator(this, function (_a) {
|
|
436
458
|
switch (_a.label) {
|
|
437
459
|
case 0:
|
|
438
460
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
439
|
-
target = "".concat(packageId, "::tds_view_function::
|
|
461
|
+
target = "".concat(packageId, "::tds_view_function::get_my_bids_bcs");
|
|
440
462
|
transactionBlockArguments = [
|
|
441
463
|
transactionBlock.pure(registry),
|
|
442
464
|
transactionBlock.makeMoveVec({
|
|
@@ -460,11 +482,28 @@ function getBidShares(provider, typusFrameworkPackageId, packageId, registry, re
|
|
|
460
482
|
return map;
|
|
461
483
|
}, {});
|
|
462
484
|
reader.readVec(function (reader, i) {
|
|
463
|
-
reader.
|
|
464
|
-
var
|
|
465
|
-
|
|
466
|
-
|
|
485
|
+
reader.read16();
|
|
486
|
+
var bidVault = {
|
|
487
|
+
id: (0, tools_1.AddressFromBytes)(reader.readBytes(32)),
|
|
488
|
+
depositToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
489
|
+
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
490
|
+
incentiveToken: reader
|
|
491
|
+
.readVec(function (reader) {
|
|
492
|
+
return String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8())));
|
|
493
|
+
})
|
|
494
|
+
.at(0),
|
|
467
495
|
index: reader.read64(),
|
|
496
|
+
shareSupply: reader.read64(),
|
|
497
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
498
|
+
u64Padding: reader.readVec(function (reader) {
|
|
499
|
+
return reader.read64();
|
|
500
|
+
}),
|
|
501
|
+
bcsPadding: reader.readVec(function (reader) {
|
|
502
|
+
return reader.read8();
|
|
503
|
+
}),
|
|
504
|
+
};
|
|
505
|
+
result[bidVault.index] = {
|
|
506
|
+
bidVault: bidVault,
|
|
468
507
|
share: reader.read64(),
|
|
469
508
|
};
|
|
470
509
|
});
|
|
@@ -474,4 +513,4 @@ function getBidShares(provider, typusFrameworkPackageId, packageId, registry, re
|
|
|
474
513
|
});
|
|
475
514
|
});
|
|
476
515
|
}
|
|
477
|
-
exports.
|
|
516
|
+
exports.getMyBids = getMyBids;
|