@sodax/dapp-kit 2.1.0-rc.9 → 2.2.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +25 -6
- package/dist/index.mjs +29 -23
- package/package.json +2 -2
- package/src/hooks/_apiKeyWire.test.ts +487 -0
- package/src/hooks/bridge/useBridge.test.ts +104 -0
- package/src/hooks/shared/index.ts +1 -0
- package/src/hooks/shared/retryUnlessAuthFailure.test.ts +38 -0
- package/src/hooks/shared/retryUnlessAuthFailure.ts +18 -0
- package/src/hooks/sponsoring/useActivateStellarAccount.wire.test.ts +109 -0
- package/src/hooks/swap/useSwap.test.ts +128 -0
- package/src/hooks/swapsApi/useSwapsApiAllowance.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiApprove.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiCancelIntent.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiCreateIntent.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiCreateLimitOrder.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiDeadline.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiEstimateGas.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiFilledIntent.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiIntent.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiIntentExtraData.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiIntentHash.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiIntentPacket.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiPartnerFee.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiQuote.ts +5 -1
- package/src/hooks/swapsApi/useSwapsApiSolverFee.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiStatus.ts +10 -4
- package/src/hooks/swapsApi/useSwapsApiSubmitTx.ts +5 -3
- package/src/hooks/swapsApi/useSwapsApiSubmitTxStatus.ts +8 -4
- package/src/hooks/swapsApi/useSwapsApiTokens.ts +2 -1
- package/src/hooks/swapsApi/useSwapsApiTokensByChain.ts +2 -1
- package/src/providers/SodaxProvider.test.ts +41 -0
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,19 @@ import { ReactNode, ReactElement } from 'react';
|
|
|
32
32
|
*/
|
|
33
33
|
declare function isUserRejectedError(error: unknown): boolean;
|
|
34
34
|
|
|
35
|
+
/**
|
|
36
|
+
* Default React Query `retry` policy for the backend swaps-API hooks: replay a transport blip, never a
|
|
37
|
+
* terminal API-key rejection (see `isAuthFailure`). Retrying a rejected key only multiplies doomed
|
|
38
|
+
* requests before the consumer sees the error.
|
|
39
|
+
*
|
|
40
|
+
* Override or compose it through `queryOptions` / `mutationOptions`:
|
|
41
|
+
*
|
|
42
|
+
* ```ts
|
|
43
|
+
* useSwapsApiQuote({ params: { body }, queryOptions: { retry: 5 } });
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
declare const retryUnlessAuthFailure: (failureCount: number, error: unknown) => boolean;
|
|
47
|
+
|
|
35
48
|
/**
|
|
36
49
|
* Subset of `UseQueryOptions` consumers may override on dapp-kit read hooks.
|
|
37
50
|
*
|
|
@@ -1080,6 +1093,9 @@ type UseSwapsApiQuoteParams = ReadHookParams<QuoteResponseV2 | undefined, {
|
|
|
1080
1093
|
* amount: '1000000', quoteType: 'exact_input',
|
|
1081
1094
|
* partnerFee: { address: '0xSonicFeeReceiver', percentage: 10 },
|
|
1082
1095
|
* },
|
|
1096
|
+
* // Optional per-request override of the configured backend API key (`x-api-key`);
|
|
1097
|
+
* // usually set once instead via new Sodax({ apiKey }).
|
|
1098
|
+
* apiConfig: { apiKey: 'partner-api-key' },
|
|
1083
1099
|
* },
|
|
1084
1100
|
* });
|
|
1085
1101
|
*/
|
|
@@ -1262,7 +1278,8 @@ type UseSwapsApiStatusParams = ReadHookParams<StatusResponseV2 | undefined, {
|
|
|
1262
1278
|
* const { data } = useSwapsApiStatus({ params: { intentTxHash: '0x123...' } });
|
|
1263
1279
|
*
|
|
1264
1280
|
* @remarks
|
|
1265
|
-
* - Default refetch interval is 1 second; stops once `status` is `3` (SOLVED) or `4` (FAILED)
|
|
1281
|
+
* - Default refetch interval is 1 second; stops once `status` is `3` (SOLVED) or `4` (FAILED), or
|
|
1282
|
+
* once the backend rejects the API key (401/403 is terminal — a retry cannot fix it).
|
|
1266
1283
|
*/
|
|
1267
1284
|
declare const useSwapsApiStatus: ({ params, queryOptions, }?: UseSwapsApiStatusParams) => UseQueryResult<StatusResponseV2 | undefined, Error>;
|
|
1268
1285
|
|
|
@@ -1435,8 +1452,9 @@ type UseSwapsApiSubmitTxVars = {
|
|
|
1435
1452
|
* React hook for submitting a swap transaction to be processed (relay, post execution to the
|
|
1436
1453
|
* solver, etc.) via the swaps API — `sodax.api.swaps.submitTx`.
|
|
1437
1454
|
*
|
|
1438
|
-
* Pure mutation: pass `{ request, apiConfig? }` to `mutate({...})`.
|
|
1439
|
-
*
|
|
1455
|
+
* Pure mutation: pass `{ request, apiConfig? }` to `mutate({...})`. Retries up to 3 times at the hook
|
|
1456
|
+
* level, except on a terminal API-key rejection (401/403) — see `retryUnlessAuthFailure`. Consumers
|
|
1457
|
+
* can override via `mutationOptions.retry`.
|
|
1440
1458
|
*
|
|
1441
1459
|
* @example
|
|
1442
1460
|
* const { mutateAsync: submitSwapTx, isPending, error } = useSwapsApiSubmitTx();
|
|
@@ -1464,8 +1482,9 @@ type UseSwapsApiSubmitTxStatusParams = ReadHookParams<SubmitTxStatusResponseV2 |
|
|
|
1464
1482
|
* });
|
|
1465
1483
|
*
|
|
1466
1484
|
* @remarks
|
|
1467
|
-
* - Default refetch interval is 1 second; stops on 'solved' or 'failed' status,
|
|
1468
|
-
* backend marks the submission abandoned (`abandonedAt`) while `status` stays non-terminal
|
|
1485
|
+
* - Default refetch interval is 1 second; stops on 'solved' or 'failed' status, when the
|
|
1486
|
+
* backend marks the submission abandoned (`abandonedAt`) while `status` stays non-terminal, or
|
|
1487
|
+
* once the backend rejects the API key (401/403 is terminal — a retry cannot fix it).
|
|
1469
1488
|
*/
|
|
1470
1489
|
declare const useSwapsApiSubmitTxStatus: ({ params, queryOptions, }?: UseSwapsApiSubmitTxStatusParams) => UseQueryResult<SubmitTxStatusResponseV2 | undefined, Error>;
|
|
1471
1490
|
|
|
@@ -2866,4 +2885,4 @@ interface NearStorageGateState {
|
|
|
2866
2885
|
*/
|
|
2867
2886
|
declare function resolveNearStorageGate(chainKey: SpokeChainKey, check: NearStorageCheckResult): NearStorageGateState;
|
|
2868
2887
|
|
|
2869
|
-
export { type ATokenData, type ApprovalHashes, type ApprovalPlan, type ApprovalProgress, type ApprovalProgressListener, type BackendPaginationParams, type BitcoinTradingSetup, type BridgeApiApprovalHashes, 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 StellarCheckResult, type StellarGate, type StellarGateInputs, type StellarGateState, type SwapsApiApprovalHashes, type UseATokenParams, type UseATokensBalancesParams, type UseActivateStellarAccountVars, type UseApproveTokenVars, 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 UseBridgeApproveVars, type UseBridgeVars, 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 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 UseLeverageYieldDepositVars, type UseLeverageYieldEffectiveAprParams, type UseLeverageYieldNotifySolverVars, type UseLeverageYieldPositionParams, type UseLeverageYieldPreviewRedeemParams, type UseLeverageYieldQuoteParams, 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 UseSponsorConfigParams, type UseStatusParams, type UseStellarAccountActiveParams, type UseStellarAccountStatusParams, type UseStellarGateParams, type UseStellarTrustlineCheckParams, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApproveVars, type UseSwapVars, type UseSwapsApiAllowanceParams, type UseSwapsApiApproveAndBroadcastVars, 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, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, 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, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, 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 };
|
|
2888
|
+
export { type ATokenData, type ApprovalHashes, type ApprovalPlan, type ApprovalProgress, type ApprovalProgressListener, type BackendPaginationParams, type BitcoinTradingSetup, type BridgeApiApprovalHashes, 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 StellarCheckResult, type StellarGate, type StellarGateInputs, type StellarGateState, type SwapsApiApprovalHashes, type UseATokenParams, type UseATokensBalancesParams, type UseActivateStellarAccountVars, type UseApproveTokenVars, 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 UseBridgeApproveVars, type UseBridgeVars, 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 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 UseLeverageYieldDepositVars, type UseLeverageYieldEffectiveAprParams, type UseLeverageYieldNotifySolverVars, type UseLeverageYieldPositionParams, type UseLeverageYieldPreviewRedeemParams, type UseLeverageYieldQuoteParams, 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 UseSponsorConfigParams, type UseStatusParams, type UseStellarAccountActiveParams, type UseStellarAccountStatusParams, type UseStellarGateParams, type UseStellarTrustlineCheckParams, type UseSupplyLiquidityVars, type UseSupplyVars, type UseSwapAllowanceParams, type UseSwapApproveVars, type UseSwapVars, type UseSwapsApiAllowanceParams, type UseSwapsApiApproveAndBroadcastVars, 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, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, retryUnlessAuthFailure, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, 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, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, 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 };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isSodaxError, ChainKeys, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, RadfiApiError, normalizePsbtToBase64, ClService, SPONSOR_CONFIG_TTL_MS, Sodax, SolverIntentStatusCode, DETAILED_STATUS_NOT_DELIVERED, isApprovalSupportedChainKeyType, isHubChainKeyType, isEvmSpokeOnlyChainKeyType, isStellarChainKeyType } from '@sodax/sdk';
|
|
1
|
+
import { isSodaxError, isAuthFailure, ChainKeys, STELLAR_TRUSTLINE_MIN_XLM_STROOPS, RadfiApiError, normalizePsbtToBase64, ClService, SPONSOR_CONFIG_TTL_MS, Sodax, SolverIntentStatusCode, DETAILED_STATUS_NOT_DELIVERED, isApprovalSupportedChainKeyType, isHubChainKeyType, isEvmSpokeOnlyChainKeyType, isStellarChainKeyType } from '@sodax/sdk';
|
|
2
2
|
export * from '@sodax/sdk';
|
|
3
3
|
import { useMutation, useQuery, useQueryClient, useQueries, QueryClient, MutationCache } from '@tanstack/react-query';
|
|
4
4
|
import { createContext, useCallback, useContext, useRef, useState, useEffect, useMemo } from 'react';
|
|
@@ -9,6 +9,8 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
9
9
|
function isUserRejectedError(error) {
|
|
10
10
|
return isSodaxError(error) && error.code === "USER_REJECTED";
|
|
11
11
|
}
|
|
12
|
+
var MAX_RETRIES = 3;
|
|
13
|
+
var retryUnlessAuthFailure = (failureCount, error) => !isAuthFailure(error) && failureCount < MAX_RETRIES;
|
|
12
14
|
|
|
13
15
|
// src/hooks/shared/unwrapResult.ts
|
|
14
16
|
function unwrapResult(result) {
|
|
@@ -1509,7 +1511,7 @@ var useSwapsApiTokens = ({
|
|
|
1509
1511
|
return useQuery({
|
|
1510
1512
|
queryKey: ["swapsApi", "tokens"],
|
|
1511
1513
|
queryFn: async () => unwrapResult(await sodax.api.swaps.getTokens(apiConfig)),
|
|
1512
|
-
retry:
|
|
1514
|
+
retry: retryUnlessAuthFailure,
|
|
1513
1515
|
...queryOptions
|
|
1514
1516
|
});
|
|
1515
1517
|
};
|
|
@@ -1527,7 +1529,7 @@ var useSwapsApiTokensByChain = ({
|
|
|
1527
1529
|
return unwrapResult(await sodax.api.swaps.getTokensByChain(chainKey, apiConfig));
|
|
1528
1530
|
},
|
|
1529
1531
|
enabled: !!chainKey && chainKey.length > 0,
|
|
1530
|
-
retry:
|
|
1532
|
+
retry: retryUnlessAuthFailure,
|
|
1531
1533
|
...queryOptions
|
|
1532
1534
|
});
|
|
1533
1535
|
};
|
|
@@ -1550,7 +1552,7 @@ var useSwapsApiQuote = ({
|
|
|
1550
1552
|
return unwrapResult(await sodax.api.swaps.getQuote(body, query, apiConfig));
|
|
1551
1553
|
},
|
|
1552
1554
|
enabled: !!body,
|
|
1553
|
-
retry:
|
|
1555
|
+
retry: retryUnlessAuthFailure,
|
|
1554
1556
|
...queryOptions
|
|
1555
1557
|
});
|
|
1556
1558
|
};
|
|
@@ -1564,7 +1566,7 @@ var useSwapsApiDeadline = ({
|
|
|
1564
1566
|
return useQuery({
|
|
1565
1567
|
queryKey: ["swapsApi", "deadline", query?.offsetSeconds ?? null],
|
|
1566
1568
|
queryFn: async () => unwrapResult(await sodax.api.swaps.getDeadline(query, apiConfig)),
|
|
1567
|
-
retry:
|
|
1569
|
+
retry: retryUnlessAuthFailure,
|
|
1568
1570
|
...queryOptions
|
|
1569
1571
|
});
|
|
1570
1572
|
};
|
|
@@ -1582,7 +1584,7 @@ var useSwapsApiAllowance = ({
|
|
|
1582
1584
|
return unwrapResult(await sodax.api.swaps.checkAllowance(body, apiConfig));
|
|
1583
1585
|
},
|
|
1584
1586
|
enabled: !!body,
|
|
1585
|
-
retry:
|
|
1587
|
+
retry: retryUnlessAuthFailure,
|
|
1586
1588
|
...queryOptions
|
|
1587
1589
|
});
|
|
1588
1590
|
};
|
|
@@ -1594,7 +1596,7 @@ var useSwapsApiApprove = ({
|
|
|
1594
1596
|
const { sodax } = useSodaxContext();
|
|
1595
1597
|
return useSafeMutation({
|
|
1596
1598
|
mutationKey: ["swapsApi", "approve"],
|
|
1597
|
-
retry:
|
|
1599
|
+
retry: retryUnlessAuthFailure,
|
|
1598
1600
|
...mutationOptions,
|
|
1599
1601
|
mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.approve(body, apiConfig))
|
|
1600
1602
|
});
|
|
@@ -1707,7 +1709,7 @@ var useSwapsApiCreateIntent = ({
|
|
|
1707
1709
|
const { sodax } = useSodaxContext();
|
|
1708
1710
|
return useSafeMutation({
|
|
1709
1711
|
mutationKey: ["swapsApi", "createIntent"],
|
|
1710
|
-
retry:
|
|
1712
|
+
retry: retryUnlessAuthFailure,
|
|
1711
1713
|
...mutationOptions,
|
|
1712
1714
|
mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.createIntent(body, apiConfig))
|
|
1713
1715
|
});
|
|
@@ -1744,8 +1746,11 @@ var useSwapsApiStatus = ({
|
|
|
1744
1746
|
return unwrapResult(await sodax.api.swaps.getStatus({ intentTxHash }, apiConfig));
|
|
1745
1747
|
},
|
|
1746
1748
|
enabled: !!intentTxHash && intentTxHash.length > 0,
|
|
1747
|
-
retry:
|
|
1748
|
-
refetchInterval: (query) =>
|
|
1749
|
+
retry: retryUnlessAuthFailure,
|
|
1750
|
+
refetchInterval: (query) => {
|
|
1751
|
+
if (isAuthFailure(query.state.error)) return false;
|
|
1752
|
+
return isTerminalSwapIntentStatus(query.state.data?.status) ? false : 1e3;
|
|
1753
|
+
},
|
|
1749
1754
|
...queryOptions
|
|
1750
1755
|
});
|
|
1751
1756
|
};
|
|
@@ -1757,7 +1762,7 @@ var useSwapsApiCancelIntent = ({
|
|
|
1757
1762
|
const { sodax } = useSodaxContext();
|
|
1758
1763
|
return useSafeMutation({
|
|
1759
1764
|
mutationKey: ["swapsApi", "cancelIntent"],
|
|
1760
|
-
retry:
|
|
1765
|
+
retry: retryUnlessAuthFailure,
|
|
1761
1766
|
...mutationOptions,
|
|
1762
1767
|
mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.cancelIntent(body, apiConfig))
|
|
1763
1768
|
});
|
|
@@ -1776,7 +1781,7 @@ var useSwapsApiIntentHash = ({
|
|
|
1776
1781
|
return unwrapResult(await sodax.api.swaps.getIntentHash({ intent }, apiConfig));
|
|
1777
1782
|
},
|
|
1778
1783
|
enabled: !!intent,
|
|
1779
|
-
retry:
|
|
1784
|
+
retry: retryUnlessAuthFailure,
|
|
1780
1785
|
...queryOptions
|
|
1781
1786
|
});
|
|
1782
1787
|
};
|
|
@@ -1794,7 +1799,7 @@ var useSwapsApiIntentPacket = ({
|
|
|
1794
1799
|
return unwrapResult(await sodax.api.swaps.getSolvedIntentPacket(body, apiConfig));
|
|
1795
1800
|
},
|
|
1796
1801
|
enabled: !!body,
|
|
1797
|
-
retry:
|
|
1802
|
+
retry: retryUnlessAuthFailure,
|
|
1798
1803
|
...queryOptions
|
|
1799
1804
|
});
|
|
1800
1805
|
};
|
|
@@ -1812,7 +1817,7 @@ var useSwapsApiIntentExtraData = ({
|
|
|
1812
1817
|
return unwrapResult(await sodax.api.swaps.getIntentSubmitTxExtraData(body, apiConfig));
|
|
1813
1818
|
},
|
|
1814
1819
|
enabled: !!body && (!!body.txHash || !!body.intent),
|
|
1815
|
-
retry:
|
|
1820
|
+
retry: retryUnlessAuthFailure,
|
|
1816
1821
|
...queryOptions
|
|
1817
1822
|
});
|
|
1818
1823
|
};
|
|
@@ -1830,7 +1835,7 @@ var useSwapsApiFilledIntent = ({
|
|
|
1830
1835
|
return unwrapResult(await sodax.api.swaps.getFilledIntent(txHash, apiConfig));
|
|
1831
1836
|
},
|
|
1832
1837
|
enabled: !!txHash && txHash.length > 0,
|
|
1833
|
-
retry:
|
|
1838
|
+
retry: retryUnlessAuthFailure,
|
|
1834
1839
|
...queryOptions
|
|
1835
1840
|
});
|
|
1836
1841
|
};
|
|
@@ -1848,7 +1853,7 @@ var useSwapsApiIntent = ({
|
|
|
1848
1853
|
return unwrapResult(await sodax.api.swaps.getIntent(txHash, apiConfig));
|
|
1849
1854
|
},
|
|
1850
1855
|
enabled: !!txHash && txHash.length > 0,
|
|
1851
|
-
retry:
|
|
1856
|
+
retry: retryUnlessAuthFailure,
|
|
1852
1857
|
...queryOptions
|
|
1853
1858
|
});
|
|
1854
1859
|
};
|
|
@@ -1860,7 +1865,7 @@ var useSwapsApiCreateLimitOrder = ({
|
|
|
1860
1865
|
const { sodax } = useSodaxContext();
|
|
1861
1866
|
return useSafeMutation({
|
|
1862
1867
|
mutationKey: ["swapsApi", "createLimitOrder"],
|
|
1863
|
-
retry:
|
|
1868
|
+
retry: retryUnlessAuthFailure,
|
|
1864
1869
|
...mutationOptions,
|
|
1865
1870
|
mutationFn: async ({ body, apiConfig }) => unwrapResult(await sodax.api.swaps.createLimitOrderIntent(body, apiConfig))
|
|
1866
1871
|
});
|
|
@@ -1879,7 +1884,7 @@ var useSwapsApiEstimateGas = ({
|
|
|
1879
1884
|
return unwrapResult(await sodax.api.swaps.estimateGas(body, apiConfig));
|
|
1880
1885
|
},
|
|
1881
1886
|
enabled: !!body,
|
|
1882
|
-
retry:
|
|
1887
|
+
retry: retryUnlessAuthFailure,
|
|
1883
1888
|
...queryOptions
|
|
1884
1889
|
});
|
|
1885
1890
|
};
|
|
@@ -1897,7 +1902,7 @@ var useSwapsApiPartnerFee = ({
|
|
|
1897
1902
|
return unwrapResult(await sodax.api.swaps.getPartnerFee({ amount }, apiConfig));
|
|
1898
1903
|
},
|
|
1899
1904
|
enabled: !!amount && amount.length > 0,
|
|
1900
|
-
retry:
|
|
1905
|
+
retry: retryUnlessAuthFailure,
|
|
1901
1906
|
...queryOptions
|
|
1902
1907
|
});
|
|
1903
1908
|
};
|
|
@@ -1915,7 +1920,7 @@ var useSwapsApiSolverFee = ({
|
|
|
1915
1920
|
return unwrapResult(await sodax.api.swaps.getSolverFee({ amount }, apiConfig));
|
|
1916
1921
|
},
|
|
1917
1922
|
enabled: !!amount && amount.length > 0,
|
|
1918
|
-
retry:
|
|
1923
|
+
retry: retryUnlessAuthFailure,
|
|
1919
1924
|
...queryOptions
|
|
1920
1925
|
});
|
|
1921
1926
|
};
|
|
@@ -1927,7 +1932,7 @@ var useSwapsApiSubmitTx = ({
|
|
|
1927
1932
|
const { sodax } = useSodaxContext();
|
|
1928
1933
|
return useSafeMutation({
|
|
1929
1934
|
mutationKey: ["swapsApi", "submitTx"],
|
|
1930
|
-
retry:
|
|
1935
|
+
retry: retryUnlessAuthFailure,
|
|
1931
1936
|
...mutationOptions,
|
|
1932
1937
|
mutationFn: async ({ request, apiConfig }) => unwrapResult(await sodax.api.swaps.submitTx(request, apiConfig))
|
|
1933
1938
|
});
|
|
@@ -1947,8 +1952,9 @@ var useSwapsApiSubmitTxStatus = ({
|
|
|
1947
1952
|
return unwrapResult(await sodax.api.swaps.getSubmitTxStatus({ txHash, srcChainKey }, apiConfig));
|
|
1948
1953
|
},
|
|
1949
1954
|
enabled: !!txHash && txHash.length > 0 && !!srcChainKey,
|
|
1950
|
-
retry:
|
|
1955
|
+
retry: retryUnlessAuthFailure,
|
|
1951
1956
|
refetchInterval: (query) => {
|
|
1957
|
+
if (isAuthFailure(query.state.error)) return false;
|
|
1952
1958
|
const data = query.state.data?.data;
|
|
1953
1959
|
if (data?.status === "solved" || data?.status === "failed" || data?.abandonedAt) return false;
|
|
1954
1960
|
return 1e3;
|
|
@@ -3857,4 +3863,4 @@ function createSodaxQueryClient({
|
|
|
3857
3863
|
});
|
|
3858
3864
|
}
|
|
3859
3865
|
|
|
3860
|
-
export { SodaxProvider, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, 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, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, 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 };
|
|
3866
|
+
export { SodaxProvider, clearRadfiSession, createDecreaseLiquidityParamsProps, createDepositParamsProps, createSodaxQueryClient, createSupplyLiquidityParamsProps, createWithdrawParamsProps, getLeverageYieldQuoteQueryOptions, getSponsorConfigQueryOptions, getStellarAccountActiveQueryOptions, getStellarAccountStatusQueryOptions, getStellarTrustlineCheckQueryOptions, getSwapQuoteQueryOptions, getXBalancesQueryOptions, isTerminalSwapIntentStatus, isUserRejectedError, loadRadfiSession, resolveNearStorageGate, resolveStellarGate, retryUnlessAuthFailure, runApprovalPlan, saveRadfiSession, toResult, unwrapResult, useAToken, useATokensBalances, useActivateStellarAccount, useApproveToken, useBackendAllMoneyMarketAssets, useBackendAllMoneyMarketBorrowers, useBackendIntentByHash, useBackendIntentByTxHash, useBackendMoneyMarketAsset, useBackendMoneyMarketAssetBorrowers, useBackendMoneyMarketAssetSuppliers, useBackendMoneyMarketPosition, useBackendOrderbook, useBackendUserIntents, useBitcoinBalance, useBitcoinTradingSetup, useBorrow, useBridge, useBridgeAllowance, useBridgeApiAllowance, useBridgeApiApprove, useBridgeApiApproveAndBroadcast, useBridgeApiBridgeableAmount, useBridgeApiCreateBridgeIntent, useBridgeApiFee, useBridgeApiIsBridgeable, useBridgeApiSubmitTx, useBridgeApiSubmitTxStatus, useBridgeApiTokens, useBridgeApiTokensByChain, useBridgeApprove, useCancelLimitOrder, useCancelSwap, useCancelUnstake, useClaim, useClaimRewards, useConvertedAssets, useCreateDecreaseLiquidityParams, useCreateDepositParams, useCreateLimitOrder, useCreateSupplyLiquidityParams, useCreateWithdrawParams, useDecreaseLiquidity, useDeriveUserWalletAddress, useDetailedStatus, useDexAllowance, useDexApprove, useDexDeposit, useDexWithdraw, useEnsureRadfiAccessToken, useEstablishTrustline, useEstimateGas, useExpiredUtxos, useFeeClaimSwap, useFeeClaimWithdraw, useFetchAssetsBalances, useFundTradingWallet, useGetAutoSwapPreferences, useGetBridgeableAmount, useGetBridgeableTokens, useGetIntentDetails, useGetUserHubWalletAddress, useGetUserIntent, useHubAssetBalances, useHubProvider, useInstantUnstake, useInstantUnstakeAllowance, useInstantUnstakeApprove, useInstantUnstakeRatio, useIsTokenApproved, useLeverageYieldDeposit, useLeverageYieldEffectiveApr, useLeverageYieldNotifySolver, useLeverageYieldPosition, useLeverageYieldPreviewRedeem, useLeverageYieldQuote, 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, useSponsorConfig, useStake, useStakeAllowance, useStakeApprove, useStakeRatio, useStakingConfig, useStakingInfo, useStatus, useStellarAccountActive, useStellarAccountStatus, useStellarGate, useStellarTrustlineCheck, useSupply, useSupplyLiquidity, useSwap, useSwapAllowance, useSwapApprove, useSwapsApiAllowance, useSwapsApiApprove, useSwapsApiApproveAndBroadcast, 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 };
|
package/package.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
7
7
|
"license": "MIT",
|
|
8
|
-
"version": "2.
|
|
8
|
+
"version": "2.2.0-rc.1",
|
|
9
9
|
"description": "React hooks for building dApps on the SODAX cross-chain DeFi platform",
|
|
10
10
|
"keywords": [
|
|
11
11
|
"sodax",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"viem": "2.29.2",
|
|
37
|
-
"@sodax/sdk": "2.
|
|
37
|
+
"@sodax/sdk": "2.2.0-rc.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@arethetypeswrong/cli": "0.17.4",
|