Add reduce only to mango instruction parsing (#21583)

* add reduce only to mango instruction parsing

* yarn format
This commit is contained in:
tjshipe
2021-12-03 19:21:42 -05:00
committed by GitHub
parent a433bb310d
commit e130b2cffc
2 changed files with 7 additions and 0 deletions

View File

@ -113,6 +113,10 @@ export function PlacePerpOrderDetailsCard(props: {
<td className="text-lg-end">{orderLotDetails?.size}</td> <td className="text-lg-end">{orderLotDetails?.size}</td>
</tr> </tr>
)} )}
<tr>
<td>Reduce only</td>
<td className="text-lg-end">{info.reduceOnly}</td>
</tr>
</InstructionCard> </InstructionCard>
); );
} }

View File

@ -192,7 +192,9 @@ export type PlacePerpOrder = {
clientOrderId: String; clientOrderId: String;
side: String; side: String;
orderType: String; orderType: String;
reduceOnly: String;
}; };
export const decodePlacePerpOrder = ( export const decodePlacePerpOrder = (
ix: TransactionInstruction ix: TransactionInstruction
): PlacePerpOrder => { ): PlacePerpOrder => {
@ -203,6 +205,7 @@ export const decodePlacePerpOrder = (
clientOrderId: decoded.PlacePerpOrder.clientOrderId.toString(), clientOrderId: decoded.PlacePerpOrder.clientOrderId.toString(),
side: decoded.PlacePerpOrder.side.toString(), side: decoded.PlacePerpOrder.side.toString(),
orderType: decoded.PlacePerpOrder.orderType.toString(), orderType: decoded.PlacePerpOrder.orderType.toString(),
reduceOnly: decoded.PlacePerpOrder.reduceOnly.toString(),
}; };
return placePerpOrder; return placePerpOrder;