aboutsummaryrefslogtreecommitdiffstats
path: root/packages/pipeline/src/scripts/pull_trusted_tokens.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/pipeline/src/scripts/pull_trusted_tokens.ts')
-rw-r--r--packages/pipeline/src/scripts/pull_trusted_tokens.ts20
1 files changed, 8 insertions, 12 deletions
diff --git a/packages/pipeline/src/scripts/pull_trusted_tokens.ts b/packages/pipeline/src/scripts/pull_trusted_tokens.ts
index 5906deee6..8afb3e052 100644
--- a/packages/pipeline/src/scripts/pull_trusted_tokens.ts
+++ b/packages/pipeline/src/scripts/pull_trusted_tokens.ts
@@ -1,6 +1,8 @@
import 'reflect-metadata';
import { Connection, ConnectionOptions, createConnection } from 'typeorm';
+import { logUtils } from '@0x/utils';
+
import { MetamaskTrustedTokenMeta, TrustedTokenSource, ZeroExTrustedTokenMeta } from '../data_sources/trusted_tokens';
import { TokenMetadata } from '../entities';
import * as ormConfig from '../ormconfig';
@@ -22,31 +24,25 @@ let connection: Connection;
})().catch(handleError);
async function getMetamaskTrustedTokensAsync(): Promise<void> {
- // tslint:disable-next-line:no-console
- console.log('Getting latest metamask trusted tokens list ...');
+ logUtils.log('Getting latest metamask trusted tokens list ...');
const trustedTokensRepository = connection.getRepository(TokenMetadata);
const trustedTokensSource = new TrustedTokenSource<Map<string, MetamaskTrustedTokenMeta>>(
METAMASK_TRUSTED_TOKENS_URL,
);
const resp = await trustedTokensSource.getTrustedTokenMetaAsync();
const trustedTokens = parseMetamaskTrustedTokens(resp);
- // tslint:disable-next-line:no-console
- console.log('Saving metamask trusted tokens list');
+ logUtils.log('Saving metamask trusted tokens list');
await trustedTokensRepository.save(trustedTokens);
- // tslint:disable-next-line:no-console
- console.log('Done saving metamask trusted tokens.');
+ logUtils.log('Done saving metamask trusted tokens.');
}
async function getZeroExTrustedTokensAsync(): Promise<void> {
- // tslint:disable-next-line:no-console
- console.log('Getting latest 0x trusted tokens list ...');
+ logUtils.log('Getting latest 0x trusted tokens list ...');
const trustedTokensRepository = connection.getRepository(TokenMetadata);
const trustedTokensSource = new TrustedTokenSource<ZeroExTrustedTokenMeta[]>(ZEROEX_TRUSTED_TOKENS_URL);
const resp = await trustedTokensSource.getTrustedTokenMetaAsync();
const trustedTokens = parseZeroExTrustedTokens(resp);
- // tslint:disable-next-line:no-console
- console.log('Saving metamask trusted tokens list');
+ logUtils.log('Saving metamask trusted tokens list');
await trustedTokensRepository.save(trustedTokens);
- // tslint:disable-next-line:no-console
- console.log('Done saving metamask trusted tokens.');
+ logUtils.log('Done saving metamask trusted tokens.');
}