aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-05 22:22:56 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-05 22:22:56 +0800
commitbac6833436960d2a7eb50d89e94fed226a16008b (patch)
tree69556bb591ecd1fc5ebcd3e2da8c688d5cbaccd0 /src/0x.js.ts
parenteb5c9ae70886cb1a14ae154f363f052a76b24479 (diff)
downloaddexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar.gz
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar.bz2
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar.lz
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar.xz
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.tar.zst
dexon-sol-tools-bac6833436960d2a7eb50d89e94fed226a16008b.zip
Make methods accept senderAccount
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 850827fee..5e2cd9ed9 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -122,17 +122,11 @@ export class ZeroEx {
this.token.invalidateContractInstances();
}
/**
- * Sets default account for sending transactions.
+ * Gets accounts available for sending transactions.
*/
- public setTransactionSenderAccount(account: string): void {
- this.web3Wrapper.setDefaultAccount(account);
- }
- /**
- * Get the default account set for sending transactions.
- */
- public async getTransactionSenderAccountIfExistsAsync(): Promise<string|undefined> {
- const senderAccountIfExists = await this.web3Wrapper.getSenderAddressIfExistsAsync();
- return senderAccountIfExists;
+ public async getAvailableAccountsAsync(): Promise<string[]> {
+ const availableAccounts = await this.web3Wrapper.getAvailableAccountsAsync();
+ return availableAccounts;
}
/**
* Computes the orderHash for a given order and returns it as a hex encoded string.
@@ -167,10 +161,10 @@ export class ZeroEx {
* Signs an orderHash and returns it's elliptic curve signature
* This method currently supports TestRPC, Geth and Parity above and below V1.6.6
*/
- public async signOrderHashAsync(orderHashHex: string): Promise<ECSignature> {
+ public async signOrderHashAsync(orderHashHex: string, senderAccount: string): Promise<ECSignature> {
assert.isHexString('orderHashHex', orderHashHex);
-
- const makerAddress = await this.web3Wrapper.getSenderAddressOrThrowAsync();
+ await assert.isSenderAccountHexAsync(this.web3Wrapper, senderAccount);
+ const makerAddress = senderAccount;
let msgHashHex;
const nodeVersion = await this.web3Wrapper.getNodeVersionAsync();