Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const assetDataForERC721TokenAddress = (tokenAddress: string, tokenId: string | number): string => {
assert.isETHAddressHex('tokenAddress', tokenAddress);
return assetDataEncoder.ERC721Token(tokenAddress, new BigNumber(tokenId)).getABIEncodedTransactionData();
};
let provider = supportedProvider;
if (provider !== undefined) {
provider = providerUtils.standardizeOrThrow(provider);
}
const bestProvider: ZeroExProvider = provider || providerFactory.getFallbackNoSigningProvider(chainId);
const swapQuoterOptions = { chainId };
const swapQuoter = _.isString(orderSource)
? SwapQuoter.getSwapQuoterForStandardRelayerAPIUrl(bestProvider, orderSource, swapQuoterOptions)
: SwapQuoter.getSwapQuoterForProvidedOrders(bestProvider, orderSource, swapQuoterOptions);
const wethAssetData = await swapQuoter.getEtherTokenAssetDataOrThrowAsync();
const liquidity = await swapQuoter.getLiquidityForMakerTakerAssetDataPairAsync(wethAssetData, takerAssetData);
return liquidity.makerAssetAvailableInBaseUnits.gt(new BigNumber(0));
};