@typus/typus-sdk 1.4.29 → 1.4.31
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/config-mainnet.json +20 -4
- package/dist/config-testnet.json +15 -2
- package/dist/src/auto-bid/token-user-entry.d.ts +17 -21
- package/dist/src/auto-bid/token-user-entry.js +21 -21
- package/dist/src/auto-bid/user-entry.d.ts +23 -27
- package/dist/src/auto-bid/user-entry.js +47 -47
- package/dist/src/auto-bid/view-function.d.ts +1 -2
- package/dist/src/auto-bid/view-function.js +6 -6
- package/dist/src/dice/api.d.ts +1 -1
- package/dist/src/dice/api.js +1 -1
- package/dist/src/dice/fetch.js +14 -9
- package/dist/src/dice/user-entry.js +6 -6
- package/dist/src/dice/view-function.js +1 -1
- package/dist/src/typus-dov-single-v2/function/bidding.js +2 -6
- package/dist/src/typus-dov-single-v2/history/user-history.js +1 -1
- package/dist/src/typus-dov-single-v2/user-entry.d.ts +0 -1
- package/dist/src/typus-dov-single-v2/user-entry.js +2 -2
- package/dist/src/typus-perp/user/orderWithBidReceipt.d.ts +1 -1
- package/dist/src/typus-safu/index.d.ts +0 -1
- package/dist/src/typus-safu/index.js +0 -2
- package/dist/src/typus-safu/user-history.d.ts +11 -0
- package/dist/src/typus-safu/user-history.js +256 -194
- package/dist/src/typus-safu/view-function.d.ts +3 -2
- package/dist/src/typus-safu/view-function.js +41 -12
- package/dist/src/utils/api/sentio/leader-board.js +1 -1
- package/dist/src/utils/typusConfig.d.ts +18 -2
- package/dist/src/utils/typusConfig.js +1 -1
- package/package.json +1 -1
|
@@ -82,7 +82,7 @@ function newGameTx(config, tx, input) {
|
|
|
82
82
|
break;
|
|
83
83
|
}
|
|
84
84
|
tx.moveCall({
|
|
85
|
-
target: "".concat(config.package.dice, "::").concat(module, "::new_game"),
|
|
85
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
|
|
86
86
|
typeArguments: input.typeArguments,
|
|
87
87
|
arguments: [
|
|
88
88
|
tx.object(registry),
|
|
@@ -123,7 +123,7 @@ function playGuessTx(config, tx, input) {
|
|
|
123
123
|
break;
|
|
124
124
|
}
|
|
125
125
|
tx.moveCall({
|
|
126
|
-
target: "".concat(config.package.dice, "::").concat(module, "::play_guess"),
|
|
126
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::play_guess"),
|
|
127
127
|
typeArguments: [],
|
|
128
128
|
arguments: [
|
|
129
129
|
tx.object(registry),
|
|
@@ -157,7 +157,7 @@ function newGamePlayGuessTx(config, tx, input) {
|
|
|
157
157
|
input.typeArguments[0] == "0x0000000000000000000000000000000000000000000000000000000000000002::sui::SUI") {
|
|
158
158
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(input.amount)]), 1), coin = _a[0];
|
|
159
159
|
tx.moveCall({
|
|
160
|
-
target: "".concat(config.package.dice, "::").concat(module, "::new_game"),
|
|
160
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
|
|
161
161
|
typeArguments: input.typeArguments,
|
|
162
162
|
arguments: input.module == "combo_dice"
|
|
163
163
|
? [
|
|
@@ -172,7 +172,7 @@ function newGamePlayGuessTx(config, tx, input) {
|
|
|
172
172
|
}
|
|
173
173
|
else {
|
|
174
174
|
tx.moveCall({
|
|
175
|
-
target: "".concat(config.package.dice, "::").concat(module, "::new_game"),
|
|
175
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::new_game"),
|
|
176
176
|
typeArguments: input.typeArguments,
|
|
177
177
|
arguments: [
|
|
178
178
|
tx.object(registry),
|
|
@@ -183,7 +183,7 @@ function newGamePlayGuessTx(config, tx, input) {
|
|
|
183
183
|
});
|
|
184
184
|
}
|
|
185
185
|
tx.moveCall({
|
|
186
|
-
target: "".concat(config.package.dice, "::").concat(module, "::play_guess"),
|
|
186
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::play_guess"),
|
|
187
187
|
typeArguments: [],
|
|
188
188
|
arguments: [
|
|
189
189
|
tx.object(registry),
|
|
@@ -196,7 +196,7 @@ function newGamePlayGuessTx(config, tx, input) {
|
|
|
196
196
|
});
|
|
197
197
|
// TODO: waiting for upgrade
|
|
198
198
|
// tx.moveCall({
|
|
199
|
-
// target: `${packageId}::${module}::play_guess_with_random`,
|
|
199
|
+
// target: `${packageId}::${input.module}::play_guess_with_random`,
|
|
200
200
|
// typeArguments: module == "combo_dice" ? typeArguments : [],
|
|
201
201
|
// arguments: [
|
|
202
202
|
// tx.object(registry),
|
|
@@ -72,7 +72,7 @@ function simulateGame(config, input) {
|
|
|
72
72
|
break;
|
|
73
73
|
}
|
|
74
74
|
transactionBlock.moveCall({
|
|
75
|
-
target: "".concat(config.package.dice, "::").concat(module, "::simulate_game"),
|
|
75
|
+
target: "".concat(config.package.dice, "::").concat(input.module, "::simulate_game"),
|
|
76
76
|
typeArguments: [],
|
|
77
77
|
arguments: [
|
|
78
78
|
transactionBlock.object(registry),
|
|
@@ -671,23 +671,19 @@ exports.getUserBidReceipts = getUserBidReceipts;
|
|
|
671
671
|
* @return User Bids.
|
|
672
672
|
*/
|
|
673
673
|
var fetchUserBids = function (config, user, prices) { return __awaiter(void 0, void 0, void 0, function () {
|
|
674
|
-
var provider,
|
|
674
|
+
var provider, vaultsInfo, userReceipts, userStrategies, auctions, _a, sortedBidReceipts, bidVaultsInfo, bidShares, bidsFromBidShares, _loop_1, bidVaultsInfo_1, bidVaultsInfo_1_1, bidVaultInfo, autoBidsShares, vaultAutoBidReceipts, userStrategies_1, userStrategies_1_1, strategy, receipts, receipts_1, receipts_1_1, receiptItem, vaultIndex, receipt, autoBidVaultInfos, bidsFromStrategies, _loop_2, autoBidVaultInfos_1, autoBidVaultInfos_1_1, autoBidVaultInfo, byOrdered;
|
|
675
675
|
var e_2, _b, e_3, _c, e_4, _d, e_5, _e;
|
|
676
676
|
return __generator(this, function (_f) {
|
|
677
677
|
switch (_f.label) {
|
|
678
678
|
case 0:
|
|
679
679
|
provider = new client_2.SuiClient({ url: config.rpcEndpoint });
|
|
680
|
-
packageAddress = config.package.dovSingle;
|
|
681
|
-
registryAddress = config.registry.dov.dovSingle;
|
|
682
|
-
originFramworkAddress = config.packageOrigin.framework;
|
|
683
|
-
strategyPool = config.object.strategyPool;
|
|
684
680
|
return [4 /*yield*/, (0, typus_dov_single_v2_1.getVaults)(config, { indexes: [] })];
|
|
685
681
|
case 1:
|
|
686
682
|
vaultsInfo = _f.sent();
|
|
687
683
|
return [4 /*yield*/, (0, exports.getUserBidReceipts)(config, { user: user })];
|
|
688
684
|
case 2:
|
|
689
685
|
userReceipts = _f.sent();
|
|
690
|
-
return [4 /*yield*/, (0, auto_bid_1.getUserStrategies)(config, {
|
|
686
|
+
return [4 /*yield*/, (0, auto_bid_1.getUserStrategies)(config, { user: user })];
|
|
691
687
|
case 3:
|
|
692
688
|
userStrategies = _f.sent();
|
|
693
689
|
return [4 /*yield*/, (0, typus_dov_single_v2_1.getAuctions)(config, { indexes: [] })];
|
|
@@ -178,7 +178,7 @@ function parseTxHistory(datas, originPackage, vaults) {
|
|
|
178
178
|
functionType = (_d = new RegExp("^([^::]+)::([^::]+)::([^<]+)").exec(event.type)) === null || _d === void 0 ? void 0 : _d.slice(1, 4);
|
|
179
179
|
action = functionType[2];
|
|
180
180
|
Tails = undefined;
|
|
181
|
-
Index = event.parsedJson.index || event.parsedJson.
|
|
181
|
+
Index = event.parsedJson.index || event.parsedJson.vaultIndex;
|
|
182
182
|
if (Index) {
|
|
183
183
|
_a = __read(parseVaultInfo(vaults, Index, action, event.parsedJson.log), 6), Period = _a[0], Vault = _a[1], RiskLevel = _a[2], d_token = _a[3], b_token = _a[4], o_token = _a[5];
|
|
184
184
|
}
|
|
@@ -82,7 +82,6 @@ export declare function getRefreshDepositSnapshotTx(config: TypusConfig, tx: Tra
|
|
|
82
82
|
)
|
|
83
83
|
*/
|
|
84
84
|
export declare function getNewBidTx(config: TypusConfig, tx: TransactionBlock, input: {
|
|
85
|
-
tgldRegistry: string;
|
|
86
85
|
typeArguments: string[];
|
|
87
86
|
index: string;
|
|
88
87
|
coins: string[];
|
|
@@ -205,7 +205,7 @@ function getNewBidTx(config, tx, input) {
|
|
|
205
205
|
arguments: [
|
|
206
206
|
tx.object(config.version.typus),
|
|
207
207
|
tx.object(config.registry.typus.user),
|
|
208
|
-
tx.object(
|
|
208
|
+
tx.object(config.registry.typus.tgld),
|
|
209
209
|
tx.object(config.registry.typus.leaderboard),
|
|
210
210
|
tx.object(config.registry.dov.dovSingle),
|
|
211
211
|
tx.pure(input.index),
|
|
@@ -238,7 +238,7 @@ function getNewBidTx(config, tx, input) {
|
|
|
238
238
|
arguments: [
|
|
239
239
|
tx.object(config.version.typus),
|
|
240
240
|
tx.object(config.registry.typus.user),
|
|
241
|
-
tx.object(
|
|
241
|
+
tx.object(config.registry.typus.tgld),
|
|
242
242
|
tx.object(config.registry.typus.leaderboard),
|
|
243
243
|
tx.object(config.registry.dov.dovSingle),
|
|
244
244
|
tx.pure(input.index),
|
|
@@ -14,8 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.NETWORK = void 0;
|
|
18
17
|
__exportStar(require("./view-function"), exports);
|
|
19
18
|
__exportStar(require("./user-entry"), exports);
|
|
20
19
|
__exportStar(require("./user-history"), exports);
|
|
21
|
-
exports.NETWORK = "MAINNET";
|
|
@@ -4,9 +4,20 @@ export interface TxHistory {
|
|
|
4
4
|
Action: string;
|
|
5
5
|
Index: string;
|
|
6
6
|
Amount: string;
|
|
7
|
+
Token: string;
|
|
7
8
|
Exp: string | undefined;
|
|
8
9
|
Date: Date;
|
|
9
10
|
txDigest: string;
|
|
10
11
|
log: string[];
|
|
11
12
|
}
|
|
12
13
|
export declare function parseTxHistory(datas: Array<any>, originPackage: string): Promise<Array<TxHistory>>;
|
|
14
|
+
export declare function getDepositorCashFlows(userHistory: TxHistory[]): Map<string, DepositorCashFlow>;
|
|
15
|
+
export interface DepositorCashFlow {
|
|
16
|
+
D_TOKEN: string | undefined;
|
|
17
|
+
totalDeposit: number;
|
|
18
|
+
totalWithdraw: number;
|
|
19
|
+
totalClaim: number;
|
|
20
|
+
totalCompound: number;
|
|
21
|
+
netDeposit: number | undefined;
|
|
22
|
+
totalHarvest: Map<string, number>;
|
|
23
|
+
}
|