@suigar/mcp 0.1.0 → 0.1.1

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 (55) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/bin.cjs +1 -1
  3. package/dist/bin.mjs +1 -1
  4. package/dist/index.cjs +43 -50
  5. package/dist/index.d.cts +818 -8
  6. package/dist/index.d.mts +818 -8
  7. package/dist/index.mjs +1 -8
  8. package/{node_modules/@suigar/sui-rpc-pool/dist/index.cjs → dist/server-BD-123-u.mjs} +2084 -671
  9. package/{node_modules/@suigar/sui-rpc-pool/dist/index.mjs → dist/server-Cmo8UaHE.cjs} +2341 -645
  10. package/dist/server.cjs +3 -432
  11. package/dist/server.mjs +1 -430
  12. package/package.json +75 -61
  13. package/dist/client.cjs +0 -46
  14. package/dist/client.d.cts +0 -17
  15. package/dist/client.d.mts +0 -17
  16. package/dist/client.mjs +0 -43
  17. package/dist/coin.cjs +0 -86
  18. package/dist/coin.d.cts +0 -35
  19. package/dist/coin.d.mts +0 -35
  20. package/dist/coin.mjs +0 -86
  21. package/dist/config.cjs +0 -183
  22. package/dist/config.d.cts +0 -15
  23. package/dist/config.d.mts +0 -15
  24. package/dist/config.mjs +0 -174
  25. package/dist/mcp-support.cjs +0 -62
  26. package/dist/mcp-support.d.cts +0 -16
  27. package/dist/mcp-support.d.mts +0 -16
  28. package/dist/mcp-support.mjs +0 -60
  29. package/dist/metadata.cjs +0 -51
  30. package/dist/metadata.d.cts +0 -52
  31. package/dist/metadata.d.mts +0 -52
  32. package/dist/metadata.mjs +0 -47
  33. package/dist/tools.cjs +0 -617
  34. package/dist/tools.d.cts +0 -158
  35. package/dist/tools.d.mts +0 -158
  36. package/dist/tools.mjs +0 -608
  37. package/dist/transactions.cjs +0 -294
  38. package/dist/transactions.d.cts +0 -40
  39. package/dist/transactions.d.mts +0 -40
  40. package/dist/transactions.mjs +0 -286
  41. package/dist/types.d.cts +0 -111
  42. package/dist/types.d.mts +0 -111
  43. package/node_modules/@suigar/currency-registry/dist/index.cjs +0 -121
  44. package/node_modules/@suigar/currency-registry/dist/index.d.cts +0 -50
  45. package/node_modules/@suigar/currency-registry/dist/index.d.mts +0 -50
  46. package/node_modules/@suigar/currency-registry/dist/index.mjs +0 -110
  47. package/node_modules/@suigar/currency-registry/package.json +0 -31
  48. package/node_modules/@suigar/game-registry/dist/index.cjs +0 -310
  49. package/node_modules/@suigar/game-registry/dist/index.d.cts +0 -65
  50. package/node_modules/@suigar/game-registry/dist/index.d.mts +0 -65
  51. package/node_modules/@suigar/game-registry/dist/index.mjs +0 -292
  52. package/node_modules/@suigar/game-registry/package.json +0 -31
  53. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.cts +0 -465
  54. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.mts +0 -465
  55. package/node_modules/@suigar/sui-rpc-pool/package.json +0 -31
@@ -1,292 +0,0 @@
1
- //#region src/index.ts
2
- const GAME_DEFINITIONS = [
3
- {
4
- id: "coinflip",
5
- name: "Coinflip",
6
- module: "coinflip",
7
- eventTypeName: "CoinFlip",
8
- description: "Heads or tails - double or nothing!",
9
- aliases: ["coinflip", "coinflipv2"],
10
- tags: [
11
- "solo",
12
- "fast",
13
- "classic"
14
- ],
15
- status: "active",
16
- updatedAt: "2025-10-18"
17
- },
18
- {
19
- id: "pvp-coinflip",
20
- name: "PvP Coinflip",
21
- module: "pvp_coinflip",
22
- eventTypeName: "PvpCoinflip",
23
- description: "Challenge another player in a heads-or-tails duel.",
24
- aliases: [
25
- "pvp-coinflip",
26
- "pvp_coinflip",
27
- "pvpcoinflip",
28
- "coinflip-pvp"
29
- ],
30
- tags: [
31
- "multiplayer",
32
- "pvp",
33
- "coinflip",
34
- "live"
35
- ],
36
- status: "active",
37
- updatedAt: "2026-04-06"
38
- },
39
- {
40
- id: "lootbox",
41
- name: "Lootbox",
42
- module: "lootbox",
43
- eventTypeName: "LootboxRevealedEvent",
44
- description: "Open sweet boxes for amazing rewards",
45
- aliases: ["lootbox"],
46
- tags: ["solo", "drops"],
47
- status: "disabled",
48
- updatedAt: "2025-09-02"
49
- },
50
- {
51
- id: "slots",
52
- name: "Candy Rush",
53
- module: "slots",
54
- eventTypeName: "Slots",
55
- description: "Spin 7x7 candy clusters, charge the Sugar Meter, and chase free spins.",
56
- aliases: [
57
- "slots",
58
- "slot",
59
- "candy-rush",
60
- "sugar-rush",
61
- "sugar-rush-1000"
62
- ],
63
- tags: [
64
- "solo",
65
- "slots",
66
- "cluster-pays",
67
- "cascades",
68
- "free-spins",
69
- "high-volatility"
70
- ],
71
- status: "active",
72
- updatedAt: "2026-05-27"
73
- },
74
- {
75
- id: "limbo",
76
- name: "Limbo",
77
- module: "limbo",
78
- eventTypeName: "Limbo",
79
- description: "How high can you pump the balloon?",
80
- aliases: ["limbo"],
81
- tags: [
82
- "solo",
83
- "risk",
84
- "multiplier"
85
- ],
86
- status: "active",
87
- updatedAt: "2025-11-12"
88
- },
89
- {
90
- id: "plinko",
91
- name: "Plinko",
92
- module: "plinko",
93
- eventTypeName: "Plinko",
94
- description: "Drop the ball and watch it bounce!",
95
- aliases: ["plinko"],
96
- tags: ["solo", "classic"],
97
- status: "active",
98
- updatedAt: "2025-12-08"
99
- },
100
- {
101
- id: "wheel",
102
- name: "Wheel",
103
- module: "wheel",
104
- eventTypeName: "Wheel",
105
- description: "Spin the wheel and chase the multiplier.",
106
- aliases: [
107
- "wheel",
108
- "luckywheel",
109
- "lucky-wheel"
110
- ],
111
- tags: [
112
- "solo",
113
- "spin",
114
- "multipliers"
115
- ],
116
- status: "active",
117
- updatedAt: "2026-04-30T21:08:34+02:00"
118
- },
119
- {
120
- id: "range",
121
- name: "Range",
122
- module: "range",
123
- eventTypeName: "Range",
124
- description: "Pick your range and hit the target",
125
- aliases: ["range"],
126
- tags: ["solo", "custom-odds"],
127
- status: "active",
128
- updatedAt: "2025-11-27"
129
- },
130
- {
131
- id: "soccer",
132
- name: "Soccer",
133
- module: "soccer",
134
- eventTypeName: "Soccer",
135
- description: "Pick a country, take soccer shots, and climb the World Cup boards.",
136
- aliases: [
137
- "soccer",
138
- "football",
139
- "world-cup",
140
- "worldcup",
141
- "suigar-world-cup"
142
- ],
143
- tags: [
144
- "solo",
145
- "soccer",
146
- "football",
147
- "event",
148
- "world-cup",
149
- "multiplier"
150
- ],
151
- status: "active",
152
- updatedAt: "2026-06-02"
153
- }
154
- ];
155
- const ONCHAIN_GAME_SETTINGS_DEFINITIONS = [
156
- {
157
- id: "coinflip",
158
- moduleName: "coinflip",
159
- keyName: "CoinFlipSettingsKey",
160
- settingsStructName: "CoinFlipSettings",
161
- parametersStructName: "Parameters"
162
- },
163
- {
164
- id: "pvp-coinflip",
165
- moduleName: "pvp_coinflip",
166
- keyName: "PvpCoinflipSettingsKey",
167
- settingsStructName: "PvpCoinflipSettings",
168
- parametersStructName: "Parameters"
169
- },
170
- {
171
- id: "range",
172
- moduleName: "range",
173
- keyName: "RangeSettingsKey",
174
- settingsStructName: "RangeSettings",
175
- parametersStructName: "Parameters"
176
- },
177
- {
178
- id: "limbo",
179
- moduleName: "limbo",
180
- keyName: "LimboSettingsKey",
181
- settingsStructName: "LimboSettings",
182
- parametersStructName: "Parameters"
183
- },
184
- {
185
- id: "wheel",
186
- moduleName: "wheel",
187
- keyName: "WheelSettingsKey",
188
- settingsStructName: "WheelSettings",
189
- parametersStructName: "Parameters"
190
- },
191
- {
192
- id: "plinko",
193
- moduleName: "plinko",
194
- keyName: "PlinkoSettingsKey",
195
- settingsStructName: "PlinkoSettings",
196
- parametersStructName: "Parameters"
197
- },
198
- {
199
- id: "soccer",
200
- moduleName: "soccer",
201
- keyName: "SoccerSettingsKey",
202
- settingsStructName: "SoccerSettings",
203
- parametersStructName: "Parameters"
204
- },
205
- {
206
- id: "rps",
207
- moduleName: "rps",
208
- keyName: "RpsSettingsKey",
209
- settingsStructName: "RpsSettings",
210
- parametersStructName: "Parameters"
211
- }
212
- ];
213
- const normalizeKey = (value) => typeof value === "string" ? value.trim().toLowerCase() : "";
214
- const normalizeStatus = (value) => typeof value === "string" ? value.trim().toLowerCase() : "active";
215
- const GAME_BY_ID = new Map(GAME_DEFINITIONS.map((game) => [normalizeKey(game.id), game]));
216
- const GAME_BY_MODULE = new Map(GAME_DEFINITIONS.map((game) => [normalizeKey(game.module), game]));
217
- const GAME_BY_ALIAS = /* @__PURE__ */ new Map();
218
- const ONCHAIN_GAME_SETTINGS_BY_ID = new Map(ONCHAIN_GAME_SETTINGS_DEFINITIONS.map((definition) => [normalizeKey(definition.id), definition]));
219
- GAME_DEFINITIONS.forEach((game) => {
220
- game.aliases.forEach((alias) => GAME_BY_ALIAS.set(normalizeKey(alias), game));
221
- GAME_BY_ALIAS.set(normalizeKey(game.id), game);
222
- GAME_BY_ALIAS.set(normalizeKey(game.module), game);
223
- });
224
- const getGameById = (id) => GAME_BY_ID.get(normalizeKey(id));
225
- const getGameByModule = (module) => GAME_BY_MODULE.get(normalizeKey(module));
226
- const getGameByAlias = (alias) => GAME_BY_ALIAS.get(normalizeKey(alias));
227
- const getAllGameIds = () => GAME_DEFINITIONS.map((game) => game.id);
228
- const getAllModules = () => GAME_DEFINITIONS.map((game) => game.module);
229
- const getAllAliases = () => Array.from(GAME_BY_ALIAS.keys());
230
- const isGameActive = (game) => normalizeStatus(game?.status) !== "disabled";
231
- const getActiveGames = () => GAME_DEFINITIONS.filter(isGameActive);
232
- const getOnchainGameSettingsDefinition = (id) => ONCHAIN_GAME_SETTINGS_BY_ID.get(normalizeKey(id));
233
- const buildOnchainGameSettingsObjectType = (packageId, definition) => `${packageId}::${definition.moduleName}::${definition.settingsStructName}`;
234
- const buildOnchainGameParametersTypePrefix = (packageId, definition) => `${packageId}::${definition.moduleName}::${definition.parametersStructName}<`;
235
- const ensureNumber = (value, fallback = 0) => Number.isFinite(value) ? Number(value) : fallback;
236
- const calculateRangeRtp = (winChance, { minRtp, maxRtp, maxRange }) => {
237
- const chance = Number(winChance);
238
- const range = Number(maxRange);
239
- if (!Number.isFinite(chance) || chance <= 0 || !Number.isFinite(range) || range <= 0) return ensureNumber(minRtp);
240
- const minValue = ensureNumber(minRtp);
241
- const maxValue = ensureNumber(maxRtp);
242
- return minValue + chance / range * (maxValue - minValue);
243
- };
244
- const calculateRangeMultiplier = (winChance, { minRtp, maxRtp, maxRange }) => {
245
- const chance = Number(winChance);
246
- const range = Number(maxRange);
247
- if (!Number.isFinite(chance) || chance <= 0 || !Number.isFinite(range) || range <= 0) return 0;
248
- return calculateRangeRtp(chance, {
249
- minRtp,
250
- maxRtp,
251
- maxRange: range
252
- }) * range / chance;
253
- };
254
- const calculateLimboRtp = (targetMultiplier, { minRtp, maxRtp, maxTargetMultiplier }) => {
255
- const target = Number(targetMultiplier);
256
- const minValue = ensureNumber(minRtp);
257
- const maxValue = ensureNumber(maxRtp);
258
- if (!Number.isFinite(target) || target <= 1) return maxValue || minValue;
259
- const maxTarget = Number.isFinite(maxTargetMultiplier) && Number(maxTargetMultiplier) > 1 ? Number(maxTargetMultiplier) : target;
260
- const maxMinusOne = Math.max(1e-4, maxTarget - 1);
261
- return maxValue - Math.min(1, Math.max(0, (target - 1) / maxMinusOne)) * (maxValue - minValue);
262
- };
263
- const calculateWheelRtp = (multipliers) => {
264
- if (!Array.isArray(multipliers) || multipliers.length === 0) return NaN;
265
- let total = 0;
266
- let count = 0;
267
- multipliers.forEach((value) => {
268
- const numeric = Number(value);
269
- if (Number.isFinite(numeric)) {
270
- total += numeric;
271
- count += 1;
272
- }
273
- });
274
- return count ? total / count : NaN;
275
- };
276
- const calculatePlinkoRtp = (multipliers, numRows) => {
277
- if (!Array.isArray(multipliers) || multipliers.length === 0) return NaN;
278
- const n = Number(numRows);
279
- if (!Number.isFinite(n) || n <= 0) return NaN;
280
- const rowCount = Math.round(n);
281
- if (multipliers.length < rowCount + 1) return NaN;
282
- let probability = Math.pow(.5, rowCount);
283
- let expected = 0;
284
- for (let i = 0; i <= rowCount; i += 1) {
285
- const multiplier = Number(multipliers[i]);
286
- if (Number.isFinite(multiplier)) expected += multiplier * probability;
287
- if (i < rowCount) probability = probability * (rowCount - i) / (i + 1);
288
- }
289
- return expected;
290
- };
291
- //#endregion
292
- export { GAME_DEFINITIONS, ONCHAIN_GAME_SETTINGS_DEFINITIONS, buildOnchainGameParametersTypePrefix, buildOnchainGameSettingsObjectType, calculateLimboRtp, calculatePlinkoRtp, calculateRangeMultiplier, calculateRangeRtp, calculateWheelRtp, getActiveGames, getAllAliases, getAllGameIds, getAllModules, getGameByAlias, getGameById, getGameByModule, getOnchainGameSettingsDefinition, isGameActive };
@@ -1,31 +0,0 @@
1
- {
2
- "name": "@suigar/game-registry",
3
- "version": "0.0.0",
4
- "description": "Shared game registry for Suigar",
5
- "private": true,
6
- "license": "UNLICENSED",
7
- "type": "module",
8
- "sideEffects": false,
9
- "main": "./dist/index.cjs",
10
- "module": "./dist/index.mjs",
11
- "types": "./dist/index.d.mts",
12
- "scripts": {
13
- "build": "tsdown",
14
- "clean": "rm -rf dist",
15
- "typecheck": "tsc --noEmit"
16
- },
17
- "exports": {
18
- ".": {
19
- "types": "./dist/index.d.mts",
20
- "require": "./dist/index.cjs",
21
- "import": "./dist/index.mjs"
22
- }
23
- },
24
- "files": [
25
- "dist"
26
- ],
27
- "devDependencies": {
28
- "tsdown": "catalog:tooling",
29
- "typescript": "catalog:tooling"
30
- }
31
- }