aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/parsers
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-11-08 07:29:34 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:24 +0800
commit62412b8551d1171844c9cdb30f2b2fe0ab2ba66b (patch)
tree41d3165343b75a802f3004fae1dcea081ac01a11 /packages/pipeline/src/parsers
parent374d51309007ceef8112b5999195e20e49b26c5f (diff)
downloaddexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar.gz
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar.bz2
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar.lz
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar.xz
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.tar.zst
dexon-0x-contracts-62412b8551d1171844c9cdb30f2b2fe0ab2ba66b.zip
Update relayer code to use new relayer-registry format
Diffstat (limited to 'packages/pipeline/src/parsers')
-rw-r--r--packages/pipeline/src/parsers/relayer_registry/index.ts8
1 files changed, 6 insertions, 2 deletions
diff --git a/packages/pipeline/src/parsers/relayer_registry/index.ts b/packages/pipeline/src/parsers/relayer_registry/index.ts
index 6eca10167..50fd12443 100644
--- a/packages/pipeline/src/parsers/relayer_registry/index.ts
+++ b/packages/pipeline/src/parsers/relayer_registry/index.ts
@@ -3,10 +3,14 @@ import * as R from 'ramda';
import { RelayerResponse, RelayerResponseNetwork } from '../../data_sources/relayer-registry';
import { Relayer } from '../../entities/Relayer';
-export const parseRelayers = R.map(parseRelayer);
+export function parseRelayers(rawResp: Map<string, RelayerResponse>): Relayer[] {
+ const parsedAsObject = R.mapObjIndexed(parseRelayer, rawResp);
+ return R.values(parsedAsObject);
+}
-function parseRelayer(relayerResp: RelayerResponse): Relayer {
+function parseRelayer(relayerResp: RelayerResponse, uuid: string): Relayer {
const relayer = new Relayer();
+ relayer.uuid = uuid;
relayer.name = relayerResp.name;
relayer.url = relayerResp.homepage_url;
relayer.appUrl = relayerResp.app_url;