@suigar/sdk 2.0.0-beta.3 → 2.0.0-beta.5

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/index.d.cts CHANGED
@@ -1,121 +1,22 @@
1
- import { BcsType, BcsStruct } from '@mysten/sui/bcs';
2
- import { SuiClientTypes, ClientWithCoreApi } from '@mysten/sui/client';
1
+ import { M as MoveStruct } from './index-jwSXA8q3.cjs';
3
2
  import * as _mysten_bcs from '@mysten/bcs';
3
+ import { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
4
4
  import { Transaction, BuildTransactionOptions } from '@mysten/sui/transactions';
5
-
6
- interface GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectOptions<Include> {
7
- client: ClientWithCoreApi;
8
- }
9
- interface GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectsOptions<Include> {
10
- client: ClientWithCoreApi;
11
- }
12
- declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
13
- get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
14
- content: true;
15
- json: true;
16
- }> & {
17
- json: BcsStruct<T>['$inferType'];
18
- }>;
19
- getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
20
- content: true;
21
- json: true;
22
- }> & {
23
- json: BcsStruct<T>['$inferType'];
24
- }>>;
25
- }
26
-
27
- type BetMetadataPrimitive = string | number | boolean | bigint;
28
- type BetMetadataValue = BetMetadataPrimitive | Uint8Array | number[];
29
- type BetMetadataInput = Record<string, BetMetadataValue | null | undefined>;
30
-
31
- declare const GAMES: readonly ["coinflip", "limbo", "plinko", "pvp-coinflip", "range", "wheel"];
32
- type Game = (typeof GAMES)[number];
33
- type StandardGame = Exclude<Game, PvPGame>;
34
- type PvPGame = 'pvp-coinflip';
35
- type CoinSide = 'heads' | 'tails';
36
-
37
- interface SuigarExtensionOptions<Name = 'suigar'> {
38
- name?: Name;
39
- }
40
- type SuigarCoin = 'sui' | 'usdc';
41
- type SuigarCoinTypes = Record<SuigarCoin, string>;
42
- type SuigarPackageKey = 'sweetHouse' | 'core' | 'coinflip' | 'limbo' | 'plinko' | 'pvpCoinflip' | 'range' | 'wheel';
43
- type SuigarPackage = Record<SuigarPackageKey, string>;
44
- type SuigarPriceInfoObjectId = Record<SuigarCoin, string>;
45
- type SuigarConfig = {
46
- packageIds: SuigarPackage;
47
- coinTypes: SuigarCoinTypes;
48
- priceInfoObjectIds: SuigarPriceInfoObjectId;
49
- };
50
-
51
- type SharedBetTransactionOptions = {
52
- config: SuigarConfig;
53
- owner: string;
54
- coinType: string;
55
- stake: number | bigint;
56
- cashStake?: number | bigint;
57
- betCount?: number | bigint;
58
- metadata?: BetMetadataInput;
59
- gasBudget?: number | bigint;
60
- sender?: string;
61
- allowGasCoinShortcut?: boolean;
62
- };
63
-
64
- type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
65
- side: CoinSide;
66
- };
67
- type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
68
- targetMultiplier: number;
69
- scale?: number;
70
- };
71
- type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
72
- configId: number;
73
- };
74
- type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
75
- leftPoint: number;
76
- rightPoint: number;
77
- outOfRange?: boolean;
78
- scale?: number;
79
- };
80
- type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
81
- configId: number;
82
- };
83
- type PvPCoinflipAction = 'create' | 'join' | 'cancel';
84
- type SharedPvPCoinflipTransactionOptions = {
85
- config: SuigarConfig;
86
- owner: string;
87
- coinType: string;
88
- metadata?: BetMetadataInput;
89
- gasBudget?: number | bigint;
90
- sender?: string;
91
- allowGasCoinShortcut?: boolean;
92
- };
93
- type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
94
- stake: number | bigint;
95
- side: CoinSide;
96
- isPrivate?: boolean;
97
- };
98
- type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
99
- gameId: string;
100
- stake: number | bigint;
101
- extraObjectId: string;
102
- };
103
- type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
104
- gameId: string;
105
- };
106
- type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
5
+ import { S as StandardGame, B as BuildCoinflipTransactionOptions, a as BuildWheelTransactionOptions, b as BuildLimboTransactionOptions, c as BuildPlinkoTransactionOptions, d as BuildRangeTransactionOptions, e as SuigarConfig, P as PvPCoinflipAction, f as BuildPvPCoinflipTransactionOptions, g as SuigarExtensionOptions } from './games-nFnPbPuK.cjs';
6
+ import '@mysten/sui/bcs';
107
7
 
108
8
  type WithoutConfig<T> = Omit<T, 'config'>;
109
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;
110
10
 
111
- declare function suigar<const Name = 'suigar'>({ name, }?: SuigarExtensionOptions<Name>): {
11
+ declare function suigar<const Name = 'suigar'>({ name, partner, }?: SuigarExtensionOptions<Name>): {
112
12
  name: Name;
113
13
  register: (client: ClientWithCoreApi) => SuigarClient;
114
14
  };
115
15
  declare class SuigarClient {
116
16
  #private;
117
- constructor({ client }: {
17
+ constructor({ client, partner, }: {
118
18
  client: ClientWithCoreApi;
19
+ partner?: string;
119
20
  });
120
21
  /**
121
22
  * Returns the resolved SDK configuration for the connected network.
@@ -140,9 +41,120 @@ declare class SuigarClient {
140
41
  */
141
42
  serializeTransactionToBase64(transaction: Transaction, options?: Omit<BuildTransactionOptions, 'client'>): Promise<string>;
142
43
  /**
143
- * BCS struct constructors for decoding Suigar events emitted on-chain.
44
+ * Lists unresolved PvP coinflip games from the configured registry and resolves
45
+ * each entry into parsed onchain game state.
46
+ *
47
+ * This fetches dynamic fields from the PvP coinflip registry object, then loads
48
+ * each referenced game object through `resolvePvPConflipGame()`. Registry
49
+ * membership is the unresolved-state signal: when a game is joined and resolved,
50
+ * the Move flow removes it from the registry and deletes the live `Game` object.
51
+ * Use this when a product needs the current set of open PvP coinflip matches for
52
+ * browsing or lobby views.
53
+ *
54
+ * @param options Optional dynamic field pagination forwarded to `listDynamicFields()`, excluding `parentId`.
55
+ * Pass `rejectOnError: true` to fail the whole lookup when any referenced game
56
+ * cannot be resolved. By default, failed game resolutions are skipped and only
57
+ * successfully parsed unresolved games are returned.
58
+ * @returns Parsed unresolved PvP coinflip game objects for the requested
59
+ * registry page. When `rejectOnError` is `false`, entries that fail
60
+ * `resolvePvPConflipGame()` are omitted from the returned array.
61
+ */
62
+ getPvPCoinflipGames(options?: Omit<SuiClientTypes.ListDynamicFieldsOptions, 'parentId'> & {
63
+ rejectOnError?: boolean;
64
+ }): Promise<{
65
+ coinType: string;
66
+ id: string;
67
+ creator: string;
68
+ creator_is_tails: boolean;
69
+ is_private: boolean;
70
+ creator_metadata: {
71
+ contents: {
72
+ key: string;
73
+ value: number[];
74
+ }[];
75
+ };
76
+ joiner: string;
77
+ winner: string;
78
+ stake_per_player: string;
79
+ house_edge_bps: string;
80
+ stake_pot: {
81
+ value: string;
82
+ };
83
+ }[]>;
84
+ /**
85
+ * Fetches a PvP coinflip game object from chain and parses it into the SDK's
86
+ * normalized runtime shape.
87
+ *
88
+ * This resolves the raw object through the configured client, requires the
89
+ * object's `content` to be present, decodes that content with the generated
90
+ * `PvPCoinflipGame` BCS parser, and normalizes the generic coin type into a
91
+ * standard struct tag string. Use this when a product needs the current state
92
+ * of a specific PvP coinflip match before rendering join, cancel, or result UI.
93
+ *
94
+ * @param gameId On-chain object id of the PvP coinflip game.
95
+ * @returns Parsed PvP coinflip game state with a normalized `coinType`.
96
+ * @throws Error If the object cannot be decoded because no content was returned.
97
+ */
98
+ resolvePvPConflipGame(gameId: string): Promise<{
99
+ coinType: string;
100
+ id: string;
101
+ creator: string;
102
+ creator_is_tails: boolean;
103
+ is_private: boolean;
104
+ creator_metadata: {
105
+ contents: {
106
+ key: string;
107
+ value: number[];
108
+ }[];
109
+ };
110
+ joiner: string;
111
+ winner: string;
112
+ stake_per_player: string;
113
+ house_edge_bps: string;
114
+ stake_pot: {
115
+ value: string;
116
+ };
117
+ }>;
118
+ /**
119
+ * BCS struct constructors for decoding on-chain objects and events related to Suigar games.
120
+ *
121
+ * These can be used to parse the `content` field of on-chain objects and events into structured data with the
122
+ * expected types. For example, use `client.suigar.bcs.PvPCoinflipGame.parse(object.content)` to decode a PvP
123
+ * coinflip game object.
124
+ *
125
+ * Note that these constructors are not meant for encoding transaction arguments, as the SDK's transaction
126
+ * builders handle argument serialization internally. Use these primarily for decoding and parsing on-chain data.
144
127
  */
145
128
  bcs: {
129
+ /**
130
+ * Object representing the state of a PvP coinflip game, as stored on-chain.
131
+ */
132
+ PvPCoinflipGame: MoveStruct<{
133
+ id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
134
+ creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
135
+ creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
136
+ is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
137
+ creator_metadata: MoveStruct<{
138
+ contents: _mysten_bcs.BcsType<{
139
+ key: string;
140
+ value: number[];
141
+ }[], Iterable<{
142
+ key: string;
143
+ value: Iterable<number> & {
144
+ length: number;
145
+ };
146
+ }> & {
147
+ length: number;
148
+ }, string>;
149
+ }, "0x2::vec_map::VecMap<string, vector<u8>>">;
150
+ joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
151
+ winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
152
+ stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
153
+ house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
154
+ stake_pot: MoveStruct<{
155
+ value: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
156
+ }, "0x2::balance::Balance<phantom T0>">;
157
+ }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Game<phantom T0>">;
146
158
  /**
147
159
  * Event emitted at the end of a standard game (e.g., Coinflip, Limbo), containing the result and payout information.
148
160
  */
@@ -265,4 +277,4 @@ declare class SuigarClient {
265
277
  };
266
278
  }
267
279
 
268
- export { suigar };
280
+ export { SuigarClient, suigar };
package/dist/index.d.ts CHANGED
@@ -1,121 +1,22 @@
1
- import { BcsType, BcsStruct } from '@mysten/sui/bcs';
2
- import { SuiClientTypes, ClientWithCoreApi } from '@mysten/sui/client';
1
+ import { M as MoveStruct } from './index-jwSXA8q3.js';
3
2
  import * as _mysten_bcs from '@mysten/bcs';
3
+ import { ClientWithCoreApi, SuiClientTypes } from '@mysten/sui/client';
4
4
  import { Transaction, BuildTransactionOptions } from '@mysten/sui/transactions';
5
-
6
- interface GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectOptions<Include> {
7
- client: ClientWithCoreApi;
8
- }
9
- interface GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectsOptions<Include> {
10
- client: ClientWithCoreApi;
11
- }
12
- declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
13
- get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
14
- content: true;
15
- json: true;
16
- }> & {
17
- json: BcsStruct<T>['$inferType'];
18
- }>;
19
- getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
20
- content: true;
21
- json: true;
22
- }> & {
23
- json: BcsStruct<T>['$inferType'];
24
- }>>;
25
- }
26
-
27
- type BetMetadataPrimitive = string | number | boolean | bigint;
28
- type BetMetadataValue = BetMetadataPrimitive | Uint8Array | number[];
29
- type BetMetadataInput = Record<string, BetMetadataValue | null | undefined>;
30
-
31
- declare const GAMES: readonly ["coinflip", "limbo", "plinko", "pvp-coinflip", "range", "wheel"];
32
- type Game = (typeof GAMES)[number];
33
- type StandardGame = Exclude<Game, PvPGame>;
34
- type PvPGame = 'pvp-coinflip';
35
- type CoinSide = 'heads' | 'tails';
36
-
37
- interface SuigarExtensionOptions<Name = 'suigar'> {
38
- name?: Name;
39
- }
40
- type SuigarCoin = 'sui' | 'usdc';
41
- type SuigarCoinTypes = Record<SuigarCoin, string>;
42
- type SuigarPackageKey = 'sweetHouse' | 'core' | 'coinflip' | 'limbo' | 'plinko' | 'pvpCoinflip' | 'range' | 'wheel';
43
- type SuigarPackage = Record<SuigarPackageKey, string>;
44
- type SuigarPriceInfoObjectId = Record<SuigarCoin, string>;
45
- type SuigarConfig = {
46
- packageIds: SuigarPackage;
47
- coinTypes: SuigarCoinTypes;
48
- priceInfoObjectIds: SuigarPriceInfoObjectId;
49
- };
50
-
51
- type SharedBetTransactionOptions = {
52
- config: SuigarConfig;
53
- owner: string;
54
- coinType: string;
55
- stake: number | bigint;
56
- cashStake?: number | bigint;
57
- betCount?: number | bigint;
58
- metadata?: BetMetadataInput;
59
- gasBudget?: number | bigint;
60
- sender?: string;
61
- allowGasCoinShortcut?: boolean;
62
- };
63
-
64
- type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
65
- side: CoinSide;
66
- };
67
- type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
68
- targetMultiplier: number;
69
- scale?: number;
70
- };
71
- type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
72
- configId: number;
73
- };
74
- type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
75
- leftPoint: number;
76
- rightPoint: number;
77
- outOfRange?: boolean;
78
- scale?: number;
79
- };
80
- type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
81
- configId: number;
82
- };
83
- type PvPCoinflipAction = 'create' | 'join' | 'cancel';
84
- type SharedPvPCoinflipTransactionOptions = {
85
- config: SuigarConfig;
86
- owner: string;
87
- coinType: string;
88
- metadata?: BetMetadataInput;
89
- gasBudget?: number | bigint;
90
- sender?: string;
91
- allowGasCoinShortcut?: boolean;
92
- };
93
- type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
94
- stake: number | bigint;
95
- side: CoinSide;
96
- isPrivate?: boolean;
97
- };
98
- type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
99
- gameId: string;
100
- stake: number | bigint;
101
- extraObjectId: string;
102
- };
103
- type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
104
- gameId: string;
105
- };
106
- type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
5
+ import { S as StandardGame, B as BuildCoinflipTransactionOptions, a as BuildWheelTransactionOptions, b as BuildLimboTransactionOptions, c as BuildPlinkoTransactionOptions, d as BuildRangeTransactionOptions, e as SuigarConfig, P as PvPCoinflipAction, f as BuildPvPCoinflipTransactionOptions, g as SuigarExtensionOptions } from './games-nFnPbPuK.js';
6
+ import '@mysten/sui/bcs';
107
7
 
108
8
  type WithoutConfig<T> = Omit<T, 'config'>;
109
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;
110
10
 
111
- declare function suigar<const Name = 'suigar'>({ name, }?: SuigarExtensionOptions<Name>): {
11
+ declare function suigar<const Name = 'suigar'>({ name, partner, }?: SuigarExtensionOptions<Name>): {
112
12
  name: Name;
113
13
  register: (client: ClientWithCoreApi) => SuigarClient;
114
14
  };
115
15
  declare class SuigarClient {
116
16
  #private;
117
- constructor({ client }: {
17
+ constructor({ client, partner, }: {
118
18
  client: ClientWithCoreApi;
19
+ partner?: string;
119
20
  });
120
21
  /**
121
22
  * Returns the resolved SDK configuration for the connected network.
@@ -140,9 +41,120 @@ declare class SuigarClient {
140
41
  */
141
42
  serializeTransactionToBase64(transaction: Transaction, options?: Omit<BuildTransactionOptions, 'client'>): Promise<string>;
142
43
  /**
143
- * BCS struct constructors for decoding Suigar events emitted on-chain.
44
+ * Lists unresolved PvP coinflip games from the configured registry and resolves
45
+ * each entry into parsed onchain game state.
46
+ *
47
+ * This fetches dynamic fields from the PvP coinflip registry object, then loads
48
+ * each referenced game object through `resolvePvPConflipGame()`. Registry
49
+ * membership is the unresolved-state signal: when a game is joined and resolved,
50
+ * the Move flow removes it from the registry and deletes the live `Game` object.
51
+ * Use this when a product needs the current set of open PvP coinflip matches for
52
+ * browsing or lobby views.
53
+ *
54
+ * @param options Optional dynamic field pagination forwarded to `listDynamicFields()`, excluding `parentId`.
55
+ * Pass `rejectOnError: true` to fail the whole lookup when any referenced game
56
+ * cannot be resolved. By default, failed game resolutions are skipped and only
57
+ * successfully parsed unresolved games are returned.
58
+ * @returns Parsed unresolved PvP coinflip game objects for the requested
59
+ * registry page. When `rejectOnError` is `false`, entries that fail
60
+ * `resolvePvPConflipGame()` are omitted from the returned array.
61
+ */
62
+ getPvPCoinflipGames(options?: Omit<SuiClientTypes.ListDynamicFieldsOptions, 'parentId'> & {
63
+ rejectOnError?: boolean;
64
+ }): Promise<{
65
+ coinType: string;
66
+ id: string;
67
+ creator: string;
68
+ creator_is_tails: boolean;
69
+ is_private: boolean;
70
+ creator_metadata: {
71
+ contents: {
72
+ key: string;
73
+ value: number[];
74
+ }[];
75
+ };
76
+ joiner: string;
77
+ winner: string;
78
+ stake_per_player: string;
79
+ house_edge_bps: string;
80
+ stake_pot: {
81
+ value: string;
82
+ };
83
+ }[]>;
84
+ /**
85
+ * Fetches a PvP coinflip game object from chain and parses it into the SDK's
86
+ * normalized runtime shape.
87
+ *
88
+ * This resolves the raw object through the configured client, requires the
89
+ * object's `content` to be present, decodes that content with the generated
90
+ * `PvPCoinflipGame` BCS parser, and normalizes the generic coin type into a
91
+ * standard struct tag string. Use this when a product needs the current state
92
+ * of a specific PvP coinflip match before rendering join, cancel, or result UI.
93
+ *
94
+ * @param gameId On-chain object id of the PvP coinflip game.
95
+ * @returns Parsed PvP coinflip game state with a normalized `coinType`.
96
+ * @throws Error If the object cannot be decoded because no content was returned.
97
+ */
98
+ resolvePvPConflipGame(gameId: string): Promise<{
99
+ coinType: string;
100
+ id: string;
101
+ creator: string;
102
+ creator_is_tails: boolean;
103
+ is_private: boolean;
104
+ creator_metadata: {
105
+ contents: {
106
+ key: string;
107
+ value: number[];
108
+ }[];
109
+ };
110
+ joiner: string;
111
+ winner: string;
112
+ stake_per_player: string;
113
+ house_edge_bps: string;
114
+ stake_pot: {
115
+ value: string;
116
+ };
117
+ }>;
118
+ /**
119
+ * BCS struct constructors for decoding on-chain objects and events related to Suigar games.
120
+ *
121
+ * These can be used to parse the `content` field of on-chain objects and events into structured data with the
122
+ * expected types. For example, use `client.suigar.bcs.PvPCoinflipGame.parse(object.content)` to decode a PvP
123
+ * coinflip game object.
124
+ *
125
+ * Note that these constructors are not meant for encoding transaction arguments, as the SDK's transaction
126
+ * builders handle argument serialization internally. Use these primarily for decoding and parsing on-chain data.
144
127
  */
145
128
  bcs: {
129
+ /**
130
+ * Object representing the state of a PvP coinflip game, as stored on-chain.
131
+ */
132
+ PvPCoinflipGame: MoveStruct<{
133
+ id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
134
+ creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
135
+ creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
136
+ is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
137
+ creator_metadata: MoveStruct<{
138
+ contents: _mysten_bcs.BcsType<{
139
+ key: string;
140
+ value: number[];
141
+ }[], Iterable<{
142
+ key: string;
143
+ value: Iterable<number> & {
144
+ length: number;
145
+ };
146
+ }> & {
147
+ length: number;
148
+ }, string>;
149
+ }, "0x2::vec_map::VecMap<string, vector<u8>>">;
150
+ joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
151
+ winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
152
+ stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
153
+ house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
154
+ stake_pot: MoveStruct<{
155
+ value: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
156
+ }, "0x2::balance::Balance<phantom T0>">;
157
+ }, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Game<phantom T0>">;
146
158
  /**
147
159
  * Event emitted at the end of a standard game (e.g., Coinflip, Limbo), containing the result and payout information.
148
160
  */
@@ -265,4 +277,4 @@ declare class SuigarClient {
265
277
  };
266
278
  }
267
279
 
268
- export { suigar };
280
+ export { SuigarClient, suigar };