Skip to content

Commit

Permalink
feat: add authorized apis interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tolgaand committed Mar 20, 2024
1 parent 6913ea8 commit 2842806
Show file tree
Hide file tree
Showing 9 changed files with 98 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/interfaces/api-responses/balances-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
interface BalanceDetails {
available: string;
locked: string;
staked: string;
}

export interface BalancesResponse {
[property: string]: BalanceDetails;
}
20 changes: 20 additions & 0 deletions src/interfaces/api-responses/deposits-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
interface DepositResponse {
id: number;
toAddress: string;
fromAddress: string;
confirmationBlockNumber: number;
providerId: string;
source: string;
status: string;
transactionHash: string;
subaccountId: number;
symbol: string;
quantity: string;
createdAt: string;
}

export interface DepositAddressResponse {
address: string;
}

export interface DepositsResponse extends Array<DepositResponse> {}
14 changes: 14 additions & 0 deletions src/interfaces/api-responses/fill-history-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
interface FillHistory {
tradeId: number;
orderId: string;
symbol: string;
side: string;
price: string;
quantity: string;
fee: string;
feeSymbol: string;
isMaker: boolean;
timestamp: string;
}

export interface FillHistoryResponse extends Array<FillHistory> {}
5 changes: 5 additions & 0 deletions src/interfaces/api-responses/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,8 @@ export * from "./depth-response";
export * from "./klines-response";
export * from "./status-response";
export * from "./trades-response";
export * from "./orders-response";
export * from "./balances-response";
export * from "./deposits-response";
export * from "./withdrawals-response";
export * from "./fill-history-response";
32 changes: 32 additions & 0 deletions src/interfaces/api-responses/orders-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import { OrderType } from "../order-type";
import { Side } from "../side";

interface OrderResponse {
orderType: OrderType;
id: string;
clientId: number;
symbol: string;
side: Side;
quantity: string;
executedQuantity: string;
quoteQuantity: string;
executedQuoteQuantity: string;
triggerPrice: string;
timeInForce: string;
selfTradePrevention: string;
status: string;
createdAt: number;
}

export interface OrderHistoryResponse
extends Omit<OrderResponse, "executedQuantity" | "executedQuoteQuantity"> {
price: string;
postOnly: boolean;
}

export interface OpenOrderResponse extends OrderResponse {}
export interface CancelOrderResponse extends OrderResponse {}
export interface ExecuteOrderResponse extends OrderResponse {}

export interface OpenOrdersResponse extends Array<OrderResponse> {}
export interface CancelOrdersResponse extends Array<OrderResponse> {}
16 changes: 16 additions & 0 deletions src/interfaces/api-responses/withdrawals-response.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
interface Withdrawal {
id: number;
blockchain: string;
clientId: string;
identifier: string;
quantity: string;
fee: string;
symbol: string;
status: string;
subaccountId: number;
toAddress: string;
transactionHash: string;
createdAt: string;
}

export interface WithdrawalsResponse extends Array<Withdrawal> {}
File renamed without changes.
1 change: 1 addition & 0 deletions src/interfaces/order-type.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type OrderType = "Limit" | "Market";
1 change: 1 addition & 0 deletions src/interfaces/side.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export type Side = "Bid" | "Ask";

0 comments on commit 2842806

Please sign in to comment.