address is not optional in this context
This commit is contained in:
@@ -130,13 +130,13 @@ export class Handler {
|
|||||||
const zeroEx = networkConfig.zeroEx;
|
const zeroEx = networkConfig.zeroEx;
|
||||||
res.setHeader('Content-Type', 'application/json');
|
res.setHeader('Content-Type', 'application/json');
|
||||||
const makerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType);
|
const makerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(requestedAssetType);
|
||||||
if (_.isUndefined(makerToken) || _.isUndefined(makerToken.address)) {
|
if (_.isUndefined(makerToken)) {
|
||||||
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
|
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
|
||||||
}
|
}
|
||||||
const takerTokenSymbol =
|
const takerTokenSymbol =
|
||||||
requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH;
|
requestedAssetType === RequestedAssetType.WETH ? RequestedAssetType.ZRX : RequestedAssetType.WETH;
|
||||||
const takerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol);
|
const takerToken = await zeroEx.tokenRegistry.getTokenBySymbolIfExistsAsync(takerTokenSymbol);
|
||||||
if (_.isUndefined(takerToken) || _.isUndefined(takerToken.address)) {
|
if (_.isUndefined(takerToken)) {
|
||||||
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
|
throw new Error(`Unsupported asset type: ${requestedAssetType}`);
|
||||||
}
|
}
|
||||||
const makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), makerToken.decimals);
|
const makerTokenAmount = ZeroEx.toBaseUnitAmount(new BigNumber(0.1), makerToken.decimals);
|
||||||
|
|||||||
Reference in New Issue
Block a user