@suigar/mcp 0.1.0 → 0.2.0-beta.0

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 (77) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/LICENSE +201 -0
  3. package/README.md +79 -110
  4. package/dist/app/index.html +181 -0
  5. package/dist/bin.mjs +3 -7
  6. package/dist/bin.mjs.map +1 -0
  7. package/dist/client.d.mts +41 -11
  8. package/dist/client.d.mts.map +1 -0
  9. package/dist/client.mjs +107 -34
  10. package/dist/client.mjs.map +1 -0
  11. package/dist/dry-run.mjs +163 -0
  12. package/dist/dry-run.mjs.map +1 -0
  13. package/dist/format.mjs +24 -0
  14. package/dist/format.mjs.map +1 -0
  15. package/dist/index.d.mts +5 -9
  16. package/dist/index.mjs +4 -8
  17. package/dist/schemas.d.mts +642 -0
  18. package/dist/schemas.d.mts.map +1 -0
  19. package/dist/schemas.mjs +113 -0
  20. package/dist/schemas.mjs.map +1 -0
  21. package/dist/server.d.mts +21 -69
  22. package/dist/server.d.mts.map +1 -0
  23. package/dist/server.mjs +172 -411
  24. package/dist/server.mjs.map +1 -0
  25. package/dist/tools.d.mts +14 -155
  26. package/dist/tools.d.mts.map +1 -0
  27. package/dist/tools.mjs +297 -553
  28. package/dist/tools.mjs.map +1 -0
  29. package/dist/types.d.mts +109 -83
  30. package/dist/types.d.mts.map +1 -0
  31. package/package.json +83 -61
  32. package/dist/bin.cjs +0 -11
  33. package/dist/bin.d.cts +0 -1
  34. package/dist/client.cjs +0 -46
  35. package/dist/client.d.cts +0 -17
  36. package/dist/coin.cjs +0 -86
  37. package/dist/coin.d.cts +0 -35
  38. package/dist/coin.d.mts +0 -35
  39. package/dist/coin.mjs +0 -86
  40. package/dist/config.cjs +0 -183
  41. package/dist/config.d.cts +0 -15
  42. package/dist/config.d.mts +0 -15
  43. package/dist/config.mjs +0 -174
  44. package/dist/index.cjs +0 -53
  45. package/dist/index.d.cts +0 -10
  46. package/dist/mcp-support.cjs +0 -62
  47. package/dist/mcp-support.d.cts +0 -16
  48. package/dist/mcp-support.d.mts +0 -16
  49. package/dist/mcp-support.mjs +0 -60
  50. package/dist/metadata.cjs +0 -51
  51. package/dist/metadata.d.cts +0 -52
  52. package/dist/metadata.d.mts +0 -52
  53. package/dist/metadata.mjs +0 -47
  54. package/dist/server.cjs +0 -433
  55. package/dist/server.d.cts +0 -73
  56. package/dist/tools.cjs +0 -617
  57. package/dist/tools.d.cts +0 -158
  58. package/dist/transactions.cjs +0 -294
  59. package/dist/transactions.d.cts +0 -40
  60. package/dist/transactions.d.mts +0 -40
  61. package/dist/transactions.mjs +0 -286
  62. package/dist/types.d.cts +0 -111
  63. package/node_modules/@suigar/currency-registry/dist/index.cjs +0 -121
  64. package/node_modules/@suigar/currency-registry/dist/index.d.cts +0 -50
  65. package/node_modules/@suigar/currency-registry/dist/index.d.mts +0 -50
  66. package/node_modules/@suigar/currency-registry/dist/index.mjs +0 -110
  67. package/node_modules/@suigar/currency-registry/package.json +0 -31
  68. package/node_modules/@suigar/game-registry/dist/index.cjs +0 -310
  69. package/node_modules/@suigar/game-registry/dist/index.d.cts +0 -65
  70. package/node_modules/@suigar/game-registry/dist/index.d.mts +0 -65
  71. package/node_modules/@suigar/game-registry/dist/index.mjs +0 -292
  72. package/node_modules/@suigar/game-registry/package.json +0 -31
  73. package/node_modules/@suigar/sui-rpc-pool/dist/index.cjs +0 -45590
  74. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.cts +0 -465
  75. package/node_modules/@suigar/sui-rpc-pool/dist/index.d.mts +0 -465
  76. package/node_modules/@suigar/sui-rpc-pool/dist/index.mjs +0 -45570
  77. package/node_modules/@suigar/sui-rpc-pool/package.json +0 -31
package/dist/coin.d.mts DELETED
@@ -1,35 +0,0 @@
1
- import { BetCoinSource, CoinReadClient } from "./types.mjs";
2
- import { Transaction } from "@mysten/sui/transactions";
3
-
4
- //#region src/coin.d.ts
5
- declare const resolveBetCoin: ({
6
- tx,
7
- coinType,
8
- amount,
9
- suiCoinType: _suiCoinType,
10
- coinSource,
11
- client,
12
- owner,
13
- allowGasCoinShortcut
14
- }: {
15
- tx: Transaction;
16
- coinType: string;
17
- amount: number | bigint;
18
- suiCoinType?: string;
19
- coinSource?: BetCoinSource;
20
- client?: CoinReadClient;
21
- owner?: string;
22
- allowGasCoinShortcut?: boolean;
23
- }) => Promise<{
24
- NestedResult: [number, number];
25
- $kind: "NestedResult";
26
- } | import("@mysten/sui/transactions").TransactionResult | {
27
- $kind: "Input";
28
- Input: number;
29
- type?: "object";
30
- } | {
31
- $kind: "GasCoin";
32
- GasCoin: true;
33
- }>;
34
- //#endregion
35
- export { resolveBetCoin };
package/dist/coin.mjs DELETED
@@ -1,86 +0,0 @@
1
- import { normalizeCoinType } from "@suigar/currency-registry";
2
- import { SUI_TYPE_ARG } from "@mysten/sui/utils";
3
- import { toBigInt } from "@suigar/sdk/utils";
4
- //#region src/coin.ts
5
- const DEFAULT_PAGE_LIMIT = 50;
6
- const NETWORK_GAS_COIN_TYPE = normalizeCoinType(SUI_TYPE_ARG);
7
- const mergeCoinObjects = (tx, coinIds) => {
8
- if (coinIds.length === 0) throw new Error("No coin objects available");
9
- const primaryCoin = tx.object(coinIds[0]);
10
- if (coinIds.length > 1) tx.mergeCoins(primaryCoin, coinIds.slice(1).map((coinId) => tx.object(coinId)));
11
- return primaryCoin;
12
- };
13
- const selectCoinsForAmount = async ({ client, owner, coinType, requiredAmount, pageLimit = DEFAULT_PAGE_LIMIT }) => {
14
- if (requiredAmount <= 0n) return [];
15
- let cursor = null;
16
- let total = 0n;
17
- const coins = [];
18
- const normalizedCoinType = normalizeCoinType(coinType);
19
- do {
20
- const response = await client.getCoins({
21
- owner,
22
- coinType: normalizedCoinType,
23
- cursor,
24
- limit: pageLimit
25
- });
26
- for (const coin of response.data ?? []) {
27
- try {
28
- const balance = BigInt(coin.balance);
29
- coins.push({
30
- coinObjectId: coin.coinObjectId,
31
- balance
32
- });
33
- total += balance;
34
- } catch {}
35
- if (total >= requiredAmount) break;
36
- }
37
- cursor = response.hasNextPage && total < requiredAmount ? response.nextCursor : null;
38
- } while (cursor);
39
- if (coins.length === 0) throw new Error(`No usable gameplay coin objects were found for ${normalizedCoinType} at owner ${owner}`);
40
- if (total < requiredAmount) throw new Error("Insufficient balance for this bet");
41
- coins.sort((left, right) => {
42
- if (left.balance === right.balance) return 0;
43
- return left.balance > right.balance ? -1 : 1;
44
- });
45
- const selectedCoinIds = [];
46
- let selectedTotal = 0n;
47
- for (const coin of coins) {
48
- selectedCoinIds.push(coin.coinObjectId);
49
- selectedTotal += coin.balance;
50
- if (selectedTotal >= requiredAmount) break;
51
- }
52
- return selectedCoinIds;
53
- };
54
- const resolveBetCoin = async ({ tx, coinType, amount, suiCoinType: _suiCoinType, coinSource, client, owner, allowGasCoinShortcut = true }) => {
55
- const normalizedCoinType = normalizeCoinType(coinType);
56
- const resolvedAmount = toBigInt(amount);
57
- if (resolvedAmount < 0n) throw new Error("Amount must be non-negative");
58
- if (resolvedAmount === 0n) return tx.moveCall({
59
- target: "0x2::coin::zero",
60
- typeArguments: [normalizedCoinType],
61
- arguments: []
62
- });
63
- if (coinSource?.kind === "object-ids") {
64
- const primaryCoin = mergeCoinObjects(tx, coinSource.objectIds);
65
- if (coinSource.split === false) return primaryCoin;
66
- const [coin] = tx.splitCoins(primaryCoin, [tx.pure.u64(resolvedAmount)]);
67
- return coin;
68
- }
69
- if (coinSource?.kind === "gas" && normalizedCoinType !== NETWORK_GAS_COIN_TYPE) throw new Error(`Gas coin sourcing is only supported for the native SUI gas coin (${NETWORK_GAS_COIN_TYPE})`);
70
- if ((coinSource?.kind === "gas" || allowGasCoinShortcut) && normalizedCoinType === NETWORK_GAS_COIN_TYPE) {
71
- if (coinSource?.kind === "gas" && coinSource.split === false) return tx.gas;
72
- const [coin] = tx.splitCoins(tx.gas, [tx.pure.u64(resolvedAmount)]);
73
- return coin;
74
- }
75
- if (!client || !owner) throw new Error(`A read-only client and owner address are required to source non-native coin ${normalizedCoinType}`);
76
- const primaryCoin = mergeCoinObjects(tx, await selectCoinsForAmount({
77
- client,
78
- owner,
79
- coinType: normalizedCoinType,
80
- requiredAmount: resolvedAmount
81
- }));
82
- const [coin] = tx.splitCoins(primaryCoin, [tx.pure.u64(resolvedAmount)]);
83
- return coin;
84
- };
85
- //#endregion
86
- export { resolveBetCoin };
package/dist/config.cjs DELETED
@@ -1,183 +0,0 @@
1
- const require_mcp_support = require("./mcp-support.cjs");
2
- let _suigar_currency_registry = require("@suigar/currency-registry");
3
- let _suigar_game_registry = require("@suigar/game-registry");
4
- let _mysten_sui_grpc = require("@mysten/sui/grpc");
5
- let _suigar_sdk = require("@suigar/sdk");
6
- //#region src/config.ts
7
- const EMPTY = "";
8
- const DEFAULT_NETWORK = "testnet";
9
- const DEFAULT_SUI_COIN_TYPE = "0x2::sui::SUI";
10
- const SDK_CONFIG_NETWORKS = /* @__PURE__ */ new Set(["mainnet", "testnet"]);
11
- const DEFAULT_GRAPHQL_URL = (network) => `https://graphql.${network}.sui.io/graphql`;
12
- const DEFAULT_PROVIDER_URL = (network) => {
13
- switch (network) {
14
- case "mainnet": return "https://fullnode.mainnet.sui.io:443";
15
- case "devnet": return "https://fullnode.devnet.sui.io:443";
16
- case "localnet": return "http://127.0.0.1:9000";
17
- default: return "https://fullnode.testnet.sui.io:443";
18
- }
19
- };
20
- const parseApiLikeUrl = (value) => value?.trim().replace(/\/+$/, "") ?? EMPTY;
21
- const trim = (value) => value?.trim() ?? EMPTY;
22
- const pickFirst = (...values) => {
23
- for (const value of values) if (typeof value === "string" && value.trim().length > 0) return value.trim();
24
- return EMPTY;
25
- };
26
- const env = (...keys) => pickFirst(...keys.map((key) => process.env[key]));
27
- const normalizeNetwork = (value) => {
28
- const normalized = value?.trim().toLowerCase();
29
- return normalized ? normalized : DEFAULT_NETWORK;
30
- };
31
- const resolveSdkConfig = (network) => {
32
- if (!SDK_CONFIG_NETWORKS.has(network)) return null;
33
- try {
34
- return new _mysten_sui_grpc.SuiGrpcClient({
35
- baseUrl: DEFAULT_PROVIDER_URL(network),
36
- network
37
- }).$extend((0, _suigar_sdk.suigar)()).suigar.getConfig();
38
- } catch {
39
- return null;
40
- }
41
- };
42
- const resolveSharedPackageId = (input) => pickFirst(input.suigarPackageId, env("SUIGAR_PACKAGE_ID", "VITE_SUIGAR_PACKAGE_ID"));
43
- const resolveSuigarConfig = (input = {}) => {
44
- const mergedInput = {
45
- ...input.config ?? {},
46
- ...input
47
- };
48
- const network = normalizeNetwork(mergedInput.network ?? env("SUIGAR_NETWORK", "VITE_NETWORK", "NETWORK"));
49
- const sdkConfig = resolveSdkConfig(network);
50
- const explicitSharedPackageId = resolveSharedPackageId(mergedInput);
51
- const sharedPackageId = pickFirst(explicitSharedPackageId, sdkConfig?.packageIds.core);
52
- return {
53
- network,
54
- providerUrl: pickFirst(mergedInput.providerUrl, env("SUIGAR_PROVIDER_URL", "VITE_SUI_GRPC_URL")) || DEFAULT_PROVIDER_URL(network),
55
- graphqlUrl: pickFirst(mergedInput.graphqlUrl, env("SUIGAR_GRAPHQL_URL", "VITE_SUI_GRAPHQL_URL")) || DEFAULT_GRAPHQL_URL(network),
56
- siteUrl: pickFirst(mergedInput.siteUrl, env("SUIGAR_SITE_URL", "VITE_SITE_URL")) || "https://suigar.com",
57
- suigarPackageId: sharedPackageId,
58
- coinflipPackageId: pickFirst(mergedInput.coinflipPackageId, env("COINFLIP_PACKAGE_ID", "VITE_COINFLIP_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.coinflip),
59
- pvpCoinflipPackageId: pickFirst(mergedInput.pvpCoinflipPackageId, env("PVP_COINFLIP_PACKAGE_ID", "VITE_PVP_COINFLIP_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.pvpCoinflip),
60
- plinkoPackageId: pickFirst(mergedInput.plinkoPackageId, env("PLINKO_PACKAGE_ID", "VITE_PLINKO_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.plinko),
61
- limboPackageId: pickFirst(mergedInput.limboPackageId, env("LIMBO_PACKAGE_ID", "VITE_LIMBO_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.limbo),
62
- rangePackageId: pickFirst(mergedInput.rangePackageId, env("RANGE_PACKAGE_ID", "VITE_RANGE_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.range),
63
- wheelPackageId: pickFirst(mergedInput.wheelPackageId, env("WHEEL_PACKAGE_ID", "VITE_WHEEL_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.wheel),
64
- sweethouseId: pickFirst(mergedInput.sweethouseId, env("SWEETHOUSE_ID", "VITE_SWEETHOUSE_ID"), sdkConfig?.packageIds.sweetHouse),
65
- suiCoinType: pickFirst(mergedInput.suiCoinType, env("SUI_COIN_TYPE", "VITE_SUI_COIN_TYPE"), sdkConfig?.coinTypes.sui) || DEFAULT_SUI_COIN_TYPE,
66
- usdcCoinType: pickFirst(mergedInput.usdcCoinType, env("USDC_COIN_TYPE", "VITE_USDC_COIN_TYPE"), sdkConfig?.coinTypes.usdc),
67
- suiPythPriceInfoObjectId: pickFirst(mergedInput.suiPythPriceInfoObjectId, env("SUI_PYTH_PRICE_INFO_OBJECT_ID", "VITE_SUI_PYTH_PRICE_INFO_OBJECT_ID"), sdkConfig?.priceInfoObjectIds.sui),
68
- usdcPythPriceInfoObjectId: pickFirst(mergedInput.usdcPythPriceInfoObjectId, env("USDC_PYTH_PRICE_INFO_OBJECT_ID", "VITE_USDC_PYTH_PRICE_INFO_OBJECT_ID"), sdkConfig?.priceInfoObjectIds.usdc),
69
- coinflipSettingsId: pickFirst(mergedInput.coinflipSettingsId, env("COINFLIP_SETTINGS_ID", "VITE_COINFLIP_SETTINGS_ID")),
70
- pvpCoinflipSettingsId: pickFirst(mergedInput.pvpCoinflipSettingsId, env("PVP_COINFLIP_SETTINGS_ID", "VITE_PVP_COINFLIP_SETTINGS_ID")),
71
- plinkoSettingsId: pickFirst(mergedInput.plinkoSettingsId, env("PLINKO_SETTINGS_ID", "VITE_PLINKO_SETTINGS_ID")),
72
- limboSettingsId: pickFirst(mergedInput.limboSettingsId, env("LIMBO_SETTINGS_ID", "VITE_LIMBO_SETTINGS_ID")),
73
- rangeSettingsId: pickFirst(mergedInput.rangeSettingsId, env("RANGE_SETTINGS_ID", "VITE_RANGE_SETTINGS_ID")),
74
- wheelSettingsId: pickFirst(mergedInput.wheelSettingsId, env("WHEEL_SETTINGS_ID", "VITE_WHEEL_SETTINGS_ID")),
75
- pvpCoinflipRegistryId: pickFirst(mergedInput.pvpCoinflipRegistryId, env("PVP_COINFLIP_REGISTRY_ID", "VITE_PVP_COINFLIP_REGISTRY_ID"), sdkConfig?.registryIds.pvpCoinflip)
76
- };
77
- };
78
- const REQUIRED_CONFIG_KEYS_BY_GAME = {
79
- coinflip: [
80
- "coinflipPackageId",
81
- "sweethouseId",
82
- "suiCoinType",
83
- "suiPythPriceInfoObjectId"
84
- ],
85
- limbo: [
86
- "limboPackageId",
87
- "sweethouseId",
88
- "suiCoinType",
89
- "suiPythPriceInfoObjectId"
90
- ],
91
- plinko: [
92
- "plinkoPackageId",
93
- "sweethouseId",
94
- "suiCoinType",
95
- "suiPythPriceInfoObjectId"
96
- ],
97
- wheel: [
98
- "wheelPackageId",
99
- "sweethouseId",
100
- "suiCoinType",
101
- "suiPythPriceInfoObjectId"
102
- ],
103
- range: [
104
- "rangePackageId",
105
- "sweethouseId",
106
- "suiCoinType",
107
- "suiPythPriceInfoObjectId"
108
- ],
109
- "pvp-coinflip": [
110
- "pvpCoinflipPackageId",
111
- "sweethouseId",
112
- "suiCoinType"
113
- ]
114
- };
115
- const getRequiredConfigKeysForGame = (game) => REQUIRED_CONFIG_KEYS_BY_GAME[game];
116
- const inspectResolvedConfig = (input = {}) => {
117
- const config = resolveSuigarConfig(input);
118
- const configuredCurrencies = (0, _suigar_currency_registry.buildConfiguredCurrencies)({
119
- suiCoinType: config.suiCoinType,
120
- usdcCoinType: config.usdcCoinType
121
- });
122
- const missingValues = Object.entries(config).flatMap(([key, value]) => trim(value) ? [] : [key]);
123
- return {
124
- config,
125
- configuredCurrencies,
126
- availableGames: (0, _suigar_game_registry.getActiveGames)().map((game) => ({
127
- ...game,
128
- mcpSupport: require_mcp_support.getMcpSupportForGame(game.id)
129
- })),
130
- missingValues,
131
- mcp: require_mcp_support.buildMcpSupportCatalog()
132
- };
133
- };
134
- const resolvePythPriceInfoId = (coinType, configInput = {}) => {
135
- const config = resolveSuigarConfig(configInput);
136
- const normalizedCoinType = (0, _suigar_currency_registry.normalizeCoinTypeKey)(coinType);
137
- if (normalizedCoinType === (0, _suigar_currency_registry.normalizeCoinTypeKey)(config.suiCoinType) && config.suiPythPriceInfoObjectId) return config.suiPythPriceInfoObjectId;
138
- if ([config.usdcCoinType].filter((value) => Boolean(trim(value))).map((value) => (0, _suigar_currency_registry.normalizeCoinTypeKey)(value)).includes(normalizedCoinType) && config.usdcPythPriceInfoObjectId) return config.usdcPythPriceInfoObjectId;
139
- if ((0, _suigar_currency_registry.resolveCurrencyMetadata)(coinType, inspectResolvedConfig(config).configuredCurrencies).symbol === "USDC" && config.usdcPythPriceInfoObjectId) return config.usdcPythPriceInfoObjectId;
140
- throw new Error(`Missing Pyth price object configuration for coin type ${coinType}`);
141
- };
142
- const resolveGamePackageId = (game, configInput = {}) => {
143
- const config = resolveSuigarConfig(configInput);
144
- switch (game) {
145
- case "coinflip": return config.coinflipPackageId;
146
- case "limbo": return config.limboPackageId;
147
- case "plinko": return config.plinkoPackageId;
148
- case "wheel": return config.wheelPackageId;
149
- case "range": return config.rangePackageId;
150
- case "pvp-coinflip": return config.pvpCoinflipPackageId;
151
- }
152
- };
153
- const resolveGameSettingsId = (game, configInput = {}) => {
154
- const config = resolveSuigarConfig(configInput);
155
- switch (game) {
156
- case "coinflip": return config.coinflipSettingsId;
157
- case "limbo": return config.limboSettingsId;
158
- case "plinko": return config.plinkoSettingsId;
159
- case "wheel": return config.wheelSettingsId;
160
- case "range": return config.rangeSettingsId;
161
- case "pvp-coinflip": return config.pvpCoinflipSettingsId;
162
- }
163
- };
164
- const assertRequiredConfig = (game, configInput = {}) => {
165
- const inspection = inspectResolvedConfig(configInput);
166
- const missing = getRequiredConfigKeysForGame(game).filter((key) => !trim(inspection.config[key]));
167
- if (missing.length > 0) throw new Error(`Missing required config for ${game}: ${missing.join(", ")}`);
168
- return inspection.config;
169
- };
170
- const buildProviderUrl = (network) => DEFAULT_PROVIDER_URL(network);
171
- const buildGraphqlUrl = (network) => DEFAULT_GRAPHQL_URL(network);
172
- const parseApiUrl = parseApiLikeUrl;
173
- //#endregion
174
- exports.assertRequiredConfig = assertRequiredConfig;
175
- exports.buildGraphqlUrl = buildGraphqlUrl;
176
- exports.buildProviderUrl = buildProviderUrl;
177
- exports.getRequiredConfigKeysForGame = getRequiredConfigKeysForGame;
178
- exports.inspectResolvedConfig = inspectResolvedConfig;
179
- exports.parseApiUrl = parseApiUrl;
180
- exports.resolveGamePackageId = resolveGamePackageId;
181
- exports.resolveGameSettingsId = resolveGameSettingsId;
182
- exports.resolvePythPriceInfoId = resolvePythPriceInfoId;
183
- exports.resolveSuigarConfig = resolveSuigarConfig;
package/dist/config.d.cts DELETED
@@ -1,15 +0,0 @@
1
- import { CasinoBetGameId, ConfigInspection, SuigarConfig, SuigarConfigInput, SupportedGameId } from "./types.cjs";
2
-
3
- //#region src/config.d.ts
4
- declare const resolveSuigarConfig: (input?: SuigarConfigInput) => SuigarConfig;
5
- declare const getRequiredConfigKeysForGame: (game: SupportedGameId) => Array<keyof SuigarConfig>;
6
- declare const inspectResolvedConfig: (input?: SuigarConfigInput) => ConfigInspection;
7
- declare const resolvePythPriceInfoId: (coinType: string, configInput?: SuigarConfigInput) => string;
8
- declare const resolveGamePackageId: (game: SupportedGameId, configInput?: SuigarConfigInput) => string | null;
9
- declare const resolveGameSettingsId: (game: CasinoBetGameId | "pvp-coinflip", configInput?: SuigarConfigInput) => string | null;
10
- declare const assertRequiredConfig: (game: SupportedGameId, configInput?: SuigarConfigInput) => SuigarConfig;
11
- declare const buildProviderUrl: (network: string) => "https://fullnode.mainnet.sui.io:443" | "https://fullnode.devnet.sui.io:443" | "http://127.0.0.1:9000" | "https://fullnode.testnet.sui.io:443";
12
- declare const buildGraphqlUrl: (network: string) => string;
13
- declare const parseApiUrl: (value: string | undefined) => string;
14
- //#endregion
15
- export { assertRequiredConfig, buildGraphqlUrl, buildProviderUrl, getRequiredConfigKeysForGame, inspectResolvedConfig, parseApiUrl, resolveGamePackageId, resolveGameSettingsId, resolvePythPriceInfoId, resolveSuigarConfig };
package/dist/config.d.mts DELETED
@@ -1,15 +0,0 @@
1
- import { CasinoBetGameId, ConfigInspection, SuigarConfig, SuigarConfigInput, SupportedGameId } from "./types.mjs";
2
-
3
- //#region src/config.d.ts
4
- declare const resolveSuigarConfig: (input?: SuigarConfigInput) => SuigarConfig;
5
- declare const getRequiredConfigKeysForGame: (game: SupportedGameId) => Array<keyof SuigarConfig>;
6
- declare const inspectResolvedConfig: (input?: SuigarConfigInput) => ConfigInspection;
7
- declare const resolvePythPriceInfoId: (coinType: string, configInput?: SuigarConfigInput) => string;
8
- declare const resolveGamePackageId: (game: SupportedGameId, configInput?: SuigarConfigInput) => string | null;
9
- declare const resolveGameSettingsId: (game: CasinoBetGameId | "pvp-coinflip", configInput?: SuigarConfigInput) => string | null;
10
- declare const assertRequiredConfig: (game: SupportedGameId, configInput?: SuigarConfigInput) => SuigarConfig;
11
- declare const buildProviderUrl: (network: string) => "https://fullnode.mainnet.sui.io:443" | "https://fullnode.devnet.sui.io:443" | "http://127.0.0.1:9000" | "https://fullnode.testnet.sui.io:443";
12
- declare const buildGraphqlUrl: (network: string) => string;
13
- declare const parseApiUrl: (value: string | undefined) => string;
14
- //#endregion
15
- export { assertRequiredConfig, buildGraphqlUrl, buildProviderUrl, getRequiredConfigKeysForGame, inspectResolvedConfig, parseApiUrl, resolveGamePackageId, resolveGameSettingsId, resolvePythPriceInfoId, resolveSuigarConfig };
package/dist/config.mjs DELETED
@@ -1,174 +0,0 @@
1
- import { buildMcpSupportCatalog, getMcpSupportForGame } from "./mcp-support.mjs";
2
- import { buildConfiguredCurrencies, normalizeCoinTypeKey, resolveCurrencyMetadata } from "@suigar/currency-registry";
3
- import { getActiveGames } from "@suigar/game-registry";
4
- import { SuiGrpcClient } from "@mysten/sui/grpc";
5
- import { suigar } from "@suigar/sdk";
6
- //#region src/config.ts
7
- const EMPTY = "";
8
- const DEFAULT_NETWORK = "testnet";
9
- const DEFAULT_SUI_COIN_TYPE = "0x2::sui::SUI";
10
- const SDK_CONFIG_NETWORKS = /* @__PURE__ */ new Set(["mainnet", "testnet"]);
11
- const DEFAULT_GRAPHQL_URL = (network) => `https://graphql.${network}.sui.io/graphql`;
12
- const DEFAULT_PROVIDER_URL = (network) => {
13
- switch (network) {
14
- case "mainnet": return "https://fullnode.mainnet.sui.io:443";
15
- case "devnet": return "https://fullnode.devnet.sui.io:443";
16
- case "localnet": return "http://127.0.0.1:9000";
17
- default: return "https://fullnode.testnet.sui.io:443";
18
- }
19
- };
20
- const parseApiLikeUrl = (value) => value?.trim().replace(/\/+$/, "") ?? EMPTY;
21
- const trim = (value) => value?.trim() ?? EMPTY;
22
- const pickFirst = (...values) => {
23
- for (const value of values) if (typeof value === "string" && value.trim().length > 0) return value.trim();
24
- return EMPTY;
25
- };
26
- const env = (...keys) => pickFirst(...keys.map((key) => process.env[key]));
27
- const normalizeNetwork = (value) => {
28
- const normalized = value?.trim().toLowerCase();
29
- return normalized ? normalized : DEFAULT_NETWORK;
30
- };
31
- const resolveSdkConfig = (network) => {
32
- if (!SDK_CONFIG_NETWORKS.has(network)) return null;
33
- try {
34
- return new SuiGrpcClient({
35
- baseUrl: DEFAULT_PROVIDER_URL(network),
36
- network
37
- }).$extend(suigar()).suigar.getConfig();
38
- } catch {
39
- return null;
40
- }
41
- };
42
- const resolveSharedPackageId = (input) => pickFirst(input.suigarPackageId, env("SUIGAR_PACKAGE_ID", "VITE_SUIGAR_PACKAGE_ID"));
43
- const resolveSuigarConfig = (input = {}) => {
44
- const mergedInput = {
45
- ...input.config ?? {},
46
- ...input
47
- };
48
- const network = normalizeNetwork(mergedInput.network ?? env("SUIGAR_NETWORK", "VITE_NETWORK", "NETWORK"));
49
- const sdkConfig = resolveSdkConfig(network);
50
- const explicitSharedPackageId = resolveSharedPackageId(mergedInput);
51
- const sharedPackageId = pickFirst(explicitSharedPackageId, sdkConfig?.packageIds.core);
52
- return {
53
- network,
54
- providerUrl: pickFirst(mergedInput.providerUrl, env("SUIGAR_PROVIDER_URL", "VITE_SUI_GRPC_URL")) || DEFAULT_PROVIDER_URL(network),
55
- graphqlUrl: pickFirst(mergedInput.graphqlUrl, env("SUIGAR_GRAPHQL_URL", "VITE_SUI_GRAPHQL_URL")) || DEFAULT_GRAPHQL_URL(network),
56
- siteUrl: pickFirst(mergedInput.siteUrl, env("SUIGAR_SITE_URL", "VITE_SITE_URL")) || "https://suigar.com",
57
- suigarPackageId: sharedPackageId,
58
- coinflipPackageId: pickFirst(mergedInput.coinflipPackageId, env("COINFLIP_PACKAGE_ID", "VITE_COINFLIP_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.coinflip),
59
- pvpCoinflipPackageId: pickFirst(mergedInput.pvpCoinflipPackageId, env("PVP_COINFLIP_PACKAGE_ID", "VITE_PVP_COINFLIP_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.pvpCoinflip),
60
- plinkoPackageId: pickFirst(mergedInput.plinkoPackageId, env("PLINKO_PACKAGE_ID", "VITE_PLINKO_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.plinko),
61
- limboPackageId: pickFirst(mergedInput.limboPackageId, env("LIMBO_PACKAGE_ID", "VITE_LIMBO_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.limbo),
62
- rangePackageId: pickFirst(mergedInput.rangePackageId, env("RANGE_PACKAGE_ID", "VITE_RANGE_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.range),
63
- wheelPackageId: pickFirst(mergedInput.wheelPackageId, env("WHEEL_PACKAGE_ID", "VITE_WHEEL_PACKAGE_ID"), explicitSharedPackageId, sdkConfig?.packageIds.wheel),
64
- sweethouseId: pickFirst(mergedInput.sweethouseId, env("SWEETHOUSE_ID", "VITE_SWEETHOUSE_ID"), sdkConfig?.packageIds.sweetHouse),
65
- suiCoinType: pickFirst(mergedInput.suiCoinType, env("SUI_COIN_TYPE", "VITE_SUI_COIN_TYPE"), sdkConfig?.coinTypes.sui) || DEFAULT_SUI_COIN_TYPE,
66
- usdcCoinType: pickFirst(mergedInput.usdcCoinType, env("USDC_COIN_TYPE", "VITE_USDC_COIN_TYPE"), sdkConfig?.coinTypes.usdc),
67
- suiPythPriceInfoObjectId: pickFirst(mergedInput.suiPythPriceInfoObjectId, env("SUI_PYTH_PRICE_INFO_OBJECT_ID", "VITE_SUI_PYTH_PRICE_INFO_OBJECT_ID"), sdkConfig?.priceInfoObjectIds.sui),
68
- usdcPythPriceInfoObjectId: pickFirst(mergedInput.usdcPythPriceInfoObjectId, env("USDC_PYTH_PRICE_INFO_OBJECT_ID", "VITE_USDC_PYTH_PRICE_INFO_OBJECT_ID"), sdkConfig?.priceInfoObjectIds.usdc),
69
- coinflipSettingsId: pickFirst(mergedInput.coinflipSettingsId, env("COINFLIP_SETTINGS_ID", "VITE_COINFLIP_SETTINGS_ID")),
70
- pvpCoinflipSettingsId: pickFirst(mergedInput.pvpCoinflipSettingsId, env("PVP_COINFLIP_SETTINGS_ID", "VITE_PVP_COINFLIP_SETTINGS_ID")),
71
- plinkoSettingsId: pickFirst(mergedInput.plinkoSettingsId, env("PLINKO_SETTINGS_ID", "VITE_PLINKO_SETTINGS_ID")),
72
- limboSettingsId: pickFirst(mergedInput.limboSettingsId, env("LIMBO_SETTINGS_ID", "VITE_LIMBO_SETTINGS_ID")),
73
- rangeSettingsId: pickFirst(mergedInput.rangeSettingsId, env("RANGE_SETTINGS_ID", "VITE_RANGE_SETTINGS_ID")),
74
- wheelSettingsId: pickFirst(mergedInput.wheelSettingsId, env("WHEEL_SETTINGS_ID", "VITE_WHEEL_SETTINGS_ID")),
75
- pvpCoinflipRegistryId: pickFirst(mergedInput.pvpCoinflipRegistryId, env("PVP_COINFLIP_REGISTRY_ID", "VITE_PVP_COINFLIP_REGISTRY_ID"), sdkConfig?.registryIds.pvpCoinflip)
76
- };
77
- };
78
- const REQUIRED_CONFIG_KEYS_BY_GAME = {
79
- coinflip: [
80
- "coinflipPackageId",
81
- "sweethouseId",
82
- "suiCoinType",
83
- "suiPythPriceInfoObjectId"
84
- ],
85
- limbo: [
86
- "limboPackageId",
87
- "sweethouseId",
88
- "suiCoinType",
89
- "suiPythPriceInfoObjectId"
90
- ],
91
- plinko: [
92
- "plinkoPackageId",
93
- "sweethouseId",
94
- "suiCoinType",
95
- "suiPythPriceInfoObjectId"
96
- ],
97
- wheel: [
98
- "wheelPackageId",
99
- "sweethouseId",
100
- "suiCoinType",
101
- "suiPythPriceInfoObjectId"
102
- ],
103
- range: [
104
- "rangePackageId",
105
- "sweethouseId",
106
- "suiCoinType",
107
- "suiPythPriceInfoObjectId"
108
- ],
109
- "pvp-coinflip": [
110
- "pvpCoinflipPackageId",
111
- "sweethouseId",
112
- "suiCoinType"
113
- ]
114
- };
115
- const getRequiredConfigKeysForGame = (game) => REQUIRED_CONFIG_KEYS_BY_GAME[game];
116
- const inspectResolvedConfig = (input = {}) => {
117
- const config = resolveSuigarConfig(input);
118
- const configuredCurrencies = buildConfiguredCurrencies({
119
- suiCoinType: config.suiCoinType,
120
- usdcCoinType: config.usdcCoinType
121
- });
122
- const missingValues = Object.entries(config).flatMap(([key, value]) => trim(value) ? [] : [key]);
123
- return {
124
- config,
125
- configuredCurrencies,
126
- availableGames: getActiveGames().map((game) => ({
127
- ...game,
128
- mcpSupport: getMcpSupportForGame(game.id)
129
- })),
130
- missingValues,
131
- mcp: buildMcpSupportCatalog()
132
- };
133
- };
134
- const resolvePythPriceInfoId = (coinType, configInput = {}) => {
135
- const config = resolveSuigarConfig(configInput);
136
- const normalizedCoinType = normalizeCoinTypeKey(coinType);
137
- if (normalizedCoinType === normalizeCoinTypeKey(config.suiCoinType) && config.suiPythPriceInfoObjectId) return config.suiPythPriceInfoObjectId;
138
- if ([config.usdcCoinType].filter((value) => Boolean(trim(value))).map((value) => normalizeCoinTypeKey(value)).includes(normalizedCoinType) && config.usdcPythPriceInfoObjectId) return config.usdcPythPriceInfoObjectId;
139
- if (resolveCurrencyMetadata(coinType, inspectResolvedConfig(config).configuredCurrencies).symbol === "USDC" && config.usdcPythPriceInfoObjectId) return config.usdcPythPriceInfoObjectId;
140
- throw new Error(`Missing Pyth price object configuration for coin type ${coinType}`);
141
- };
142
- const resolveGamePackageId = (game, configInput = {}) => {
143
- const config = resolveSuigarConfig(configInput);
144
- switch (game) {
145
- case "coinflip": return config.coinflipPackageId;
146
- case "limbo": return config.limboPackageId;
147
- case "plinko": return config.plinkoPackageId;
148
- case "wheel": return config.wheelPackageId;
149
- case "range": return config.rangePackageId;
150
- case "pvp-coinflip": return config.pvpCoinflipPackageId;
151
- }
152
- };
153
- const resolveGameSettingsId = (game, configInput = {}) => {
154
- const config = resolveSuigarConfig(configInput);
155
- switch (game) {
156
- case "coinflip": return config.coinflipSettingsId;
157
- case "limbo": return config.limboSettingsId;
158
- case "plinko": return config.plinkoSettingsId;
159
- case "wheel": return config.wheelSettingsId;
160
- case "range": return config.rangeSettingsId;
161
- case "pvp-coinflip": return config.pvpCoinflipSettingsId;
162
- }
163
- };
164
- const assertRequiredConfig = (game, configInput = {}) => {
165
- const inspection = inspectResolvedConfig(configInput);
166
- const missing = getRequiredConfigKeysForGame(game).filter((key) => !trim(inspection.config[key]));
167
- if (missing.length > 0) throw new Error(`Missing required config for ${game}: ${missing.join(", ")}`);
168
- return inspection.config;
169
- };
170
- const buildProviderUrl = (network) => DEFAULT_PROVIDER_URL(network);
171
- const buildGraphqlUrl = (network) => DEFAULT_GRAPHQL_URL(network);
172
- const parseApiUrl = parseApiLikeUrl;
173
- //#endregion
174
- export { assertRequiredConfig, buildGraphqlUrl, buildProviderUrl, getRequiredConfigKeysForGame, inspectResolvedConfig, parseApiUrl, resolveGamePackageId, resolveGameSettingsId, resolvePythPriceInfoId, resolveSuigarConfig };
package/dist/index.cjs DELETED
@@ -1,53 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_mcp_support = require("./mcp-support.cjs");
3
- const require_config = require("./config.cjs");
4
- const require_metadata = require("./metadata.cjs");
5
- const require_coin = require("./coin.cjs");
6
- const require_client = require("./client.cjs");
7
- const require_transactions = require("./transactions.cjs");
8
- const require_tools = require("./tools.cjs");
9
- const require_server = require("./server.cjs");
10
- exports.SUPPORTED_MCP_TOOL_NAMES = require_mcp_support.SUPPORTED_MCP_TOOL_NAMES;
11
- exports.assertRequiredConfig = require_config.assertRequiredConfig;
12
- exports.buildCoinflipTransaction = require_transactions.buildCoinflipTransaction;
13
- exports.buildCoinflipTransactionTool = require_tools.buildCoinflipTransactionTool;
14
- exports.buildGraphqlUrl = require_config.buildGraphqlUrl;
15
- exports.buildLimboTransaction = require_transactions.buildLimboTransaction;
16
- exports.buildLimboTransactionTool = require_tools.buildLimboTransactionTool;
17
- exports.buildMcpSupportCatalog = require_mcp_support.buildMcpSupportCatalog;
18
- exports.buildPlinkoTransaction = require_transactions.buildPlinkoTransaction;
19
- exports.buildPlinkoTransactionTool = require_tools.buildPlinkoTransactionTool;
20
- exports.buildProviderUrl = require_config.buildProviderUrl;
21
- exports.buildPvpCoinflipCancelTransaction = require_transactions.buildPvpCoinflipCancelTransaction;
22
- exports.buildPvpCoinflipCancelTransactionTool = require_tools.buildPvpCoinflipCancelTransactionTool;
23
- exports.buildPvpCoinflipCreateTransaction = require_transactions.buildPvpCoinflipCreateTransaction;
24
- exports.buildPvpCoinflipCreateTransactionTool = require_tools.buildPvpCoinflipCreateTransactionTool;
25
- exports.buildPvpCoinflipJoinTransaction = require_transactions.buildPvpCoinflipJoinTransaction;
26
- exports.buildPvpCoinflipJoinTransactionTool = require_tools.buildPvpCoinflipJoinTransactionTool;
27
- exports.buildRangeTransaction = require_transactions.buildRangeTransaction;
28
- exports.buildRangeTransactionTool = require_tools.buildRangeTransactionTool;
29
- exports.buildWheelTransaction = require_transactions.buildWheelTransaction;
30
- exports.buildWheelTransactionTool = require_tools.buildWheelTransactionTool;
31
- exports.createReadOnlyClientBundle = require_client.createReadOnlyClientBundle;
32
- exports.createSuigarMcpServer = require_server.createSuigarMcpServer;
33
- exports.dryRunTransaction = require_client.dryRunTransaction;
34
- exports.getCurrencyInfo = require_metadata.getCurrencyInfo;
35
- exports.getGameMetadata = require_metadata.getGameMetadata;
36
- exports.getMcpSupportForGame = require_mcp_support.getMcpSupportForGame;
37
- exports.getRequiredConfigKeysForGame = require_config.getRequiredConfigKeysForGame;
38
- exports.inspectResolvedConfig = require_config.inspectResolvedConfig;
39
- exports.listConfiguredCurrencies = require_metadata.listConfiguredCurrencies;
40
- exports.listSupportedGames = require_metadata.listSupportedGames;
41
- exports.parseApiUrl = require_config.parseApiUrl;
42
- exports.readConfigMetadata = require_metadata.readConfigMetadata;
43
- exports.readConfigTool = require_tools.readConfigTool;
44
- exports.readGameMetadataTool = require_tools.readGameMetadataTool;
45
- exports.resolveBetCoin = require_coin.resolveBetCoin;
46
- exports.resolveGamePackageId = require_config.resolveGamePackageId;
47
- exports.resolveGameSettingsId = require_config.resolveGameSettingsId;
48
- exports.resolvePythPriceInfoId = require_config.resolvePythPriceInfoId;
49
- exports.resolveSuigarConfig = require_config.resolveSuigarConfig;
50
- exports.sanitizeForJson = require_client.sanitizeForJson;
51
- exports.serializeTransactionToBase64 = require_client.serializeTransactionToBase64;
52
- exports.startSuigarMcpServer = require_server.startSuigarMcpServer;
53
- exports.summarizeTransaction = require_transactions.summarizeTransaction;
package/dist/index.d.cts DELETED
@@ -1,10 +0,0 @@
1
- import { GameMcpSupport, McpExecutionSurface, SUPPORTED_MCP_TOOL_NAMES, SuigarMcpToolName, buildMcpSupportCatalog, getMcpSupportForGame } from "./mcp-support.cjs";
2
- import { BetCoinSource, BetMetadataInput, BetMetadataInputValue, BetMetadataPrimitive, BuilderMode, CasinoBetGameId, CoinReadClient, CoinSide, ConfigInspection, ReadOnlyPlan, SharedBuildOptions, SuigarConfig, SuigarConfigInput, SuigarNetwork, SupportedGameId, TransactionSummary } from "./types.cjs";
3
- import { assertRequiredConfig, buildGraphqlUrl, buildProviderUrl, getRequiredConfigKeysForGame, inspectResolvedConfig, parseApiUrl, resolveGamePackageId, resolveGameSettingsId, resolvePythPriceInfoId, resolveSuigarConfig } from "./config.cjs";
4
- import { getCurrencyInfo, getGameMetadata, listConfiguredCurrencies, listSupportedGames, readConfigMetadata } from "./metadata.cjs";
5
- import { resolveBetCoin } from "./coin.cjs";
6
- import { createReadOnlyClientBundle, dryRunTransaction, sanitizeForJson, serializeTransactionToBase64 } from "./client.cjs";
7
- import { buildCoinflipTransaction, buildLimboTransaction, buildPlinkoTransaction, buildPvpCoinflipCancelTransaction, buildPvpCoinflipCreateTransaction, buildPvpCoinflipJoinTransaction, buildRangeTransaction, buildWheelTransaction, summarizeTransaction } from "./transactions.cjs";
8
- import { buildCoinflipTransactionTool, buildLimboTransactionTool, buildPlinkoTransactionTool, buildPvpCoinflipCancelTransactionTool, buildPvpCoinflipCreateTransactionTool, buildPvpCoinflipJoinTransactionTool, buildRangeTransactionTool, buildWheelTransactionTool, readConfigTool, readGameMetadataTool } from "./tools.cjs";
9
- import { createSuigarMcpServer, startSuigarMcpServer } from "./server.cjs";
10
- export { BetCoinSource, BetMetadataInput, BetMetadataInputValue, BetMetadataPrimitive, BuilderMode, CasinoBetGameId, CoinReadClient, CoinSide, ConfigInspection, GameMcpSupport, McpExecutionSurface, ReadOnlyPlan, SUPPORTED_MCP_TOOL_NAMES, SharedBuildOptions, SuigarConfig, SuigarConfigInput, SuigarMcpToolName, SuigarNetwork, SupportedGameId, TransactionSummary, assertRequiredConfig, buildCoinflipTransaction, buildCoinflipTransactionTool, buildGraphqlUrl, buildLimboTransaction, buildLimboTransactionTool, buildMcpSupportCatalog, buildPlinkoTransaction, buildPlinkoTransactionTool, buildProviderUrl, buildPvpCoinflipCancelTransaction, buildPvpCoinflipCancelTransactionTool, buildPvpCoinflipCreateTransaction, buildPvpCoinflipCreateTransactionTool, buildPvpCoinflipJoinTransaction, buildPvpCoinflipJoinTransactionTool, buildRangeTransaction, buildRangeTransactionTool, buildWheelTransaction, buildWheelTransactionTool, createReadOnlyClientBundle, createSuigarMcpServer, dryRunTransaction, getCurrencyInfo, getGameMetadata, getMcpSupportForGame, getRequiredConfigKeysForGame, inspectResolvedConfig, listConfiguredCurrencies, listSupportedGames, parseApiUrl, readConfigMetadata, readConfigTool, readGameMetadataTool, resolveBetCoin, resolveGamePackageId, resolveGameSettingsId, resolvePythPriceInfoId, resolveSuigarConfig, sanitizeForJson, serializeTransactionToBase64, startSuigarMcpServer, summarizeTransaction };
@@ -1,62 +0,0 @@
1
- //#region src/mcp-support.ts
2
- const SUPPORTED_MCP_TOOL_NAMES = [
3
- "read_config",
4
- "read_game_metadata",
5
- "build_coinflip_transaction",
6
- "build_limbo_transaction",
7
- "build_plinko_transaction",
8
- "build_wheel_transaction",
9
- "build_range_transaction",
10
- "build_pvp_coinflip_create_transaction",
11
- "build_pvp_coinflip_join_transaction",
12
- "build_pvp_coinflip_cancel_transaction"
13
- ];
14
- const GAME_MCP_SUPPORT_BY_ID = {
15
- coinflip: {
16
- executionSurface: "onchain",
17
- toolSupported: true,
18
- primaryToolName: "build_coinflip_transaction"
19
- },
20
- limbo: {
21
- executionSurface: "onchain",
22
- toolSupported: true,
23
- primaryToolName: "build_limbo_transaction"
24
- },
25
- plinko: {
26
- executionSurface: "onchain",
27
- toolSupported: true,
28
- primaryToolName: "build_plinko_transaction"
29
- },
30
- wheel: {
31
- executionSurface: "onchain",
32
- toolSupported: true,
33
- primaryToolName: "build_wheel_transaction"
34
- },
35
- range: {
36
- executionSurface: "onchain",
37
- toolSupported: true,
38
- primaryToolName: "build_range_transaction"
39
- },
40
- "pvp-coinflip": {
41
- executionSurface: "onchain",
42
- toolSupported: true,
43
- primaryToolName: "build_pvp_coinflip_create_transaction"
44
- }
45
- };
46
- const getMcpSupportForGame = (gameId) => {
47
- const support = GAME_MCP_SUPPORT_BY_ID[gameId];
48
- if (support) return support;
49
- return {
50
- executionSurface: gameId === "slots" ? "backend" : "onchain",
51
- toolSupported: false,
52
- primaryToolName: null
53
- };
54
- };
55
- const buildMcpSupportCatalog = () => Object.freeze({
56
- serverName: "suigar",
57
- supportedToolNames: [...SUPPORTED_MCP_TOOL_NAMES]
58
- });
59
- //#endregion
60
- exports.SUPPORTED_MCP_TOOL_NAMES = SUPPORTED_MCP_TOOL_NAMES;
61
- exports.buildMcpSupportCatalog = buildMcpSupportCatalog;
62
- exports.getMcpSupportForGame = getMcpSupportForGame;