@typus/typus-sdk 1.0.122 → 1.0.123
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { TransactionBlock } from "@mysten/sui.js";
|
|
2
2
|
/**
|
|
3
|
-
public(friend) entry fun deposit<D_TOKEN, B_TOKEN
|
|
3
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN>(
|
|
4
4
|
registry: &mut Registry,
|
|
5
5
|
index: u64,
|
|
6
6
|
coins: vector<Coin<D_TOKEN>>,
|
|
@@ -11,7 +11,7 @@ import { TransactionBlock } from "@mysten/sui.js";
|
|
|
11
11
|
*/
|
|
12
12
|
export declare function getDepositTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], amount: string, receipts: string[], usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
13
13
|
/**
|
|
14
|
-
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN
|
|
14
|
+
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN>(
|
|
15
15
|
registry: &mut Registry,
|
|
16
16
|
index: u64,
|
|
17
17
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -21,7 +21,7 @@ export declare function getDepositTx(gasBudget: number, typusFrameworkPackageId:
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function getWithdrawTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
23
23
|
/**
|
|
24
|
-
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN
|
|
24
|
+
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN>(
|
|
25
25
|
registry: &mut Registry,
|
|
26
26
|
index: u64,
|
|
27
27
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -31,7 +31,7 @@ export declare function getWithdrawTx(gasBudget: number, typusFrameworkPackageId
|
|
|
31
31
|
*/
|
|
32
32
|
export declare function getUnsubscribeTx(gasBudget: number, typusFrameworkPackageId: string, packageId: string, typeArguments: string[], registry: string, index: string, receipts: string[], share?: string): Promise<TransactionBlock>;
|
|
33
33
|
/**
|
|
34
|
-
public(friend) entry fun claim<D_TOKEN, B_TOKEN
|
|
34
|
+
public(friend) entry fun claim<D_TOKEN, B_TOKEN>(
|
|
35
35
|
registry: &mut Registry,
|
|
36
36
|
index: u64,
|
|
37
37
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -44,7 +44,7 @@ export declare function getClaimTx(gasBudget: number, typusFrameworkPackageId: s
|
|
|
44
44
|
receipts: string[];
|
|
45
45
|
}[]): Promise<TransactionBlock>;
|
|
46
46
|
/**
|
|
47
|
-
public(friend) entry fun harvest<D_TOKEN, B_TOKEN
|
|
47
|
+
public(friend) entry fun harvest<D_TOKEN, B_TOKEN>(
|
|
48
48
|
registry: &mut Registry,
|
|
49
49
|
index: u64,
|
|
50
50
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -57,7 +57,7 @@ export declare function getHarvestTx(gasBudget: number, typusFrameworkPackageId:
|
|
|
57
57
|
receipts: string[];
|
|
58
58
|
}[]): Promise<TransactionBlock>;
|
|
59
59
|
/**
|
|
60
|
-
public(friend) entry fun compound<D_TOKEN, B_TOKEN
|
|
60
|
+
public(friend) entry fun compound<D_TOKEN, B_TOKEN>(
|
|
61
61
|
registry: &mut Registry,
|
|
62
62
|
index: u64,
|
|
63
63
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -70,7 +70,7 @@ export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId
|
|
|
70
70
|
receipts: string[];
|
|
71
71
|
}[]): Promise<TransactionBlock>;
|
|
72
72
|
/**
|
|
73
|
-
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN
|
|
73
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN>(
|
|
74
74
|
registry: &mut Registry,
|
|
75
75
|
index: u64,
|
|
76
76
|
coins: vector<Coin<B_TOKEN>>,
|
|
@@ -82,7 +82,7 @@ export declare function getCompoundTx(gasBudget: number, typusFrameworkPackageId
|
|
|
82
82
|
export declare function getNewBidTx(gasBudget: number, packageId: string, typeArguments: string[], registry: string, index: string, coins: string[], size: string, premium_required: string, // fe float * b_token_decimal
|
|
83
83
|
usingSponsoredGasCoin?: boolean): Promise<TransactionBlock>;
|
|
84
84
|
/**
|
|
85
|
-
public(friend) entry fun exercise<D_TOKEN, B_TOKEN
|
|
85
|
+
public(friend) entry fun exercise<D_TOKEN, B_TOKEN>(
|
|
86
86
|
registry: &mut Registry,
|
|
87
87
|
index: u64,
|
|
88
88
|
receipts: vector<TypusBidReceipt>,
|
|
@@ -56,7 +56,7 @@ exports.getRefundTx = exports.getExerciseTx = exports.getNewBidTx = exports.getC
|
|
|
56
56
|
var sui_js_1 = require("@mysten/sui.js");
|
|
57
57
|
var constants_1 = require("../../constants");
|
|
58
58
|
/**
|
|
59
|
-
public(friend) entry fun deposit<D_TOKEN, B_TOKEN
|
|
59
|
+
public(friend) entry fun deposit<D_TOKEN, B_TOKEN>(
|
|
60
60
|
registry: &mut Registry,
|
|
61
61
|
index: u64,
|
|
62
62
|
coins: vector<Coin<D_TOKEN>>,
|
|
@@ -115,7 +115,7 @@ function getDepositTx(gasBudget, typusFrameworkPackageId, packageId, typeArgumen
|
|
|
115
115
|
}
|
|
116
116
|
exports.getDepositTx = getDepositTx;
|
|
117
117
|
/**
|
|
118
|
-
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN
|
|
118
|
+
public(friend) entry fun withdraw<D_TOKEN, B_TOKEN>(
|
|
119
119
|
registry: &mut Registry,
|
|
120
120
|
index: u64,
|
|
121
121
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -149,7 +149,7 @@ function getWithdrawTx(gasBudget, typusFrameworkPackageId, packageId, typeArgume
|
|
|
149
149
|
}
|
|
150
150
|
exports.getWithdrawTx = getWithdrawTx;
|
|
151
151
|
/**
|
|
152
|
-
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN
|
|
152
|
+
public(friend) entry fun unsubscribe<D_TOKEN, B_TOKEN>(
|
|
153
153
|
registry: &mut Registry,
|
|
154
154
|
index: u64,
|
|
155
155
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -183,7 +183,7 @@ function getUnsubscribeTx(gasBudget, typusFrameworkPackageId, packageId, typeArg
|
|
|
183
183
|
}
|
|
184
184
|
exports.getUnsubscribeTx = getUnsubscribeTx;
|
|
185
185
|
/**
|
|
186
|
-
public(friend) entry fun claim<D_TOKEN, B_TOKEN
|
|
186
|
+
public(friend) entry fun claim<D_TOKEN, B_TOKEN>(
|
|
187
187
|
registry: &mut Registry,
|
|
188
188
|
index: u64,
|
|
189
189
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -197,7 +197,7 @@ function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, registry, req
|
|
|
197
197
|
tx = new sui_js_1.TransactionBlock();
|
|
198
198
|
requests.forEach(function (request) {
|
|
199
199
|
tx.moveCall({
|
|
200
|
-
target: "".concat(packageId, "::
|
|
200
|
+
target: "".concat(packageId, "::tds_user_entry::claim"),
|
|
201
201
|
typeArguments: request.typeArguments,
|
|
202
202
|
arguments: [
|
|
203
203
|
tx.object(registry),
|
|
@@ -216,7 +216,7 @@ function getClaimTx(gasBudget, typusFrameworkPackageId, packageId, registry, req
|
|
|
216
216
|
}
|
|
217
217
|
exports.getClaimTx = getClaimTx;
|
|
218
218
|
/**
|
|
219
|
-
public(friend) entry fun harvest<D_TOKEN, B_TOKEN
|
|
219
|
+
public(friend) entry fun harvest<D_TOKEN, B_TOKEN>(
|
|
220
220
|
registry: &mut Registry,
|
|
221
221
|
index: u64,
|
|
222
222
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -230,7 +230,7 @@ function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, registry, r
|
|
|
230
230
|
tx = new sui_js_1.TransactionBlock();
|
|
231
231
|
requests.forEach(function (request) {
|
|
232
232
|
tx.moveCall({
|
|
233
|
-
target: "".concat(packageId, "::
|
|
233
|
+
target: "".concat(packageId, "::tds_user_entry::harvest"),
|
|
234
234
|
typeArguments: request.typeArguments,
|
|
235
235
|
arguments: [
|
|
236
236
|
tx.object(registry),
|
|
@@ -249,7 +249,7 @@ function getHarvestTx(gasBudget, typusFrameworkPackageId, packageId, registry, r
|
|
|
249
249
|
}
|
|
250
250
|
exports.getHarvestTx = getHarvestTx;
|
|
251
251
|
/**
|
|
252
|
-
public(friend) entry fun compound<D_TOKEN, B_TOKEN
|
|
252
|
+
public(friend) entry fun compound<D_TOKEN, B_TOKEN>(
|
|
253
253
|
registry: &mut Registry,
|
|
254
254
|
index: u64,
|
|
255
255
|
receipts: vector<TypusDepositReceipt>,
|
|
@@ -283,7 +283,7 @@ function getCompoundTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
283
283
|
}
|
|
284
284
|
exports.getCompoundTx = getCompoundTx;
|
|
285
285
|
/**
|
|
286
|
-
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN
|
|
286
|
+
public(friend) entry fun new_bid<D_TOKEN, B_TOKEN>(
|
|
287
287
|
registry: &mut Registry,
|
|
288
288
|
index: u64,
|
|
289
289
|
coins: vector<Coin<B_TOKEN>>,
|
|
@@ -304,14 +304,14 @@ usingSponsoredGasCoin) {
|
|
|
304
304
|
typeArguments[1] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI")) {
|
|
305
305
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(premium_required)]), 1), coin = _a[0];
|
|
306
306
|
tx.moveCall({
|
|
307
|
-
target: "".concat(packageId, "::
|
|
307
|
+
target: "".concat(packageId, "::tds_user_entry::new_bid"),
|
|
308
308
|
typeArguments: typeArguments,
|
|
309
309
|
arguments: [tx.object(registry), tx.pure(index), tx.makeMoveVec({ objects: [coin] }), tx.pure(size), tx.pure("0x6")],
|
|
310
310
|
});
|
|
311
311
|
}
|
|
312
312
|
else {
|
|
313
313
|
tx.moveCall({
|
|
314
|
-
target: "".concat(packageId, "::
|
|
314
|
+
target: "".concat(packageId, "::tds_user_entry::new_bid"),
|
|
315
315
|
typeArguments: typeArguments,
|
|
316
316
|
arguments: [
|
|
317
317
|
tx.object(registry),
|
|
@@ -329,7 +329,7 @@ usingSponsoredGasCoin) {
|
|
|
329
329
|
}
|
|
330
330
|
exports.getNewBidTx = getNewBidTx;
|
|
331
331
|
/**
|
|
332
|
-
public(friend) entry fun exercise<D_TOKEN, B_TOKEN
|
|
332
|
+
public(friend) entry fun exercise<D_TOKEN, B_TOKEN>(
|
|
333
333
|
registry: &mut Registry,
|
|
334
334
|
index: u64,
|
|
335
335
|
receipts: vector<TypusBidReceipt>,
|
|
@@ -343,7 +343,7 @@ function getExerciseTx(gasBudget, typusFrameworkPackageId, packageId, registry,
|
|
|
343
343
|
tx = new sui_js_1.TransactionBlock();
|
|
344
344
|
requests.forEach(function (request) {
|
|
345
345
|
tx.moveCall({
|
|
346
|
-
target: "".concat(packageId, "::
|
|
346
|
+
target: "".concat(packageId, "::tds_user_entry::exercise"),
|
|
347
347
|
typeArguments: request.typeArguments,
|
|
348
348
|
arguments: [
|
|
349
349
|
tx.object(registry),
|
|
@@ -374,7 +374,7 @@ function getRefundTx(gasBudget, packageId, typeArguments, registry) {
|
|
|
374
374
|
tx = new sui_js_1.TransactionBlock();
|
|
375
375
|
typeArguments.forEach(function (typeArgument) {
|
|
376
376
|
tx.moveCall({
|
|
377
|
-
target: "".concat(packageId, "::
|
|
377
|
+
target: "".concat(packageId, "::tds_user_entry::refund"),
|
|
378
378
|
typeArguments: [typeArgument],
|
|
379
379
|
arguments: [tx.object(registry)],
|
|
380
380
|
});
|
|
@@ -16,6 +16,8 @@ export interface Info {
|
|
|
16
16
|
bidToken: string;
|
|
17
17
|
settlementBase: string;
|
|
18
18
|
settlementQuote: string;
|
|
19
|
+
settlementBaseName: string;
|
|
20
|
+
settlementQuoteName: string;
|
|
19
21
|
dTokenDecimal: string;
|
|
20
22
|
bTokenDecimal: string;
|
|
21
23
|
oTokenDecimal: string;
|
|
@@ -85,12 +87,6 @@ export interface Config {
|
|
|
85
87
|
hasNext: boolean;
|
|
86
88
|
activeVaultConfig: VaultConfig;
|
|
87
89
|
warmupVaultConfig: VaultConfig;
|
|
88
|
-
depositReceiptDisplayName: string;
|
|
89
|
-
depositReceiptDisplayDescription: string;
|
|
90
|
-
depositReceiptDisplayImageUrl: string;
|
|
91
|
-
bidReceiptDisplayName: string;
|
|
92
|
-
bidReceiptDisplayDescription: string;
|
|
93
|
-
bidReceiptDisplayImageUrl: string;
|
|
94
90
|
u64Padding: string[];
|
|
95
91
|
bcsPadding: string[];
|
|
96
92
|
}
|
|
@@ -123,9 +119,7 @@ export interface DepositVault {
|
|
|
123
119
|
premiumShareSupply: string;
|
|
124
120
|
incentiveShareSupply: string;
|
|
125
121
|
hasNext: boolean;
|
|
126
|
-
|
|
127
|
-
description: string;
|
|
128
|
-
imageUrl: string;
|
|
122
|
+
metadata: string;
|
|
129
123
|
u64Padding: string[];
|
|
130
124
|
bcsPadding: string[];
|
|
131
125
|
}
|
|
@@ -64,7 +64,7 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
64
64
|
switch (_a.label) {
|
|
65
65
|
case 0:
|
|
66
66
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
67
|
-
target = "".concat(packageId, "::
|
|
67
|
+
target = "".concat(packageId, "::tds_view_function::get_vault_data_bcs");
|
|
68
68
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes)];
|
|
69
69
|
transactionBlock.moveCall({
|
|
70
70
|
target: target,
|
|
@@ -90,6 +90,8 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
90
90
|
bidToken: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
91
91
|
settlementBase: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
92
92
|
settlementQuote: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
93
|
+
settlementBaseName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
94
|
+
settlementQuoteName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
93
95
|
dTokenDecimal: reader.read64(),
|
|
94
96
|
bTokenDecimal: reader.read64(),
|
|
95
97
|
oTokenDecimal: reader.read64(),
|
|
@@ -203,12 +205,6 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
203
205
|
initialPrice: reader.read64(),
|
|
204
206
|
finalPrice: reader.read64(),
|
|
205
207
|
},
|
|
206
|
-
depositReceiptDisplayName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
207
|
-
depositReceiptDisplayDescription: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
208
|
-
depositReceiptDisplayImageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
209
|
-
bidReceiptDisplayName: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
210
|
-
bidReceiptDisplayDescription: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
211
|
-
bidReceiptDisplayImageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
212
208
|
u64Padding: reader.readVec(function (reader) {
|
|
213
209
|
return reader.read64();
|
|
214
210
|
}),
|
|
@@ -249,9 +245,7 @@ function getVaults(provider, packageId, registry, indexes) {
|
|
|
249
245
|
premiumShareSupply: reader.read64(),
|
|
250
246
|
incentiveShareSupply: reader.read64(),
|
|
251
247
|
hasNext: reader.read8() > 0,
|
|
252
|
-
|
|
253
|
-
description: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
254
|
-
imageUrl: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
248
|
+
metadata: String.fromCharCode.apply(null, Array.from(reader.readBytes(reader.read8()))),
|
|
255
249
|
u64Padding: reader.readVec(function (reader) {
|
|
256
250
|
return reader.read64();
|
|
257
251
|
}),
|
|
@@ -279,7 +273,7 @@ function getAuctions(provider, packageId, registry, indexes) {
|
|
|
279
273
|
switch (_a.label) {
|
|
280
274
|
case 0:
|
|
281
275
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
282
|
-
target = "".concat(packageId, "::
|
|
276
|
+
target = "".concat(packageId, "::tds_view_function::get_auction_bcs");
|
|
283
277
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(indexes)];
|
|
284
278
|
transactionBlock.moveCall({
|
|
285
279
|
target: target,
|
|
@@ -290,7 +284,6 @@ function getAuctions(provider, packageId, registry, indexes) {
|
|
|
290
284
|
case 1:
|
|
291
285
|
results = (_a.sent()).results;
|
|
292
286
|
bytes = results[results.length - 1].returnValues[0][0];
|
|
293
|
-
console.log(JSON.stringify(bytes));
|
|
294
287
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
295
288
|
result = {};
|
|
296
289
|
reader.readVec(function (reader) {
|
|
@@ -350,7 +343,7 @@ function getAuctionBids(provider, packageId, registry, index) {
|
|
|
350
343
|
switch (_a.label) {
|
|
351
344
|
case 0:
|
|
352
345
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
353
|
-
target = "".concat(packageId, "::
|
|
346
|
+
target = "".concat(packageId, "::tds_view_function::get_auction_bids_bcs");
|
|
354
347
|
transactionBlockArguments = [transactionBlock.pure(registry), transactionBlock.pure(index)];
|
|
355
348
|
transactionBlock.moveCall({
|
|
356
349
|
target: target,
|
|
@@ -389,7 +382,7 @@ function getDepositShares(provider, typusFrameworkPackageId, packageId, registry
|
|
|
389
382
|
switch (_a.label) {
|
|
390
383
|
case 0:
|
|
391
384
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
392
|
-
target = "".concat(packageId, "::
|
|
385
|
+
target = "".concat(packageId, "::tds_view_function::get_deposit_shares_bcs");
|
|
393
386
|
transactionBlockArguments = [
|
|
394
387
|
transactionBlock.pure(registry),
|
|
395
388
|
transactionBlock.makeMoveVec({
|
|
@@ -445,7 +438,7 @@ function getBidShares(provider, typusFrameworkPackageId, packageId, registry, re
|
|
|
445
438
|
switch (_a.label) {
|
|
446
439
|
case 0:
|
|
447
440
|
transactionBlock = new sui_js_1.TransactionBlock();
|
|
448
|
-
target = "".concat(packageId, "::
|
|
441
|
+
target = "".concat(packageId, "::tds_view_function::get_bid_shares_bcs");
|
|
449
442
|
transactionBlockArguments = [
|
|
450
443
|
transactionBlock.pure(registry),
|
|
451
444
|
transactionBlock.makeMoveVec({
|