diff --git a/.github/workflows/npmpublish.yml b/.github/workflows/npmpublish.yml index f2af8e7..b0b36fc 100644 --- a/.github/workflows/npmpublish.yml +++ b/.github/workflows/npmpublish.yml @@ -42,6 +42,8 @@ jobs: - run: npm ci if: steps.version-updated.outputs.has-updated + - run: npm run clean + if: steps.version-updated.outputs.has-updated - run: npm run build if: steps.version-updated.outputs.has-updated - run: npm publish diff --git a/package.json b/package.json index 47ac72c..b933318 100644 --- a/package.json +++ b/package.json @@ -11,8 +11,9 @@ "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "clean": "rm -rf lib dist", - "prebuild": "npm run clean", + "buildclean": "npm run clean && npm run build", "build": "tsc", + "build:watch": "npm run clean && tsc --watch", "pack": "webpack --config webpack/webpack.config.js", "prepublish": "npm run build", "betapublish": "npm publish --tag beta" diff --git a/src/shared-endpoints.ts b/src/shared-endpoints.ts index fe7daed..0f868a0 100644 --- a/src/shared-endpoints.ts +++ b/src/shared-endpoints.ts @@ -82,14 +82,6 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/private/wallet/balance', params) } - getAssetExchangeRecords(params?: { - limit?: number; - from?: number; - direction?: string; - }): GenericAPIResponse { - return this.requestWrapper.get('v2/private/exchange-order/list', params); - } - getWalletFundRecords(params?: { start_date?: string; end_date?: string; @@ -113,6 +105,14 @@ export default class SharedEndpoints { return this.requestWrapper.get('v2/private/wallet/withdraw/list', params); } + getAssetExchangeRecords(params?: { + limit?: number; + from?: number; + direction?: string; + }): GenericAPIResponse { + return this.requestWrapper.get('v2/private/exchange-order/list', params); + } + /** * * API Data Endpoints diff --git a/src/websocket-client.ts b/src/websocket-client.ts index b81520b..27d9825 100644 --- a/src/websocket-client.ts +++ b/src/websocket-client.ts @@ -75,6 +75,16 @@ const getLinearWsKeyForTopic = (topic: string) => { return wsKeyLinearPublic; } +export declare interface WebsocketClient { + on(event: 'open', listener: ({ wsKey: string, event: any }) => void): this; + on(event: 'reconnected', listener: ({ wsKey: string, event: any }) => void): this; + on(event: 'reconnect', listener: () => void): this; + on(event: 'close', listener: () => void): this; + on(event: 'response', listener: (response: any) => void): this; + on(event: 'update', listener: (response: any) => void): this; + on(event: 'error', listener: (response: any) => void): this; +} + export class WebsocketClient extends EventEmitter { private logger: typeof DefaultLogger; private restClient: InverseClient | LinearClient;