diff options
author | Brandon Millman <brandon@0xproject.com> | 2018-07-11 04:57:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 04:57:14 +0800 |
commit | 56a96d36a1f994f36c9331931a9b9cb201891678 (patch) | |
tree | 29f9edab4f664eb1ea417ed69be13da780ef1738 /packages/website/ts/blockchain.ts | |
parent | af7e02de2789efd3e73f60bf92b700ccec8ba520 (diff) | |
parent | 51d5b9d35d903413a83254e5a82fbd247b7ab789 (diff) | |
download | dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar.gz dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar.bz2 dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar.lz dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar.xz dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.tar.zst dexon-sol-tools-56a96d36a1f994f36c9331931a9b9cb201891678.zip |
Merge pull request #849 from 0xProject/feature/website/tokens-backend
Grab token registry information from our DB for mainnet
Diffstat (limited to 'packages/website/ts/blockchain.ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index 5476fcf37..0e6698318 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -769,9 +769,13 @@ export class Blockchain { this._contractWrappers.exchange.unsubscribeAll(); } private async _getTokenRegistryTokensByAddressAsync(): Promise<TokenByAddress> { - utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); - const tokenRegistryTokens = await this._contractWrappers.tokenRegistry.getTokensAsync(); - + let tokenRegistryTokens; + if (this.networkId === constants.NETWORK_ID_MAINNET) { + tokenRegistryTokens = await backendClient.getTokenInfosAsync(); + } else { + utils.assert(!_.isUndefined(this._contractWrappers), 'ContractWrappers must be instantiated.'); + tokenRegistryTokens = await this._contractWrappers.tokenRegistry.getTokensAsync(); + } const tokenByAddress: TokenByAddress = {}; _.each(tokenRegistryTokens, (t: ZeroExToken) => { // HACK: For now we have a hard-coded list of iconUrls for the dummyTokens |