@sodax/dapp-kit 2.0.0-rc.8 → 2.0.0

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 (74) hide show
  1. package/README.md +20 -11
  2. package/dist/index.d.ts +786 -54
  3. package/dist/index.mjs +864 -150
  4. package/package.json +3 -3
  5. package/src/hooks/_mutationContract.test.ts +15 -2
  6. package/src/hooks/backend/index.ts +1 -5
  7. package/src/hooks/bitcoin/index.ts +2 -0
  8. package/src/hooks/bitcoin/resolveBtcReadAddress.test.ts +54 -0
  9. package/src/hooks/bitcoin/resolveBtcReadAddress.ts +21 -0
  10. package/src/hooks/bitcoin/useBitcoinTradingSetup.ts +45 -0
  11. package/src/hooks/bitcoin/useEnsureRadfiAccessToken.ts +57 -0
  12. package/src/hooks/bitcoin/useFundTradingWallet.ts +1 -1
  13. package/src/hooks/bitcoin/useRadfiAuth.ts +2 -2
  14. package/src/hooks/bitcoin/useRadfiWithdraw.ts +2 -2
  15. package/src/hooks/bitcoin/useRenewUtxos.ts +2 -2
  16. package/src/hooks/bitcoin/useTradingWallet.ts +1 -1
  17. package/src/hooks/index.ts +2 -0
  18. package/src/hooks/leverageYield/index.ts +9 -0
  19. package/src/hooks/leverageYield/useLeverageYieldDeposit.ts +40 -0
  20. package/src/hooks/leverageYield/useLeverageYieldEffectiveApr.ts +42 -0
  21. package/src/hooks/leverageYield/useLeverageYieldNotifySolver.ts +34 -0
  22. package/src/hooks/leverageYield/useLeverageYieldPosition.ts +40 -0
  23. package/src/hooks/leverageYield/useLeverageYieldPreviewRedeem.ts +43 -0
  24. package/src/hooks/leverageYield/useLeverageYieldShareBalances.ts +74 -0
  25. package/src/hooks/leverageYield/useLeverageYieldTotalAssets.ts +36 -0
  26. package/src/hooks/leverageYield/useLeverageYieldVaultSwap.ts +50 -0
  27. package/src/hooks/leverageYield/useLeverageYieldWithdraw.ts +40 -0
  28. package/src/hooks/mm/useATokensBalances.ts +7 -1
  29. package/src/hooks/mm/useUserFormattedSummary.ts +5 -1
  30. package/src/hooks/mm/useUserReservesData.ts +5 -1
  31. package/src/hooks/partner/index.ts +4 -0
  32. package/src/hooks/partner/useFeeClaimWithdraw.ts +88 -0
  33. package/src/hooks/partner/useGetIntentDetails.ts +39 -0
  34. package/src/hooks/partner/useGetUserIntent.ts +35 -0
  35. package/src/hooks/partner/usePartnerCancelIntent.ts +52 -0
  36. package/src/hooks/shared/index.ts +4 -0
  37. package/src/hooks/shared/isUserRejectedError.test.ts +42 -0
  38. package/src/hooks/shared/isUserRejectedError.ts +30 -0
  39. package/src/hooks/shared/useGetUserHubWalletAddress.ts +5 -1
  40. package/src/hooks/shared/useNearStorageCheck.ts +45 -0
  41. package/src/hooks/shared/useNearStorageGate.ts +60 -0
  42. package/src/hooks/shared/useRegisterNearStorage.ts +46 -0
  43. package/src/hooks/shared/useRequestTrustline.ts +1 -1
  44. package/src/hooks/shared/useStellarTrustlineCheck.test.ts +74 -0
  45. package/src/hooks/shared/useStellarTrustlineCheck.ts +39 -15
  46. package/src/hooks/swapsApi/index.ts +41 -0
  47. package/src/hooks/swapsApi/isTerminalSwapIntentStatus.test.ts +24 -0
  48. package/src/hooks/swapsApi/isTerminalSwapIntentStatus.ts +11 -0
  49. package/src/hooks/swapsApi/useSwapsApiAllowance.ts +40 -0
  50. package/src/hooks/swapsApi/useSwapsApiApprove.ts +42 -0
  51. package/src/hooks/swapsApi/useSwapsApiCancelIntent.ts +41 -0
  52. package/src/hooks/swapsApi/useSwapsApiCreateIntent.ts +41 -0
  53. package/src/hooks/swapsApi/useSwapsApiCreateLimitOrder.ts +41 -0
  54. package/src/hooks/swapsApi/useSwapsApiDeadline.ts +36 -0
  55. package/src/hooks/swapsApi/useSwapsApiEstimateGas.ts +40 -0
  56. package/src/hooks/swapsApi/useSwapsApiFilledIntent.ts +41 -0
  57. package/src/hooks/swapsApi/useSwapsApiIntent.ts +40 -0
  58. package/src/hooks/swapsApi/useSwapsApiIntentExtraData.ts +41 -0
  59. package/src/hooks/swapsApi/useSwapsApiIntentHash.ts +40 -0
  60. package/src/hooks/swapsApi/useSwapsApiIntentPacket.ts +43 -0
  61. package/src/hooks/swapsApi/useSwapsApiPartnerFee.ts +40 -0
  62. package/src/hooks/swapsApi/useSwapsApiQuote.ts +55 -0
  63. package/src/hooks/swapsApi/useSwapsApiSolverFee.ts +40 -0
  64. package/src/hooks/swapsApi/useSwapsApiStatus.ts +45 -0
  65. package/src/hooks/swapsApi/useSwapsApiSubmitIntent.ts +43 -0
  66. package/src/hooks/{backend/useBackendSubmitSwapTx.ts → swapsApi/useSwapsApiSubmitTx.ts} +16 -17
  67. package/src/hooks/swapsApi/useSwapsApiSubmitTxStatus.ts +55 -0
  68. package/src/hooks/swapsApi/useSwapsApiTokens.ts +34 -0
  69. package/src/hooks/swapsApi/useSwapsApiTokensByChain.ts +40 -0
  70. package/src/providers/SodaxProvider.tsx +2 -3
  71. package/src/utils/index.ts +1 -0
  72. package/src/utils/nearStorageGate.test.ts +46 -0
  73. package/src/utils/nearStorageGate.ts +39 -0
  74. package/src/hooks/backend/useBackendSubmitSwapTxStatus.ts +0 -59
package/dist/index.d.ts CHANGED
@@ -1,9 +1,36 @@
1
1
  import { UseMutationOptions, UseQueryOptions, UseMutationResult, MutateOptions, UseQueryResult, QueryClientConfig, QueryClient } from '@tanstack/react-query';
2
- import { Result, Sodax, SpokeChainKey, GetEstimateGasReturnType, EstimateGasParams, IStellarWalletProvider, StellarChainKey, IXServiceBase, XToken, EvmHubProvider, IBitcoinWalletProvider, RadfiWalletBalance, RadfiUtxo, MoneyMarketBorrowActionParams, TxHashPair, MoneyMarketRepayActionParams, MoneyMarketSupplyActionParams, MoneyMarketWithdrawActionParams, UserReserveData, AggregatedReserveData, BaseCurrencyInfo, ReservesDataHumanized, Address as Address$1, MoneyMarketParams, MoneyMarketApproveActionParams, TxReturnType, Erc20Token, ChainKey, ReserveDataHumanized, FormatReserveUSDResponse, FormatUserSummaryResponse, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentQuoteRequest, SwapActionParams, SwapResponse, SolverIntentStatusResponse, Hex, CreateIntentParams, CreateLimitOrderParams, GetWalletProviderType, Intent, LimitOrderActionParams, IntentResponse, UserIntentsResponse, SubmitSwapTxResponse, SubmitSwapTxRequest, RequestOverrideConfig, SubmitSwapTxStatusResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, BridgeParams, CreateBridgeIntentParams, BridgeLimit, StakeAction, StakeParams, UnstakeAction, ClaimAction, CancelUnstakeAction, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeAction, UnstakeParams, InstantUnstakeParams, PartnerFeeClaimAssetBalance, AutoSwapPreferences, FeeTokenApproveParams, FeeTokenApproveAction, HubChainKey, SetSwapPreferenceAction, PartnerFeeClaimSwapAction, IntentAutoSwapResult, HubAssetBalance, WithdrawHubAssetAction, IcxMigrateAction, IcxRevertMigrationAction, UnifiedBnUSDMigrateAction, BalnMigrateAction, MigrationAction, IcxMigrateParams, IcxCreateRevertMigrationParams, UnifiedBnUSDMigrateParams, BalnMigrateParams, PoolKey, PoolData, ClPositionInfo, AssetDepositAction, AssetWithdrawAction, CreateAssetDepositParams, ClSupplyParams, ClIncreaseLiquidityParams, ClLiquidityDecreaseLiquidityAction, ClDecreaseLiquidityParams, CreateAssetWithdrawParams, PoolSpokeAssets, DestinationParamsType, ClLiquidityClaimRewardsAction, DeepPartial, SodaxConfig } from '@sodax/sdk';
2
+ import { Result, Sodax, SpokeChainKey, GetEstimateGasReturnType, EstimateGasParams, StellarChainKey, IStellarWalletProvider, INearWalletProvider, GetWalletProviderType, IXServiceBase, XToken, EvmHubProvider, IBitcoinWalletProvider, RadfiWalletBalance, IWalletProvider, RadfiUtxo, MoneyMarketBorrowActionParams, TxHashPair, MoneyMarketRepayActionParams, MoneyMarketSupplyActionParams, MoneyMarketWithdrawActionParams, UserReserveData, AggregatedReserveData, BaseCurrencyInfo, ReservesDataHumanized, Address as Address$1, MoneyMarketParams, MoneyMarketApproveActionParams, TxReturnType, Erc20Token, ChainKey, ReserveDataHumanized, FormatReserveUSDResponse, FormatUserSummaryResponse, SolverIntentQuoteResponse, SolverErrorResponse, SolverIntentQuoteRequest, SwapActionParams, SwapResponse, SolverIntentStatusResponse, Hex, CreateIntentParams, CreateLimitOrderParams, Intent, LimitOrderActionParams, IntentResponse, UserIntentsResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, GetSwapTokensResponseV2, RequestOverrideConfig, GetSwapTokensByChainResponseV2, QuoteResponseV2, QuoteRequestV2, QuoteQueryV2, DeadlineResponseV2, DeadlineQueryV2, AllowanceCheckResponseV2, CreateIntentParamsV2, ApproveResponseV2, CreateIntentResponseV2, SubmitIntentRequestV2, SubmitIntentResponseV2, StatusResponseV2, SwapIntentStatusCodeV2, CancelIntentRequestV2, CancelIntentResponseV2, IntentHashResponseV2, IntentRequestV2, IntentPacketResponseV2, IntentPacketRequestV2, IntentExtraDataResponseV2, IntentExtraDataRequestV2, IntentStateV2, GetIntentResponseV2, CreateLimitOrderParamsV2, CreateLimitOrderResponseV2, GasEstimateResponseV2, GasEstimateRequestV2, FeeResponseV2, SubmitTxRequestV2, SubmitTxResponseV2, SubmitTxStatusResponseV2, BridgeParams, CreateBridgeIntentParams, BridgeLimit, StakeAction, StakeParams, UnstakeAction, ClaimAction, CancelUnstakeAction, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeAction, UnstakeParams, InstantUnstakeParams, PartnerFeeClaimAssetBalance, AutoSwapPreferences, FeeTokenApproveParams, FeeTokenApproveAction, HubChainKey, SetSwapPreferenceAction, PartnerFeeClaimSwapAction, IntentAutoSwapResult, PartnerFeeClaimCancelAction, GetUserIntentParams, HubAssetBalance, WithdrawHubAssetAction, IcxMigrateAction, IcxRevertMigrationAction, UnifiedBnUSDMigrateAction, BalnMigrateAction, MigrationAction, IcxMigrateParams, IcxCreateRevertMigrationParams, UnifiedBnUSDMigrateParams, BalnMigrateParams, PoolKey, PoolData, ClPositionInfo, AssetDepositAction, AssetWithdrawAction, CreateAssetDepositParams, ClSupplyParams, ClIncreaseLiquidityParams, ClLiquidityDecreaseLiquidityAction, ClDecreaseLiquidityParams, CreateAssetWithdrawParams, PoolSpokeAssets, DestinationParamsType, ClLiquidityClaimRewardsAction, LeverageYieldEffectiveApr, LeverageYieldPosition, LeverageYieldSwapDepositParams, LeverageYieldSwapPayload, SolverExecutionRequest, SolverExecutionResponse, VaultSwapActionParams, VaultSwapResponse, LeverageYieldSwapWithdrawParams, SodaxOptions } from '@sodax/sdk';
3
3
  export * from '@sodax/sdk';
4
4
  import { Address } from 'viem';
5
5
  import { ReactNode, ReactElement } from 'react';
6
6
 
7
+ /**
8
+ * Predicate for the canonical "user cancelled the wallet prompt" outcome.
9
+ *
10
+ * The SDK classifies wallet rejection at the source: `intentCreationFailed` / `approveFailed`
11
+ * wrappers emit `SodaxError<'USER_REJECTED'>` whenever the underlying cause matches a known
12
+ * rejection shape (viem `4001` / `UserRejectedRequestError`, ICON Hana `CANCEL_SIGNING`,
13
+ * Solana / Sui / Stellar / Stacks / NEAR / Injective name + message patterns). Consumers
14
+ * branch on this code to render a "Cancelled" UI instead of a "Failed" toast — user
15
+ * cancellation is a normal flow, not a failure.
16
+ *
17
+ * Use after `mutateAsyncSafe` (or inside an `onError` / `catch`):
18
+ *
19
+ * ```ts
20
+ * const result = await swap.mutateAsyncSafe({ params, walletProvider });
21
+ * if (!result.ok) {
22
+ * if (isUserRejectedError(result.error)) return; // silent — user cancelled
23
+ * toast.error(getErrorMessage(result.error)); // real failure
24
+ * }
25
+ * ```
26
+ *
27
+ * The check trusts the SDK's classification — it does NOT re-scan message content. Errors
28
+ * raised outside the SDK boundary (e.g. a non-SodaxError thrown from a `queryFn`) will not
29
+ * match, which is intentional: only the SDK's `USER_REJECTED` is the canonical "cancelled"
30
+ * signal.
31
+ */
32
+ declare function isUserRejectedError(error: unknown): boolean;
33
+
7
34
  /**
8
35
  * Subset of `UseQueryOptions` consumers may override on dapp-kit read hooks.
9
36
  *
@@ -134,8 +161,25 @@ type UseStellarTrustlineCheckParams = ReadHookParams<boolean, {
134
161
  token: string | undefined;
135
162
  amount: bigint | undefined;
136
163
  chainId: SpokeChainKey | undefined;
137
- walletProvider: IStellarWalletProvider | undefined;
164
+ /** Resolved Stellar account address (e.g. `useXAccount('STELLAR').address`) — keys the cache per account. */
165
+ walletAddress: string | undefined;
138
166
  }>;
167
+ type StellarTrustlineReader = {
168
+ spoke: {
169
+ stellar: Pick<Sodax['spoke']['stellar'], 'hasSufficientTrustline'>;
170
+ };
171
+ };
172
+ declare function getStellarTrustlineCheckQueryOptions({ sodax, token, amount, chainId, walletAddress, }: {
173
+ sodax: StellarTrustlineReader;
174
+ token: string | undefined;
175
+ amount: bigint | undefined;
176
+ chainId: SpokeChainKey | undefined;
177
+ walletAddress: string | undefined;
178
+ }): {
179
+ queryKey: readonly ["shared", "stellarTrustlineCheck", "0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "injective-1" | "sonic" | "0x1.icon" | "sui" | "0xa.optimism" | "0x89.polygon" | "solana" | "stellar" | "hyper" | "lightlink" | "near" | "ethereum" | "bitcoin" | "redbelly" | "0x2019.kaia" | "stacks" | "hedera" | undefined, string | undefined, string | undefined, string | undefined];
180
+ queryFn: () => Promise<boolean>;
181
+ enabled: boolean;
182
+ };
139
183
  declare function useStellarTrustlineCheck({ params, queryOptions, }?: UseStellarTrustlineCheckParams): UseQueryResult<boolean, Error>;
140
184
 
141
185
  declare function useRequestTrustline(token: string | undefined): {
@@ -151,6 +195,72 @@ declare function useRequestTrustline(token: string | undefined): {
151
195
  data: string | null;
152
196
  };
153
197
 
198
+ type UseNearStorageCheckParams = ReadHookParams<boolean, {
199
+ token: string | undefined;
200
+ accountId: string | undefined;
201
+ chainId: SpokeChainKey | undefined;
202
+ }>;
203
+ /**
204
+ * Whether `accountId` is NEP-141 storage-registered for `token` on NEAR — the receive-side
205
+ * prerequisite for any leg that delivers a token to the user on NEAR (swap output on NEAR, bridge
206
+ * into NEAR, money-market borrow/withdraw to NEAR). NEAR's analogue of a Stellar trustline.
207
+ *
208
+ * Returns `true` (no gate) when `chainId` is not NEAR, mirroring how the Stellar trustline check
209
+ * short-circuits off-chain. Native NEAR is not a NEP-141 token, so the SDK reports it as registered.
210
+ *
211
+ * Pair with {@link useRegisterNearStorage} to perform the one-time `storage_deposit` when this
212
+ * resolves to `false`.
213
+ */
214
+ declare function useNearStorageCheck({ params, queryOptions, }?: UseNearStorageCheckParams): UseQueryResult<boolean, Error>;
215
+
216
+ type UseRegisterNearStorageVars = {
217
+ token: string;
218
+ accountId: string;
219
+ walletProvider: INearWalletProvider;
220
+ /** Storage bond override; defaults to the SDK's `NEAR_STORAGE_DEPOSIT` (0.00125 NEAR). */
221
+ deposit?: bigint;
222
+ };
223
+ /**
224
+ * Submit a NEP-141 `storage_deposit` so `accountId` can receive `token` on NEAR. NEAR's analogue of
225
+ * requesting a Stellar trustline; pair with {@link useNearStorageCheck} and call this when the check
226
+ * resolves to `false`. The recipient's NEAR wallet signs the registration tx.
227
+ *
228
+ * Pure mutation: pass `{ token, accountId, walletProvider }` to `mutate(...)`. The hook itself only
229
+ * takes the structural `mutationOptions` slot. `registerStorage` throws natively (no `Result<T>`),
230
+ * so this hook is registered as `nativeThrow` in the mutation contract. On success it invalidates
231
+ * the matching {@link useNearStorageCheck} query.
232
+ */
233
+ declare function useRegisterNearStorage({ mutationOptions, }?: MutationHookParams<string, UseRegisterNearStorageVars>): SafeUseMutationResult<string, Error, UseRegisterNearStorageVars>;
234
+
235
+ interface UseNearStorageGateParams {
236
+ /** Destination chain the token is delivered on. */
237
+ dstChainKey: SpokeChainKey;
238
+ /** Destination token address the recipient must be registered for. */
239
+ token: string | undefined;
240
+ /** Recipient NEAR account id. */
241
+ accountId: string | undefined;
242
+ /** Destination wallet provider; only consumed when it is the NEAR provider. */
243
+ walletProvider: GetWalletProviderType<SpokeChainKey> | undefined;
244
+ }
245
+ interface NearStorageGate {
246
+ /** Destination is NEAR. */
247
+ isNear: boolean;
248
+ /** Destination is NEAR and the recipient is not yet storage-registered for `token`. */
249
+ needsRegistration: boolean;
250
+ /** The downstream action must stay disabled while the gate is unresolved or unmet. */
251
+ blocksAction: boolean;
252
+ /** The registration-status query is actively fetching. */
253
+ isChecking: boolean;
254
+ /** A `storage_deposit` tx is in flight. */
255
+ isRegistering: boolean;
256
+ /** Submit the `storage_deposit`; resolves to the SDK `Result` or `undefined` if inputs are missing. */
257
+ registerStorage: () => Promise<Result<string> | undefined>;
258
+ }
259
+ /**
260
+ * NEP-141 storage-registration gate for flows that deliver a token to a user on NEAR.
261
+ */
262
+ declare function useNearStorageGate({ dstChainKey, token, accountId, walletProvider, }: UseNearStorageGateParams): NearStorageGate;
263
+
154
264
  type UseGetUserHubWalletAddressParams = ReadHookParams<Address, {
155
265
  spokeChainId?: SpokeChainKey;
156
266
  spokeAddress?: string;
@@ -191,7 +301,7 @@ type UseXBalancesParams = ReadHookParams<Record<string, bigint>, XBalancesInputs
191
301
  * tests and for advanced callers that compose their own `useQuery` wrapper.
192
302
  */
193
303
  declare function getXBalancesQueryOptions({ xService, xChainId, xTokens, address }: XBalancesInputs): {
194
- queryKey: readonly ["shared", "xBalances", "0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "injective-1" | "sonic" | "0x1.icon" | "sui" | "0xa.optimism" | "0x89.polygon" | "solana" | "stellar" | "hyper" | "lightlink" | "near" | "ethereum" | "bitcoin" | "redbelly" | "0x2019.kaia" | "stacks" | undefined, (readonly [string, string])[], string | undefined];
304
+ queryKey: readonly ["shared", "xBalances", "0xa86a.avax" | "0xa4b1.arbitrum" | "0x2105.base" | "0x38.bsc" | "injective-1" | "sonic" | "0x1.icon" | "sui" | "0xa.optimism" | "0x89.polygon" | "solana" | "stellar" | "hyper" | "lightlink" | "near" | "ethereum" | "bitcoin" | "redbelly" | "0x2019.kaia" | "stacks" | "hedera" | undefined, (readonly [string, string])[], string | undefined];
195
305
  queryFn: () => Promise<Record<string, bigint>>;
196
306
  enabled: boolean;
197
307
  refetchInterval: number;
@@ -228,12 +338,32 @@ declare function saveRadfiSession(address: string, session: RadfiSession): void;
228
338
  declare function loadRadfiSession(address: string): RadfiSession | null;
229
339
  declare function clearRadfiSession(address: string): void;
230
340
  /**
231
- * React hook for authenticating with Radfi via BIP322-signed message. Pure mutation: pass
341
+ * React hook for authenticating with Bound Exchange via BIP322-signed message. Pure mutation: pass
232
342
  * `{ walletProvider }` to `mutate({...})`. The hook itself takes no arguments other than the
233
343
  * structural `mutationOptions` slot.
234
344
  */
235
345
  declare function useRadfiAuth({ mutationOptions, }?: MutationHookParams<RadfiAuthResult, UseRadfiAuthVars>): SafeUseMutationResult<RadfiAuthResult, Error, UseRadfiAuthVars>;
236
346
 
347
+ type UseEnsureRadfiAccessTokenVars = {
348
+ walletProvider: IBitcoinWalletProvider;
349
+ };
350
+ /**
351
+ * Ensure a valid Bound Exchange access token and return it. Refreshes the existing token (no
352
+ * signature prompt) when a refresh token is available, falling back to a full BIP322 re-auth only if
353
+ * refresh fails. Bound tokens are short-lived, so call this right before a Bitcoin-source
354
+ * createIntent — forward the returned token via the typed `extras.bound.accessToken` slot (SDK in-process)
355
+ * or the `accessToken` body field on the backend DTO — or before the client-side sign + co-sign step.
356
+ *
357
+ * @example
358
+ * const { mutateAsync: ensureToken } = useEnsureRadfiAccessToken();
359
+ * const accessToken = await ensureToken({ walletProvider });
360
+ * // SDK in-process (Bitcoin-gated extras):
361
+ * await sodax.swaps.createIntent({ params, extras: { bound: { accessToken } }, raw: true });
362
+ * // or backend createIntent — token in the body, not an x-bound-access-token header:
363
+ * await createIntent({ body: { ...body, accessToken } });
364
+ */
365
+ declare function useEnsureRadfiAccessToken({ mutationOptions, }?: MutationHookParams<string, UseEnsureRadfiAccessTokenVars>): SafeUseMutationResult<string, Error, UseEnsureRadfiAccessTokenVars>;
366
+
237
367
  type UseRadfiSessionReturn = {
238
368
  walletAddress: string | undefined;
239
369
  isAuthed: boolean;
@@ -248,7 +378,7 @@ type UseFundTradingWalletVars = {
248
378
  walletProvider: IBitcoinWalletProvider;
249
379
  };
250
380
  /**
251
- * React hook for funding the user's Radfi trading wallet from their personal Bitcoin wallet.
381
+ * React hook for funding the user's Bound Exchange trading wallet from their personal Bitcoin wallet.
252
382
  * Pure mutation: pass `{ amount, walletProvider }` to `mutate({...})`. Returns the broadcast tx
253
383
  * id on success.
254
384
  */
@@ -271,7 +401,7 @@ type UseTradingWalletReturn = {
271
401
  tradingAddress: string | undefined;
272
402
  };
273
403
  /**
274
- * Returns the Radfi trading wallet address from the persisted session.
404
+ * Returns the Bound Exchange trading wallet address from the persisted session.
275
405
  * Trading wallet is created automatically during authentication — no API call needed.
276
406
  */
277
407
  declare function useTradingWallet(walletAddress: string | undefined): UseTradingWalletReturn;
@@ -282,6 +412,23 @@ type UseTradingWalletBalanceParams = ReadHookParams<RadfiWalletBalance, {
282
412
  }>;
283
413
  declare function useTradingWalletBalance({ params, queryOptions, }?: UseTradingWalletBalanceParams): UseQueryResult<RadfiWalletBalance, Error>;
284
414
 
415
+ interface UseBitcoinTradingSetupParams {
416
+ chainKey: SpokeChainKey;
417
+ /** This side's wallet provider + account, e.g. `useWalletProvider` / `useXAccount`. */
418
+ walletProvider: IWalletProvider | undefined;
419
+ address: string | undefined;
420
+ }
421
+ interface BitcoinTradingSetup {
422
+ wallet: IBitcoinWalletProvider | undefined;
423
+ tradingBalance: RadfiWalletBalance | undefined;
424
+ }
425
+ /**
426
+ * Bitcoin trading-wallet setup for one side of a cross-chain flow: Bitcoin funds move through a
427
+ * Bound Exchange (Radfi) trading wallet, not the personal wallet. Inert (no work) unless `chainKey`
428
+ * is Bitcoin. Wallet-layer inputs are passed in — this package doesn't depend on wallet-sdk-react.
429
+ */
430
+ declare function useBitcoinTradingSetup({ chainKey, walletProvider, address, }: UseBitcoinTradingSetupParams): BitcoinTradingSetup;
431
+
285
432
  type UseExpiredUtxosParams = ReadHookParams<RadfiUtxo[], {
286
433
  walletProvider: IBitcoinWalletProvider | undefined;
287
434
  tradingAddress: string | undefined;
@@ -293,7 +440,7 @@ type UseRenewUtxosVars = {
293
440
  walletProvider: IBitcoinWalletProvider;
294
441
  };
295
442
  /**
296
- * React hook for renewing expired UTXOs in the user's Radfi trading wallet. Pure mutation: pass
443
+ * React hook for renewing expired UTXOs in the user's Bound Exchange trading wallet. Pure mutation: pass
297
444
  * `{ txIdVouts, walletProvider }` to `mutate({...})`.
298
445
  */
299
446
  declare function useRenewUtxos({ mutationOptions, }?: MutationHookParams<string, UseRenewUtxosVars>): SafeUseMutationResult<string, Error, UseRenewUtxosVars>;
@@ -309,7 +456,7 @@ type WithdrawResult = {
309
456
  fee: number;
310
457
  };
311
458
  /**
312
- * React hook for withdrawing BTC from the user's Radfi trading wallet back to their personal
459
+ * React hook for withdrawing BTC from the user's Bound Exchange trading wallet back to their personal
313
460
  * Bitcoin wallet. Pure mutation: pass all inputs (including the wallet provider) to
314
461
  * `mutate({...})`.
315
462
  */
@@ -649,50 +796,6 @@ type UseBackendUserIntentsParams = ReadHookParams<UserIntentsResponse | undefine
649
796
  */
650
797
  declare const useBackendUserIntents: ({ params, queryOptions, }?: UseBackendUserIntentsParams) => UseQueryResult<UserIntentsResponse | undefined, Error>;
651
798
 
652
- /**
653
- * Mutation variables for {@link useBackendSubmitSwapTx}. The per-request `apiConfig` override
654
- * (e.g. base URL) belongs here rather than at the hook level — different submissions in the same
655
- * component can target different endpoints without re-rendering.
656
- */
657
- type UseBackendSubmitSwapTxVars = {
658
- request: SubmitSwapTxRequest;
659
- apiConfig?: RequestOverrideConfig;
660
- };
661
- /**
662
- * React hook for submitting a swap transaction to be processed by the backend (relay, post
663
- * execution to solver, etc.).
664
- *
665
- * Pure mutation: pass `{ request, apiConfig? }` to `mutate({...})`. Default `retry: 3` is applied
666
- * at the hook level — consumers can override via `mutationOptions.retry`.
667
- *
668
- * @example
669
- * const { mutateAsync: submitSwapTx, isPending, error } = useBackendSubmitSwapTx();
670
- *
671
- * const result = await submitSwapTx({
672
- * request: { txHash: '0x123...', srcChainKey: 'sonic', walletAddress: '0xabc...', intent: { ... }, relayData: '0x...' },
673
- * apiConfig: { baseURL: 'https://...' },
674
- * });
675
- */
676
- declare const useBackendSubmitSwapTx: ({ mutationOptions, }?: MutationHookParams<SubmitSwapTxResponse, UseBackendSubmitSwapTxVars>) => SafeUseMutationResult<SubmitSwapTxResponse, Error, UseBackendSubmitSwapTxVars>;
677
-
678
- type UseBackendSubmitSwapTxStatusParams = ReadHookParams<SubmitSwapTxStatusResponse | undefined, {
679
- txHash: string | undefined;
680
- srcChainKey?: string;
681
- apiConfig?: RequestOverrideConfig;
682
- }>;
683
- /**
684
- * React hook for polling the processing status of a submitted swap transaction.
685
- *
686
- * @example
687
- * const { data: status } = useBackendSubmitSwapTxStatus({
688
- * params: { txHash: '0x123...', srcChainKey: 'sonic' },
689
- * });
690
- *
691
- * @remarks
692
- * - Default refetch interval is 1 second; stops on 'executed' or 'failed' status.
693
- */
694
- declare const useBackendSubmitSwapTxStatus: ({ params, queryOptions, }?: UseBackendSubmitSwapTxStatusParams) => UseQueryResult<SubmitSwapTxStatusResponse | undefined, Error>;
695
-
696
799
  type BackendPaginationParams = {
697
800
  offset: string;
698
801
  limit: string;
@@ -783,6 +886,358 @@ type UseBackendAllMoneyMarketBorrowersParams = ReadHookParams<MoneyMarketBorrowe
783
886
  */
784
887
  declare const useBackendAllMoneyMarketBorrowers: ({ params, queryOptions, }?: UseBackendAllMoneyMarketBorrowersParams) => UseQueryResult<MoneyMarketBorrowers | undefined>;
785
888
 
889
+ type UseSwapsApiTokensParams = ReadHookParams<GetSwapTokensResponseV2, {
890
+ apiConfig?: RequestOverrideConfig;
891
+ }>;
892
+ /**
893
+ * React hook to fetch all supported swap tokens grouped by SpokeChainKey via the swaps API —
894
+ * `sodax.api.swaps.getTokens`.
895
+ *
896
+ * @example
897
+ * const { data: tokensByChain } = useSwapsApiTokens();
898
+ */
899
+ declare const useSwapsApiTokens: ({ params, queryOptions, }?: UseSwapsApiTokensParams) => UseQueryResult<GetSwapTokensResponseV2, Error>;
900
+
901
+ type UseSwapsApiTokensByChainParams = ReadHookParams<GetSwapTokensByChainResponseV2 | undefined, {
902
+ chainKey: string | undefined;
903
+ apiConfig?: RequestOverrideConfig;
904
+ }>;
905
+ /**
906
+ * React hook to fetch supported swap tokens for a single SpokeChainKey via the swaps API —
907
+ * `sodax.api.swaps.getTokensByChain`.
908
+ *
909
+ * @example
910
+ * const { data: tokens } = useSwapsApiTokensByChain({ params: { chainKey: '0xa4b1.arbitrum' } });
911
+ */
912
+ declare const useSwapsApiTokensByChain: ({ params, queryOptions, }?: UseSwapsApiTokensByChainParams) => UseQueryResult<GetSwapTokensByChainResponseV2 | undefined, Error>;
913
+
914
+ type UseSwapsApiQuoteParams = ReadHookParams<QuoteResponseV2 | undefined, {
915
+ body: QuoteRequestV2 | undefined;
916
+ query?: QuoteQueryV2;
917
+ apiConfig?: RequestOverrideConfig;
918
+ }>;
919
+ /**
920
+ * React hook to get a solver quote for a cross-chain swap via the swaps API —
921
+ * `sodax.api.swaps.getQuote`. Pass `query.includeTxData = true` to also build an unsigned
922
+ * create-intent transaction (`txData`); `srcAddress`/`dstAddress` are then required in the body.
923
+ *
924
+ * @example
925
+ * const { data: quote } = useSwapsApiQuote({
926
+ * params: {
927
+ * body: {
928
+ * tokenSrc: '0x...', tokenSrcChainKey: '0xa4b1.arbitrum',
929
+ * tokenDst: '0x...', tokenDstChainKey: 'sonic',
930
+ * amount: '1000000', quoteType: 'exact_input',
931
+ * },
932
+ * },
933
+ * });
934
+ */
935
+ declare const useSwapsApiQuote: ({ params, queryOptions, }?: UseSwapsApiQuoteParams) => UseQueryResult<QuoteResponseV2 | undefined, Error>;
936
+
937
+ type UseSwapsApiDeadlineParams = ReadHookParams<DeadlineResponseV2, {
938
+ query?: DeadlineQueryV2;
939
+ apiConfig?: RequestOverrideConfig;
940
+ }>;
941
+ /**
942
+ * React hook to compute a swap deadline (hub timestamp + `offsetSeconds`, default 300s) via the
943
+ * swaps API — `sodax.api.swaps.getDeadline`.
944
+ *
945
+ * @example
946
+ * const { data: deadline } = useSwapsApiDeadline({ params: { query: { offsetSeconds: 600 } } });
947
+ */
948
+ declare const useSwapsApiDeadline: ({ params, queryOptions, }?: UseSwapsApiDeadlineParams) => UseQueryResult<DeadlineResponseV2, Error>;
949
+
950
+ type UseSwapsApiAllowanceParams = ReadHookParams<AllowanceCheckResponseV2 | undefined, {
951
+ body: CreateIntentParamsV2 | undefined;
952
+ apiConfig?: RequestOverrideConfig;
953
+ }>;
954
+ /**
955
+ * React hook to check whether the source-token allowance is already sufficient for an intent via
956
+ * the swaps API — `sodax.api.swaps.checkAllowance`. Returns `{ valid }`.
957
+ *
958
+ * @example
959
+ * const { data: allowance } = useSwapsApiAllowance({ params: { body: createIntentParams } });
960
+ */
961
+ declare const useSwapsApiAllowance: ({ params, queryOptions, }?: UseSwapsApiAllowanceParams) => UseQueryResult<AllowanceCheckResponseV2 | undefined, Error>;
962
+
963
+ /**
964
+ * Mutation variables for {@link useSwapsApiApprove}. The per-request `apiConfig` override belongs
965
+ * here rather than at the hook level — different calls in the same component can target different
966
+ * endpoints without re-rendering.
967
+ */
968
+ type UseSwapsApiApproveVars = {
969
+ body: CreateIntentParamsV2;
970
+ apiConfig?: RequestOverrideConfig;
971
+ };
972
+ /**
973
+ * React hook to build an unsigned token-approval transaction for the source token via the swaps
974
+ * API — `sodax.api.swaps.approve`. Returns `{ tx }` (chain-specific unsigned tx) to sign and
975
+ * broadcast yourself; it does not change state, so no queries are invalidated.
976
+ *
977
+ * @example
978
+ * const { mutateAsync: approve } = useSwapsApiApprove();
979
+ * const { tx } = await approve({ body: createIntentParams });
980
+ */
981
+ declare const useSwapsApiApprove: ({ mutationOptions, }?: MutationHookParams<ApproveResponseV2, UseSwapsApiApproveVars>) => SafeUseMutationResult<ApproveResponseV2, Error, UseSwapsApiApproveVars>;
982
+
983
+ /**
984
+ * Mutation variables for {@link useSwapsApiCreateIntent}. The per-request `apiConfig` override
985
+ * belongs here rather than at the hook level.
986
+ */
987
+ type UseSwapsApiCreateIntentVars = {
988
+ body: CreateIntentParamsV2;
989
+ apiConfig?: RequestOverrideConfig;
990
+ };
991
+ /**
992
+ * React hook to build an unsigned create-intent transaction via the swaps API —
993
+ * `sodax.api.swaps.createIntent`. Returns `{ tx, intent, relayData }` to sign and broadcast
994
+ * yourself; it does not change state, so no queries are invalidated.
995
+ *
996
+ * @example
997
+ * const { mutateAsync: createIntent } = useSwapsApiCreateIntent();
998
+ * const { tx, intent, relayData } = await createIntent({ body: createIntentParams });
999
+ */
1000
+ declare const useSwapsApiCreateIntent: ({ mutationOptions, }?: MutationHookParams<CreateIntentResponseV2, UseSwapsApiCreateIntentVars>) => SafeUseMutationResult<CreateIntentResponseV2, Error, UseSwapsApiCreateIntentVars>;
1001
+
1002
+ /**
1003
+ * Mutation variables for {@link useSwapsApiSubmitIntent}. The per-request `apiConfig` override
1004
+ * belongs here rather than at the hook level.
1005
+ */
1006
+ type UseSwapsApiSubmitIntentVars = {
1007
+ body: SubmitIntentRequestV2;
1008
+ apiConfig?: RequestOverrideConfig;
1009
+ };
1010
+ /**
1011
+ * React hook to submit the broadcast intent tx to the relay via the swaps API —
1012
+ * `sodax.api.swaps.submitIntent`. Returns `{ result }` (opaque relay response).
1013
+ *
1014
+ * No auto-retry (`retry: false`): submitting is non-idempotent — a retry after a lost response
1015
+ * could double-submit to the relay. Override via `mutationOptions.retry` if your relay dedupes.
1016
+ *
1017
+ * @example
1018
+ * const { mutateAsync: submitIntent } = useSwapsApiSubmitIntent();
1019
+ * const { result } = await submitIntent({ body: { chainId: '146', txHash: '0x123...' } });
1020
+ */
1021
+ declare const useSwapsApiSubmitIntent: ({ mutationOptions, }?: MutationHookParams<SubmitIntentResponseV2, UseSwapsApiSubmitIntentVars>) => SafeUseMutationResult<SubmitIntentResponseV2, Error, UseSwapsApiSubmitIntentVars>;
1022
+
1023
+ type UseSwapsApiStatusParams = ReadHookParams<StatusResponseV2 | undefined, {
1024
+ intentTxHash: string | undefined;
1025
+ apiConfig?: RequestOverrideConfig;
1026
+ }>;
1027
+ /**
1028
+ * React hook for polling the solver intent status by hub-chain intent tx hash via the swaps API —
1029
+ * `sodax.api.swaps.getStatus`. Returns `{ status, fillTxHash? }` (`fillTxHash` set when `status === 3`).
1030
+ *
1031
+ * @example
1032
+ * const { data } = useSwapsApiStatus({ params: { intentTxHash: '0x123...' } });
1033
+ *
1034
+ * @remarks
1035
+ * - Default refetch interval is 1 second; stops once `status` is `3` (SOLVED) or `4` (FAILED).
1036
+ */
1037
+ declare const useSwapsApiStatus: ({ params, queryOptions, }?: UseSwapsApiStatusParams) => UseQueryResult<StatusResponseV2 | undefined, Error>;
1038
+
1039
+ /**
1040
+ * Terminal solver intent states: once reached, the intent is resolved and polling stops.
1041
+ * `3` = SOLVED, `4` = FAILED (per `SwapIntentStatusCodeV2`); `-1` / `1` / `2` are non-terminal.
1042
+ *
1043
+ * Kept in its own pure module (no React/context imports) so it is unit-testable in dapp-kit's
1044
+ * `node` test environment — importing the hook itself pulls in `useSodaxContext`.
1045
+ */
1046
+ declare const isTerminalSwapIntentStatus: (status: SwapIntentStatusCodeV2 | undefined) => boolean;
1047
+
1048
+ /**
1049
+ * Mutation variables for {@link useSwapsApiCancelIntent}. The per-request `apiConfig` override
1050
+ * belongs here rather than at the hook level.
1051
+ */
1052
+ type UseSwapsApiCancelIntentVars = {
1053
+ body: CancelIntentRequestV2;
1054
+ apiConfig?: RequestOverrideConfig;
1055
+ };
1056
+ /**
1057
+ * React hook to build an unsigned cancel-intent transaction via the swaps API —
1058
+ * `sodax.api.swaps.cancelIntent`. The `intent` carries `bigint` numerics. Returns `{ tx }` to sign
1059
+ * and broadcast yourself; it does not change state, so no queries are invalidated.
1060
+ *
1061
+ * @example
1062
+ * const { mutateAsync: cancelIntent } = useSwapsApiCancelIntent();
1063
+ * const { tx } = await cancelIntent({ body: { srcChainKey: 'sonic', intent } });
1064
+ */
1065
+ declare const useSwapsApiCancelIntent: ({ mutationOptions, }?: MutationHookParams<CancelIntentResponseV2, UseSwapsApiCancelIntentVars>) => SafeUseMutationResult<CancelIntentResponseV2, Error, UseSwapsApiCancelIntentVars>;
1066
+
1067
+ type UseSwapsApiIntentHashParams = ReadHookParams<IntentHashResponseV2 | undefined, {
1068
+ intent: IntentRequestV2 | undefined;
1069
+ apiConfig?: RequestOverrideConfig;
1070
+ }>;
1071
+ /**
1072
+ * React hook to compute the keccak256 hash of an Intent struct via the swaps API —
1073
+ * `sodax.api.swaps.getIntentHash`. The `intent` carries `bigint` numerics. Returns `{ hash }`.
1074
+ *
1075
+ * @example
1076
+ * const { data } = useSwapsApiIntentHash({ params: { intent } });
1077
+ */
1078
+ declare const useSwapsApiIntentHash: ({ params, queryOptions, }?: UseSwapsApiIntentHashParams) => UseQueryResult<IntentHashResponseV2 | undefined, Error>;
1079
+
1080
+ type UseSwapsApiIntentPacketParams = ReadHookParams<IntentPacketResponseV2 | undefined, {
1081
+ body: IntentPacketRequestV2 | undefined;
1082
+ apiConfig?: RequestOverrideConfig;
1083
+ }>;
1084
+ /**
1085
+ * React hook to long-poll the relayer until the fill packet lands on the destination chain via the
1086
+ * swaps API — `sodax.api.swaps.getSolvedIntentPacket`. The request is held open server-side until
1087
+ * the packet arrives (or `body.timeout` ms elapses), so no client-side `refetchInterval` is set.
1088
+ *
1089
+ * @example
1090
+ * const { data: packet } = useSwapsApiIntentPacket({
1091
+ * params: { body: { chainId: '146', fillTxHash: '0x123...' } },
1092
+ * });
1093
+ */
1094
+ declare const useSwapsApiIntentPacket: ({ params, queryOptions, }?: UseSwapsApiIntentPacketParams) => UseQueryResult<IntentPacketResponseV2 | undefined, Error>;
1095
+
1096
+ type UseSwapsApiIntentExtraDataParams = ReadHookParams<IntentExtraDataResponseV2 | undefined, {
1097
+ body: IntentExtraDataRequestV2 | undefined;
1098
+ apiConfig?: RequestOverrideConfig;
1099
+ }>;
1100
+ /**
1101
+ * React hook to recover the relay extra data needed by `/swaps/intents/submit` via the swaps API —
1102
+ * `sodax.api.swaps.getIntentSubmitTxExtraData`. Provide EITHER `txHash` OR `intent` in the body
1103
+ * (whose `bigint` numerics are serialized by the SDK). Returns `{ address, payload }`.
1104
+ *
1105
+ * @example
1106
+ * const { data } = useSwapsApiIntentExtraData({ params: { body: { txHash: '0x123...' } } });
1107
+ */
1108
+ declare const useSwapsApiIntentExtraData: ({ params, queryOptions, }?: UseSwapsApiIntentExtraDataParams) => UseQueryResult<IntentExtraDataResponseV2 | undefined, Error>;
1109
+
1110
+ type UseSwapsApiFilledIntentParams = ReadHookParams<IntentStateV2 | undefined, {
1111
+ txHash: string | undefined;
1112
+ apiConfig?: RequestOverrideConfig;
1113
+ }>;
1114
+ /**
1115
+ * React hook to get the on-chain fill state for an intent by its hub-chain tx hash via the swaps
1116
+ * API — `sodax.api.swaps.getFilledIntent`. Returns
1117
+ * `{ exists, remainingInput, receivedOutput, pendingPayment }`.
1118
+ *
1119
+ * @example
1120
+ * const { data: fill } = useSwapsApiFilledIntent({ params: { txHash: '0x123...' } });
1121
+ */
1122
+ declare const useSwapsApiFilledIntent: ({ params, queryOptions, }?: UseSwapsApiFilledIntentParams) => UseQueryResult<IntentStateV2 | undefined, Error>;
1123
+
1124
+ type UseSwapsApiIntentParams = ReadHookParams<GetIntentResponseV2 | undefined, {
1125
+ txHash: string | undefined;
1126
+ apiConfig?: RequestOverrideConfig;
1127
+ }>;
1128
+ /**
1129
+ * React hook to look up an Intent struct by its hub-chain creation tx hash via the swaps API —
1130
+ * `sodax.api.swaps.getIntent`. The decoded intent's bigint fields are returned as decimal strings.
1131
+ *
1132
+ * @example
1133
+ * const { data: intent } = useSwapsApiIntent({ params: { txHash: '0x123...' } });
1134
+ */
1135
+ declare const useSwapsApiIntent: ({ params, queryOptions, }?: UseSwapsApiIntentParams) => UseQueryResult<GetIntentResponseV2 | undefined, Error>;
1136
+
1137
+ /**
1138
+ * Mutation variables for {@link useSwapsApiCreateLimitOrder}. The per-request `apiConfig` override
1139
+ * belongs here rather than at the hook level.
1140
+ */
1141
+ type UseSwapsApiCreateLimitOrderVars = {
1142
+ body: CreateLimitOrderParamsV2;
1143
+ apiConfig?: RequestOverrideConfig;
1144
+ };
1145
+ /**
1146
+ * React hook to build an unsigned create-limit-order-intent transaction via the swaps API —
1147
+ * `sodax.api.swaps.createLimitOrderIntent` (same as create-intent but `deadline` is optional).
1148
+ * Returns `{ tx, intent, relayData }`; it does not change state, so no queries are invalidated.
1149
+ *
1150
+ * @example
1151
+ * const { mutateAsync: createLimitOrder } = useSwapsApiCreateLimitOrder();
1152
+ * const { tx, intent, relayData } = await createLimitOrder({ body: createLimitOrderParams });
1153
+ */
1154
+ declare const useSwapsApiCreateLimitOrder: ({ mutationOptions, }?: MutationHookParams<CreateLimitOrderResponseV2, UseSwapsApiCreateLimitOrderVars>) => SafeUseMutationResult<CreateLimitOrderResponseV2, Error, UseSwapsApiCreateLimitOrderVars>;
1155
+
1156
+ type UseSwapsApiEstimateGasParams = ReadHookParams<GasEstimateResponseV2 | undefined, {
1157
+ body: GasEstimateRequestV2 | undefined;
1158
+ apiConfig?: RequestOverrideConfig;
1159
+ }>;
1160
+ /**
1161
+ * React hook to estimate gas for a raw transaction on a spoke chain via the swaps API —
1162
+ * `sodax.api.swaps.estimateGas`. Returns `{ gas }` (chain-specific shape).
1163
+ *
1164
+ * @example
1165
+ * const { data } = useSwapsApiEstimateGas({ params: { body: { chainKey: 'sonic', tx } } });
1166
+ */
1167
+ declare const useSwapsApiEstimateGas: ({ params, queryOptions, }?: UseSwapsApiEstimateGasParams) => UseQueryResult<GasEstimateResponseV2 | undefined, Error>;
1168
+
1169
+ type UseSwapsApiPartnerFeeParams = ReadHookParams<FeeResponseV2 | undefined, {
1170
+ amount: string | undefined;
1171
+ apiConfig?: RequestOverrideConfig;
1172
+ }>;
1173
+ /**
1174
+ * React hook to compute the partner fee for a given input amount via the swaps API —
1175
+ * `sodax.api.swaps.getPartnerFee`. Returns `{ fee }` (decimal string).
1176
+ *
1177
+ * @example
1178
+ * const { data } = useSwapsApiPartnerFee({ params: { amount: '1000000' } });
1179
+ */
1180
+ declare const useSwapsApiPartnerFee: ({ params, queryOptions, }?: UseSwapsApiPartnerFeeParams) => UseQueryResult<FeeResponseV2 | undefined, Error>;
1181
+
1182
+ type UseSwapsApiSolverFeeParams = ReadHookParams<FeeResponseV2 | undefined, {
1183
+ amount: string | undefined;
1184
+ apiConfig?: RequestOverrideConfig;
1185
+ }>;
1186
+ /**
1187
+ * React hook to compute the protocol (solver) fee for a given input amount via the swaps API —
1188
+ * `sodax.api.swaps.getSolverFee`. Returns `{ fee }` (decimal string).
1189
+ *
1190
+ * @example
1191
+ * const { data } = useSwapsApiSolverFee({ params: { amount: '1000000' } });
1192
+ */
1193
+ declare const useSwapsApiSolverFee: ({ params, queryOptions, }?: UseSwapsApiSolverFeeParams) => UseQueryResult<FeeResponseV2 | undefined, Error>;
1194
+
1195
+ /**
1196
+ * Mutation variables for {@link useSwapsApiSubmitTx}. The per-request `apiConfig` override
1197
+ * (e.g. base URL) belongs here rather than at the hook level — different submissions in the same
1198
+ * component can target different endpoints without re-rendering.
1199
+ */
1200
+ type UseSwapsApiSubmitTxVars = {
1201
+ request: SubmitTxRequestV2;
1202
+ apiConfig?: RequestOverrideConfig;
1203
+ };
1204
+ /**
1205
+ * React hook for submitting a swap transaction to be processed (relay, post execution to the
1206
+ * solver, etc.) via the swaps API — `sodax.api.swaps.submitTx`.
1207
+ *
1208
+ * Pure mutation: pass `{ request, apiConfig? }` to `mutate({...})`. Default `retry: 3` is applied
1209
+ * at the hook level — consumers can override via `mutationOptions.retry`.
1210
+ *
1211
+ * @example
1212
+ * const { mutateAsync: submitSwapTx, isPending, error } = useSwapsApiSubmitTx();
1213
+ *
1214
+ * const result = await submitSwapTx({
1215
+ * request: { txHash: '0x123...', srcChainKey: 'sonic', walletAddress: '0xabc...', intent: { ... }, relayData: '0x...' },
1216
+ * apiConfig: { baseURL: 'https://...' },
1217
+ * });
1218
+ */
1219
+ declare const useSwapsApiSubmitTx: ({ mutationOptions, }?: MutationHookParams<SubmitTxResponseV2, UseSwapsApiSubmitTxVars>) => SafeUseMutationResult<SubmitTxResponseV2, Error, UseSwapsApiSubmitTxVars>;
1220
+
1221
+ type UseSwapsApiSubmitTxStatusParams = ReadHookParams<SubmitTxStatusResponseV2 | undefined, {
1222
+ txHash: string | undefined;
1223
+ srcChainKey?: string;
1224
+ apiConfig?: RequestOverrideConfig;
1225
+ }>;
1226
+ /**
1227
+ * React hook for polling the processing status of a submitted swap transaction via the swaps API —
1228
+ * `sodax.api.swaps.getSubmitTxStatus`. Both `txHash` and `srcChainKey` are required for the query
1229
+ * to run (the swaps API v2 status query requires the source chain key).
1230
+ *
1231
+ * @example
1232
+ * const { data: status } = useSwapsApiSubmitTxStatus({
1233
+ * params: { txHash: '0x123...', srcChainKey: 'sonic' },
1234
+ * });
1235
+ *
1236
+ * @remarks
1237
+ * - Default refetch interval is 1 second; stops on 'solved' or 'failed' status.
1238
+ */
1239
+ declare const useSwapsApiSubmitTxStatus: ({ params, queryOptions, }?: UseSwapsApiSubmitTxStatusParams) => UseQueryResult<SubmitTxStatusResponseV2 | undefined, Error>;
1240
+
786
1241
  /**
787
1242
  * Mutation variables for {@link useBridge}. Generic over `K extends SpokeChainKey` (defaults to
788
1243
  * the full union). Sophisticated callers can lock K at the hook call site to narrow the
@@ -1092,6 +1547,75 @@ type UseFeeClaimSwapVars = Omit<PartnerFeeClaimSwapAction<HubChainKey, false>, '
1092
1547
  */
1093
1548
  declare function useFeeClaimSwap({ mutationOptions, }?: MutationHookParams<IntentAutoSwapResult, UseFeeClaimSwapVars>): SafeUseMutationResult<IntentAutoSwapResult, Error, UseFeeClaimSwapVars>;
1094
1549
 
1550
+ type UsePartnerCancelIntentVars = Omit<PartnerFeeClaimCancelAction<HubChainKey, false>, 'raw'>;
1551
+ /**
1552
+ * React hook to cancel a stuck partner fee-claim auto-swap intent and recover the locked tokens.
1553
+ *
1554
+ * Calls `ProtocolIntents.cancelIntent(fromToken, toToken)` — the only authorized cancel path for
1555
+ * partner auto-swap intents (the generic swap-cancel reverts because ProtocolIntents, not the
1556
+ * partner, is the intent creator). The contract cancels the intent and refunds the input amount to
1557
+ * the partner. Use this to recover funds from an unfillable same-token claim.
1558
+ *
1559
+ * Throws on SDK failure so React Query's native error model engages. Returns the transaction hash.
1560
+ */
1561
+ declare function usePartnerCancelIntent({ mutationOptions, }?: MutationHookParams<TxReturnType<HubChainKey, false>, UsePartnerCancelIntentVars>): SafeUseMutationResult<TxReturnType<HubChainKey, false>, Error, UsePartnerCancelIntentVars>;
1562
+
1563
+ type UseGetUserIntentParams = ReadHookParams<Hex, Partial<GetUserIntentParams>>;
1564
+ /**
1565
+ * React hook to look up the stored intent hash for a partner's `(user, fromToken, toToken)` pair.
1566
+ *
1567
+ * A non-zero hash means an open auto-swap intent exists for that token pair (e.g. an unfilled
1568
+ * same-token claim) and can be recovered via {@link usePartnerCancelIntent}. Disabled until all
1569
+ * three inputs are present. Throws on `!ok`.
1570
+ */
1571
+ declare function useGetUserIntent({ params, queryOptions }?: UseGetUserIntentParams): UseQueryResult<Hex, Error>;
1572
+
1573
+ type UseGetIntentDetailsParams = ReadHookParams<Intent, {
1574
+ intentHash: Hex | undefined;
1575
+ }>;
1576
+ /**
1577
+ * React hook to fetch the full {@link Intent} details for a ProtocolIntents intent hash.
1578
+ *
1579
+ * Pair with {@link useGetUserIntent} to display a stuck intent (e.g. its locked `inputAmount`)
1580
+ * before recovering it. Disabled when the hash is missing or the zero hash (no intent). Throws
1581
+ * on `!ok`.
1582
+ */
1583
+ declare function useGetIntentDetails({ params, queryOptions, }?: UseGetIntentDetailsParams): UseQueryResult<Intent, Error>;
1584
+
1585
+ /**
1586
+ * Mutation variables for {@link useFeeClaimWithdraw}. Maps a partner fee balance to a
1587
+ * Sonic-sourced bridge: `feeToken` is the wrapped hub-asset address on Sonic
1588
+ * (`PartnerFeeClaimAssetBalance.address`); `dstToken` is the original token address on
1589
+ * `dstChainKey` (`PartnerFeeClaimAssetBalance.originalAddress`, or `feeToken` for same-chain
1590
+ * delivery to a Sonic address).
1591
+ */
1592
+ type UseFeeClaimWithdrawVars = {
1593
+ params: {
1594
+ srcAddress: string;
1595
+ feeToken: Address$1;
1596
+ amount: bigint;
1597
+ dstChainKey: SpokeChainKey;
1598
+ dstToken: string;
1599
+ recipient: string;
1600
+ };
1601
+ walletProvider: GetWalletProviderType<HubChainKey>;
1602
+ };
1603
+ /**
1604
+ * React hook to withdraw a partner fee token directly to the partner's wallet **without a swap**.
1605
+ *
1606
+ * For fees the partner wants to keep as-is (the desired output equals the fee token, e.g. BTC→BTC),
1607
+ * an auto-swap is impossible — the solver rejects a same-token swap. This bridges the wrapped fee
1608
+ * token from Sonic to its native chain (or transfers it on Sonic when `dstChainKey` is Sonic),
1609
+ * bypassing the solver entirely.
1610
+ *
1611
+ * Bridging from Sonic pulls the token via the partner's hub-wallet router, which requires a prior
1612
+ * allowance to that spender — a different approval than the ProtocolIntents one used by the swap
1613
+ * claim. Use `useBridgeAllowance` / `useBridgeApprove` (with the same mapped bridge params) first.
1614
+ *
1615
+ * Throws on SDK failure so React Query's native error model engages. Returns the `TxHashPair`.
1616
+ */
1617
+ declare function useFeeClaimWithdraw({ mutationOptions, }?: MutationHookParams<TxHashPair, UseFeeClaimWithdrawVars>): SafeUseMutationResult<TxHashPair, Error, UseFeeClaimWithdrawVars>;
1618
+
1095
1619
  type UseHubAssetBalancesParams = ReadHookParams<HubAssetBalance[], {
1096
1620
  chainKey: SpokeChainKey | undefined;
1097
1621
  /** The user's address on the spoke chain. The SDK derives the hub wallet abstraction internally. */
@@ -1475,6 +1999,188 @@ type UseClaimRewardsVars<K extends SpokeChainKey = SpokeChainKey> = Omit<ClLiqui
1475
1999
  */
1476
2000
  declare function useClaimRewards<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<TxHashPair, UseClaimRewardsVars<K>>): SafeUseMutationResult<TxHashPair, Error, UseClaimRewardsVars<K>>;
1477
2001
 
2002
+ type UseLeverageYieldEffectiveAprParams = ReadHookParams<LeverageYieldEffectiveApr, {
2003
+ vault: Address$1 | undefined;
2004
+ }>;
2005
+ /**
2006
+ * Reads a leverage-yield vault's effective APR — AAVE supply/borrow rates plus the LSD
2007
+ * staking yield, with the vault's leverage formula re-applied on the boosted supply side.
2008
+ *
2009
+ * The underlying SDK call does the on-chain reads (AAVE rates + `targetLTV`) and the
2010
+ * off-chain LSD fetch in parallel. Rates drift slowly, so the default refresh is 60s.
2011
+ *
2012
+ * @example
2013
+ * ```typescript
2014
+ * const { data: apr } = useLeverageYieldEffectiveApr({ params: { vault: vault.vault } });
2015
+ * ```
2016
+ */
2017
+ declare function useLeverageYieldEffectiveApr({ params, queryOptions, }?: UseLeverageYieldEffectiveAprParams): UseQueryResult<LeverageYieldEffectiveApr, Error>;
2018
+
2019
+ type UseLeverageYieldPositionParams = ReadHookParams<LeverageYieldPosition, {
2020
+ vault: Address$1 | undefined;
2021
+ }>;
2022
+ /**
2023
+ * Reads a leverage-yield vault's live position snapshot via the vault's `getPositionDetails`:
2024
+ * collateral, debt, current LTV (drift vs `targetLTV`), health factor (∞ when no debt), and
2025
+ * idle (not-yet-deployed) asset.
2026
+ *
2027
+ * LTV shifts with each rebalance/rate tick, so the default refresh (30s) is faster than the
2028
+ * APR/stats reads.
2029
+ *
2030
+ * @example
2031
+ * ```typescript
2032
+ * const { data: position } = useLeverageYieldPosition({ params: { vault: vault.vault } });
2033
+ * ```
2034
+ */
2035
+ declare function useLeverageYieldPosition({ params, queryOptions, }?: UseLeverageYieldPositionParams): UseQueryResult<LeverageYieldPosition, Error>;
2036
+
2037
+ type UseLeverageYieldTotalAssetsParams = ReadHookParams<bigint, {
2038
+ vault: Address$1 | undefined;
2039
+ }>;
2040
+ /**
2041
+ * Reads a leverage-yield vault's total underlying assets (vault-asset units, 18 decimals) —
2042
+ * i.e. its TVL. Moves slowly, so the default refresh is 60s.
2043
+ *
2044
+ * @example
2045
+ * ```typescript
2046
+ * const { data: tvl } = useLeverageYieldTotalAssets({ params: { vault: vault.vault } });
2047
+ * ```
2048
+ */
2049
+ declare function useLeverageYieldTotalAssets({ params, queryOptions, }?: UseLeverageYieldTotalAssetsParams): UseQueryResult<bigint, Error>;
2050
+
2051
+ type UseLeverageYieldPreviewRedeemParams = ReadHookParams<bigint, {
2052
+ vault: Address$1 | undefined;
2053
+ shares: bigint | undefined;
2054
+ }>;
2055
+ /**
2056
+ * Reads the assets received for redeeming `shares` of a leverage-yield vault (ERC-4626
2057
+ * `previewRedeem`). Passing `10n ** 18n` (one share) yields the per-share price that creeps
2058
+ * up as the vault accrues interest. Moves slowly, so the default refresh is 60s.
2059
+ *
2060
+ * @example
2061
+ * ```typescript
2062
+ * const { data: sharePrice } = useLeverageYieldPreviewRedeem({
2063
+ * params: { vault: vault.vault, shares: 10n ** 18n },
2064
+ * });
2065
+ * ```
2066
+ */
2067
+ declare function useLeverageYieldPreviewRedeem({ params, queryOptions, }?: UseLeverageYieldPreviewRedeemParams): UseQueryResult<bigint, Error>;
2068
+
2069
+ /** A single `(chain, hub-wallet holder, share balance)` row produced by {@link useLeverageYieldShareBalances}. */
2070
+ type LeverageYieldShareHolding = {
2071
+ chainKey: SpokeChainKey;
2072
+ holder: Address$1;
2073
+ shares: bigint;
2074
+ };
2075
+ /** A `(chainKey, EOA address)` pair the user controls — one per spoke chain they may hold shares under. */
2076
+ type LeverageYieldShareHolder = {
2077
+ chainKey: SpokeChainKey;
2078
+ address: string;
2079
+ };
2080
+ type UseLeverageYieldShareBalancesParams = ReadHookParams<LeverageYieldShareHolding, {
2081
+ vault: Address$1 | undefined;
2082
+ holders: readonly LeverageYieldShareHolder[] | undefined;
2083
+ }>;
2084
+ /**
2085
+ * Reads a user's leverage-vault share (`lsoda*`) balances across every chain they may hold a
2086
+ * position under — one query per holder, fanned out via `useQueries`.
2087
+ *
2088
+ * For each `(chainKey, address)` the holder is resolved to the address that actually owns the
2089
+ * shares: the user's **derived hub wallet** on every chain, including the hub itself. Leverage
2090
+ * deposits always deliver `lsoda*` to `getUserHubWalletAddress(srcAddress, srcChainKey)` (the
2091
+ * CREATE3 user-router on Sonic for a hub-sourced deposit, the per-spoke hub wallet otherwise) —
2092
+ * never the bare EOA — so a hub-chain deposit's shares live in the router, not the signing EOA.
2093
+ * Resolving the holder the same way the deposit does is what makes a Sonic-sourced position show
2094
+ * up here instead of reading a stale zero off the EOA.
2095
+ *
2096
+ * Returns the raw `useQueries` result array (15s refresh per query); callers aggregate as needed
2097
+ * (e.g. sum `shares` for a headline total, or pick the row for the active chain).
2098
+ *
2099
+ * `useQueries` has no top-level options slot, so `queryOptions` is spread into every individual
2100
+ * query config (and applies uniformly to each holder's query).
2101
+ *
2102
+ * @example
2103
+ * ```typescript
2104
+ * const balances = useLeverageYieldShareBalances({ params: { vault: vault.vault, holders } });
2105
+ * const total = balances.reduce((acc, q) => acc + (q.data?.shares ?? 0n), 0n);
2106
+ * ```
2107
+ */
2108
+ declare function useLeverageYieldShareBalances({ params, queryOptions, }?: UseLeverageYieldShareBalancesParams): UseQueryResult<LeverageYieldShareHolding, Error>[];
2109
+
2110
+ /** Mutation variables for {@link useLeverageYieldDeposit} — the swap-style deposit inputs. */
2111
+ type UseLeverageYieldDepositVars = LeverageYieldSwapDepositParams;
2112
+ /**
2113
+ * Builds the `LeverageYieldSwapPayload` for a leverage-yield deposit (any token → `lsoda*` shares,
2114
+ * delivered to the user's hub wallet). Spread the returned payload into
2115
+ * {@link useLeverageYieldVaultSwap}.
2116
+ *
2117
+ * This is a builder, not an executor — it derives the hub wallet and assembles the intent; the
2118
+ * actual swap is relayed by `useLeverageYieldVaultSwap`. Throws on SDK failure so React Query's
2119
+ * error model engages; returns the unwrapped `LeverageYieldSwapPayload` on success.
2120
+ *
2121
+ * @example
2122
+ * ```typescript
2123
+ * const { mutateAsyncSafe: buildDeposit } = useLeverageYieldDeposit();
2124
+ * const built = await buildDeposit({ vault, srcChainKey, srcAddress, inputToken, inputAmount, minOutputAmount });
2125
+ * if (built.ok) vaultSwap({ ...built.value, walletProvider });
2126
+ * ```
2127
+ */
2128
+ declare function useLeverageYieldDeposit({ mutationOptions, }?: MutationHookParams<LeverageYieldSwapPayload, UseLeverageYieldDepositVars>): SafeUseMutationResult<LeverageYieldSwapPayload, Error, UseLeverageYieldDepositVars>;
2129
+
2130
+ /** Mutation variables for {@link useLeverageYieldNotifySolver} — the hub-side intent tx hash. */
2131
+ type UseLeverageYieldNotifySolverVars = SolverExecutionRequest;
2132
+ /**
2133
+ * Notifies the solver that a leverage-yield vault intent landed on the hub, triggering the fill.
2134
+ * The standalone notify step for the manual create → relay → notify flow: build the intent with
2135
+ * `sodax.leverageYield.createVaultIntent`, relay it yourself, then call this with the hub-side
2136
+ * intent tx hash. The end-to-end {@link useLeverageYieldVaultSwap} already calls notifySolver
2137
+ * internally — only reach for this hook when driving the relay manually.
2138
+ *
2139
+ * Throws on SDK failure so React Query's error model engages; returns the unwrapped
2140
+ * `SolverExecutionResponse` (`{ answer: 'OK', intent_hash }`) on success.
2141
+ */
2142
+ declare function useLeverageYieldNotifySolver({ mutationOptions, }?: MutationHookParams<SolverExecutionResponse, UseLeverageYieldNotifySolverVars>): SafeUseMutationResult<SolverExecutionResponse, Error, UseLeverageYieldNotifySolverVars>;
2143
+
2144
+ /**
2145
+ * Mutation variables for {@link useLeverageYieldVaultSwap}. Generic over `K extends SpokeChainKey`
2146
+ * (defaults to the full union). Sophisticated callers can lock K at the hook call site to narrow
2147
+ * the `walletProvider` and `params.srcChainKey` types.
2148
+ */
2149
+ type UseLeverageYieldVaultSwapVars<K extends SpokeChainKey = SpokeChainKey> = Omit<VaultSwapActionParams<K, false>, 'raw'>;
2150
+ /**
2151
+ * React hook for executing an end-to-end leverage-yield vault swap (deposit or withdraw).
2152
+ *
2153
+ * Spread a `LeverageYieldSwapPayload` built by {@link useLeverageYieldDeposit} /
2154
+ * {@link useLeverageYieldWithdraw} into `mutate` alongside the wallet provider:
2155
+ * `vaultSwap({ ...payload, walletProvider })`. Runs `sodax.leverageYield.vaultSwap` —
2156
+ * create intent → verify → relay → notify solver — so vault flows never touch the
2157
+ * generic swap surface.
2158
+ *
2159
+ * Throws on SDK failure so React Query's native error model engages (`isError`, `error`,
2160
+ * `onError`, `retry`). Returns the unwrapped `VaultSwapResponse` on success.
2161
+ */
2162
+ declare function useLeverageYieldVaultSwap<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<VaultSwapResponse, UseLeverageYieldVaultSwapVars<K>>): SafeUseMutationResult<VaultSwapResponse, Error, UseLeverageYieldVaultSwapVars<K>>;
2163
+
2164
+ /** Mutation variables for {@link useLeverageYieldWithdraw} — the swap-style withdraw inputs. */
2165
+ type UseLeverageYieldWithdrawVars = LeverageYieldSwapWithdrawParams;
2166
+ /**
2167
+ * Builds the `LeverageYieldSwapPayload` for a leverage-yield withdraw (`lsoda*` shares → any token).
2168
+ * The returned payload carries `hubWalletSwap: true`; spread it into
2169
+ * {@link useLeverageYieldVaultSwap}, which authorises the hub wallet to spend the shares via a
2170
+ * `Connection.sendMessage`.
2171
+ *
2172
+ * This is a builder, not an executor. Throws on SDK failure so React Query's error model engages;
2173
+ * returns the unwrapped `LeverageYieldSwapPayload` on success.
2174
+ *
2175
+ * @example
2176
+ * ```typescript
2177
+ * const { mutateAsyncSafe: buildWithdraw } = useLeverageYieldWithdraw();
2178
+ * const built = await buildWithdraw({ vault, srcChainKey, srcAddress, dstChainKey, outputToken, inputAmount, minOutputAmount });
2179
+ * if (built.ok) vaultSwap({ ...built.value, walletProvider });
2180
+ * ```
2181
+ */
2182
+ declare function useLeverageYieldWithdraw({ mutationOptions, }?: MutationHookParams<LeverageYieldSwapPayload, UseLeverageYieldWithdrawVars>): SafeUseMutationResult<LeverageYieldSwapPayload, Error, UseLeverageYieldWithdrawVars>;
2183
+
1478
2184
  interface SodaxProviderProps {
1479
2185
  children: ReactNode;
1480
2186
  /**
@@ -1489,7 +2195,7 @@ interface SodaxProviderProps {
1489
2195
  * <SodaxProvider config={config}>...</SodaxProvider>
1490
2196
  * ```
1491
2197
  */
1492
- config?: DeepPartial<SodaxConfig>;
2198
+ config?: SodaxOptions;
1493
2199
  }
1494
2200
  /** Root provider for `@sodax/dapp-kit`. Must be paired with `QueryClientProvider`. */
1495
2201
  declare const SodaxProvider: ({ children, config }: SodaxProviderProps) => ReactElement;
@@ -1554,4 +2260,30 @@ type CreateSodaxQueryClientOptions = {
1554
2260
  */
1555
2261
  declare function createSodaxQueryClient({ onMutationError, config, }?: CreateSodaxQueryClientOptions): QueryClient;
1556
2262
 
1557
- export { type ATokenData, type BackendPaginationParams, type CreateSodaxQueryClientOptions, type DecreaseLiquidityParamsCore, type DepositParamsCore, type MutationHookOptions, type MutationHookParams, type RadfiSession, type ReadHookParams, type ReadQueryOptions, type ReserveUsdFormat, type SafeUseMutationResult, SodaxProvider, type UseATokenParams, type UseATokensBalancesParams, type UseApproveTokenVars, type UseBitcoinBalanceParams, type UseBorrowVars, type UseBridgeAllowanceParams, type UseBridgeApproveVars, type UseBridgeVars, type UseClaimRewardsVars, type UseCreateDecreaseLiquidityParamsProps, type UseCreateDepositParamsProps, type UseCreateLimitOrderVars, type UseCreateSupplyLiquidityParamsProps, type UseCreateSupplyLiquidityParamsResult, type UseCreateWithdrawParamsProps, type UseDecreaseLiquidityVars, type UseDeriveUserWalletAddressParams, type UseDexAllowanceParams, type UseDexApproveVars, type UseDexDepositVars, type UseDexWithdrawVars, type UseExpiredUtxosParams, type UseFeeClaimSwapVars, type UseFetchAssetsBalancesParams, type UseFundTradingWalletVars, type UseGetAutoSwapPreferencesParams, type UseGetBridgeableAmountParams, type UseGetBridgeableTokensParams, type UseGetUserHubWalletAddressParams, type UseHubAssetBalancesParams, type UseIsTokenApprovedParams, type UseLiquidityAmountsResult, type UseMMAllowanceParams, type UseMMApproveVars, type UseMigrateBalnVars, type UseMigrateIcxToSodaVars, type UseMigratebnUSDVars, type UseMigrationAllowanceInputs, type UseMigrationAllowanceParams, type UseMigrationApproveVars, type UsePoolBalancesParams, type UsePoolBalancesResponse, type UsePoolDataParams, type UsePoolsParams, type UsePositionInfoParams, type UsePositionInfoResponse, type UseQuoteParams, type UseRadfiAuthVars, type UseRadfiSessionReturn, type UseRadfiWithdrawVars, type UseRenewUtxosVars, type UseRepayVars, type UseReservesDataParams, type UseReservesHumanizedParams, type UseReservesListParams, type UseReservesUsdFormatParams, type UseRevertMigrateSodaToIcxVars, type UseSetSwapPreferenceVars, type UseSetSwapPreferenceVarsHub, type UseStatusParams, type UseStellarTrustlineCheckParams, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApproveVars, type UseSwapVars, type UseTradingWalletBalanceParams, type UseUserFormattedSummaryParams, type UseUserReservesDataParams, type UseWithdrawHubAssetVars, type UseWithdrawVars, type UseXBalancesParams, type WithdrawParamsCore, type XBalancesInputs, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getXBalancesQueryOptions, loadRadfiSession, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendSubmitSwapTx, useBackendSubmitSwapTxStatus, useBackendUserIntents, useBitcoinBalance, useBorrow, useBridge, useBridgeAllowance, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetUserHubWalletAddress, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useSafeMutation, useSetSwapPreference, useSodaxContext, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useTradingWallet, useTradingWalletBalance, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserFormattedSummary, useUserReservesData, useWithdraw, useWithdrawHubAsset, useXBalances };
2263
+ /** The subset of a `useNearStorageCheck` result the gate reads. A full `UseQueryResult<boolean>` satisfies it. */
2264
+ type NearStorageCheckResult = Pick<UseQueryResult<boolean>, 'isLoading' | 'data'>;
2265
+ /** UI gate state for NEP-141 storage registration on NEAR. */
2266
+ interface NearStorageGateState {
2267
+ /** Destination is NEAR — the only chain with a NEP-141 storage-registration prerequisite. */
2268
+ isNear: boolean;
2269
+ /** Show the "register storage" action: the check resolved and the recipient is not registered. */
2270
+ needsRegistration: boolean;
2271
+ /**
2272
+ * Keep the downstream action (swap/bridge/borrow/withdraw) disabled: the NEAR gate is unresolved
2273
+ * (still checking) or unmet (needs registration).
2274
+ */
2275
+ blocksAction: boolean;
2276
+ }
2277
+ /**
2278
+ * Derives the NEP-141 storage-registration UI gate state for a flow that delivers a token to a user
2279
+ * on NEAR — NEAR's analogue of the Stellar trustline gate. Unwrapped (no hook): pass the destination
2280
+ * `chainKey` and the `useNearStorageCheck` result; the util owns the `=== NEAR` test and reads
2281
+ * `isLoading` (NOT `isPending`, which stays `true` for a disabled query and would block forever).
2282
+ *
2283
+ * `blocksAction` deliberately also covers the in-flight check window so the action can't be
2284
+ * triggered before registration status is known; `needsRegistration` only flips once the check has
2285
+ * resolved (so the "register" button isn't shown speculatively while still checking).
2286
+ */
2287
+ declare function resolveNearStorageGate(chainKey: SpokeChainKey, check: NearStorageCheckResult): NearStorageGateState;
2288
+
2289
+ export { type ATokenData, type BackendPaginationParams, type BitcoinTradingSetup, type CreateSodaxQueryClientOptions, type DecreaseLiquidityParamsCore, type DepositParamsCore, type LeverageYieldShareHolder, type LeverageYieldShareHolding, type MutationHookOptions, type MutationHookParams, type NearStorageCheckResult, type NearStorageGateState, type RadfiSession, type ReadHookParams, type ReadQueryOptions, type ReserveUsdFormat, type SafeUseMutationResult, SodaxProvider, type UseATokenParams, type UseATokensBalancesParams, type UseApproveTokenVars, type UseBitcoinBalanceParams, type UseBitcoinTradingSetupParams, type UseBorrowVars, type UseBridgeAllowanceParams, type UseBridgeApproveVars, type UseBridgeVars, type UseClaimRewardsVars, type UseCreateDecreaseLiquidityParamsProps, type UseCreateDepositParamsProps, type UseCreateLimitOrderVars, type UseCreateSupplyLiquidityParamsProps, type UseCreateSupplyLiquidityParamsResult, type UseCreateWithdrawParamsProps, type UseDecreaseLiquidityVars, type UseDeriveUserWalletAddressParams, type UseDexAllowanceParams, type UseDexApproveVars, type UseDexDepositVars, type UseDexWithdrawVars, type UseEnsureRadfiAccessTokenVars, type UseExpiredUtxosParams, type UseFeeClaimSwapVars, type UseFeeClaimWithdrawVars, type UseFetchAssetsBalancesParams, type UseFundTradingWalletVars, type UseGetAutoSwapPreferencesParams, type UseGetBridgeableAmountParams, type UseGetBridgeableTokensParams, type UseGetIntentDetailsParams, type UseGetUserHubWalletAddressParams, type UseGetUserIntentParams, type UseHubAssetBalancesParams, type UseIsTokenApprovedParams, type UseLeverageYieldDepositVars, type UseLeverageYieldEffectiveAprParams, type UseLeverageYieldNotifySolverVars, type UseLeverageYieldPositionParams, type UseLeverageYieldPreviewRedeemParams, type UseLeverageYieldShareBalancesParams, type UseLeverageYieldTotalAssetsParams, type UseLeverageYieldVaultSwapVars, type UseLeverageYieldWithdrawVars, type UseLiquidityAmountsResult, type UseMMAllowanceParams, type UseMMApproveVars, type UseMigrateBalnVars, type UseMigrateIcxToSodaVars, type UseMigratebnUSDVars, type UseMigrationAllowanceInputs, type UseMigrationAllowanceParams, type UseMigrationApproveVars, type UseNearStorageCheckParams, type UsePartnerCancelIntentVars, type UsePoolBalancesParams, type UsePoolBalancesResponse, type UsePoolDataParams, type UsePoolsParams, type UsePositionInfoParams, type UsePositionInfoResponse, type UseQuoteParams, type UseRadfiAuthVars, type UseRadfiSessionReturn, type UseRadfiWithdrawVars, type UseRegisterNearStorageVars, type UseRenewUtxosVars, type UseRepayVars, type UseReservesDataParams, type UseReservesHumanizedParams, type UseReservesListParams, type UseReservesUsdFormatParams, type UseRevertMigrateSodaToIcxVars, type UseSetSwapPreferenceVars, type UseSetSwapPreferenceVarsHub, type UseStatusParams, type UseStellarTrustlineCheckParams, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApproveVars, type UseSwapVars, type UseSwapsApiAllowanceParams, type UseSwapsApiApproveVars, type UseSwapsApiCancelIntentVars, type UseSwapsApiCreateIntentVars, type UseSwapsApiCreateLimitOrderVars, type UseSwapsApiDeadlineParams, type UseSwapsApiEstimateGasParams, type UseSwapsApiFilledIntentParams, type UseSwapsApiIntentExtraDataParams, type UseSwapsApiIntentHashParams, type UseSwapsApiIntentPacketParams, type UseSwapsApiIntentParams, type UseSwapsApiPartnerFeeParams, type UseSwapsApiQuoteParams, type UseSwapsApiSolverFeeParams, type UseSwapsApiStatusParams, type UseSwapsApiSubmitIntentVars, type UseSwapsApiSubmitTxStatusParams, type UseSwapsApiSubmitTxVars, type UseSwapsApiTokensByChainParams, type UseSwapsApiTokensParams, type UseTradingWalletBalanceParams, type UseUserFormattedSummaryParams, type UseUserReservesDataParams, type UseWithdrawHubAssetVars, type UseWithdrawVars, type UseXBalancesParams, type WithdrawParamsCore, type XBalancesInputs, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getStellarTrustlineCheckQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldShareBalances, useLeverageYieldTotalAssets, useLeverageYieldVaultSwap, useLeverageYieldWithdraw, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, useNearStorageCheck, useNearStorageGate, usePartnerCancelIntent, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRegisterNearStorage, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useSafeMutation, useSetSwapPreference, useSodaxContext, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiCancelIntent, useSwapsApiCreateIntent, useSwapsApiCreateLimitOrder, useSwapsApiDeadline, useSwapsApiEstimateGas, useSwapsApiFilledIntent, useSwapsApiIntent, useSwapsApiIntentExtraData, useSwapsApiIntentHash, useSwapsApiIntentPacket, useSwapsApiPartnerFee, useSwapsApiQuote, useSwapsApiSolverFee, useSwapsApiStatus, useSwapsApiSubmitIntent, useSwapsApiSubmitTx, useSwapsApiSubmitTxStatus, useSwapsApiTokens, useSwapsApiTokensByChain, useTradingWallet, useTradingWalletBalance, useUnstake, useUnstakeAllowance, useUnstakeApprove, useUnstakingInfo, useUnstakingInfoWithPenalty, useUserFormattedSummary, useUserReservesData, useWithdraw, useWithdrawHubAsset, useXBalances };