get_nonce
Generate a cryptographic nonce to verify wallet owner signatures for secure authentication in blockchain transactions.
Instructions
Get a nonce for owner wallet signature verification.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wallet_id | No | Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet. |
Implementation Reference
- The handler function that calls the /v1/nonce API to retrieve the nonce.
async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('walletId', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/nonce' + (qs ? '?' + qs : '')); return toToolResult(result); }, - Zod schema defining the input arguments for the get_nonce tool.
{ wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), }, - packages/mcp/src/tools/get-nonce.ts:10-25 (registration)Registration function that defines the get_nonce tool in the MCP server.
export function registerGetNonce(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void { server.tool( 'get_nonce', withWalletPrefix('Get a nonce for owner wallet signature verification.', walletContext?.walletName), { wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'), }, async (args) => { const params = new URLSearchParams(); if (args.wallet_id) params.set('walletId', args.wallet_id); const qs = params.toString(); const result = await apiClient.get('/v1/nonce' + (qs ? '?' + qs : '')); return toToolResult(result); }, ); }