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