aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-02 15:43:03 +0800
committerFabio Berger <me@fabioberger.com>2017-06-02 15:43:03 +0800
commit707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c (patch)
tree4e0eee1b8107a3e4b8136a3150ac5bda0e3d89c1 /src/0x.js.ts
parent293ce6f4b2e495589ae3675eb293fb9948f22dbb (diff)
downloaddexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar.gz
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar.bz2
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar.lz
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar.xz
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.tar.zst
dexon-sol-tools-707a5f55eb919b3460ae4ee7d58b9a0eaa56a07c.zip
Write tests for getUnavailableTakerAmountAsync, getFilledTakerAmountAsync and getCanceledTakerAmountAsync
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 2bced325f..b42d5dee1 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -17,7 +17,7 @@ import {TokenRegistryWrapper} from './contract_wrappers/token_registry_wrapper';
import {ecSignatureSchema} from './schemas/ec_signature_schema';
import {TokenWrapper} from './contract_wrappers/token_wrapper';
import {SolidityTypes, ECSignature, ZeroExError} from './types';
-import {Order} from './types';
+import {Order, SignedOrder} from './types';
import {orderSchema} from './schemas/order_schemas';
import * as ExchangeArtifacts from './artifacts/Exchange.json';
@@ -116,7 +116,6 @@ export class ZeroEx {
this.tokenRegistry.invalidateContractInstance();
this.token.invalidateContractInstances();
}
-
/**
* Sets default account for sending transactions.
*/
@@ -124,9 +123,16 @@ export class ZeroEx {
this.web3Wrapper.setDefaultAccount(account);
}
/**
+ * Get the default account set for sending transactions.
+ */
+ public async getTransactionSenderAccountAsync(): Promise<string> {
+ const senderAccount = await this.web3Wrapper.getSenderAddressOrThrowAsync();
+ return senderAccount;
+ }
+ /**
* Computes the orderHash given the order parameters and returns it as a hex encoded string.
*/
- public async getOrderHashHexAsync(order: Order): Promise<string> {
+ public async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
const exchangeContractAddr = await this.getExchangeAddressAsync();
assert.doesConformToSchema('order',
SchemaValidator.convertToJSONSchemaCompatibleObject(order as object),