diff --git a/cli/src/delegator.ts b/cli/src/delegator.ts index 22f55088d..3150eaf47 100644 --- a/cli/src/delegator.ts +++ b/cli/src/delegator.ts @@ -298,9 +298,11 @@ export function reporterListHandler() { try { const endpoint = buildUrl(ORAKL_NETWORK_DELEGATOR_URL, `reporter`) const result = (await axios.get(endpoint)).data + const printResult: any[] = [] for (const reporter of result) { if (!reporter.contract) { + printResult.push(reporter) continue } const url = new URL(AGGREGATOR_ENDPOINT) @@ -308,10 +310,11 @@ export function reporterListHandler() { const aggregatorResult = (await axios.get(url.toString())).data if (aggregatorResult && aggregatorResult[0].name) { reporter.name = aggregatorResult[0].name + printResult.push(reporter) } } - console.log(result) + console.log(printResult) return result } catch (e) { console.error('Delegator Reporter was not listed. Reason:') diff --git a/cli/src/listener.ts b/cli/src/listener.ts index 5d37c9871..64636a771 100644 --- a/cli/src/listener.ts +++ b/cli/src/listener.ts @@ -126,20 +126,25 @@ export function listHandler(print?: boolean) { try { const result = (await axios.get(LISTENER_ENDPOINT, { data: { chain, service } }))?.data + + const printResult: any[] = [] if (print) { for (const listener of result) { if (listener.service != 'DATA_FEED') { + printResult.push(listener) continue } + const url = new URL(AGGREGATOR_ENDPOINT) url.searchParams.append('address', listener.address) const aggregatorResult = (await axios.get(url.toString())).data if (aggregatorResult && aggregatorResult[0].name) { listener.name = aggregatorResult[0].name + printResult.push(listener) } } - console.dir(result, { depth: null }) + console.dir(printResult, { depth: null }) } return result } catch (e) { diff --git a/cli/src/reporter.ts b/cli/src/reporter.ts index 42410f9d6..4291c4f39 100644 --- a/cli/src/reporter.ts +++ b/cli/src/reporter.ts @@ -149,9 +149,11 @@ export function listHandler(print?: boolean) { try { const result = (await axios.get(REPORTER_ENDPOINT, { data: { chain, service } }))?.data + const printResult: any[] = [] if (print) { for (const reporter of result) { if (reporter.service != 'DATA_FEED') { + printResult.push(reporter) continue } const url = new URL(AGGREGATOR_ENDPOINT) @@ -159,10 +161,11 @@ export function listHandler(print?: boolean) { const aggregatorResult = (await axios.get(url.toString())).data if (aggregatorResult && aggregatorResult[0].name) { reporter.name = aggregatorResult[0].name + printResult.push(reporter) } } - console.dir(result, { depth: null }) + console.dir(printResult, { depth: null }) } return result } catch (e) {