|
@ -47,9 +47,9 @@ import { CfdOrderRequestPayload } from "./Types"; |
|
|
const MotionBox = motion<BoxProps>(Box); |
|
|
const MotionBox = motion<BoxProps>(Box); |
|
|
|
|
|
|
|
|
interface TradeProps { |
|
|
interface TradeProps { |
|
|
order_id?: string; |
|
|
orderId?: string; |
|
|
min_quantity: number; |
|
|
minQuantity: number; |
|
|
max_quantity: number; |
|
|
maxQuantity: number; |
|
|
referencePrice?: number; |
|
|
referencePrice?: number; |
|
|
askPrice?: number; |
|
|
askPrice?: number; |
|
|
margin?: string; |
|
|
margin?: string; |
|
@ -64,8 +64,8 @@ interface TradeProps { |
|
|
|
|
|
|
|
|
const Trade = ( |
|
|
const Trade = ( |
|
|
{ |
|
|
{ |
|
|
min_quantity, |
|
|
minQuantity, |
|
|
max_quantity, |
|
|
maxQuantity, |
|
|
referencePrice: referencePriceAsNumber, |
|
|
referencePrice: referencePriceAsNumber, |
|
|
askPrice: askPriceAsNumber, |
|
|
askPrice: askPriceAsNumber, |
|
|
quantity, |
|
|
quantity, |
|
@ -75,7 +75,7 @@ const Trade = ( |
|
|
liquidationPrice: liquidationPriceAsNumber, |
|
|
liquidationPrice: liquidationPriceAsNumber, |
|
|
canSubmit, |
|
|
canSubmit, |
|
|
onLongSubmit, |
|
|
onLongSubmit, |
|
|
order_id, |
|
|
orderId, |
|
|
}: TradeProps, |
|
|
}: TradeProps, |
|
|
) => { |
|
|
) => { |
|
|
let outerCircleBg = useColorModeValue("gray.100", "gray.700"); |
|
|
let outerCircleBg = useColorModeValue("gray.100", "gray.700"); |
|
@ -93,7 +93,7 @@ const Trade = ( |
|
|
const quantityAsNumber = quantity.replace("$", ""); |
|
|
const quantityAsNumber = quantity.replace("$", ""); |
|
|
|
|
|
|
|
|
let payload: CfdOrderRequestPayload = { |
|
|
let payload: CfdOrderRequestPayload = { |
|
|
order_id: order_id!, |
|
|
order_id: orderId!, |
|
|
quantity: Number.parseFloat(quantityAsNumber), |
|
|
quantity: Number.parseFloat(quantityAsNumber), |
|
|
}; |
|
|
}; |
|
|
await onLongSubmit(payload); |
|
|
await onLongSubmit(payload); |
|
@ -138,7 +138,7 @@ const Trade = ( |
|
|
</Center> |
|
|
</Center> |
|
|
</GridItem> |
|
|
</GridItem> |
|
|
<GridItem colSpan={1}> |
|
|
<GridItem colSpan={1}> |
|
|
<Quantity min={min_quantity} max={max_quantity} quantity={quantity} onChange={onQuantityChange} /> |
|
|
<Quantity min={minQuantity} max={maxQuantity} quantity={quantity} onChange={onQuantityChange} /> |
|
|
</GridItem> |
|
|
</GridItem> |
|
|
<GridItem colSpan={1}> |
|
|
<GridItem colSpan={1}> |
|
|
<Leverage leverage={leverage} /> |
|
|
<Leverage leverage={leverage} /> |
|
|