web3_signup
Create a free 0xArchive account and obtain an API key by providing a signed SIWE message and its EIP-191 signature.
Instructions
Create a free-tier 0xArchive account and get an API key using a signed SIWE message. Requires a challenge from web3_challenge signed with personal_sign (EIP-191). Returns an API key that can be used with all other tools.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The SIWE message from web3_challenge | |
| signature | Yes | Hex-encoded signature from personal_sign (0x-prefixed, 65 bytes) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | Result data object |
Implementation Reference
- src/index.ts:2115-2153 (handler)The 'web3_signup' tool handler — registered via server.registerTool with input schema (message, signature), calls the SDK's api().web3.signup() or fallback direct fetch to POST https://api.0xarchive.io/v1/web3/signup. Returns the API key result.
server.registerTool( "web3_signup", { description: "Create a free-tier 0xArchive account and get an API key using a signed SIWE message. " + "Requires a challenge from web3_challenge signed with personal_sign (EIP-191). " + "Returns an API key that can be used with all other tools.", inputSchema: { message: z.string().describe("The SIWE message from web3_challenge"), signature: z.string().describe("Hex-encoded signature from personal_sign (0x-prefixed, 65 bytes)"), }, outputSchema: ObjectOutputSchema, annotations: AUTH_TOOL_ANNOTATIONS, }, async (params: any) => { try { if (client) { const data = await api().web3.signup(params.message, params.signature); return formatResponse(data); } const response = await fetch("https://api.0xarchive.io/v1/web3/signup", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify({ message: params.message, signature: params.signature }), }); const data = await response.json(); if (!response.ok) { return { content: [{ type: "text" as const, text: `Error: ${data.error || "Signup failed"}` }], isError: true, }; } return formatResponse(data); } catch (err) { const error = err instanceof OxArchiveError ? err : new OxArchiveError(String(err), 500); return formatError(error); } } ); - src/index.ts:2065-2070 (helper)AUTH_TOOL_ANNOTATIONS — overrides the default read-only annotations for Web3 auth tools (including web3_signup) since these tools are not read-only.
const AUTH_TOOL_ANNOTATIONS = { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: true, } as const; - src/index.ts:2061-2062 (registration)Section header 'Tool Registration — Web3 Authentication' marking where web3_signup is registered.
// Tool Registration — Web3 Authentication // ---------------------------------------------------------------------------