fix 0 dp handling

This commit is contained in:
jejolare 2025-09-04 04:36:50 +07:00
parent a5d81dc07b
commit f6ab4e38e0

View file

@ -77,7 +77,10 @@ class OrdersModel {
if (!userRow) throw new Error('Invalid address from token.');
const timestamp = Date.now();
const firstCurrencyDecimalPoint = firstCurrency?.asset_info?.decimal_point || 12;
const firstCurrencyDecimalPoint =
firstCurrency?.asset_info?.decimal_point === undefined
? 12
: firstCurrency.asset_info.decimal_point;
const newOrder = await Order.create({
type: orderData.type === 'buy' ? 'buy' : 'sell',