sodax-sdk-swap
Installation
SKILL.md
Swap (Core SDK granular skill)
Granular skill for the swap feature of @sodax/sdk v2. Source-of-truth reference lives in the parent broad skill's knowledge tree — this file is the focused workflow only.
Step 1 — Clarify with user before coding
Swap has materially different code paths depending on the answers. Don't skip:
- Are you writing new code, or porting v1 code to v2?
- New code → § Integration workflow below.
- Port v1 → v2 → § Migration workflow.
- Signed flow (frontend wallet, browser/RN) or unsigned-tx flow (backend / custom relay)?
- Signed →
raw: false+walletProvider. - Unsigned →
raw: true, you handle relay yourself.
- Signed →
- One-shot
swap()or step-by-step (createIntent→ backend submit →postExecution)?- One-shot is the default for frontends. Step-by-step is for backends that already have a relay/orchestration layer.
- Market order or limit order? Limit orders use a different params shape (no
deadline).