diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-08-16 08:52:13 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-08-16 08:52:13 +0800 |
commit | ca5e52920d5fd8388fc1f62f0a98908adfc69c08 (patch) | |
tree | fb0b468195aa991fd9ad5065afb2d7882543077b /packages/connect/src | |
parent | 30dfb7511dc695b2dc7514c2908e632e0969ddfd (diff) | |
download | dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar.gz dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar.bz2 dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar.lz dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar.xz dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.tar.zst dexon-sol-tools-ca5e52920d5fd8388fc1f62f0a98908adfc69c08.zip |
Add fee recipients test
Diffstat (limited to 'packages/connect/src')
-rw-r--r-- | packages/connect/src/http_client.ts | 10 | ||||
-rw-r--r-- | packages/connect/src/types.ts | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index 35d7ee77e..5aeba19dd 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -140,10 +140,14 @@ export class HttpClient implements Client { /** * Retrieve the list of fee recipient addresses used by */ - public async getFeeRecipientsAsync(): Promise<FeeRecipientsResponse> { - return this._requestAsync('/fee_recipients', HttpRequestType.Get); + public async getFeeRecipientsAsync(requestOpts?: PagedRequestOpts): Promise<FeeRecipientsResponse> { + if (!_.isUndefined(requestOpts)) { + assert.doesConformToSchema('requestOpts', requestOpts, clientSchemas.pagedRequestOptsSchema); + } + const feeRecipients = await this._requestAsync('/fee_recipients', HttpRequestType.Get); + assert.doesConformToSchema('feeRecipients', feeRecipients, schemas.relayerApiFeeRecipientsResponseSchema); + return feeRecipients; } - /** * Submit a signed order to the API * @param signedOrder A SignedOrder instance to submit diff --git a/packages/connect/src/types.ts b/packages/connect/src/types.ts index 42417f709..44ea4abd6 100644 --- a/packages/connect/src/types.ts +++ b/packages/connect/src/types.ts @@ -7,7 +7,7 @@ export interface Client { getOrderAsync: (orderHash: string) => Promise<APIOrder>; getOrderbookAsync: (request: OrderbookRequest, requestOpts?: PagedRequestOpts) => Promise<OrderbookResponse>; getOrderConfigAsync: (request: OrderConfigRequest) => Promise<OrderConfigResponse>; - getFeeRecipientsAsync: () => Promise<FeeRecipientsResponse>; + getFeeRecipientsAsync: (requestOpts?: PagedRequestOpts) => Promise<FeeRecipientsResponse>; submitOrderAsync: (signedOrder: SignedOrder) => Promise<void>; } |