@typus/typus-sdk 1.2.90 → 1.2.92
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/lib/config.json
CHANGED
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"LOCKED_VAULT": "0xe79b7ba69b750d30ac7ae171483a4064d0bb34090493fef3c844a11b05818d79"
|
|
69
69
|
},
|
|
70
70
|
"PACKAGE": {
|
|
71
|
-
"DOV_SINGLE": "
|
|
71
|
+
"DOV_SINGLE": "0x37c6a2425e87fcad23faeae753a01a98c0880346f3b81ba412de1edb2a9d3f81",
|
|
72
72
|
"FRAMEWORK": "0xa304e225551b619b07c06d8965462b268138b2c5774fd22ad8853ef91fbb9771",
|
|
73
73
|
"MFUD": "0x7755ff79f0f27256c73e6c197e25b407ef6d4b9bd6e1af8cdd50fef28f84712c",
|
|
74
74
|
"NFT": "0x0f5162014f18686640b8d0adefd60c3fe5b377413ec4f1e77001c67d96f8501a",
|
package/lib/mainnet.json
CHANGED
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"SCALLOP_MARKET": "0xa757975255146dc9686aa823b7838b507f315d704f428cbadad2f4ea061939d9",
|
|
31
31
|
"SCALLOP_REWARD_POOL_FOR_SUI": "0x162250ef72393a4ad3d46294c4e1bdfcb03f04c869d390e7efbfc995353a7ee9",
|
|
32
32
|
"SCALLOP_REWARD_POOL_FOR_USDC": "0xf4268cc9b9413b9bfe09e8966b8de650494c9e5784bf0930759cfef4904daff8",
|
|
33
|
-
"VERSION": "2.
|
|
33
|
+
"VERSION": "2.24.0",
|
|
34
34
|
"EXP_GUESS_PACKAGE": "0x32d670520a10a87b8c042d2259c2d1f7c319329bafcf6f893ad9aaf01a43db8b",
|
|
35
35
|
"EXP_GUESS_PACKAGE_ORIGIN": "0x32d670520a10a87b8c042d2259c2d1f7c319329bafcf6f893ad9aaf01a43db8b",
|
|
36
36
|
"EXP_GUESS_REGISTRY": "0x70c6cbe6764b315cee1b24f483a0fc8307f047f1fab2a0d4438624845e6ba3f2",
|
|
37
37
|
"FRAMEWORK_PACKAGE": "0xb4f25230ba74837d8299e92951306100c4a532e8c48cc3d8828abe9b91c8b274",
|
|
38
|
-
"SINGLE_COLLATERAL_PACKAGE": "
|
|
38
|
+
"SINGLE_COLLATERAL_PACKAGE": "0x8b65b817e7d819ab810bf50eaaa521ceea39d85cd46ab58180cfe287ce6f8ef0",
|
|
39
39
|
"SINGLE_COLLATERAL_PACKAGE_ORIGIN": "0x321848bf1ae327a9e022ccb3701940191e02fa193ab160d9c0e49cd3c003de3a",
|
|
40
40
|
"SINGLE_COLLATERAL_REGISTRY": "0x3d70b09359e3ca8301ae0abeda4f2fdf72ce313ba58c919ce568e5f535fd2ea8",
|
|
41
41
|
"SINGLE_COLLATERAL_PORTFOLIO_VAULT_REGISTRY": "0xa1a186d050e3172ef4701c16048c99b11f785969874fa2642b9cbcf59cde7fc0",
|
|
@@ -42,7 +42,10 @@ function getRaiseFundTx(input) {
|
|
|
42
42
|
typeArguments: [input.typeArguments[0]],
|
|
43
43
|
arguments: [
|
|
44
44
|
input.tx.pure(input.user),
|
|
45
|
-
input.tx.makeMoveVec({
|
|
45
|
+
input.tx.makeMoveVec({
|
|
46
|
+
type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
|
|
47
|
+
objects: [input.tx.splitCoins(input.tx.gas, [input.tx.pure(input.raiseAmount)])],
|
|
48
|
+
}),
|
|
46
49
|
input.tx.pure(input.raiseAmount),
|
|
47
50
|
],
|
|
48
51
|
})
|
|
@@ -53,7 +56,7 @@ function getRaiseFundTx(input) {
|
|
|
53
56
|
input.tx.pure(input.user),
|
|
54
57
|
input.tx.makeMoveVec({
|
|
55
58
|
type: "0x2::coin::Coin<".concat(input.typeArguments[0], ">"),
|
|
56
|
-
objects: input.raiseCoins,
|
|
59
|
+
objects: input.raiseCoins.map(function (coin) { return input.tx.object(coin); }),
|
|
57
60
|
}),
|
|
58
61
|
input.tx.pure(input.raiseAmount),
|
|
59
62
|
],
|
|
@@ -164,6 +164,11 @@ export interface Bid {
|
|
|
164
164
|
tsMs: string;
|
|
165
165
|
}
|
|
166
166
|
export declare function getAuctionBids(provider: SuiClient, packageId: string, registry: string, index: string, sender?: string): Promise<Bid[]>;
|
|
167
|
+
export interface DepositSnapshot {
|
|
168
|
+
snapshots: string[];
|
|
169
|
+
totalDeposit: string;
|
|
170
|
+
snapshotTsMs: string;
|
|
171
|
+
}
|
|
167
172
|
export interface DepositShare {
|
|
168
173
|
index: string;
|
|
169
174
|
activeSubVaultUserShare: string;
|
|
@@ -173,8 +178,17 @@ export interface DepositShare {
|
|
|
173
178
|
premiumSubVaultUserShare: string;
|
|
174
179
|
incentiveShare: string;
|
|
175
180
|
}
|
|
176
|
-
export
|
|
177
|
-
|
|
181
|
+
export interface RRR {
|
|
182
|
+
a: {
|
|
183
|
+
[key: string]: DepositShare;
|
|
184
|
+
};
|
|
185
|
+
b: DepositSnapshot;
|
|
186
|
+
}
|
|
187
|
+
export declare function getDepositShares(provider: SuiClient, typusFrameworkPackageId: string, packageId: string, registry: string, receipts: string[], user: string, sender?: string): Promise<{
|
|
188
|
+
depositShare: {
|
|
189
|
+
[key: string]: DepositShare;
|
|
190
|
+
};
|
|
191
|
+
depositSnapshot: DepositSnapshot;
|
|
178
192
|
}>;
|
|
179
193
|
export interface BidVault {
|
|
180
194
|
id: string;
|
|
@@ -398,9 +398,9 @@ function getAuctionBids(provider_1, packageId_1, registry_1, index_1) {
|
|
|
398
398
|
});
|
|
399
399
|
}
|
|
400
400
|
exports.getAuctionBids = getAuctionBids;
|
|
401
|
-
function getDepositShares(provider_1, typusFrameworkPackageId_1, packageId_1, registry_1, receipts_1) {
|
|
402
|
-
return __awaiter(this, arguments, void 0, function (provider, typusFrameworkPackageId, packageId, registry, receipts, sender) {
|
|
403
|
-
var transactionBlock, target, transactionBlockArguments, results, bytes, reader,
|
|
401
|
+
function getDepositShares(provider_1, typusFrameworkPackageId_1, packageId_1, registry_1, receipts_1, user_1) {
|
|
402
|
+
return __awaiter(this, arguments, void 0, function (provider, typusFrameworkPackageId, packageId, registry, receipts, user, sender) {
|
|
403
|
+
var transactionBlock, target, transactionBlockArguments, results, bytes, reader, depositShare, depositSnapshot;
|
|
404
404
|
if (sender === void 0) { sender = exports.SENDER; }
|
|
405
405
|
return __generator(this, function (_a) {
|
|
406
406
|
switch (_a.label) {
|
|
@@ -413,6 +413,7 @@ function getDepositShares(provider_1, typusFrameworkPackageId_1, packageId_1, re
|
|
|
413
413
|
type: "".concat(typusFrameworkPackageId, "::vault::TypusDepositReceipt"),
|
|
414
414
|
objects: receipts.map(function (id) { return transactionBlock.object(id); }),
|
|
415
415
|
}),
|
|
416
|
+
transactionBlock.pure(user),
|
|
416
417
|
];
|
|
417
418
|
transactionBlock.moveCall({
|
|
418
419
|
target: target,
|
|
@@ -424,32 +425,46 @@ function getDepositShares(provider_1, typusFrameworkPackageId_1, packageId_1, re
|
|
|
424
425
|
results = (_a.sent()).results;
|
|
425
426
|
bytes = results[results.length - 1].returnValues[0][0];
|
|
426
427
|
reader = new bcs_1.BcsReader(new Uint8Array(bytes));
|
|
427
|
-
|
|
428
|
+
depositShare = Array.from(new Map()).reduce(function (map, _a) {
|
|
428
429
|
var _b = __read(_a, 2), key = _b[0], value = _b[1];
|
|
429
430
|
map[key] = value;
|
|
430
431
|
return map;
|
|
431
432
|
}, {});
|
|
433
|
+
depositSnapshot = {};
|
|
434
|
+
// console.log(bytes);
|
|
432
435
|
reader.readVec(function (reader, i) {
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
436
|
+
if (i == 0) {
|
|
437
|
+
reader.readULEB();
|
|
438
|
+
depositSnapshot = {
|
|
439
|
+
snapshots: reader.readVec(function (reader) {
|
|
440
|
+
return reader.read64();
|
|
441
|
+
}),
|
|
442
|
+
totalDeposit: reader.read64(),
|
|
443
|
+
snapshotTsMs: reader.read64(),
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
else {
|
|
447
|
+
reader.readULEB();
|
|
448
|
+
var index = reader.read64();
|
|
449
|
+
var activeSubVaultUserShare = reader.read64();
|
|
450
|
+
var deactivatingSubVaultUserShare = reader.read64();
|
|
451
|
+
var inactiveSubVaultUserShare = reader.read64();
|
|
452
|
+
var warmupSubVaultUserShare = reader.read64();
|
|
453
|
+
var premiumSubVaultUserShare = reader.read64();
|
|
454
|
+
var incentiveShare = reader.read64();
|
|
455
|
+
depositShare[index] = {
|
|
456
|
+
index: index,
|
|
457
|
+
activeSubVaultUserShare: activeSubVaultUserShare,
|
|
458
|
+
deactivatingSubVaultUserShare: deactivatingSubVaultUserShare,
|
|
459
|
+
inactiveSubVaultUserShare: inactiveSubVaultUserShare,
|
|
460
|
+
warmupSubVaultUserShare: warmupSubVaultUserShare,
|
|
461
|
+
premiumSubVaultUserShare: premiumSubVaultUserShare,
|
|
462
|
+
incentiveShare: incentiveShare,
|
|
463
|
+
};
|
|
464
|
+
}
|
|
450
465
|
});
|
|
451
466
|
// @ts-ignore
|
|
452
|
-
return [2 /*return*/,
|
|
467
|
+
return [2 /*return*/, { depositShare: depositShare, depositSnapshot: depositSnapshot }];
|
|
453
468
|
}
|
|
454
469
|
});
|
|
455
470
|
});
|