2020-08-24 08:29:54 +00:00
|
|
|
import {tEthereumAddress} from './types';
|
2020-08-21 11:07:32 +00:00
|
|
|
import {MockAggregator} from '../types/MockAggregator';
|
2020-08-24 08:29:54 +00:00
|
|
|
import {MockTokenMap} from './contracts-helpers';
|
2020-08-21 11:07:32 +00:00
|
|
|
|
|
|
|
export const getAllTokenAddresses = (mockTokens: MockTokenMap) =>
|
|
|
|
Object.entries(mockTokens).reduce(
|
|
|
|
(accum: {[tokenSymbol: string]: tEthereumAddress}, [tokenSymbol, tokenContract]) => ({
|
|
|
|
...accum,
|
|
|
|
[tokenSymbol]: tokenContract.address,
|
|
|
|
}),
|
|
|
|
{}
|
|
|
|
);
|
|
|
|
export const getAllAggregatorsAddresses = (mockAggregators: {
|
|
|
|
[tokenSymbol: string]: MockAggregator;
|
|
|
|
}) =>
|
|
|
|
Object.entries(mockAggregators).reduce(
|
|
|
|
(accum: {[tokenSymbol: string]: tEthereumAddress}, [tokenSymbol, aggregator]) => ({
|
|
|
|
...accum,
|
|
|
|
[tokenSymbol]: aggregator.address,
|
|
|
|
}),
|
|
|
|
{}
|
|
|
|
);
|