@sodax/skills 2.0.0-rc.17 → 2.0.0-rc.18

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "2.0.0-rc.17",
7
+ "version": "2.0.0-rc.18",
8
8
  "license": "MIT",
9
9
  "description": "AI-agent skills and knowledge for consumers of @sodax/* SDKs (Claude Code, Codex, Cursor, …)",
10
10
  "keywords": [
@@ -173,9 +173,13 @@ Comprehensive hook table across 12 feature domains. Use this when you know the f
173
173
  | `useFetchAssetsBalances` | Query | Fetch partner asset balances |
174
174
  | `useGetAutoSwapPreferences` | Query | Get auto-swap preferences |
175
175
  | `useIsTokenApproved` | Query | Check token approval |
176
+ | `useGetUserIntent` | Query | Look up a partner's stored intent hash for a token pair (`0x0…0` = none) |
177
+ | `useGetIntentDetails` | Query | Read full intent details for an intent hash |
176
178
  | `useApproveToken` | Mutation | Approve token |
177
179
  | `useSetSwapPreference` | Mutation | Set swap preference |
178
180
  | `useFeeClaimSwap` | Mutation | Claim partner fees via swap |
181
+ | `useFeeClaimWithdraw` | Mutation | Withdraw a fee token directly (no swap) via the bridge |
182
+ | `usePartnerCancelIntent` | Mutation | Cancel a stuck same-token claim and recover the locked tokens |
179
183
 
180
184
  ## Recovery
181
185
 
@@ -19,12 +19,34 @@ sodax.partners.feeClaim.setSwapPreference<K, Raw>(args): Promise<Result<TxReturn
19
19
  sodax.partners.feeClaim.swap(args): Promise<Result<...>>; // immediate fee swap
20
20
  sodax.partners.feeClaim.createIntentAutoSwap<Raw>(args): Promise<Result<...>>; // intent-driven auto-swap
21
21
 
22
+ // Recover a stuck claim. createIntentAutoSwap() (and swap(), which delegates to it) rejects a
23
+ // same-token claim (output === fee token) up front with VALIDATION_FAILED. The guard fails closed: if
24
+ // the preference lookup it relies on fails, the call returns that error instead of submitting. An
25
+ // already-created same-token intent is unfillable and locks the funds. Cancel via ProtocolIntents' own
26
+ // cancelIntent — the only authorized path: the intent's creator is the ProtocolIntents contract, so the
27
+ // generic SwapService.cancelIntent reverts Unauthorized().
28
+ sodax.partners.feeClaim.cancelIntent<Raw>(args): Promise<Result<TxReturnType, Error>>; // args.params: { srcChainKey: Hub, srcAddress, fromToken, toToken }
29
+
22
30
  // Reads
23
31
  sodax.partners.feeClaim.fetchAssetsBalances(args): Promise<Result<...>>;
32
+ sodax.partners.feeClaim.getUserIntent({ user, fromToken, toToken }): Promise<Result<Hex, Error>>; // 0x0…0 = no open intent
33
+ sodax.partners.feeClaim.getIntentDetails(intentHash): Promise<Result<Intent, Error>>;
24
34
  sodax.partners.feeClaim.getOriginalAssetAddress(chainId, hubAsset): OriginalAssetAddress | undefined;
25
35
  sodax.partners.feeClaim.getSpokeTokenFromOriginalAssetAddress(...): /* … */;
26
36
  ```
27
37
 
38
+ ## Same-token fees (no conversion) — withdraw directly
39
+
40
+ When a partner wants the fee token itself (e.g. claim BTC fees as BTC), there is no swap to do — the
41
+ solver rejects a same-token swap, so `createIntentAutoSwap` (and `swap()`, which delegates to it)
42
+ rejects it up front with `VALIDATION_FAILED` rather than locking the funds in an unfillable intent.
43
+ Instead move the wrapped fee token off Sonic with the bridge:
44
+ `sodax.bridge.bridge({ params: { srcChainKey: Sonic, srcAddress, srcToken: <hub asset on Sonic>,
45
+ amount, dstChainKey: <fee's native chain, or Sonic>, dstToken: <original token on dstChain, or the
46
+ hub asset for same-chain delivery>, recipient } })`. Bridging from Sonic pulls via the partner's
47
+ hub-wallet router, so it needs a bridge allowance — a different spender than the ProtocolIntents
48
+ approval used by the swap claim.
49
+
28
50
  ## Common call shape
29
51
 
30
52
  ```ts