diff options
author | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
---|---|---|
committer | Brandon Millman <brandon.millman@gmail.com> | 2018-01-09 08:35:12 +0800 |
commit | 734cf5819aee5d46719d1ca387666bfda6e475bd (patch) | |
tree | 264785cb0666e011b49842b47ac4b2408dddaa28 /packages/connect/src/http_client.ts | |
parent | 9f3acf8e2888b6105062e47664ecd5adaaf3c889 (diff) | |
parent | 35e0b6143ab1405259471e1c9c698bfcd869df5a (diff) | |
download | dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.gz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.bz2 dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.lz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.xz dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.tar.zst dexon-sol-tools-734cf5819aee5d46719d1ca387666bfda6e475bd.zip |
Merge branch 'development' into fix/mutatedInput
* development:
Changes to abi-gen after code review
Added constructor ABIs to abi-gen
Describe #295 in a CHANGELOG
Add #302 description to changelog
Fix formatting
Apply prettier config
Install prettier
Remove formatting esilnt rules
sendTransactionAsync should return txHash string
Added Event generation to abi-gen
Publish
Add dates to CHANGELOG entries
Update subproviders CHANGELOG
Support both personal_sign and eth_sign
Fix Ledger tests given change from `personal_sign` to `eth_sign`
Update subprovider to catch correct RPC method
Rename guide
Update contribution guide
Fix broken links in the abi-gen README
Fix typing generation for arrays in which types separated by |s
Diffstat (limited to 'packages/connect/src/http_client.ts')
-rw-r--r-- | packages/connect/src/http_client.ts | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/packages/connect/src/http_client.ts b/packages/connect/src/http_client.ts index da052ba3c..dcaf5d9a9 100644 --- a/packages/connect/src/http_client.ts +++ b/packages/connect/src/http_client.ts @@ -1,10 +1,10 @@ -import {assert} from '@0xproject/assert'; -import {schemas} from '@0xproject/json-schemas'; +import { assert } from '@0xproject/assert'; +import { schemas } from '@0xproject/json-schemas'; import 'isomorphic-fetch'; import * as _ from 'lodash'; import * as queryString from 'query-string'; -import {schemas as clientSchemas} from './schemas/schemas'; +import { schemas as clientSchemas } from './schemas/schemas'; import { Client, FeesRequest, @@ -18,7 +18,7 @@ import { TokenPairsItem, TokenPairsRequest, } from './types'; -import {typeConverters} from './utils/type_converters'; +import { typeConverters } from './utils/type_converters'; /** * This class includes all the functionality related to interacting with a set of HTTP endpoints @@ -49,8 +49,7 @@ export class HttpClient implements Client { params: request, }; const tokenPairs = await this._requestAsync('/token_pairs', HttpRequestType.Get, requestOpts); - assert.doesConformToSchema( - 'tokenPairs', tokenPairs, schemas.relayerApiTokenPairsResponseSchema); + assert.doesConformToSchema('tokenPairs', tokenPairs, schemas.relayerApiTokenPairsResponseSchema); _.each(tokenPairs, (tokenPair: object) => { typeConverters.convertStringsFieldsToBigNumbers(tokenPair, [ 'tokenA.minAmount', @@ -131,8 +130,11 @@ export class HttpClient implements Client { }; await this._requestAsync('/order', HttpRequestType.Post, requestOpts); } - private async _requestAsync(path: string, requestType: HttpRequestType, - requestOptions?: HttpRequestOptions): Promise<any> { + private async _requestAsync( + path: string, + requestType: HttpRequestType, + requestOptions?: HttpRequestOptions, + ): Promise<any> { const params = _.get(requestOptions, 'params'); const payload = _.get(requestOptions, 'payload'); let query = ''; |