Represents a swap-routed payment where the payer pays in one token and the merchant settles in another. Specific to Shade's cross-asset capabilities.
Proposed Steps:
- Create
src/shade/models/swap.py.
- Fields:
id, pay_in_token, settle_out_token, amount_in: Decimal, amount_out: Optional[Decimal], routing_path: list[str], slippage_tolerance: float, status, stellar_tx_hash: Optional[str], created_at.
- Add
SwapStatus enum: pending, swapping, completed, failed, slippage_exceeded.
- Validate
0 < slippage_tolerance < 1.
Acceptance Criteria:
SwapPayment.from_dict(...) populates all fields including routing path list.
slippage_tolerance outside (0, 1) raises ValueError.
status is a SwapStatus enum.
Represents a swap-routed payment where the payer pays in one token and the merchant settles in another. Specific to Shade's cross-asset capabilities.
Proposed Steps:
src/shade/models/swap.py.id,pay_in_token,settle_out_token,amount_in: Decimal,amount_out: Optional[Decimal],routing_path: list[str],slippage_tolerance: float,status,stellar_tx_hash: Optional[str],created_at.SwapStatusenum:pending,swapping,completed,failed,slippage_exceeded.0 < slippage_tolerance < 1.Acceptance Criteria:
SwapPayment.from_dict(...)populates all fields including routing path list.slippage_toleranceoutside(0, 1)raisesValueError.statusis aSwapStatusenum.