Change CoordinatorWrapper constructor to take a provider

This commit is contained in:
fabioberger
2019-08-28 17:11:16 +02:00
parent d8dab6a070
commit 7efcf9066c
2 changed files with 8 additions and 4 deletions

View File

@@ -1,10 +1,14 @@
[
{
"version": "11.1.1",
"version": "12.0.0",
"changes": [
{
"note": "Import wrappers from @0x/abi-gen-wrappers instead of directly implementing within this package.",
"pr": 2086
},
{
"note": "Change CoordinatorWrapper constructor to take a provider instead of a Web3Wrapper instance",
"pr": 2023
}
]
},

View File

@@ -5,7 +5,7 @@ import { generatePseudoRandomSalt, signatureUtils } from '@0x/order-utils';
import { Order, SignedOrder, SignedZeroExTransaction, ZeroExTransaction } from '@0x/types';
import { BigNumber, fetchAsync } from '@0x/utils';
import { Web3Wrapper } from '@0x/web3-wrapper';
import { ContractAbi } from 'ethereum-types';
import { ContractAbi, SupportedProvider } from 'ethereum-types';
import * as HttpStatus from 'http-status-codes';
import { flatten } from 'lodash';
@@ -54,7 +54,7 @@ export class CoordinatorWrapper {
* default to the known address corresponding to the networkId.
*/
constructor(
web3Wrapper: Web3Wrapper,
provider: SupportedProvider,
networkId: number,
address?: string,
exchangeAddress?: string,
@@ -65,7 +65,7 @@ export class CoordinatorWrapper {
this.address = address === undefined ? contractAddresses.coordinator : address;
this.exchangeAddress = exchangeAddress === undefined ? contractAddresses.coordinator : exchangeAddress;
this.registryAddress = registryAddress === undefined ? contractAddresses.coordinatorRegistry : registryAddress;
this._web3Wrapper = web3Wrapper;
this._web3Wrapper = new Web3Wrapper(provider);
this._contractInstance = new CoordinatorContract(
this.address,