{"openapi":"3.1.0","info":{"title":"OltinPay","description":"Telegram Mini App for tokenized gold trading","version":"0.1.0"},"paths":{"/api/v1/auth/telegram":{"post":{"tags":["auth"],"summary":"Authenticate Telegram","description":"Authenticate user via Telegram initData.\n\nIf user doesn't exist, creates new user with temporary oltin_id.","operationId":"authenticate_telegram_api_v1_auth_telegram_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/users/me":{"get":{"tags":["users"],"summary":"Get Current User Info","description":"Get current user info.","operationId":"get_current_user_info_api_v1_users_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"HTTPBearer":[]}]},"patch":{"tags":["users"],"summary":"Update Current User","description":"Update current user (language only).","operationId":"update_current_user_api_v1_users_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/users/oltin-id":{"post":{"tags":["users"],"summary":"Set Oltin Id","description":"Set oltin_id for current user.\n\nCan only be set once. Cannot be changed later.","operationId":"set_oltin_id_api_v1_users_oltin_id_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OltinIdCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/users/search":{"get":{"tags":["users"],"summary":"Search Users","description":"Search users by oltin_id prefix.","operationId":"search_users_api_v1_users_search_get","parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":32,"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserSearchResult"},"title":"Response Search Users Api V1 Users Search Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/balances":{"get":{"tags":["balances"],"summary":"Get Balances","description":"Get all user balances.","operationId":"get_balances_api_v1_balances_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalancesResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/balances/transfer":{"post":{"tags":["balances"],"summary":"Internal Transfer","description":"Transfer between own accounts (free).","operationId":"internal_transfer_api_v1_balances_transfer_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalTransferRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalTransferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/transfers":{"post":{"tags":["transfers"],"summary":"Create Transfer","description":"Create OLTIN transfer to another user.\n\nTransfers OLTIN from wallet to recipient's wallet.\nFee: 1% (min 0.05 USD equivalent).","operationId":"create_transfer_api_v1_transfers_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["transfers"],"summary":"Get Transfers","description":"Get user's transfers (sent and received).","operationId":"get_transfers_api_v1_transfers_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TransferListResponse"},"title":"Response Get Transfers Api V1 Transfers Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/transfers/{transfer_id}":{"get":{"tags":["transfers"],"summary":"Get Transfer","description":"Get transfer details.","operationId":"get_transfer_api_v1_transfers__transfer_id__get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"transfer_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Transfer Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/staking":{"get":{"tags":["staking"],"summary":"Get Staking Info","description":"Get staking info.\n\nReturns balance, lock status, APY, daily reward, total earned.","operationId":"get_staking_info_api_v1_staking_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingInfoResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/staking/deposit":{"post":{"tags":["staking"],"summary":"Deposit To Staking","description":"Deposit OLTIN to staking.\n\nMoves OLTIN from wallet to staking.\nResets lock period to 7 days.","operationId":"deposit_to_staking_api_v1_staking_deposit_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingDepositRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingDepositResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/staking/withdraw":{"post":{"tags":["staking"],"summary":"Withdraw From Staking","description":"Withdraw OLTIN from staking.\n\nFails if still locked.","operationId":"withdraw_from_staking_api_v1_staking_withdraw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingWithdrawRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingWithdrawResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/staking/rewards":{"get":{"tags":["staking"],"summary":"Get Staking Rewards","description":"Get staking rewards history.","operationId":"get_staking_rewards_api_v1_staking_rewards_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/StakingRewardResponse"},"type":"array","title":"Response Get Staking Rewards Api V1 Staking Rewards Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/staking/rewards/calculate":{"post":{"tags":["staking"],"summary":"Calculate Rewards","description":"Calculate and credit daily rewards for all stakers.\n\nCalled by cron job. Can be triggered manually for testing.\nIdempotent - safe to call multiple times per day.","operationId":"calculate_rewards_api_v1_staking_rewards_calculate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Calculate Rewards Api V1 Staking Rewards Calculate Post"}}}}}}},"/api/v1/exchange/orderbook":{"get":{"tags":["exchange"],"summary":"Get Orderbook","description":"Get current orderbook.","operationId":"get_orderbook_api_v1_exchange_orderbook_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBookResponse"}}}}}}},"/api/v1/exchange/price":{"get":{"tags":["exchange"],"summary":"Get Price","description":"Get current bid/ask/mid price (real gold price).","operationId":"get_price_api_v1_exchange_price_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceResponse"}}}}}}},"/api/v1/exchange/swap/quote":{"post":{"tags":["exchange"],"summary":"Get Swap Quote","description":"Get swap quote without executing.\n\n- side: 'buy' = USD -> OLTIN, 'sell' = OLTIN -> USD\n- amount: Amount to swap\n- amount_type: 'from' = what you give, 'to' = what you want to receive","operationId":"get_swap_quote_api_v1_exchange_swap_quote_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapQuoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/exchange/swap":{"post":{"tags":["exchange"],"summary":"Execute Swap","description":"Execute instant swap on exchange account.\n\nRequires funds on exchange account.\nUse /send (internal transfer) to move funds from wallet to exchange first.","operationId":"execute_swap_api_v1_exchange_swap_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/exchange/orders":{"post":{"tags":["exchange"],"summary":"Create Order","description":"Create a new order (legacy - prefer /swap for instant execution).","operationId":"create_order_api_v1_exchange_orders_post","security":[{"HTTPBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["exchange"],"summary":"Get Orders","description":"Get user's orders.","operationId":"get_orders_api_v1_exchange_orders_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","pattern":"^(open|partial|filled|cancelled)$"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderResponse"},"title":"Response Get Orders Api V1 Exchange Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exchange/orders/{order_id}":{"delete":{"tags":["exchange"],"summary":"Cancel Order","description":"Cancel an open order.","operationId":"cancel_order_api_v1_exchange_orders__order_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/exchange/trades":{"get":{"tags":["exchange"],"summary":"Get Trades","description":"Get recent trades.","operationId":"get_trades_api_v1_exchange_trades_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TradeResponse"},"title":"Response Get Trades Api V1 Exchange Trades Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/contacts/recent":{"get":{"tags":["contacts"],"summary":"Get Recent Contacts","description":"Get last 5 transfer recipients.","operationId":"get_recent_contacts_api_v1_contacts_recent_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RecentContactResponse"},"type":"array","title":"Response Get Recent Contacts Api V1 Contacts Recent Get"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/contacts/favorites":{"get":{"tags":["contacts"],"summary":"Get Favorites","description":"Get favorite contacts.","operationId":"get_favorites_api_v1_contacts_favorites_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FavoriteContactResponse"},"type":"array","title":"Response Get Favorites Api V1 Contacts Favorites Get"}}}}},"security":[{"HTTPBearer":[]}]},"post":{"tags":["contacts"],"summary":"Add Favorite","description":"Add contact to favorites.","operationId":"add_favorite_api_v1_contacts_favorites_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteContactCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FavoriteContactResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/contacts/favorites/{favorite_id}":{"delete":{"tags":["contacts"],"summary":"Remove Favorite","description":"Remove contact from favorites.","operationId":"remove_favorite_api_v1_contacts_favorites__favorite_id__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"favorite_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Favorite Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/aylin/chat":{"post":{"tags":["aylin"],"summary":"Chat","description":"Chat with AI assistant.","operationId":"chat_api_v1_aylin_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/health":{"get":{"summary":"Health Check","description":"Health check endpoint.","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Health Check Health Get"}}}}}}},"/":{"get":{"summary":"Root","description":"Root endpoint.","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Root  Get"}}}}}}}},"components":{"schemas":{"AccountBalance":{"properties":{"usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Usd"},"oltin":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Oltin"}},"type":"object","required":["usd","oltin"],"title":"AccountBalance","description":"Single account balance."},"AuthResponse":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"user":{"$ref":"#/components/schemas/UserResponse"},"is_new":{"type":"boolean","title":"Is New"}},"type":"object","required":["access_token","user","is_new"],"title":"AuthResponse","description":"Authentication response."},"BalancesResponse":{"properties":{"total_usd":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Usd"},"wallet":{"$ref":"#/components/schemas/AccountBalance"},"exchange":{"$ref":"#/components/schemas/AccountBalance"},"staking":{"$ref":"#/components/schemas/AccountBalance"}},"type":"object","required":["total_usd","wallet","exchange","staking"],"title":"BalancesResponse","description":"All user balances response."},"ChatRequest":{"properties":{"message":{"type":"string","maxLength":1000,"minLength":1,"title":"Message"}},"type":"object","required":["message"],"title":"ChatRequest","description":"Chat request to AI assistant."},"ChatResponse":{"properties":{"response":{"type":"string","title":"Response"},"sources":{"items":{"$ref":"#/components/schemas/ChatSource"},"type":"array","title":"Sources","default":[]}},"type":"object","required":["response"],"title":"ChatResponse","description":"Chat response from AI assistant."},"ChatSource":{"properties":{"title":{"type":"string","title":"Title"},"url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Url"}},"type":"object","required":["title"],"title":"ChatSource","description":"Source document reference."},"FavoriteContactCreate":{"properties":{"oltin_id":{"type":"string","maxLength":32,"minLength":1,"title":"Oltin Id"}},"type":"object","required":["oltin_id"],"title":"FavoriteContactCreate","description":"Create favorite contact request."},"FavoriteContactResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"oltin_id":{"type":"string","title":"Oltin Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","oltin_id","created_at"],"title":"FavoriteContactResponse","description":"Favorite contact response."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InternalTransferRequest":{"properties":{"from_account":{"type":"string","pattern":"^(wallet|exchange|staking)$","title":"From Account"},"to_account":{"type":"string","pattern":"^(wallet|exchange|staking)$","title":"To Account"},"currency":{"type":"string","pattern":"^(USD|OLTIN)$","title":"Currency"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount"}},"type":"object","required":["from_account","to_account","currency","amount"],"title":"InternalTransferRequest","description":"Internal transfer request (between own accounts)."},"InternalTransferResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"from_account":{"type":"string","title":"From Account"},"to_account":{"type":"string","title":"To Account"},"currency":{"type":"string","title":"Currency"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"}},"type":"object","required":["from_account","to_account","currency","amount"],"title":"InternalTransferResponse","description":"Internal transfer response."},"OltinIdCreate":{"properties":{"oltin_id":{"type":"string","maxLength":30,"minLength":3,"title":"Oltin Id"}},"type":"object","required":["oltin_id"],"title":"OltinIdCreate","description":"Schema for creating oltin_id."},"OrderBookLevel":{"properties":{"price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"}},"type":"object","required":["price","quantity"],"title":"OrderBookLevel","description":"Orderbook price level."},"OrderBookResponse":{"properties":{"bids":{"items":{"$ref":"#/components/schemas/OrderBookLevel"},"type":"array","title":"Bids"},"asks":{"items":{"$ref":"#/components/schemas/OrderBookLevel"},"type":"array","title":"Asks"},"mid_price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Mid Price"}},"type":"object","required":["bids","asks","mid_price"],"title":"OrderBookResponse","description":"Orderbook response."},"OrderRequest":{"properties":{"side":{"type":"string","pattern":"^(buy|sell)$","title":"Side"},"type":{"type":"string","pattern":"^(market|limit)$","title":"Type","default":"limit"},"price":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price"},"quantity":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Quantity"}},"type":"object","required":["side","quantity"],"title":"OrderRequest","description":"Create order request."},"OrderResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"side":{"type":"string","title":"Side"},"order_type":{"type":"string","title":"Order Type"},"price":{"anyOf":[{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"},{"type":"null"}],"title":"Price"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"},"filled_quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Filled Quantity"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","side","order_type","price","quantity","filled_quantity","status","created_at"],"title":"OrderResponse","description":"Order response."},"PriceResponse":{"properties":{"bid":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Bid"},"ask":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Ask"},"mid":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Mid"}},"type":"object","required":["bid","ask","mid"],"title":"PriceResponse","description":"Current price response."},"RecentContactResponse":{"properties":{"oltin_id":{"type":"string","title":"Oltin Id"},"last_transfer_at":{"type":"string","format":"date-time","title":"Last Transfer At"}},"type":"object","required":["oltin_id","last_transfer_at"],"title":"RecentContactResponse","description":"Recent contact from transfers."},"StakingDepositRequest":{"properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount"}},"type":"object","required":["amount"],"title":"StakingDepositRequest","description":"Staking deposit request."},"StakingDepositResponse":{"properties":{"new_balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"New Balance"},"locked_until":{"type":"string","format":"date-time","title":"Locked Until"}},"type":"object","required":["new_balance","locked_until"],"title":"StakingDepositResponse","description":"Staking deposit response."},"StakingInfoResponse":{"properties":{"balance":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance"},"locked_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Locked Until"},"is_locked":{"type":"boolean","title":"Is Locked"},"apy":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Apy"},"daily_reward":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Daily Reward"},"total_earned":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Total Earned"}},"type":"object","required":["balance","locked_until","is_locked","apy","daily_reward","total_earned"],"title":"StakingInfoResponse","description":"Staking info response."},"StakingRewardResponse":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"balance_snapshot":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Balance Snapshot"}},"type":"object","required":["date","amount","balance_snapshot"],"title":"StakingRewardResponse","description":"Staking reward item."},"StakingWithdrawRequest":{"properties":{"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount"}},"type":"object","required":["amount"],"title":"StakingWithdrawRequest","description":"Staking withdraw request."},"StakingWithdrawResponse":{"properties":{"withdrawn":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Withdrawn"},"remaining":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Remaining"}},"type":"object","required":["withdrawn","remaining"],"title":"StakingWithdrawResponse","description":"Staking withdraw response."},"SwapQuoteResponse":{"properties":{"side":{"type":"string","title":"Side"},"from_currency":{"type":"string","title":"From Currency"},"from_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"From Amount"},"to_currency":{"type":"string","title":"To Currency"},"to_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"To Amount"},"price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price"},"fee":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee"},"fee_percent":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee Percent"}},"type":"object","required":["side","from_currency","from_amount","to_currency","to_amount","price","fee","fee_percent"],"title":"SwapQuoteResponse","description":"Swap quote - preview before execution."},"SwapRequest":{"properties":{"side":{"type":"string","pattern":"^(buy|sell)$","title":"Side","description":"buy = USD->OLTIN, sell = OLTIN->USD"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount","description":"Amount to swap"},"amount_type":{"type":"string","pattern":"^(from|to)$","title":"Amount Type","description":"Is amount what you give (from) or receive (to)","default":"from"}},"type":"object","required":["side","amount"],"title":"SwapRequest","description":"Swap request - instant exchange USD <-> OLTIN."},"SwapResponse":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"side":{"type":"string","title":"Side"},"from_currency":{"type":"string","title":"From Currency"},"from_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"From Amount"},"to_currency":{"type":"string","title":"To Currency"},"to_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"To Amount"},"price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price"},"fee":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee"}},"type":"object","required":["side","from_currency","from_amount","to_currency","to_amount","price","fee"],"title":"SwapResponse","description":"Swap execution response."},"TelegramAuthRequest":{"properties":{"init_data":{"type":"string","title":"Init Data"}},"type":"object","required":["init_data"],"title":"TelegramAuthRequest","description":"Telegram authentication request."},"TradeResponse":{"properties":{"price":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Price"},"quantity":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Quantity"},"side":{"type":"string","title":"Side"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["price","quantity","side","created_at"],"title":"TradeResponse","description":"Trade response."},"TransferDetailResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"from_oltin_id":{"type":"string","title":"From Oltin Id"},"to_oltin_id":{"type":"string","title":"To Oltin Id"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"fee":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee"},"tx_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tx Hash"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"confirmed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Confirmed At"}},"type":"object","required":["id","from_oltin_id","to_oltin_id","amount","fee","tx_hash","status","created_at","confirmed_at"],"title":"TransferDetailResponse","description":"Detailed transfer response."},"TransferListResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"direction":{"type":"string","title":"Direction"},"counterparty":{"type":"string","title":"Counterparty"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"fee":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","direction","counterparty","amount","fee","status","created_at"],"title":"TransferListResponse","description":"Transfer list item."},"TransferRequest":{"properties":{"to_oltin_id":{"type":"string","minLength":1,"title":"To Oltin Id"},"amount":{"anyOf":[{"type":"number","exclusiveMinimum":0.0},{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$"}],"title":"Amount"}},"type":"object","required":["to_oltin_id","amount"],"title":"TransferRequest","description":"Transfer request."},"TransferResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Amount"},"fee":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Fee"},"net_amount":{"type":"string","pattern":"^(?!^[-+.]*$)[+-]?0*\\d*\\.?\\d*$","title":"Net Amount"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","amount","fee","net_amount","status","created_at"],"title":"TransferResponse","description":"Transfer response."},"UserResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"telegram_id":{"type":"integer","title":"Telegram Id"},"oltin_id":{"type":"string","title":"Oltin Id"},"language":{"type":"string","title":"Language"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","telegram_id","oltin_id","language","created_at"],"title":"UserResponse","description":"User response schema."},"UserSearchResult":{"properties":{"oltin_id":{"type":"string","title":"Oltin Id"},"telegram_id":{"type":"integer","title":"Telegram Id"}},"type":"object","required":["oltin_id","telegram_id"],"title":"UserSearchResult","description":"User search result."},"UserUpdate":{"properties":{"language":{"anyOf":[{"type":"string","pattern":"^(uz|ru|en)$"},{"type":"null"}],"title":"Language"}},"type":"object","title":"UserUpdate","description":"Schema for updating user."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}