aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-02 03:14:30 +0800
committerFabio Berger <me@fabioberger.com>2017-06-02 03:14:30 +0800
commit3e0c2ad7530927fa1c9019bbc311a88d327e2306 (patch)
tree435dd8a0efe6c057958d348bc0e9bfd3dcbba6cc /src
parentaade6891e834dda7e80d76740882facdb45bc014 (diff)
parentf663a15c9b000d639bd0d58d0c177e6de9d47346 (diff)
downloaddexon-0x-contracts-3e0c2ad7530927fa1c9019bbc311a88d327e2306.tar.gz
dexon-0x-contracts-3e0c2ad7530927fa1c9019bbc311a88d327e2306.tar.zst
dexon-0x-contracts-3e0c2ad7530927fa1c9019bbc311a88d327e2306.zip
Merge branch 'fillOrderAsync' into unavailableFilledCancelled
Diffstat (limited to 'src')
-rw-r--r--src/0x.js.ts2
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts7
-rw-r--r--src/types.ts4
3 files changed, 9 insertions, 4 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index c799e63e9..2bced325f 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -120,7 +120,7 @@ export class ZeroEx {
/**
* Sets default account for sending transactions.
*/
- public setDefaultAccount(account: string): void {
+ public setTransactionSenderAccount(account: string): void {
this.web3Wrapper.setDefaultAccount(account);
}
/**
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index 6f6380bb8..8b20d2b4d 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -107,10 +107,10 @@ export class ExchangeWrapper extends ContractWrapper {
assert.isBoolean('shouldCheckTransfer', shouldCheckTransfer);
const senderAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync();
- const exchangeInstance = await this.getExchangeContractAsync();
-
await this.validateFillOrderAsync(signedOrder, fillTakerAmountInBaseUnits, senderAddress);
+ const exchangeInstance = await this.getExchangeContractAsync();
+
const orderAddresses: OrderAddresses = [
signedOrder.maker,
signedOrder.taker,
@@ -164,7 +164,8 @@ export class ExchangeWrapper extends ContractWrapper {
if (signedOrder.expirationUnixTimestampSec.lessThan(Date.now() / 1000)) {
throw new Error(FillOrderValidationErrs.EXPIRED);
}
- const makerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.makerTokenAddress, signedOrder.maker);
+ const makerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.makerTokenAddress,
+ signedOrder.maker);
const takerBalance = await this.tokenWrapper.getBalanceAsync(signedOrder.takerTokenAddress, senderAddress);
const makerAllowance = await this.tokenWrapper.getProxyAllowanceAsync(signedOrder.makerTokenAddress,
signedOrder.maker);
diff --git a/src/types.ts b/src/types.ts
index 2686c140a..29f7e0ee4 100644
--- a/src/types.ts
+++ b/src/types.ts
@@ -147,3 +147,7 @@ export interface TxOpts {
from: string;
gas?: number;
}
+
+export interface TokenAddressBySymbol {
+ [symbol: string]: string;
+}