@sodax/dapp-kit 2.3.0 → 2.4.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -2
- package/dist/index.d.ts +182 -31
- package/dist/index.mjs +297 -25
- package/package.json +10 -5
- package/src/hooks/_mutationContract.test.ts +1 -0
- package/src/hooks/bridge/getBridgeDetailedStatusRefetchInterval.test.ts +28 -3
- package/src/hooks/bridge/getBridgeDetailedStatusRefetchInterval.ts +17 -8
- package/src/hooks/bridge/useBridge.ts +6 -0
- package/src/hooks/bridge/useBridgeDetailedStatus.test.ts +56 -1
- package/src/hooks/bridge/useBridgeDetailedStatus.ts +26 -9
- package/src/hooks/bridge/useBridgeWithApproval.test.ts +24 -1
- package/src/hooks/bridge/useBridgeWithApproval.ts +6 -0
- package/src/hooks/dex/useDexDeposit.ts +6 -0
- package/src/hooks/dex/useDexWithdraw.ts +12 -5
- package/src/hooks/mm/useBorrow.ts +15 -4
- package/src/hooks/mm/useRepay.ts +6 -0
- package/src/hooks/mm/useSupply.ts +6 -0
- package/src/hooks/mm/useWithdraw.ts +12 -5
- package/src/hooks/recovery/useWithdrawHubAsset.ts +12 -5
- package/src/hooks/shared/index.ts +4 -0
- package/src/hooks/shared/notFoundStreak.ts +5 -0
- package/src/hooks/shared/retryBeforeSubmission.ts +26 -0
- package/src/hooks/shared/useBalances.test.ts +10 -0
- package/src/hooks/shared/useBalances.ts +17 -4
- package/src/hooks/shared/useEstablishXrpTrustline.test.ts +113 -0
- package/src/hooks/shared/useEstablishXrpTrustline.ts +65 -0
- package/src/hooks/shared/useSafeMutation.retry.test.ts +47 -0
- package/src/hooks/shared/useSafeMutation.ts +8 -1
- package/src/hooks/shared/useXrpDestinationCheck.ts +75 -0
- package/src/hooks/shared/useXrpGate.test.ts +118 -0
- package/src/hooks/shared/useXrpGate.ts +81 -0
- package/src/hooks/shared/useXrpTrustlineReserveCheck.ts +45 -0
- package/src/hooks/swap/useCreateLimitOrder.ts +8 -0
- package/src/hooks/swap/useSwap.ts +6 -0
- package/src/hooks/swap/useSwapLifecycle.test.ts +73 -1
- package/src/hooks/swap/useSwapLifecycle.ts +29 -5
- package/src/hooks/swap/useSwapWithApproval.test.ts +24 -1
- package/src/hooks/swap/useSwapWithApproval.ts +6 -0
- package/src/utils/index.ts +1 -0
- package/src/utils/swapLifecycle.test.ts +35 -0
- package/src/utils/swapLifecycle.ts +29 -5
- package/src/utils/xrpGate.test.ts +112 -0
- package/src/utils/xrpGate.ts +72 -0
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ High-level React hooks library for dApp developers. Wraps `@sodax/sdk` with Reac
|
|
|
15
15
|
- **Partner** — `useFetchAssetsBalances`, `useGetAutoSwapPreferences`, `useIsTokenApproved`, `useApproveToken`, `useSetSwapPreference`, `useFeeClaimSwap`, `useFeeClaimWithdraw`, `usePartnerCancelIntent`, `useGetUserIntent`, `useGetIntentDetails`
|
|
16
16
|
- **Recovery** — `useHubAssetBalances`, `useWithdrawHubAsset`
|
|
17
17
|
- **Backend Queries** — Intent tracking, swap-tx submission + status, orderbook, money market position queries
|
|
18
|
-
- **Shared** — `useBalances`, `useXBalances`, `useDeriveUserWalletAddress`, `useGetUserHubWalletAddress`, `useStellarTrustlineCheck`, `useEstablishTrustline`, `useStellarGate`, `useNearStorageCheck`, `useRegisterNearStorage`, `useNearStorageGate`, `useEstimateGas`
|
|
18
|
+
- **Shared** — `useBalances`, `useXBalances`, `useDeriveUserWalletAddress`, `useGetUserHubWalletAddress`, `useStellarTrustlineCheck`, `useEstablishTrustline`, `useStellarGate`, `useNearStorageCheck`, `useRegisterNearStorage`, `useNearStorageGate`, `useXrpDestinationCheck`, `useXrpTrustlineReserveCheck`, `useEstablishXrpTrustline`, `useXrpGate`, `useEstimateGas`
|
|
19
19
|
- **Sponsoring** — `useStellarAccountActive`, `useStellarAccountStatus`, `useSponsorConfig`, `useActivateStellarAccount`
|
|
20
20
|
|
|
21
21
|
## Installation
|
|
@@ -140,7 +140,7 @@ function SwapButton({ intentParams }: { intentParams: CreateIntentParams }) {
|
|
|
140
140
|
- [`useSwap()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwap.ts) — Submit a cross-chain swap intent
|
|
141
141
|
- [`useSwapAllowance()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapAllowance.ts) — Check token approval
|
|
142
142
|
- [`useSwapApprove()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapApprove.ts) — Approve token spending
|
|
143
|
-
- [`useSwapLifecycle()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapLifecycle.ts) — A whole swap form as one discriminated `state` and one `next()` action: approval strategy, Stellar/NEAR destination gates, source-chain switch (passed in), the swap and its status. A swap that fails after broadcast stays `pending` with its `error`; a batch that was sent but not confirmed is `unconfirmed`, and `next()` waits for it again (never re-sends it) and finishes the swap once it lands. The hooks it composes are returned as escape hatches
|
|
143
|
+
- [`useSwapLifecycle()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapLifecycle.ts) — A whole swap form as one discriminated `state` and one `next()` action: approval strategy, Stellar/NEAR/XRPL destination gates, source-chain switch (passed in), the swap and its status. A swap that fails after broadcast stays `pending` with its `error`; a batch that was sent but not confirmed is `unconfirmed`, and `next()` waits for it again (never re-sends it) and finishes the swap once it lands. The hooks it composes are returned as escape hatches
|
|
144
144
|
- [`useSwapWithApproval()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapWithApproval.ts) — `useSwap` with the approval folded in: approve + swap as one EIP-5792 batch (one signature) on a wallet that can batch, otherwise approve then swap. `allowAccountUpgrade: false` skips the smart-account upgrade prompt a `'ready'` wallet would show and approves separately
|
|
145
145
|
- [`useSwapApprovalStrategy()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useSwapApprovalStrategy.ts) — Which path `useSwapWithApproval` will take (`'not-required'` / `'atomic-batch'` / `'sequential'`), to label the button
|
|
146
146
|
- [`useDetailedStatus()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/swap/useDetailedStatus.ts) — Poll a swap's status from its **source** tx (`{ srcChainKey, srcTxHash }`), whichever completion path ran — the default status read. Collapse `data.value` with `summarizeSwapStatus` from `@sodax/sdk`
|
|
@@ -311,6 +311,10 @@ expires unfilled, so those go through `useSubmitLeveragePositionIntent()`, which
|
|
|
311
311
|
- [`useEstablishTrustline()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useEstablishTrustline.ts) — Request Stellar trustline
|
|
312
312
|
- [`useRequestTrustline()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useRequestTrustline.ts) — **Deprecated**, use `useEstablishTrustline()`
|
|
313
313
|
- [`useStellarGate()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useStellarGate.ts) — Sequences the Stellar destination prerequisites (activation → funding → trustline)
|
|
314
|
+
- [`useXrpDestinationCheck()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useXrpDestinationCheck.ts) — Whether an XRPL account can receive an amount of a token, and why not
|
|
315
|
+
- [`useXrpTrustlineReserveCheck()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useXrpTrustlineReserveCheck.ts) — Whether an XRPL account holds the spendable XRP to set a trustline
|
|
316
|
+
- [`useEstablishXrpTrustline()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useEstablishXrpTrustline.ts) — Create an XRPL trustline, or raise its limit, with one TrustSet
|
|
317
|
+
- [`useXrpGate()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useXrpGate.ts) — Sequences the XRPL issued-token destination prerequisites (trustline → funding), with `blockedReason` for refusals no trustline fixes
|
|
314
318
|
- [`useNearStorageCheck()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useNearStorageCheck.ts) — Check NEP-141 storage registration for a token on NEAR (NEAR's analogue of a Stellar trustline)
|
|
315
319
|
- [`useRegisterNearStorage()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useRegisterNearStorage.ts) — Submit a NEP-141 `storage_deposit` so a NEAR account can receive a token
|
|
316
320
|
- [`useNearStorageGate()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/hooks/shared/useNearStorageGate.ts) — Derive the NEP-141 storage-registration UI gate state for a NEAR delivery
|
|
@@ -380,6 +384,10 @@ DEX param builders:
|
|
|
380
384
|
- [`createSupplyLiquidityParamsProps()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/utils/dex-utils.ts) — Build concentrated liquidity supply params
|
|
381
385
|
- [`createDecreaseLiquidityParamsProps()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/utils/dex-utils.ts) — Build decrease liquidity params
|
|
382
386
|
|
|
387
|
+
XRPL trustline gate:
|
|
388
|
+
|
|
389
|
+
- [`resolveXrpGate()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/utils/xrpGate.ts) — Derive the XRPL issued-token destination gate state (hook-free counterpart of `useXrpGate`)
|
|
390
|
+
|
|
383
391
|
NEAR storage gate:
|
|
384
392
|
|
|
385
393
|
- [`resolveNearStorageGate()`](https://github.com/gosodax/sodax-sdks/blob/main/packages/dapp-kit/src/utils/nearStorageGate.ts) — Derive the NEP-141 storage-registration UI gate state (hook-free counterpart of `useNearStorageGate`)
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UseMutationOptions, UseQueryOptions, UseMutationResult, MutateOptions, UseQueryResult, QueryClient, QueryClientConfig } from '@tanstack/react-query';
|
|
2
2
|
import * as _sodax_sdk from '@sodax/sdk';
|
|
3
|
-
import { Result, Sodax, SpokeChainKey, GetEstimateGasReturnType, EstimateGasParams, StellarChainKey, IStellarWalletProvider, INearWalletProvider, GetWalletProviderType, StellarAccountStatus, ActivateStellarAccountResult, IXServiceBase, XToken, EvmHubProvider, IBitcoinWalletProvider, RadfiWalletBalance, IWalletProvider, RadfiUtxo, MoneyMarketBorrowActionParams,
|
|
3
|
+
import { Result, Sodax, SpokeChainKey, GetEstimateGasReturnType, EstimateGasParams, StellarChainKey, IStellarWalletProvider, INearWalletProvider, GetWalletProviderType, StellarAccountStatus, ActivateStellarAccountResult, XrpDestinationReadiness, IXrpWalletProvider, IXServiceBase, XToken, EvmHubProvider, IBitcoinWalletProvider, RadfiWalletBalance, IWalletProvider, RadfiUtxo, MoneyMarketBorrowActionParams, OutboundSettlement, MoneyMarketRepayActionParams, TxHashPair, MoneyMarketSupplyActionParams, MoneyMarketWithdrawActionParams, UserReserveData, AggregatedReserveData, BaseCurrencyInfo, ReservesDataHumanized, Address as Address$1, MoneyMarketParams, MoneyMarketApproveActionParams, TxReturnType, Erc20Token, ChainKey, ReserveDataHumanized, FormatReserveUSDResponse, FormatUserSummaryResponse, EmodeDataHumanized, SolverIntentQuoteRequest, SwapActionParams, SwapResponse, SolverIntentStatusResponse, SolverErrorResponse, Hex, DetailedSwapStatus, DetailedStatusError, CreateIntentParams, CreateLimitOrderParams, SwapApprovalStrategy, SwapWithApprovalParams, SwapWithApprovalResponse, SwapExtras, Intent, LimitOrderActionParams, IntentResponse, UserIntentsResponse, OrderbookResponse, MoneyMarketPosition, MoneyMarketAsset, MoneyMarketAssetBorrowers, MoneyMarketAssetSuppliers, MoneyMarketBorrowers, OracleMarketsResponse, OracleCandlesResponse, OracleCandleInterval, GetSwapTokensResponseV2, RequestOverrideConfig, GetSwapTokensByChainResponseV2, QuoteResponseV2, QuoteRequestV2, QuoteQueryV2, DeadlineResponseV2, DeadlineQueryV2, AllowanceCheckResponseV2, CreateIntentParamsV2, ApproveResponseV2, RawTxReturnType, Hash, ApprovalStrategy, ApprovalOptions, EvmRawTransaction, IEvmWalletProvider, CreateIntentResponseV2, SubmitIntentRequestV2, SubmitIntentResponseV2, StatusResponseV2, SwapIntentStatusCodeV2, CancelIntentRequestV2, CancelIntentResponseV2, IntentHashResponseV2, IntentRequestV2, IntentPacketResponseV2, IntentPacketRequestV2, IntentExtraDataResponseV2, IntentExtraDataRequestV2, IntentStateV2, GetIntentResponseV2, CreateLimitOrderParamsV2, CreateLimitOrderResponseV2, GasEstimateResponseV2, GasEstimateRequestV2, FeeResponseV2, SubmitTxRequestV2, SubmitTxResponseV2, SubmitTxStatusResponseV2, DetailedBridgeStatus, BridgeDetailedStatusError, BridgeParams, CreateBridgeIntentParams, BridgeWithApprovalParams, BridgeWithApprovalResponse, BridgeLimit, BridgeAllowanceCheckResponseV2, CreateBridgeIntentParamsV2, BridgeApproveResponseV2, BridgeableAmountResponseV2, BridgeQuoteRequestV2, CreateBridgeIntentResponseV2, BridgeFeeResponseV2, BridgeFeeRequestV2, BridgeableCheckResponseV2, BridgeSubmitTxRequestV2, BridgeSubmitTxResponseV2, BridgeSubmitTxStatusResponseV2, GetBridgeTokensResponseV2, GetBridgeTokensByChainResponseV2, StakeAction, StakeParams, UnstakeAction, ClaimAction, CancelUnstakeAction, StakingInfo, UnstakingInfo, UnstakeRequestWithPenalty, StakingConfig, InstantUnstakeAction, UnstakeParams, InstantUnstakeParams, PartnerFeeClaimAssetBalance, AutoSwapPreferences, FeeTokenApproveParams, FeeTokenApproveAction, HubChainKey, SetSwapPreferenceAction, PartnerFeeClaimSwapAction, IntentAutoSwapResult, PartnerFeeClaimCancelAction, GetUserIntentParams, HubAssetBalance, WithdrawHubAssetAction, SendMessageReturnType, IcxMigrateAction, IcxRevertMigrationAction, UnifiedBnUSDMigrateAction, BalnMigrateAction, MigrationAction, IcxMigrateParams, IcxCreateRevertMigrationParams, UnifiedBnUSDMigrateParams, BalnMigrateParams, PoolKey, PoolData, ClPositionInfo, AssetDepositAction, AssetWithdrawAction, CreateAssetDepositParams, ClSupplyParams, ClIncreaseLiquidityParams, ClLiquidityDecreaseLiquidityAction, ClDecreaseLiquidityParams, CreateAssetWithdrawParams, PoolSpokeAssets, DestinationParamsType, ClLiquidityClaimRewardsAction, LeverageYieldQuoteParams, LeverageYieldEffectiveApr, LeverageYieldPosition, LeverageYieldSwapDepositParams, LeverageYieldSwapPayload, SolverExecutionRequest, SolverExecutionResponse, DetailedLeverageYieldStatus, LeverageYieldDetailedStatusError, VaultSwapActionParams, VaultSwapResponse, VaultSwapWithApprovalParams, VaultSwapWithApprovalResponse, LeverageYieldSwapWithdrawParams, LeveragePositionAccount, LeveragePositionCollateral, LeveragePosition, LeveragePositionPendingState, SpokeExecActionParams, OpenPositionParams, OpenPositionFromDebtTokenParams, LeveragePositionIntentResult, PositionOperationParams, PositionBatchCall, PositionDirectCall, GetLeverageVaultsResponseV2, GetLeverageVaultResponseV2, VaultAssetResponseV2, LeverageYieldPositionV2, LeverageYieldAprV2, LeverageYieldEffectiveAprV2, LeverageYieldLsdAprV2, VaultTotalAssetsResponseV2, PreviewDepositResponseV2, PreviewWithdrawResponseV2, PreviewRedeemResponseV2, ShareBalanceResponseV2, MaxWithdrawResponseV2, LeverageYieldDepositQuoteRequestV2, LeverageYieldWithdrawQuoteRequestV2, CreateDepositIntentParamsV2, CreateWithdrawIntentParamsV2, LeverageYieldSubmitTxRequestV2, ActivateStellarAccountParams, StellarSponsorConfig, SodaxOptions } from '@sodax/sdk';
|
|
4
4
|
export * from '@sodax/sdk';
|
|
5
5
|
import { Address } from 'viem';
|
|
6
6
|
import { ReactNode, ReactElement } from 'react';
|
|
@@ -190,7 +190,7 @@ declare function getStellarTrustlineCheckQueryOptions({ sodax, token, amount, ch
|
|
|
190
190
|
chainId: SpokeChainKey | undefined;
|
|
191
191
|
walletAddress: string | undefined;
|
|
192
192
|
}): {
|
|
193
|
-
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" | "robinhood" | undefined, string | undefined, string | undefined, string | undefined];
|
|
193
|
+
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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano" | undefined, string | undefined, string | undefined, string | undefined];
|
|
194
194
|
queryFn: () => Promise<boolean>;
|
|
195
195
|
enabled: boolean;
|
|
196
196
|
};
|
|
@@ -364,6 +364,135 @@ interface StellarGate extends StellarGateState {
|
|
|
364
364
|
*/
|
|
365
365
|
declare function useStellarGate({ dstChainKey, token, amount, address, walletProvider, }: UseStellarGateParams): StellarGate;
|
|
366
366
|
|
|
367
|
+
type UseXrpDestinationCheckParams = ReadHookParams<XrpDestinationReadiness, {
|
|
368
|
+
chainId: SpokeChainKey | undefined;
|
|
369
|
+
token: string | undefined;
|
|
370
|
+
/** The XRPL account that receives the payout. */
|
|
371
|
+
address: string | undefined;
|
|
372
|
+
/** The least that arrives, in the token's decimals. */
|
|
373
|
+
amount: bigint | undefined;
|
|
374
|
+
/** The most that can arrive, which the trustline needs room for. Defaults to `amount`. */
|
|
375
|
+
maxAmount?: bigint;
|
|
376
|
+
}>;
|
|
377
|
+
type XrpDestinationReader = {
|
|
378
|
+
spoke: {
|
|
379
|
+
xrp: Pick<Sodax['spoke']['xrp'], 'checkDestination'>;
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
declare function getXrpDestinationCheckQueryOptions({ sodax, chainId, token, address, amount, maxAmount, }: {
|
|
383
|
+
sodax: XrpDestinationReader;
|
|
384
|
+
chainId: SpokeChainKey | undefined;
|
|
385
|
+
token: string | undefined;
|
|
386
|
+
address: string | undefined;
|
|
387
|
+
amount: bigint | undefined;
|
|
388
|
+
maxAmount?: bigint;
|
|
389
|
+
}): {
|
|
390
|
+
queryKey: readonly ["shared", "xrpDestinationCheck", "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano" | undefined, string | undefined, string | undefined, string | undefined, string | undefined];
|
|
391
|
+
queryFn: () => Promise<XrpDestinationReadiness>;
|
|
392
|
+
enabled: boolean;
|
|
393
|
+
};
|
|
394
|
+
/**
|
|
395
|
+
* Whether an XRPL account can receive `amount` of `token` (up to `maxAmount`), and if not, why. It reads the
|
|
396
|
+
* same ledger state a swap or withdrawal is refused on before signing.
|
|
397
|
+
*/
|
|
398
|
+
declare function useXrpDestinationCheck({ params, queryOptions, }?: UseXrpDestinationCheckParams): UseQueryResult<XrpDestinationReadiness, Error>;
|
|
399
|
+
|
|
400
|
+
type UseXrpTrustlineReserveCheckParams = ReadHookParams<boolean, {
|
|
401
|
+
token: string | undefined;
|
|
402
|
+
address: string | undefined;
|
|
403
|
+
}>;
|
|
404
|
+
type XrpReserveReader = {
|
|
405
|
+
spoke: {
|
|
406
|
+
xrp: Pick<Sodax['spoke']['xrp'], 'canAffordTrustline'>;
|
|
407
|
+
};
|
|
408
|
+
};
|
|
409
|
+
declare function getXrpTrustlineReserveCheckQueryOptions({ sodax, token, address, }: {
|
|
410
|
+
sodax: XrpReserveReader;
|
|
411
|
+
token: string | undefined;
|
|
412
|
+
address: string | undefined;
|
|
413
|
+
}): {
|
|
414
|
+
queryKey: readonly ["shared", "xrpTrustlineReserveCheck", string | undefined, string | undefined];
|
|
415
|
+
queryFn: () => Promise<boolean>;
|
|
416
|
+
enabled: boolean;
|
|
417
|
+
};
|
|
418
|
+
/** Whether an XRPL account holds the spendable XRP to set the trustline for an issued `token`. */
|
|
419
|
+
declare function useXrpTrustlineReserveCheck({ params, queryOptions, }?: UseXrpTrustlineReserveCheckParams): UseQueryResult<boolean, Error>;
|
|
420
|
+
|
|
421
|
+
type UseEstablishXrpTrustlineVars = {
|
|
422
|
+
/** The XRPL issued token to hold. */
|
|
423
|
+
token: string;
|
|
424
|
+
/** The account that needs the trustline. When set, the mutation refuses a wallet connected to another account. */
|
|
425
|
+
address?: string;
|
|
426
|
+
walletProvider: IXrpWalletProvider;
|
|
427
|
+
};
|
|
428
|
+
/**
|
|
429
|
+
* Create the XRPL trustline the connected account needs to hold `token`, or raise its limit. Resolves to the
|
|
430
|
+
* TrustSet hash once it validates. The account pays its fee and, unless the ledger waives it, an owner reserve: check with
|
|
431
|
+
* {@link useXrpTrustlineReserveCheck}, or use {@link useXrpGate}, before asking the user to sign.
|
|
432
|
+
*/
|
|
433
|
+
declare function useEstablishXrpTrustline({ mutationOptions, }?: MutationHookParams<string, UseEstablishXrpTrustlineVars>): SafeUseMutationResult<string, Error, UseEstablishXrpTrustlineVars>;
|
|
434
|
+
|
|
435
|
+
/** The subset of a query result the gate reads. A full `UseQueryResult<T>` satisfies it. */
|
|
436
|
+
type XrpCheckResult<T> = Pick<UseQueryResult<T>, 'isLoading' | 'isError' | 'data'>;
|
|
437
|
+
/** A destination refusal the account's own trustline cannot fix. */
|
|
438
|
+
type XrpBlockedReason = Exclude<Extract<XrpDestinationReadiness, {
|
|
439
|
+
ready: false;
|
|
440
|
+
}>['reason'], 'no_trustline' | 'trustline_limit'>;
|
|
441
|
+
interface XrpGateState {
|
|
442
|
+
/** The destination is XRPL and the token is an issued currency, so a trustline is involved. */
|
|
443
|
+
isXrpIssuedToken: boolean;
|
|
444
|
+
/** The trustline is missing or too small, and the account can afford to set it. */
|
|
445
|
+
needsTrustline: boolean;
|
|
446
|
+
/** The trustline needs setting, but the account lacks the spendable XRP for its fee and reserve. */
|
|
447
|
+
needsFunding: boolean;
|
|
448
|
+
/** Why the destination cannot receive, when no trustline change by the user would fix it. */
|
|
449
|
+
blockedReason: XrpBlockedReason | undefined;
|
|
450
|
+
/** A query failed; disabled or unresolved queries do not set this. */
|
|
451
|
+
checkFailed: boolean;
|
|
452
|
+
/** Whether the downstream action must remain disabled. */
|
|
453
|
+
blocksAction: boolean;
|
|
454
|
+
}
|
|
455
|
+
interface XrpGateInputs {
|
|
456
|
+
/** Whether the destination can receive the payout, from the same ledger reads the SDK refuses a swap on. */
|
|
457
|
+
readinessCheck: XrpCheckResult<XrpDestinationReadiness>;
|
|
458
|
+
/** Whether the account can pay for the TrustSet. Only read once the trustline is known to need setting. */
|
|
459
|
+
reserveCheck: XrpCheckResult<boolean>;
|
|
460
|
+
/** Resolve from chain config: false for native XRP. */
|
|
461
|
+
requiresTrustline: boolean;
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Resolve the XRPL destination prerequisites for an issued token. Native XRP and other chains pass through:
|
|
465
|
+
* the SDK still refuses an unreceivable payout before signing. Unknown states fail closed.
|
|
466
|
+
*/
|
|
467
|
+
declare function resolveXrpGate(chainKey: SpokeChainKey | undefined, inputs: XrpGateInputs): XrpGateState;
|
|
468
|
+
|
|
469
|
+
interface UseXrpGateParams {
|
|
470
|
+
dstChainKey: SpokeChainKey | undefined;
|
|
471
|
+
token: string | undefined;
|
|
472
|
+
/** The XRPL account that receives the payout. */
|
|
473
|
+
address: string | undefined;
|
|
474
|
+
/** The least that arrives, in the token's decimals. */
|
|
475
|
+
amount: bigint | undefined;
|
|
476
|
+
/** The most that can arrive, which the trustline needs room for. Defaults to `amount`. */
|
|
477
|
+
maxAmount?: bigint;
|
|
478
|
+
/** Must control `address`: `requestTrustline` refuses, before signing, a wallet connected to another account. */
|
|
479
|
+
walletProvider: GetWalletProviderType<SpokeChainKey> | undefined;
|
|
480
|
+
}
|
|
481
|
+
interface XrpGate extends XrpGateState {
|
|
482
|
+
isChecking: boolean;
|
|
483
|
+
/** Surface when `checkFailed` is true. */
|
|
484
|
+
error: Error | undefined;
|
|
485
|
+
retry: () => void;
|
|
486
|
+
isRequestingTrustline: boolean;
|
|
487
|
+
/** Returns `undefined` when required inputs are missing. */
|
|
488
|
+
requestTrustline: () => Promise<Result<string> | undefined>;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Gate XRPL delivery of an issued token on a trustline with room for the payout, and on enough spendable XRP
|
|
492
|
+
* to set one. Refusals the user's trustline cannot fix surface as `blockedReason`.
|
|
493
|
+
*/
|
|
494
|
+
declare function useXrpGate({ dstChainKey, token, address, amount, maxAmount, walletProvider, }: UseXrpGateParams): XrpGate;
|
|
495
|
+
|
|
367
496
|
type UseGetUserHubWalletAddressParams = ReadHookParams<Address, {
|
|
368
497
|
spokeChainId?: SpokeChainKey;
|
|
369
498
|
spokeAddress?: string;
|
|
@@ -404,7 +533,7 @@ type UseXBalancesParams = ReadHookParams<Record<string, bigint>, XBalancesInputs
|
|
|
404
533
|
* tests and for advanced callers that compose their own `useQuery` wrapper.
|
|
405
534
|
*/
|
|
406
535
|
declare function getXBalancesQueryOptions({ xService, xChainId, xTokens, address }: XBalancesInputs): {
|
|
407
|
-
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" | "robinhood" | undefined, (readonly [string, string])[], string | undefined];
|
|
536
|
+
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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano" | undefined, (readonly [string, string])[], string | undefined];
|
|
408
537
|
queryFn: () => Promise<Record<string, bigint>>;
|
|
409
538
|
enabled: boolean;
|
|
410
539
|
refetchInterval: number;
|
|
@@ -432,6 +561,8 @@ interface BalancesInputs {
|
|
|
432
561
|
chainKey: SpokeChainKey | undefined;
|
|
433
562
|
tokens: readonly XToken[];
|
|
434
563
|
address: string | undefined;
|
|
564
|
+
/** TON only: wallet account to read. Defaults to the public key’s wallet-v4R2 address. */
|
|
565
|
+
accountAddress?: string;
|
|
435
566
|
}
|
|
436
567
|
type UseBalancesParams = ReadHookParams<Record<string, bigint>, BalancesInputs>;
|
|
437
568
|
/**
|
|
@@ -439,8 +570,8 @@ type UseBalancesParams = ReadHookParams<Record<string, bigint>, BalancesInputs>;
|
|
|
439
570
|
* callers that compose their own `useQuery` wrapper. Takes the SDK instance explicitly (the hook
|
|
440
571
|
* supplies it from context).
|
|
441
572
|
*/
|
|
442
|
-
declare function getBalancesQueryOptions(sodax: Sodax, { chainKey, tokens, address }: BalancesInputs): {
|
|
443
|
-
queryKey: readonly ["shared", "balances", "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" | "robinhood" | undefined, (readonly [string, string])[], string | undefined];
|
|
573
|
+
declare function getBalancesQueryOptions(sodax: Sodax, { chainKey, tokens, address, accountAddress }: BalancesInputs): {
|
|
574
|
+
queryKey: readonly ["shared", "balances", "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano" | undefined, (readonly [string, string])[], string | undefined, ...string[]];
|
|
444
575
|
queryFn: () => Promise<Record<string, bigint>>;
|
|
445
576
|
enabled: boolean;
|
|
446
577
|
refetchInterval: number;
|
|
@@ -639,9 +770,10 @@ type UseBorrowVars<K extends SpokeChainKey = SpokeChainKey> = Omit<MoneyMarketBo
|
|
|
639
770
|
* React hook for borrowing tokens from the Sodax money market protocol.
|
|
640
771
|
*
|
|
641
772
|
* Throws on SDK failure so React Query's native error model engages (`isError`, `error`,
|
|
642
|
-
* `onError`, `retry`). Returns the unwrapped
|
|
773
|
+
* `onError`, `retry`). Returns the unwrapped {@link OutboundSettlement} on success: a tx pair, or
|
|
774
|
+
* from Tron the relay's `trackingId` beside the destination tx.
|
|
643
775
|
*/
|
|
644
|
-
declare function useBorrow<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<
|
|
776
|
+
declare function useBorrow<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<OutboundSettlement<K>, UseBorrowVars<K>>): SafeUseMutationResult<OutboundSettlement<K>, Error, UseBorrowVars<K>>;
|
|
645
777
|
|
|
646
778
|
/**
|
|
647
779
|
* Mutation variables for {@link useRepay}. Generic over `K extends SpokeChainKey` (defaults to
|
|
@@ -693,9 +825,10 @@ type UseWithdrawVars<K extends SpokeChainKey = SpokeChainKey> = Omit<MoneyMarket
|
|
|
693
825
|
* React hook for withdrawing supplied tokens from the Sodax money market protocol.
|
|
694
826
|
*
|
|
695
827
|
* Throws on SDK failure so React Query's native error model engages (`isError`, `error`,
|
|
696
|
-
* `onError`, `retry`). Returns the unwrapped
|
|
828
|
+
* `onError`, `retry`). Returns the unwrapped {@link OutboundSettlement} on success: a tx pair, or
|
|
829
|
+
* from Tron the relay's `trackingId` beside the destination tx.
|
|
697
830
|
*/
|
|
698
|
-
declare function useWithdraw<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<
|
|
831
|
+
declare function useWithdraw<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<OutboundSettlement<K>, UseWithdrawVars<K>>): SafeUseMutationResult<OutboundSettlement<K>, Error, UseWithdrawVars<K>>;
|
|
699
832
|
|
|
700
833
|
type UseUserReservesDataParams = ReadHookParams<readonly [readonly UserReserveData[], number], {
|
|
701
834
|
spokeChainKey: SpokeChainKey | undefined;
|
|
@@ -846,9 +979,9 @@ declare function getSwapQuoteQueryOptions({ sodax, payload, }: {
|
|
|
846
979
|
}): {
|
|
847
980
|
queryKey: (string | {
|
|
848
981
|
token_src: string;
|
|
849
|
-
token_src_blockchain_id: "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" | "robinhood";
|
|
982
|
+
token_src_blockchain_id: "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano";
|
|
850
983
|
token_dst: string;
|
|
851
|
-
token_dst_blockchain_id: "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" | "robinhood";
|
|
984
|
+
token_dst_blockchain_id: "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano";
|
|
852
985
|
amount: string;
|
|
853
986
|
quote_type: "exact_input";
|
|
854
987
|
partnerFee: _sodax_sdk.PartnerFeePercentage | {
|
|
@@ -1023,14 +1156,15 @@ interface NearStorageGateState {
|
|
|
1023
1156
|
declare function resolveNearStorageGate(chainKey: SpokeChainKey | undefined, check: NearStorageCheckResult): NearStorageGateState;
|
|
1024
1157
|
|
|
1025
1158
|
/** A prerequisite the user must resolve before the swap can go out. */
|
|
1026
|
-
type SwapSetupReason = 'stellarActivation' | 'stellarFunding' | 'stellarTrustline' | 'stellarCheckFailed' | 'nearStorage' | 'nearStorageCheckFailed' | 'external';
|
|
1159
|
+
type SwapSetupReason = 'stellarActivation' | 'stellarFunding' | 'stellarTrustline' | 'stellarCheckFailed' | 'nearStorage' | 'nearStorageCheckFailed' | 'xrpTrustline' | 'xrpFunding' | 'xrpBlocked' | 'xrpCheckFailed' | 'external';
|
|
1027
1160
|
/**
|
|
1028
1161
|
* Where a swap form stands, discriminated on `kind`. `useSwapLifecycle`'s `next()` acts on it.
|
|
1029
1162
|
*
|
|
1030
1163
|
* - `checking` — waiting before anything can be done: a gate or the approval strategy is still reading, or a
|
|
1031
1164
|
* setup tx (activation, trustline, NEAR storage) is in flight or its check is refreshing.
|
|
1032
1165
|
* - `submitting` — the swap call is in flight: signing, and on the default backend path settlement too.
|
|
1033
|
-
* - `pending` — the source tx
|
|
1166
|
+
* - `pending` — the source tx status is being read, or a recovery handle is waiting for identification.
|
|
1167
|
+
* `error` is set when the swap call
|
|
1034
1168
|
* failed after broadcast, or when the status read cannot recover (a rejected API key); the swap may
|
|
1035
1169
|
* still complete either way. The read can also stop polling without an error (after its budget of
|
|
1036
1170
|
* ambiguous reads), so keep `reset()` reachable here.
|
|
@@ -1057,6 +1191,12 @@ type SwapLifecycleState = {
|
|
|
1057
1191
|
srcChainKey: SpokeChainKey;
|
|
1058
1192
|
srcTxHash: string;
|
|
1059
1193
|
error?: Error;
|
|
1194
|
+
} | {
|
|
1195
|
+
kind: 'pending';
|
|
1196
|
+
srcChainKey: SpokeChainKey;
|
|
1197
|
+
srcTxHash?: never;
|
|
1198
|
+
recovery: unknown;
|
|
1199
|
+
error: Error;
|
|
1060
1200
|
} | {
|
|
1061
1201
|
kind: 'unconfirmed';
|
|
1062
1202
|
batchId: string;
|
|
@@ -1083,7 +1223,7 @@ type UseSwapLifecycleParams<K extends SpokeChainKey = SpokeChainKey> = {
|
|
|
1083
1223
|
intentParams: CreateIntentParams<K> | undefined;
|
|
1084
1224
|
srcWalletProvider: GetWalletProviderType<K> | undefined;
|
|
1085
1225
|
/**
|
|
1086
|
-
* Destination wallet, for the Stellar and
|
|
1226
|
+
* Destination wallet, for the Stellar, NEAR and XRPL setup actions. The gates check `intentParams.dstAddress`,
|
|
1087
1227
|
* the account the swap pays, so this wallet must control it for those actions to clear them.
|
|
1088
1228
|
*/
|
|
1089
1229
|
dstWalletProvider: GetWalletProviderType<SpokeChainKey> | undefined;
|
|
@@ -1123,10 +1263,12 @@ type SwapLifecycle<K extends SpokeChainKey = SpokeChainKey> = {
|
|
|
1123
1263
|
status: UseQueryResult<UseDetailedStatusResult>;
|
|
1124
1264
|
stellar: StellarGate;
|
|
1125
1265
|
nearStorage: NearStorageGate;
|
|
1266
|
+
/** `blockedReason` names why an XRPL destination cannot receive when the state is `xrpBlocked`. */
|
|
1267
|
+
xrp: XrpGate;
|
|
1126
1268
|
};
|
|
1127
1269
|
/**
|
|
1128
1270
|
* One hook for a swap form: approval strategy, destination prerequisites (Stellar account and
|
|
1129
|
-
* trustline, NEAR storage), source-chain switching, the swap itself (`useSwapWithApproval` — one
|
|
1271
|
+
* trustline, NEAR storage, XRPL trustline), source-chain switching, the swap itself (`useSwapWithApproval` — one
|
|
1130
1272
|
* signature on an EIP-5792 wallet) and its status (`useDetailedStatus`), as a single discriminated
|
|
1131
1273
|
* `state` with one `next()` action. Render from `state.kind`; wire the button to `next()`.
|
|
1132
1274
|
*
|
|
@@ -1515,7 +1657,7 @@ type UseSwapsApiApproveAndBroadcastVars<K extends SpokeChainKey = SpokeChainKey>
|
|
|
1515
1657
|
* if (!result.ok) return;
|
|
1516
1658
|
* const { resetTxHash, approveTxHash } = result.value; // resetTxHash only on a guarded token
|
|
1517
1659
|
*/
|
|
1518
|
-
declare const useSwapsApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "robinhood">({ mutationOptions, }?: MutationHookParams<SwapsApiApprovalHashes, UseSwapsApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<SwapsApiApprovalHashes, Error, UseSwapsApiApproveAndBroadcastVars<K>>;
|
|
1660
|
+
declare const useSwapsApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano">({ mutationOptions, }?: MutationHookParams<SwapsApiApprovalHashes, UseSwapsApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<SwapsApiApprovalHashes, Error, UseSwapsApiApproveAndBroadcastVars<K>>;
|
|
1519
1661
|
|
|
1520
1662
|
type UseSwapsApiBroadcastWithApprovalVars = ApprovalOptions & {
|
|
1521
1663
|
/** The swap's create-intent params — the same body `/swaps/intents` built `intentTx` from. */
|
|
@@ -1857,13 +1999,16 @@ type DetailedBridgeStatusRead = Result<DetailedBridgeStatus, BridgeDetailedStatu
|
|
|
1857
1999
|
* how the read recovers when the outage ends.
|
|
1858
2000
|
*/
|
|
1859
2001
|
declare function isBridgeNotDelivered(data: DetailedBridgeStatusRead): boolean;
|
|
2002
|
+
/** A read the SDK tags `context.mpcRelay`: a bridge with an MPC-relay end, which gets the longer budget. */
|
|
2003
|
+
declare function isBridgeMpcRelayRead(data: DetailedBridgeStatusRead): boolean;
|
|
1860
2004
|
/**
|
|
1861
2005
|
* Polling interval for `useBridgeDetailedStatus`.
|
|
1862
2006
|
*
|
|
1863
2007
|
* Unlike the swap analog there is no in-flight second arm to wait on: the relay arm only ever
|
|
1864
|
-
* carries a matched `executed` packet,
|
|
1865
|
-
* terminal
|
|
1866
|
-
* run `MAX_NOT_FOUND_POLLS` times in a row
|
|
2008
|
+
* carries a matched `executed` packet, and the MPC-relay arm a minted deposit record, so both are
|
|
2009
|
+
* terminal on arrival. That leaves three stops — a terminal or abandoned backend record, a rejected
|
|
2010
|
+
* API key, and the ambiguous relay miss once it has run `MAX_NOT_FOUND_POLLS` times in a row, or
|
|
2011
|
+
* `MAX_MPC_RELAY_NOT_FOUND_POLLS` when the SDK tags it `context.mpcRelay`.
|
|
1867
2012
|
*
|
|
1868
2013
|
* Kept in its own pure module (no React/context imports) so it is unit-testable in dapp-kit's `node`
|
|
1869
2014
|
* test environment — importing the hook itself pulls in `useSodaxContext`.
|
|
@@ -1888,25 +2033,29 @@ type UseBridgeDetailedStatusResult = Result<DetailedBridgeStatus, BridgeDetailed
|
|
|
1888
2033
|
type UseBridgeDetailedStatusParams = ReadHookParams<UseBridgeDetailedStatusResult, {
|
|
1889
2034
|
srcChainKey: SpokeChainKey | undefined;
|
|
1890
2035
|
srcTxHash: string | undefined;
|
|
2036
|
+
/** The bridge's destination; from Tron to another spoke the read waits for that leg. */
|
|
2037
|
+
dstChainKey?: SpokeChainKey;
|
|
1891
2038
|
apiConfig?: RequestOverrideConfig;
|
|
1892
2039
|
}>;
|
|
1893
2040
|
/**
|
|
1894
2041
|
* Hook for monitoring a bridge from its source-chain transaction.
|
|
1895
2042
|
*
|
|
1896
2043
|
* `useBridgeApiSubmitTxStatus` needs the backend to still hold a usable record; this takes
|
|
1897
|
-
* `(srcChainKey, srcTxHash)` — the pair you hold after `bridge()`
|
|
2044
|
+
* `(srcChainKey, srcTxHash)` — the pair you hold after `bridge()`, plus `dstChainKey` for a bridge from Tron —
|
|
2045
|
+
* and routes to whichever source
|
|
1898
2046
|
* can answer, so it also covers a bridge the client-side fallback completed. `data.value` is
|
|
1899
2047
|
* discriminated on `source`, and each variant carries that source's payload unmodified.
|
|
1900
2048
|
*
|
|
1901
2049
|
* Polls every 3s. Stops once the answering source is terminal (a relay packet always is), once the
|
|
1902
2050
|
* backend rejects the API key, and — like `useDetailedStatus` — after 40 consecutive *ambiguous*
|
|
1903
|
-
* reads, meaning a `LOOKUP_FAILED` whose relay has no packet for the tx
|
|
2051
|
+
* reads, meaning a `LOOKUP_FAILED` whose relay has no packet for the tx — 100, about 5 minutes, for a bridge
|
|
2052
|
+
* with an MPC-relay end (`context.mpcRelay`), which settles more slowly. A dependency outage keeps
|
|
1904
2053
|
* polling instead, so the read recovers by itself; any real answer resets the budget. Override with
|
|
1905
2054
|
* `queryOptions.refetchInterval`.
|
|
1906
2055
|
*
|
|
1907
2056
|
* @example
|
|
1908
2057
|
* ```typescript
|
|
1909
|
-
* const { data } = useBridgeDetailedStatus({ params: { srcChainKey, srcTxHash } });
|
|
2058
|
+
* const { data } = useBridgeDetailedStatus({ params: { srcChainKey, srcTxHash, dstChainKey } });
|
|
1910
2059
|
* if (data?.ok && data.value.source === 'relay') console.log(data.value.data.dst_tx_hash);
|
|
1911
2060
|
* ```
|
|
1912
2061
|
*/
|
|
@@ -2047,7 +2196,7 @@ type UseBridgeApiApproveAndBroadcastVars<K extends SpokeChainKey = SpokeChainKey
|
|
|
2047
2196
|
* if (!result.ok) return;
|
|
2048
2197
|
* const { resetTxHash, approveTxHash } = result.value; // resetTxHash only on a guarded token
|
|
2049
2198
|
*/
|
|
2050
|
-
declare const useBridgeApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "robinhood">({ mutationOptions, }?: MutationHookParams<BridgeApiApprovalHashes, UseBridgeApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<BridgeApiApprovalHashes, Error, UseBridgeApiApproveAndBroadcastVars<K>>;
|
|
2199
|
+
declare const useBridgeApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano">({ mutationOptions, }?: MutationHookParams<BridgeApiApprovalHashes, UseBridgeApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<BridgeApiApprovalHashes, Error, UseBridgeApiApproveAndBroadcastVars<K>>;
|
|
2051
2200
|
|
|
2052
2201
|
type UseBridgeApiBridgeableAmountParams = ReadHookParams<BridgeableAmountResponseV2 | undefined, {
|
|
2053
2202
|
body: BridgeQuoteRequestV2 | undefined;
|
|
@@ -2552,9 +2701,10 @@ type UseWithdrawHubAssetVars<K extends SpokeChainKey = SpokeChainKey> = Omit<Wit
|
|
|
2552
2701
|
* React hook for withdrawing a hub-side asset back to the user's spoke chain wallet.
|
|
2553
2702
|
*
|
|
2554
2703
|
* Throws on SDK failure so React Query's native error model engages (`isError`, `error`,
|
|
2555
|
-
* `onError`, `retry`). Returns the
|
|
2704
|
+
* `onError`, `retry`). Returns the spoke tx hash on success, or from an MPC-relay chain (Tron) the
|
|
2705
|
+
* relay's `trackingId`, which is not a tx hash: never link it to an explorer.
|
|
2556
2706
|
*/
|
|
2557
|
-
declare function useWithdrawHubAsset<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<
|
|
2707
|
+
declare function useWithdrawHubAsset<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<SendMessageReturnType<K, false>, UseWithdrawHubAssetVars<K>>): SafeUseMutationResult<SendMessageReturnType<K, false>, Error, UseWithdrawHubAssetVars<K>>;
|
|
2558
2708
|
|
|
2559
2709
|
/**
|
|
2560
2710
|
* Mutation variables for {@link useMigrateIcxToSoda}. Wraps `IcxMigrateAction<false>` with `raw`
|
|
@@ -2728,9 +2878,10 @@ type UseDexWithdrawVars<K extends SpokeChainKey = SpokeChainKey> = Omit<AssetWit
|
|
|
2728
2878
|
* React hook for withdrawing an asset from a DEX pool.
|
|
2729
2879
|
*
|
|
2730
2880
|
* Throws on SDK failure so React Query's native error model engages (`isError`, `error`,
|
|
2731
|
-
* `onError`, `retry`). Returns the unwrapped
|
|
2881
|
+
* `onError`, `retry`). Returns the unwrapped {@link OutboundSettlement} on success: a tx pair, or
|
|
2882
|
+
* from Tron the relay's `trackingId` beside the destination tx.
|
|
2732
2883
|
*/
|
|
2733
|
-
declare function useDexWithdraw<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<
|
|
2884
|
+
declare function useDexWithdraw<K extends SpokeChainKey = SpokeChainKey>({ mutationOptions, }?: MutationHookParams<OutboundSettlement<K>, UseDexWithdrawVars<K>>): SafeUseMutationResult<OutboundSettlement<K>, Error, UseDexWithdrawVars<K>>;
|
|
2734
2885
|
|
|
2735
2886
|
type UseDexAllowanceParams<K extends SpokeChainKey = SpokeChainKey> = ReadHookParams<boolean, {
|
|
2736
2887
|
payload: CreateAssetDepositParams<K> | undefined;
|
|
@@ -2932,9 +3083,9 @@ declare function getLeverageYieldQuoteQueryOptions({ sodax, payload, }: {
|
|
|
2932
3083
|
}): {
|
|
2933
3084
|
queryKey: (string | {
|
|
2934
3085
|
token_src: string;
|
|
2935
|
-
token_src_blockchain_id: "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" | "robinhood";
|
|
3086
|
+
token_src_blockchain_id: "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano";
|
|
2936
3087
|
token_dst: string;
|
|
2937
|
-
token_dst_blockchain_id: "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" | "robinhood";
|
|
3088
|
+
token_dst_blockchain_id: "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano";
|
|
2938
3089
|
amount: string;
|
|
2939
3090
|
quote_type: "exact_input";
|
|
2940
3091
|
partnerFee: _sodax_sdk.PartnerFeePercentage | {
|
|
@@ -3788,7 +3939,7 @@ type UseLeverageYieldApiApproveAndBroadcastVars<K extends SpokeChainKey = SpokeC
|
|
|
3788
3939
|
* if (!result.ok) return;
|
|
3789
3940
|
* const { resetTxHash, approveTxHash } = result.value; // resetTxHash only on a guarded token
|
|
3790
3941
|
*/
|
|
3791
|
-
declare const useLeverageYieldApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "robinhood">({ mutationOptions, }?: MutationHookParams<LeverageYieldApiApprovalHashes, UseLeverageYieldApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<LeverageYieldApiApprovalHashes, Error, UseLeverageYieldApiApproveAndBroadcastVars<K>>;
|
|
3942
|
+
declare const useLeverageYieldApiApproveAndBroadcast: <K extends SpokeChainKey = "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" | "tron" | "robinhood" | "xrp" | "monad" | "ton" | "zcash" | "cardano">({ mutationOptions, }?: MutationHookParams<LeverageYieldApiApprovalHashes, UseLeverageYieldApiApproveAndBroadcastVars<K>>) => SafeUseMutationResult<LeverageYieldApiApprovalHashes, Error, UseLeverageYieldApiApproveAndBroadcastVars<K>>;
|
|
3792
3943
|
|
|
3793
3944
|
/**
|
|
3794
3945
|
* Mutation variables for {@link useLeverageYieldApiCreateDepositIntent}. The per-request `apiConfig` override belongs here
|
|
@@ -4139,4 +4290,4 @@ type CreateSodaxQueryClientOptions = {
|
|
|
4139
4290
|
*/
|
|
4140
4291
|
declare function createSodaxQueryClient({ onMutationError, config, }?: CreateSodaxQueryClientOptions): QueryClient;
|
|
4141
4292
|
|
|
4142
|
-
export { type ATokenData, type ApprovalHashes, type ApprovalPlan, type ApprovalProgress, type ApprovalProgressListener, type BackendPaginationParams, type BalancesInputs, type BitcoinTradingSetup, type BridgeApiApprovalHashes, type CreateSodaxQueryClientOptions, type DecreaseLiquidityParamsCore, type DepositParamsCore, type LeverageYieldApiApprovalHashes, type LeverageYieldShareHolder, type LeverageYieldShareHolding, type MutationHookOptions, type MutationHookParams, type NearStorageCheckResult, type NearStorageGate, type NearStorageGateState, type RadfiSession, type ReadHookParams, type ReadQueryOptions, type ReserveUsdFormat, type SafeUseMutationResult, SodaxProvider, type StellarCheckResult, type StellarGate, type StellarGateInputs, type StellarGateState, type SwapLifecycle, type SwapLifecycleState, type SwapSetupReason, type SwapsApiApprovalHashes, type SwapsApiBroadcastWithApprovalResult, type UseATokenParams, type UseATokensBalancesParams, type UseActivateStellarAccountVars, type UseApproveLeveragePositionFundingVars, type UseApproveTokenVars, type UseBalancesParams, type UseBitcoinBalanceParams, type UseBitcoinTradingSetupParams, type UseBorrowVars, type UseBridgeAllowanceParams, type UseBridgeApiAllowanceParams, type UseBridgeApiApproveAndBroadcastVars, type UseBridgeApiApproveVars, type UseBridgeApiBridgeableAmountParams, type UseBridgeApiCreateBridgeIntentVars, type UseBridgeApiFeeParams, type UseBridgeApiIsBridgeableParams, type UseBridgeApiSubmitTxStatusParams, type UseBridgeApiSubmitTxVars, type UseBridgeApiTokensByChainParams, type UseBridgeApiTokensParams, type UseBridgeApprovalStrategyParams, type UseBridgeApproveVars, type UseBridgeDetailedStatusParams, type UseBridgeDetailedStatusResult, type UseBridgeVars, type UseBridgeWithApprovalVars, type UseClaimRewardsVars, type UseCreateDecreaseLiquidityParamsProps, type UseCreateDepositParamsProps, type UseCreateLimitOrderVars, type UseCreateSupplyLiquidityParamsProps, type UseCreateSupplyLiquidityParamsResult, type UseCreateWithdrawParamsProps, type UseDecreaseLiquidityVars, type UseDeriveUserWalletAddressParams, type UseDetailedStatusParams, type UseDetailedStatusResult, type UseDexAllowanceParams, type UseDexApproveVars, type UseDexDepositVars, type UseDexWithdrawVars, type UseEModesParams, type UseEnsureRadfiAccessTokenVars, type UseEstablishTrustlineVars, 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 UseLeveragePositionAccountParams, type UseLeveragePositionCollateralParams, type UseLeveragePositionFundingAllowanceParams, type UseLeveragePositionInfoParams, type UseLeveragePositionPayoutAddressParams, type UseLeveragePositionPendingParams, type UseLeveragePositionsForUserParams, type UseLeveragePositionsParams, type UseLeverageYieldApiAllowanceParams, type UseLeverageYieldApiApproveAndBroadcastVars, type UseLeverageYieldApiApproveVars, type UseLeverageYieldApiAprParams, type UseLeverageYieldApiAssetParams, type UseLeverageYieldApiCancelIntentVars, type UseLeverageYieldApiCreateDepositIntentVars, type UseLeverageYieldApiCreateWithdrawIntentVars, type UseLeverageYieldApiDeadlineParams, type UseLeverageYieldApiDepositQuoteParams, type UseLeverageYieldApiEffectiveAprParams, type UseLeverageYieldApiEstimateGasParams, type UseLeverageYieldApiFilledIntentParams, type UseLeverageYieldApiIntentExtraDataParams, type UseLeverageYieldApiIntentHashParams, type UseLeverageYieldApiIntentPacketParams, type UseLeverageYieldApiIntentParams, type UseLeverageYieldApiLsdAprParams, type UseLeverageYieldApiMaxWithdrawParams, type UseLeverageYieldApiPartnerFeeParams, type UseLeverageYieldApiPositionParams, type UseLeverageYieldApiPreviewDepositParams, type UseLeverageYieldApiPreviewRedeemParams, type UseLeverageYieldApiPreviewWithdrawParams, type UseLeverageYieldApiShareBalanceParams, type UseLeverageYieldApiSolverFeeParams, type UseLeverageYieldApiStatusParams, type UseLeverageYieldApiSubmitIntentVars, type UseLeverageYieldApiSubmitTxStatusParams, type UseLeverageYieldApiSubmitTxVars, type UseLeverageYieldApiTotalAssetsParams, type UseLeverageYieldApiVaultParams, type UseLeverageYieldApiVaultsParams, type UseLeverageYieldApiWithdrawQuoteParams, type UseLeverageYieldApprovalStrategyParams, type UseLeverageYieldDepositVars, type UseLeverageYieldDetailedStatusParams, type UseLeverageYieldDetailedStatusResult, type UseLeverageYieldEffectiveAprParams, type UseLeverageYieldNotifySolverVars, type UseLeverageYieldPositionParams, type UseLeverageYieldPreviewRedeemParams, type UseLeverageYieldQuoteParams, type UseLeverageYieldShareBalancesParams, type UseLeverageYieldTotalAssetsParams, type UseLeverageYieldVaultSwapVars, type UseLeverageYieldVaultSwapWithApprovalVars, type UseLeverageYieldWithdrawVars, type UseLiquidityAmountsResult, type UseMMAllowanceParams, type UseMMApproveVars, type UseMigrateBalnVars, type UseMigrateIcxToSodaVars, type UseMigratebnUSDVars, type UseMigrationAllowanceInputs, type UseMigrationAllowanceParams, type UseMigrationApproveVars, type UseNearStorageCheckParams, type UseNearStorageGateParams, type UseOpenLeveragePositionVars, 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 UseRunLeveragePositionOperationVars, type UseSetSwapPreferenceVars, type UseSetSwapPreferenceVarsHub, type UseSponsorConfigParams, type UseStatusParams, type UseStellarAccountActiveParams, type UseStellarAccountStatusParams, type UseStellarGateParams, type UseStellarTrustlineCheckParams, type UseSubmitLeveragePositionIntentVars, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApprovalStrategyParams, type UseSwapApproveVars, type UseSwapLifecycleParams, type UseSwapVars, type UseSwapWithApprovalVars, type UseSwapsApiAllowanceParams, type UseSwapsApiApproveAndBroadcastVars, type UseSwapsApiApproveVars, type UseSwapsApiBroadcastWithApprovalVars, 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, getBalancesQueryOptions, getBridgeDetailedStatusRefetchInterval, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, invalidateBalances, isBridgeNotDelivered, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, retryUnlessAuthFailure, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveLeveragePositionFunding, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOracleCandles, useBackendOracleMarkets, useBackendOrderbook, useBackendUserIntents, useBalances, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprovalStrategy, useBridgeApprove, useBridgeDetailedStatus, useBridgeWithApproval, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEModes, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeveragePositionAccount, useLeveragePositionCollateral, useLeveragePositionFundingAllowance, useLeveragePositionInfo, useLeveragePositionPayoutAddress, useLeveragePositionPending, useLeveragePositions, useLeveragePositionsForUser, useLeverageYieldApiAllowance, useLeverageYieldApiApprove, useLeverageYieldApiApproveAndBroadcast, useLeverageYieldApiApr, useLeverageYieldApiAsset, useLeverageYieldApiCancelIntent, useLeverageYieldApiCreateDepositIntent, useLeverageYieldApiCreateWithdrawIntent, useLeverageYieldApiDeadline, useLeverageYieldApiDepositQuote, useLeverageYieldApiEffectiveApr, useLeverageYieldApiEstimateGas, useLeverageYieldApiFilledIntent, useLeverageYieldApiIntent, useLeverageYieldApiIntentExtraData, useLeverageYieldApiIntentHash, useLeverageYieldApiIntentPacket, useLeverageYieldApiLsdApr, useLeverageYieldApiMaxWithdraw, useLeverageYieldApiPartnerFee, useLeverageYieldApiPosition, useLeverageYieldApiPreviewDeposit, useLeverageYieldApiPreviewRedeem, useLeverageYieldApiPreviewWithdraw, useLeverageYieldApiShareBalance, useLeverageYieldApiSolverFee, useLeverageYieldApiStatus, useLeverageYieldApiSubmitIntent, useLeverageYieldApiSubmitTx, useLeverageYieldApiSubmitTxStatus, useLeverageYieldApiTotalAssets, useLeverageYieldApiVault, useLeverageYieldApiVaults, useLeverageYieldApiWithdrawQuote, useLeverageYieldApprovalStrategy, useLeverageYieldDeposit, useLeverageYieldDetailedStatus, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, useLeverageYieldShareBalances, useLeverageYieldTotalAssets, useLeverageYieldVaultSwap, useLeverageYieldVaultSwapWithApproval, useLeverageYieldWithdraw, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, useNearStorageCheck, useNearStorageGate, useOpenLeveragePosition, usePartnerCancelIntent, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRegisterNearStorage, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useRunLeveragePositionOperation, useSafeMutation, useSetSwapPreference, useSodaxContext, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSubmitLeveragePositionIntent, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprovalStrategy, useSwapApprove, useSwapLifecycle, useSwapWithApproval, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, useSwapsApiBroadcastWithApproval, 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 };
|
|
4293
|
+
export { type ATokenData, type ApprovalHashes, type ApprovalPlan, type ApprovalProgress, type ApprovalProgressListener, type BackendPaginationParams, type BalancesInputs, type BitcoinTradingSetup, type BridgeApiApprovalHashes, type CreateSodaxQueryClientOptions, type DecreaseLiquidityParamsCore, type DepositParamsCore, type LeverageYieldApiApprovalHashes, type LeverageYieldShareHolder, type LeverageYieldShareHolding, type MutationHookOptions, type MutationHookParams, type NearStorageCheckResult, type NearStorageGate, type NearStorageGateState, type RadfiSession, type ReadHookParams, type ReadQueryOptions, type ReserveUsdFormat, type SafeUseMutationResult, SodaxProvider, type StellarCheckResult, type StellarGate, type StellarGateInputs, type StellarGateState, type SwapLifecycle, type SwapLifecycleState, type SwapSetupReason, type SwapsApiApprovalHashes, type SwapsApiBroadcastWithApprovalResult, type UseATokenParams, type UseATokensBalancesParams, type UseActivateStellarAccountVars, type UseApproveLeveragePositionFundingVars, type UseApproveTokenVars, type UseBalancesParams, type UseBitcoinBalanceParams, type UseBitcoinTradingSetupParams, type UseBorrowVars, type UseBridgeAllowanceParams, type UseBridgeApiAllowanceParams, type UseBridgeApiApproveAndBroadcastVars, type UseBridgeApiApproveVars, type UseBridgeApiBridgeableAmountParams, type UseBridgeApiCreateBridgeIntentVars, type UseBridgeApiFeeParams, type UseBridgeApiIsBridgeableParams, type UseBridgeApiSubmitTxStatusParams, type UseBridgeApiSubmitTxVars, type UseBridgeApiTokensByChainParams, type UseBridgeApiTokensParams, type UseBridgeApprovalStrategyParams, type UseBridgeApproveVars, type UseBridgeDetailedStatusParams, type UseBridgeDetailedStatusResult, type UseBridgeVars, type UseBridgeWithApprovalVars, type UseClaimRewardsVars, type UseCreateDecreaseLiquidityParamsProps, type UseCreateDepositParamsProps, type UseCreateLimitOrderVars, type UseCreateSupplyLiquidityParamsProps, type UseCreateSupplyLiquidityParamsResult, type UseCreateWithdrawParamsProps, type UseDecreaseLiquidityVars, type UseDeriveUserWalletAddressParams, type UseDetailedStatusParams, type UseDetailedStatusResult, type UseDexAllowanceParams, type UseDexApproveVars, type UseDexDepositVars, type UseDexWithdrawVars, type UseEModesParams, type UseEnsureRadfiAccessTokenVars, type UseEstablishTrustlineVars, type UseEstablishXrpTrustlineVars, 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 UseLeveragePositionAccountParams, type UseLeveragePositionCollateralParams, type UseLeveragePositionFundingAllowanceParams, type UseLeveragePositionInfoParams, type UseLeveragePositionPayoutAddressParams, type UseLeveragePositionPendingParams, type UseLeveragePositionsForUserParams, type UseLeveragePositionsParams, type UseLeverageYieldApiAllowanceParams, type UseLeverageYieldApiApproveAndBroadcastVars, type UseLeverageYieldApiApproveVars, type UseLeverageYieldApiAprParams, type UseLeverageYieldApiAssetParams, type UseLeverageYieldApiCancelIntentVars, type UseLeverageYieldApiCreateDepositIntentVars, type UseLeverageYieldApiCreateWithdrawIntentVars, type UseLeverageYieldApiDeadlineParams, type UseLeverageYieldApiDepositQuoteParams, type UseLeverageYieldApiEffectiveAprParams, type UseLeverageYieldApiEstimateGasParams, type UseLeverageYieldApiFilledIntentParams, type UseLeverageYieldApiIntentExtraDataParams, type UseLeverageYieldApiIntentHashParams, type UseLeverageYieldApiIntentPacketParams, type UseLeverageYieldApiIntentParams, type UseLeverageYieldApiLsdAprParams, type UseLeverageYieldApiMaxWithdrawParams, type UseLeverageYieldApiPartnerFeeParams, type UseLeverageYieldApiPositionParams, type UseLeverageYieldApiPreviewDepositParams, type UseLeverageYieldApiPreviewRedeemParams, type UseLeverageYieldApiPreviewWithdrawParams, type UseLeverageYieldApiShareBalanceParams, type UseLeverageYieldApiSolverFeeParams, type UseLeverageYieldApiStatusParams, type UseLeverageYieldApiSubmitIntentVars, type UseLeverageYieldApiSubmitTxStatusParams, type UseLeverageYieldApiSubmitTxVars, type UseLeverageYieldApiTotalAssetsParams, type UseLeverageYieldApiVaultParams, type UseLeverageYieldApiVaultsParams, type UseLeverageYieldApiWithdrawQuoteParams, type UseLeverageYieldApprovalStrategyParams, type UseLeverageYieldDepositVars, type UseLeverageYieldDetailedStatusParams, type UseLeverageYieldDetailedStatusResult, type UseLeverageYieldEffectiveAprParams, type UseLeverageYieldNotifySolverVars, type UseLeverageYieldPositionParams, type UseLeverageYieldPreviewRedeemParams, type UseLeverageYieldQuoteParams, type UseLeverageYieldShareBalancesParams, type UseLeverageYieldTotalAssetsParams, type UseLeverageYieldVaultSwapVars, type UseLeverageYieldVaultSwapWithApprovalVars, type UseLeverageYieldWithdrawVars, type UseLiquidityAmountsResult, type UseMMAllowanceParams, type UseMMApproveVars, type UseMigrateBalnVars, type UseMigrateIcxToSodaVars, type UseMigratebnUSDVars, type UseMigrationAllowanceInputs, type UseMigrationAllowanceParams, type UseMigrationApproveVars, type UseNearStorageCheckParams, type UseNearStorageGateParams, type UseOpenLeveragePositionVars, 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 UseRunLeveragePositionOperationVars, type UseSetSwapPreferenceVars, type UseSetSwapPreferenceVarsHub, type UseSponsorConfigParams, type UseStatusParams, type UseStellarAccountActiveParams, type UseStellarAccountStatusParams, type UseStellarGateParams, type UseStellarTrustlineCheckParams, type UseSubmitLeveragePositionIntentVars, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApprovalStrategyParams, type UseSwapApproveVars, type UseSwapLifecycleParams, type UseSwapVars, type UseSwapWithApprovalVars, type UseSwapsApiAllowanceParams, type UseSwapsApiApproveAndBroadcastVars, type UseSwapsApiApproveVars, type UseSwapsApiBroadcastWithApprovalVars, 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 UseXrpDestinationCheckParams, type UseXrpGateParams, type UseXrpTrustlineReserveCheckParams, type WithdrawParamsCore, type XBalancesInputs, type XrpBlockedReason, type XrpCheckResult, type XrpGate, type XrpGateInputs, type XrpGateState, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getBalancesQueryOptions, getBridgeDetailedStatusRefetchInterval, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, getXrpDestinationCheckQueryOptions, getXrpTrustlineReserveCheckQueryOptions, invalidateBalances, isBridgeMpcRelayRead, isBridgeNotDelivered, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, resolveXrpGate, retryUnlessAuthFailure, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveLeveragePositionFunding, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOracleCandles, useBackendOracleMarkets, useBackendOrderbook, useBackendUserIntents, useBalances, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprovalStrategy, useBridgeApprove, useBridgeDetailedStatus, useBridgeWithApproval, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEModes, useEnsureRadfiAccessToken, useEstablishTrustline, useEstablishXrpTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeveragePositionAccount, useLeveragePositionCollateral, useLeveragePositionFundingAllowance, useLeveragePositionInfo, useLeveragePositionPayoutAddress, useLeveragePositionPending, useLeveragePositions, useLeveragePositionsForUser, useLeverageYieldApiAllowance, useLeverageYieldApiApprove, useLeverageYieldApiApproveAndBroadcast, useLeverageYieldApiApr, useLeverageYieldApiAsset, useLeverageYieldApiCancelIntent, useLeverageYieldApiCreateDepositIntent, useLeverageYieldApiCreateWithdrawIntent, useLeverageYieldApiDeadline, useLeverageYieldApiDepositQuote, useLeverageYieldApiEffectiveApr, useLeverageYieldApiEstimateGas, useLeverageYieldApiFilledIntent, useLeverageYieldApiIntent, useLeverageYieldApiIntentExtraData, useLeverageYieldApiIntentHash, useLeverageYieldApiIntentPacket, useLeverageYieldApiLsdApr, useLeverageYieldApiMaxWithdraw, useLeverageYieldApiPartnerFee, useLeverageYieldApiPosition, useLeverageYieldApiPreviewDeposit, useLeverageYieldApiPreviewRedeem, useLeverageYieldApiPreviewWithdraw, useLeverageYieldApiShareBalance, useLeverageYieldApiSolverFee, useLeverageYieldApiStatus, useLeverageYieldApiSubmitIntent, useLeverageYieldApiSubmitTx, useLeverageYieldApiSubmitTxStatus, useLeverageYieldApiTotalAssets, useLeverageYieldApiVault, useLeverageYieldApiVaults, useLeverageYieldApiWithdrawQuote, useLeverageYieldApprovalStrategy, useLeverageYieldDeposit, useLeverageYieldDetailedStatus, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, useLeverageYieldShareBalances, useLeverageYieldTotalAssets, useLeverageYieldVaultSwap, useLeverageYieldVaultSwapWithApproval, useLeverageYieldWithdraw, useLiquidityAmounts, useMMAllowance, useMMApprove, useMigrateBaln, useMigrateIcxToSoda, useMigratebnUSD, useMigrationAllowance, useMigrationApprove, useNearStorageCheck, useNearStorageGate, useOpenLeveragePosition, usePartnerCancelIntent, usePoolBalances, usePoolData, usePools, usePositionInfo, useQuote, useRadfiAuth, useRadfiSession, useRadfiWithdraw, useRegisterNearStorage, useRenewUtxos, useRepay, useRequestTrustline, useReservesData, useReservesHumanized, useReservesList, useReservesUsdFormat, useRevertMigrateSodaToIcx, useRunLeveragePositionOperation, useSafeMutation, useSetSwapPreference, useSodaxContext, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSubmitLeveragePositionIntent, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprovalStrategy, useSwapApprove, useSwapLifecycle, useSwapWithApproval, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, useSwapsApiBroadcastWithApproval, 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, useXrpDestinationCheck, useXrpGate, useXrpTrustlineReserveCheck };
|