mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-09 05:51:01 +08:00
feat: add exchange account states and refine beginner trader creation flow (#1450)
* feat: implement exchange account state management and UI updates - Added functionality to invalidate exchange account state cache on exchange config updates, creation, and deletion. - Introduced new API endpoint to fetch exchange account states. - Updated frontend components to display exchange account states, including status and balance information. - Enhanced user experience by refreshing exchange account states after relevant actions. * feat: enhance trader creation readiness in AITradersPage and BeginnerGuideCards --------- Co-authored-by: Dean <afei.wuhao@gmail.com>
This commit is contained in:
@@ -41,6 +41,30 @@ export interface Exchange {
|
||||
lighterApiKeyIndex?: number
|
||||
}
|
||||
|
||||
export type ExchangeAccountStatus =
|
||||
| 'ok'
|
||||
| 'disabled'
|
||||
| 'missing_credentials'
|
||||
| 'invalid_credentials'
|
||||
| 'permission_denied'
|
||||
| 'unavailable'
|
||||
|
||||
export interface ExchangeAccountState {
|
||||
exchange_id: string
|
||||
status: ExchangeAccountStatus
|
||||
display_balance?: string
|
||||
asset?: string
|
||||
total_equity?: number
|
||||
available_balance?: number
|
||||
checked_at: string
|
||||
error_code?: string
|
||||
error_message?: string
|
||||
}
|
||||
|
||||
export interface ExchangeAccountStateResponse {
|
||||
states: Record<string, ExchangeAccountState>
|
||||
}
|
||||
|
||||
export interface CreateExchangeRequest {
|
||||
exchange_type: string // "binance", "bybit", "okx", "hyperliquid", "aster", "lighter"
|
||||
account_name: string // User-defined account name
|
||||
|
||||
Reference in New Issue
Block a user