Skip to content

Commit

Permalink
Add reduce only to mango instruction parsing (solana-labs#21583)
Browse files Browse the repository at this point in the history
* add reduce only to mango instruction parsing

* yarn format
  • Loading branch information
tlrjs authored Dec 4, 2021
1 parent a433bb3 commit e130b2c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ export function PlacePerpOrderDetailsCard(props: {
<td className="text-lg-end">{orderLotDetails?.size}</td>
</tr>
)}
<tr>
<td>Reduce only</td>
<td className="text-lg-end">{info.reduceOnly}</td>
</tr>
</InstructionCard>
);
}
3 changes: 3 additions & 0 deletions explorer/src/components/instruction/mango/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ export type PlacePerpOrder = {
clientOrderId: String;
side: String;
orderType: String;
reduceOnly: String;
};

export const decodePlacePerpOrder = (
ix: TransactionInstruction
): PlacePerpOrder => {
Expand All @@ -203,6 +205,7 @@ export const decodePlacePerpOrder = (
clientOrderId: decoded.PlacePerpOrder.clientOrderId.toString(),
side: decoded.PlacePerpOrder.side.toString(),
orderType: decoded.PlacePerpOrder.orderType.toString(),
reduceOnly: decoded.PlacePerpOrder.reduceOnly.toString(),
};

return placePerpOrder;
Expand Down

0 comments on commit e130b2c

Please sign in to comment.