{"openapi":"3.0.0","info":{"title":"Tradegrub Published API","version":"v1","description":"The Tradegrub API provides everything you need to connect to market data and manage your trading activities across multiple exchanges.\n\n**Base URL:** `https://api.tradegrub.com`\n\n**Authentication:** All endpoints require HTTP Basic Auth using your API key (username) and secret key (password)."},"servers":[{"url":"https://api.tradegrub.com","description":"Production"}],"tags":[{"name":"General","description":"Core market data — list exchanges, browse markets, fetch tickers, pull OHLCV candles, chart history, and currency rates."},{"name":"Fundamentals","description":"Balance sheets, income statements, and on-chain metrics for stocks (SEC filings) and crypto assets."},{"name":"News","description":"Latest headlines and articles for any stock or crypto symbol."},{"name":"Signals","description":"Receive TradingView-style webhook alerts and auto-execute trades on connected exchanges."},{"name":"Auth","description":"Link an exchange account by submitting API credentials and receiving a session token."},{"name":"Orders","description":"Place, list, and cancel orders. View positions, balances, and trade history."},{"name":"Quotes","description":"Quote/OHLCV data from specific sources"},{"name":"Risk","description":"Create portfolio rules that monitor conditions and trigger alerts or auto-trades."},{"name":"Wallet","description":"Generate wallets, check balances, send transactions, and view history on supported blockchains."}],"paths":{"/v1/exchange/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the API is up.","tags":["General"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingResponse"},"example":{"success":"pong"}}}}}}},"/v1/exchanges":{"get":{"summary":"List Exchanges","description":"Returns every exchange supported by Tradegrub (e.g., alpaca, binance, coinbase).","tags":["General"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"List of supported exchange names","content":{"application/json":{"schema":{"type":"array","items":{"type":"string"}},"example":["alpaca","binance","binanceus","coinbase","kraken","bitfinex"]}}}}}},"/v1/exchange/{exchange_name}/markets":{"get":{"summary":"List Markets","description":"Returns all trading pairs on an exchange with their limits, precision, and base/quote info.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"responses":{"200":{"description":"List of markets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"example":[{"base":"BTC","exchange":"binance","id":"BTCUSDT","info":{"baseCurrency":"BTC","maxBaseOrderSize":"10","minOrderValue":"1","pricePrecision":"2"},"limits":{"amount":{"max":100,"min":0.001},"cost":{"max":10000,"min":1}},"precision":{"amount":2,"price":2},"quote":"USDT","symbol":"BTC/USDT"}]}}}}}},"/v1/exchange/{exchange_name}/currencies":{"get":{"summary":"List Currencies","description":"Returns all currencies on an exchange with deposit/withdrawal limits, fees, and network info.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"responses":{"200":{"description":"Map of currency code to currency details","content":{"application/json":{"schema":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/Currency"}}}}}}}},"/v1/exchange/{exchange_name}/tickers":{"get":{"summary":"Get Tickers","description":"Returns live price, high, low, and volume for trading pairs. Optionally filter by symbol.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"symbol","in":"query","schema":{"type":"string"},"example":"BTC"}],"responses":{"200":{"description":"Ticker data","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Ticker"}}}},"example":{"success":true,"data":[{"symbol":"BTC-USDT","last":"45000.00","high":"46000.00","low":"44000.00","volume":"1200"}]}}}}}}},"/v1/exchange/{exchange_name}/OHLCV":{"get":{"summary":"Get OHLCV","description":"Returns candlestick data (open, high, low, close, volume) for a symbol at the specified frequency and period.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"example":"BTC/USDT"},{"name":"frequency","in":"query","required":true,"schema":{"type":"integer"},"example":5,"description":"Time interval for each candle"},{"name":"frequencyType","in":"query","required":true,"schema":{"type":"string","enum":["minute","hour","day","week","month"]},"example":"minute","description":"Unit of the frequency"},{"name":"period","in":"query","required":true,"schema":{"type":"integer"},"example":1,"description":"Duration of data to retrieve"},{"name":"periodType","in":"query","required":true,"schema":{"type":"string","enum":["day","week","month","year"]},"example":"day","description":"Unit of the period"}],"responses":{"200":{"description":"OHLCV candle data","content":{"application/json":{"schema":{"type":"object","properties":{"candles":{"type":"array","items":{"$ref":"#/components/schemas/Candle"}}}},"example":{"candles":[{"open":125078.95,"high":125078.95,"low":125000.01,"close":125000.01,"volume":26.56693,"datetime":1759647300000}]}}}}}}},"/v1/exchange/{exchange_name}/charts":{"get":{"summary":"Get Chart Data","description":"Returns historical candlestick data between two timestamps. Use `from`/`to` as epoch milliseconds.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"example":"BTC/USDT"},{"name":"frequency","in":"query","required":true,"schema":{"type":"integer"},"example":1,"description":"Time interval for each candle"},{"name":"frequencyType","in":"query","required":true,"schema":{"type":"string","enum":["minute","hour","day","week","month"]},"example":"hour","description":"Unit of the frequency"},{"name":"from","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"example":1715695197000,"description":"Start timestamp in milliseconds since epoch"},{"name":"to","in":"query","required":true,"schema":{"type":"integer","format":"int64"},"example":1720432797000,"description":"End timestamp in milliseconds since epoch"}],"responses":{"200":{"description":"Chart data","content":{"application/json":{"schema":{"type":"object","properties":{"candles":{"type":"array","description":"Each candle is an array: [timestamp, open, high, low, close, volume]","items":{"type":"array","items":{"type":"number"}}},"empty":{"type":"boolean","description":"true if no data found for the given parameters"},"symbol":{"type":"string"}}},"example":{"candles":[[1738274400000,105200.01,105350,105094.57,105094.57,279.52567],[1738278000000,105094.57,105254,104693.82,104722.94,395.49962]],"empty":false,"symbol":"BTC/USDT"}}}}}}},"/v1/exchange/{exchange_name}/rates":{"get":{"summary":"Get Rates","description":"Returns fiat and crypto exchange rates relative to USD.","tags":["General"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"responses":{"200":{"description":"Exchange rates","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Rate"}},"timestamp":{"type":"integer"}}},"example":{"data":[{"currencySymbol":"$","id":"us-dollar","rateUsd":1,"symbol":"USD","type":"fiat"}],"timestamp":1633036800}}}}}}},"/v1/fundamentals/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the Fundamentals service is up.","tags":["Fundamentals"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"text/plain":{"schema":{"type":"string"},"example":"pong"}}}}}},"/v1/fundamentals":{"get":{"summary":"Get Fundamentals","description":"Returns financials (stocks) or on-chain data (crypto). Use `EXCHANGE:TICKER` format — e.g., `NASDAQ:AAPL` or `BINANCE:BTCUSDT`. Pass `EXCHANGE:*` to get all symbols on an exchange.","tags":["Fundamentals"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"example":"NASDAQ:AAPL","description":"Full symbol in EXCHANGE:TICKER format"},{"name":"view","in":"query","schema":{"type":"string","enum":["collapse","expand"]},"example":"expand","description":"Data format: collapse (flat) or expand (detailed). Default: collapse"},{"name":"period","in":"query","schema":{"type":"string","enum":["q","y"]},"example":"q","description":"Period type when view=collapse: q (quarterly) or y (yearly). Default: q"}],"responses":{"200":{"description":"Fundamental data (structure varies for stocks vs crypto)","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object"}}}}}}}}},"/v1/news/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the News service is up.","tags":["News"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"text/plain":{"schema":{"type":"string"},"example":"pong"}}}}}},"/v1/news":{"get":{"summary":"Get News","description":"Returns recent news articles for a symbol. Use `exchange:ticker` format (e.g., `binance:BTC/USDT` or `goldfish:AAPL`).","tags":["News"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"example":"binance:BTC/USDT","description":"Symbol in exchange:ticker format (e.g., binance:BTC/USDT or goldfish:AAPL)"},{"name":"limit","in":"query","schema":{"type":"integer"},"example":5,"description":"Number of articles to return"}],"responses":{"200":{"description":"News articles","content":{"application/json":{"schema":{"type":"object","properties":{"results":{"type":"array","items":{"$ref":"#/components/schemas/NewsArticle"}}}},"example":{"results":[{"symbol":"binance:BTC/USDT","title":"Bitcoin Surges Past $50K","link":"https://example.com/bitcoin-50k","published_at":"2025-01-28T09:00:00Z","source":"cryptonews"}]}}}}}}},"/v1/webhook/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the Signals service is up.","tags":["Signals"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"text/plain":{"schema":{"type":"string"},"example":"pong"}}}}}},"/v1/webhook":{"post":{"summary":"Send Trading Signal","description":"Sends a buy/sell signal to an exchange. Supports fixed amounts, percentages, and currency-denominated quantities.","tags":["Signals"],"security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["apiKey","secret","ticker","exchange","strategy"],"properties":{"apiKey":{"type":"string","description":"API key for exchange authentication"},"secret":{"type":"string","description":"Secret key for exchange authentication"},"accountId":{"type":"string","description":"Trading account identifier"},"quantity":{"type":"string","description":"Amount to trade: fixed (e.g., '2 BTC'), percentage ('10%'), or currency value ('1000 USDT')"},"ticker":{"type":"string","description":"Trading pair symbol (e.g., XRPUSDT)"},"exchange":{"type":"string","description":"Exchange name (e.g., binance)"},"bar":{"type":"object","properties":{"price":{"type":"number"}}},"strategy":{"type":"object","properties":{"signal":{"type":"string","enum":["buy","sell"]}}},"syminfo":{"type":"object","properties":{"currency":{"type":"string"},"basecurrency":{"type":"string"}}},"env":{"type":"string","enum":["dev","prod"],"description":"Environment to use: dev (development Firebase) or prod (production Firebase). Default: prod"}}},"example":{"apiKey":"your_api_key","secret":"your_secret_key","accountId":"acc123","quantity":"50 USDT","ticker":"TRXUSDT","exchange":"binance","bar":{"price":0.33},"strategy":{"signal":"buy"},"syminfo":{"currency":"USDT","basecurrency":"TRX"},"env":"dev"}}}},"responses":{"200":{"description":"Order execution result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}}}}},"/v1/exchange/{exchange_name}":{"post":{"summary":"Generate Auth Token","description":"Submit exchange API credentials to receive a session token for authenticated trading endpoints.","tags":["Auth"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["id","apiKey","secret"],"properties":{"id":{"type":"string","description":"Exchange identifier (e.g., binanceus)"},"apiKey":{"type":"string","description":"Your exchange API key"},"secret":{"type":"string","description":"Your exchange secret key"},"password":{"type":"string","description":"Account password (if applicable, can be empty)"},"sandbox":{"type":"boolean","description":"Use sandbox/testnet environment. Default: false"}}},"example":{"id":"binance","apiKey":"your_api_key","secret":"your_secret_key","password":"","sandbox":false}}}},"responses":{"200":{"description":"Authentication token","content":{"application/json":{"schema":{"type":"object","properties":{"token":{"type":"string"}}},"example":{"token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}}}}}}},"/v1/rms/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the Orders service is up.","tags":["Orders"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"text/plain":{"schema":{"type":"string"},"example":"pong"}}}}}},"/v1/rms/exchange/{exchange_name}/order":{"post":{"summary":"Place Order","description":"Places a market, limit, or stop order on the exchange. Returns the full execution result including fill details.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbol","login","type","side","amount"],"properties":{"symbol":{"type":"string","description":"Trading pair (e.g., TRX/USDT)"},"login":{"type":"string","description":"Exchange account login identifier"},"type":{"type":"string","enum":["market","limit","stop"],"description":"Order type"},"side":{"type":"string","enum":["buy","sell"],"description":"Trade direction"},"amount":{"type":"number","description":"Quantity of base currency to trade"},"price":{"type":"number","description":"Price per unit (required for limit orders)"}}},"example":{"symbol":"BTC/USDT","login":"acc123","type":"limit","side":"buy","amount":10,"price":1}}}},"responses":{"200":{"description":"Order execution result","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}}}}},"/v1/rms/exchange/{exchange_name}/balances/accountInfo/{account_id}":{"get":{"summary":"Get Account Info","description":"Returns account details including permissions, commission rates, and deposit/withdraw status.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"account_id","in":"path","required":true,"schema":{"type":"string"},"example":"acc123"}],"responses":{"200":{"description":"Account details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInfo"}}}}}}},"/v1/rms/exchange/{exchange_name}/balances":{"get":{"summary":"Get Positions","description":"Returns current holdings with free, used, and total balances for each asset.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"login","in":"query","required":true,"schema":{"type":"string"},"example":"acc123","description":"Exchange account login identifier"}],"responses":{"200":{"description":"Account positions and balances","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccountInfo"}}}}}}},"/v1/rms/exchange/{exchange_name}/markets":{"get":{"summary":"Get Tradable Assets","description":"Returns all markets available for trading on this exchange, including order types and margin info.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"}],"responses":{"200":{"description":"List of tradable markets","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Market"}}}}}}}},"/v1/rms/exchange/{exchange_name}/orders":{"get":{"summary":"List Orders","description":"Returns all orders for an account. Optionally filter by trading pair.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"login","in":"query","required":true,"schema":{"type":"string"},"example":"acc123","description":"Exchange account login identifier"},{"name":"symbol","in":"query","schema":{"type":"string"},"example":"BTC/USDT","description":"Filter by trading pair"}],"responses":{"200":{"description":"List of orders","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderSummary"}}}}}}}},"/v1/rms/exchange/{exchange_name}/transactions":{"get":{"summary":"Get Trade History","description":"Returns executed trades for an account, optionally filtered by trading pair.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"login","in":"query","required":true,"schema":{"type":"string"},"example":"acc123"},{"name":"symbol","in":"query","schema":{"type":"string"},"example":"BTC/USDT"}],"responses":{"200":{"description":"List of transactions","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Transaction"}}}}}}}},"/v1/rms/exchange/{exchange_name}/order/{order_id}":{"delete":{"summary":"Cancel Order","description":"Cancels an open order by its ID. Requires the trading pair and account login.","tags":["Orders"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"exchange_name","in":"path","required":true,"schema":{"type":"string"},"example":"binance"},{"name":"order_id","in":"path","required":true,"schema":{"type":"string"},"example":"313075"},{"name":"login","in":"query","required":true,"schema":{"type":"string"},"example":"acc123"},{"name":"symbol","in":"query","required":true,"schema":{"type":"string"},"example":"BTC/USDT"}],"responses":{"200":{"description":"Order cancelled successfully","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string"}}}}}}}}},"/v1/quotes/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the Quotes service is up.","tags":["Quotes"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PingResponse"}}}}}}},"/v1/quotes/alpaca/ohlcv/latest":{"post":{"summary":"Get Latest Quotes","description":"Returns the most recent OHLCV candle for one or more US stock symbols via Alpaca.","tags":["Quotes"],"security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["symbols"],"properties":{"symbols":{"type":"array","items":{"type":"string"},"description":"List of trading symbols to fetch quotes for"}}},"example":{"symbols":["AAPL","TSLA"]}}}},"responses":{"200":{"description":"OHLCV data for requested symbols","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QuoteOHLCV"}},"example":[{"symbol":"AAPL","timestamp":"2025-10-03T15:59:00Z","open":170.5,"high":172.1,"low":169.8,"close":171.6,"volume":24589000}]}}}}}},"/v1/rule/ping":{"get":{"summary":"Ping","description":"Quick health check — returns a welcome message if the Risk service is up.","tags":["Risk"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"Hi! Welcome to the Flask API."}}}}}}},"/v1/rule/create-rule":{"post":{"summary":"Create Rule","description":"Creates a portfolio rule with a condition script. When the condition is met, the rule triggers an alert or auto-places a trade.","tags":["Risk"],"security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["condition_script","user_id","account_id","exchange"],"properties":{"condition_script":{"type":"string","description":"Script defining the rule condition (e.g., \"portfolio.total_value < 10000\")"},"user_id":{"type":"string","description":"User identifier"},"account_id":{"type":"string","description":"Account identifier"},"exchange":{"type":"string","description":"Exchange name (e.g., binance)"},"symbol":{"type":"string","description":"Trading pair. Default: * (account-level)"},"active":{"type":"boolean","description":"Whether the rule is active. Default: true"},"rule_name":{"type":"string","description":"Custom rule name (auto-generated if omitted)"},"description":{"type":"string","description":"Rule description (auto-generated if omitted)"},"ruleId":{"type":"string","description":"Existing rule ID (for updating a rule)"}}},"example":{"condition_script":"portfolio.total_value < 10000","user_id":"your_user_id","account_id":"your_account_id","exchange":"binance","symbol":"BTC/USDT","active":true,"rule_name":"my_portfolio_rule","description":"Alert when portfolio drops below 10k"}}}},"responses":{"200":{"description":"Rule created successfully","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"object","properties":{"createMarketRule":{"type":"object","properties":{"marketRule":{"type":"object","properties":{"ruleId":{"type":"string"},"ruleName":{"type":"string"}}}}}}}}},"example":{"data":{"createMarketRule":{"marketRule":{"ruleId":"64c40d41-2616-4a07-9e82-0ae3cac235d6","ruleName":"my_portfolio_rule"}}}}}}}}}},"/v1/wallet/ping":{"get":{"summary":"Ping","description":"Quick health check — returns `pong` if the Wallet service is up.","tags":["Wallet"],"security":[{"BasicAuth":[]}],"responses":{"200":{"description":"Service is running","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"string"}}},"example":{"message":"pong"}}}}}}},"/v1/wallet/create-wallet":{"post":{"summary":"Create Wallet","description":"Generates a new wallet (address, mnemonic, private key) for the chosen blockchain.","tags":["Wallet"],"security":[{"BasicAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["chain"],"properties":{"chain":{"type":"string","enum":["ETH","BTC","CELO","DOGE","LTC","MATIC"],"description":"Blockchain (case-insensitive)"},"is_testnet":{"type":"boolean","description":"Use testnet if true, mainnet if false. Default: true"},"index":{"type":"integer","description":"Derivation index for address/key pair. Default: 0"}}},"example":{"chain":"CELO","is_testnet":false,"index":0}}}},"responses":{"200":{"description":"Generated wallet details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WalletInfo"},"example":{"address":"0x123abc...","mnemonic":"word1 word2 word3 ...","privateKey":"abcdef123456...","xpub":"pqrstuv123...","chain":"celo","network":"mainnet","index":0}}}}}}},"/v1/wallet/check-balance":{"get":{"summary":"Check Balance","description":"Returns incoming, outgoing, and pending balances for a wallet address.","tags":["Wallet"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"chain","in":"query","required":true,"schema":{"type":"string"},"example":"ETH","description":"Blockchain shorthand (ETH, BTC, MATIC, CELO, LTC, DOGE)"},{"name":"address","in":"query","required":true,"schema":{"type":"string"},"example":"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68"},{"name":"network","in":"query","schema":{"type":"string","enum":["testnet","mainnet"]},"example":"testnet","description":"Default: testnet"}],"responses":{"200":{"description":"Wallet balance","content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string"},"network":{"type":"string"},"address":{"type":"string"},"balance":{"type":"object","properties":{"incoming":{"type":"string"},"outgoing":{"type":"string"},"incomingPending":{"type":"string"},"outgoingPending":{"type":"string"}}}}},"example":{"chain":"eth","network":"testnet","address":"0x742d35Cc6634C0532925a3b844Bc9e7595f2bD68","balance":{"incoming":"0.00002425","outgoing":"0.000032425","incomingPending":"0","outgoingPending":"0"}}}}}}}},"/v1/wallet/send-transaction":{"post":{"summary":"Send Transaction","description":"Signs and broadcasts a transfer from one wallet to another. The private key is used locally for signing only.","tags":["Wallet"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"chain","in":"query","required":true,"schema":{"type":"string"},"example":"ETH"},{"name":"is_testnet","in":"query","schema":{"type":"boolean"},"example":true}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["to","amount","from_private_key"],"properties":{"to":{"type":"string","description":"Destination wallet address"},"amount":{"type":"string","description":"Amount to send"},"from_private_key":{"type":"string","description":"Sender's private key (used only for local signing)"}}},"example":{"to":"0x123abc456def...","amount":"0.001","from_private_key":"your_private_key"}}}},"responses":{"200":{"description":"Transaction broadcast result","content":{"application/json":{"schema":{"type":"object","properties":{"hash":{"type":"string"},"status":{"type":"string"}}},"example":{"hash":"0xabc123def456...","status":"broadcasted"}}}}}}},"/v1/wallet/transactions":{"get":{"summary":"Transaction History","description":"Returns past transactions for a wallet address with pagination and time-range filters.","tags":["Wallet"],"security":[{"BasicAuth":[]}],"parameters":[{"name":"chain","in":"query","required":true,"schema":{"type":"string"},"example":"BTC"},{"name":"address","in":"query","required":true,"schema":{"type":"string"},"example":"tb1qxxxxxxxyyyzzz111222abc"},{"name":"network","in":"query","schema":{"type":"string","enum":["testnet","mainnet"]},"example":"testnet"},{"name":"pageSize","in":"query","required":true,"schema":{"type":"integer"},"example":10},{"name":"offset","in":"query","schema":{"type":"integer"},"example":0},{"name":"from","in":"query","schema":{"type":"integer","format":"int64"},"description":"Start time filter (timestamp in ms)"},{"name":"to","in":"query","schema":{"type":"integer","format":"int64"},"description":"End time filter (timestamp in ms)"},{"name":"sort","in":"query","schema":{"type":"string","enum":["ASC","DESC"]},"example":"DESC"}],"responses":{"200":{"description":"Transaction history","content":{"application/json":{"schema":{"type":"object","properties":{"chain":{"type":"string"},"network":{"type":"string"},"address":{"type":"string"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/BlockchainTransaction"}}}}}}}}}}},"components":{"securitySchemes":{"BasicAuth":{"type":"http","scheme":"basic"}},"schemas":{"PingResponse":{"type":"object","properties":{"success":{"type":"string"}},"example":{"success":"pong"}},"Market":{"type":"object","properties":{"base":{"type":"string"},"exchange":{"type":"string"},"id":{"type":"string"},"info":{"type":"object"},"limits":{"type":"object","properties":{"amount":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"}}},"cost":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"}}},"price":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"}}}}},"precision":{"type":"object","properties":{"amount":{"type":"number"},"price":{"type":"number"}}},"quote":{"type":"string"},"symbol":{"type":"string"}}},"Currency":{"type":"object","properties":{"active":{"type":"boolean"},"code":{"type":"string"},"deposit":{"type":"boolean"},"fee":{"type":"number","nullable":true},"id":{"type":"string"},"info":{"type":"object"},"limits":{"type":"object","properties":{"amount":{"type":"object","properties":{"max":{"type":"number","nullable":true},"min":{"type":"number","nullable":true}}},"deposit":{"type":"object","properties":{"max":{"type":"number","nullable":true},"min":{"type":"number"}}},"withdraw":{"type":"object","properties":{"max":{"type":"number"},"min":{"type":"number"}}}}},"name":{"type":"string"},"networks":{"type":"object"},"precision":{"type":"number"},"type":{"type":"string"},"withdraw":{"type":"boolean"}}},"Ticker":{"type":"object","properties":{"symbol":{"type":"string"},"last":{"type":"string"},"high":{"type":"string"},"low":{"type":"string"},"volume":{"type":"string"}}},"Candle":{"type":"object","properties":{"open":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"close":{"type":"number"},"volume":{"type":"number"},"datetime":{"type":"integer","format":"int64","description":"Timestamp in milliseconds since epoch"}}},"Rate":{"type":"object","properties":{"currencySymbol":{"type":"string"},"id":{"type":"string"},"rateUsd":{"type":"number"},"symbol":{"type":"string"},"type":{"type":"string","enum":["fiat","crypto"]}}},"NewsArticle":{"type":"object","properties":{"symbol":{"type":"string"},"title":{"type":"string"},"link":{"type":"string"},"published_at":{"type":"string","format":"date-time"},"source":{"type":"string"}}},"OrderResponse":{"type":"object","description":"Full order execution result from the exchange","properties":{"id":{"type":"string"},"amount":{"type":"number"},"average":{"type":"number"},"clientOrderId":{"type":"string"},"cost":{"type":"number"},"datetime":{"type":"string","format":"date-time"},"fee":{"type":"object","properties":{"cost":{"type":"number"},"currency":{"type":"string"}}},"filled":{"type":"number"},"info":{"type":"object","description":"Raw exchange-specific response data"},"price":{"type":"number"},"remaining":{"type":"number"},"side":{"type":"string","enum":["buy","sell"]},"status":{"type":"string","enum":["open","closed","canceled"]},"symbol":{"type":"string"},"timestamp":{"type":"integer","format":"int64"},"type":{"type":"string","enum":["market","limit","stop"]},"trades":{"type":"array","items":{"type":"object","properties":{"amount":{"type":"number"},"cost":{"type":"number"},"price":{"type":"number"},"id":{"type":"string"}}}}}},"OrderSummary":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string"},"side":{"type":"string"},"status":{"type":"string"},"price":{"type":"number"},"amount":{"type":"number"},"filled":{"type":"number"},"remaining":{"type":"number"},"cost":{"type":"number"},"fee":{"type":"number"},"commission":{"type":"number"},"datetime":{"type":"string","format":"date-time"},"info":{"type":"object"}}},"Transaction":{"type":"object","properties":{"id":{"type":"string"},"symbol":{"type":"string"},"type":{"type":"string"},"side":{"type":"string"},"status":{"type":"string"},"price":{"type":"number"},"amount":{"type":"number"},"cost":{"type":"number"},"filled":{"type":"number"},"remaining":{"type":"number"},"fee":{"type":"number"},"commission":{"type":"string"},"datetime":{"type":"string"},"timestamp":{"type":"integer","format":"int64"},"info":{"type":"object"}}},"AccountInfo":{"type":"object","properties":{"balances":{"type":"array","items":{"type":"object","properties":{"currency":{"type":"string"},"free":{"type":"number"},"total":{"type":"number"},"used":{"type":"number"}}}},"info":{"type":"object","properties":{"accountType":{"type":"string"},"balances":{"type":"array","items":{"type":"object","properties":{"asset":{"type":"string"},"free":{"type":"string"},"locked":{"type":"string"}}}},"canDeposit":{"type":"boolean"},"canTrade":{"type":"boolean"},"canWithdraw":{"type":"boolean"},"commissionRates":{"type":"object","properties":{"buyer":{"type":"string"},"maker":{"type":"string"},"seller":{"type":"string"},"taker":{"type":"string"}}},"permissions":{"type":"array","items":{"type":"string"}},"uid":{"type":"string"}}}}},"QuoteOHLCV":{"type":"object","properties":{"symbol":{"type":"string"},"timestamp":{"type":"string","format":"date-time"},"open":{"type":"number"},"high":{"type":"number"},"low":{"type":"number"},"close":{"type":"number"},"volume":{"type":"integer"}}},"WalletInfo":{"type":"object","properties":{"address":{"type":"string"},"mnemonic":{"type":"string"},"privateKey":{"type":"string"},"xpub":{"type":"string"},"chain":{"type":"string"},"network":{"type":"string"},"index":{"type":"integer"}}},"BlockchainTransaction":{"type":"object","properties":{"blockNumber":{"type":"integer"},"fee":{"type":"integer"},"hash":{"type":"string"},"index":{"type":"integer"},"inputs":{"type":"array","items":{"type":"object"}},"outputs":{"type":"array","items":{"type":"object","properties":{"value":{"type":"integer"},"address":{"type":"string"}}}},"size":{"type":"integer"},"time":{"type":"integer"},"version":{"type":"integer"},"vsize":{"type":"integer"}}}}},"security":[{"BasicAuth":[]}]}