get_current_wallet
Retrieve active wallet details using the Rootstock MCP Server, enabling quick access to blockchain asset management and transaction data.
Instructions
Get the current active wallet information
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:833-848 (handler)The main handler function for the 'get_current_wallet' tool. It retrieves the current wallet address and detailed information using the WalletManager and formats the response.private async handleGetCurrentWallet() { try { const address = this.walletManager.getCurrentAddress(); const walletInfo = this.walletManager.getWalletInfo(address); return { content: [ { type: 'text', text: `Current Wallet:\n\nAddress: ${walletInfo.address}\nPublic Key: ${walletInfo.publicKey}\nPrivate Key: ${walletInfo.privateKey}`, }, ], }; } catch (error) { throw new Error(`Failed to get current wallet: ${error}`); } }
- src/index.ts:398-405 (schema)Schema definition for the 'get_current_wallet' tool in the list of available tools, specifying no input parameters.{ name: 'get_current_wallet', description: 'Get the current active wallet information', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:126-127 (registration)Registration and dispatch point in the CallToolRequestSchema handler switch statement that routes calls to the tool handler.case 'get_current_wallet': return await this.handleGetCurrentWallet();
- src/wallet-manager.ts:134-139 (helper)Core helper method in WalletManager that retrieves the current wallet object, used extensively across tool handlers.getCurrentWallet(): ethers.Wallet | ethers.HDNodeWallet { if (!this.currentWallet) { throw new Error('No current wallet set'); } return this.getWallet(this.currentWallet); }
- src/wallet-manager.ts:183-188 (helper)Helper method directly used by the tool handler to get the current wallet address.getCurrentAddress(): string { if (!this.currentWallet) { throw new Error('No current wallet set'); } return this.wallets.get(this.currentWallet)!.address; }