kill-switch-mcp 1.2.13 → 1.2.15

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 (2) hide show
  1. package/dist/server.js +24 -9
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -4097,14 +4097,30 @@ async function joinTournament(tournamentAddress, username) {
4097
4097
  }
4098
4098
  const keyAuth = readKeyAuthorization();
4099
4099
  const sponsorOpts = feePayerUrl ? { feePayer: true } : {};
4100
- const approveHash = await walletClient.writeContract({
4101
- address: USDC_ADDRESS,
4102
- abi: ERC20_ABI,
4103
- functionName: "approve",
4104
- args: [tournamentAddress, buyIn],
4105
- ...keyAuth ? { keyAuthorization: keyAuth } : {},
4106
- ...sponsorOpts
4107
- });
4100
+ let approveHash;
4101
+ try {
4102
+ approveHash = await walletClient.writeContract({
4103
+ address: USDC_ADDRESS,
4104
+ abi: ERC20_ABI,
4105
+ functionName: "approve",
4106
+ args: [tournamentAddress, buyIn],
4107
+ ...sponsorOpts
4108
+ });
4109
+ } catch (e) {
4110
+ if (keyAuth && e.message?.includes("KeyNotFound")) {
4111
+ approveHash = await walletClient.writeContract({
4112
+ address: USDC_ADDRESS,
4113
+ abi: ERC20_ABI,
4114
+ functionName: "approve",
4115
+ args: [tournamentAddress, buyIn],
4116
+ keyAuthorization: keyAuth,
4117
+ gas: 700000n,
4118
+ ...sponsorOpts
4119
+ });
4120
+ } else {
4121
+ throw e;
4122
+ }
4123
+ }
4108
4124
  await pub.waitForTransactionReceipt({ hash: approveHash });
4109
4125
  const usernameBytes = pad(stringToHex(username), { size: 32 });
4110
4126
  const depositHash = await walletClient.writeContract({
@@ -4112,7 +4128,6 @@ async function joinTournament(tournamentAddress, username) {
4112
4128
  abi: TOURNAMENT_ABI,
4113
4129
  functionName: "deposit",
4114
4130
  args: [usernameBytes],
4115
- ...keyAuth ? { keyAuthorization: keyAuth } : {},
4116
4131
  ...sponsorOpts
4117
4132
  });
4118
4133
  await pub.waitForTransactionReceipt({ hash: depositHash });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kill-switch-mcp",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "Kill Switch MCP Server — AI battle royale powered by Claude Code",
5
5
  "type": "module",
6
6
  "bin": {