This wallet package serves as the core wallet functionality for the CoinSpace application, providing essential cryptocurrency management capabilities. It's designed to be integrated into the main CoinSpace app to handle wallet operations.
To install the CS-Wallet package in your project, use npm:
npm install cs-wallet
First, import the wallet module and initialize it with your configuration:
const CSWallet = require('cs-wallet');
// Initialize a wallet with configuration
const wallet = new CSWallet({
// Required configuration options
network: 'bitcoin', // or other supported cryptocurrency network
seed: 'your-wallet-seed-phrase', // seed phrase for wallet generation
// Optional configuration
storage: customStorageImplementation, // default is in-memory
fee: customFeeHandler // for custom fee calculation
});
Once initialized, you can perform various operations with the wallet:
// Get wallet balance
wallet.getBalance((err, balance) => {
if (err) return console.error(err);
console.log('Wallet balance:', balance);
});
// Get transaction history
wallet.getTransactions((err, transactions) => {
if (err) return console.error(err);
console.log('Transaction history:', transactions);
});
// Generate a new receiving address
wallet.getNextAddress((err, address) => {
if (err) return console.error(err);
console.log('New receiving address:', address);
});
To send cryptocurrency from your wallet:
const txOptions = {
to: 'recipient-address',
amount: 100000, // amount in satoshis (for Bitcoin)
fee: 10000 // transaction fee in satoshis
};
wallet.send(txOptions, (err, txHash) => {
if (err) return console.error('Transaction failed:', err);
console.log('Transaction sent! Hash:', txHash);
});
Keeping the wallet synchronized with the blockchain:
// Start synchronizing with the network
wallet.synchronize((err) => {
if (err) return console.error('Sync failed:', err);
console.log('Wallet synchronized successfully');
});
// You can also listen for sync events
wallet.on('sync', (status) => {
console.log('Sync status:', status);
});
wallet.on('transaction', (tx) => {
console.log('New transaction detected:', tx);
});
You can customize network settings when initializing the wallet:
const wallet = new CSWallet({
network: 'bitcoin',
seed: 'your-seed-phrase',
networkSettings: {
apiUrl: 'https://custom-blockchain-api.com',
feeEstimationStrategy: 'conservative',
confirmationTarget: 6
}
});
If you need to handle multiple cryptocurrencies:
const bitcoinWallet = new CSWallet({
network: 'bitcoin',
seed: 'your-seed-phrase'
});
const ethereumWallet = new CSWallet({
network: 'ethereum',
seed: 'your-seed-phrase'
});
// You can now work with both wallets independently
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "frontend-review" '{"command":"npx","args":["serve","-s","build"]}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"frontend-review": {
"command": "npx",
"args": [
"serve",
"-s",
"build"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"frontend-review": {
"command": "npx",
"args": [
"serve",
"-s",
"build"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect