remove silly logger from ws by default. Expand spot and linear types

This commit is contained in:
tiagosiebler
2022-08-18 17:04:53 +01:00
parent ae56067c94
commit 2d0366a708
15 changed files with 174 additions and 31 deletions

View File

@@ -0,0 +1,3 @@
export * from './shared';
export * from './spot';
export * from './usdt-perp';

View File

@@ -0,0 +1,19 @@
export interface SymbolWalletBalance {
equity: number;
available_balance: number;
used_margin: number;
order_margin: number;
position_margin: number;
occ_closing_fee: number;
occ_funding_fee: number;
wallet_balance: number;
realised_pnl: number;
unrealised_pnl: number;
cum_realised_pnl: number;
given_cash: number;
service_cash: number;
}
export interface WalletBalances {
[symbol: string]: SymbolWalletBalance | undefined;
}

View File

@@ -0,0 +1,17 @@
export interface SpotBalances {
balances: SpotBalance[];
}
export interface SpotBalance {
coin: string;
coinId: string;
coinName: string;
total: string;
free: string;
locked: string;
}
export interface SpotLastPrice {
symbol: string;
price: string;
}

View File

@@ -0,0 +1,58 @@
export interface PerpPosition {
user_id: number;
symbol: string;
side: string;
size: number;
position_value: number;
entry_price: number;
liq_price: number;
bust_price: number;
leverage: number;
auto_add_margin: number;
is_isolated: boolean;
position_margin: number;
occ_closing_fee: number;
realised_pnl: number;
cum_realised_pnl: number;
free_qty: number;
tp_sl_mode: string;
unrealised_pnl: number;
deleverage_indicator: number;
risk_id: number;
stop_loss: number;
take_profit: number;
trailing_stop: number;
position_idx: number;
mode: string;
}
export interface PerpPositionRoot {
data: PerpPosition;
is_valid: boolean;
}
export interface LinearOrder {
order_id: string;
user_id: number;
symbol: string;
side: string;
order_type: string;
price: number;
qty: number;
time_in_force: string;
order_status: string;
last_exec_price: number;
cum_exec_qty: number;
cum_exec_value: number;
cum_exec_fee: number;
reduce_only: boolean;
close_on_trigger: boolean;
order_link_id: string;
created_time: string;
updated_time: string;
take_profit: number;
stop_loss: number;
tp_trigger_by: string;
sl_trigger_by: string;
position_idx: number;
}