Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 {
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 {