aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src/types.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/connect/src/types.ts')
-rw-r--r--packages/connect/src/types.ts43
1 files changed, 32 insertions, 11 deletions
diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts
index 75b6b8020..eb6df3ba9 100644
--- a/packages/connect/src/types.ts
+++ b/packages/connect/src/types.ts
@@ -15,6 +15,19 @@ export interface OrderbookChannel {
close: () => void;
}
+/*
+ * baseTokenAddress: The address of token designated as the baseToken in the currency pair calculation of price
+ * quoteTokenAddress: The address of token designated as the quoteToken in the currency pair calculation of price
+ * snapshot: If true, a snapshot of the orderbook will be sent before the updates to the orderbook
+ * limit: Maximum number of bids and asks in orderbook snapshot
+ */
+export interface OrderbookChannelSubscriptionOpts {
+ baseTokenAddress: string;
+ quoteTokenAddress: string;
+ snapshot: boolean;
+ limit: number;
+}
+
export interface OrderbookChannelHandler {
onSnapshot: (channel: OrderbookChannel, snapshot: OrderbookResponse) => void;
onUpdate: (channel: OrderbookChannel, order: SignedOrder) => void;
@@ -48,17 +61,15 @@ export interface UnknownOrderbookChannelMessage {
payload: undefined;
}
-/*
- * baseTokenAddress: The address of token designated as the baseToken in the currency pair calculation of price
- * quoteTokenAddress: The address of token designated as the quoteToken in the currency pair calculation of price
- * snapshot: If true, a snapshot of the orderbook will be sent before the updates to the orderbook
- * limit: Maximum number of bids and asks in orderbook snapshot
- */
-export interface OrderbookChannelSubscriptionOpts {
- baseTokenAddress: string;
- quoteTokenAddress: string;
- snapshot: boolean;
- limit: number;
+export enum WebsocketConnectionEventType {
+ Close = 'close',
+ Error = 'error',
+ Message = 'message',
+}
+
+export enum WebsocketClientEventType {
+ Connect = 'connect',
+ ConnectFailed = 'connectFailed',
}
export interface TokenPairsRequest {
@@ -118,3 +129,13 @@ export interface FeesResponse {
makerFee: BigNumber;
takerFee: BigNumber;
}
+
+export interface HttpRequestOptions {
+ params?: object;
+ payload?: object;
+}
+
+export enum HttpRequestType {
+ Get = 'GET',
+ Post = 'POST',
+}