How to use the @0x/contract-wrappers.AssetBalanceAndProxyAllowanceFetcher function in @0x/contract-wrappers

To help you get started, we’ve selected a few @0x/contract-wrappers examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github 0xProject / 0x-monorepo / packages / order-watcher / src / order_watcher / order_watcher.ts View on Github external
};

        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(
            balanceAndProxyAllowanceFetcher,
        );
        const orderFilledCancelledFetcher = new OrderFilledCancelledFetcher(contractWrappers.exchange, STATE_LAYER);
        this._orderFilledCancelledLazyStore = new OrderFilledCancelledLazyStore(orderFilledCancelledFetcher);
        this._orderStateUtils = new OrderStateUtils(balanceAndProxyAllowanceFetcher, orderFilledCancelledFetcher);
        const expirationMarginIfExistsMs = config === undefined ? undefined : config.expirationMarginMs;
        this._expirationWatcher = new ExpirationWatcher(
            expirationMarginIfExistsMs,
            config.orderExpirationCheckingIntervalMs,
        );
        this._cleanupJobInterval = config.cleanupJobIntervalMs;