aboutsummaryrefslogtreecommitdiffstats
path: root/src/0x.js.ts
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2017-06-10 21:36:52 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2017-06-10 21:36:52 +0800
commitd727bed6ab6fef90717a45845c544b409657e3c2 (patch)
tree9a232b7764d80726acf5f4dd91d19c0c06ae0439 /src/0x.js.ts
parent8b9d8ad1b625967fe264fe87e617af1089e1d0e9 (diff)
downloaddexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar.gz
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar.bz2
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar.lz
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar.xz
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.tar.zst
dexon-sol-tools-d727bed6ab6fef90717a45845c544b409657e3c2.zip
Prefix private vars with _
Diffstat (limited to 'src/0x.js.ts')
-rw-r--r--src/0x.js.ts26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index b1e4e25ff..3a149ae6e 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -33,7 +33,7 @@ export class ZeroEx {
public exchange: ExchangeWrapper;
public tokenRegistry: TokenRegistryWrapper;
public token: TokenWrapper;
- private web3Wrapper: Web3Wrapper;
+ private _web3Wrapper: Web3Wrapper;
/**
* Verifies that the elliptic curve signature `signature` was generated
* by signing `dataHex` with the private key corresponding to the `signerAddressHex` address.
@@ -128,10 +128,10 @@ export class ZeroEx {
* @return An instance of the 0x.js ZeroEx class.
*/
constructor(web3: Web3) {
- this.web3Wrapper = new Web3Wrapper(web3);
- this.token = new TokenWrapper(this.web3Wrapper);
- this.exchange = new ExchangeWrapper(this.web3Wrapper, this.token);
- this.tokenRegistry = new TokenRegistryWrapper(this.web3Wrapper);
+ this._web3Wrapper = new Web3Wrapper(web3);
+ this.token = new TokenWrapper(this._web3Wrapper);
+ this.exchange = new ExchangeWrapper(this._web3Wrapper, this.token);
+ this.tokenRegistry = new TokenRegistryWrapper(this._web3Wrapper);
}
/**
* Sets a new provider for the web3 instance used by 0x.js. Updating the provider will stop all
@@ -139,7 +139,7 @@ export class ZeroEx {
* @param provider The Web3.Provider you would like the 0x.js library to use from now on.
*/
public async setProviderAsync(provider: Web3.Provider) {
- this.web3Wrapper.setProvider(provider);
+ this._web3Wrapper.setProvider(provider);
await this.exchange.invalidateContractInstanceAsync();
this.tokenRegistry.invalidateContractInstance();
this.token.invalidateContractInstances();
@@ -149,7 +149,7 @@ export class ZeroEx {
* @return An array of Ethereum addresses available.
*/
public async getAvailableAddressesAsync(): Promise<string[]> {
- const availableAddresses = await this.web3Wrapper.getAvailableAddressesAsync();
+ const availableAddresses = await this._web3Wrapper.getAvailableAddressesAsync();
return availableAddresses;
}
/**
@@ -160,7 +160,7 @@ export class ZeroEx {
public async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
assert.doesConformToSchema('order', order, orderSchema);
- const exchangeContractAddr = await this.getExchangeAddressAsync();
+ const exchangeContractAddr = await this._getExchangeAddressAsync();
const orderHashHex = utils.getOrderHashHex(order, exchangeContractAddr);
return orderHashHex;
}
@@ -174,10 +174,10 @@ export class ZeroEx {
*/
public async signOrderHashAsync(orderHashHex: string, signerAddress: string): Promise<ECSignature> {
assert.isHexString('orderHashHex', orderHashHex);
- await assert.isSenderAddressAsync('signerAddress', signerAddress, this.web3Wrapper);
+ await assert.isSenderAddressAsync('signerAddress', signerAddress, this._web3Wrapper);
let msgHashHex;
- const nodeVersion = await this.web3Wrapper.getNodeVersionAsync();
+ const nodeVersion = await this._web3Wrapper.getNodeVersionAsync();
const isParityNode = utils.isParityNode(nodeVersion);
if (isParityNode) {
// Parity node adds the personalMessage prefix itself
@@ -188,7 +188,7 @@ export class ZeroEx {
msgHashHex = ethUtil.bufferToHex(msgHashBuff);
}
- const signature = await this.web3Wrapper.signTransactionAsync(signerAddress, msgHashHex);
+ const signature = await this._web3Wrapper.signTransactionAsync(signerAddress, msgHashHex);
let signatureData;
const [nodeVersionNumber] = findVersions(nodeVersion);
@@ -224,8 +224,8 @@ export class ZeroEx {
}
return ecSignature;
}
- private async getExchangeAddressAsync() {
- const networkIdIfExists = await this.web3Wrapper.getNetworkIdIfExistsAsync();
+ private async _getExchangeAddressAsync() {
+ const networkIdIfExists = await this._web3Wrapper.getNetworkIdIfExistsAsync();
const exchangeNetworkConfigsIfExists = _.isUndefined(networkIdIfExists) ?
undefined :
(ExchangeArtifacts as any).networks[networkIdIfExists];