@sodax/sdk 2.0.0-rc.1 → 2.0.0-rc.11
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.
- package/README.md +8 -60
- package/dist/index.cjs +343 -113
- package/dist/index.d.cts +102 -113
- package/dist/index.d.ts +102 -113
- package/dist/index.mjs +321 -90
- package/package.json +24 -24
- package/ai-exported/AGENTS.md +0 -99
- package/ai-exported/integration/README.md +0 -41
- package/ai-exported/integration/ai-rules.md +0 -75
- package/ai-exported/integration/architecture.md +0 -519
- package/ai-exported/integration/chain-specifics.md +0 -189
- package/ai-exported/integration/features/README.md +0 -19
- package/ai-exported/integration/features/auxiliary-services.md +0 -189
- package/ai-exported/integration/features/bridge.md +0 -136
- package/ai-exported/integration/features/dex.md +0 -182
- package/ai-exported/integration/features/icx-bnusd-baln.md +0 -181
- package/ai-exported/integration/features/money-market.md +0 -198
- package/ai-exported/integration/features/staking.md +0 -166
- package/ai-exported/integration/features/swap.md +0 -207
- package/ai-exported/integration/quickstart.md +0 -213
- package/ai-exported/integration/recipes/README.md +0 -21
- package/ai-exported/integration/recipes/backend-server-init.md +0 -69
- package/ai-exported/integration/recipes/chain-key-narrowing.md +0 -65
- package/ai-exported/integration/recipes/gas-estimation.md +0 -33
- package/ai-exported/integration/recipes/initialize-sodax.md +0 -53
- package/ai-exported/integration/recipes/raw-tx-flow.md +0 -71
- package/ai-exported/integration/recipes/result-and-errors.md +0 -104
- package/ai-exported/integration/recipes/signed-tx-flow.md +0 -46
- package/ai-exported/integration/recipes/testing.md +0 -101
- package/ai-exported/integration/reference/README.md +0 -18
- package/ai-exported/integration/reference/chain-keys.md +0 -67
- package/ai-exported/integration/reference/error-codes.md +0 -165
- package/ai-exported/integration/reference/glossary.md +0 -32
- package/ai-exported/integration/reference/public-api.md +0 -138
- package/ai-exported/integration/reference/wallet-providers.md +0 -62
- package/ai-exported/migration/README.md +0 -58
- package/ai-exported/migration/ai-rules.md +0 -80
- package/ai-exported/migration/breaking-changes/architecture.md +0 -335
- package/ai-exported/migration/breaking-changes/result-and-errors.md +0 -363
- package/ai-exported/migration/breaking-changes/type-system.md +0 -321
- package/ai-exported/migration/checklist.md +0 -61
- package/ai-exported/migration/features/README.md +0 -35
- package/ai-exported/migration/features/auxiliary-services.md +0 -156
- package/ai-exported/migration/features/bridge.md +0 -125
- package/ai-exported/migration/features/dex.md +0 -143
- package/ai-exported/migration/features/icx-bnusd-baln.md +0 -151
- package/ai-exported/migration/features/money-market.md +0 -214
- package/ai-exported/migration/features/staking.md +0 -138
- package/ai-exported/migration/features/swap.md +0 -198
- package/ai-exported/migration/recipes.md +0 -288
- package/ai-exported/migration/reference/README.md +0 -18
- package/ai-exported/migration/reference/deleted-exports.md +0 -100
- package/ai-exported/migration/reference/error-code-crosswalk.md +0 -104
- package/ai-exported/migration/reference/return-shapes.md +0 -49
- package/ai-exported/migration/reference/sodax-config.md +0 -52
- package/dist/index.cjs.map +0 -1
- 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`
|
|
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
|
-
|
|
103
|
+
**Recommended: [`skills` CLI](https://github.com/vercel-labs/skills)** — from your project root:
|
|
104
104
|
|
|
105
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|