aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/data_sources
diff options
context:
space:
mode:
authorAlex Browne <stephenalexbrowne@gmail.com>2018-10-25 09:34:20 +0800
committerFred Carlsen <fred@sjelfull.no>2018-12-06 19:04:24 +0800
commitb159d4e0ecbd1f1419501c79dbb9bf52004c37b7 (patch)
tree0443e8e86c6ec1e0216fc6e1446dc413fecce8f0 /packages/pipeline/src/data_sources
parent1402a3dfae1be32a346f8b75a4209950bda00b74 (diff)
downloaddexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar.gz
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar.bz2
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar.lz
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar.xz
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.tar.zst
dexon-sol-tools-b159d4e0ecbd1f1419501c79dbb9bf52004c37b7.zip
Implement fetching and parsing relayer info
Diffstat (limited to 'packages/pipeline/src/data_sources')
-rw-r--r--packages/pipeline/src/data_sources/relayer-registry/index.ts33
1 files changed, 33 insertions, 0 deletions
diff --git a/packages/pipeline/src/data_sources/relayer-registry/index.ts b/packages/pipeline/src/data_sources/relayer-registry/index.ts
new file mode 100644
index 000000000..c97b50d27
--- /dev/null
+++ b/packages/pipeline/src/data_sources/relayer-registry/index.ts
@@ -0,0 +1,33 @@
+import axios from 'axios';
+
+export interface RelayerResponse {
+ name: string;
+ homepage_url: string;
+ app_url: string;
+ header_img: string;
+ logo_img: string;
+ networks: RelayerResponseNetwork[];
+}
+
+export interface RelayerResponseNetwork {
+ networkId: number;
+ sra_http_endpoint?: string;
+ sra_ws_endpoint?: string;
+ static_order_fields?: {
+ fee_recipient_addresses?: string[];
+ taker_addresses?: string[];
+ };
+}
+
+export class RelayerRegistrySource {
+ private _url: string;
+
+ constructor(url: string) {
+ this._url = url;
+ }
+
+ public async getRelayerInfoAsync(): Promise<RelayerResponse[]> {
+ const resp = await axios.get<RelayerResponse[]>(this._url);
+ return resp.data;
+ }
+}