diff --git a/cli/src/delegator.ts b/cli/src/delegator.ts index 5fd45e0c9..c05458d07 100644 --- a/cli/src/delegator.ts +++ b/cli/src/delegator.ts @@ -298,28 +298,28 @@ export function reporterListHandler() { try { const endpoint = buildUrl(ORAKL_NETWORK_DELEGATOR_URL, `reporter`) const result = (await axios.get(endpoint)).data + // const printResult: any[] = [] + + // const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) + // const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data + + // for (const reporter of result) { + // if (!reporter.contract) { + // printResult.push({ ...reporter }) + // continue + // } + + // const aggregator = aggregatorResult.find( + // (aggregator) => aggregator.address === reporter.contract[0] + // ) + // if (aggregator) { + // printResult.push({ ...reporter, name: aggregator.name }) + // } else { + // printResult.push({ ...reporter }) + // } + // } - const printResult: any[] = [] - const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) - const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data - - for (const reporter of result) { - if (!reporter.contract) { - printResult.push({ ...reporter }) - continue - } - - const aggregator = aggregatorResult.find( - (aggregator) => aggregator.address === reporter.contract[0] - ) - if (aggregator) { - printResult.push({ ...reporter, name: aggregator.name }) - } else { - printResult.push({ ...reporter }) - } - } - - console.log(printResult) + console.log(result) 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 91ed32af9..c8096012e 100644 --- a/cli/src/listener.ts +++ b/cli/src/listener.ts @@ -126,28 +126,28 @@ export function listHandler(print?: boolean) { try { const result = (await axios.get(LISTENER_ENDPOINT, { data: { chain, service } }))?.data + // const printResult: any[] = [] - const printResult: any[] = [] - const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) - const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data + // const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) + // const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data if (print) { - for (const listener of result) { - if (listener.service != 'DATA_FEED') { - printResult.push({ ...listener }) - continue - } + // for (const listener of result) { + // if (listener.service != 'DATA_FEED') { + // printResult.push({ ...listener }) + // continue + // } - const aggregator = aggregatorResult.find( - (aggregator) => aggregator.address === listener.address - ) - if (aggregator) { - printResult.push({ ...listener, name: aggregator.name }) - } else { - printResult.push({ ...listener }) - } - } + // const aggregator = aggregatorResult.find( + // (aggregator) => aggregator.address === listener.address + // ) + // if (aggregator) { + // printResult.push({ ...listener, name: aggregator.name }) + // } else { + // printResult.push({ ...listener }) + // } + // } - console.dir(printResult, { depth: null }) + console.dir(result, { depth: null }) } return result } catch (e) { diff --git a/cli/src/reporter.ts b/cli/src/reporter.ts index 7a41ff678..7b27ed19a 100644 --- a/cli/src/reporter.ts +++ b/cli/src/reporter.ts @@ -149,28 +149,28 @@ export function listHandler(print?: boolean) { try { const result = (await axios.get(REPORTER_ENDPOINT, { data: { chain, service } }))?.data + // const printResult: any[] = [] - const printResult: any[] = [] - const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) - const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data + // const aggregatorUrl = new URL(AGGREGATOR_ENDPOINT) + // const aggregatorResult = (await axios.get(aggregatorUrl.toString())).data if (print) { - for (const reporter of result) { - if (reporter.service != 'DATA_FEED') { - printResult.push({ ...reporter }) - continue - } - - const aggregator = aggregatorResult.find( - (aggregator) => aggregator.address === reporter.oracleAddress - ) - if (aggregator) { - printResult.push({ ...reporter, name: aggregator.name }) - } else { - printResult.push({ ...reporter }) - } - } - - console.dir(printResult, { depth: null }) + // for (const reporter of result) { + // if (reporter.service != 'DATA_FEED') { + // printResult.push({ ...reporter }) + // continue + // } + + // const aggregator = aggregatorResult.find( + // (aggregator) => aggregator.address === reporter.oracleAddress + // ) + // if (aggregator) { + // printResult.push({ ...reporter, name: aggregator.name }) + // } else { + // printResult.push({ ...reporter }) + // } + // } + + console.dir(result, { depth: null }) } return result } catch (e) {