@sodax/sdk 2.0.0-rc.1 → 2.0.0-rc.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +8 -60
  2. package/dist/index.cjs +320 -109
  3. package/dist/index.d.cts +95 -111
  4. package/dist/index.d.ts +95 -111
  5. package/dist/index.mjs +297 -85
  6. package/package.json +24 -24
  7. package/ai-exported/AGENTS.md +0 -99
  8. package/ai-exported/integration/README.md +0 -41
  9. package/ai-exported/integration/ai-rules.md +0 -75
  10. package/ai-exported/integration/architecture.md +0 -519
  11. package/ai-exported/integration/chain-specifics.md +0 -189
  12. package/ai-exported/integration/features/README.md +0 -19
  13. package/ai-exported/integration/features/auxiliary-services.md +0 -189
  14. package/ai-exported/integration/features/bridge.md +0 -136
  15. package/ai-exported/integration/features/dex.md +0 -182
  16. package/ai-exported/integration/features/icx-bnusd-baln.md +0 -181
  17. package/ai-exported/integration/features/money-market.md +0 -198
  18. package/ai-exported/integration/features/staking.md +0 -166
  19. package/ai-exported/integration/features/swap.md +0 -207
  20. package/ai-exported/integration/quickstart.md +0 -213
  21. package/ai-exported/integration/recipes/README.md +0 -21
  22. package/ai-exported/integration/recipes/backend-server-init.md +0 -69
  23. package/ai-exported/integration/recipes/chain-key-narrowing.md +0 -65
  24. package/ai-exported/integration/recipes/gas-estimation.md +0 -33
  25. package/ai-exported/integration/recipes/initialize-sodax.md +0 -53
  26. package/ai-exported/integration/recipes/raw-tx-flow.md +0 -71
  27. package/ai-exported/integration/recipes/result-and-errors.md +0 -104
  28. package/ai-exported/integration/recipes/signed-tx-flow.md +0 -46
  29. package/ai-exported/integration/recipes/testing.md +0 -101
  30. package/ai-exported/integration/reference/README.md +0 -18
  31. package/ai-exported/integration/reference/chain-keys.md +0 -67
  32. package/ai-exported/integration/reference/error-codes.md +0 -165
  33. package/ai-exported/integration/reference/glossary.md +0 -32
  34. package/ai-exported/integration/reference/public-api.md +0 -138
  35. package/ai-exported/integration/reference/wallet-providers.md +0 -62
  36. package/ai-exported/migration/README.md +0 -58
  37. package/ai-exported/migration/ai-rules.md +0 -80
  38. package/ai-exported/migration/breaking-changes/architecture.md +0 -335
  39. package/ai-exported/migration/breaking-changes/result-and-errors.md +0 -363
  40. package/ai-exported/migration/breaking-changes/type-system.md +0 -321
  41. package/ai-exported/migration/checklist.md +0 -61
  42. package/ai-exported/migration/features/README.md +0 -35
  43. package/ai-exported/migration/features/auxiliary-services.md +0 -156
  44. package/ai-exported/migration/features/bridge.md +0 -125
  45. package/ai-exported/migration/features/dex.md +0 -143
  46. package/ai-exported/migration/features/icx-bnusd-baln.md +0 -151
  47. package/ai-exported/migration/features/money-market.md +0 -214
  48. package/ai-exported/migration/features/staking.md +0 -138
  49. package/ai-exported/migration/features/swap.md +0 -198
  50. package/ai-exported/migration/recipes.md +0 -288
  51. package/ai-exported/migration/reference/README.md +0 -18
  52. package/ai-exported/migration/reference/deleted-exports.md +0 -100
  53. package/ai-exported/migration/reference/error-code-crosswalk.md +0 -104
  54. package/ai-exported/migration/reference/return-shapes.md +0 -49
  55. package/ai-exported/migration/reference/sodax-config.md +0 -52
  56. package/dist/index.cjs.map +0 -1
  57. package/dist/index.mjs.map +0 -1
package/README.md CHANGED
@@ -98,73 +98,21 @@ How to setup local development
98
98
 
99
99
  ## AI agent docs
100
100
 
101
- `@sodax/sdk` ships an AI-ready documentation tree at `node_modules/@sodax/sdk/ai-exported/`. It's tool-neutral: any agent that can read files (Claude Code, Cursor, Aider, Copilot Chat, ChatGPT with file context, etc.) can use it without further setup.
101
+ AI-readable docs for `@sodax/sdk` (and the other `@sodax/*` packages) are shipped via [`@sodax/skills`](https://github.com/icon-project/sodax-sdks/tree/main/packages/skills) a separate npm package bundling Claude-Code SKILL.md files and a long-form knowledge tree.
102
102
 
103
- ### Get started
103
+ **Recommended: [`skills` CLI](https://github.com/vercel-labs/skills)** — from your project root:
104
104
 
105
- Point your agent at `node_modules/@sodax/sdk/ai-exported/AGENTS.md` — it routes to the rest. Three sample prompts covering the typical entry points:
106
-
107
- ```
108
- > Read node_modules/@sodax/sdk/ai-exported/AGENTS.md and integrate
109
- > SODAX cross-chain swaps from Arbitrum to Stellar into my Node service.
110
-
111
- > Read node_modules/@sodax/sdk/ai-exported/AGENTS.md. My code uses
112
- > @sodax/sdk v1 — port my call sites to v2.
113
-
114
- > Look up the v2 SodaxError code for a relay timeout in
115
- > node_modules/@sodax/sdk/ai-exported/integration/reference/error-codes.md.
105
+ ```bash
106
+ npx skills@latest add icon-project/sodax-sdks/packages/skills
116
107
  ```
117
108
 
118
- ### What's inside
109
+ **npm + `AGENTS.md` pointer** (fallback for web chats, or when you prefer a devDependency over the CLI):
119
110
 
111
+ ```bash
112
+ pnpm add -D @sodax/skills
120
113
  ```
121
- ai-exported/
122
- ├── AGENTS.md # Tool-neutral entry point — start here
123
- ├── integration/ # Building NEW v2 code
124
- │ ├── README.md, ai-rules.md # Index + DO / DO NOT / workflow for agents
125
- │ ├── quickstart.md # Install + initialize + first-run troubleshooting
126
- │ ├── architecture.md # Type system + design concepts (Result, ChainKeys, …)
127
- │ ├── chain-specifics.md # Non-EVM quirks (Stellar, BTC, Solana, ICON, NEAR)
128
- │ ├── features/ # 7 feature pages: swap, money-market, staking, bridge,
129
- │ │ # dex, icx-bnusd-baln, auxiliary-services
130
- │ ├── recipes/ # 8 copy-pasteable patterns: init, signed-/raw-tx flow,
131
- │ │ # error handling, narrowing, testing, gas, backend init
132
- │ └── reference/ # 5 lookup tables: chain keys, wallet providers,
133
- │ # error codes, public API surface, glossary
134
- └── migration/ # Porting EXISTING v1 code to v2
135
- ├── README.md, ai-rules.md # Index + workflow for porting agents
136
- ├── checklist.md # 17-step cross-cutting checklist
137
- ├── breaking-changes/ # 3 cross-cutting changes: type-system, architecture,
138
- │ # result-and-errors
139
- ├── features/ # 7 per-feature porting playbooks (same names as
140
- │ # integration/features/)
141
- ├── recipes.md # Codemods + error-shape and Result adapters
142
- └── reference/ # 4 reference tables: deleted exports, sodax-config
143
- # reshape, error-code crosswalk, return-shape diffs
144
- ```
145
-
146
- ### Scope
147
-
148
- This tree documents `@sodax/sdk` (the Core SDK) only. It assumes:
149
-
150
- - **TypeScript** — examples are TS; the SDK ships dual ESM/CJS.
151
- - **Runtime-agnostic** — Node.js, browsers, bundled apps. **No React or Next.js content** — the SDK is UI-framework-agnostic and the docs reflect that.
152
- - **`@sodax/types` is re-exported** through `@sodax/sdk`'s barrel; consumers don't add it as a separate dependency.
153
-
154
- `@sodax/wallet-sdk-core` is **mentioned** in a few places as a pointer — it's a separate SODAX package that ships ready-made `I*WalletProvider` implementations for all 9 chain families. Consumers can install it separately or implement the wallet-provider interfaces themselves. React-layer packages (`@sodax/wallet-sdk-react`, `@sodax/dapp-kit`) are **out of scope here** and may have their own `ai-exported/` trees in their respective packages.
155
-
156
- ### Integrity guarantees
157
-
158
- Every release passes four CI checks against `ai-exported/`:
159
-
160
- | Guard | What it catches |
161
- |---|---|
162
- | `check:ai-exported` | Each top-level `sodax.X` reference matches a real public member of the `Sodax` class in `src/shared/entities/Sodax.ts`. (Shallow — `sodax.partners.invented` would still pass.) |
163
- | `check:ai-scope` | No accidental sibling-package, React, or Next.js content leaks in. |
164
- | `check:ai-links` | Every relative link between markdown files resolves. |
165
- | `check:ai-imports` | Every `import … from '@sodax/sdk'` example in the docs typechecks against the SDK source. |
166
114
 
167
- If you're contributing to this repo, run them with `pnpm -C packages/sdk run check:ai-exported` (or `:scope`, `:links`, `:imports`).
115
+ Then point your agent at `node_modules/@sodax/skills/AGENTS.md`. See [docs/ai-integration-guide.md](https://github.com/icon-project/sodax-sdks/blob/main/docs/ai-integration-guide.md) for all install modes and per-tool wiring.
168
116
 
169
117
  ***
170
118