How to use the @0x/contract-wrappers.ERC721TokenEvents.ApprovalForAll 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
// ERC721
                    // Invalidate cache
                    const args = decodedLog.args as ERC721TokenTransferEventArgs;
                    const tokenAssetData = assetDataUtils.encodeERC721AssetData(decodedLog.address, args._tokenId);
                    this._deleteLazyStoreBalance(tokenAssetData, args._from);
                    this._deleteLazyStoreBalance(tokenAssetData, args._to);
                    // Revalidate orders
                    const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByAssetDataByMaker(
                        args._from,
                        tokenAssetData,
                    );
                    await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
                    break;
                }
            }
            case ERC721TokenEvents.ApprovalForAll: {
                // Invalidate cache
                const args = decodedLog.args as ERC721TokenApprovalForAllEventArgs;
                const tokenAddress = decodedLog.address;
                this._balanceAndProxyAllowanceLazyStore.deleteAllERC721ProxyAllowance(tokenAddress, args._owner);
                // Revalidate orders
                const orderHashes = this._dependentOrderHashesTracker.getDependentOrderHashesByERC721ByMaker(
                    args._owner,
                    tokenAddress,
                );
                await this._emitRevalidateOrdersAsync(orderHashes, transactionHash);
                break;
            }
            case WETH9Events.Deposit: {
                // Invalidate cache
                const args = decodedLog.args as WETH9DepositEventArgs;
                const tokenAssetData = assetDataUtils.encodeERC20AssetData(decodedLog.address);