@suigar/sdk 2.0.0-beta.13 → 2.0.0-beta.15
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/CHANGELOG.md +23 -4
- package/README.md +22 -8
- package/dist/client.d.mts +258 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +291 -0
- package/dist/client.mjs.map +1 -0
- package/dist/configs/package.mainnet.mjs +23 -0
- package/dist/configs/package.mainnet.mjs.map +1 -0
- package/dist/configs/package.mjs +19 -0
- package/dist/configs/package.mjs.map +1 -0
- package/dist/configs/package.testnet.mjs +23 -0
- package/dist/configs/package.testnet.mjs.map +1 -0
- package/dist/configs/registry.mainnet.mjs +6 -0
- package/dist/configs/registry.mainnet.mjs.map +1 -0
- package/dist/configs/registry.mjs +11 -0
- package/dist/configs/registry.mjs.map +1 -0
- package/dist/configs/registry.testnet.mjs +6 -0
- package/dist/configs/registry.testnet.mjs.map +1 -0
- package/dist/contracts/coinflip/coinflip.mjs +46 -0
- package/dist/contracts/coinflip/coinflip.mjs.map +1 -0
- package/dist/contracts/core/core.d.mts +55 -0
- package/dist/contracts/core/core.d.mts.map +1 -0
- package/dist/contracts/core/core.mjs +22 -0
- package/dist/contracts/core/core.mjs.map +1 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/core/float.d.mts +14 -0
- package/dist/contracts/core/float.d.mts.map +1 -0
- package/dist/contracts/core/float.mjs +15 -0
- package/dist/contracts/core/float.mjs.map +1 -0
- package/dist/contracts/core/i64.mjs +10 -0
- package/dist/contracts/core/i64.mjs.map +1 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/limbo/limbo.mjs +53 -0
- package/dist/contracts/limbo/limbo.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/plinko/plinko.mjs +59 -0
- package/dist/contracts/plinko/plinko.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +10 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts +34 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts.map +1 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs +131 -0
- package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs.map +1 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/range/range.mjs +53 -0
- package/dist/contracts/range/range.mjs.map +1 -0
- package/dist/contracts/utils/index.d.mts +33 -0
- package/dist/contracts/utils/index.d.mts.map +1 -0
- package/dist/contracts/utils/index.mjs +119 -0
- package/dist/contracts/utils/index.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
- package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
- package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
- package/dist/contracts/wheel/wheel.mjs +59 -0
- package/dist/contracts/wheel/wheel.mjs.map +1 -0
- package/dist/games.d.mts +3 -0
- package/dist/games.mjs +1 -0
- package/dist/helpers/config.mjs +51 -0
- package/dist/helpers/config.mjs.map +1 -0
- package/dist/helpers/game-settings.mjs +19 -0
- package/dist/helpers/game-settings.mjs.map +1 -0
- package/dist/helpers/metadata.mjs +42 -0
- package/dist/helpers/metadata.mjs.map +1 -0
- package/dist/index.d.mts +2 -0
- package/dist/index.mjs +2 -0
- package/dist/transactions/coinflip.mjs +27 -0
- package/dist/transactions/coinflip.mjs.map +1 -0
- package/dist/transactions/limbo.mjs +31 -0
- package/dist/transactions/limbo.mjs.map +1 -0
- package/dist/transactions/plinko.mjs +29 -0
- package/dist/transactions/plinko.mjs.map +1 -0
- package/dist/transactions/pvp-coinflip.mjs +70 -0
- package/dist/transactions/pvp-coinflip.mjs.map +1 -0
- package/dist/transactions/range.mjs +33 -0
- package/dist/transactions/range.mjs.map +1 -0
- package/dist/transactions/shared.mjs +49 -0
- package/dist/transactions/shared.mjs.map +1 -0
- package/dist/transactions/wheel.mjs +29 -0
- package/dist/transactions/wheel.mjs.map +1 -0
- package/dist/ttl-cache.mjs +60 -0
- package/dist/ttl-cache.mjs.map +1 -0
- package/dist/types/bet-metadata.type.d.mts +7 -0
- package/dist/types/bet-metadata.type.d.mts.map +1 -0
- package/dist/types/build-game-transaction-options.type.d.mts +9 -0
- package/dist/types/build-game-transaction-options.type.d.mts.map +1 -0
- package/dist/types/game-details.type.d.mts +73 -0
- package/dist/types/game-details.type.d.mts.map +1 -0
- package/dist/types/game-details.type.mjs +59 -0
- package/dist/types/game-details.type.mjs.map +1 -0
- package/dist/types/game-settings.type.d.mts +201 -0
- package/dist/types/game-settings.type.d.mts.map +1 -0
- package/dist/types/game-settings.type.mjs +37 -0
- package/dist/types/game-settings.type.mjs.map +1 -0
- package/dist/types/game.type.d.mts +15 -0
- package/dist/types/game.type.d.mts.map +1 -0
- package/dist/types/game.type.mjs +19 -0
- package/dist/types/game.type.mjs.map +1 -0
- package/dist/types/index.d.mts +7 -0
- package/dist/types/move-float.type.d.mts +7 -0
- package/dist/types/move-float.type.d.mts.map +1 -0
- package/dist/types/network.type.d.mts +1 -0
- package/dist/types/network.type.mjs +6 -0
- package/dist/types/network.type.mjs.map +1 -0
- package/dist/types/suigar-config.type.d.mts +33 -0
- package/dist/types/suigar-config.type.d.mts.map +1 -0
- package/dist/types/transaction-options.type.d.mts +63 -0
- package/dist/types/transaction-options.type.d.mts.map +1 -0
- package/dist/utils/constants.d.mts +8 -0
- package/dist/utils/constants.d.mts.map +1 -0
- package/dist/utils/constants.mjs +10 -0
- package/dist/utils/constants.mjs.map +1 -0
- package/dist/utils/numeric.d.mts +86 -0
- package/dist/utils/numeric.d.mts.map +1 -0
- package/dist/utils/numeric.mjs +148 -0
- package/dist/utils/numeric.mjs.map +1 -0
- package/dist/utils/parser.d.mts +54 -0
- package/dist/utils/parser.d.mts.map +1 -0
- package/dist/utils/parser.mjs +94 -0
- package/dist/utils/parser.mjs.map +1 -0
- package/dist/utils.d.mts +4 -0
- package/dist/utils.mjs +4 -0
- package/package.json +16 -17
- package/dist/chunk-7N55D2TV.js +0 -343
- package/dist/games-BHYRg31e.d.cts +0 -98
- package/dist/games-BHYRg31e.d.ts +0 -98
- package/dist/games.cjs +0 -2
- package/dist/games.d.cts +0 -2
- package/dist/games.d.ts +0 -2
- package/dist/games.js +0 -1
- package/dist/index-3P_LBbDM.d.cts +0 -25
- package/dist/index-3P_LBbDM.d.ts +0 -25
- package/dist/index.cjs +0 -1692
- package/dist/index.d.cts +0 -457
- package/dist/index.d.ts +0 -457
- package/dist/index.js +0 -1470
- package/dist/utils.cjs +0 -243
- package/dist/utils.d.cts +0 -180
- package/dist/utils.d.ts +0 -180
- package/dist/utils.js +0 -1
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { Game } from "./game.type.mjs";
|
|
2
|
+
import { MoveStruct } from "../contracts/utils/index.mjs";
|
|
3
|
+
import { SuiClientTypes } from "@mysten/sui/client";
|
|
4
|
+
import * as _$_mysten_bcs0 from "@mysten/bcs";
|
|
5
|
+
|
|
6
|
+
//#region src/types/game-settings.type.d.ts
|
|
7
|
+
declare const GAME_SETTINGS: {
|
|
8
|
+
readonly coinflip: {
|
|
9
|
+
readonly settingsKey: MoveStruct<{
|
|
10
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
11
|
+
}, "0xb35c5f286c443752afc8ccb40125a578a4f32df35617170ccfa17fe180ab80ea::coinflip::CoinFlipSettingsKey">;
|
|
12
|
+
readonly parameters: MoveStruct<{
|
|
13
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
14
|
+
house_edge: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
15
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
16
|
+
max_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
17
|
+
}, "0xb35c5f286c443752afc8ccb40125a578a4f32df35617170ccfa17fe180ab80ea::coinflip::Parameters<phantom T0>">;
|
|
18
|
+
};
|
|
19
|
+
readonly limbo: {
|
|
20
|
+
readonly settingsKey: MoveStruct<{
|
|
21
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
22
|
+
}, "0x96c7841b9b32c59a219760fd656f1c3aceb53cc74a68ec9844a3a696374309f4::limbo::LimboSettingsKey">;
|
|
23
|
+
readonly parameters: MoveStruct<{
|
|
24
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
25
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
26
|
+
max_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
27
|
+
max_payout: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
28
|
+
min_target_multiplier: MoveStruct<{
|
|
29
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
30
|
+
exp: MoveStruct<{
|
|
31
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
32
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
33
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
34
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
35
|
+
max_target_multiplier: MoveStruct<{
|
|
36
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
37
|
+
exp: MoveStruct<{
|
|
38
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
39
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
40
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
41
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
42
|
+
max_number_of_games: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
43
|
+
min_rtp: MoveStruct<{
|
|
44
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
45
|
+
exp: MoveStruct<{
|
|
46
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
47
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
48
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
49
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
50
|
+
max_rtp: MoveStruct<{
|
|
51
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
52
|
+
exp: MoveStruct<{
|
|
53
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
54
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
55
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
56
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
57
|
+
}, "0x96c7841b9b32c59a219760fd656f1c3aceb53cc74a68ec9844a3a696374309f4::limbo::Parameters<phantom T0>">;
|
|
58
|
+
};
|
|
59
|
+
readonly plinko: {
|
|
60
|
+
readonly settingsKey: MoveStruct<{
|
|
61
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
62
|
+
}, "0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::PlinkoSettingsKey">;
|
|
63
|
+
readonly parameters: MoveStruct<{
|
|
64
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
65
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
66
|
+
max_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
67
|
+
max_number_of_balls: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
68
|
+
configs: MoveStruct<{
|
|
69
|
+
contents: _$_mysten_bcs0.BcsType<{
|
|
70
|
+
key: number;
|
|
71
|
+
value: {
|
|
72
|
+
num_rows: number;
|
|
73
|
+
multipliers: {
|
|
74
|
+
is_negative: boolean;
|
|
75
|
+
exp: {
|
|
76
|
+
bits: string;
|
|
77
|
+
};
|
|
78
|
+
mant: string;
|
|
79
|
+
}[];
|
|
80
|
+
min_stake: string;
|
|
81
|
+
max_stake: string;
|
|
82
|
+
is_playable: boolean;
|
|
83
|
+
};
|
|
84
|
+
}[], Iterable<{
|
|
85
|
+
key: number;
|
|
86
|
+
value: {
|
|
87
|
+
num_rows: number;
|
|
88
|
+
multipliers: Iterable<{
|
|
89
|
+
is_negative: boolean;
|
|
90
|
+
exp: {
|
|
91
|
+
bits: string | number | bigint;
|
|
92
|
+
};
|
|
93
|
+
mant: string | number | bigint;
|
|
94
|
+
}> & {
|
|
95
|
+
length: number;
|
|
96
|
+
};
|
|
97
|
+
min_stake: string | number | bigint;
|
|
98
|
+
max_stake: string | number | bigint;
|
|
99
|
+
is_playable: boolean;
|
|
100
|
+
};
|
|
101
|
+
}> & {
|
|
102
|
+
length: number;
|
|
103
|
+
}, string>;
|
|
104
|
+
}, "0x2::vec_map::VecMap<u8, 0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::PlinkoConfig>">;
|
|
105
|
+
}, "0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::Parameters<phantom T0>">;
|
|
106
|
+
};
|
|
107
|
+
readonly 'pvp-coinflip': {
|
|
108
|
+
readonly settingsKey: MoveStruct<{
|
|
109
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
110
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::PvpCoinflipSettingsKey">;
|
|
111
|
+
readonly parameters: MoveStruct<{
|
|
112
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
113
|
+
house_edge_bps: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
114
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
115
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Parameters<phantom T0>">;
|
|
116
|
+
};
|
|
117
|
+
readonly range: {
|
|
118
|
+
readonly settingsKey: MoveStruct<{
|
|
119
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
120
|
+
}, "0x096a4cf18b3661e76b2c62b90785418345d52f45b272448794f123a4cb6b6416::range::RangeSettingsKey">;
|
|
121
|
+
readonly parameters: MoveStruct<{
|
|
122
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
123
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
124
|
+
max_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
125
|
+
min_zone_size: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
126
|
+
max_zone_size: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
127
|
+
max_number_of_games: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
128
|
+
min_rtp: MoveStruct<{
|
|
129
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
130
|
+
exp: MoveStruct<{
|
|
131
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
132
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
133
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
134
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
135
|
+
max_rtp: MoveStruct<{
|
|
136
|
+
is_negative: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
137
|
+
exp: MoveStruct<{
|
|
138
|
+
bits: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
139
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
140
|
+
mant: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
141
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
142
|
+
}, "0x096a4cf18b3661e76b2c62b90785418345d52f45b272448794f123a4cb6b6416::range::Parameters<phantom T0>">;
|
|
143
|
+
};
|
|
144
|
+
readonly wheel: {
|
|
145
|
+
readonly settingsKey: MoveStruct<{
|
|
146
|
+
dummy_field: _$_mysten_bcs0.BcsType<boolean, boolean, "bool">;
|
|
147
|
+
}, "0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::WheelSettingsKey">;
|
|
148
|
+
readonly parameters: MoveStruct<{
|
|
149
|
+
id: _$_mysten_bcs0.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
150
|
+
min_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
151
|
+
max_stake: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
152
|
+
max_number_of_spins: _$_mysten_bcs0.BcsType<string, string | number | bigint, "u64">;
|
|
153
|
+
configs: MoveStruct<{
|
|
154
|
+
contents: _$_mysten_bcs0.BcsType<{
|
|
155
|
+
key: number;
|
|
156
|
+
value: {
|
|
157
|
+
num_cases: number;
|
|
158
|
+
multipliers: {
|
|
159
|
+
is_negative: boolean;
|
|
160
|
+
exp: {
|
|
161
|
+
bits: string;
|
|
162
|
+
};
|
|
163
|
+
mant: string;
|
|
164
|
+
}[];
|
|
165
|
+
min_stake: string;
|
|
166
|
+
max_stake: string;
|
|
167
|
+
is_playable: boolean;
|
|
168
|
+
};
|
|
169
|
+
}[], Iterable<{
|
|
170
|
+
key: number;
|
|
171
|
+
value: {
|
|
172
|
+
num_cases: number;
|
|
173
|
+
multipliers: Iterable<{
|
|
174
|
+
is_negative: boolean;
|
|
175
|
+
exp: {
|
|
176
|
+
bits: string | number | bigint;
|
|
177
|
+
};
|
|
178
|
+
mant: string | number | bigint;
|
|
179
|
+
}> & {
|
|
180
|
+
length: number;
|
|
181
|
+
};
|
|
182
|
+
min_stake: string | number | bigint;
|
|
183
|
+
max_stake: string | number | bigint;
|
|
184
|
+
is_playable: boolean;
|
|
185
|
+
};
|
|
186
|
+
}> & {
|
|
187
|
+
length: number;
|
|
188
|
+
}, string>;
|
|
189
|
+
}, "0x2::vec_map::VecMap<u8, 0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::WheelConfig>">;
|
|
190
|
+
}, "0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::Parameters<phantom T0>">;
|
|
191
|
+
};
|
|
192
|
+
};
|
|
193
|
+
type GameParametersMap = { [TGame in Game]: ReturnType<(typeof GAME_SETTINGS)[TGame]['parameters']['parse']> };
|
|
194
|
+
type GameParameters<TGame extends Game> = GameParametersMap[TGame];
|
|
195
|
+
type GetGameParametersOptions = SuiClientTypes.CoreClientMethodOptions & {
|
|
196
|
+
coinType?: string;
|
|
197
|
+
ignoreCache?: boolean;
|
|
198
|
+
};
|
|
199
|
+
//#endregion
|
|
200
|
+
export { GameParameters, GetGameParametersOptions };
|
|
201
|
+
//# sourceMappingURL=game-settings.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-settings.type.d.mts","names":[],"sources":["../../src/types/game-settings.type.ts"],"mappings":";;;;;;cA8Ba,aAAA;EAAA;;mBAyBH,cAAA,CAAA,OAAA;IAAA;IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAEL,iBAAA,eACM,IAAA,GAAO,UAAA,SACR,aAAA,EAAe,KAAA;AAAA,KAIb,cAAA,eAA6B,IAAA,IAAQ,iBAAA,CAAkB,KAAA;AAAA,KAEvD,wBAAA,GACX,cAAA,CAAe,uBAAA;EACd,QAAA;EACA,WAAA;AAAA"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Parameters, PvpCoinflipSettingsKey } from "../contracts/pvp-coinflip/pvp_coinflip.mjs";
|
|
2
|
+
import { CoinFlipSettingsKey, Parameters as Parameters$1 } from "../contracts/coinflip/coinflip.mjs";
|
|
3
|
+
import { LimboSettingsKey, Parameters as Parameters$2 } from "../contracts/limbo/limbo.mjs";
|
|
4
|
+
import { Parameters as Parameters$3, PlinkoSettingsKey } from "../contracts/plinko/plinko.mjs";
|
|
5
|
+
import { Parameters as Parameters$4, RangeSettingsKey } from "../contracts/range/range.mjs";
|
|
6
|
+
import { Parameters as Parameters$5, WheelSettingsKey } from "../contracts/wheel/wheel.mjs";
|
|
7
|
+
//#region src/types/game-settings.type.ts
|
|
8
|
+
const GAME_SETTINGS = {
|
|
9
|
+
coinflip: {
|
|
10
|
+
settingsKey: CoinFlipSettingsKey,
|
|
11
|
+
parameters: Parameters$1
|
|
12
|
+
},
|
|
13
|
+
limbo: {
|
|
14
|
+
settingsKey: LimboSettingsKey,
|
|
15
|
+
parameters: Parameters$2
|
|
16
|
+
},
|
|
17
|
+
plinko: {
|
|
18
|
+
settingsKey: PlinkoSettingsKey,
|
|
19
|
+
parameters: Parameters$3
|
|
20
|
+
},
|
|
21
|
+
"pvp-coinflip": {
|
|
22
|
+
settingsKey: PvpCoinflipSettingsKey,
|
|
23
|
+
parameters: Parameters
|
|
24
|
+
},
|
|
25
|
+
range: {
|
|
26
|
+
settingsKey: RangeSettingsKey,
|
|
27
|
+
parameters: Parameters$4
|
|
28
|
+
},
|
|
29
|
+
wheel: {
|
|
30
|
+
settingsKey: WheelSettingsKey,
|
|
31
|
+
parameters: Parameters$5
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { GAME_SETTINGS };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=game-settings.type.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game-settings.type.mjs","names":["CoinflipParameters","LimboParameters","PlinkoParameters","PvPCoinflipParameters","RangeParameters","WheelParameters"],"sources":["../../src/types/game-settings.type.ts"],"sourcesContent":["// Copyright (c) Suigar\n// SPDX-License-Identifier: Apache-2.0\n\nimport { SuiClientTypes } from '@mysten/sui/client';\nimport {\n\tParameters as CoinflipParameters,\n\tCoinFlipSettingsKey,\n} from '../contracts/coinflip/coinflip';\nimport {\n\tParameters as LimboParameters,\n\tLimboSettingsKey,\n} from '../contracts/limbo/limbo';\nimport {\n\tParameters as PlinkoParameters,\n\tPlinkoSettingsKey,\n} from '../contracts/plinko/plinko';\nimport {\n\tParameters as PvPCoinflipParameters,\n\tPvpCoinflipSettingsKey,\n} from '../contracts/pvp-coinflip/pvp_coinflip';\nimport {\n\tParameters as RangeParameters,\n\tRangeSettingsKey,\n} from '../contracts/range/range';\nimport {\n\tParameters as WheelParameters,\n\tWheelSettingsKey,\n} from '../contracts/wheel/wheel';\nimport type { Game } from './game.type.js';\n\nexport const GAME_SETTINGS = {\n\tcoinflip: {\n\t\tsettingsKey: CoinFlipSettingsKey,\n\t\tparameters: CoinflipParameters,\n\t},\n\tlimbo: {\n\t\tsettingsKey: LimboSettingsKey,\n\t\tparameters: LimboParameters,\n\t},\n\tplinko: {\n\t\tsettingsKey: PlinkoSettingsKey,\n\t\tparameters: PlinkoParameters,\n\t},\n\t'pvp-coinflip': {\n\t\tsettingsKey: PvpCoinflipSettingsKey,\n\t\tparameters: PvPCoinflipParameters,\n\t},\n\trange: {\n\t\tsettingsKey: RangeSettingsKey,\n\t\tparameters: RangeParameters,\n\t},\n\twheel: {\n\t\tsettingsKey: WheelSettingsKey,\n\t\tparameters: WheelParameters,\n\t},\n} as const;\n\ntype GameParametersMap = {\n\t[TGame in Game]: ReturnType<\n\t\t(typeof GAME_SETTINGS)[TGame]['parameters']['parse']\n\t>;\n};\n\nexport type GameParameters<TGame extends Game> = GameParametersMap[TGame];\n\nexport type GetGameParametersOptions =\n\tSuiClientTypes.CoreClientMethodOptions & {\n\t\tcoinType?: string;\n\t\tignoreCache?: boolean;\n\t};\n"],"mappings":";;;;;;;AA8BA,MAAa,gBAAgB;CAC5B,UAAU;EACT,aAAa;EACb,YAAYA;EACZ;CACD,OAAO;EACN,aAAa;EACb,YAAYC;EACZ;CACD,QAAQ;EACP,aAAa;EACb,YAAYC;EACZ;CACD,gBAAgB;EACf,aAAa;EACb,YAAYC;EACZ;CACD,OAAO;EACN,aAAa;EACb,YAAYC;EACZ;CACD,OAAO;EACN,aAAa;EACb,YAAYC;EACZ;CACD"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/types/game.type.d.ts
|
|
2
|
+
declare const GAMES: readonly ["coinflip", "limbo", "plinko", "pvp-coinflip", "range", "wheel"];
|
|
3
|
+
declare const GAME_EVENTS: readonly ["BetResultEvent", "GameCreatedEvent", "GameResolvedEvent", "GameCancelledEvent"];
|
|
4
|
+
type Game = (typeof GAMES)[number];
|
|
5
|
+
type StandardGame = Exclude<Game, PvPGame>;
|
|
6
|
+
type PvPGame = Extract<Game, `pvp-${string}`>;
|
|
7
|
+
type CoinSide = 'heads' | 'tails';
|
|
8
|
+
type GameEvent = (typeof GAME_EVENTS)[number];
|
|
9
|
+
type SuigarGameEvent = {
|
|
10
|
+
gameId: Game;
|
|
11
|
+
eventName: GameEvent;
|
|
12
|
+
};
|
|
13
|
+
//#endregion
|
|
14
|
+
export { CoinSide, GAMES, GAME_EVENTS, Game, GameEvent, PvPGame, StandardGame, SuigarGameEvent };
|
|
15
|
+
//# sourceMappingURL=game.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.type.d.mts","names":[],"sources":["../../src/types/game.type.ts"],"mappings":";cAGa,KAAA;AAAA,cASA,WAAA;AAAA,KAOD,IAAA,WAAe,KAAA;AAAA,KAEf,YAAA,GAAe,OAAA,CAAQ,IAAA,EAAM,OAAA;AAAA,KAC7B,OAAA,GAAU,OAAA,CAAQ,IAAA;AAAA,KAElB,QAAA;AAAA,KAEA,SAAA,WAAoB,WAAA;AAAA,KAEpB,eAAA;EACX,MAAA,EAAQ,IAAA;EACR,SAAA,EAAW,SAAA;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
//#region src/types/game.type.ts
|
|
2
|
+
const GAMES = [
|
|
3
|
+
"coinflip",
|
|
4
|
+
"limbo",
|
|
5
|
+
"plinko",
|
|
6
|
+
"pvp-coinflip",
|
|
7
|
+
"range",
|
|
8
|
+
"wheel"
|
|
9
|
+
];
|
|
10
|
+
const GAME_EVENTS = [
|
|
11
|
+
"BetResultEvent",
|
|
12
|
+
"GameCreatedEvent",
|
|
13
|
+
"GameResolvedEvent",
|
|
14
|
+
"GameCancelledEvent"
|
|
15
|
+
];
|
|
16
|
+
//#endregion
|
|
17
|
+
export { GAMES, GAME_EVENTS };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=game.type.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"game.type.mjs","names":[],"sources":["../../src/types/game.type.ts"],"sourcesContent":["// Copyright (c) Suigar\n// SPDX-License-Identifier: Apache-2.0\n\nexport const GAMES = [\n\t'coinflip',\n\t'limbo',\n\t'plinko',\n\t'pvp-coinflip',\n\t'range',\n\t'wheel',\n] as const;\n\nexport const GAME_EVENTS = [\n\t'BetResultEvent',\n\t'GameCreatedEvent',\n\t'GameResolvedEvent',\n\t'GameCancelledEvent',\n] as const;\n\nexport type Game = (typeof GAMES)[number];\n\nexport type StandardGame = Exclude<Game, PvPGame>;\nexport type PvPGame = Extract<Game, `pvp-${string}`>;\n\nexport type CoinSide = 'heads' | 'tails';\n\nexport type GameEvent = (typeof GAME_EVENTS)[number];\n\nexport type SuigarGameEvent = {\n\tgameId: Game;\n\teventName: GameEvent;\n};\n"],"mappings":";AAGA,MAAa,QAAQ;CACpB;CACA;CACA;CACA;CACA;CACA;CACA;AAED,MAAa,cAAc;CAC1B;CACA;CACA;CACA;CACA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CoinSide, GAMES, GAME_EVENTS, Game, GameEvent, PvPGame, StandardGame, SuigarGameEvent } from "./game.type.mjs";
|
|
2
|
+
import { BetMetadataInput, BetMetadataPrimitive, BetMetadataValue } from "./bet-metadata.type.mjs";
|
|
3
|
+
import { SuigarCoin, SuigarCoinTypes, SuigarConfig, SuigarExtensionOptions, SuigarPackage, SuigarPackageIds, SuigarPriceInfoObjectIds, SuigarRegistry, SuigarRegistryIds } from "./suigar-config.type.mjs";
|
|
4
|
+
import { BaseTransactionOptions, BuildCancelPvPCoinflipTransactionOptions, BuildCoinflipTransactionOptions, BuildCreatePvPCoinflipTransactionOptions, BuildJoinPvPCoinflipTransactionOptions, BuildLimboTransactionOptions, BuildPlinkoTransactionOptions, BuildPvPCoinflipTransactionOptions, BuildRangeTransactionOptions, BuildWheelTransactionOptions, CoinTransactionOptions, PvPCoinflipAction, SharedBetTransactionOptions, SharedPvPCoinflipTransactionOptions, StakeTransactionOptions, WithGasBudget, WithThrowOnError } from "./transaction-options.type.mjs";
|
|
5
|
+
import { BuildGameOptions } from "./build-game-transaction-options.type.mjs";
|
|
6
|
+
import { BetResultGameDetails, GAME_DETAILS_SCHEMAS, GAME_DETAIL_BCS, GameDetail, GameDetailValueType, GameDetails } from "./game-details.type.mjs";
|
|
7
|
+
import { MoveFloat } from "./move-float.type.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"move-float.type.d.mts","names":[],"sources":["../../src/types/move-float.type.ts"],"mappings":";;;KAKY,SAAA,GAAY,UAAA,SAAmB,KAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import { SuiClientTypes } from "@mysten/sui/client";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.type.mjs","names":[],"sources":["../../src/types/network.type.ts"],"sourcesContent":["// Copyright (c) Suigar\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { SuiClientTypes } from '@mysten/sui/client';\n\nexport type SuiNetwork = Extract<SuiClientTypes.Network, 'mainnet' | 'testnet'>;\n\nexport const SUPPORTED_SUI_NETWORKS: SuiClientTypes.Network[] = [\n\t'mainnet',\n\t'testnet',\n];\n"],"mappings":";AAOA,MAAa,yBAAmD,CAC/D,WACA,UACA"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/types/suigar-config.type.d.ts
|
|
2
|
+
interface SuigarExtensionOptions<Name = 'suigar'> {
|
|
3
|
+
name?: Name;
|
|
4
|
+
/**
|
|
5
|
+
* Partner wallet address injected into bet metadata for attribution.
|
|
6
|
+
*
|
|
7
|
+
* Configure this once when registering the `suigar()` client extension
|
|
8
|
+
* instead of passing partner data through per-transaction metadata.
|
|
9
|
+
*/
|
|
10
|
+
partner?: string;
|
|
11
|
+
/**
|
|
12
|
+
* Cache TTL in milliseconds for SDK-managed on-chain config lookups.
|
|
13
|
+
*
|
|
14
|
+
* Defaults to 30 minutes.
|
|
15
|
+
*/
|
|
16
|
+
cacheTtl?: number;
|
|
17
|
+
}
|
|
18
|
+
type SuigarCoin = 'sui' | 'usdc';
|
|
19
|
+
type SuigarCoinTypes = Record<SuigarCoin, string>;
|
|
20
|
+
type SuigarPackage = 'sweetHouse' | 'core' | 'coinflip' | 'limbo' | 'plinko' | 'pvpCoinflip' | 'range' | 'wheel';
|
|
21
|
+
type SuigarPackageIds = Record<SuigarPackage, string>;
|
|
22
|
+
type SuigarRegistry = 'pvpCoinflip';
|
|
23
|
+
type SuigarRegistryIds = Record<SuigarRegistry, string>;
|
|
24
|
+
type SuigarPriceInfoObjectIds = Record<SuigarCoin, string>;
|
|
25
|
+
type SuigarConfig = {
|
|
26
|
+
packageIds: SuigarPackageIds;
|
|
27
|
+
registryIds: SuigarRegistryIds;
|
|
28
|
+
coinTypes: SuigarCoinTypes;
|
|
29
|
+
priceInfoObjectIds: SuigarPriceInfoObjectIds;
|
|
30
|
+
};
|
|
31
|
+
//#endregion
|
|
32
|
+
export { SuigarCoin, SuigarCoinTypes, SuigarConfig, SuigarExtensionOptions, SuigarPackage, SuigarPackageIds, SuigarPriceInfoObjectIds, SuigarRegistry, SuigarRegistryIds };
|
|
33
|
+
//# sourceMappingURL=suigar-config.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"suigar-config.type.d.mts","names":[],"sources":["../../src/types/suigar-config.type.ts"],"mappings":";UAKiB,sBAAA;EAChB,IAAA,GAAO,IAAA;EADS;;;;;;EAQhB,OAAA;EAAA;;;;AASD;EAHC,QAAA;AAAA;AAAA,KAGW,UAAA;AAAA,KAEA,eAAA,GAAkB,MAAA,CAAO,UAAA;AAAA,KAEzB,aAAA;AAAA,KASA,gBAAA,GAAmB,MAAA,CAAO,aAAA;AAAA,KAE1B,cAAA;AAAA,KACA,iBAAA,GAAoB,MAAA,CAAO,cAAA;AAAA,KAE3B,wBAAA,GAA2B,MAAA,CAAO,UAAA;AAAA,KAIlC,YAAA;EACX,UAAA,EAAY,gBAAA;EACZ,WAAA,EAAa,iBAAA;EACb,SAAA,EAAW,eAAA;EACX,kBAAA,EAAoB,wBAAA;AAAA"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { CoinSide } from "./game.type.mjs";
|
|
2
|
+
import { BetMetadataInput } from "./bet-metadata.type.mjs";
|
|
3
|
+
import { SuigarConfig } from "./suigar-config.type.mjs";
|
|
4
|
+
import { Transaction } from "@mysten/sui/transactions";
|
|
5
|
+
|
|
6
|
+
//#region src/types/transaction-options.type.d.ts
|
|
7
|
+
type WithGasBudget = {
|
|
8
|
+
gasBudget?: Parameters<Transaction['setGasBudgetIfNotSet']>[0];
|
|
9
|
+
};
|
|
10
|
+
type WithThrowOnError<T = object> = T & {
|
|
11
|
+
throwOnError?: boolean;
|
|
12
|
+
};
|
|
13
|
+
type BaseTransactionOptions = WithGasBudget & {
|
|
14
|
+
config: SuigarConfig;
|
|
15
|
+
playerAddress: string;
|
|
16
|
+
};
|
|
17
|
+
type CoinTransactionOptions = {
|
|
18
|
+
coinType: string;
|
|
19
|
+
metadata?: BetMetadataInput;
|
|
20
|
+
allowGasCoinShortcut?: boolean;
|
|
21
|
+
};
|
|
22
|
+
type StakeTransactionOptions = {
|
|
23
|
+
stake: number | bigint;
|
|
24
|
+
cashStake?: number | bigint;
|
|
25
|
+
betCount?: number | bigint;
|
|
26
|
+
};
|
|
27
|
+
type SharedBetTransactionOptions = BaseTransactionOptions & CoinTransactionOptions & StakeTransactionOptions;
|
|
28
|
+
type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
|
|
29
|
+
side: CoinSide;
|
|
30
|
+
};
|
|
31
|
+
type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
|
|
32
|
+
targetMultiplier: number;
|
|
33
|
+
scale?: number;
|
|
34
|
+
};
|
|
35
|
+
type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
|
|
36
|
+
configId: number;
|
|
37
|
+
};
|
|
38
|
+
type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
|
|
39
|
+
leftPoint: number;
|
|
40
|
+
rightPoint: number;
|
|
41
|
+
outOfRange?: boolean;
|
|
42
|
+
scale?: number;
|
|
43
|
+
};
|
|
44
|
+
type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
|
|
45
|
+
configId: number;
|
|
46
|
+
};
|
|
47
|
+
type PvPCoinflipAction = 'create' | 'join' | 'cancel';
|
|
48
|
+
type SharedPvPCoinflipTransactionOptions = BaseTransactionOptions & CoinTransactionOptions;
|
|
49
|
+
type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
50
|
+
stake: StakeTransactionOptions['stake'];
|
|
51
|
+
side: CoinSide;
|
|
52
|
+
isPrivate?: boolean;
|
|
53
|
+
};
|
|
54
|
+
type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
55
|
+
gameId: string;
|
|
56
|
+
};
|
|
57
|
+
type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
58
|
+
gameId: string;
|
|
59
|
+
};
|
|
60
|
+
type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
|
|
61
|
+
//#endregion
|
|
62
|
+
export { BaseTransactionOptions, BuildCancelPvPCoinflipTransactionOptions, BuildCoinflipTransactionOptions, BuildCreatePvPCoinflipTransactionOptions, BuildJoinPvPCoinflipTransactionOptions, BuildLimboTransactionOptions, BuildPlinkoTransactionOptions, BuildPvPCoinflipTransactionOptions, BuildRangeTransactionOptions, BuildWheelTransactionOptions, CoinTransactionOptions, PvPCoinflipAction, SharedBetTransactionOptions, SharedPvPCoinflipTransactionOptions, StakeTransactionOptions, WithGasBudget, WithThrowOnError };
|
|
63
|
+
//# sourceMappingURL=transaction-options.type.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-options.type.d.mts","names":[],"sources":["../../src/types/transaction-options.type.ts"],"mappings":";;;;;;KAQY,aAAA;EACX,SAAA,GAAY,UAAA,CAAW,WAAA;AAAA;AAAA,KAOZ,gBAAA,eAA+B,CAAA;EAC1C,YAAA;AAAA;AAAA,KAGW,sBAAA,GAAyB,aAAA;EACpC,MAAA,EAAQ,YAAA;EACR,aAAA;AAAA;AAAA,KAGW,sBAAA;EACX,QAAA;EACA,QAAA,GAAW,gBAAA;EACX,oBAAA;AAAA;AAAA,KAGW,uBAAA;EACX,KAAA;EACA,SAAA;EACA,QAAA;AAAA;AAAA,KAGW,2BAAA,GAA8B,sBAAA,GACzC,sBAAA,GACA,uBAAA;AAAA,KAEW,+BAAA,GAAkC,2BAAA;EAC7C,IAAA,EAAM,QAAA;AAAA;AAAA,KAGK,4BAAA,GAA+B,2BAAA;EAC1C,gBAAA;EACA,KAAA;AAAA;AAAA,KAGW,6BAAA,GAAgC,2BAAA;EAC3C,QAAA;AAAA;AAAA,KAGW,4BAAA,GAA+B,2BAAA;EAC1C,SAAA;EACA,UAAA;EACA,UAAA;EACA,KAAA;AAAA;AAAA,KAGW,4BAAA,GAA+B,2BAAA;EAC1C,QAAA;AAAA;AAAA,KAGW,iBAAA;AAAA,KAEA,mCAAA,GAAsC,sBAAA,GACjD,sBAAA;AAAA,KAEW,wCAAA,GACX,mCAAA;EACC,KAAA,EAAO,uBAAA;EACP,IAAA,EAAM,QAAA;EACN,SAAA;AAAA;AAAA,KAGU,sCAAA,GACX,mCAAA;EACC,MAAA;AAAA;AAAA,KAQU,wCAAA,GACX,mCAAA;EACC,MAAA;AAAA;AAAA,KAGU,kCAAA,gBACI,iBAAA,GAAoB,iBAAA,IAChC,MAAA,oBACD,wCAAA,GACA,MAAA,kBACC,sCAAA,GACA,MAAA,oBACC,wCAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region src/utils/constants.d.ts
|
|
2
|
+
declare const DEFAULT_GAS_BUDGET_MIST: bigint;
|
|
3
|
+
declare const DEFAULT_RANGE_SCALE = 1000000;
|
|
4
|
+
declare const RANGE_POINT_LIMIT: number;
|
|
5
|
+
declare const DEFAULT_LIMBO_MULTIPLIER_SCALE = 100;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { DEFAULT_GAS_BUDGET_MIST, DEFAULT_LIMBO_MULTIPLIER_SCALE, DEFAULT_RANGE_SCALE, RANGE_POINT_LIMIT };
|
|
8
|
+
//# sourceMappingURL=constants.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.mts","names":[],"sources":["../../src/utils/constants.ts"],"mappings":";cAKa,uBAAA;AAAA,cACA,mBAAA;AAAA,cACA,iBAAA;AAAA,cACA,8BAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { parseToMist } from "@mysten/sui/utils";
|
|
2
|
+
//#region src/utils/constants.ts
|
|
3
|
+
const DEFAULT_GAS_BUDGET_MIST = parseToMist("0.05");
|
|
4
|
+
const DEFAULT_RANGE_SCALE = 1e6;
|
|
5
|
+
const RANGE_POINT_LIMIT = DEFAULT_RANGE_SCALE * 100;
|
|
6
|
+
const DEFAULT_LIMBO_MULTIPLIER_SCALE = 100;
|
|
7
|
+
//#endregion
|
|
8
|
+
export { DEFAULT_GAS_BUDGET_MIST, DEFAULT_LIMBO_MULTIPLIER_SCALE, DEFAULT_RANGE_SCALE, RANGE_POINT_LIMIT };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=constants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.mjs","names":[],"sources":["../../src/utils/constants.ts"],"sourcesContent":["// Copyright (c) Suigar\n// SPDX-License-Identifier: Apache-2.0\n\nimport { parseToMist } from '@mysten/sui/utils';\n\nexport const DEFAULT_GAS_BUDGET_MIST: bigint = parseToMist('0.05');\nexport const DEFAULT_RANGE_SCALE = 1_000_000;\nexport const RANGE_POINT_LIMIT: number = DEFAULT_RANGE_SCALE * 100;\nexport const DEFAULT_LIMBO_MULTIPLIER_SCALE = 100;\n"],"mappings":";;AAKA,MAAa,0BAAkC,YAAY,OAAO;AAClE,MAAa,sBAAsB;AACnC,MAAa,oBAA4B,sBAAsB;AAC/D,MAAa,iCAAiC"}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { MoveFloat } from "../types/move-float.type.mjs";
|
|
2
|
+
//#region src/utils/numeric.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Converts a generated Move `i64` wrapper into a JavaScript number.
|
|
5
|
+
*
|
|
6
|
+
* The generated bindings expose signed 64-bit integers through a `{ bits }`
|
|
7
|
+
* field that stores the raw two's-complement bit pattern. This helper
|
|
8
|
+
* reinterprets those bits as a signed `i64` and returns a plain JS number.
|
|
9
|
+
* Invalid or missing input falls back to `0`.
|
|
10
|
+
*
|
|
11
|
+
* @param i64 Generated Move `i64` value, typically used for float exponents.
|
|
12
|
+
* @returns The signed 64-bit value as a JavaScript number.
|
|
13
|
+
*/
|
|
14
|
+
declare function fromMoveI64(i64: MoveFloat['exp']): number;
|
|
15
|
+
/**
|
|
16
|
+
* Converts a generated Move `Float` struct into a JavaScript number.
|
|
17
|
+
*
|
|
18
|
+
* Suigar float values are represented as a sign flag, an unsigned mantissa,
|
|
19
|
+
* and a Move `i64` exponent. This helper rebuilds the numeric value using the
|
|
20
|
+
* same normalization expected by the on-chain format and applies the sign at
|
|
21
|
+
* the end. Missing mantissas are treated as `0`, and a zero mantissa returns `0`.
|
|
22
|
+
*
|
|
23
|
+
* @param float Generated Move float value with `mant`, `exp`, and `is_negative`.
|
|
24
|
+
* @returns The decoded floating-point value as a JavaScript number.
|
|
25
|
+
*/
|
|
26
|
+
declare function fromMoveFloat(float: MoveFloat): number;
|
|
27
|
+
/**
|
|
28
|
+
* Normalizes a value into a non-negative `bigint`.
|
|
29
|
+
*
|
|
30
|
+
* Accepted inputs:
|
|
31
|
+
* - `bigint`
|
|
32
|
+
* - finite `number`
|
|
33
|
+
* - base-10 integer `string`
|
|
34
|
+
* - `boolean`
|
|
35
|
+
*
|
|
36
|
+
* Number inputs are truncated toward zero before conversion, so `5.9` becomes
|
|
37
|
+
* `5n`. String and boolean inputs are parsed through the native
|
|
38
|
+
* `BigInt(...)` constructor, so `true` becomes `1n`, `false` becomes `0n`,
|
|
39
|
+
* and only integer strings are accepted.
|
|
40
|
+
*
|
|
41
|
+
* @param value Value to normalize.
|
|
42
|
+
* @returns A non-negative `bigint`.
|
|
43
|
+
* @throws When `value` is not a bigint, finite number, integer string, or
|
|
44
|
+
* boolean.
|
|
45
|
+
* @throws When the normalized value is negative.
|
|
46
|
+
*/
|
|
47
|
+
declare function toBigInt(value: unknown): bigint;
|
|
48
|
+
/**
|
|
49
|
+
* Validates that a value can be safely used as a Move `u8` in the `0..255`
|
|
50
|
+
* range.
|
|
51
|
+
*
|
|
52
|
+
* Accepted inputs:
|
|
53
|
+
* - finite `number`
|
|
54
|
+
* - base-10 integer `string`
|
|
55
|
+
*
|
|
56
|
+
* String inputs are accepted for parsed values such as `'1'`, but only when
|
|
57
|
+
* they are plain non-negative integer strings. This helper does not accept
|
|
58
|
+
* booleans and does not truncate fractional values.
|
|
59
|
+
*
|
|
60
|
+
* @param value Value to validate.
|
|
61
|
+
* @returns The validated `u8` value as a JavaScript `number`.
|
|
62
|
+
* @throws When `value` is not a finite number or integer string.
|
|
63
|
+
* @throws When `value` is not an integer between `0` and `255`.
|
|
64
|
+
*/
|
|
65
|
+
declare function toU8(value: unknown): number;
|
|
66
|
+
/**
|
|
67
|
+
* Validates that a value can be safely used as a Move `u16` in the
|
|
68
|
+
* `0..65535` range.
|
|
69
|
+
*
|
|
70
|
+
* Accepted inputs:
|
|
71
|
+
* - finite `number`
|
|
72
|
+
* - base-10 integer `string`
|
|
73
|
+
*
|
|
74
|
+
* String inputs are accepted for parsed values such as `'1'`, but only when
|
|
75
|
+
* they are plain non-negative integer strings. This helper does not accept
|
|
76
|
+
* booleans and does not truncate fractional values.
|
|
77
|
+
*
|
|
78
|
+
* @param value Value to validate.
|
|
79
|
+
* @returns The validated `u16` value as a JavaScript `number`.
|
|
80
|
+
* @throws When `value` is not a finite number or integer string.
|
|
81
|
+
* @throws When `value` is not an integer between `0` and `65535`.
|
|
82
|
+
*/
|
|
83
|
+
declare function toU16(value: unknown): number;
|
|
84
|
+
//#endregion
|
|
85
|
+
export { fromMoveFloat, fromMoveI64, toBigInt, toU16, toU8 };
|
|
86
|
+
//# sourceMappingURL=numeric.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"numeric.d.mts","names":[],"sources":["../../src/utils/numeric.ts"],"mappings":";;;;;AAgBA;;;;;AAmBA;;;iBAnBgB,WAAA,CAAY,GAAA,EAAK,SAAA;;AAgEjC;;;;;AAqFA;;;;;iBAlIgB,aAAA,CAAc,KAAA,EAAO,SAAA;;;;;;;;;;;;;;;;;;;;;iBA6CrB,QAAA,CAAS,KAAA;;;;;;;;;;;;;;;;;;iBAqFT,IAAA,CAAK,KAAA;;;;;;;;;;;;;;;;;;iBAqBL,KAAA,CAAM,KAAA"}
|