From 0dfc2b5f3b81e034a9c939f667383eb03c9a5561 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 6 Jun 2017 14:56:54 +0200 Subject: Add isAnyAddressAvailableAsync --- src/contract_wrappers/token_wrapper.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/contract_wrappers/token_wrapper.ts') diff --git a/src/contract_wrappers/token_wrapper.ts b/src/contract_wrappers/token_wrapper.ts index d30645548..945f5caf1 100644 --- a/src/contract_wrappers/token_wrapper.ts +++ b/src/contract_wrappers/token_wrapper.ts @@ -25,6 +25,7 @@ export class TokenWrapper extends ContractWrapper { public async getBalanceAsync(tokenAddress: string, ownerAddress: string): Promise { assert.isETHAddressHex('ownerAddress', ownerAddress); assert.isETHAddressHex('tokenAddress', tokenAddress); + await assert.isAnyAddressAvailableAsync(this.web3Wrapper); const tokenContract = await this.getTokenContractAsync(tokenAddress); let balance = await tokenContract.balanceOf.call(ownerAddress); @@ -60,6 +61,7 @@ export class TokenWrapper extends ContractWrapper { public async getAllowanceAsync(tokenAddress: string, ownerAddress: string, spenderAddress: string) { assert.isETHAddressHex('ownerAddress', ownerAddress); assert.isETHAddressHex('tokenAddress', tokenAddress); + await assert.isAnyAddressAvailableAsync(this.web3Wrapper); const tokenContract = await this.getTokenContractAsync(tokenAddress); let allowanceInBaseUnits = await tokenContract.allowance.call(ownerAddress, spenderAddress); -- cgit