Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(url: string) {
assert.isWebUri('url', url);
this._apiEndpointUrl = url.replace(TRAILING_SLASHES_REGEX, ''); // remove trailing slashes
}
/**
export const checkErc20TokenLiquidityAsync = async (sraApiUrl: string, erc20TokenAddress: string) => {
assert.isWebUri('sraApiUrl', sraApiUrl);
assert.isETHAddressHex('erc20TokenAddress', erc20TokenAddress);
const tokenAssetData = assetDataUtils.encodeERC20AssetData(erc20TokenAddress);
const httpClient = new HttpClient(sraApiUrl);
const response = await httpClient.getAssetPairsAsync({
networkId: Network.Mainnet,
assetDataA: MAINNET_WETH_ASSET_DATA,
assetDataB: tokenAssetData,
perPage: 1000,
});
const supported = response.records.length > 0;
return { supported };
};