@0x/contract-wrappers: add exchangeProxy to ContractWrappers tyoe.

This commit is contained in:
Lawrence Forman
2020-07-30 13:07:21 -04:00
parent 82774df715
commit 84a55a2d84
2 changed files with 11 additions and 0 deletions

View File

@@ -9,6 +9,10 @@
{ {
"note": "Update `ERC20BridgeSampler` wrapper", "note": "Update `ERC20BridgeSampler` wrapper",
"pr": 2633 "pr": 2633
},
{
"note": "Add `exchangeProxy` to `ContractWrappers` type.",
"pr": 2649
} }
] ]
}, },

View File

@@ -11,6 +11,7 @@ import { ERC20TokenContract } from './generated-wrappers/erc20_token';
import { ERC721TokenContract } from './generated-wrappers/erc721_token'; import { ERC721TokenContract } from './generated-wrappers/erc721_token';
import { ExchangeContract } from './generated-wrappers/exchange'; import { ExchangeContract } from './generated-wrappers/exchange';
import { ForwarderContract } from './generated-wrappers/forwarder'; import { ForwarderContract } from './generated-wrappers/forwarder';
import { IZeroExContract } from './generated-wrappers/i_zero_ex';
import { StakingContract } from './generated-wrappers/staking'; import { StakingContract } from './generated-wrappers/staking';
import { WETH9Contract } from './generated-wrappers/weth9'; import { WETH9Contract } from './generated-wrappers/weth9';
import { ContractWrappersConfig } from './types'; import { ContractWrappersConfig } from './types';
@@ -49,6 +50,10 @@ export class ContractWrappers {
* An instance of the StakingContract class containing methods for interacting with the Staking contracts. * An instance of the StakingContract class containing methods for interacting with the Staking contracts.
*/ */
public staking: StakingContract; public staking: StakingContract;
/**
* An instance of the IZeroExContract class containing methods for interacting with the Exchange Proxy.
*/
public exchangeProxy: IZeroExContract;
private readonly _web3Wrapper: Web3Wrapper; private readonly _web3Wrapper: Web3Wrapper;
/** /**
@@ -73,6 +78,7 @@ export class ContractWrappers {
ForwarderContract, ForwarderContract,
StakingContract, StakingContract,
WETH9Contract, WETH9Contract,
IZeroExContract,
]; ];
contractsArray.forEach(contract => { contractsArray.forEach(contract => {
this._web3Wrapper.abiDecoder.addABI(contract.ABI(), contract.contractName); this._web3Wrapper.abiDecoder.addABI(contract.ABI(), contract.contractName);
@@ -87,6 +93,7 @@ export class ContractWrappers {
this.staking = new StakingContract(contractAddresses.stakingProxy, this.getProvider()); this.staking = new StakingContract(contractAddresses.stakingProxy, this.getProvider());
this.devUtils = new DevUtilsContract(contractAddresses.devUtils, this.getProvider()); this.devUtils = new DevUtilsContract(contractAddresses.devUtils, this.getProvider());
this.coordinator = new CoordinatorContract(contractAddresses.coordinator, this.getProvider()); this.coordinator = new CoordinatorContract(contractAddresses.coordinator, this.getProvider());
this.exchangeProxy = new IZeroExContract(contractAddresses.exchangeProxy, this.getProvider());
this.contractAddresses = contractAddresses; this.contractAddresses = contractAddresses;
} }
/** /**