Skip to content

feat: add full support for TPSL orders and PermitSingle#4

Open
Dmkls wants to merge 5 commits into
SmoothBot:mainfrom
Dmkls:main
Open

feat: add full support for TPSL orders and PermitSingle#4
Dmkls wants to merge 5 commits into
SmoothBot:mainfrom
Dmkls:main

Conversation

@Dmkls

@Dmkls Dmkls commented Jun 10, 2026

Copy link
Copy Markdown

Description

This PR introduces native support for direct Take Profit / Stop Loss (TPSL) order placement and budget approvals, which were previously missing from the SDK. Since TPSL orders are handled off-chain and are not supported by the standard RISEx limits endpoint, this adds the necessary EIP-712 structs, type definitions, and client methods to execute them seamlessly.

Changes Included:

  • Types: Added TypeScript interfaces for ApprovePermitSingleParams, PlaceTpslOrderParams, CancelTpslOrderParams, and TpslOrder in src/types/order.ts.
  • EIP-712 Domains: Exported EIP-712 typing structs (PERMIT_SINGLE_TYPES, PLACE_TPSL_TYPES, CANCEL_TPSL_TYPES) in src/signing/domain.ts.
  • InfoClient: Added getOpenTpslOrders to fetch currently open TPSL orders.
  • ExchangeClient: Added the core authenticated methods:
    • approvePermitSingle: Approves the operator_hub budget.
    • placeTpslOrder: Signs and places a TPSL order.
    • cancelTpslOrder: Signs and cancels a TPSL order.
  • Helper: Exported hexToBase64 in permit.ts to properly format signatures for the Rise backend.

Testing

  • Successfully compiled using npm run build with zero type errors.
  • Signatures align with actual operator_hub and RISEx API requirements.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant