revoke_delegate
Remove a delegate's permission to transfer tokens from your wallet, ensuring only you control token movements.
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)Implements the revoke_delegate tool logic: retrieves the wallet and associated token account, then uses Solana's SPL token `revoke` instruction to remove delegate authority and returns the transaction signature.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)Defines the input schema for the revoke_delegate tool, requiring walletName and tokenMint parameters.{ 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-1359 (registration)Registers the revoke_delegate tool handler by dispatching to handleRevokeDelegate in the main CallToolRequestSchema handler switch statement.case "revoke_delegate": result = await handleRevokeDelegate(args); break;