@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.
Files changed (160) hide show
  1. package/CHANGELOG.md +23 -4
  2. package/README.md +22 -8
  3. package/dist/client.d.mts +258 -0
  4. package/dist/client.d.mts.map +1 -0
  5. package/dist/client.mjs +291 -0
  6. package/dist/client.mjs.map +1 -0
  7. package/dist/configs/package.mainnet.mjs +23 -0
  8. package/dist/configs/package.mainnet.mjs.map +1 -0
  9. package/dist/configs/package.mjs +19 -0
  10. package/dist/configs/package.mjs.map +1 -0
  11. package/dist/configs/package.testnet.mjs +23 -0
  12. package/dist/configs/package.testnet.mjs.map +1 -0
  13. package/dist/configs/registry.mainnet.mjs +6 -0
  14. package/dist/configs/registry.mainnet.mjs.map +1 -0
  15. package/dist/configs/registry.mjs +11 -0
  16. package/dist/configs/registry.mjs.map +1 -0
  17. package/dist/configs/registry.testnet.mjs +6 -0
  18. package/dist/configs/registry.testnet.mjs.map +1 -0
  19. package/dist/contracts/coinflip/coinflip.mjs +46 -0
  20. package/dist/contracts/coinflip/coinflip.mjs.map +1 -0
  21. package/dist/contracts/core/core.d.mts +55 -0
  22. package/dist/contracts/core/core.d.mts.map +1 -0
  23. package/dist/contracts/core/core.mjs +22 -0
  24. package/dist/contracts/core/core.mjs.map +1 -0
  25. package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
  26. package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
  27. package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
  28. package/dist/contracts/core/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
  29. package/dist/contracts/core/float.d.mts +14 -0
  30. package/dist/contracts/core/float.d.mts.map +1 -0
  31. package/dist/contracts/core/float.mjs +15 -0
  32. package/dist/contracts/core/float.mjs.map +1 -0
  33. package/dist/contracts/core/i64.mjs +10 -0
  34. package/dist/contracts/core/i64.mjs.map +1 -0
  35. package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
  36. package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
  37. package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
  38. package/dist/contracts/limbo/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
  39. package/dist/contracts/limbo/limbo.mjs +53 -0
  40. package/dist/contracts/limbo/limbo.mjs.map +1 -0
  41. package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
  42. package/dist/contracts/plinko/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
  43. package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
  44. package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
  45. package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
  46. package/dist/contracts/plinko/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
  47. package/dist/contracts/plinko/plinko.mjs +59 -0
  48. package/dist/contracts/plinko/plinko.mjs.map +1 -0
  49. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs +10 -0
  50. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000001/type_name.mjs.map +1 -0
  51. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs +10 -0
  52. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/balance.mjs.map +1 -0
  53. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
  54. package/dist/contracts/pvp-coinflip/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
  55. package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts +34 -0
  56. package/dist/contracts/pvp-coinflip/pvp_coinflip.d.mts.map +1 -0
  57. package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs +131 -0
  58. package/dist/contracts/pvp-coinflip/pvp_coinflip.mjs.map +1 -0
  59. package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
  60. package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
  61. package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
  62. package/dist/contracts/range/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
  63. package/dist/contracts/range/range.mjs +53 -0
  64. package/dist/contracts/range/range.mjs.map +1 -0
  65. package/dist/contracts/utils/index.d.mts +33 -0
  66. package/dist/contracts/utils/index.d.mts.map +1 -0
  67. package/dist/contracts/utils/index.mjs +119 -0
  68. package/dist/contracts/utils/index.mjs.map +1 -0
  69. package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs +26 -0
  70. package/dist/contracts/wheel/deps/0x0000000000000000000000000000000000000000000000000000000000000002/vec_map.mjs.map +1 -0
  71. package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs +15 -0
  72. package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/float.mjs.map +1 -0
  73. package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs +10 -0
  74. package/dist/contracts/wheel/deps/0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc/i64.mjs.map +1 -0
  75. package/dist/contracts/wheel/wheel.mjs +59 -0
  76. package/dist/contracts/wheel/wheel.mjs.map +1 -0
  77. package/dist/games.d.mts +3 -0
  78. package/dist/games.mjs +1 -0
  79. package/dist/helpers/config.mjs +51 -0
  80. package/dist/helpers/config.mjs.map +1 -0
  81. package/dist/helpers/game-settings.mjs +19 -0
  82. package/dist/helpers/game-settings.mjs.map +1 -0
  83. package/dist/helpers/metadata.mjs +42 -0
  84. package/dist/helpers/metadata.mjs.map +1 -0
  85. package/dist/index.d.mts +2 -0
  86. package/dist/index.mjs +2 -0
  87. package/dist/transactions/coinflip.mjs +27 -0
  88. package/dist/transactions/coinflip.mjs.map +1 -0
  89. package/dist/transactions/limbo.mjs +31 -0
  90. package/dist/transactions/limbo.mjs.map +1 -0
  91. package/dist/transactions/plinko.mjs +29 -0
  92. package/dist/transactions/plinko.mjs.map +1 -0
  93. package/dist/transactions/pvp-coinflip.mjs +70 -0
  94. package/dist/transactions/pvp-coinflip.mjs.map +1 -0
  95. package/dist/transactions/range.mjs +33 -0
  96. package/dist/transactions/range.mjs.map +1 -0
  97. package/dist/transactions/shared.mjs +49 -0
  98. package/dist/transactions/shared.mjs.map +1 -0
  99. package/dist/transactions/wheel.mjs +29 -0
  100. package/dist/transactions/wheel.mjs.map +1 -0
  101. package/dist/ttl-cache.mjs +60 -0
  102. package/dist/ttl-cache.mjs.map +1 -0
  103. package/dist/types/bet-metadata.type.d.mts +7 -0
  104. package/dist/types/bet-metadata.type.d.mts.map +1 -0
  105. package/dist/types/build-game-transaction-options.type.d.mts +9 -0
  106. package/dist/types/build-game-transaction-options.type.d.mts.map +1 -0
  107. package/dist/types/game-details.type.d.mts +73 -0
  108. package/dist/types/game-details.type.d.mts.map +1 -0
  109. package/dist/types/game-details.type.mjs +59 -0
  110. package/dist/types/game-details.type.mjs.map +1 -0
  111. package/dist/types/game-settings.type.d.mts +201 -0
  112. package/dist/types/game-settings.type.d.mts.map +1 -0
  113. package/dist/types/game-settings.type.mjs +37 -0
  114. package/dist/types/game-settings.type.mjs.map +1 -0
  115. package/dist/types/game.type.d.mts +15 -0
  116. package/dist/types/game.type.d.mts.map +1 -0
  117. package/dist/types/game.type.mjs +19 -0
  118. package/dist/types/game.type.mjs.map +1 -0
  119. package/dist/types/index.d.mts +7 -0
  120. package/dist/types/move-float.type.d.mts +7 -0
  121. package/dist/types/move-float.type.d.mts.map +1 -0
  122. package/dist/types/network.type.d.mts +1 -0
  123. package/dist/types/network.type.mjs +6 -0
  124. package/dist/types/network.type.mjs.map +1 -0
  125. package/dist/types/suigar-config.type.d.mts +33 -0
  126. package/dist/types/suigar-config.type.d.mts.map +1 -0
  127. package/dist/types/transaction-options.type.d.mts +63 -0
  128. package/dist/types/transaction-options.type.d.mts.map +1 -0
  129. package/dist/utils/constants.d.mts +8 -0
  130. package/dist/utils/constants.d.mts.map +1 -0
  131. package/dist/utils/constants.mjs +10 -0
  132. package/dist/utils/constants.mjs.map +1 -0
  133. package/dist/utils/numeric.d.mts +86 -0
  134. package/dist/utils/numeric.d.mts.map +1 -0
  135. package/dist/utils/numeric.mjs +148 -0
  136. package/dist/utils/numeric.mjs.map +1 -0
  137. package/dist/utils/parser.d.mts +54 -0
  138. package/dist/utils/parser.d.mts.map +1 -0
  139. package/dist/utils/parser.mjs +94 -0
  140. package/dist/utils/parser.mjs.map +1 -0
  141. package/dist/utils.d.mts +4 -0
  142. package/dist/utils.mjs +4 -0
  143. package/package.json +16 -17
  144. package/dist/chunk-7N55D2TV.js +0 -343
  145. package/dist/games-BHYRg31e.d.cts +0 -98
  146. package/dist/games-BHYRg31e.d.ts +0 -98
  147. package/dist/games.cjs +0 -2
  148. package/dist/games.d.cts +0 -2
  149. package/dist/games.d.ts +0 -2
  150. package/dist/games.js +0 -1
  151. package/dist/index-3P_LBbDM.d.cts +0 -25
  152. package/dist/index-3P_LBbDM.d.ts +0 -25
  153. package/dist/index.cjs +0 -1692
  154. package/dist/index.d.cts +0 -457
  155. package/dist/index.d.ts +0 -457
  156. package/dist/index.js +0 -1470
  157. package/dist/utils.cjs +0 -243
  158. package/dist/utils.d.cts +0 -180
  159. package/dist/utils.d.ts +0 -180
  160. package/dist/utils.js +0 -1
package/dist/index.d.cts DELETED
@@ -1,457 +0,0 @@
1
- import { M as MoveStruct } from './index-3P_LBbDM.cjs';
2
- import * as _mysten_bcs from '@mysten/bcs';
3
- import { SuiClientTypes, ClientWithCoreApi } from '@mysten/sui/client';
4
- import { Transaction, BuildTransactionOptions } from '@mysten/sui/transactions';
5
- import { S as StandardGame, B as BuildCoinflipTransactionOptions, a as BuildWheelTransactionOptions, b as BuildLimboTransactionOptions, c as BuildPlinkoTransactionOptions, d as BuildRangeTransactionOptions, G as Game, e as SuigarConfig, W as WithThrowOnError, P as PvPCoinflipAction, f as BuildPvPCoinflipTransactionOptions, g as SuigarExtensionOptions } from './games-BHYRg31e.cjs';
6
- import '@mysten/sui/bcs';
7
-
8
- type WithoutConfig<T> = Omit<T, 'config'>;
9
- type BuildGameOptions<GameId extends StandardGame> = GameId extends 'coinflip' ? WithoutConfig<BuildCoinflipTransactionOptions> : GameId extends 'wheel' ? WithoutConfig<BuildWheelTransactionOptions> : GameId extends 'limbo' ? WithoutConfig<BuildLimboTransactionOptions> : GameId extends 'plinko' ? WithoutConfig<BuildPlinkoTransactionOptions> : GameId extends 'range' ? WithoutConfig<BuildRangeTransactionOptions> : never;
10
-
11
- declare const GAME_SETTINGS: {
12
- readonly coinflip: {
13
- readonly settingsKey: MoveStruct<{
14
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
15
- }, "0xb35c5f286c443752afc8ccb40125a578a4f32df35617170ccfa17fe180ab80ea::coinflip::CoinFlipSettingsKey">;
16
- readonly parameters: MoveStruct<{
17
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
18
- house_edge: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
19
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
20
- max_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
21
- }, "0xb35c5f286c443752afc8ccb40125a578a4f32df35617170ccfa17fe180ab80ea::coinflip::Parameters<phantom T0>">;
22
- };
23
- readonly limbo: {
24
- readonly settingsKey: MoveStruct<{
25
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
26
- }, "0x96c7841b9b32c59a219760fd656f1c3aceb53cc74a68ec9844a3a696374309f4::limbo::LimboSettingsKey">;
27
- readonly parameters: MoveStruct<{
28
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
29
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
30
- max_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
31
- max_payout: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
32
- min_target_multiplier: MoveStruct<{
33
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
34
- exp: MoveStruct<{
35
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
36
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
37
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
38
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
39
- max_target_multiplier: MoveStruct<{
40
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
41
- exp: MoveStruct<{
42
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
43
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
44
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
45
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
46
- max_number_of_games: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
47
- min_rtp: MoveStruct<{
48
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
49
- exp: MoveStruct<{
50
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
51
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
52
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
53
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
54
- max_rtp: MoveStruct<{
55
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
56
- exp: MoveStruct<{
57
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
58
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
59
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
60
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
61
- }, "0x96c7841b9b32c59a219760fd656f1c3aceb53cc74a68ec9844a3a696374309f4::limbo::Parameters<phantom T0>">;
62
- };
63
- readonly plinko: {
64
- readonly settingsKey: MoveStruct<{
65
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
66
- }, "0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::PlinkoSettingsKey">;
67
- readonly parameters: MoveStruct<{
68
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
69
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
70
- max_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
71
- max_number_of_balls: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
72
- configs: MoveStruct<{
73
- contents: _mysten_bcs.BcsType<{
74
- key: number;
75
- value: {
76
- num_rows: number;
77
- multipliers: {
78
- is_negative: boolean;
79
- exp: {
80
- bits: string;
81
- };
82
- mant: string;
83
- }[];
84
- min_stake: string;
85
- max_stake: string;
86
- is_playable: boolean;
87
- };
88
- }[], Iterable<{
89
- key: number;
90
- value: {
91
- num_rows: number;
92
- multipliers: Iterable<{
93
- is_negative: boolean;
94
- exp: {
95
- bits: string | number | bigint;
96
- };
97
- mant: string | number | bigint;
98
- }> & {
99
- length: number;
100
- };
101
- min_stake: string | number | bigint;
102
- max_stake: string | number | bigint;
103
- is_playable: boolean;
104
- };
105
- }> & {
106
- length: number;
107
- }, string>;
108
- }, "0x2::vec_map::VecMap<u8, 0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::PlinkoConfig>">;
109
- }, "0xd3dd2200883af10811724f0bed97591ad155a02efd6332d471ff8b346030dfb7::plinko::Parameters<phantom T0>">;
110
- };
111
- readonly 'pvp-coinflip': {
112
- readonly settingsKey: MoveStruct<{
113
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
114
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::PvpCoinflipSettingsKey">;
115
- readonly parameters: MoveStruct<{
116
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
117
- house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
118
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
119
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Parameters<phantom T0>">;
120
- };
121
- readonly range: {
122
- readonly settingsKey: MoveStruct<{
123
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
124
- }, "0x096a4cf18b3661e76b2c62b90785418345d52f45b272448794f123a4cb6b6416::range::RangeSettingsKey">;
125
- readonly parameters: MoveStruct<{
126
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
127
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
128
- max_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
129
- min_zone_size: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
130
- max_zone_size: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
131
- max_number_of_games: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
132
- min_rtp: MoveStruct<{
133
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
134
- exp: MoveStruct<{
135
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
136
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
137
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
138
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
139
- max_rtp: MoveStruct<{
140
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
141
- exp: MoveStruct<{
142
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
143
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
144
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
145
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
146
- }, "0x096a4cf18b3661e76b2c62b90785418345d52f45b272448794f123a4cb6b6416::range::Parameters<phantom T0>">;
147
- };
148
- readonly wheel: {
149
- readonly settingsKey: MoveStruct<{
150
- dummy_field: _mysten_bcs.BcsType<boolean, boolean, "bool">;
151
- }, "0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::WheelSettingsKey">;
152
- readonly parameters: MoveStruct<{
153
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
154
- min_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
155
- max_stake: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
156
- max_number_of_spins: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
157
- configs: MoveStruct<{
158
- contents: _mysten_bcs.BcsType<{
159
- key: number;
160
- value: {
161
- num_cases: number;
162
- multipliers: {
163
- is_negative: boolean;
164
- exp: {
165
- bits: string;
166
- };
167
- mant: string;
168
- }[];
169
- min_stake: string;
170
- max_stake: string;
171
- is_playable: boolean;
172
- };
173
- }[], Iterable<{
174
- key: number;
175
- value: {
176
- num_cases: number;
177
- multipliers: Iterable<{
178
- is_negative: boolean;
179
- exp: {
180
- bits: string | number | bigint;
181
- };
182
- mant: string | number | bigint;
183
- }> & {
184
- length: number;
185
- };
186
- min_stake: string | number | bigint;
187
- max_stake: string | number | bigint;
188
- is_playable: boolean;
189
- };
190
- }> & {
191
- length: number;
192
- }, string>;
193
- }, "0x2::vec_map::VecMap<u8, 0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::WheelConfig>">;
194
- }, "0x0997852ded7e13301c42317004bc49704a893aa82997c5706cebee59053a31b7::wheel::Parameters<phantom T0>">;
195
- };
196
- };
197
- type GameParametersMap = {
198
- [TGame in Game]: ReturnType<(typeof GAME_SETTINGS)[TGame]['parameters']['parse']>;
199
- };
200
- type GameParameters<TGame extends Game> = GameParametersMap[TGame];
201
- type GetGameParametersOptions = SuiClientTypes.CoreClientMethodOptions & {
202
- coinType?: string;
203
- ignoreCache?: boolean;
204
- };
205
-
206
- declare function suigar<const Name = 'suigar'>({ name, partner, cacheTtl, }?: SuigarExtensionOptions<Name>): {
207
- name: Name;
208
- register: (client: ClientWithCoreApi) => SuigarClient;
209
- };
210
- declare class SuigarClient {
211
- #private;
212
- constructor({ client, name, partner, cacheTtl, }: {
213
- client: ClientWithCoreApi;
214
- name: string;
215
- partner?: string;
216
- cacheTtl?: number;
217
- });
218
- /**
219
- * Returns the resolved SDK configuration for the connected network.
220
- *
221
- * This is primarily useful for debugging or inspecting which package ids,
222
- * registry ids, supported coin types, and price info object ids the SDK
223
- * resolved for the current client network.
224
- *
225
- * @returns Network-resolved Suigar configuration.
226
- */
227
- getConfig(): SuigarConfig;
228
- /**
229
- * Builds a transaction with the configured Sui client and encodes the resulting BCS bytes as base64.
230
- *
231
- * Use this when an external wallet, API, or transport expects the built transaction payload as a base64 string
232
- * instead of raw bytes. The SDK always injects the configured Sui client, so `options` accepts the standard
233
- * transaction build options except for `client`.
234
- *
235
- * @param transaction Transaction to build and serialize.
236
- * @param options Optional transaction build options forwarded to `transaction.build()`, excluding `client`.
237
- * @returns Base64-encoded transaction bytes ready to send over the wire.
238
- */
239
- serializeTransactionToBase64(transaction: Transaction, options?: Omit<BuildTransactionOptions, 'client'>): Promise<string>;
240
- /**
241
- * Reads on-chain game parameters for the requested game.
242
- *
243
- * The SDK first reads the selected game's settings object from SweetHouse,
244
- * then reads that game's coin-specific `Parameters<T>` object. Results are
245
- * cached according to the extension `cacheTtl` option. Pass
246
- * `ignoreCache: true` to refresh the on-chain read and replace the cached
247
- * value.
248
- *
249
- * @param game Game whose parameters should be loaded.
250
- * @param options Optional coin type, cache override, and abort signal.
251
- * @returns Parsed game parameters typed for the requested game.
252
- */
253
- getGameParameters<TGame extends Game>(game: TGame, options?: GetGameParametersOptions): Promise<GameParameters<TGame>>;
254
- /**
255
- * Lists unresolved PvP coinflip games from the configured registry and resolves
256
- * each entry into parsed on-chain game state.
257
- *
258
- * This fetches dynamic fields from the PvP coinflip registry object, then bulk
259
- * loads the referenced game objects through `client.core.getObjects()`. Registry
260
- * membership is the unresolved-state signal: when a game is joined and resolved,
261
- * the Move flow removes it from the registry and deletes the live `Game` object.
262
- * Use this when a product needs the current set of open PvP coinflip matches for
263
- * browsing or lobby views.
264
- *
265
- * @param options Optional dynamic field pagination forwarded to `listDynamicFields()`, excluding `parentId`.
266
- * Supported options such as `limit`, `cursor`, and `signal` are forwarded to the
267
- * underlying lookup calls. Pass `throwOnError: true` to fail the whole lookup
268
- * when any referenced game object cannot be fetched or parsed. By default,
269
- * failed per-object lookups are skipped and only successfully parsed unresolved
270
- * games are returned.
271
- * @returns Parsed unresolved PvP coinflip game objects for the requested
272
- * registry page. When `throwOnError` is `false`, entries that fail object fetch
273
- * or parse are omitted from the returned array.
274
- */
275
- getPvPCoinflipGames(options?: WithThrowOnError<Omit<SuiClientTypes.ListDynamicFieldsOptions, 'parentId'>>): Promise<{
276
- coinType: string;
277
- id: string;
278
- creator: string;
279
- creator_is_tails: boolean;
280
- is_private: boolean;
281
- creator_metadata: {
282
- contents: {
283
- key: string;
284
- value: number[];
285
- }[];
286
- };
287
- joiner: string;
288
- winner: string;
289
- stake_per_player: string;
290
- house_edge_bps: string;
291
- stake_pot: {
292
- value: string;
293
- };
294
- }[]>;
295
- /**
296
- * BCS struct constructors for decoding on-chain objects and events related to Suigar games.
297
- *
298
- * These can be used to parse the `content` field of on-chain objects and events into structured data with the
299
- * expected types. For example, use `client.suigar.bcs.PvPCoinflipGame.parse(object.content)` to decode a PvP
300
- * coinflip game object.
301
- *
302
- * Note that these constructors are not meant for encoding transaction arguments, as the SDK's transaction
303
- * builders handle argument serialization internally. Use these primarily for decoding and parsing on-chain data.
304
- */
305
- bcs: {
306
- /**
307
- * Object representing the state of a PvP coinflip game, as stored on-chain.
308
- */
309
- PvPCoinflipGame: MoveStruct<{
310
- id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
311
- creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
312
- creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
313
- is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
314
- creator_metadata: MoveStruct<{
315
- contents: _mysten_bcs.BcsType<{
316
- key: string;
317
- value: number[];
318
- }[], Iterable<{
319
- key: string;
320
- value: Iterable<number> & {
321
- length: number;
322
- };
323
- }> & {
324
- length: number;
325
- }, string>;
326
- }, "0x2::vec_map::VecMap<string, vector<u8>>">;
327
- joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
328
- winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
329
- stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
330
- house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
331
- stake_pot: MoveStruct<{
332
- value: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
333
- }, "0x2::balance::Balance<phantom T0>">;
334
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Game<phantom T0>">;
335
- /**
336
- * Event emitted at the end of a standard game (e.g., Coinflip, Limbo), containing the result and payout information.
337
- */
338
- BetResultEvent: MoveStruct<{
339
- player: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
340
- coin_type: MoveStruct<{
341
- name: _mysten_bcs.BcsType<string, string, "string">;
342
- }, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
343
- stake_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
344
- unsafe_oracle_usd_coin_price: MoveStruct<{
345
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
346
- exp: MoveStruct<{
347
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
348
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
349
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
350
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
351
- adjusted_oracle_usd_coin_price: MoveStruct<{
352
- is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
353
- exp: MoveStruct<{
354
- bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
355
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
356
- mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
357
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
358
- outcome_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
359
- game_details: MoveStruct<{
360
- contents: _mysten_bcs.BcsType<{
361
- key: string;
362
- value: number[];
363
- }[], Iterable<{
364
- key: string;
365
- value: Iterable<number> & {
366
- length: number;
367
- };
368
- }> & {
369
- length: number;
370
- }, string>;
371
- }, "0x2::vec_map::VecMap<string, vector<u8>>">;
372
- metadata: MoveStruct<{
373
- contents: _mysten_bcs.BcsType<{
374
- key: string;
375
- value: number[];
376
- }[], Iterable<{
377
- key: string;
378
- value: Iterable<number> & {
379
- length: number;
380
- };
381
- }> & {
382
- length: number;
383
- }, string>;
384
- }, "0x2::vec_map::VecMap<string, vector<u8>>">;
385
- }, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::core::BetResultEvent<phantom T0>">;
386
- /**
387
- * Event emitted when a PvP Coinflip game is created, containing the game configuration and initial state.
388
- */
389
- PvPCoinflipGameCreatedEvent: MoveStruct<{
390
- game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
391
- creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
392
- creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
393
- is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
394
- joiner_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
395
- stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
396
- house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
397
- coin_type: MoveStruct<{
398
- name: _mysten_bcs.BcsType<string, string, "string">;
399
- }, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
400
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCreatedEvent<phantom T0>">;
401
- /**
402
- * Event emitted when a PvP Coinflip game is resolved, containing the final outcome.
403
- */
404
- PvPCoinflipGameResolvedEvent: MoveStruct<{
405
- game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
406
- creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
407
- joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
408
- winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
409
- creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
410
- is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
411
- joiner_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
412
- stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
413
- total_pot: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
414
- house_edge_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
415
- payout_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
416
- coin_type: MoveStruct<{
417
- name: _mysten_bcs.BcsType<string, string, "string">;
418
- }, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
419
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameResolvedEvent<phantom T0>">;
420
- /**
421
- * Event emitted when a PvP Coinflip game is cancelled.
422
- */
423
- PvPCoinflipGameCancelledEvent: MoveStruct<{
424
- game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
425
- creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
426
- creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
427
- is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
428
- stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
429
- coin_type: MoveStruct<{
430
- name: _mysten_bcs.BcsType<string, string, "string">;
431
- }, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
432
- }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCancelledEvent<phantom T0>">;
433
- };
434
- /**
435
- * Transaction builders for Suigar games.
436
- */
437
- tx: {
438
- /**
439
- * Creates a standard game transaction for the provided game id.
440
- *
441
- * @param gameId Supported standard game identifier.
442
- * @param options Transaction builder options for the selected game.
443
- * @returns Prepared transaction for the selected game.
444
- */
445
- createBetTransaction: <GameId extends StandardGame>(gameId: GameId, options: BuildGameOptions<GameId>) => Transaction;
446
- /**
447
- * Creates a PvP coinflip transaction for the requested action.
448
- *
449
- * @param action PvP coinflip action to perform.
450
- * @param options Transaction builder options for the selected action.
451
- * @returns Prepared PvP coinflip transaction.
452
- */
453
- createPvPCoinflipTransaction: <Action extends PvPCoinflipAction>(action: Action, options: BuildPvPCoinflipTransactionOptions<Action>) => Transaction;
454
- };
455
- }
456
-
457
- export { SuigarClient, suigar };