create_wallet
Generate a new Solana wallet with a custom name to manage blockchain assets and execute transactions on the Solana network.
Instructions
Create a new Solana wallet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name for the wallet |
Implementation Reference
- src/index.ts:74-87 (registration)Tool registration in the tools array, defining name, description, and input schema for create_wallet.{ name: "create_wallet", description: "Create a new Solana wallet", inputSchema: { type: "object", properties: { name: { type: "string", description: "Name for the wallet" } }, required: ["name"] } },
- src/index.ts:527-545 (handler)The handler function that creates a new Solana wallet by generating a Keypair, storing it in the wallets map under the given name, and returning the wallet details including address and base58-encoded private key.async function handleCreateWallet(args: any) { const { name } = args; if (wallets.has(name)) { throw new Error(`Wallet with name '${name}' already exists`); } const keypair = Keypair.generate(); wallets.set(name, { keypair, name }); return { success: true, wallet: { name, address: keypair.publicKey.toString(), privateKey: bs58.encode(keypair.secretKey) } }; }
- src/index.ts:1285-1287 (registration)Switch case in the CallToolRequestSchema handler that dispatches to the create_wallet handler function.case "create_wallet": result = await handleCreateWallet(args); break;