diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-10-25 09:34:20 +0800 |
---|---|---|
committer | Fred Carlsen <fred@sjelfull.no> | 2018-12-06 19:04:24 +0800 |
commit | b159d4e0ecbd1f1419501c79dbb9bf52004c37b7 (patch) | |
tree | 0443e8e86c6ec1e0216fc6e1446dc413fecce8f0 /packages/pipeline/src/data_sources | |
parent | 1402a3dfae1be32a346f8b75a4209950bda00b74 (diff) | |
download | dexon-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.ts | 33 |
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; + } +} |