{"id":30116999,"url":"https://github.com/albedosehen/robinhood-crypto-client","last_synced_at":"2025-08-10T10:35:27.187Z","repository":{"id":305630390,"uuid":"1023329007","full_name":"albedosehen/robinhood-crypto-client","owner":"albedosehen","description":"Ready to use client library for the Robinhood Crypto API. Built with Deno and designed for security, reliability, and ease of use.","archived":false,"fork":false,"pushed_at":"2025-07-21T06:54:40.000Z","size":99,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-21T08:15:08.793Z","etag":null,"topics":["robinhood-api","robinhood-crypto"],"latest_commit_sha":null,"homepage":"https://jsr.io/@albedosehen/robinhood-crypto-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/albedosehen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-21T02:09:07.000Z","updated_at":"2025-07-21T06:58:53.000Z","dependencies_parsed_at":"2025-07-21T08:15:35.068Z","dependency_job_id":"dd2f4623-ce1c-4100-8896-b0633f87b1bf","html_url":"https://github.com/albedosehen/robinhood-crypto-client","commit_stats":null,"previous_names":["albedosehen/robinhood-crypto-client"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/albedosehen/robinhood-crypto-client","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albedosehen%2Frobinhood-crypto-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albedosehen%2Frobinhood-crypto-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albedosehen%2Frobinhood-crypto-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albedosehen%2Frobinhood-crypto-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/albedosehen","download_url":"https://codeload.github.com/albedosehen/robinhood-crypto-client/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/albedosehen%2Frobinhood-crypto-client/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269712069,"owners_count":24463206,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["robinhood-api","robinhood-crypto"],"created_at":"2025-08-10T10:35:26.625Z","updated_at":"2025-08-10T10:35:27.163Z","avatar_url":"https://github.com/albedosehen.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Robinhood Crypto Client\n\n[![Build Status](https://img.shields.io/badge/Build-passing-brightgreen.svg)](https://github.com/albedosehen/robinhood-crypto-client) [![Deno Version](https://img.shields.io/badge/Deno-v2.4.1-green)](https://deno.land/) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) [![JSR](https://jsr.io/badges/@albedosehen/robinhood-crypto-client)](https://jsr.io/@albedosehen/robinhood-crypto-client)\n\nA comprehensive, production-ready TypeScript client library for the Robinhood Crypto API. Built with Deno and designed for security, reliability, and ease of use.\n\n## ✨ Features\n\n### 🔐 **Authentication \u0026 Security**\n\n- **Ed25519 digital signatures** using Deno's Web Crypto API\n- **Automatic request signing** with message integrity validation\n- **Secure credential management** with environment variable support\n- **Sanitized error handling** to prevent key leakage\n\n### 🚦 **Rate Limiting \u0026 Reliability**\n\n- **Token bucket rate limiting** (100 requests/minute, 300 burst capacity)\n- **Exponential backoff** with jitter for failed requests\n- **Automatic retry logic** with configurable policies\n- **Connection pooling** via Deno's native fetch\n\n### 📊 **Complete API Coverage**\n\n- **Account Management** - Details, balance, permissions, status\n- **Market Data** - Real-time quotes, estimated prices, spreads\n- **Trading Operations** - Orders (market/limit), holdings, cancellation\n- **Portfolio Management** - Summary, balance tracking, holdings\n\n### 🛠️ **Developer Experience**\n\n- **Full TypeScript support** with strict type checking\n- **Comprehensive error handling** with detailed error codes\n- **Pagination support** for large data sets\n- **Debug logging** for development and troubleshooting\n- **185+ unit and integration tests** with excellent coverage\n\n## 🚀 Quick Start\n\n### Installation\n\n```bash\n# Using Deno\nimport { CryptoClient } from 'jsr:@albedosehen/robinhood-crypto-client'\n\n# Or add to deno.json imports\n{\n  \"imports\": {\n    \"@robinhood/crypto\": \"jsr:@albedosehen/robinhood-crypto-client\"\n  }\n}\n```\n\n### Basic Usage\n\n```typescript\nimport { CryptoClient } from '@robinhood/crypto'\n\n// Initialize client with credentials\nconst client = new CryptoClient({\n  apiKey: Deno.env.get('RH_CRYPTO_API_KEY')!,\n  secretKey: Deno.env.get('RH_CRYPTO_SECRET_KEY')!\n})\n\n// Test connectivity\nconst status = await client.testClientConnections()\nconsole.log('Available endpoints:', status.endpoints)\n\n// Get account information\nconst account = await client.account.getAccountDetails()\nconsole.log('Account status:', account.status)\nconsole.log('Buying power:', account.buying_power, account.buying_power_currency)\n\n// Get real-time market data\nconst quotes = await client.marketData.getBestBidAsk(['BTC-USD', 'ETH-USD'])\nfor (const quote of quotes.results) {\n  console.log(`${quote.symbol}: $${quote.mid_price}`)\n}\n\n// Get your crypto holdings\nconst holdings = await client.trading.getHoldings()\nfor (const holding of holdings.results) {\n  console.log(`${holding.asset_code}: ${holding.quantity}`)\n}\n```\n\n## Crypto Client\n\n### Client Initialization\n\n```typescript\nconst client = new CryptoClient({\n  apiKey: 'your-api-key',           // Required: Your Robinhood API key\n  secretKey: 'your-secret-key',     // Required: Base64-encoded private key\n  baseUrl: 'https://api.robinhood.com', // Optional: API base URL\n  timeout: 30000,                   // Optional: Request timeout (ms)\n  debug: false,                     // Optional: Enable debug logging\n  rateLimit: {                      // Optional: Rate limiting config\n    maxRequests: 100,               // Requests per minute\n    burstCapacity: 300,             // Burst allowance\n    windowMs: 60000                 // Rate limit window\n  }\n})\n```\n\n### Environment Variables\n\nSet your credentials using environment variables:\n\n```bash\nexport RH_CRYPTO_API_KEY=\"your-api-key\"\nexport RH_CRYPTO_SECRET_KEY=\"your-base64-encoded-private-key\"\n```\n\nThen initialize without explicit credentials:\n\n```typescript\nconst client = new CryptoClient() // Automatically loads from env vars\n```\n\n## 🔧 API Reference\n\n### Account Operations\n\n```typescript\n// Get account details\nconst account = await client.account.getAccountDetails()\n\n// Get account summary with metadata\nconst summary = await client.account.getAccountSummary()\n\n// Check account status\nconst isActive = await client.account.isAccountActive()\n\n// Get buying power\nconst buyingPower = await client.account.getBuyingPower()\n```\n\n### Market Data Operations\n\n```typescript\n// Get best bid/ask prices\nconst quotes = await client.marketData.getBestBidAsk(['BTC-USD'])\n\n// Get estimated execution price\nconst estimate = await client.marketData.getEstimatedPrice({\n  symbol: 'BTC-USD',\n  side: 'ask',      // 'bid' for sell, 'ask' for buy\n  quantities: ['0.1', '1.0']\n})\n\n// Get current market price\nconst btcPrice = await client.marketData.getCurrentPrice('BTC-USD')\n\n// Get bid-ask spread\nconst spread = await client.marketData.getSpread('BTC-USD')\n```\n\n### Trading Operations\n\n```typescript\n// Get trading pairs\nconst pairs = await client.trading.getTradingPairs(['BTC-USD'])\n\n// Get your holdings\nconst holdings = await client.trading.getHoldings(['BTC', 'ETH'])\n\n// Place a market buy order\nconst order = await client.trading.placeMarketBuyOrder({\n  symbol: 'BTC-USD',\n  assetQuantity: '0.001'  // Buy 0.001 BTC\n})\n\n// Place a limit sell order\nconst limitOrder = await client.trading.placeLimitSellOrder({\n  symbol: 'ETH-USD',\n  limitPrice: '3000.00',\n  assetQuantity: '1.0'\n})\n\n// Get order status\nconst orderDetails = await client.trading.getOrder(order.id)\n\n// Cancel an order\nconst cancellation = await client.trading.cancelOrder(order.id)\n\n// Get open orders\nconst openOrders = await client.trading.getOpenOrders()\n\n// Get portfolio summary\nconst portfolio = await client.trading.getPortfolioSummary()\n```\n\n## 🛡️ Error Handling\n\nThe client provides comprehensive error handling with specific error types:\n\n```typescript\nimport {\n  AuthenticationError,\n  RateLimitError,\n  ValidationError,\n  NetworkError,\n  ApiError\n} from '@robinhood/crypto'\n\ntry {\n  const account = await client.account.getAccountDetails()\n} catch (error) {\n  if (error instanceof AuthenticationError) {\n    console.log('Invalid credentials:', error.message)\n  } else if (error instanceof RateLimitError) {\n    console.log('Rate limit exceeded, retry after:', error.retryAfter)\n  } else if (error instanceof ValidationError) {\n    console.log('Invalid request parameters:', error.message)\n  } else if (error instanceof NetworkError) {\n    console.log('Network connectivity issue:', error.message)\n  } else if (error instanceof ApiError) {\n    console.log('API error:', error.code, error.message)\n  }\n}\n```\n\n## ⚙️ Configuration\n\n### Rate Limiting\n\nThe client includes intelligent rate limiting to prevent API throttling:\n\n```typescript\nconst client = new CryptoClient({\n  apiKey: 'your-key',\n  secretKey: 'your-secret',\n  rateLimit: {\n    maxRequests: 100,     // Requests per minute (default: 100)\n    burstCapacity: 300,   // Burst allowance (default: 300)\n    windowMs: 60000       // Rate window in ms (default: 60000)\n  }\n})\n\n// Check rate limiter status\nconst status = client.getRateLimiterStatus()\nconsole.log('Remaining requests:', status.remainingRequests)\nconsole.log('Reset time:', status.resetTime)\n\n// Reset rate limiter (useful for testing)\nclient.resetRateLimiter()\n```\n\n### Debug Mode\n\nEnable debug logging to monitor API interactions:\n\n```typescript\nconst client = new CryptoClient({\n  apiKey: 'your-key',\n  secretKey: 'your-secret',\n  debug: true  // Enables detailed logging\n})\n\n// Check if debug mode is enabled\nconst debugEnabled = client.isDebugEnabled()\n```\n\n## Documentation\n\n- **[Getting Started Guide](docs/getting-started.md)** - Step-by-step setup instructions\n- **[Usage Examples](docs/examples.md)** - Practical code examples\n- **[API Reference](docs/api-reference.md)** - Complete method documentation\n- **[Advanced Topics](docs/advanced.md)** - Authentication, rate limiting, error handling\n- **[Architecture](docs/architecture/core.md)** - Technical implementation details\n\n## 🧪 Testing\n\nRun the comprehensive test suite:\n\n```bash\n# Run all tests\ndeno task test\n\n# Run with coverage\ndeno task test:coverage\n\n# Run unit tests only\ndeno task test:unit\n\n# Run integration tests\ndeno task test:integration\n\n# Run tests in watch mode\ndeno task test:watch\n```\n\n## 🔒 Security Considerations\n\n### Credential Management\n\n- **Never log or expose private keys** in production code\n- **Use environment variables** for credential storage\n- **Rotate API keys regularly** as per security best practices\n- **Monitor API usage** for unauthorized access\n\n### Request Security\n\n- All requests are **signed with Ed25519 signatures**\n- **Timestamp validation** prevents replay attacks (30-second window)\n- **Message integrity** is validated on every request\n- **Error messages are sanitized** to prevent key leakage\n\n## 🤝 Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.\n\n### Development Setup\n\n```bash\n# Clone the repository\ngit clone https://github.com/albedosehen/robinhood-crypto-client.git\ncd robinhood-crypto-client\n\n# Run tests\ndeno task test\n\n# Format code\ndeno fmt\n\n# Lint code\ndeno lint\n```\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Need Help?\n\n- **Documentation**: Check the [docs](docs/) directory for detailed guides\n- **Issues**: Report bugs and feature requests on [GitHub Issues](https://github.com/albedosehen/robinhood-crypto-client/issues)\n\n---\n\n## ⚠️ Disclaimer ⚠️\n\nThis client library is provided as-is for educational and development purposes. You assume all risks associated with using this library, including any financial risks related to trading operations. Always test thoroughly in a sandbox environment before using with real funds.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbedosehen%2Frobinhood-crypto-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falbedosehen%2Frobinhood-crypto-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falbedosehen%2Frobinhood-crypto-client/lists"}