@sodax/skills 2.2.0-rc.8 → 2.3.0-rc.1
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/AGENTS.md +11 -10
- package/README.md +5 -5
- package/package.json +6 -5
- package/skills/sodax-build/SKILL.md +3 -3
- package/skills/sodax-build/knowledge/README.md +1 -1
- package/skills/sodax-build/knowledge/feature-catalog.md +4 -0
- package/skills/sodax-build/knowledge/glossary.md +1 -0
- package/skills/sodax-build/knowledge/handoff.md +3 -0
- package/skills/sodax-build/knowledge/interview-guide.md +1 -0
- package/skills/sodax-dapp-kit/SKILL.md +23 -5
- package/skills/sodax-dapp-kit/auxiliary-services/SKILL.md +4 -1
- package/skills/sodax-dapp-kit/bridge/SKILL.md +1 -1
- package/skills/sodax-dapp-kit/integration/knowledge/ai-rules.md +3 -0
- package/skills/sodax-dapp-kit/integration/knowledge/architecture.md +18 -4
- package/skills/sodax-dapp-kit/integration/knowledge/features/auxiliary-services.md +31 -1
- package/skills/sodax-dapp-kit/integration/knowledge/features/bridge.md +8 -0
- package/skills/sodax-dapp-kit/integration/knowledge/features/leverage-yield.md +17 -3
- package/skills/sodax-dapp-kit/integration/knowledge/features/swap.md +24 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/README.md +1 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/bridge.md +2 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/dex.md +23 -8
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/leverage-yield-product-anatomy.md +150 -0
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/leverage-yield.md +122 -38
- package/skills/sodax-dapp-kit/integration/knowledge/recipes/swap.md +141 -1
- package/skills/sodax-dapp-kit/integration/knowledge/reference/hooks-index.md +14 -3
- package/skills/sodax-dapp-kit/integration/knowledge/reference/public-api.md +1 -1
- package/skills/sodax-dapp-kit/integration/knowledge/reference/querykey-conventions.md +8 -0
- package/skills/sodax-dapp-kit/leverage-yield/SKILL.md +27 -10
- package/skills/sodax-dapp-kit/swap/SKILL.md +3 -3
- package/skills/sodax-sdk/SKILL.md +2 -1
- package/skills/sodax-sdk/bridge/SKILL.md +3 -1
- package/skills/sodax-sdk/integration/knowledge/ai-rules.md +3 -0
- package/skills/sodax-sdk/integration/knowledge/architecture.md +1 -1
- package/skills/sodax-sdk/integration/knowledge/features/bridge-api.md +5 -3
- package/skills/sodax-sdk/integration/knowledge/features/bridge.md +8 -0
- package/skills/sodax-sdk/integration/knowledge/features/leverage-yield.md +81 -12
- package/skills/sodax-sdk/integration/knowledge/features/swap.md +68 -2
- package/skills/sodax-sdk/integration/knowledge/features/swaps-api.md +56 -2
- package/skills/sodax-sdk/integration/knowledge/reference/error-codes.md +27 -1
- package/skills/sodax-sdk/integration/knowledge/reference/public-api.md +30 -1
- package/skills/sodax-sdk/leverage-yield/SKILL.md +16 -8
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/breaking-changes/architecture.md +1 -1
- package/skills/sodax-sdk/migration-v1-to-v2/knowledge/reference/sodax-config.md +9 -1
- package/skills/sodax-sdk/swap/SKILL.md +3 -1
- package/skills/sodax-sdk/swaps-api/SKILL.md +3 -2
- package/skills/sodax-wallet-sdk-core/SKILL.md +20 -2
- package/skills/sodax-wallet-sdk-core/evm/SKILL.md +2 -1
- package/skills/sodax-wallet-sdk-core/integration/knowledge/README.md +1 -1
- package/skills/sodax-wallet-sdk-core/integration/knowledge/features/evm.md +6 -0
- package/skills/sodax-wallet-sdk-core/integration/knowledge/reference/interfaces.md +4 -1
- package/skills/sodax-wallet-sdk-core/migration-v1-to-v2/knowledge/README.md +1 -1
- package/skills/sodax-wallet-sdk-react/SKILL.md +20 -3
- package/skills/sodax-wallet-sdk-react/integration/knowledge/README.md +2 -1
- package/skills/sodax-wallet-sdk-react/integration/knowledge/ai-rules.md +2 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/architecture.md +10 -6
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/05-privy-email-login.tsx +157 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/examples/README.md +1 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/recipes/privy-email-login.md +111 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/api-surface.md +14 -0
- package/skills/sodax-wallet-sdk-react/integration/knowledge/reference/chain-support.md +1 -1
- package/skills/sodax-wallet-sdk-react/migration-v1-to-v2/knowledge/README.md +1 -1
- package/skills/sodax-wallet-sdk-react/privy/SKILL.md +53 -0
- package/skills/sodax-wallet-sdk-react/wallet-modal/SKILL.md +1 -0
package/AGENTS.md
CHANGED
|
@@ -12,10 +12,10 @@ This package ships **mode-gated broad SDK skills** (`skills/<name>/SKILL.md`, on
|
|
|
12
12
|
|---|---|---|
|
|
13
13
|
| `@sodax/sdk` | `sodax-sdk` | `sodax-sdk/swap`, `sodax-sdk/money-market`, `sodax-sdk/bridge`, `sodax-sdk/staking`, `sodax-sdk/dex`, `sodax-sdk/leverage-yield`, `sodax-sdk/migration`, `sodax-sdk/partner`, `sodax-sdk/recovery`, `sodax-sdk/sponsoring`, `sodax-sdk/backend-api`, `sodax-sdk/swaps-api`, `sodax-sdk/leverage-yield-api` |
|
|
14
14
|
| `@sodax/wallet-sdk-core` | `sodax-wallet-sdk-core` | `sodax-wallet-sdk-core/evm`, `sodax-wallet-sdk-core/solana`, `sodax-wallet-sdk-core/sui`, `sodax-wallet-sdk-core/bitcoin`, `sodax-wallet-sdk-core/stellar`, `sodax-wallet-sdk-core/icon`, `sodax-wallet-sdk-core/injective`, `sodax-wallet-sdk-core/near`, `sodax-wallet-sdk-core/stacks` |
|
|
15
|
-
| `@sodax/wallet-sdk-react` | `sodax-wallet-sdk-react` | `sodax-wallet-sdk-react/connect`, `sodax-wallet-sdk-react/wallet-modal`, `sodax-wallet-sdk-react/bridge-to-sdk`, `sodax-wallet-sdk-react/switch-chain`, `sodax-wallet-sdk-react/sign-message`, `sodax-wallet-sdk-react/walletconnect` |
|
|
15
|
+
| `@sodax/wallet-sdk-react` | `sodax-wallet-sdk-react` | `sodax-wallet-sdk-react/connect`, `sodax-wallet-sdk-react/wallet-modal`, `sodax-wallet-sdk-react/bridge-to-sdk`, `sodax-wallet-sdk-react/switch-chain`, `sodax-wallet-sdk-react/sign-message`, `sodax-wallet-sdk-react/walletconnect`, `sodax-wallet-sdk-react/privy` |
|
|
16
16
|
| `@sodax/dapp-kit` | `sodax-dapp-kit` | `sodax-dapp-kit/swap`, `sodax-dapp-kit/money-market`, `sodax-dapp-kit/staking`, `sodax-dapp-kit/bridge`, `sodax-dapp-kit/dex`, `sodax-dapp-kit/leverage-yield`, `sodax-dapp-kit/migration`, `sodax-dapp-kit/bitcoin`, `sodax-dapp-kit/auxiliary-services` |
|
|
17
17
|
|
|
18
|
-
**When to prefer a granular skill:** if the consumer has already picked a sub-domain (e.g. *"swap with Sodax"*, *"supply on money market"*, *"useSwap hook"*, *"instantiate EvmWalletProvider"*, *"add a connect button"*), load the matching granular skill — it's ~3 KB vs the broad skill's ~13 KB and points at exactly the knowledge files needed. For a React dapp that has settled on one feature, load `sodax-dapp-kit/<feature>`; for raw SDK / backend work, load `sodax-sdk/<feature>`; for a known chain in a backend/Node wallet flow, load `sodax-wallet-sdk-core/<chain>`; for a known React wallet concern (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect), load `sodax-wallet-sdk-react/<concern>`. Load the broad skill when the sub-domain is undecided, the task spans several, or the consumer is porting a full v1 codebase.
|
|
18
|
+
**When to prefer a granular skill:** if the consumer has already picked a sub-domain (e.g. *"swap with Sodax"*, *"supply on money market"*, *"useSwap hook"*, *"instantiate EvmWalletProvider"*, *"add a connect button"*), load the matching granular skill — it's ~3 KB vs the broad skill's ~13 KB and points at exactly the knowledge files needed. For a React dapp that has settled on one feature, load `sodax-dapp-kit/<feature>`; for raw SDK / backend work, load `sodax-sdk/<feature>`; for a known chain in a backend/Node wallet flow, load `sodax-wallet-sdk-core/<chain>`; for a known React wallet concern (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect, privy), load `sodax-wallet-sdk-react/<concern>`. Load the broad skill when the sub-domain is undecided, the task spans several, or the consumer is porting a full v1 codebase.
|
|
19
19
|
|
|
20
20
|
> **What about `@sodax/types`?** No skill. The package has no consumer-facing surface — it's pure TypeScript types, re-exported through `@sodax/sdk`. Importing `@sodax/types` directly invites version skew. The SDK skills cover all `@sodax/types` symbols you need.
|
|
21
21
|
|
|
@@ -29,7 +29,7 @@ Pick the consumer's situation, load the listed skills in order. Each entry names
|
|
|
29
29
|
| **Scaffolding ONE specific Core SDK feature** (swap, money-market, bridge, staking, dex, leverage-yield, migration, partner, recovery, sponsoring, backend-api, swaps-api, leverage-yield-api) | `sodax-sdk/<feature>` (granular, covers both modes via internal links). Add `sodax-wallet-sdk-core` (integration) if it signs and lives outside React. Skip the broad `sodax-sdk` skill |
|
|
30
30
|
| **Scaffolding ONE specific dapp-kit feature in React** (swap, money-market, staking, bridge, dex, leverage-yield, migration, bitcoin, auxiliary-services) | `sodax-wallet-sdk-react` (integration) → `sodax-dapp-kit/<feature>` (granular, covers both modes via internal links). Skip the broad `sodax-dapp-kit` skill. If the wallet concern is also settled (just a connect button, modal, bridge, etc.), narrow to `sodax-wallet-sdk-react/<concern>` too |
|
|
31
31
|
| **Scaffolding ONE chain's wallet provider** (backend/Node/non-React: evm, solana, sui, bitcoin, stellar, icon, injective, near, stacks) | `sodax-wallet-sdk-core/<chain>` (granular, covers both modes) → `sodax-sdk/<feature>` for the operation it signs. Skip the broad `sodax-wallet-sdk-core` skill |
|
|
32
|
-
| **Scaffolding ONE React wallet concern** (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect) | `sodax-wallet-sdk-react/<concern>` (granular, covers both modes). Skip the broad `sodax-wallet-sdk-react` skill |
|
|
32
|
+
| **Scaffolding ONE React wallet concern** (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect, privy) | `sodax-wallet-sdk-react/<concern>` (granular, covers both modes). Skip the broad `sodax-wallet-sdk-react` skill |
|
|
33
33
|
| **Building a NEW React dapp** | `sodax-wallet-sdk-react` (integration) → `sodax-dapp-kit` (integration) → (`sodax-sdk` (integration) only if dropping below dapp-kit) |
|
|
34
34
|
| **Building a NEW React app, no dapp-kit** (calling the SDK directly) | `sodax-wallet-sdk-react` (integration) → `sodax-sdk` (integration) |
|
|
35
35
|
| **Building a NEW Node / backend service or script** | `sodax-sdk` (integration) → `sodax-wallet-sdk-core` (integration; only if it signs) |
|
|
@@ -71,7 +71,7 @@ packages/skills/
|
|
|
71
71
|
├── sodax-wallet-sdk-react/ {SKILL.md, integration/knowledge/, migration-v1-to-v2/knowledge/
|
|
72
72
|
│ (incl. .tsx example apps under integration/knowledge/examples/),
|
|
73
73
|
│ <concern>/SKILL.md children — connect, wallet-modal, bridge-to-sdk,
|
|
74
|
-
│ switch-chain, sign-message, walletconnect}
|
|
74
|
+
│ switch-chain, sign-message, walletconnect, privy}
|
|
75
75
|
└── sodax-dapp-kit/ {SKILL.md, integration/knowledge/, migration-v1-to-v2/knowledge/,
|
|
76
76
|
<feature>/SKILL.md children — swap, money-market, staking, bridge, dex,
|
|
77
77
|
leverage-yield, migration, bitcoin, auxiliary-services}
|
|
@@ -95,7 +95,7 @@ If the user is doing **DeFi work but explicitly NOT with SODAX** (e.g. "use Unis
|
|
|
95
95
|
|
|
96
96
|
## Feedback
|
|
97
97
|
|
|
98
|
-
If an agent generates wrong code despite following a skill, that's a doc bug — file an issue at https://github.com/
|
|
98
|
+
If an agent generates wrong code despite following a skill, that's a doc bug — file an issue at https://github.com/gosodax/sodax-sdks/issues with the prompt and the incorrect output. The package is structurally CI-guarded (frontmatter + link resolution); prose-level claims benefit from real-world feedback.
|
|
99
99
|
|
|
100
100
|
## Maintaining this package
|
|
101
101
|
|
|
@@ -114,7 +114,7 @@ They exist so agents can load just one workflow (~3 KB) instead of the whole bro
|
|
|
114
114
|
|
|
115
115
|
Granular skills are **one file each** (`<sub-domain>/SKILL.md`). They do **NOT** ship their own `integration/knowledge/` or `migration-v1-to-v2/knowledge/` subtrees — they link directly into the parent broad skill's knowledge tree (`../integration/knowledge/features/<feature>.md`, `../integration/knowledge/recipes/<recipe>.md`, etc.).
|
|
116
116
|
|
|
117
|
-
**Granular skills are bundled, not separately published.** `plugin.json` registers **only the top-level skills** (the broad SDK skills plus the registered meta skill). Each broad skill's directory already contains its nested granular `SKILL.md` files, so installing a broad skill (e.g. `npx skills add … --skill sodax-sdk`) lands every granular file alongside the knowledge tree; the broad SKILL.md's "prefer a granular skill" table then links to `./swap/SKILL.md` etc., which resolve in the consumer's install. Granular skills are deliberately **not** registered because they are not self-contained: a granular `SKILL.md` links **up** into its parent's tree (`../integration/knowledge/...`), and the `skills` CLI copies only a skill's own directory — so installing a granular skill standalone would leave every `../knowledge` link dangling. Keeping the registry to the top-level skills also concentrates skills.sh install telemetry (which drives search ranking) instead of diluting it across the many bundled granular rows. To add a new granular skill, drop a `<feature>/SKILL.md` into the broad skill dir — do **not** add it to `plugin.json`.
|
|
117
|
+
**Granular skills are bundled, not separately published.** `plugin.json` registers **only the top-level skills** (the broad SDK skills plus the registered meta skill). Each broad skill's directory already contains its nested granular `SKILL.md` files, so installing a broad skill (e.g. `npx skills add … --skill sodax-sdk`) lands every granular file alongside the knowledge tree; the broad SKILL.md's "prefer a granular skill" table then links to `./swap/SKILL.md` etc., which resolve in the consumer's install. Granular skills are deliberately **not** registered because they are not self-contained: a granular `SKILL.md` links **up** into its parent's tree (`../integration/knowledge/...`), and the `skills` CLI copies only a skill's own directory — so installing a granular skill standalone would leave every `../knowledge` link dangling. Keeping the registry to the top-level skills also concentrates skills.sh install telemetry (which drives search ranking) instead of diluting it across the many bundled granular rows. To add a new granular skill, drop a `<feature>/SKILL.md` into the broad skill dir and add its row to the parent's "Prefer a granular skill" table (`check:ai-structural` fails without it) — do **not** add it to `plugin.json`. Agents only auto-discover top-level skills, so that row is how they find it.
|
|
118
118
|
|
|
119
119
|
**Family rule:** every granular skill shares its parent broad skill's family. Family is the broad-skill name (`sdk`, `wallet-sdk-core`, `wallet-sdk-react`, `dapp-kit`). Cross-family clickable links remain forbidden; intra-family links (broad ↔ granular, granular ↔ granular within the same broad parent) are explicitly allowed.
|
|
120
120
|
|
|
@@ -162,16 +162,17 @@ To add another meta skill later: drop `skills/<name>/SKILL.md` + a flat `knowled
|
|
|
162
162
|
pnpm --filter @sodax/skills check:ai
|
|
163
163
|
```
|
|
164
164
|
|
|
165
|
-
Chains
|
|
165
|
+
Chains seven sub-scripts. Each catches a distinct bug class — green guards together prove syntactic + structural correctness, but **NOT** prose-level accuracy.
|
|
166
166
|
|
|
167
167
|
| Sub-script | What it enforces | Source of truth | Opt-out |
|
|
168
168
|
|---|---|---|---|
|
|
169
|
-
| `check:ai-structural` | `.claude-plugin/plugin.json` parses and registers exactly the expected broad SDK skills + meta skills (the `EXPECTED_*` arrays in `check-skills.sh` are the source of truth); every SKILL.md (broad + bundled granular + meta) has valid `name:` / `description:` frontmatter; no orphan top-level skill dirs; every relative `.md` link resolves. | this package's filesystem | none — structural |
|
|
169
|
+
| `check:ai-structural` | `.claude-plugin/plugin.json` parses and registers exactly the expected broad SDK skills + meta skills (the `EXPECTED_*` arrays in `check-skills.sh` are the source of truth); every SKILL.md (broad + bundled granular + meta) has valid `name:` / `description:` frontmatter; no orphan top-level skill dirs; every relative `.md` link resolves; every granular skill is linked from its parent SKILL.md (its "Prefer a granular skill" row), every `integration/knowledge/features/*.md` is named in the parent's integration section, and every registered description fits Claude Code's 1,536-character skill-listing cap. | this package's filesystem | none — structural |
|
|
170
170
|
| `check:ai-imports` | Every `import … from '@sodax/<pkg>'` statement in `skills/sodax-<pkg>/{integration,migration-v1-to-v2}/knowledge/**/*.md` + each SDK package's README/AGENTS.md typechecks against `packages/<pkg>/src/index.ts`. Catches deleted / renamed exports. | `packages/<pkg>/src/index.ts` via fixture tsconfig `paths` | none |
|
|
171
171
|
| `check:ai-snippets` | Every fenced ts/tsx code block in `skills/sodax-{dapp-kit,wallet-sdk-react}/{integration,migration-v1-to-v2}/knowledge/**/*.md` typechecks against the real SDK. Catches call-shape drift. Pattern-style blocks can opt out with the marker; real working examples still validate. | same as imports, plus `_ai-snippets-fixture/_preamble.d.ts` ambients | `// @ai-snippets-skip` as first content line of the block |
|
|
172
172
|
| `check:ai-tsx-examples` | Every standalone `.tsx` file under `skills/sodax-<pkg>/integration/knowledge/examples/` typechecks as a complete module against the live `src/`. Catches export drift, hook-shape drift, and renamed-param drift in runnable user-facing examples. | each SDK package's `src/index.ts` (and `xchains/*` sub-paths for wallet-sdk-react) via fixture tsconfig `paths` | none — illustrative blocks live in `.md` via `@ai-snippets-skip`; `integration/knowledge/examples/` is for runnable code only |
|
|
173
173
|
| `check:ai-keys` | Every `queryKey: [...]` / `mutationKey: [...]` literal in `skills/sodax-dapp-kit/{integration,migration-v1-to-v2}/knowledge/**/*.md` has a matching prefix in `packages/dapp-kit/src/hooks/**/*.ts`. Catches `'stakingInfo'` vs `'info'`-style drift. | `packages/dapp-kit/src/hooks/**/*.ts` | `<!-- ai-keys-allow -->` or `// ai-keys-allow` within 3 preceding lines |
|
|
174
174
|
| `check:ai-consistency` | Every polling-interval claim ("polls 3s") near a `useFoo` mention matches the source `refetchInterval` for that hook. | same as keys | `<!-- ai-consistency-allow -->` within 6 preceding lines |
|
|
175
|
+
| `check:ai-safety` | No fenced code block under `skills/` (nor any standalone `.tsx` example) sends a zero minimum output (`minOutputAmount: 0n` and friends) or `skipSimulation: true`. Agents copy examples verbatim, so an unsafe example ships straight into user code; prose may still name the patterns. | this package's filesystem | `ai-safety-allow` in a comment on the same line |
|
|
175
176
|
|
|
176
177
|
Run individually for faster feedback: `pnpm run check:ai-imports`, `pnpm run check:ai-keys`, etc.
|
|
177
178
|
|
|
@@ -181,11 +182,11 @@ Run individually for faster feedback: `pnpm run check:ai-imports`, `pnpm run che
|
|
|
181
182
|
|
|
182
183
|
Two paths:
|
|
183
184
|
|
|
184
|
-
1. **GitHub-based via the [`skills` CLI](https://github.com/vercel-labs/skills)** (primary): `npx skills@latest add
|
|
185
|
+
1. **GitHub-based via the [`skills` CLI](https://github.com/vercel-labs/skills)** (primary): `npx skills@latest add gosodax/sodax-sdks/packages/skills`. Drops skills into the consumer's repo through the CLI-supported agent targets.
|
|
185
186
|
2. **npm** (fallback for web chats / unsupported tools): `pnpm add -D @sodax/skills`. Consumers point their agent at `node_modules/@sodax/skills/AGENTS.md`.
|
|
186
187
|
|
|
187
188
|
The `files` field in `package.json` controls the npm-shipped surface (`.claude-plugin`, `skills`, `AGENTS.md`, `README.md`). Knowledge ships inside each skill, so it travels with `skills/`.
|
|
188
189
|
|
|
189
190
|
### Release
|
|
190
191
|
|
|
191
|
-
Published
|
|
192
|
+
Published by `.github/workflows/sdks-publish.yml`, with every other `@sodax/*` package on an `@sdks@x.y.z` tag, or alone on an `@sodax/skills@x.y.z` tag.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
AI-agent skills and knowledge for building on the **SODAX** cross-chain DeFi platform. Drop this into your repo and your AI coding agent writes v2-correct `@sodax/*` SDK code on the first try.
|
|
4
4
|
|
|
5
|
-
**Full setup** (skills CLI, npm, monorepo/local install, wiring agents to `AGENTS.md`): [docs/ai-integration-guide.md](https://github.com/
|
|
5
|
+
**Full setup** (skills CLI, npm, monorepo/local install, wiring agents to `AGENTS.md`): [docs/ai-integration-guide.md](https://github.com/gosodax/sodax-sdks/blob/main/docs/ai-integration-guide.md).
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -10,12 +10,12 @@ Using the [`skills` CLI](https://github.com/vercel-labs/skills) from Vercel Labs
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
# From the root of your consumer repo
|
|
13
|
-
npx skills@latest add
|
|
13
|
+
npx skills@latest add gosodax/sodax-sdks/packages/skills
|
|
14
14
|
```
|
|
15
15
|
|
|
16
16
|
The five installable skills listed in `.claude-plugin/plugin.json` land in your repo — the `sodax-build` front-door / ideation skill plus the four mode-gated per-SDK-package skills (each with two knowledge subtrees: `integration/` for new v2 code, `migration-v1-to-v2/` for v1→v2 porting). The CLI does **not** copy the package-level `AGENTS.md`; agents auto-discover each skill from its `SKILL.md` frontmatter. Re-running the command picks up the latest content.
|
|
17
17
|
|
|
18
|
-
> **npm fallback** (web chats or when you prefer a devDependency): `pnpm add -D @sodax/skills`, then point your agent at `node_modules/@sodax/skills/AGENTS.md`. See the [integration guide](https://github.com/
|
|
18
|
+
> **npm fallback** (web chats or when you prefer a devDependency): `pnpm add -D @sodax/skills`, then point your agent at `node_modules/@sodax/skills/AGENTS.md`. See the [integration guide](https://github.com/gosodax/sodax-sdks/blob/main/docs/ai-integration-guide.md#wire-your-agent).
|
|
19
19
|
|
|
20
20
|
## What you get
|
|
21
21
|
|
|
@@ -23,7 +23,7 @@ The five installable skills listed in `.claude-plugin/plugin.json` land in your
|
|
|
23
23
|
|---|---|
|
|
24
24
|
| **Front-door skill** at `skills/sodax-build/SKILL.md` | A cross-cutting ideation skill for when you don't know what to build yet. It interviews you, turns the idea into a product brief, and hands off to the right developer skill(s). Writes no app code; flat `knowledge/` tree (no integration/migration split). |
|
|
25
25
|
| **Mode-gated per-SDK-package skills** under `skills/sodax-<pkg>/SKILL.md` | One skill per SODAX SDK package. `<pkg>` ∈ `sdk`, `wallet-sdk-core`, `wallet-sdk-react`, `dapp-kit`. Each SKILL.md gates by mode (integration vs migration) at the top of the body. |
|
|
26
|
-
| **Granular skills** bundled inside each broad skill at `skills/sodax-<pkg>/<sub-domain>/SKILL.md` | Every broad skill ships focused single-domain children: `sodax-sdk` / `sodax-dapp-kit` per feature (swap, money-market, bridge, staking, dex, …); `sodax-wallet-sdk-core` per chain (evm, solana, sui, bitcoin, stellar, icon, injective, near, stacks); `sodax-wallet-sdk-react` per connectivity concern (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect). They install **with** their parent broad skill (not as separate packages); once installed, load one when the task is already scoped to a single sub-domain — it points at exactly the knowledge files for it instead of the whole broad skill. |
|
|
26
|
+
| **Granular skills** bundled inside each broad skill at `skills/sodax-<pkg>/<sub-domain>/SKILL.md` | Every broad skill ships focused single-domain children: `sodax-sdk` / `sodax-dapp-kit` per feature (swap, money-market, bridge, staking, dex, …); `sodax-wallet-sdk-core` per chain (evm, solana, sui, bitcoin, stellar, icon, injective, near, stacks); `sodax-wallet-sdk-react` per connectivity concern (connect, wallet-modal, bridge-to-sdk, switch-chain, sign-message, walletconnect, privy). They install **with** their parent broad skill (not as separate packages); once installed, load one when the task is already scoped to a single sub-domain — it points at exactly the knowledge files for it instead of the whole broad skill. |
|
|
27
27
|
| **Knowledge** under `skills/sodax-<pkg>/{integration,migration-v1-to-v2}/knowledge/` | Long-form supporting docs — features, recipes, reference tables, breaking-change writeups, code examples. Each skill ships both mode subtrees so `npx skills add` copies the full reference together. |
|
|
28
28
|
| **`AGENTS.md`** at the package root | Tool-neutral router: maps the consumer's stated task to the right skill + mode. Ships on npm, so it is the entry point for the `pnpm add -D @sodax/skills` and `file:` installs — the skills CLI does not copy it. |
|
|
29
29
|
|
|
@@ -49,4 +49,4 @@ LLM training data drifts: snippets from chat often use stale method names, resha
|
|
|
49
49
|
|
|
50
50
|
## Feedback
|
|
51
51
|
|
|
52
|
-
If your agent generates wrong code despite reading the docs, that's a doc bug — please open an issue on the [SODAX SDKs repo](https://github.com/
|
|
52
|
+
If your agent generates wrong code despite reading the docs, that's a doc bug — please open an issue on the [SODAX SDKs repo](https://github.com/gosodax/sodax-sdks/issues) with the prompt and the incorrect output. The per-skill `knowledge/` subtrees are structurally CI-guarded (frontmatter, link resolution); prose claims benefit from real-world feedback.
|
package/package.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
|
-
"version": "2.
|
|
7
|
+
"version": "2.3.0-rc.1",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"description": "AI-agent skills and knowledge for consumers of @sodax/* SDKs (Claude Code, Codex, Cursor, …)",
|
|
10
10
|
"keywords": [
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"claude-code",
|
|
15
15
|
"agents"
|
|
16
16
|
],
|
|
17
|
-
"homepage": "https://github.com/
|
|
17
|
+
"homepage": "https://github.com/gosodax/sodax-sdks/tree/main/packages/skills",
|
|
18
18
|
"bugs": {
|
|
19
|
-
"url": "https://github.com/
|
|
19
|
+
"url": "https://github.com/gosodax/sodax-sdks/issues"
|
|
20
20
|
},
|
|
21
21
|
"repository": {
|
|
22
22
|
"type": "git",
|
|
23
|
-
"url": "https://github.com/
|
|
23
|
+
"url": "https://github.com/gosodax/sodax-sdks"
|
|
24
24
|
},
|
|
25
25
|
"type": "module",
|
|
26
26
|
"engines": {
|
|
@@ -51,7 +51,8 @@
|
|
|
51
51
|
"check:ai-tsx-examples": "bash ./scripts/check-ai-tsx-examples.sh",
|
|
52
52
|
"check:ai-keys": "bash ./scripts/check-ai-keys.sh",
|
|
53
53
|
"check:ai-consistency": "bash ./scripts/check-ai-consistency.sh",
|
|
54
|
-
"check:ai": "
|
|
54
|
+
"check:ai-safety": "bash ./scripts/check-ai-safety.sh",
|
|
55
|
+
"check:ai": "pnpm run check:ai-structural && pnpm run check:ai-imports && pnpm run check:ai-snippets && pnpm run check:ai-tsx-examples && pnpm run check:ai-keys && pnpm run check:ai-consistency && pnpm run check:ai-safety",
|
|
55
56
|
"ci": "pnpm run pretty && pnpm run check:ai",
|
|
56
57
|
"clean": "rm -rf node_modules && rm -rf .turbo"
|
|
57
58
|
}
|
|
@@ -11,7 +11,7 @@ metadata:
|
|
|
11
11
|
|
|
12
12
|
You are the **ideation layer** that sits upstream of the developer skills (see the package `AGENTS.md` router). Your job: take a person who knows *what they want* but not *which SODAX feature or SDK does it*, and produce a **product brief** + a **handoff** that names the next skill to load. You **do not write app code** — you route to the skills that do.
|
|
13
13
|
|
|
14
|
-
SODAX is **cross-chain DeFi** on a hub-and-spoke model (Sonic is the hub). **Its defining strength is moving value *across* chains** — swapping or bridging between different chains, lending/borrowing cross-chain — so steer ideas toward that cross-chain edge first; it is the main reason to pick SODAX over a single-chain protocol. Other plain-English capabilities: stake, provide liquidity, migrate legacy tokens, take a partner fee, recover stuck funds. The catalog in [`knowledge/feature-catalog.md`](./knowledge/feature-catalog.md) maps each to what an end-user can *do*.
|
|
14
|
+
SODAX is **cross-chain DeFi** on a hub-and-spoke model (Sonic is the hub). **Its defining strength is moving value *across* chains** — swapping or bridging between different chains, lending/borrowing cross-chain — so steer ideas toward that cross-chain edge first; it is the main reason to pick SODAX over a single-chain protocol. Other plain-English capabilities: stake, provide liquidity, earn leveraged yield in a vault (advanced and risk-heavy: only for a semi-technical+ user who asks for leverage, never pitched as savings), migrate legacy tokens, take a partner fee, recover stuck funds. The catalog in [`knowledge/feature-catalog.md`](./knowledge/feature-catalog.md) maps each to what an end-user can *do*.
|
|
15
15
|
|
|
16
16
|
---
|
|
17
17
|
|
|
@@ -24,8 +24,8 @@ SODAX is **cross-chain DeFi** on a hub-and-spoke model (Sonic is the hub). **Its
|
|
|
24
24
|
| `useSwap`, `useXxx` hook, `@sodax/dapp-kit`, "React dapp + dapp-kit" | `sodax-dapp-kit` (+ `sodax-wallet-sdk-react`) |
|
|
25
25
|
| `Sodax`, `ChainKeys`, `Result<T>`, `SodaxError`, "backend / bot / script with @sodax/sdk" | `sodax-sdk` |
|
|
26
26
|
| `walletProvider`, `IEvmWalletProvider`, "sign on <chain>", a specific chain provider | `sodax-wallet-sdk-core` |
|
|
27
|
-
| "connect button", "wallet modal", "switch chain", WalletConnect | `sodax-wallet-sdk-react` |
|
|
28
|
-
| A named feature already chosen (swap / money market / staking / bridge / dex / migration / partner / recovery) **with** an SDK in mind | the matching dev skill above |
|
|
27
|
+
| "connect button", "wallet modal", "switch chain", WalletConnect, "email login", Privy | `sodax-wallet-sdk-react` |
|
|
28
|
+
| A named feature already chosen (swap / money market / staking / bridge / dex / leverage yield / migration / partner / recovery) **with** an SDK in mind | the matching dev skill above |
|
|
29
29
|
|
|
30
30
|
When in doubt about whether the *what* is decided, ask **one** question: *"Do you already know which SODAX feature you want, or are we still figuring that out?"* — decided → route; not decided → interview.
|
|
31
31
|
|
|
@@ -26,7 +26,7 @@ This skill is **self-contained** — it needs no network to run the interview. B
|
|
|
26
26
|
- Chains, tokens, and config → the **`@sodax/types`** package source.
|
|
27
27
|
- Fees, and which feature services exist → the **`@sodax/sdk`** package source.
|
|
28
28
|
|
|
29
|
-
Repo: `https://github.com/
|
|
29
|
+
Repo: `https://github.com/gosodax/sodax-sdks` (the `@sodax/*` packages live under `packages/`). Other files here point back to this policy rather than repeating paths.
|
|
30
30
|
|
|
31
31
|
## Honesty rules
|
|
32
32
|
|
|
@@ -46,6 +46,10 @@ If assets end up stranded in a user's hub wallet, recovery withdraws them back t
|
|
|
46
46
|
|
|
47
47
|
Leveraged-yield vaults on the hub that loop supply → borrow → swap to build a leveraged position. **Advanced and risk-heavy** — only surface it when a semi-technical+ user explicitly wants leverage, and keep risk framing separate from product design. Net yield can be negative. Never present it to a Tier A user as "savings".
|
|
48
48
|
|
|
49
|
+
## Email login — users without a crypto wallet
|
|
50
|
+
|
|
51
|
+
Not a DeFi feature but an onboarding choice: an opt-in "log in with email" entry next to the usual wallets. The user types an email, enters a one-time code, and gets a wallet created for them (a Privy embedded wallet) that signs like MetaMask. EVM chains only, React apps only. Use it when the audience has no wallet yet ("my users are not crypto people"). Be honest about the trade-offs in the brief: Privy holds access, so nobody can sign while Privy is down; the builder needs their own Privy account and pays per signature; a user who loses their email loses that wallet.
|
|
52
|
+
|
|
49
53
|
---
|
|
50
54
|
|
|
51
55
|
**Mapping back to the interview:** the goal → feature table lives in [`interview-guide.md`](./interview-guide.md); worked product combinations are in [`use-case-gallery.md`](./use-case-gallery.md).
|
|
@@ -23,6 +23,7 @@ For glossing terms during the interview. Apply **by tier** (see [`interview-guid
|
|
|
23
23
|
| **Liquidity / LP** | "Put two coins into a shared pool so others can trade, and earn fees." | Concentrated-liquidity DEX. |
|
|
24
24
|
| **Allowance / approval** | "A one-time permission so the app can move a specific token for you." | ERC-20 approve step. |
|
|
25
25
|
| **Wallet** | "The app that holds your coins and signs actions (e.g. MetaMask)." | Per-chain provider in the SDK. |
|
|
26
|
+
| **Embedded wallet / email login** | "A wallet created for you when you log in with your email — no app to install." | Privy-held; EVM only. See [`feature-catalog.md`](./feature-catalog.md#email-login--users-without-a-crypto-wallet). |
|
|
26
27
|
| **Partner fee** | "The cut the app you built takes on each transaction." | See [`monetization.md`](./monetization.md). |
|
|
27
28
|
| **Gas** | "The small network fee paid to process a transaction." | Paid in the chain's native coin; not a SODAX fee. |
|
|
28
29
|
| **Token migration** | "Move an older ICON-era coin (ICX/BALN/bnUSD) into the new system." | Specific tokens only. |
|
|
@@ -19,6 +19,8 @@ The last step. Map the brief's build shape to the exact developer skill(s) the u
|
|
|
19
19
|
|
|
20
20
|
**Non-EVM chains:** if the product touches **any non-EVM chain**, add the matching chain in `sodax-wallet-sdk-core` to the handoff — each non-EVM chain needs its own wallet provider.
|
|
21
21
|
|
|
22
|
+
**Email login:** if the brief chose it, name the privy concern of `sodax-wallet-sdk-react` in the handoff (EVM only, React only). The builder must create a Privy app before the dev skill can finish.
|
|
23
|
+
|
|
22
24
|
## How to choose mode
|
|
23
25
|
|
|
24
26
|
- **Integration** (write new v2 code) — the default for a brand-new product.
|
|
@@ -53,6 +55,7 @@ handoff:
|
|
|
53
55
|
mode: integration # or "migration" (port v1 first), then integration
|
|
54
56
|
partner_fee: true # if true, also load the sodax-sdk partner feature (+ sodax-dapp-kit in React)
|
|
55
57
|
non_evm_chains: [] # each entry adds a sodax-wallet-sdk-core/<chain> provider
|
|
58
|
+
email_login: false # if true, also load sodax-wallet-sdk-react/privy (EVM, React only)
|
|
56
59
|
starter_app: apps/demo
|
|
57
60
|
phase1_goal: "one working cross-chain transfer in the safest supported environment"
|
|
58
61
|
```
|
|
@@ -52,6 +52,7 @@ See [`feature-catalog.md`](./feature-catalog.md) for the plain-English descripti
|
|
|
52
52
|
|
|
53
53
|
- **Who uses it** and **on which chains**. Tier A gets a recommended default to confirm (e.g. "start with a small number of EVM chains — one major chain plus one lower-fee chain"). Confirm against [`chains-and-assets.md`](./chains-and-assets.md).
|
|
54
54
|
- **Honesty-gate** any unsupported chain.
|
|
55
|
+
- **Do the users already have a crypto wallet?** If not (Tier A audiences often do not), offer email login as the onboarding default — EVM only, with the trade-offs in [`feature-catalog.md`](./feature-catalog.md#email-login--users-without-a-crypto-wallet). It changes the handoff.
|
|
55
56
|
- **Flag non-EVM assets**: if the product touches **any non-EVM chain**, note that it pulls in a chain-specific wallet provider — this changes the handoff (a matching chain skill in `sodax-wallet-sdk-core`). Confirm which chains are non-EVM against live source if it matters.
|
|
56
57
|
|
|
57
58
|
## Stage 4 — Monetization detail (only if not "free")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sodax-dapp-kit
|
|
3
|
-
description: 'Integrate SODAX into a React dapp with @sodax/dapp-kit — React Query hooks for swaps, lending/borrowing, staking, bridging, DEX,
|
|
3
|
+
description: 'Integrate SODAX into a React dapp with @sodax/dapp-kit — React Query hooks for swaps, money market lending/borrowing, staking, bridging, DEX liquidity, leverage-yield vaults (deposit/withdraw, APR / TVL / health) and leverage positions, token migration, Bitcoin trading (Radfi / Bound Exchange), partner fees, recovery, and backend API reads. INTEGRATION (write NEW code) — use whenever a React dapp needs SODAX feature hooks; backend code uses `@sodax/sdk`. Triggers on "use @sodax/dapp-kit", "useSwap", "useMoneyMarket", "useStake", "useBridge", "useDex", "useMigrate", "useLeverageYield", "leverage yield vault in React", "vault UI", any dapp-kit `use<Feature>` hook, "Sodax React hooks". v2 hook shape: mutation hooks return `SafeUseMutationResult` with `mutateAsyncSafe(vars): Promise<Result<TData>>`; mutationFn throws on SDK `!ok`; hooks own their invalidations. MIGRATION (port v1 → v2) — single-object hook params, mandatory `mutateAsyncSafe`, hook-owned invalidations, canonical queryKey/mutationKey conventions, on top of the reshaped SDK (chain-key-driven routing, `Result<T>` everywhere, `WalletProviderSlot<K, Raw>`). Triggers on "migrate @sodax/dapp-kit", "useSpokeProvider gone", "dapp-kit v1 → v2", "invalidateMmQueries broken", "dapp-kit hook signatures changed", v1 fingerprints (positional args, hook-init `spokeProvider`, `useSpokeProvider`, `invalidateMmQueries`, legacy `useMigrate`, `*_MAINNET_CHAIN_ID`). Load this skill if EITHER applies; the body gates by mode.'
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
version: '0.0.1'
|
|
@@ -20,13 +20,31 @@ AGENTS.md routes you here when you're working with `@sodax/dapp-kit` v2 — eith
|
|
|
20
20
|
For backend / Node → use `sodax-sdk` (dapp-kit is React-only).
|
|
21
21
|
Every dapp-kit consumer also needs wallet connectivity — also load `sodax-wallet-sdk-react`.
|
|
22
22
|
|
|
23
|
+
## Prefer a granular skill if the feature is known
|
|
24
|
+
|
|
25
|
+
If the user has already picked one feature, load the matching granular skill instead of this broad one. It is a few KB of focused workflow and links straight into the right knowledge files, for integration and, where a v1 surface existed, migration.
|
|
26
|
+
|
|
27
|
+
| Feature | Granular skill | Trigger phrases |
|
|
28
|
+
|---|---|---|
|
|
29
|
+
| Intent-based swap (market + limit orders) | [`./swap/SKILL.md`](./swap/SKILL.md) | "useSwap", "useQuote", "limit order in React" |
|
|
30
|
+
| Cross-chain lending / borrowing | [`./money-market/SKILL.md`](./money-market/SKILL.md) | "useSupply", "useBorrow", "money market UI" |
|
|
31
|
+
| SODA ↔ xSODA staking | [`./staking/SKILL.md`](./staking/SKILL.md) | "useStake", "instant unstake", "staking UI" |
|
|
32
|
+
| Direct token bridge via vault | [`./bridge/SKILL.md`](./bridge/SKILL.md) | "useBridge", "bridge tokens in React" |
|
|
33
|
+
| Concentrated-liquidity LP | [`./dex/SKILL.md`](./dex/SKILL.md) | "useSupplyLiquidity", "LP position UI", "usePools" |
|
|
34
|
+
| Leverage-yield vaults and leverage positions (on-chain hooks; a user-facing vault screen starts from the [product anatomy](./integration/knowledge/recipes/leverage-yield-product-anatomy.md)) | [`./leverage-yield/SKILL.md`](./leverage-yield/SKILL.md) | "leverage yield vault", "vault UI / screen / dashboard", "deposit into a vault", "lsoda shares", "vault APR / TVL", "useLeverageYieldDeposit", "useLeverageYieldVaultSwap", "open a leverage position" |
|
|
35
|
+
| ICX / bnUSD / BALN token migration | [`./migration/SKILL.md`](./migration/SKILL.md) | "useMigrateIcxToSoda", "migrate bnUSD" (NOT v1→v2 porting) |
|
|
36
|
+
| Bitcoin trading via Radfi | [`./bitcoin/SKILL.md`](./bitcoin/SKILL.md) | "useRadfiAuth", "trading wallet", "Bound Exchange" |
|
|
37
|
+
| Partner fees, recovery, backend reads, the Swaps / Bridge / Leverage Yield API hooks, Stellar account activation, shared utilities (balances, gas, trustlines) | [`./auxiliary-services/SKILL.md`](./auxiliary-services/SKILL.md) | "useFeeClaimSwap", "useWithdrawHubAsset", "useBackendIntentByTxHash", "useSwapsApiQuote", "useLeverageYieldApi*", "useStellarGate", "useXBalances" |
|
|
38
|
+
|
|
39
|
+
Load this broad skill (keep reading below) when the feature is undecided, the task spans several features, or the consumer is porting a full v1 codebase.
|
|
40
|
+
|
|
23
41
|
---
|
|
24
42
|
|
|
25
43
|
## Integration mode (writing new v2 code)
|
|
26
44
|
|
|
27
45
|
Pick this mode when the consumer is a React dapp using `@sodax/dapp-kit` hooks. Common signals:
|
|
28
46
|
|
|
29
|
-
- Any feature hook: `useSwap`, `useMoneyMarket*`, `useStake`, `useBridge`, `useDex*`, `useMigrate*`, `useRadfi*`, `usePartner*`, `useRecovery*`.
|
|
47
|
+
- Any feature hook: `useSwap`, `useMoneyMarket*`, `useStake`, `useBridge`, `useDex*`, `useLeverageYield*`, `useMigrate*`, `useRadfi*`, `usePartner*`, `useRecovery*`.
|
|
30
48
|
- "Wire React Query for SODAX" — `SodaxProvider`, `createSodaxQueryClient`.
|
|
31
49
|
- "Branch on mutation result without try/catch" — `mutateAsyncSafe`.
|
|
32
50
|
- "Custom invalidation on success" — consumer-provided `onSuccess` (note: hook-owned invalidations already run; yours runs *after*).
|
|
@@ -36,8 +54,8 @@ Pick this mode when the consumer is a React dapp using `@sodax/dapp-kit` hooks.
|
|
|
36
54
|
1. Read [`integration/knowledge/ai-rules.md`](./integration/knowledge/ai-rules.md) — DO / DO NOT / workflow / stop conditions.
|
|
37
55
|
2. Read [`integration/knowledge/quickstart.md`](./integration/knowledge/quickstart.md) — install + wire providers + first feature.
|
|
38
56
|
3. Read [`integration/knowledge/architecture.md`](./integration/knowledge/architecture.md) — hook shapes, queryKey conventions, `useSafeMutation`, `unwrapResult`, `Result<T>`.
|
|
39
|
-
4. For each feature you use, read [`integration/knowledge/features/`](./integration/knowledge/features/) — `swap.md`, `money-market.md`, `staking.md`, `bridge.md`, `dex.md`, `migration.md`, `bitcoin.md` (Bound Exchange, dapp-kit-unique), `auxiliary-services.md` (partner + recovery + backend + shared).
|
|
40
|
-
5. Recipes → [`integration/knowledge/recipes/`](./integration/knowledge/recipes/) — `setup.md`, `wallet-connectivity.md`, per-feature, `mutation-error-handling.md`, `observability.md`, `invalidations.md`.
|
|
57
|
+
4. For each feature you use, read [`integration/knowledge/features/`](./integration/knowledge/features/) — `swap.md`, `money-market.md`, `staking.md`, `bridge.md`, `dex.md`, `leverage-yield.md` (vaults + leverage positions), `migration.md`, `bitcoin.md` (Bound Exchange, dapp-kit-unique), `auxiliary-services.md` (partner + recovery + backend + shared).
|
|
58
|
+
5. Recipes → [`integration/knowledge/recipes/`](./integration/knowledge/recipes/) — `setup.md`, `wallet-connectivity.md`, per-feature, `mutation-error-handling.md`, `observability.md`, `invalidations.md`. Building a user-facing leverage-yield vault screen → [`leverage-yield-product-anatomy.md`](./integration/knowledge/recipes/leverage-yield-product-anatomy.md).
|
|
41
59
|
6. Lookups → [`integration/knowledge/reference/`](./integration/knowledge/reference/) — `hooks-index.md`, `querykey-conventions.md`, `public-api.md`, `glossary.md`.
|
|
42
60
|
|
|
43
61
|
### v2 in one minute
|
|
@@ -46,7 +64,7 @@ Pick this mode when the consumer is a React dapp using `@sodax/dapp-kit` hooks.
|
|
|
46
64
|
2. **Every mutation hook returns `SafeUseMutationResult`** — extends React Query's `UseMutationResult` with `mutateAsyncSafe(vars): Promise<Result<TData>>` (never rejects). Use `mutateAsyncSafe` for sequenced flows; `mutateAsync` for try/catch flows; `mutate` for fire-and-forget render-driven flows.
|
|
47
65
|
3. **`mutationFn` throws on SDK `!ok`.** dapp-kit calls `unwrapResult` on the SDK's `Result<T>`, throwing on failure. This makes React Query's native error model engage (`isError`, `error`, `onError`, `retry`, devtools). `mutateAsyncSafe` packages the throw back into `Result<T>` for ergonomic branching.
|
|
48
66
|
4. **Hook-owned invalidations.** Each mutation hook invalidates the relevant query keys in its `onSuccess`, derived from `vars`. Consumer-provided `onSuccess` runs after. v1's manual `invalidateMmQueries` utilities are gone.
|
|
49
|
-
5. **Canonical queryKey shape.** `[feature, action, ...identifiers]`. First segment matches the directory name (`swap`, `mm`, `bridge`, `staking`, `dex`, `bitcoin`, `partner`, `recovery`, `backend`, `shared`, `migrate`). camelCase. Bigints stringified.
|
|
67
|
+
5. **Canonical queryKey shape.** `[feature, action, ...identifiers]`. First segment matches the directory name (`swap`, `mm`, `bridge`, `staking`, `dex`, `leverageYield`, `bitcoin`, `partner`, `recovery`, `backend`, `shared`, `migrate`). camelCase. Bigints stringified.
|
|
50
68
|
|
|
51
69
|
### Conventions agents must follow (integration)
|
|
52
70
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: sodax-dapp-kit-auxiliary-services
|
|
3
|
-
description: 'Granular skill for the @sodax/dapp-kit v2 auxiliary surfaces — partner fee claiming (useFeeClaimSwap, useApproveToken, useSetSwapPreference, useGetAutoSwapPreferences, useIsTokenApproved), recovery (useHubAssetBalances, useWithdrawHubAsset), read-only backend queries (useBackendIntentByTxHash, useBackendUserIntents, useBackendOrderbook, useBackendMoneyMarketPosition), the
|
|
3
|
+
description: 'Granular skill for the @sodax/dapp-kit v2 auxiliary surfaces — partner fee claiming (useFeeClaimSwap, useApproveToken, useSetSwapPreference, useGetAutoSwapPreferences, useIsTokenApproved), recovery (useHubAssetBalances, useWithdrawHubAsset), read-only backend queries (useBackendIntentByTxHash, useBackendUserIntents, useBackendOrderbook, useBackendMoneyMarketPosition), the backend API client hooks (Swaps: useSwapsApiQuote, useSwapsApiSubmitTx, useSwapsApiStatus, useSwapsApiApproveAndBroadcast, useSwapsApiBroadcastWithApproval; Bridge: useBridgeApi*; Leverage Yield: useLeverageYieldApi*, e.g. useLeverageYieldApiVaults, useLeverageYieldApiSubmitTxStatus), sponsored Stellar account activation (useStellarGate, useStellarAccountActive, useStellarAccountStatus, useSponsorConfig, useActivateStellarAccount), and shared utilities (useSodaxContext, useHubProvider, useBalances, useXBalances, useDeriveUserWalletAddress, useEstimateGas, useStellarTrustlineCheck, useEstablishTrustline). Use when a React dapp task is partner fees, recovering stuck hub assets, backend data reads (intent tracking / orderbook / MM data, no wallet), swapping through the backend Swaps API (approve, sign, submit-tx; one EIP-5792 signature where the wallet can batch), activating a Stellar account for a user who holds no XLM, or cross-cutting utilities (token balances, gas estimation, Stellar trustlines). Covers BOTH integration and migration. Links into the parent sodax-dapp-kit knowledge tree.'
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
version: '0.0.1'
|
|
@@ -18,6 +18,7 @@ Granular skill for the smaller `@sodax/dapp-kit` v2 surfaces grouped together: *
|
|
|
18
18
|
- **Partner fees:** `useIsTokenApproved` → `useApproveToken` → `useSetSwapPreference` → `useFeeClaimSwap` (returns `IntentAutoSwapResult`, NOT `SwapResponse`); `useGetAutoSwapPreferences`, `useFetchAssetsBalances` for reads.
|
|
19
19
|
- **Recovery:** `useHubAssetBalances` (list stuck hub assets) → `useWithdrawHubAsset` (withdraw one back to a spoke). Follows a *known* failed cross-chain op — investigate the failure first.
|
|
20
20
|
- **Backend reads (no wallet):** intent tracking (`useBackendIntentByTxHash` polls 1s, `useBackendIntentByHash`, `useBackendUserIntents`), orderbook (`useBackendOrderbook` — `pagination` nests under `params`), MM data (`useBackendMoneyMarketPosition` etc.), and the Swaps API client (`useSwapsApi*` — e.g. `useSwapsApiSubmitTx`, `useSwapsApiSubmitTxStatus`, `useSwapsApiQuote`).
|
|
21
|
+
- **Swaps API swap with a wallet:** `useSwapsApiAllowance` first. Short allowance on an EVM source → `useSwapsApiBroadcastWithApproval` (the approval and the `/swaps/intents` tx in one EIP-5792 signature where the wallet can batch; a refusal means approve with `useSwapsApiApproveAndBroadcast`, create the intent again, sign it); otherwise sign the intent tx yourself. Then `useSwapsApiSubmitTx` with the `txHash`. Persist the batch id `onBatchSent` reports: a batch that comes back `ATOMIC_BATCH_UNCONFIRMED` may still land.
|
|
21
22
|
- **Stellar prerequisites:** `useStellarGate` sequences the ordered prerequisites — the account must EXIST (sponsored activation, free to the user), must TRUST the token, and only then must be able to PAY for the trustline it needs. A freshly activated account holds zero XLM. An account that already holds the trustline needs no XLM at all, which is why affordability is checked last. A failed check sets `checkFailed` with `error`/`retry` — render it, or the fail-closed gate becomes an unexplained dead button. Lower-level: `useStellarAccountStatus`, `useStellarAccountActive`, `useSponsorConfig`, `useActivateStellarAccount`.
|
|
22
23
|
- **Shared utilities:** `useSodaxContext`, `useHubProvider`, `useBalances` (SDK-backed — no `xService`, reads via `SodaxProvider`) / `useXBalances` (needs `xService` from wallet-sdk-react), `useDeriveUserWalletAddress` / `useGetUserHubWalletAddress`, `useEstimateGas`, `useStellarTrustlineCheck` / `useEstablishTrustline`.
|
|
23
24
|
|
|
@@ -37,6 +38,8 @@ Granular skill for the smaller `@sodax/dapp-kit` v2 surfaces grouped together: *
|
|
|
37
38
|
- **Passing top-level `pagination` to `useBackendOrderbook` / `useBackendAllMoneyMarketBorrowers`.** It nests under `params`; without it those queries are disabled.
|
|
38
39
|
- **Calling `useXBalances` without `xService`.** Supply `xService` from `@sodax/wallet-sdk-react`'s `useXService`; the request-side key is `xChainId` (the cross-chain abstraction), distinct from the token-side `chainKey`.
|
|
39
40
|
- **Pairing `useStellarTrustlineCheck` with `useEstablishTrustline` by hand.** Use `useStellarGate`: `hasSufficientTrustline` THROWS for an account that does not exist, so a `!data` test offers a trustline button on a missing account. `useEstablishTrustline` is a canonical mutation hook — vars are `{ token, amount, srcChainKey, walletProvider }` (NOT `account`/`asset`). `useRequestTrustline` is its deprecated 2.0.0-shape wrapper; don't write new code against it.
|
|
41
|
+
- **`useSwapsApiApproveAndBroadcast`, then signing the intent tx, on an EVM source.** Two prompts where `useSwapsApiBroadcastWithApproval` needs one when the wallet can batch; keep that path for its refusal.
|
|
42
|
+
- **Re-sending a swap whose batch came back `ATOMIC_BATCH_UNCONFIRMED`.** It may still land. Resume it with `confirmApprovalBatch` and the persisted batch id; never sign it again.
|
|
40
43
|
- **Running recovery on successful flows.** Recovery is a workaround for *failed* ops — `useHubAssetBalances` first, then withdraw the specific entry; investigate the original failure.
|
|
41
44
|
- **Leaving `useBackendIntentByTxHash` polling (1s) running after the intent resolves.**
|
|
42
45
|
|
|
@@ -15,7 +15,7 @@ Granular skill for the bridge hooks of `@sodax/dapp-kit` v2. queryKey/mutationKe
|
|
|
15
15
|
|
|
16
16
|
1. **New code or v1 → v2 port?**
|
|
17
17
|
2. **Need a bridgeable precheck?** `useGetBridgeableAmount` (vault deposit/withdrawal cap, returns a `BridgeLimit`) and `useGetBridgeableTokens` (enumerate compatible destinations).
|
|
18
|
-
3. **Allowance gating?** `useBridgeAllowance` + `useBridgeApprove` before `useBridge`.
|
|
18
|
+
3. **Allowance gating?** `useBridgeWithApproval` folds the approval in (one EIP-5792 batch when the wallet can), labelled with `useBridgeApprovalStrategy`. The two-step alternative is `useBridgeAllowance` + `useBridgeApprove` before `useBridge`.
|
|
19
19
|
4. **Source/destination chains + recipient format** — confirm both are supported spokes and the `recipient` matches the destination chain encoding.
|
|
20
20
|
|
|
21
21
|
## Integration workflow (new v2 code)
|
|
@@ -40,6 +40,9 @@ DO / DO NOT / workflow / stop conditions for AI agents writing v2 dapp-kit code.
|
|
|
40
40
|
- **DO NOT** destructure cross-chain mutation results as arrays — `[a, b] = result.value` is wrong. The shape is `TxHashPair = { srcChainTxHash, dstChainTxHash }` (object). This applies to `useBridge`, `useStake`/`useUnstake`/etc., `useDexDeposit`/`useDexWithdraw`, all four MM mutations, and all four migration mutations.
|
|
41
41
|
- **DO NOT** use legacy chain-id constants (`BSC_MAINNET_CHAIN_ID`, etc.). They're gone in v2 — use `ChainKeys.X_MAINNET`.
|
|
42
42
|
- **DO NOT** reach for `as any` / `as IEvmWalletProvider` casts when wiring `useWalletProvider({ xChainId })` into mutation `mutate(vars)`. v2 supports the broad-union case structurally; the cast is not needed. See `recipes/wallet-connectivity.md` § "No type cast is needed".
|
|
43
|
+
- **DO NOT** send a zero or hand-picked minimum output (`minOutputAmount: 0n` or a literal). Derive it from a live quote for that exact input minus a slippage tolerance in basis points, show both to the user before they sign, and disable the action while there is no quote. The SDK does not reject a zero minimum (swaps and bridge only enforce the 546-sat dust floor on a BTC payout); a zero minimum accepts any fill.
|
|
44
|
+
- **DO NOT** add a `partnerFee` the integrator did not ask for. It is optional; omit it by default, and never copy a fee receiver address from a SODAX demo, doc, or example.
|
|
45
|
+
- **DO NOT** pass `skipSimulation: true` in user-facing flows. The simulation replays the hub-side execution and catches an intent that would revert there before the user signs it.
|
|
43
46
|
|
|
44
47
|
## Stop conditions (defer to user)
|
|
45
48
|
|
|
@@ -230,7 +230,20 @@ take — each API builds its approval for its own hub spender, so an approval bu
|
|
|
230
230
|
satisfy the other. Only a leverage-yield **deposit** needs one; a withdraw spends `lsoda*` from the
|
|
231
231
|
hub wallet and never approves.
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
For a swap from an EVM source whose allowance is short (`/swaps/allowance/check` says so — the hook
|
|
234
|
+
always approves), **`useSwapsApiBroadcastWithApproval`** goes one step further: given the
|
|
235
|
+
create-intent `body` and the unsigned `intentTx`, it sends the approval and `intentTx` as one EIP-5792
|
|
236
|
+
atomic batch — one signature — when the wallet supports it. It resolves with `{ txHash, approvalStrategy,
|
|
237
|
+
approval? }` and stops there: persist `txHash`, then call `useSwapsApiSubmitTx`. Persist the `batchId` its
|
|
238
|
+
`onBatchSent` reports too: a `TX_VERIFICATION_FAILED` with `context.reason === ATOMIC_BATCH_UNCONFIRMED`
|
|
239
|
+
means the batch may still land, so never let the user sign that swap again — resume it with
|
|
240
|
+
`confirmApprovalBatch` instead. A wallet that cannot batch (the Sonic hub never does), or refuses the batch
|
|
241
|
+
before signing, rejects with an `isAtomicBatchRefusal` error and nothing sent: approve with
|
|
242
|
+
`useSwapsApiApproveAndBroadcast`, create the intent again — a fresh deadline — and sign that. Pass
|
|
243
|
+
`fallbackOnRefusal: true` to have the hook approve and then send the `intentTx` it was given; that intent was
|
|
244
|
+
built before the approval, so its deadline has to outlast the approval's wait.
|
|
245
|
+
|
|
246
|
+
All three, and `useSwapsApiBroadcastWithApproval` for its separate approval, accept an optional **`onProgress`** in their mutation vars. It reports each transaction as
|
|
234
247
|
`{ step, phase, index, total, hash?, error? }` — `step` is `'allowance-reset'` or `'approve'`, `phase`
|
|
235
248
|
walks `signing → broadcast → confirmed` (or `failed`), and `index`/`total` give "1 of 2" without the
|
|
236
249
|
caller tracking anything. Advisory: the listener is never awaited, one that throws is ignored rather
|
|
@@ -240,8 +253,8 @@ vars rather than the hook options so it is never a stale closure.
|
|
|
240
253
|
`useSwapsApiApprove` / `useBridgeApiApprove` / `useLeverageYieldApiApprove` still exist and return
|
|
241
254
|
the API's `{ tx, resetTx? }` verbatim — use them only when you need to own signing. If you do,
|
|
242
255
|
broadcast `resetTx` **first and wait for it to succeed**; the approve is not a valid state
|
|
243
|
-
transition until the reset has landed, so sending both
|
|
244
|
-
revert. Waiting is not enough on its own —
|
|
256
|
+
transition until the reset has landed, so sending both as separate transactions at once spends the
|
|
257
|
+
user's gas on a certain revert (an EIP-5792 atomic batch runs them in order, so it can carry both). Waiting is not enough on its own —
|
|
245
258
|
check the receipt's status, because a mined-and-reverted reset leaves the allowance exactly where it
|
|
246
259
|
was.
|
|
247
260
|
|
|
@@ -296,7 +309,8 @@ hooks/
|
|
|
296
309
|
│ # useBalances, useXBalances, invalidateBalances,
|
|
297
310
|
│ # useStellarTrustlineCheck, useEstablishTrustline (+ deprecated useRequestTrustline)
|
|
298
311
|
├── provider/ # useHubProvider
|
|
299
|
-
├── swap/ #
|
|
312
|
+
├── swap/ # useSwapLifecycle, useSwapWithApproval, useSwapApprovalStrategy,
|
|
313
|
+
│ # useQuote, useSwap, useDetailedStatus, useStatus, useSwapAllowance, useSwapApprove,
|
|
300
314
|
│ # useCancelSwap, useCreateLimitOrder, useCancelLimitOrder
|
|
301
315
|
├── mm/ # useSupply, useWithdraw, useBorrow, useRepay, useMMAllowance, useMMApprove,
|
|
302
316
|
│ # reserves data hooks
|
|
@@ -84,6 +84,27 @@ useSwapsApiSubmitTx({ mutationOptions }); // mutation → sodax.ap
|
|
|
84
84
|
useSwapsApiSubmitTxStatus({ params, queryOptions }); // query → sodax.api.swaps.getSubmitTxStatus
|
|
85
85
|
```
|
|
86
86
|
|
|
87
|
+
**Approving and sending with a wallet.** `useSwapsApiApproveAndBroadcast` builds, signs and confirms the
|
|
88
|
+
`/swaps/approve` plan, reset first when there is one. For an EVM source whose allowance is short,
|
|
89
|
+
`useSwapsApiBroadcastWithApproval` sends the approval and the `/swaps/intents` tx as one EIP-5792 batch
|
|
90
|
+
(one signature) when the wallet can. When it cannot, the hook rejects with an `isAtomicBatchRefusal` error
|
|
91
|
+
and sends nothing: approve with `useSwapsApiApproveAndBroadcast`, create the intent again and sign that. It
|
|
92
|
+
always approves, so check `useSwapsApiAllowance` first, and it stops at the broadcast: persist `txHash`,
|
|
93
|
+
then submit it. Its errors, the unconfirmed-batch rule and `fallbackOnRefusal` are in
|
|
94
|
+
[architecture.md](../architecture.md#approve-hooks-can-prompt-the-wallet-twice).
|
|
95
|
+
|
|
96
|
+
```ts
|
|
97
|
+
// @ai-snippets-skip
|
|
98
|
+
const { mutateAsync: broadcastWithApproval } = useSwapsApiBroadcastWithApproval();
|
|
99
|
+
const { txHash } = await broadcastWithApproval({
|
|
100
|
+
body, // the create-intent body
|
|
101
|
+
intentTx: created.tx, // the unsigned tx /swaps/intents returned for it
|
|
102
|
+
walletProvider, // the source chain's IEvmWalletProvider
|
|
103
|
+
onBatchSent: (batchId, callCount) => saveBatch(batchId, callCount), // persist before the wait
|
|
104
|
+
});
|
|
105
|
+
await submitSwapTx({ request: { txHash, ...submission } });
|
|
106
|
+
```
|
|
107
|
+
|
|
87
108
|
These hooks forward the body verbatim, so `partnerFee` has no default (SDK fee config does not
|
|
88
109
|
apply). Put the same value on quote and create-intent:
|
|
89
110
|
|
|
@@ -357,7 +378,7 @@ if (isRegistered === false) {
|
|
|
357
378
|
}
|
|
358
379
|
```
|
|
359
380
|
|
|
360
|
-
For the common UI path, `useNearStorageGate` returns `{ isNear, needsRegistration, blocksAction, isChecking, isRegistering, registerStorage }`.
|
|
381
|
+
For the common UI path, `useNearStorageGate` returns `{ isNear, needsRegistration, blocksAction, isChecking, checkFailed, retry, isRegistering, registerStorage }`. `blocksAction` stays `false` when the check errors, so read `checkFailed` too and offer `retry` rather than letting the action through: whether the recipient can receive is unknown until the check succeeds. `useSwapLifecycle` does this as the `nearStorageCheckFailed` setup reason.
|
|
361
382
|
|
|
362
383
|
Derive UI gate flags with the unwrapped `resolveNearStorageGate` util (no hook) when you need custom check/register composition:
|
|
363
384
|
|
|
@@ -450,12 +471,21 @@ and origin gating are the real controls. Proxy through your own backend if that
|
|
|
450
471
|
| `useBackendOracleCandles` | none | `staleTime: 10s` — matches the ~10s server-side cache |
|
|
451
472
|
| `useExpiredUtxos` (bitcoin) | 60s | refetchInterval |
|
|
452
473
|
| `useQuote` (swap) | 3s | refetchInterval |
|
|
474
|
+
| `useDetailedStatus` (swap) | 3s | stops on the answering source's terminal state, on a rejected API key, and after 40 consecutive ambiguous reads |
|
|
453
475
|
| `useStatus` (swap) | 3s | stops on status `3`/`4`, and after 40 consecutive NOT_FOUND fetches |
|
|
454
476
|
| `useSwapAllowance` (swap) | 2s | refetchInterval |
|
|
455
477
|
| `useMMAllowance` (mm) | 5s | refetchInterval; `enabled: false` for borrow/withdraw actions |
|
|
456
478
|
| Reserves data (mm) | 5s | `useReservesData` / `useReservesHumanized` / user position hooks |
|
|
457
479
|
| `useBalances` | 5s | refetchInterval |
|
|
458
480
|
| `useXBalances` | 5s | refetchInterval |
|
|
481
|
+
| `useLeverageYieldQuote` | 3s | refetchInterval; solver prices go stale |
|
|
482
|
+
| `useLeverageYieldDetailedStatus` | 3s | stops on the answering source's terminal state |
|
|
483
|
+
| `useLeverageYieldApiStatus` / `useLeverageYieldApiSubmitTxStatus` | 1s | stop on a terminal status |
|
|
484
|
+
| `useLeverageYieldShareBalances` | 15s | per holder |
|
|
485
|
+
| `useLeverageYieldPosition` | 30s | refetchInterval |
|
|
486
|
+
| `useLeverageYieldEffectiveApr` / `useLeverageYieldTotalAssets` / `useLeverageYieldPreviewRedeem` | 60s | Sonic RPC reads with no multicall: one APR refresh is six `eth_call`s per vault, so don't shorten these on a vault grid |
|
|
487
|
+
| `useLeveragePositionAccount` / `useLeveragePositionCollateral` | 30s | refetchInterval |
|
|
488
|
+
| `useLeveragePositionPending` | 15s | refetchInterval |
|
|
459
489
|
| Most others | None | |
|
|
460
490
|
|
|
461
491
|
All overridable via `queryOptions.refetchInterval`.
|
|
@@ -11,12 +11,18 @@ Pair: [`features/bridge.md`](../../../migration-v1-to-v2/knowledge/features/brid
|
|
|
11
11
|
// Mutation
|
|
12
12
|
useBridge({ mutationOptions });
|
|
13
13
|
useBridgeApprove({ mutationOptions });
|
|
14
|
+
// bridge with the approval folded in: one EIP-5792 batch (one signature) when the wallet can
|
|
15
|
+
useBridgeWithApproval({ mutationOptions });
|
|
14
16
|
|
|
15
17
|
// Queries
|
|
16
18
|
// useBridgeAllowance nests payload + walletProvider under params (NOT at top level)
|
|
17
19
|
useBridgeAllowance({ params: { payload: CreateBridgeIntentParams<K>, walletProvider }, queryOptions });
|
|
20
|
+
// 'not-required' | 'atomic-batch' | 'sequential' — the path useBridgeWithApproval would take; not polled
|
|
21
|
+
useBridgeApprovalStrategy({ params: { payload, walletProvider, allowAccountUpgrade? }, queryOptions });
|
|
18
22
|
// Polls 3s from the source tx; stops on a terminal source, a rejected API key, or 40 consecutive
|
|
19
23
|
// ambiguous reads. Result-wrapped — narrow `data.value.source` ('backend' | 'relay').
|
|
24
|
+
// Feed it `srcChainTxHash` on success, or `error.context.srcTxHash` / `srcChainKey` when the bridge
|
|
25
|
+
// failed after broadcast (verify / relay codes) — the deposit may still deliver.
|
|
20
26
|
useBridgeDetailedStatus({ params: { srcChainKey, srcTxHash, apiConfig? }, queryOptions });
|
|
21
27
|
useGetBridgeableAmount({ params: { from: XToken, to: XToken }, queryOptions });
|
|
22
28
|
useGetBridgeableTokens({ params: { from: SpokeChainKey, to: SpokeChainKey, token: string }, queryOptions });
|
|
@@ -81,6 +87,8 @@ type UseGetBridgeableTokensParams = ReadHookParams<XToken[], {
|
|
|
81
87
|
|---|---|
|
|
82
88
|
| `useBridge` | `SafeUseMutationResult<TxHashPair, Error, ...>` (`{ srcChainTxHash, dstChainTxHash }`) |
|
|
83
89
|
| `useBridgeApprove` | `SafeUseMutationResult<TxReturnType<K, false>, Error, UseBridgeApproveVars<K>>` — chain-keyed receipt union (EVM/Stellar/Sui differ) |
|
|
90
|
+
| `useBridgeWithApproval` | `SafeUseMutationResult<BridgeWithApprovalResponse, Error, ...>` — `TxHashPair` plus `approvalStrategy`. A `TX_VERIFICATION_FAILED` with `context.reason === ATOMIC_BATCH_UNCONFIRMED` may still land: never bridge it again — mutate again with `resumeBatchId` / `resumeBatchCallCount` from its `context`, which sends nothing |
|
|
91
|
+
| `useBridgeApprovalStrategy` | `UseQueryResult<ApprovalStrategy, Error>` |
|
|
84
92
|
| `useBridgeAllowance` | `UseQueryResult<boolean, Error>` — already unwrapped; on SDK `!ok` the queryFn returns `false` (does NOT throw), so `isError` stays clean |
|
|
85
93
|
| `useGetBridgeableAmount` | `UseQueryResult<BridgeLimit, Error>` (richer than v1's bare `bigint`) |
|
|
86
94
|
| `useGetBridgeableTokens` | `UseQueryResult<XToken[], Error>` |
|