Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getDecimalsForCurrency(currency: RequestLogicTypes.REQUEST_LOGIC_CURRENCY): number {
const decimals = {
[RequestLogicTypes.REQUEST_LOGIC_CURRENCY.ETH]: 18,
[RequestLogicTypes.REQUEST_LOGIC_CURRENCY.BTC]: 8,
}[currency];
if (!decimals) {
throw new Error(`Currency ${currency} not implemented`);
}
return decimals;
},
};
getDecimalsForCurrency(currency: RequestLogicTypes.REQUEST_LOGIC_CURRENCY): number {
const decimals = {
[RequestLogicTypes.REQUEST_LOGIC_CURRENCY.ETH]: 18,
[RequestLogicTypes.REQUEST_LOGIC_CURRENCY.BTC]: 8,
}[currency];
if (!decimals) {
throw new Error(`Currency ${currency} not implemented`);
}
return decimals;
},
};