{"openapi":"3.1.0","info":{"title":"Rent Energy","description":"\nRent Energy\n","version":"1.0.0"},"paths":{"/api/user/token":{"post":{"tags":["user"],"summary":"Get Access Token","description":"Log in a user and get an access token.\n\n    This endpoint allows a user to log in with their username and password. \n    Upon successful authentication, it returns an access token that can be used \n    to access protected routes in the API. The token does not expire.\n\n    - **username**: The username of the user.\n    - **password**: The password of the user.\n\n    If the login is unsuccessful, an HTTP 401 error is returned.\n    If there is an unexpected error during token creation, an HTTP 500 error is returned.","operationId":"authorize_api_user_token_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_authorize_api_user_token_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/change-password":{"post":{"tags":["user"],"summary":"Change Password","description":"Change the signed-in user's password after verifying the old password.","operationId":"change_password_api_user_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"400":{"description":"Incorrect old password"},"401":{"description":"Bearer authentication required"},"409":{"description":"Another request already changed the password"},"422":{"description":"Invalid password change request"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/user/me":{"get":{"tags":["user"],"summary":"Get Current User","description":"Retrieve the details of the currently authenticated user.\n\n    This endpoint returns the details of the user who is currently authenticated \n    based on the provided access token.\n\n    - **username**: The username of the user.\n    - **role**: The role of the user (user/admin).\n    - **balance**: The balance of the user.\n    - **updated_at**: The last update timestamp.\n    - **created_at**: The creation timestamp.\n\n    If the token is invalid or the user is not found, an HTTP 401 error is returned.","operationId":"read_users_me_api_user_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMe"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/user":{"post":{"tags":["user"],"summary":"Create New User","description":"Create a new user.\n\n    This endpoint creates a new user with a unique username.\n\n    - **username**: The username of the new user (must be unique).\n    - **password**: The password of the new user.\n\n    If the username already exists, an HTTP 400 error is returned.","operationId":"create_user_api_user_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserMe"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/withdraw":{"post":{"tags":["user"],"summary":"Withdraw TRX from balance","description":"Withdraw TRX from the user's balance.\nA fee of 1 TRX is applied to each withdrawal.","operationId":"withdraw_api_user_withdraw_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WithdrawRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/user/balance/logs":{"get":{"tags":["user"],"summary":"Get Current User's Balance Logs","description":"Retrieve the balance logs for the currently authenticated user.","operationId":"get_current_user_balance_logs_api_user_balance_logs_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Size"},"description":"Page size"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedBalanceLog"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/whitelist":{"post":{"tags":["user","whitelist"],"summary":"Create Whitelisted Address","operationId":"create_whitelisted_address_api_user_whitelist_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddressCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["user","whitelist"],"summary":"Read Whitelisted Addresses","operationId":"read_whitelisted_addresses_api_user_whitelist_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/WhitelistedAddress"},"title":"Response Read Whitelisted Addresses Api User Whitelist Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/whitelist/{tron_address}/disable":{"put":{"tags":["user","whitelist"],"summary":"Disable Whitelisted Address","operationId":"disable_whitelisted_address_api_user_whitelist__tron_address__disable_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tron_address","in":"path","required":true,"schema":{"type":"string","title":"Tron Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/whitelist/{tron_address}/enable":{"put":{"tags":["user","whitelist"],"summary":"Enable Whitelisted Address","operationId":"enable_whitelisted_address_api_user_whitelist__tron_address__enable_put","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"tron_address","in":"path","required":true,"schema":{"type":"string","title":"Tron Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhitelistedAddress"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/order/bandwidth":{"post":{"tags":["orders"],"summary":"Provide Bandwidth","description":"Provide bandwidth for one usdt transaction","operationId":"bandwidth_order_api_order_bandwidth_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderActivate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/order/bandwidth_units":{"post":{"tags":["orders"],"summary":"Provide Bandwidth","description":"This is only used for renting bandwidth as multiplier of 345. 2 transactions = 690,..","operationId":"bandwidth_order_api_order_bandwidth_units_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderBandwidth"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/order/activate":{"post":{"tags":["orders"],"summary":"Activate a wallet","description":"Activate a newly created wallet","operationId":"activate_order_api_order_activate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderActivate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/order":{"post":{"tags":["orders"],"summary":"Create an Order","description":"Create a new order with the specified details.","operationId":"create_order_endpoint_api_order_post","security":[{"OAuth2PasswordBearer":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["orders"],"summary":"Get All Orders","description":"Get all orders for the current user or all orders if the user is an admin.","operationId":"get_orders_api_order_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"from_address","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"From Address"}},{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer","minimum":1,"description":"Page number","default":1,"title":"Page"},"description":"Page number"},{"name":"size","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"description":"Page size","default":50,"title":"Size"},"description":"Page size"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaginatedOrders"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/order/estimate":{"get":{"tags":["orders"],"summary":"Estimate Order Cost","description":"Estimate the cost of an order with the specified details.","operationId":"estimate_order_cost_api_order_estimate_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"from_address","in":"query","required":true,"schema":{"title":"From Address"}},{"name":"to_address","in":"query","required":true,"schema":{"title":"To Address"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEstimate"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/order/energy":{"post":{"tags":["orders"],"summary":"Create an Order with Specific Energy","description":"Create a new order with the specified details.","operationId":"create_order_energy_api_order_energy_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEnergy"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/order/summary":{"get":{"tags":["orders"],"summary":"Get Order Summary","description":"Retrieve total energy volume, bandwidth usage, wallet activations, and order count with optional date filtering.","operationId":"get_order_summary_api_order_summary_get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"start_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Date"}},{"name":"end_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderSummary"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/order/{order_id}":{"get":{"tags":["orders"],"summary":"Get Order by ID","description":"Retrieve the details of an order by its ID. Admins can retrieve any order, users can retrieve only their own orders.","operationId":"get_order_by_id_api_order__order_id__get","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"integer","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Order"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/prices":{"get":{"tags":["public"],"summary":"Get Prices","operationId":"get_prices_api_prices_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceData"}}}}}}},"/api/estimate_usdt":{"get":{"tags":["public"],"summary":"Estimate Transaction","operationId":"estimate_transaction_api_estimate_usdt_get","parameters":[{"name":"from_address","in":"query","required":true,"schema":{"type":"string","description":"Sender address","title":"From Address"},"description":"Sender address"},{"name":"to_address","in":"query","required":true,"schema":{"type":"string","description":"Receiver address","title":"To Address"},"description":"Receiver address"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/rent_usdt":{"post":{"tags":["public"],"summary":"Rent Energy Endpoint","description":"Process the signed transaction and rent energy","operationId":"rent_energy_endpoint_api_rent_usdt_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransactionUSDTRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/swap/estimate":{"post":{"tags":["public"],"summary":"Estimate swap output amount","description":"Estimate the output amount for a token swap.\n\n- **type**: Token type ('usdt' or 'trx')\n- **amount**: Amount to swap\n\nReturns the estimated payout after a percentage fee with a TRX floor\n(swap_fee_percent and swap_min_fee_trx in price_settings). The returned\nto_amount is negative when the fee exceeds the swap output — in that\ncase the worker will refund the deposit (minus swap_refund_fee_*) or\nleave it in the inbox wallet if even the refund fee can't be covered.","operationId":"estimate_swap_api_v1_swap_estimate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapEstimateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SwapEstimateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/telegram":{"get":{"tags":["telegram"],"summary":"Connection","operationId":"connection_api_user_telegram_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["telegram"],"summary":"Disconnect","operationId":"disconnect_api_user_telegram_delete","responses":{"204":{"description":"Successful Response"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/user/telegram/link":{"post":{"tags":["telegram"],"summary":"Start Link","operationId":"start_link_api_user_telegram_link_post","responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/api/user/telegram/link/{link_id}/confirm":{"post":{"tags":["telegram"],"summary":"Confirm Link","operationId":"confirm_link_api_user_telegram_link__link_id__confirm_post","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"link_id","in":"path","required":true,"schema":{"type":"string","title":"Link Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/user/telegram/link/{link_id}":{"delete":{"tags":["telegram"],"summary":"Cancel Link","operationId":"cancel_link_api_user_telegram_link__link_id__delete","security":[{"OAuth2PasswordBearer":[]}],"parameters":[{"name":"link_id","in":"path","required":true,"schema":{"type":"string","title":"Link Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/telegram/access":{"post":{"tags":["telegram"],"summary":"Setup Access","operationId":"setup_access_api_telegram_access_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessSetup"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AccessSetup":{"properties":{"token":{"type":"string","maxLength":64,"minLength":32,"title":"Token"},"username":{"type":"string","maxLength":128,"minLength":3,"pattern":"^[A-Za-z0-9_@.\\-+]+$","title":"Username"},"password":{"type":"string","maxLength":72,"minLength":12,"title":"Password"}},"type":"object","required":["token","username","password"],"title":"AccessSetup"},"BalanceLog":{"properties":{"type":{"type":"string","title":"Type"},"amount":{"type":"number","minimum":0.0,"title":"Amount","description":"Must be a non-negative value"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"balance":{"type":"number","title":"Balance"}},"type":"object","required":["type","amount","created_at","balance"],"title":"BalanceLog"},"Body_authorize_api_user_token_post":{"properties":{"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_authorize_api_user_token_post"},"DailyOrderSummary":{"properties":{"date":{"type":"string","title":"Date"},"energy_trx":{"type":"number","minimum":0.0,"title":"Energy Trx","description":"Must be a non-negative value"},"bandwidth_trx":{"type":"number","minimum":0.0,"title":"Bandwidth Trx","description":"Must be a non-negative value"},"activation_trx":{"type":"number","minimum":0.0,"title":"Activation Trx","description":"Must be a non-negative value"},"order_count":{"type":"integer","minimum":0.0,"title":"Order Count","description":"Must be a non-negative integer"},"energy_units":{"type":"integer","minimum":0.0,"title":"Energy Units","description":"Must be a non-negative integer"},"bandwidth_count":{"type":"integer","minimum":0.0,"title":"Bandwidth Count","description":"Must be a non-negative integer"},"activation_count":{"type":"integer","minimum":0.0,"title":"Activation Count","description":"Must be a non-negative integer"},"internal_costs":{"anyOf":[{"$ref":"#/components/schemas/InternalCosts"},{"type":"null"}]}},"type":"object","required":["date","energy_trx","bandwidth_trx","activation_trx","order_count","energy_units","bandwidth_count","activation_count"],"title":"DailyOrderSummary"},"EstimateResponse":{"properties":{"activation_fee":{"type":"number","minimum":0.0,"title":"Activation Fee","description":"Must be a non-negative value"},"trx_topup_fee":{"type":"number","minimum":0.0,"title":"Trx Topup Fee","description":"Must be a non-negative value"},"trx_to_send":{"type":"number","minimum":0.0,"title":"Trx To Send","description":"Must be a non-negative value"},"energy_fee":{"type":"number","minimum":0.0,"title":"Energy Fee","description":"Must be a non-negative value"},"total_cost":{"type":"number","minimum":0.0,"title":"Total Cost","description":"Must be a non-negative value"},"energy_units":{"type":"integer","minimum":0.0,"title":"Energy Units","description":"Must be a non-negative integer"}},"type":"object","required":["activation_fee","trx_topup_fee","trx_to_send","energy_fee","total_cost","energy_units"],"title":"EstimateResponse"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"InternalCosts":{"properties":{"energy_cost":{"type":"number","minimum":0.0,"title":"Energy Cost","description":"Must be a non-negative value"},"bandwidth_cost":{"type":"number","minimum":0.0,"title":"Bandwidth Cost","description":"Must be a non-negative value"},"activation_cost":{"type":"number","minimum":0.0,"title":"Activation Cost","description":"Must be a non-negative value"}},"type":"object","required":["energy_cost","bandwidth_cost","activation_cost"],"title":"InternalCosts"},"Order":{"properties":{"id":{"type":"integer","title":"Id"},"user_id":{"type":"integer","title":"User Id"},"from_address":{"type":"string","title":"From Address"},"to_address":{"type":"string","title":"To Address"},"energy_amount":{"type":"integer","title":"Energy Amount"},"energy_fee":{"type":"number","title":"Energy Fee"},"energy_hash":{"type":"string","title":"Energy Hash"},"activation_fee":{"type":"number","title":"Activation Fee"},"activation_hash":{"type":"string","title":"Activation Hash"},"bandwidth_fee":{"type":"number","title":"Bandwidth Fee"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","user_id","from_address","to_address","energy_amount","energy_fee","energy_hash","activation_fee","activation_hash","bandwidth_fee","created_at"],"title":"Order"},"OrderActivate":{"properties":{"from_address":{"type":"string","title":"From Address"}},"type":"object","required":["from_address"],"title":"OrderActivate"},"OrderBandwidth":{"properties":{"from_address":{"type":"string","title":"From Address"},"bandwidth_units":{"type":"integer","minimum":0.0,"title":"Bandwidth Units","description":"Must be a non-negative integer"}},"type":"object","required":["from_address","bandwidth_units"],"title":"OrderBandwidth"},"OrderCreate":{"properties":{"from_address":{"type":"string","title":"From Address"},"to_address":{"type":"string","title":"To Address"}},"type":"object","required":["from_address","to_address"],"title":"OrderCreate"},"OrderEnergy":{"properties":{"from_address":{"type":"string","title":"From Address"},"energy_units":{"type":"integer","maximum":2147483647.0,"minimum":10000.0,"title":"Energy Units"}},"type":"object","required":["from_address","energy_units"],"title":"OrderEnergy"},"OrderEstimate":{"properties":{"activation_fee":{"type":"number","minimum":0.0,"title":"Activation Fee","description":"Must be a non-negative value"},"bandwidth_fee":{"type":"number","minimum":0.0,"title":"Bandwidth Fee","description":"Must be a non-negative value"},"energy_fee":{"type":"number","minimum":0.0,"title":"Energy Fee","description":"Must be a non-negative value"},"total_cost":{"type":"number","minimum":0.0,"title":"Total Cost","description":"Must be a non-negative value"},"energy_units":{"type":"integer","minimum":0.0,"title":"Energy Units","description":"Must be a non-negative integer"}},"type":"object","required":["activation_fee","bandwidth_fee","energy_fee","total_cost","energy_units"],"title":"OrderEstimate"},"OrderSummary":{"properties":{"total_orders":{"type":"integer","minimum":0.0,"title":"Total Orders","description":"Must be a non-negative integer"},"total_energy":{"additionalProperties":true,"type":"object","title":"Total Energy"},"total_bandwidth_usage":{"additionalProperties":true,"type":"object","title":"Total Bandwidth Usage"},"total_wallet_activations":{"additionalProperties":true,"type":"object","title":"Total Wallet Activations"},"daily_summary":{"items":{"$ref":"#/components/schemas/DailyOrderSummary"},"type":"array","title":"Daily Summary"},"internal_costs":{"anyOf":[{"$ref":"#/components/schemas/InternalCosts"},{"type":"null"}]}},"type":"object","required":["total_orders","total_energy","total_bandwidth_usage","total_wallet_activations","daily_summary"],"title":"OrderSummary"},"PaginatedBalanceLog":{"properties":{"items":{"items":{"$ref":"#/components/schemas/BalanceLog"},"type":"array","title":"Items"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"page":{"type":"integer","minimum":1.0,"title":"Page"},"size":{"type":"integer","minimum":1.0,"title":"Size"},"pages":{"type":"integer","minimum":0.0,"title":"Pages"}},"type":"object","required":["items","total","page","size","pages"],"title":"PaginatedBalanceLog"},"PaginatedOrders":{"properties":{"items":{"items":{"$ref":"#/components/schemas/Order"},"type":"array","title":"Items"},"total":{"type":"integer","minimum":0.0,"title":"Total"},"page":{"type":"integer","minimum":1.0,"title":"Page"},"size":{"type":"integer","minimum":1.0,"title":"Size"},"pages":{"type":"integer","minimum":0.0,"title":"Pages"}},"type":"object","required":["items","total","page","size","pages"],"title":"PaginatedOrders"},"PasswordChange":{"properties":{"old_password":{"type":"string","format":"password","title":"Old Password","writeOnly":true},"new_password":{"type":"string","maxLength":72,"minLength":12,"format":"password","title":"New Password","description":"At most 72 UTF-8 bytes.","writeOnly":true}},"additionalProperties":false,"type":"object","required":["old_password","new_password"],"title":"PasswordChange"},"PriceData":{"properties":{"energyPrice":{"type":"number","minimum":0.0,"title":"Energyprice","description":"Must be a non-negative value"},"activationPrice":{"type":"number","minimum":0.0,"title":"Activationprice","description":"Must be a non-negative value"},"bandwidthPrice":{"type":"number","minimum":0.0,"title":"Bandwidthprice","description":"Must be a non-negative value"},"competitorPrice":{"type":"number","minimum":0.0,"title":"Competitorprice","description":"Must be a non-negative value"},"wUSDT":{"type":"integer","minimum":0.0,"title":"Wusdt","description":"Must be a non-negative integer"},"woUSDT":{"type":"integer","minimum":0.0,"title":"Wousdt","description":"Must be a non-negative integer"},"activation_usdt":{"type":"number","minimum":0.0,"title":"Activation Usdt","description":"Must be a non-negative value"},"trx_topup_small":{"type":"number","minimum":0.0,"title":"Trx Topup Small","description":"Must be a non-negative value"},"trx_topup_large":{"type":"number","minimum":0.0,"title":"Trx Topup Large","description":"Must be a non-negative value"},"usdt_energy_transaction":{"type":"number","minimum":0.0,"title":"Usdt Energy Transaction","description":"Must be a non-negative value"},"swap_fee_percent":{"type":"number","minimum":0.0,"title":"Swap Fee Percent","description":"Must be a non-negative value"},"swap_min_fee_trx":{"type":"number","minimum":0.0,"title":"Swap Min Fee Trx","description":"Must be a non-negative value"},"swap_refund_fee_trx":{"type":"number","minimum":0.0,"title":"Swap Refund Fee Trx","description":"Must be a non-negative value"},"swap_refund_fee_usdt":{"type":"number","minimum":0.0,"title":"Swap Refund Fee Usdt","description":"Must be a non-negative value"}},"type":"object","required":["energyPrice","activationPrice","bandwidthPrice","competitorPrice","wUSDT","woUSDT","activation_usdt","trx_topup_small","trx_topup_large","usdt_energy_transaction","swap_fee_percent","swap_min_fee_trx","swap_refund_fee_trx","swap_refund_fee_usdt"],"title":"PriceData"},"SwapEstimateRequest":{"properties":{"type":{"type":"string","title":"Type"},"amount":{"type":"number","minimum":0.0,"title":"Amount","description":"Must be a non-negative value"}},"type":"object","required":["type","amount"],"title":"SwapEstimateRequest"},"SwapEstimateResponse":{"properties":{"from_token":{"type":"string","title":"From Token"},"to_token":{"type":"string","title":"To Token"},"from_amount":{"type":"number","minimum":0.0,"title":"From Amount","description":"Must be a non-negative value"},"to_amount":{"type":"number","title":"To Amount","description":"Negative when fees exceed swap output"}},"type":"object","required":["from_token","to_token","from_amount","to_amount"],"title":"SwapEstimateResponse"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type"}},"type":"object","required":["access_token","token_type"],"title":"Token"},"TransactionUSDTRequest":{"properties":{"signedTransaction":{"type":"string","title":"Signedtransaction"},"to_address":{"type":"string","title":"To Address"}},"type":"object","required":["signedTransaction","to_address"],"title":"TransactionUSDTRequest"},"UserCreate":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"recaptcha_token":{"type":"string","title":"Recaptcha Token"}},"type":"object","required":["username","password","recaptcha_token"],"title":"UserCreate"},"UserMe":{"properties":{"id":{"type":"integer","title":"Id"},"username":{"type":"string","title":"Username"},"address":{"type":"string","title":"Address"},"role":{"type":"string","title":"Role"},"balance":{"type":"number","title":"Balance"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"whitelisted_addresses":{"items":{"$ref":"#/components/schemas/WhitelistedAddress"},"type":"array","title":"Whitelisted Addresses","default":[]}},"type":"object","required":["id","username","address","role","balance","updated_at","created_at"],"title":"UserMe"},"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"},"WhitelistedAddress":{"properties":{"tron_address":{"type":"string","maxLength":34,"minLength":34,"title":"Tron Address"},"id":{"type":"integer","title":"Id"},"is_active":{"type":"boolean","title":"Is Active"},"total_energy_rented":{"type":"integer","title":"Total Energy Rented"},"total_bandwidth_rented":{"type":"integer","title":"Total Bandwidth Rented"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["tron_address","id","is_active","total_energy_rented","total_bandwidth_rented","created_at"],"title":"WhitelistedAddress"},"WhitelistedAddressCreate":{"properties":{"tron_address":{"type":"string","maxLength":34,"minLength":34,"title":"Tron Address"}},"type":"object","required":["tron_address"],"title":"WhitelistedAddressCreate"},"WithdrawRequest":{"properties":{"amount":{"type":"number","maximum":20.0,"exclusiveMinimum":0.0,"title":"Amount","description":"Amount to withdraw, max 20 TRX"},"to_address":{"type":"string","title":"To Address"}},"type":"object","required":["amount","to_address"],"title":"WithdrawRequest"}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/api/user/token"}}}}}}