diff options
Diffstat (limited to 'packages/website/ts')
-rw-r--r-- | packages/website/ts/blockchain.ts | 10 | ||||
-rw-r--r-- | packages/website/ts/utils/utils.ts | 7 |
2 files changed, 6 insertions, 11 deletions
diff --git a/packages/website/ts/blockchain.ts b/packages/website/ts/blockchain.ts index b1181e4c6..8955bbc30 100644 --- a/packages/website/ts/blockchain.ts +++ b/packages/website/ts/blockchain.ts @@ -374,7 +374,7 @@ export class Blockchain { return unavailableTakerAmount; } public getExchangeContractAddressIfExists(): string | undefined { - return this._contractWrappers.exchange.getContractAddress(); + return this._contractWrappers.exchange.address; } public async validateFillOrderThrowIfInvalidAsync( signedOrder: SignedOrder, @@ -859,10 +859,12 @@ export class Blockchain { shouldUserLedgerProvider, ); if (!_.isUndefined(this._contractWrappers)) { - this._contractWrappers.setProvider(provider, networkId); - } else { - this._contractWrappers = new ContractWrappers(provider, { networkId }); + this._contractWrappers.unsubscribeAll(); } + const contractWrappersConfig = { + networkId, + }; + this._contractWrappers = new ContractWrappers(provider, contractWrappersConfig); if (!_.isUndefined(this._zeroEx)) { this._zeroEx.setProvider(provider, networkId); } else { diff --git a/packages/website/ts/utils/utils.ts b/packages/website/ts/utils/utils.ts index d083e0ffc..d1628bc52 100644 --- a/packages/website/ts/utils/utils.ts +++ b/packages/website/ts/utils/utils.ts @@ -231,13 +231,6 @@ export const utils = { }, zeroExErrToHumanReadableErrMsg(error: ContractWrappersError | ExchangeContractErrs, takerAddress: string): string { const ContractWrappersErrorToHumanReadableError: { [error: string]: string } = { - [ContractWrappersError.ExchangeContractDoesNotExist]: 'Exchange contract does not exist', - [ContractWrappersError.EtherTokenContractDoesNotExist]: 'EtherToken contract does not exist', - [ContractWrappersError.ERC20ProxyContractDoesNotExist]: 'ERC20 proxy contract des not exist', - [ContractWrappersError.ERC721ProxyContractDoesNotExist]: 'ERC721 proxy contract des not exist', - [ContractWrappersError.ERC20TokenContractDoesNotExist]: 'ERC20 token contract does not exist', - [ContractWrappersError.ERC721TokenContractDoesNotExist]: 'ERC721 token contract does not exist', - [ContractWrappersError.ZRXContractDoesNotExist]: 'ZRX contract does not exist', [BlockchainCallErrs.UserHasNoAssociatedAddresses]: 'User has no addresses available', [OrderError.InvalidSignature]: 'Order signature is not valid', [ContractWrappersError.ContractNotDeployedOnNetwork]: 'Contract is not deployed on the detected network', |