@typus/typus-sdk 1.1.46 → 1.1.47
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.
|
@@ -137,6 +137,16 @@ function getSwitchNftTx(gasBudget, nftPackageId, registry, kiosk, kiosk_cap, nft
|
|
|
137
137
|
return __generator(this, function (_b) {
|
|
138
138
|
tx = new transactions_1.TransactionBlock();
|
|
139
139
|
_a = __read(tx.splitCoins(tx.gas, [tx.pure(50000000)]), 1), coin = _a[0];
|
|
140
|
+
tx.moveCall({
|
|
141
|
+
target: "".concat(nftPackageId, "::tails_staking::snapshot"),
|
|
142
|
+
typeArguments: [],
|
|
143
|
+
arguments: [tx.object(registry), tx.object(constants_1.CLOCK)],
|
|
144
|
+
});
|
|
145
|
+
tx.moveCall({
|
|
146
|
+
target: "".concat(nftPackageId, "::tails_staking::claim_profit_sharing"),
|
|
147
|
+
typeArguments: ["0x2::sui::SUI"],
|
|
148
|
+
arguments: [tx.object(registry)],
|
|
149
|
+
});
|
|
140
150
|
tx.moveCall({
|
|
141
151
|
target: "".concat(nftPackageId, "::tails_staking::switch_nft"),
|
|
142
152
|
typeArguments: [],
|
|
@@ -30,6 +30,7 @@ export interface Game {
|
|
|
30
30
|
vrf_input_2: number[] | null;
|
|
31
31
|
}
|
|
32
32
|
export declare function getHistory(provider: SuiClient, dicePackage: string, playgrounds: Playground[]): Promise<DrawDisplay[]>;
|
|
33
|
+
export declare function waitHistory(provider: SuiClient, dicePackage: string, onMessage: any): Promise<import("@mysten/sui.js/client").Unsubscribe>;
|
|
33
34
|
export declare function parseHistory(datas: any, playgrounds: Playground[]): Promise<DrawDisplay[]>;
|
|
34
35
|
interface DrawDisplay {
|
|
35
36
|
game_id: string;
|
|
@@ -47,7 +47,7 @@ var __values = (this && this.__values) || function(o) {
|
|
|
47
47
|
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
48
48
|
};
|
|
49
49
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
-
exports.calculateLevelReward = exports.getProfitSharing = exports.getLeaderBoard = exports.parseHistory = exports.getHistory = exports.getPlaygrounds = void 0;
|
|
50
|
+
exports.calculateLevelReward = exports.getProfitSharing = exports.getLeaderBoard = exports.parseHistory = exports.waitHistory = exports.getHistory = exports.getPlaygrounds = void 0;
|
|
51
51
|
var token_1 = require("../token");
|
|
52
52
|
function getPlaygrounds(provider, diceRegistry) {
|
|
53
53
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -131,6 +131,27 @@ function getHistory(provider, dicePackage, playgrounds) {
|
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
133
|
exports.getHistory = getHistory;
|
|
134
|
+
function waitHistory(provider, dicePackage, onMessage) {
|
|
135
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
136
|
+
var eventFilter, unsubscribe;
|
|
137
|
+
return __generator(this, function (_a) {
|
|
138
|
+
switch (_a.label) {
|
|
139
|
+
case 0:
|
|
140
|
+
eventFilter = {
|
|
141
|
+
MoveEventType: "".concat(dicePackage, "::tails_exp::Draw"),
|
|
142
|
+
};
|
|
143
|
+
return [4 /*yield*/, provider.subscribeEvent({
|
|
144
|
+
filter: eventFilter,
|
|
145
|
+
onMessage: onMessage,
|
|
146
|
+
})];
|
|
147
|
+
case 1:
|
|
148
|
+
unsubscribe = _a.sent();
|
|
149
|
+
return [2 /*return*/, unsubscribe];
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
exports.waitHistory = waitHistory;
|
|
134
155
|
function parseHistory(datas, playgrounds) {
|
|
135
156
|
return __awaiter(this, void 0, void 0, function () {
|
|
136
157
|
var result;
|