kill-switch-mcp 1.2.6 → 1.2.7
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/dist/server.js +14 -15
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -15,6 +15,7 @@ import { existsSync as existsSync3 } from "fs";
|
|
|
15
15
|
import { readFile as readFile2 } from "fs/promises";
|
|
16
16
|
import { join as join3 } from "path";
|
|
17
17
|
import { homedir as homedir3 } from "os";
|
|
18
|
+
import { exec } from "child_process";
|
|
18
19
|
|
|
19
20
|
// src/sdk/types.ts
|
|
20
21
|
var PRAYER_NAMES = [
|
|
@@ -3851,24 +3852,16 @@ import {
|
|
|
3851
3852
|
createWalletClient,
|
|
3852
3853
|
http,
|
|
3853
3854
|
formatUnits,
|
|
3854
|
-
defineChain,
|
|
3855
3855
|
stringToHex,
|
|
3856
3856
|
pad
|
|
3857
3857
|
} from "viem";
|
|
3858
3858
|
import { privateKeyToAccount, generatePrivateKey } from "viem/accounts";
|
|
3859
3859
|
import { Account } from "viem/tempo";
|
|
3860
|
+
import { tempoModerato, tempo } from "viem/chains";
|
|
3860
3861
|
var WALLET_DIR = join2(homedir2(), ".killswitch");
|
|
3861
3862
|
var WALLET_FILE = join2(WALLET_DIR, "access-key.json");
|
|
3862
|
-
var TEMPO_RPC = process.env.TEMPO_RPC_URL || "https://rpc.moderato.tempo.xyz";
|
|
3863
3863
|
var TEMPO_CHAIN_ID = parseInt(process.env.TEMPO_CHAIN_ID || "42431");
|
|
3864
|
-
var tempoChain =
|
|
3865
|
-
id: TEMPO_CHAIN_ID,
|
|
3866
|
-
name: TEMPO_CHAIN_ID === 4217 ? "Tempo" : "Tempo Testnet",
|
|
3867
|
-
nativeCurrency: { name: "USD", symbol: "USD", decimals: 18 },
|
|
3868
|
-
rpcUrls: {
|
|
3869
|
-
default: { http: [TEMPO_RPC] }
|
|
3870
|
-
}
|
|
3871
|
-
});
|
|
3864
|
+
var tempoChain = TEMPO_CHAIN_ID === 4217 ? tempo : tempoModerato;
|
|
3872
3865
|
var USDC_ADDRESS = process.env.USDC_ADDRESS || "0x20c0000000000000000000000000000000000000";
|
|
3873
3866
|
var FACTORY_ADDRESS = process.env.FACTORY_ADDRESS;
|
|
3874
3867
|
var PENDING_FILE = join2(WALLET_DIR, "pending-wallet.json");
|
|
@@ -4131,6 +4124,13 @@ async function joinTournament(tournamentAddress, username) {
|
|
|
4131
4124
|
}
|
|
4132
4125
|
|
|
4133
4126
|
// src/server.ts
|
|
4127
|
+
function openInBrowser(url) {
|
|
4128
|
+
const command = process.platform === "darwin" ? `open "${url}"` : process.platform === "win32" ? `start "" "${url}"` : `xdg-open "${url}"`;
|
|
4129
|
+
exec(command, (error) => {
|
|
4130
|
+
if (error)
|
|
4131
|
+
console.error(`[MCP] Failed to open browser: ${error.message}`);
|
|
4132
|
+
});
|
|
4133
|
+
}
|
|
4134
4134
|
var SERVER_URL2 = (() => {
|
|
4135
4135
|
const idx = process.argv.indexOf("--server");
|
|
4136
4136
|
if (idx !== -1 && process.argv[idx + 1])
|
|
@@ -5171,6 +5171,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
5171
5171
|
};
|
|
5172
5172
|
}
|
|
5173
5173
|
const { accessKeyAddress, authorizeUrl } = initiateWalletSetup();
|
|
5174
|
+
openInBrowser(authorizeUrl);
|
|
5174
5175
|
return {
|
|
5175
5176
|
content: [{
|
|
5176
5177
|
type: "text",
|
|
@@ -5179,18 +5180,16 @@ server.setRequestHandler(CallToolRequestSchema, async (request, extra) => {
|
|
|
5179
5180
|
"",
|
|
5180
5181
|
`Access key: ${accessKeyAddress}`,
|
|
5181
5182
|
"",
|
|
5182
|
-
"
|
|
5183
|
+
"A browser window has been opened to set up your wallet.",
|
|
5183
5184
|
"",
|
|
5184
|
-
`
|
|
5185
|
+
`If it didn't open, use this link: ${authorizeUrl}`,
|
|
5185
5186
|
"",
|
|
5186
|
-
"
|
|
5187
|
+
"In the browser:",
|
|
5187
5188
|
"1. Create a Tempo account using Face ID / Touch ID (or sign in)",
|
|
5188
5189
|
"2. Authorize Kill Switch to manage game deposits (one tap)",
|
|
5189
5190
|
"",
|
|
5190
5191
|
"No wallet app needed — just your browser and biometrics.",
|
|
5191
5192
|
"",
|
|
5192
|
-
"━━━ AFTER YOU'RE DONE ━━━",
|
|
5193
|
-
"",
|
|
5194
5193
|
"Come back here and run setup_game_wallet again to confirm."
|
|
5195
5194
|
].join(`
|
|
5196
5195
|
`)
|