Skip to content

Commit 9dc333d

Browse files
MajorTalclaude
andcommitted
Fix SIWX payload format: CAIP-2 chainId, eip191 type, add statement
The server expects chainId as CAIP-2 string ("eip155:84532"), type as "eip191" (the signing scheme), and statement in the payload JSON so it can reconstruct the SIWE message for signature verification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 5a544e1 commit 9dc333d

5 files changed

Lines changed: 10 additions & 8 deletions

File tree

cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "run402",
3-
"version": "1.12.1",
3+
"version": "1.12.2",
44
"description": "CLI for Run402 — provision Postgres databases, deploy static sites, generate images, and manage wallets via x402 micropayments.",
55
"type": "module",
66
"bin": {

core/src/allowance-auth.test.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ describe("getAllowanceAuthHeaders", () => {
105105
assert.equal(decoded.address, TEST_ADDRESS);
106106
assert.equal(decoded.uri, "https://api.run402.com/projects/v1");
107107
assert.equal(decoded.version, "1");
108-
assert.equal(decoded.chainId, 84532);
109-
assert.equal(decoded.type, "eip4361");
108+
assert.equal(decoded.statement, "Sign in to Run402");
109+
assert.equal(decoded.chainId, "eip155:84532");
110+
assert.equal(decoded.type, "eip191");
110111
assert.ok(decoded.nonce);
111112
assert.ok(decoded.issuedAt);
112113
assert.ok(decoded.expirationTime);

core/src/allowance-auth.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,11 @@ export function getAllowanceAuthHeaders(path: string, allowancePath?: string): S
142142
const payload = {
143143
domain,
144144
address: toChecksumAddress(allowance.address),
145+
statement: "Sign in to Run402",
145146
uri,
146147
version: "1",
147-
chainId: 84532,
148-
type: "eip4361",
148+
chainId: "eip155:84532",
149+
type: "eip191",
149150
nonce,
150151
issuedAt,
151152
expirationTime,

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "run402-mcp",
3-
"version": "1.12.1",
3+
"version": "1.12.2",
44
"description": "MCP server for Run402 — AI-native Postgres databases with REST API, auth, storage, and row-level security. Pay with x402 USDC micropayments.",
55
"type": "module",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)