Update connect types in preperation for publishing

This commit is contained in:
Brandon Millman
2017-12-07 10:35:18 -08:00
parent f1ecdcf602
commit 3c64b33f5c
4 changed files with 6 additions and 7 deletions

View File

@@ -3,6 +3,7 @@
vx.x.x
------------------------
* Expose WebSocketOrderbookChannel and associated types to public interface (#251)
* Remove tokenA and tokenB fields from OrdersRequest (#256)
v0.2.0 - _November 29, 2017_
------------------------

View File

@@ -63,7 +63,7 @@ export interface OrderbookChannelHandler {
order: SignedOrder) => void;
onError: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts,
err: Error) => void;
onClose: (channel: OrderbookChannel) => void;
onClose: (channel: OrderbookChannel, subscriptionOpts: OrderbookChannelSubscriptionOpts) => void;
}
export type OrderbookChannelMessage =
@@ -128,8 +128,6 @@ export interface OrdersRequest {
tokenAddress?: string;
makerTokenAddress?: string;
takerTokenAddress?: string;
tokenA?: string;
tokenB?: string;
maker?: string;
taker?: string;
trader?: string;

View File

@@ -62,7 +62,7 @@ export class WebSocketOrderbookChannel implements OrderbookChannel {
handler.onError(this, subscriptionOpts, wsError);
});
connection.on(WebsocketConnectionEventType.Close, () => {
handler.onClose(this);
handler.onClose(this, subscriptionOpts);
});
connection.on(WebsocketConnectionEventType.Message, message => {
this._handleWebSocketMessage(subscribeMessage.requestId, subscriptionOpts, message, handler);

View File

@@ -61,12 +61,12 @@ describe('HttpClient', () => {
const orders = await relayerClient.getOrdersAsync();
expect(orders).to.be.deep.equal(ordersResponse);
});
it('gets specfic orders for request', async () => {
it('gets specific orders for request', async () => {
const tokenAddress = '0x323b5d4c32345ced77393b3530b1eed0f346429d';
const ordersRequest = {
tokenA: tokenAddress,
tokenAddress,
};
const urlWithQuery = `${url}?tokenA=${tokenAddress}`;
const urlWithQuery = `${url}?tokenAddress=${tokenAddress}`;
fetchMock.get(urlWithQuery, ordersResponseJSON);
const orders = await relayerClient.getOrdersAsync(ordersRequest);
expect(orders).to.be.deep.equal(ordersResponse);