Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
supportedProvider: SupportedProvider,
networkId: number,
contractAddresses?: ContractAddresses,
partialConfig: Partial = DEFAULT_ORDER_WATCHER_CONFIG,
) {
const provider = providerUtils.standardizeOrThrow(supportedProvider);
assert.isNumber('networkId', networkId);
assert.doesConformToSchema('partialConfig', partialConfig, orderWatcherPartialConfigSchema);
const config = {
...DEFAULT_ORDER_WATCHER_CONFIG,
...partialConfig,
};
this._provider = provider;
this._collisionResistantAbiDecoder = new CollisionResistanceAbiDecoder(
artifacts.ERC20Token.compilerOutput.abi,
artifacts.ERC721Token.compilerOutput.abi,
[artifacts.WETH9.compilerOutput.abi, artifacts.Exchange.compilerOutput.abi],
);
const contractWrappers = new ContractWrappers(provider, {
networkId,
// Note(albrow): We let the contract-wrappers package handle
// default values for contractAddresses.
contractAddresses,
});
this._eventWatcher = new EventWatcher(provider, config.eventPollingIntervalMs, config.isVerbose);
const balanceAndProxyAllowanceFetcher = new AssetBalanceAndProxyAllowanceFetcher(
contractWrappers.erc20Token,
contractWrappers.erc721Token,
STATE_LAYER,
);
this._balanceAndProxyAllowanceLazyStore = new BalanceAndProxyAllowanceLazyStore(