revoke_delegate
Remove a delegate's permission to transfer tokens from your wallet on the Solana blockchain. Specify the wallet name and token mint address to execute.
Instructions
Revoke a delegate's authority to transfer tokens
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| walletName | Yes | Name of the wallet that owns the tokens | |
| tokenMint | Yes | Token mint address |
Implementation Reference
- src/index.ts:1215-1243 (handler)The handler function that executes the revoke_delegate tool. It revokes delegate authority on the associated token account using the SPL token program's revoke instruction.async function handleRevokeDelegate(args: any) { const { walletName, tokenMint } = args; const wallet = wallets.get(walletName); if (!wallet) { throw new Error(`Wallet '${walletName}' not found`); } ensureConnection(); const tokenMintPubkey = new PublicKey(tokenMint); const tokenAccount = await getAssociatedTokenAddress( tokenMintPubkey, wallet.keypair.publicKey ); const signature = await revoke( connection, wallet.keypair, tokenAccount, wallet.keypair ); return { success: true, signature, explorerUrl: `https://explorer.solana.com/tx/${signature}?cluster=${currentNetwork}` }; }
- src/index.ts:506-523 (schema)The input schema and metadata for the revoke_delegate tool, used for validation and listing.{ name: "revoke_delegate", description: "Revoke a delegate's authority to transfer tokens", inputSchema: { type: "object", properties: { walletName: { type: "string", description: "Name of the wallet that owns the tokens" }, tokenMint: { type: "string", description: "Token mint address" } }, required: ["walletName", "tokenMint"] } }
- src/index.ts:1357-1358 (registration)The switch case that registers and dispatches calls to the revoke_delegate handler in the main CallToolRequestSchema handler.case "revoke_delegate": result = await handleRevokeDelegate(args);
- src/index.ts:1273-1275 (registration)The ListToolsRequestSchema handler that registers the tool by returning the tools array containing revoke_delegate.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });