Apply various PR feedback
This commit is contained in:
@@ -67,7 +67,6 @@
|
||||
"dependencies": {
|
||||
"@0xproject/abi-gen-wrappers": "^1.0.0",
|
||||
"@0xproject/assert": "^1.0.13",
|
||||
"@0xproject/base-contract": "^3.0.1",
|
||||
"@0xproject/contract-addresses": "^1.0.0",
|
||||
"@0xproject/contract-artifacts": "^1.0.0",
|
||||
"@0xproject/fill-scenarios": "^1.0.7",
|
||||
|
@@ -70,7 +70,7 @@ export class ContractWrappers {
|
||||
private readonly _web3Wrapper: Web3Wrapper;
|
||||
/**
|
||||
* Instantiates a new ContractWrappers instance.
|
||||
* @param provider The Provider instance you would like the 0x.js library to use for interacting with
|
||||
* @param provider The Provider instance you would like the contract-wrappers library to use for interacting with
|
||||
* the Ethereum network.
|
||||
* @param config The configuration object. Look up the type for the description.
|
||||
* @return An instance of the ContractWrappers class.
|
||||
@@ -147,9 +147,9 @@ export class ContractWrappers {
|
||||
);
|
||||
}
|
||||
/**
|
||||
* Sets a new web3 provider for 0x.js. Updating the provider will stop all
|
||||
* Sets a new web3 provider for contract-wrappers. Updating the provider will stop all
|
||||
* subscriptions so you will need to re-subscribe to all events relevant to your app after this call.
|
||||
* @param provider The Web3Provider you would like the 0x.js library to use from now on.
|
||||
* @param provider The Web3Provider you would like the contract-wrappers library to use from now on.
|
||||
* @param networkId The id of the network your provider is connected to
|
||||
*/
|
||||
public setProvider(provider: Provider): void {
|
||||
@@ -164,7 +164,7 @@ export class ContractWrappers {
|
||||
(this.orderValidator as any)._invalidateContractInstance();
|
||||
}
|
||||
/**
|
||||
* Get the provider instance currently used by 0x.js
|
||||
* Get the provider instance currently used by contract-wrappers
|
||||
* @return Web3 provider instance
|
||||
*/
|
||||
public getProvider(): Provider {
|
||||
|
@@ -113,6 +113,7 @@ export abstract class ContractWrapper {
|
||||
return logWithDecodedArgs;
|
||||
}
|
||||
protected _getDefaultContractAddresses(): ContractAddresses {
|
||||
// TODO(albrow): Figure out better error handling here.
|
||||
return getContractAddressesForNetwork(this._networkId);
|
||||
}
|
||||
private _onLogStateChanged<ArgsType extends ContractEventArgs>(isRemoved: boolean, rawLog: RawLogEntry): void {
|
||||
|
@@ -20,9 +20,8 @@ export class ERC20ProxyWrapper extends ContractWrapper {
|
||||
* Instantiate ERC20ProxyWrapper
|
||||
* @param web3Wrapper Web3Wrapper instance to use
|
||||
* @param networkId Desired networkId
|
||||
* @param address (Optional) The address of the ERC20Proxy contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param address The address of the ERC20Proxy contract. If undefined, will
|
||||
* default to the known address corresponding to the networkId.
|
||||
*/
|
||||
constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
|
||||
super(web3Wrapper, networkId);
|
||||
|
@@ -20,9 +20,8 @@ export class ERC721ProxyWrapper extends ContractWrapper {
|
||||
* Instantiate ERC721ProxyWrapper
|
||||
* @param web3Wrapper Web3Wrapper instance to use
|
||||
* @param networkId Desired networkId
|
||||
* @param address (Optional) The address of the ERC721Proxy contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param address The address of the ERC721Proxy contract. If undefined,
|
||||
* will default to the known address corresponding to the networkId.
|
||||
*/
|
||||
constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
|
||||
super(web3Wrapper, networkId);
|
||||
|
@@ -53,12 +53,11 @@ export class ExchangeWrapper extends ContractWrapper {
|
||||
* @param networkId Desired networkId.
|
||||
* @param erc20TokenWrapper ERC20TokenWrapper instance to use.
|
||||
* @param erc721TokenWrapper ERC721TokenWrapper instance to use.
|
||||
* @param address (Optional) The address of the Exchange contract. If
|
||||
* @param address The address of the Exchange contract. If undefined, will
|
||||
* default to the known address corresponding to the networkId.
|
||||
* @param zrxTokenAddress The address of the ZRXToken contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param zrxTokenAddress (Optional) The address of the ZRXToken contract.
|
||||
* If undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param blockPollingIntervalMs The block polling interval to use for active subscriptions.
|
||||
*/
|
||||
constructor(
|
||||
|
@@ -32,15 +32,14 @@ export class ForwarderWrapper extends ContractWrapper {
|
||||
* Instantiate ForwarderWrapper
|
||||
* @param web3Wrapper Web3Wrapper instance to use.
|
||||
* @param networkId Desired networkId.
|
||||
* @param address (Optional) The address of the Exchange contract. If
|
||||
* @param address The address of the Exchange contract. If undefined, will
|
||||
* default to the known address corresponding to the networkId.
|
||||
* @param zrxTokenAddress The address of the ZRXToken contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param zrxTokenAddress (Optional) The address of the ZRXToken contract.
|
||||
* If undefined, will default to the known address corresponding to the
|
||||
* @param etherTokenAddress The address of a WETH (Ether token) contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param etherTokenAddress (Optional) The address of a WETH (Ether token)
|
||||
* contract. If undefined, will default to the known address corresponding
|
||||
* to the networkId.
|
||||
*/
|
||||
constructor(
|
||||
web3Wrapper: Web3Wrapper,
|
||||
|
@@ -23,9 +23,8 @@ export class OrderValidatorWrapper extends ContractWrapper {
|
||||
* Instantiate OrderValidatorWrapper
|
||||
* @param web3Wrapper Web3Wrapper instance to use.
|
||||
* @param networkId Desired networkId.
|
||||
* @param address (Optional) The address of the OrderValidator contract. If
|
||||
* undefined, will default to the known address corresponding to the
|
||||
* networkId.
|
||||
* @param address The address of the OrderValidator contract. If undefined,
|
||||
* will default to the known address corresponding to the networkId.
|
||||
*/
|
||||
constructor(web3Wrapper: Web3Wrapper, networkId: number, address?: string) {
|
||||
super(web3Wrapper, networkId);
|
||||
|
Reference in New Issue
Block a user