Closed mariano-aguero closed 5 years ago
Hey Mariano, I tested this yesterday and found out that there might be a problem withe the units handling.
I created a Sell
limit order with the following data:
DGD, 9 decimals
WETH, 18 decimals
2
1.5
The above generated the following when MetaMask asked me to sign the order (screenshot):
I believe there is a problem around the amounts and that the expected SignedOrder
should end up with the following values:
makerAssetAmount: 2000000000,
takerAssetAmount: 3000000000000000000
makerAssetAmount
should be expressed in base units of the maker asset, and the same goes for takerAssetAmount
(which has more zeros because WETH has more decimals).
Please confirm that you see the same thing. We'll continue improving this PR's branch.
LGTM @unjapones , I think is ready to merge!
Closes #516
Includes:
buy_sell.tsx
's BigNumberInput, so theamount
obtained is correctly expressed in base units.makerAssetAmount
calculation in the functionbuildLimitOrder
fromsrc/util/orders.ts
(should be expressed in the taker asset's base units).price
inbuildLimitOrder
fromsrc/util/ui_orders.ts
.src/util/orders.ts
.