@suigar/sdk 2.0.0-beta.2 → 2.0.0-beta.20
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 +165 -1
- package/README.md +300 -59
- package/dist/client.d.mts +257 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +278 -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 +54 -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 +13 -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 +33 -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 +68 -0
- package/dist/contracts/utils/index.d.mts.map +1 -0
- package/dist/contracts/utils/index.mjs +185 -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 +72 -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 +200 -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 +80 -82
- package/dist/index.cjs +0 -1016
- package/dist/index.d.cts +0 -267
- package/dist/index.d.ts +0 -267
- package/dist/index.js +0 -1014
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,174 @@
|
|
|
1
1
|
# @suigar/sdk
|
|
2
2
|
|
|
3
|
+
## 2.0.0-beta.20
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 84feb08: Refresh SDK dependency metadata for the latest Mysten package set and normalize the published Node engine range.
|
|
8
|
+
- bed0775: Update the SDK to the latest Mysten package set, NodeNext TypeScript module resolution, and explicit ESM source imports. Regenerated contract wrappers now expose helpers for building and resolving Move type tags from generated BCS types.
|
|
9
|
+
|
|
10
|
+
## 2.0.0-beta.19
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 10f49e2: Bump the SDK's `@mysten/sui` dependency to the latest shared workspace minor
|
|
15
|
+
release and align the package metadata and lockfile with that update.
|
|
16
|
+
|
|
17
|
+
## 2.0.0-beta.18
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- de9e425: Update SDK dependency metadata to use the shared Mysten and TypeScript pnpm catalogs, including the `@mysten/sui` and `tsx` dependency updates.
|
|
22
|
+
|
|
23
|
+
## 2.0.0-beta.17
|
|
24
|
+
|
|
25
|
+
### Major Changes
|
|
26
|
+
|
|
27
|
+
- bd8499e: Rename transaction builder option `playerAddress` to `owner` across standard and PvP transaction APIs.
|
|
28
|
+
|
|
29
|
+
## 2.0.0-beta.16
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- 4463bbf: Update `@mysten/*` dependencies to latest patch versions
|
|
34
|
+
|
|
35
|
+
## 2.0.0-beta.15
|
|
36
|
+
|
|
37
|
+
### Patch Changes
|
|
38
|
+
|
|
39
|
+
- 67a8b5b: Add `parseGameEvent` to `@suigar/sdk/utils` for extracting a normalized Suigar game id plus raw Move event name for supported Suigar events in `GAME_EVENTS`, including standard `BetResultEvent` and PvP coinflip events.
|
|
40
|
+
|
|
41
|
+
Change `parseGameDetails` to accept `gameId` first so TypeScript can narrow the returned detail keys and value types per game.
|
|
42
|
+
|
|
43
|
+
## 2.0.0-beta.14
|
|
44
|
+
|
|
45
|
+
### Patch Changes
|
|
46
|
+
|
|
47
|
+
- f846d27: Rename exported SDK config types to distinguish key unions from ID maps more clearly.
|
|
48
|
+
- Rename `SuigarPackageKey` to `SuigarPackage`.
|
|
49
|
+
- Rename the old `SuigarPackage` record type to `SuigarPackageIds`.
|
|
50
|
+
- Rename `SuigarRegistryKey` to `SuigarRegistry`.
|
|
51
|
+
- Rename the old `SuigarRegistry` record type to `SuigarRegistryIds`.
|
|
52
|
+
- Rename `SuigarPriceInfoObjectId` to `SuigarPriceInfoObjectIds`.
|
|
53
|
+
|
|
54
|
+
## 2.0.0-beta.13
|
|
55
|
+
|
|
56
|
+
### Patch Changes
|
|
57
|
+
|
|
58
|
+
- 667d7c4: Normalize repository wording to use `on-chain` consistently.
|
|
59
|
+
|
|
60
|
+
## 2.0.0-beta.12
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- 85ae057: Refine public validation failures to use `RangeError` and `TypeError` instead
|
|
65
|
+
of generic `Error` for unsupported networks, unsupported game or PvP action
|
|
66
|
+
inputs, unsupported configured coin types, bounded integer helpers, and
|
|
67
|
+
`parseCoinType()` parsing failures.
|
|
68
|
+
|
|
69
|
+
## 2.0.0-beta.11
|
|
70
|
+
|
|
71
|
+
### Patch Changes
|
|
72
|
+
|
|
73
|
+
- c7685d2: Add `client.suigar.getGameParameters(game, options?)` for reading live on-chain game parameter objects, such as min/max stake and game-specific config bounds, directly from SweetHouse settings.
|
|
74
|
+
|
|
75
|
+
The lookup first reads the selected game's settings object from SweetHouse, then reads that game's coin-specific `Parameters<T>` object, parses it with the correct return type for the requested game, and caches the result for SDK integrations that need to display or validate current game limits without repeatedly querying the same on-chain objects.
|
|
76
|
+
|
|
77
|
+
This update also broadens the public numeric helpers in `@suigar/sdk/utils`: `toBigInt()` accepts booleans and non-negative integer strings in addition to numbers and `bigint`, `toU8()` accepts plain integer strings such as `'1'` for parsed config ids and other `u8` values, and `toU16()` provides the same validation pattern for `u16` values.
|
|
78
|
+
|
|
79
|
+
## 2.0.0-beta.10
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- 4b59c7b: Remove the `client.suigar.resolvePvPCoinflipGame()` client method. Use the exported generated helper `client.suigar.bcs.PvPCoinflipGame.get({ client, objectId })` for one specific live PvP coinflip game object instead.
|
|
84
|
+
|
|
85
|
+
Add `parseCoinType` to `@suigar/sdk/utils` for extracting normalized coin types from generic Move object type strings.
|
|
86
|
+
|
|
87
|
+
- 4b59c7b: Move the SDK into the `packages/sdk` pnpm workspace while keeping the public package API unchanged.
|
|
88
|
+
|
|
89
|
+
## 2.0.0-beta.9
|
|
90
|
+
|
|
91
|
+
### Patch Changes
|
|
92
|
+
|
|
93
|
+
- eaf8b3a: Fix metadata encoding so partner metadata is only added when configured and hex metadata values are encoded consistently as bytes. Improve supported-coin and price-info resolution error handling for transaction configuration.
|
|
94
|
+
- 9929e05: Refine Move parser helpers by simplifying BCS type usage, normalizing missing
|
|
95
|
+
`i64` and float mantissa values to `0`, and documenting the numeric conversion
|
|
96
|
+
behavior in `fromMoveI64` and `fromMoveFloat`.
|
|
97
|
+
|
|
98
|
+
## 2.0.0-beta.8
|
|
99
|
+
|
|
100
|
+
### Patch Changes
|
|
101
|
+
|
|
102
|
+
- 0292edb: Rename transaction builder option `owner` to `playerAddress` and remove the separate `sender` option so all game transactions use a single explicit player address.
|
|
103
|
+
- 20311be: Improve the public JSDoc for `parseGameDetails`, `toBigInt`, and `toU8` so the
|
|
104
|
+
generated API surface explains their coercion, validation, and decoding
|
|
105
|
+
behavior more clearly.
|
|
106
|
+
- a2aa324: Update PvP coinflip lookup helpers to use bulk object reads for unresolved lobby discovery and support forwarded lookup options.
|
|
107
|
+
- Make `getPvPCoinflipGames()` parse bulk `client.core.getObjects()` results instead of resolving each game individually.
|
|
108
|
+
- Skip per-object fetch or parse failures by default and continue supporting strict rejection with `throwOnError: true`.
|
|
109
|
+
- Forward supported lookup options such as `signal` through `getPvPCoinflipGames()` and `resolvePvPCoinflipGame(gameId, options?)`.
|
|
110
|
+
- Update tests, README guidance, and repo-local PvP skill documentation to match the current client behavior.
|
|
111
|
+
|
|
112
|
+
## 2.0.0-beta.7
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- f0ea104: Align numeric utility names, Move decoding helpers, and PvP BCS event helper references with the current SDK API.
|
|
117
|
+
|
|
118
|
+
## 2.0.0-beta.6
|
|
119
|
+
|
|
120
|
+
### Patch Changes
|
|
121
|
+
|
|
122
|
+
- ef6bcd4: Rename getPvPCoinflipGames option from rejectOnError to throwOnError.
|
|
123
|
+
|
|
124
|
+
## 2.0.0-beta.5
|
|
125
|
+
|
|
126
|
+
### Patch Changes
|
|
127
|
+
|
|
128
|
+
- bf98e0a: Update PvP coinflip registry lookups so `getPvPCoinflipGames()` can skip
|
|
129
|
+
individual game resolution failures by default while still supporting
|
|
130
|
+
`rejectOnError: true` for strict rejection.
|
|
131
|
+
- Document the `rejectOnError` behavior in the public JSDoc and README examples.
|
|
132
|
+
- Clarify repo guidance and skill documentation to distinguish general PvP game
|
|
133
|
+
guidance from the current PvP coinflip-specific runtime surface.
|
|
134
|
+
|
|
135
|
+
## 2.0.0-beta.4
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- 6daa819: Add BCS parser helpers and a Next.js playground example app.
|
|
140
|
+
- expose parser helpers through `@suigar/sdk/utils`
|
|
141
|
+
- add `parseGameDetails` for decoding `BetResultEvent.game_details`
|
|
142
|
+
- document generated BCS event decoding and game detail parsing guidance
|
|
143
|
+
- add a testnet-only app for standard and PvP Suigar transactions
|
|
144
|
+
- integrate Mysten dApp Kit wallet connection, signing, and execution
|
|
145
|
+
- add live transaction code previews and shared decoded event logging with SDK parser helpers
|
|
146
|
+
- add Suigar-themed responsive UI, supported coin selection, and human-readable stake handling
|
|
147
|
+
- update PvP coinflip join so callers only provide `gameId` and the SDK derives the join stake while using the configured price info object id
|
|
148
|
+
|
|
149
|
+
- b89d0b4: Add a public `@suigar/sdk/games` export subpath for shared game option types, and export `SuigarClient` from the package root.
|
|
150
|
+
- bf1f71b: Add `registryIds` to `SuigarConfig` and resolve them from the network config registry map.
|
|
151
|
+
|
|
152
|
+
Document the PvP coinflip runtime helpers more clearly by describing
|
|
153
|
+
registry-backed unresolved game discovery through `getPvPCoinflipGames()` and
|
|
154
|
+
the normalized live-game lookup behavior of `resolvePvPCoinflipGame()`.
|
|
155
|
+
|
|
156
|
+
- 4861f55: Add public utility exports for shared scaling constants in `@suigar/sdk/utils`, including `RANGE_POINT_LIMIT` and `DEFAULT_RANGE_SCALE`. Update the SDK example app and documentation to use the exported constants and document limbo/range scaling behavior more clearly.
|
|
157
|
+
|
|
158
|
+
## 2.0.0-beta.3
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- e1cdedc: Improve public transaction builder typings and refresh Sui 2.0+ integration guidance around the gRPC client.
|
|
163
|
+
- Fix exported transaction option types so `BuildGameOptions` and `BuildPvPGameOptions` no longer require the internal `config` field
|
|
164
|
+
- Update installation and integration documentation for Sui 2.0+ by switching examples to `SuiGrpcClient`, clarifying required peer dependencies, and aligning transaction-result examples with the current client API.
|
|
165
|
+
|
|
3
166
|
## 2.0.0-beta.2
|
|
4
167
|
|
|
5
168
|
### Patch Changes
|
|
6
169
|
|
|
7
|
-
- 128cb6c: -
|
|
170
|
+
- 128cb6c: Make SDK configuration network-resolved and expose runtime config inspection through the client extension.
|
|
171
|
+
- `suigar()` now only accepts the extension `name`.
|
|
8
172
|
- The SDK now validates the connected client network and supports `mainnet` and `testnet`.
|
|
9
173
|
- Added `client.suigar.getConfig()` to inspect the resolved network config at runtime.
|
|
10
174
|
- Exported the `SuiNetwork` type and `resolveGamePackageId()` helper.
|