How to use the @0x/order-utils.assetDataUtils.decodeERC721AssetData function in @0x/order-utils

To help you get started, we’ve selected a few @0x/order-utils 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 / dependent_order_hashes_tracker.ts View on Github external
private _getDependentOrderHashesByERC721AssetData(makerAddress: string, erc721AssetData: string): string[] {
        const tokenAddress = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenAddress;
        const tokenId = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenId;
        let dependentOrderHashes: string[] = [];
        if (
            !_.isUndefined(this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress]) &&
            !_.isUndefined(this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress]) &&
            !_.isUndefined(
                this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress][tokenId.toString()],
            )
        ) {
            dependentOrderHashes = Array.from(
                this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress][tokenId.toString()],
            );
        }
        return dependentOrderHashes;
    }
    private _addToERC20DependentOrderHashes(signedOrder: SignedOrder, erc20TokenAddress: string): void {
github 0xProject / 0x-monorepo / packages / order-watcher / src / order_watcher / dependent_order_hashes_tracker.ts View on Github external
private _getDependentOrderHashesByERC721AssetData(makerAddress: string, erc721AssetData: string): string[] {
        const tokenAddress = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenAddress;
        const tokenId = assetDataUtils.decodeERC721AssetData(erc721AssetData).tokenId;
        let dependentOrderHashes: string[] = [];
        if (
            !_.isUndefined(this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress]) &&
            !_.isUndefined(this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress]) &&
            !_.isUndefined(
                this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress][tokenId.toString()],
            )
        ) {
            dependentOrderHashes = Array.from(
                this._orderHashesByERC721AddressByTokenIdByMakerAddress[makerAddress][tokenAddress][tokenId.toString()],
            );
        }
        return dependentOrderHashes;
    }
    private _addToERC20DependentOrderHashes(signedOrder: SignedOrder, erc20TokenAddress: string): void {