skills/binance-auth/SKILL.md
Binance API authentication and key management for trading skills. Securely stores API keys, validates permissions, supports testnet vs production environments, and provides health checks with balance queries.
npx skillsauth add ticruz38/skills binance-authInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Authentication skill for Binance cryptocurrency exchange API. Built on top of auth-provider for secure API key storage and management. Supports both Binance production and testnet environments.
npm install
npm run build
No environment variables required - API keys are configured per-profile via CLI.
node dist/cli.js status
# Production environment
node dist/cli.js connect prod \
--key YOUR_API_KEY \
--secret YOUR_API_SECRET \
--env production
# Testnet environment
node dist/cli.js connect test \
--key YOUR_API_KEY \
--secret YOUR_API_SECRET \
--env testnet
# Check specific profile
node dist/cli.js health prod
# Check all profiles
node dist/cli.js health
node dist/cli.js list
node dist/cli.js balance prod
node dist/cli.js validate prod
node dist/cli.js disconnect prod
import { BinanceAuthClient, getBinanceAuth } from '@openclaw/binance-auth';
// Create client for specific profile
const binance = new BinanceAuthClient('prod');
// Or use singleton
const binance = getBinanceAuth('prod');
const result = await binance.connect({
apiKey: 'your-api-key',
apiSecret: 'your-api-secret',
environment: 'production', // or 'testnet'
});
if (result.success) {
console.log('Connected! Permissions:', result.permissions);
}
const isConnected = await binance.isConnected();
console.log('Connected:', isConnected);
const credentials = await binance.getCredentials();
if (credentials) {
console.log('API Key:', credentials.apiKey);
console.log('Environment:', credentials.environment);
}
const health = await binance.healthCheck();
console.log('Status:', health.status); // 'healthy' | 'unhealthy'
console.log('Message:', health.message);
const balance = await binance.getBalance();
if (balance) {
console.log('Total BTC:', balance.totalBTC);
console.log('Balances:', balance.balances);
console.log('Permissions:', balance.permissions);
}
const validation = await binance.validatePermissions();
console.log('Valid:', validation.valid);
console.log('Can Trade:', validation.canTrade);
console.log('Can Withdraw:', validation.canWithdraw);
console.log('Permissions:', validation.permissions);
const disconnected = await binance.disconnect();
console.log('Disconnected:', disconnected);
Binance API keys can have the following permissions:
SPOT - Spot tradingMARGIN - Margin tradingFUTURES - Futures tradingDELIVERY - Coin-margined futuresPERM - Permanent API keyIP_RESTRICTED - IP-restricted accesshttps://api.binance.comhttps://testnet.binance.visionCredentials are stored in the auth-provider database:
~/.openclaw/skills/auth-provider/credentials.db
API keys are encrypted with AES-256.
interface BinanceCredentials {
apiKey: string;
apiSecret: string;
environment: 'production' | 'testnet';
permissions?: string[];
}
interface BinanceConnectionResult {
success: boolean;
permissions?: string[];
canTrade?: boolean;
canWithdraw?: boolean;
error?: string;
}
interface BinanceBalance {
totalBTC: string;
balances: Array<{
asset: string;
free: string;
locked: string;
}>;
permissions: string[];
}
interface BinanceValidationResult {
valid: boolean;
permissions: string[];
canTrade: boolean;
canWithdraw: boolean;
}
try {
await binance.connect({ apiKey, apiSecret, environment: 'production' });
} catch (error) {
if (error.message.includes('Invalid API key')) {
// API key format is invalid
} else if (error.message.includes('API key validation failed')) {
// Key rejected by Binance
}
}
# Type checking
npm run typecheck
# Build
npm run build
# Run CLI
npm run cli -- status
@openclaw/auth-provider - Secure credential storagetesting
Suggest recipes based on dietary preferences, available ingredients, and cuisine preferences
development
Extract data from receipt photos using Google Vision API
business
QuickBooks Online integration for accounting sync - sync customers, invoices, and transactions with two-way sync and conflict resolution
testing
QuickBooks OAuth adapter for QuickBooks Online accounting integration. Built on top of auth-provider for secure token management with automatic refresh, multi-profile support, sandbox/production toggle, and health checks.