@suigar/sdk 2.0.0-beta.0 → 2.0.0-beta.10
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 +113 -0
- package/README.md +375 -204
- package/dist/chunk-PPUDLRHA.js +331 -0
- package/dist/games-BccpPyWd.d.cts +86 -0
- package/dist/games-BccpPyWd.d.ts +86 -0
- package/dist/games.cjs +2 -0
- package/dist/games.d.cts +2 -0
- package/dist/games.d.ts +2 -0
- package/dist/games.js +1 -0
- package/dist/index-3P_LBbDM.d.cts +25 -0
- package/dist/index-3P_LBbDM.d.ts +25 -0
- package/dist/index.cjs +657 -369
- package/dist/index.d.cts +193 -227
- package/dist/index.d.ts +193 -227
- package/dist/index.js +544 -466
- package/dist/utils.cjs +230 -0
- package/dist/utils.d.cts +148 -0
- package/dist/utils.d.ts +148 -0
- package/dist/utils.js +1 -0
- package/package.json +81 -79
package/dist/index.d.ts
CHANGED
|
@@ -1,258 +1,224 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
1
|
+
import { M as MoveStruct } from './index-3P_LBbDM.js';
|
|
2
|
+
import * as _mysten_bcs from '@mysten/bcs';
|
|
3
|
+
import { ClientWithCoreApi, SuiClientTypes } 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, e as SuigarConfig, W as WithThrowOnError, P as PvPCoinflipAction, f as BuildPvPCoinflipTransactionOptions, g as SuigarExtensionOptions } from './games-BccpPyWd.js';
|
|
6
|
+
import '@mysten/sui/bcs';
|
|
4
7
|
|
|
5
|
-
type
|
|
6
|
-
type
|
|
7
|
-
type BetMetadataInput = Record<string, BetMetadataValue | null | undefined>;
|
|
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;
|
|
8
10
|
|
|
9
|
-
declare const
|
|
10
|
-
type Game = (typeof GAMES)[number];
|
|
11
|
-
type StandardGame = Exclude<Game, PvPGame>;
|
|
12
|
-
type PvPGame = 'pvp-coinflip';
|
|
13
|
-
type CoinSide = 'heads' | 'tails';
|
|
14
|
-
|
|
15
|
-
type DeepPartial<T> = T extends object ? {
|
|
16
|
-
[P in keyof T]?: DeepPartial<T[P]>;
|
|
17
|
-
} : T;
|
|
18
|
-
|
|
19
|
-
interface SuigarOptions<Name = 'suigar'> extends DeepPartial<SuigarConfig> {
|
|
20
|
-
name?: Name;
|
|
21
|
-
}
|
|
22
|
-
type SuigarConfig = {
|
|
23
|
-
sweetHousePackageId: string;
|
|
24
|
-
coinTypes: {
|
|
25
|
-
sui: string;
|
|
26
|
-
usdc: string;
|
|
27
|
-
usdcFlowx: string;
|
|
28
|
-
};
|
|
29
|
-
gamesPackageId: Record<Game, string>;
|
|
30
|
-
pyth: SuigarPythConfig;
|
|
31
|
-
};
|
|
32
|
-
type SuigarPythConfig = {
|
|
33
|
-
packageId?: string;
|
|
34
|
-
priceInfoObjectIds: Record<string, string>;
|
|
35
|
-
suiPriceInfoObjectId: string;
|
|
36
|
-
usdcPriceInfoObjectId: string;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
type SharedBetTransactionOptions = {
|
|
40
|
-
config: SuigarConfig;
|
|
41
|
-
owner: string;
|
|
42
|
-
coinType: string;
|
|
43
|
-
stake: number | bigint;
|
|
44
|
-
cashStake?: number | bigint;
|
|
45
|
-
betCount?: number | bigint;
|
|
46
|
-
metadata?: BetMetadataInput;
|
|
47
|
-
gasBudget?: number | bigint;
|
|
48
|
-
sender?: string;
|
|
49
|
-
allowGasCoinShortcut?: boolean;
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
type BuildCoinflipTransactionOptions = SharedBetTransactionOptions & {
|
|
53
|
-
side: CoinSide;
|
|
54
|
-
};
|
|
55
|
-
type BuildLimboTransactionOptions = SharedBetTransactionOptions & {
|
|
56
|
-
targetMultiplier: number;
|
|
57
|
-
scale?: number;
|
|
58
|
-
};
|
|
59
|
-
type BuildPlinkoTransactionOptions = SharedBetTransactionOptions & {
|
|
60
|
-
configId: number;
|
|
61
|
-
};
|
|
62
|
-
type BuildRangeTransactionOptions = SharedBetTransactionOptions & {
|
|
63
|
-
leftPoint: number;
|
|
64
|
-
rightPoint: number;
|
|
65
|
-
outOfRange?: boolean;
|
|
66
|
-
scale?: number;
|
|
67
|
-
};
|
|
68
|
-
type BuildWheelTransactionOptions = SharedBetTransactionOptions & {
|
|
69
|
-
configId: number;
|
|
70
|
-
};
|
|
71
|
-
type PvPCoinflipAction = 'create' | 'join' | 'cancel';
|
|
72
|
-
type SharedPvPCoinflipTransactionOptions = {
|
|
73
|
-
config: SuigarConfig;
|
|
74
|
-
owner: string;
|
|
75
|
-
coinType: string;
|
|
76
|
-
metadata?: BetMetadataInput;
|
|
77
|
-
gasBudget?: number | bigint;
|
|
78
|
-
sender?: string;
|
|
79
|
-
allowGasCoinShortcut?: boolean;
|
|
80
|
-
};
|
|
81
|
-
type BuildCreatePvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
82
|
-
stake: number | bigint;
|
|
83
|
-
side: CoinSide;
|
|
84
|
-
isPrivate?: boolean;
|
|
85
|
-
};
|
|
86
|
-
type BuildJoinPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
87
|
-
gameId: string;
|
|
88
|
-
stake: number | bigint;
|
|
89
|
-
extraObjectId: string;
|
|
90
|
-
};
|
|
91
|
-
type BuildCancelPvPCoinflipTransactionOptions = SharedPvPCoinflipTransactionOptions & {
|
|
92
|
-
gameId: string;
|
|
93
|
-
};
|
|
94
|
-
type BuildPvPCoinflipTransactionOptions<Action extends PvPCoinflipAction = PvPCoinflipAction> = Action extends 'create' ? BuildCreatePvPCoinflipTransactionOptions : Action extends 'join' ? BuildJoinPvPCoinflipTransactionOptions : Action extends 'cancel' ? BuildCancelPvPCoinflipTransactionOptions : never;
|
|
95
|
-
|
|
96
|
-
type BuildGameOptions<GameId extends StandardGame> = GameId extends 'coinflip' ? BuildCoinflipTransactionOptions : GameId extends 'wheel' ? BuildWheelTransactionOptions : GameId extends 'limbo' ? BuildLimboTransactionOptions : GameId extends 'plinko' ? BuildPlinkoTransactionOptions : GameId extends 'range' ? BuildRangeTransactionOptions : never;
|
|
97
|
-
|
|
98
|
-
interface GetOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectOptions<Include> {
|
|
99
|
-
client: ClientWithCoreApi;
|
|
100
|
-
}
|
|
101
|
-
interface GetManyOptions<Include extends Omit<SuiClientTypes.ObjectInclude, 'content'> = {}> extends SuiClientTypes.GetObjectsOptions<Include> {
|
|
102
|
-
client: ClientWithCoreApi;
|
|
103
|
-
}
|
|
104
|
-
declare class MoveStruct<T extends Record<string, BcsType<any>>, const Name extends string = string> extends BcsStruct<T, Name> {
|
|
105
|
-
get<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ objectId, ...options }: GetOptions<Include>): Promise<SuiClientTypes.Object<Include & {
|
|
106
|
-
content: true;
|
|
107
|
-
json: true;
|
|
108
|
-
}> & {
|
|
109
|
-
json: BcsStruct<T>['$inferType'];
|
|
110
|
-
}>;
|
|
111
|
-
getMany<Include extends Omit<SuiClientTypes.ObjectInclude, 'content' | 'json'> = {}>({ client, ...options }: GetManyOptions<Include>): Promise<Array<SuiClientTypes.Object<Include & {
|
|
112
|
-
content: true;
|
|
113
|
-
json: true;
|
|
114
|
-
}> & {
|
|
115
|
-
json: BcsStruct<T>['$inferType'];
|
|
116
|
-
}>>;
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**************************************************************
|
|
120
|
-
* THIS FILE IS GENERATED AND SHOULD NOT BE MANUALLY MODIFIED *
|
|
121
|
-
**************************************************************/
|
|
122
|
-
|
|
123
|
-
declare function BetResultEvent<T0 extends BcsType<any>>(...typeParameters: [
|
|
124
|
-
T0
|
|
125
|
-
]): MoveStruct<{
|
|
126
|
-
player: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
127
|
-
coin_type: MoveStruct<{
|
|
128
|
-
name: BcsType<string, string, "string">;
|
|
129
|
-
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
130
|
-
stake_amount: BcsType<string, string | number | bigint, "u64">;
|
|
131
|
-
unsafe_oracle_usd_coin_price: MoveStruct<{
|
|
132
|
-
is_negative: BcsType<boolean, boolean, "bool">;
|
|
133
|
-
exp: MoveStruct<{
|
|
134
|
-
bits: BcsType<string, string | number | bigint, "u64">;
|
|
135
|
-
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
136
|
-
mant: BcsType<string, string | number | bigint, "u64">;
|
|
137
|
-
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
138
|
-
adjusted_oracle_usd_coin_price: MoveStruct<{
|
|
139
|
-
is_negative: BcsType<boolean, boolean, "bool">;
|
|
140
|
-
exp: MoveStruct<{
|
|
141
|
-
bits: BcsType<string, string | number | bigint, "u64">;
|
|
142
|
-
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
143
|
-
mant: BcsType<string, string | number | bigint, "u64">;
|
|
144
|
-
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
145
|
-
outcome_amount: BcsType<string, string | number | bigint, "u64">;
|
|
146
|
-
game_details: MoveStruct<{
|
|
147
|
-
contents: BcsType<{
|
|
148
|
-
key: string;
|
|
149
|
-
value: number[];
|
|
150
|
-
}[], Iterable<{
|
|
151
|
-
key: string;
|
|
152
|
-
value: Iterable<number> & {
|
|
153
|
-
length: number;
|
|
154
|
-
};
|
|
155
|
-
}> & {
|
|
156
|
-
length: number;
|
|
157
|
-
}, string>;
|
|
158
|
-
}, "0x2::vec_map::VecMap<string, vector<u8>>">;
|
|
159
|
-
metadata: MoveStruct<{
|
|
160
|
-
contents: BcsType<{
|
|
161
|
-
key: string;
|
|
162
|
-
value: number[];
|
|
163
|
-
}[], Iterable<{
|
|
164
|
-
key: string;
|
|
165
|
-
value: Iterable<number> & {
|
|
166
|
-
length: number;
|
|
167
|
-
};
|
|
168
|
-
}> & {
|
|
169
|
-
length: number;
|
|
170
|
-
}, string>;
|
|
171
|
-
}, "0x2::vec_map::VecMap<string, vector<u8>>">;
|
|
172
|
-
}, `0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::core::BetResultEvent<${T0["name"]}>`>;
|
|
173
|
-
|
|
174
|
-
declare function GameCreatedEvent<T0 extends BcsType<any>>(...typeParameters: [
|
|
175
|
-
T0
|
|
176
|
-
]): MoveStruct<{
|
|
177
|
-
game_id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
178
|
-
creator: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
179
|
-
creator_is_tails: BcsType<boolean, boolean, "bool">;
|
|
180
|
-
is_private: BcsType<boolean, boolean, "bool">;
|
|
181
|
-
joiner_is_tails: BcsType<boolean, boolean, "bool">;
|
|
182
|
-
stake_per_player: BcsType<string, string | number | bigint, "u64">;
|
|
183
|
-
house_edge_bps: BcsType<string, string | number | bigint, "u64">;
|
|
184
|
-
coin_type: MoveStruct<{
|
|
185
|
-
name: BcsType<string, string, "string">;
|
|
186
|
-
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
187
|
-
}, `0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCreatedEvent<${T0["name"]}>`>;
|
|
188
|
-
declare function GameResolvedEvent<T0 extends BcsType<any>>(...typeParameters: [
|
|
189
|
-
T0
|
|
190
|
-
]): MoveStruct<{
|
|
191
|
-
game_id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
192
|
-
creator: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
193
|
-
joiner: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
194
|
-
winner: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
195
|
-
creator_is_tails: BcsType<boolean, boolean, "bool">;
|
|
196
|
-
is_private: BcsType<boolean, boolean, "bool">;
|
|
197
|
-
joiner_is_tails: BcsType<boolean, boolean, "bool">;
|
|
198
|
-
stake_per_player: BcsType<string, string | number | bigint, "u64">;
|
|
199
|
-
total_pot: BcsType<string, string | number | bigint, "u64">;
|
|
200
|
-
house_edge_amount: BcsType<string, string | number | bigint, "u64">;
|
|
201
|
-
payout_amount: BcsType<string, string | number | bigint, "u64">;
|
|
202
|
-
coin_type: MoveStruct<{
|
|
203
|
-
name: BcsType<string, string, "string">;
|
|
204
|
-
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
205
|
-
}, `0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameResolvedEvent<${T0["name"]}>`>;
|
|
206
|
-
declare function GameCancelledEvent<T0 extends BcsType<any>>(...typeParameters: [
|
|
207
|
-
T0
|
|
208
|
-
]): MoveStruct<{
|
|
209
|
-
game_id: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
210
|
-
creator: BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
211
|
-
creator_is_tails: BcsType<boolean, boolean, "bool">;
|
|
212
|
-
is_private: BcsType<boolean, boolean, "bool">;
|
|
213
|
-
stake_per_player: BcsType<string, string | number | bigint, "u64">;
|
|
214
|
-
coin_type: MoveStruct<{
|
|
215
|
-
name: BcsType<string, string, "string">;
|
|
216
|
-
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
217
|
-
}, `0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCancelledEvent<${T0["name"]}>`>;
|
|
218
|
-
|
|
219
|
-
declare function suigar<const Name = 'suigar'>({ name, ...options }?: SuigarOptions<Name>): {
|
|
11
|
+
declare function suigar<const Name = 'suigar'>({ name, partner, }?: SuigarExtensionOptions<Name>): {
|
|
220
12
|
name: Name;
|
|
221
13
|
register: (client: ClientWithCoreApi) => SuigarClient;
|
|
222
14
|
};
|
|
223
15
|
declare class SuigarClient {
|
|
224
16
|
#private;
|
|
225
|
-
constructor({ client,
|
|
17
|
+
constructor({ client, partner, }: {
|
|
226
18
|
client: ClientWithCoreApi;
|
|
227
|
-
|
|
19
|
+
partner?: string;
|
|
228
20
|
});
|
|
229
21
|
/**
|
|
230
|
-
*
|
|
22
|
+
* Returns the resolved SDK configuration for the connected network.
|
|
23
|
+
*
|
|
24
|
+
* This is primarily useful for debugging or inspecting which package ids,
|
|
25
|
+
* supported coin types, and price info object ids the SDK resolved for the
|
|
26
|
+
* current client network.
|
|
27
|
+
*
|
|
28
|
+
* @returns Network-resolved Suigar configuration.
|
|
29
|
+
*/
|
|
30
|
+
getConfig(): SuigarConfig;
|
|
31
|
+
/**
|
|
32
|
+
* Builds a transaction with the configured Sui client and encodes the resulting BCS bytes as base64.
|
|
33
|
+
*
|
|
34
|
+
* Use this when an external wallet, API, or transport expects the built transaction payload as a base64 string
|
|
35
|
+
* instead of raw bytes. The SDK always injects the configured Sui client, so `options` accepts the standard
|
|
36
|
+
* transaction build options except for `client`.
|
|
231
37
|
*
|
|
232
|
-
* @param transaction Transaction
|
|
38
|
+
* @param transaction Transaction to build and serialize.
|
|
39
|
+
* @param options Optional transaction build options forwarded to `transaction.build()`, excluding `client`.
|
|
233
40
|
* @returns Base64-encoded transaction bytes ready to send over the wire.
|
|
234
41
|
*/
|
|
235
|
-
serializeTransactionToBase64(transaction: Transaction): Promise<string>;
|
|
42
|
+
serializeTransactionToBase64(transaction: Transaction, options?: Omit<BuildTransactionOptions, 'client'>): Promise<string>;
|
|
43
|
+
/**
|
|
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 bulk
|
|
48
|
+
* loads the referenced game objects through `client.core.getObjects()`. 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
|
+
* Supported options such as `limit`, `cursor`, and `signal` are forwarded to the
|
|
56
|
+
* underlying lookup calls. Pass `throwOnError: true` to fail the whole lookup
|
|
57
|
+
* when any referenced game object cannot be fetched or parsed. By default,
|
|
58
|
+
* failed per-object lookups are skipped and only successfully parsed unresolved
|
|
59
|
+
* games are returned.
|
|
60
|
+
* @returns Parsed unresolved PvP coinflip game objects for the requested
|
|
61
|
+
* registry page. When `throwOnError` is `false`, entries that fail object fetch
|
|
62
|
+
* or parse are omitted from the returned array.
|
|
63
|
+
*/
|
|
64
|
+
getPvPCoinflipGames(options?: WithThrowOnError<Omit<SuiClientTypes.ListDynamicFieldsOptions, 'parentId'>>): 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
|
+
}[]>;
|
|
236
84
|
/**
|
|
237
|
-
* BCS struct constructors for decoding
|
|
85
|
+
* BCS struct constructors for decoding on-chain objects and events related to Suigar games.
|
|
86
|
+
*
|
|
87
|
+
* These can be used to parse the `content` field of on-chain objects and events into structured data with the
|
|
88
|
+
* expected types. For example, use `client.suigar.bcs.PvPCoinflipGame.parse(object.content)` to decode a PvP
|
|
89
|
+
* coinflip game object.
|
|
90
|
+
*
|
|
91
|
+
* Note that these constructors are not meant for encoding transaction arguments, as the SDK's transaction
|
|
92
|
+
* builders handle argument serialization internally. Use these primarily for decoding and parsing on-chain data.
|
|
238
93
|
*/
|
|
239
94
|
bcs: {
|
|
95
|
+
/**
|
|
96
|
+
* Object representing the state of a PvP coinflip game, as stored on-chain.
|
|
97
|
+
*/
|
|
98
|
+
PvPCoinflipGame: MoveStruct<{
|
|
99
|
+
id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
100
|
+
creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
101
|
+
creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
102
|
+
is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
103
|
+
creator_metadata: MoveStruct<{
|
|
104
|
+
contents: _mysten_bcs.BcsType<{
|
|
105
|
+
key: string;
|
|
106
|
+
value: number[];
|
|
107
|
+
}[], Iterable<{
|
|
108
|
+
key: string;
|
|
109
|
+
value: Iterable<number> & {
|
|
110
|
+
length: number;
|
|
111
|
+
};
|
|
112
|
+
}> & {
|
|
113
|
+
length: number;
|
|
114
|
+
}, string>;
|
|
115
|
+
}, "0x2::vec_map::VecMap<string, vector<u8>>">;
|
|
116
|
+
joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
117
|
+
winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
118
|
+
stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
119
|
+
house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
120
|
+
stake_pot: MoveStruct<{
|
|
121
|
+
value: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
122
|
+
}, "0x2::balance::Balance<phantom T0>">;
|
|
123
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::Game<phantom T0>">;
|
|
240
124
|
/**
|
|
241
125
|
* Event emitted at the end of a standard game (e.g., Coinflip, Limbo), containing the result and payout information.
|
|
242
126
|
*/
|
|
243
|
-
BetResultEvent:
|
|
127
|
+
BetResultEvent: MoveStruct<{
|
|
128
|
+
player: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
129
|
+
coin_type: MoveStruct<{
|
|
130
|
+
name: _mysten_bcs.BcsType<string, string, "string">;
|
|
131
|
+
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
132
|
+
stake_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
133
|
+
unsafe_oracle_usd_coin_price: MoveStruct<{
|
|
134
|
+
is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
135
|
+
exp: MoveStruct<{
|
|
136
|
+
bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
137
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
138
|
+
mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
139
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
140
|
+
adjusted_oracle_usd_coin_price: MoveStruct<{
|
|
141
|
+
is_negative: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
142
|
+
exp: MoveStruct<{
|
|
143
|
+
bits: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
144
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::i64::I64">;
|
|
145
|
+
mant: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
146
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::float::Float">;
|
|
147
|
+
outcome_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
148
|
+
game_details: MoveStruct<{
|
|
149
|
+
contents: _mysten_bcs.BcsType<{
|
|
150
|
+
key: string;
|
|
151
|
+
value: number[];
|
|
152
|
+
}[], Iterable<{
|
|
153
|
+
key: string;
|
|
154
|
+
value: Iterable<number> & {
|
|
155
|
+
length: number;
|
|
156
|
+
};
|
|
157
|
+
}> & {
|
|
158
|
+
length: number;
|
|
159
|
+
}, string>;
|
|
160
|
+
}, "0x2::vec_map::VecMap<string, vector<u8>>">;
|
|
161
|
+
metadata: MoveStruct<{
|
|
162
|
+
contents: _mysten_bcs.BcsType<{
|
|
163
|
+
key: string;
|
|
164
|
+
value: number[];
|
|
165
|
+
}[], Iterable<{
|
|
166
|
+
key: string;
|
|
167
|
+
value: Iterable<number> & {
|
|
168
|
+
length: number;
|
|
169
|
+
};
|
|
170
|
+
}> & {
|
|
171
|
+
length: number;
|
|
172
|
+
}, string>;
|
|
173
|
+
}, "0x2::vec_map::VecMap<string, vector<u8>>">;
|
|
174
|
+
}, "0xf391858d2a08473e8d4defcc8df89976bd7b123d3865c6b9341b237f7853dbbc::core::BetResultEvent<phantom T0>">;
|
|
244
175
|
/**
|
|
245
176
|
* Event emitted when a PvP Coinflip game is created, containing the game configuration and initial state.
|
|
246
177
|
*/
|
|
247
|
-
|
|
178
|
+
PvPCoinflipGameCreatedEvent: MoveStruct<{
|
|
179
|
+
game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
180
|
+
creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
181
|
+
creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
182
|
+
is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
183
|
+
joiner_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
184
|
+
stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
185
|
+
house_edge_bps: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
186
|
+
coin_type: MoveStruct<{
|
|
187
|
+
name: _mysten_bcs.BcsType<string, string, "string">;
|
|
188
|
+
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
189
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCreatedEvent<phantom T0>">;
|
|
248
190
|
/**
|
|
249
191
|
* Event emitted when a PvP Coinflip game is resolved, containing the final outcome.
|
|
250
192
|
*/
|
|
251
|
-
|
|
193
|
+
PvPCoinflipGameResolvedEvent: MoveStruct<{
|
|
194
|
+
game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
195
|
+
creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
196
|
+
joiner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
197
|
+
winner: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
198
|
+
creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
199
|
+
is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
200
|
+
joiner_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
201
|
+
stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
202
|
+
total_pot: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
203
|
+
house_edge_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
204
|
+
payout_amount: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
205
|
+
coin_type: MoveStruct<{
|
|
206
|
+
name: _mysten_bcs.BcsType<string, string, "string">;
|
|
207
|
+
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
208
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameResolvedEvent<phantom T0>">;
|
|
252
209
|
/**
|
|
253
210
|
* Event emitted when a PvP Coinflip game is cancelled.
|
|
254
211
|
*/
|
|
255
|
-
|
|
212
|
+
PvPCoinflipGameCancelledEvent: MoveStruct<{
|
|
213
|
+
game_id: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
214
|
+
creator: _mysten_bcs.BcsType<string, string | Uint8Array<ArrayBufferLike>, "bytes[32]">;
|
|
215
|
+
creator_is_tails: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
216
|
+
is_private: _mysten_bcs.BcsType<boolean, boolean, "bool">;
|
|
217
|
+
stake_per_player: _mysten_bcs.BcsType<string, string | number | bigint, "u64">;
|
|
218
|
+
coin_type: MoveStruct<{
|
|
219
|
+
name: _mysten_bcs.BcsType<string, string, "string">;
|
|
220
|
+
}, "0x0000000000000000000000000000000000000000000000000000000000000001::type_name::TypeName">;
|
|
221
|
+
}, "0xb43cf6583c0c15315c7e66f173af4be79ac40c38aad1fd92ec08638ab2026202::pvp_coinflip::GameCancelledEvent<phantom T0>">;
|
|
256
222
|
};
|
|
257
223
|
/**
|
|
258
224
|
* Transaction builders for Suigar games.
|