aboutsummaryrefslogtreecommitdiffstats
path: root/packages/connect/src/utils
diff options
context:
space:
mode:
authorBrandon Millman <brandon.millman@gmail.com>2018-01-09 10:02:41 +0800
committerBrandon Millman <brandon.millman@gmail.com>2018-01-09 10:02:41 +0800
commit8019b1b8231cac24dfc6aa3bb2d5115eff11ee89 (patch)
treed270d71404bd3aab44c79dcadf16e348614e9214 /packages/connect/src/utils
parent8fe81c9d090ce50496f3150602f19433e7aedd1e (diff)
parent7a56e83fa3ca02d796deba3359da480834a9f6ea (diff)
downloaddexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar.gz
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar.bz2
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar.lz
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar.xz
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.tar.zst
dexon-sol-tools-8019b1b8231cac24dfc6aa3bb2d5115eff11ee89.zip
Merge branch 'development' into refactor/httpClientJsonParsing
* development: (21 commits) Update connect CHANGELOG 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 ...
Diffstat (limited to 'packages/connect/src/utils')
-rw-r--r--packages/connect/src/utils/orderbook_channel_message_parser.ts19
-rw-r--r--packages/connect/src/utils/type_converters.ts2
2 files changed, 9 insertions, 12 deletions
diff --git a/packages/connect/src/utils/orderbook_channel_message_parser.ts b/packages/connect/src/utils/orderbook_channel_message_parser.ts
index adc565d29..9a9ca8901 100644
--- a/packages/connect/src/utils/orderbook_channel_message_parser.ts
+++ b/packages/connect/src/utils/orderbook_channel_message_parser.ts
@@ -1,13 +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 * as _ from 'lodash';
-import {
- OrderbookChannelMessage,
- OrderbookChannelMessageTypes,
-} from '../types';
+import { OrderbookChannelMessage, OrderbookChannelMessageTypes } from '../types';
-import {relayerResponseJsonParsers} from './relayer_response_json_parsers';
+import { relayerResponseJsonParsers } from './relayer_response_json_parsers';
export const orderbookChannelMessageParser = {
parse(utf8Data: string): OrderbookChannelMessage {
@@ -16,17 +13,17 @@ export const orderbookChannelMessageParser = {
assert.assert(!_.isUndefined(type), `Message is missing a type parameter: ${utf8Data}`);
assert.isString('type', type);
switch (type) {
- case (OrderbookChannelMessageTypes.Snapshot): {
+ case OrderbookChannelMessageTypes.Snapshot: {
assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelSnapshotSchema);
const orderbookJson = messageObj.payload;
const orderbook = relayerResponseJsonParsers.parseOrderbookResponseJson(orderbookJson);
- return _.assign(messageObj, {payload: orderbook});
+ return _.assign(messageObj, { payload: orderbook });
}
- case (OrderbookChannelMessageTypes.Update): {
+ case OrderbookChannelMessageTypes.Update: {
assert.doesConformToSchema('message', messageObj, schemas.relayerApiOrderbookChannelUpdateSchema);
const orderJson = messageObj.payload;
const order = relayerResponseJsonParsers.parseOrderJson(orderJson);
- return _.assign(messageObj, {payload: order});
+ return _.assign(messageObj, { payload: order });
}
default: {
return {
diff --git a/packages/connect/src/utils/type_converters.ts b/packages/connect/src/utils/type_converters.ts
index 5ba1b8291..ad27e0b97 100644
--- a/packages/connect/src/utils/type_converters.ts
+++ b/packages/connect/src/utils/type_converters.ts
@@ -1,4 +1,4 @@
-import {BigNumber} from 'bignumber.js';
+import { BigNumber } from 'bignumber.js';
import * as _ from 'lodash';
export const typeConverters = {