Decode the side field from the Jupiter Perps Position account.
Map the decoded value to JupiterPerpsPositionDirection.
Keep existing entry price decoding unchanged.
Non-goals:
No market/token name
No collateral
No liquidation price
No wallet discovery changes
No trading or transaction signing
Acceptance criteria:
JupiterPerpsPosition contains a direction field.
Direction is decoded from the Position account.
Existing getPosition(...) and getOpenPositions(...) still work.
### Description:
Extend the Jupiter Perps position API with the position direction.
Add a direction field to `JupiterPerpsPosition` so callers can see whether a position is `LONG` or `SHORT`.
### Suggested API change:
```java
public record JupiterPerpsPosition(
ΩJupiterPerpsPositionAccountΩ positionAccount,
ΩUSDCPriceΩ entryPrice,
JupiterPerpsPositionDirection direction
) {
}
```
Add enum:
```java
public enum JupiterPerpsPositionDirection {
LONG,
SHORT
}
```
###
Implementation:
* Decode the `side` field from the Jupiter Perps Position account.
* Map the decoded value to `JupiterPerpsPositionDirection`.
* Keep existing entry price decoding unchanged.
### Non-goals:
* No market/token name
* No collateral
* No liquidation price
* No wallet discovery changes
* No trading or transaction signing
### Acceptance criteria:
* `JupiterPerpsPosition` contains a direction field.
* Direction is decoded from the Position account.
* Existing `getPosition(...)` and `getOpenPositions(...)` still work.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Description:
Extend the Jupiter Perps position API with the position direction.
Add a direction field to
JupiterPerpsPositionso callers can see whether a position isLONGorSHORT.Suggested API change:
Add enum:
Implementation:
sidefield from the Jupiter Perps Position account.JupiterPerpsPositionDirection.Non-goals:
Acceptance criteria:
JupiterPerpsPositioncontains a direction field.getPosition(...)andgetOpenPositions(...)still work.