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