@sodax/dapp-kit 2.4.0-rc.2 → 2.4.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (283) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +279 -2428
  3. package/dist/index.mjs +15 -24
  4. package/package.json +2 -2
  5. package/src/hooks/_apiKeyWire.test.ts +4 -29
  6. package/src/hooks/_mutationContract.test.ts +1 -8
  7. package/src/hooks/backend/index.ts +0 -13
  8. package/src/hooks/backend/useBackendAllMoneyMarketAssets.ts +0 -6
  9. package/src/hooks/backend/useBackendAllMoneyMarketBorrowers.ts +0 -10
  10. package/src/hooks/backend/useBackendIntentByHash.ts +0 -6
  11. package/src/hooks/backend/useBackendIntentByTxHash.ts +1 -10
  12. package/src/hooks/backend/useBackendMoneyMarketAsset.ts +0 -6
  13. package/src/hooks/backend/useBackendMoneyMarketAssetBorrowers.ts +0 -8
  14. package/src/hooks/backend/useBackendMoneyMarketAssetSuppliers.ts +0 -8
  15. package/src/hooks/backend/useBackendMoneyMarketPosition.ts +0 -6
  16. package/src/hooks/backend/useBackendOracleCandles.ts +1 -9
  17. package/src/hooks/backend/useBackendOracleMarkets.ts +1 -7
  18. package/src/hooks/backend/useBackendOrderbook.ts +0 -6
  19. package/src/hooks/backend/useBackendUserIntents.ts +0 -8
  20. package/src/hooks/bitcoin/resolveBtcReadAddress.test.ts +1 -3
  21. package/src/hooks/bitcoin/resolveBtcReadAddress.ts +2 -12
  22. package/src/hooks/bitcoin/useBitcoinBalance.ts +1 -7
  23. package/src/hooks/bitcoin/useBitcoinTradingSetup.ts +2 -4
  24. package/src/hooks/bitcoin/useEnsureRadfiAccessToken.ts +2 -13
  25. package/src/hooks/bitcoin/useFundTradingWallet.ts +0 -6
  26. package/src/hooks/bitcoin/useRadfiAuth.ts +1 -6
  27. package/src/hooks/bitcoin/useRadfiSession.ts +0 -1
  28. package/src/hooks/bitcoin/useRadfiWithdraw.ts +0 -6
  29. package/src/hooks/bitcoin/useRenewUtxos.ts +0 -5
  30. package/src/hooks/bitcoin/useTradingWallet.ts +1 -4
  31. package/src/hooks/bridge/getBridgeDetailedStatusRefetchInterval.test.ts +1 -7
  32. package/src/hooks/bridge/getBridgeDetailedStatusRefetchInterval.ts +7 -21
  33. package/src/hooks/bridge/useBridge.test.ts +1 -11
  34. package/src/hooks/bridge/useBridge.ts +2 -12
  35. package/src/hooks/bridge/useBridgeAllowance.ts +1 -2
  36. package/src/hooks/bridge/useBridgeApprovalStrategy.ts +2 -6
  37. package/src/hooks/bridge/useBridgeApprove.ts +2 -14
  38. package/src/hooks/bridge/useBridgeDetailedStatus.test.ts +2 -11
  39. package/src/hooks/bridge/useBridgeDetailedStatus.ts +3 -23
  40. package/src/hooks/bridge/useBridgeWithApproval.ts +2 -11
  41. package/src/hooks/bridgeApi/getBridgeSubmitTxStatusRefetchInterval.test.ts +2 -7
  42. package/src/hooks/bridgeApi/getBridgeSubmitTxStatusRefetchInterval.ts +2 -13
  43. package/src/hooks/bridgeApi/index.ts +11 -14
  44. package/src/hooks/bridgeApi/useBridgeApiAllowance.ts +1 -9
  45. package/src/hooks/bridgeApi/useBridgeApiApprove.ts +2 -17
  46. package/src/hooks/bridgeApi/useBridgeApiApproveAndBroadcast.test.ts +2 -13
  47. package/src/hooks/bridgeApi/useBridgeApiApproveAndBroadcast.ts +3 -20
  48. package/src/hooks/bridgeApi/useBridgeApiBridgeableAmount.ts +1 -12
  49. package/src/hooks/bridgeApi/useBridgeApiCreateBridgeIntent.ts +1 -14
  50. package/src/hooks/bridgeApi/useBridgeApiFee.ts +2 -11
  51. package/src/hooks/bridgeApi/useBridgeApiIsBridgeable.ts +1 -12
  52. package/src/hooks/bridgeApi/useBridgeApiSubmitTx.ts +2 -23
  53. package/src/hooks/bridgeApi/useBridgeApiSubmitTxStatus.test.ts +1 -9
  54. package/src/hooks/bridgeApi/useBridgeApiSubmitTxStatus.ts +1 -19
  55. package/src/hooks/bridgeApi/useBridgeApiTokens.ts +0 -8
  56. package/src/hooks/bridgeApi/useBridgeApiTokensByChain.ts +0 -7
  57. package/src/hooks/dex/useClaimRewards.ts +1 -12
  58. package/src/hooks/dex/useCreateDecreaseLiquidityParams.ts +1 -5
  59. package/src/hooks/dex/useCreateDepositParams.ts +1 -5
  60. package/src/hooks/dex/useCreateSupplyLiquidityParams.ts +1 -10
  61. package/src/hooks/dex/useCreateWithdrawParams.ts +1 -5
  62. package/src/hooks/dex/useDecreaseLiquidity.ts +2 -15
  63. package/src/hooks/dex/useDexAllowance.ts +1 -5
  64. package/src/hooks/dex/useDexApprove.ts +1 -12
  65. package/src/hooks/dex/useDexDeposit.ts +1 -23
  66. package/src/hooks/dex/useDexWithdraw.ts +1 -13
  67. package/src/hooks/dex/useLiquidityAmounts.ts +1 -4
  68. package/src/hooks/dex/usePoolBalances.ts +0 -4
  69. package/src/hooks/dex/usePoolData.ts +1 -4
  70. package/src/hooks/dex/usePools.ts +1 -4
  71. package/src/hooks/dex/usePositionInfo.ts +1 -4
  72. package/src/hooks/dex/useSupplyLiquidity.ts +3 -20
  73. package/src/hooks/leverageYield/useApproveLeveragePositionFunding.ts +2 -8
  74. package/src/hooks/leverageYield/useLeveragePositionAccount.ts +2 -13
  75. package/src/hooks/leverageYield/useLeveragePositionCollateral.ts +2 -14
  76. package/src/hooks/leverageYield/useLeveragePositionFundingAllowance.ts +2 -9
  77. package/src/hooks/leverageYield/useLeveragePositionInfo.ts +1 -13
  78. package/src/hooks/leverageYield/useLeveragePositionPayoutAddress.ts +3 -15
  79. package/src/hooks/leverageYield/useLeveragePositionPending.ts +2 -16
  80. package/src/hooks/leverageYield/useLeveragePositions.ts +1 -15
  81. package/src/hooks/leverageYield/useLeveragePositionsForUser.ts +1 -15
  82. package/src/hooks/leverageYield/useLeverageYieldApprovalStrategy.ts +1 -6
  83. package/src/hooks/leverageYield/useLeverageYieldDeposit.ts +1 -17
  84. package/src/hooks/leverageYield/useLeverageYieldDetailedStatus.test.ts +3 -14
  85. package/src/hooks/leverageYield/useLeverageYieldDetailedStatus.ts +2 -19
  86. package/src/hooks/leverageYield/useLeverageYieldEffectiveApr.ts +1 -12
  87. package/src/hooks/leverageYield/useLeverageYieldNotifySolver.ts +1 -11
  88. package/src/hooks/leverageYield/useLeverageYieldPosition.ts +1 -13
  89. package/src/hooks/leverageYield/useLeverageYieldPreviewRedeem.ts +1 -12
  90. package/src/hooks/leverageYield/useLeverageYieldQuote.test.ts +3 -13
  91. package/src/hooks/leverageYield/useLeverageYieldQuote.ts +5 -54
  92. package/src/hooks/leverageYield/useLeverageYieldShareBalances.ts +2 -29
  93. package/src/hooks/leverageYield/useLeverageYieldTotalAssets.ts +1 -9
  94. package/src/hooks/leverageYield/useLeverageYieldVaultSwap.ts +2 -25
  95. package/src/hooks/leverageYield/useLeverageYieldVaultSwapWithApproval.ts +1 -11
  96. package/src/hooks/leverageYield/useLeverageYieldWithdraw.ts +1 -17
  97. package/src/hooks/leverageYield/useOpenLeveragePosition.ts +5 -18
  98. package/src/hooks/leverageYield/useRunLeveragePositionOperation.ts +4 -20
  99. package/src/hooks/leverageYield/useSubmitLeveragePositionIntent.ts +3 -15
  100. package/src/hooks/leverageYieldApi/index.ts +0 -15
  101. package/src/hooks/leverageYieldApi/useLeverageYieldApiAllowance.ts +1 -8
  102. package/src/hooks/leverageYieldApi/useLeverageYieldApiApprove.ts +3 -6
  103. package/src/hooks/leverageYieldApi/useLeverageYieldApiApproveAndBroadcast.test.ts +4 -14
  104. package/src/hooks/leverageYieldApi/useLeverageYieldApiApproveAndBroadcast.ts +4 -26
  105. package/src/hooks/leverageYieldApi/useLeverageYieldApiApr.ts +1 -7
  106. package/src/hooks/leverageYieldApi/useLeverageYieldApiAsset.ts +0 -7
  107. package/src/hooks/leverageYieldApi/useLeverageYieldApiCancelIntent.ts +2 -8
  108. package/src/hooks/leverageYieldApi/useLeverageYieldApiCreateDepositIntent.ts +2 -8
  109. package/src/hooks/leverageYieldApi/useLeverageYieldApiCreateWithdrawIntent.ts +2 -8
  110. package/src/hooks/leverageYieldApi/useLeverageYieldApiDeadline.ts +1 -7
  111. package/src/hooks/leverageYieldApi/useLeverageYieldApiDepositQuote.ts +1 -15
  112. package/src/hooks/leverageYieldApi/useLeverageYieldApiEffectiveApr.ts +1 -7
  113. package/src/hooks/leverageYieldApi/useLeverageYieldApiEstimateGas.ts +1 -7
  114. package/src/hooks/leverageYieldApi/useLeverageYieldApiFilledIntent.ts +1 -6
  115. package/src/hooks/leverageYieldApi/useLeverageYieldApiIntent.ts +1 -6
  116. package/src/hooks/leverageYieldApi/useLeverageYieldApiIntentExtraData.ts +1 -8
  117. package/src/hooks/leverageYieldApi/useLeverageYieldApiIntentHash.ts +0 -7
  118. package/src/hooks/leverageYieldApi/useLeverageYieldApiIntentPacket.ts +1 -7
  119. package/src/hooks/leverageYieldApi/useLeverageYieldApiLsdApr.ts +1 -7
  120. package/src/hooks/leverageYieldApi/useLeverageYieldApiMaxWithdraw.ts +1 -7
  121. package/src/hooks/leverageYieldApi/useLeverageYieldApiPartnerFee.ts +1 -7
  122. package/src/hooks/leverageYieldApi/useLeverageYieldApiPosition.ts +0 -7
  123. package/src/hooks/leverageYieldApi/useLeverageYieldApiPreviewDeposit.ts +1 -7
  124. package/src/hooks/leverageYieldApi/useLeverageYieldApiPreviewRedeem.ts +1 -7
  125. package/src/hooks/leverageYieldApi/useLeverageYieldApiPreviewWithdraw.ts +1 -7
  126. package/src/hooks/leverageYieldApi/useLeverageYieldApiShareBalance.ts +0 -7
  127. package/src/hooks/leverageYieldApi/useLeverageYieldApiSolverFee.ts +1 -7
  128. package/src/hooks/leverageYieldApi/useLeverageYieldApiStatus.ts +2 -12
  129. package/src/hooks/leverageYieldApi/useLeverageYieldApiSubmitIntent.ts +2 -8
  130. package/src/hooks/leverageYieldApi/useLeverageYieldApiSubmitTx.ts +2 -8
  131. package/src/hooks/leverageYieldApi/useLeverageYieldApiSubmitTxStatus.ts +2 -17
  132. package/src/hooks/leverageYieldApi/useLeverageYieldApiTotalAssets.ts +0 -7
  133. package/src/hooks/leverageYieldApi/useLeverageYieldApiVault.ts +1 -7
  134. package/src/hooks/leverageYieldApi/useLeverageYieldApiVaults.ts +0 -7
  135. package/src/hooks/leverageYieldApi/useLeverageYieldApiWithdrawQuote.ts +1 -15
  136. package/src/hooks/migrate/useMigrateBaln.ts +1 -8
  137. package/src/hooks/migrate/useMigrateIcxToSoda.ts +1 -12
  138. package/src/hooks/migrate/useMigratebnUSD.ts +1 -12
  139. package/src/hooks/migrate/useMigrationAllowance.ts +3 -19
  140. package/src/hooks/migrate/useMigrationApprove.ts +2 -20
  141. package/src/hooks/migrate/useRevertMigrateSodaToIcx.ts +0 -7
  142. package/src/hooks/mm/useAToken.ts +1 -6
  143. package/src/hooks/mm/useATokensBalances.ts +0 -5
  144. package/src/hooks/mm/useBorrow.ts +1 -13
  145. package/src/hooks/mm/useEModes.ts +2 -13
  146. package/src/hooks/mm/useMMAllowance.test.ts +55 -0
  147. package/src/hooks/mm/useMMAllowance.ts +6 -16
  148. package/src/hooks/mm/useMMApprove.ts +1 -14
  149. package/src/hooks/mm/useRepay.ts +1 -12
  150. package/src/hooks/mm/useReservesData.ts +0 -4
  151. package/src/hooks/mm/useReservesHumanized.ts +0 -4
  152. package/src/hooks/mm/useReservesList.ts +0 -4
  153. package/src/hooks/mm/useReservesUsdFormat.ts +0 -4
  154. package/src/hooks/mm/useSupply.ts +1 -24
  155. package/src/hooks/mm/useUserFormattedSummary.ts +0 -7
  156. package/src/hooks/mm/useUserReservesData.ts +0 -4
  157. package/src/hooks/mm/useWithdraw.ts +1 -13
  158. package/src/hooks/partner/useApproveToken.ts +1 -7
  159. package/src/hooks/partner/useFeeClaimSwap.ts +1 -7
  160. package/src/hooks/partner/useFeeClaimWithdraw.ts +3 -20
  161. package/src/hooks/partner/useFetchAssetsBalances.ts +0 -4
  162. package/src/hooks/partner/useGetAutoSwapPreferences.ts +0 -4
  163. package/src/hooks/partner/useGetIntentDetails.ts +1 -8
  164. package/src/hooks/partner/useGetUserIntent.ts +1 -8
  165. package/src/hooks/partner/useIsTokenApproved.ts +0 -4
  166. package/src/hooks/partner/usePartnerCancelIntent.ts +2 -9
  167. package/src/hooks/partner/useSetSwapPreference.ts +1 -14
  168. package/src/hooks/recovery/useHubAssetBalances.ts +1 -6
  169. package/src/hooks/recovery/useWithdrawHubAsset.ts +1 -13
  170. package/src/hooks/shared/invalidateBalances.ts +2 -10
  171. package/src/hooks/shared/isUserRejectedError.test.ts +0 -3
  172. package/src/hooks/shared/isUserRejectedError.ts +2 -23
  173. package/src/hooks/shared/notFoundStreak.ts +5 -22
  174. package/src/hooks/shared/retryUnlessAuthFailure.test.ts +1 -2
  175. package/src/hooks/shared/retryUnlessAuthFailure.ts +1 -12
  176. package/src/hooks/shared/solverStatusPolicy.test.ts +0 -5
  177. package/src/hooks/shared/solverStatusPolicy.ts +8 -58
  178. package/src/hooks/shared/types.ts +4 -55
  179. package/src/hooks/shared/unwrapResult.ts +1 -8
  180. package/src/hooks/shared/useBalances.ts +6 -39
  181. package/src/hooks/shared/useEstablishTrustline.test.ts +1 -5
  182. package/src/hooks/shared/useEstablishTrustline.ts +3 -13
  183. package/src/hooks/shared/useEstablishXrpTrustline.test.ts +1 -2
  184. package/src/hooks/shared/useEstablishXrpTrustline.ts +3 -5
  185. package/src/hooks/shared/useEstimateGas.ts +0 -1
  186. package/src/hooks/shared/useGetUserHubWalletAddress.ts +1 -18
  187. package/src/hooks/shared/useNearStorageCheck.ts +2 -9
  188. package/src/hooks/shared/useNearStorageGate.ts +5 -15
  189. package/src/hooks/shared/useRegisterNearStorage.ts +2 -10
  190. package/src/hooks/shared/useRequestTrustline.test.ts +1 -7
  191. package/src/hooks/shared/useRequestTrustline.ts +4 -14
  192. package/src/hooks/shared/useSafeMutation.test.ts +0 -3
  193. package/src/hooks/shared/useSafeMutation.ts +2 -26
  194. package/src/hooks/shared/useSodaxContext.ts +0 -6
  195. package/src/hooks/shared/useStellarGate.test.ts +2 -9
  196. package/src/hooks/shared/useStellarGate.ts +3 -9
  197. package/src/hooks/shared/useStellarTrustlineCheck.test.ts +0 -2
  198. package/src/hooks/shared/useStellarTrustlineCheck.ts +1 -4
  199. package/src/hooks/shared/useXBalances.ts +2 -20
  200. package/src/hooks/shared/useXrpDestinationCheck.ts +1 -5
  201. package/src/hooks/shared/useXrpGate.test.ts +1 -3
  202. package/src/hooks/shared/useXrpGate.ts +2 -3
  203. package/src/hooks/shared/waitForApiAllowance.test.ts +0 -1
  204. package/src/hooks/shared/waitForApiAllowance.ts +2 -6
  205. package/src/hooks/sponsoring/useActivateStellarAccount.test.ts +1 -2
  206. package/src/hooks/sponsoring/useActivateStellarAccount.ts +1 -5
  207. package/src/hooks/sponsoring/useActivateStellarAccount.wire.test.ts +2 -13
  208. package/src/hooks/sponsoring/useSponsorConfig.ts +0 -1
  209. package/src/hooks/sponsoring/useStellarAccountActive.ts +0 -1
  210. package/src/hooks/sponsoring/useStellarAccountStatus.ts +1 -4
  211. package/src/hooks/staking/index.ts +0 -1
  212. package/src/hooks/staking/useCancelUnstake.ts +1 -7
  213. package/src/hooks/staking/useClaim.ts +1 -7
  214. package/src/hooks/staking/useConvertedAssets.ts +1 -4
  215. package/src/hooks/staking/useInstantUnstake.ts +1 -7
  216. package/src/hooks/staking/useInstantUnstakeAllowance.ts +1 -5
  217. package/src/hooks/staking/useInstantUnstakeApprove.ts +1 -11
  218. package/src/hooks/staking/useInstantUnstakeRatio.ts +1 -4
  219. package/src/hooks/staking/useStake.ts +1 -12
  220. package/src/hooks/staking/useStakeAllowance.ts +1 -5
  221. package/src/hooks/staking/useStakeApprove.ts +1 -11
  222. package/src/hooks/staking/useStakeRatio.ts +1 -4
  223. package/src/hooks/staking/useStakingConfig.ts +1 -4
  224. package/src/hooks/staking/useStakingInfo.ts +1 -5
  225. package/src/hooks/staking/useUnstake.ts +2 -9
  226. package/src/hooks/staking/useUnstakeAllowance.ts +1 -5
  227. package/src/hooks/staking/useUnstakeApprove.ts +1 -10
  228. package/src/hooks/staking/useUnstakingInfo.ts +1 -4
  229. package/src/hooks/staking/useUnstakingInfoWithPenalty.ts +1 -4
  230. package/src/hooks/swap/useCancelLimitOrder.ts +1 -7
  231. package/src/hooks/swap/useCancelSwap.ts +1 -7
  232. package/src/hooks/swap/useCreateLimitOrder.ts +2 -12
  233. package/src/hooks/swap/useDetailedStatus.test.ts +6 -18
  234. package/src/hooks/swap/useDetailedStatus.ts +2 -19
  235. package/src/hooks/swap/useQuote.test.ts +2 -8
  236. package/src/hooks/swap/useQuote.ts +5 -32
  237. package/src/hooks/swap/useStatus.ts +2 -10
  238. package/src/hooks/swap/useSwap.test.ts +1 -11
  239. package/src/hooks/swap/useSwap.ts +2 -12
  240. package/src/hooks/swap/useSwapAllowance.ts +1 -2
  241. package/src/hooks/swap/useSwapApprovalStrategy.ts +2 -7
  242. package/src/hooks/swap/useSwapApprove.ts +2 -14
  243. package/src/hooks/swap/useSwapLifecycle.test.ts +1 -2
  244. package/src/hooks/swap/useSwapLifecycle.ts +9 -27
  245. package/src/hooks/swap/useSwapWithApproval.ts +2 -11
  246. package/src/hooks/swapsApi/index.ts +2 -14
  247. package/src/hooks/swapsApi/isTerminalSwapIntentStatus.test.ts +1 -5
  248. package/src/hooks/swapsApi/isTerminalSwapIntentStatus.ts +1 -7
  249. package/src/hooks/swapsApi/useSwapsApiAllowance.ts +0 -7
  250. package/src/hooks/swapsApi/useSwapsApiApprove.ts +1 -14
  251. package/src/hooks/swapsApi/useSwapsApiApproveAndBroadcast.test.ts +5 -20
  252. package/src/hooks/swapsApi/useSwapsApiApproveAndBroadcast.ts +3 -24
  253. package/src/hooks/swapsApi/useSwapsApiBroadcastWithApproval.test.ts +2 -8
  254. package/src/hooks/swapsApi/useSwapsApiBroadcastWithApproval.ts +6 -41
  255. package/src/hooks/swapsApi/useSwapsApiCancelIntent.ts +0 -13
  256. package/src/hooks/swapsApi/useSwapsApiCreateIntent.ts +0 -13
  257. package/src/hooks/swapsApi/useSwapsApiCreateLimitOrder.ts +1 -13
  258. package/src/hooks/swapsApi/useSwapsApiDeadline.ts +1 -7
  259. package/src/hooks/swapsApi/useSwapsApiEstimateGas.ts +0 -7
  260. package/src/hooks/swapsApi/useSwapsApiFilledIntent.ts +0 -8
  261. package/src/hooks/swapsApi/useSwapsApiIntent.ts +1 -7
  262. package/src/hooks/swapsApi/useSwapsApiIntentExtraData.ts +1 -8
  263. package/src/hooks/swapsApi/useSwapsApiIntentHash.ts +0 -7
  264. package/src/hooks/swapsApi/useSwapsApiIntentPacket.ts +1 -10
  265. package/src/hooks/swapsApi/useSwapsApiPartnerFee.ts +0 -7
  266. package/src/hooks/swapsApi/useSwapsApiQuote.ts +2 -24
  267. package/src/hooks/swapsApi/useSwapsApiSolverFee.ts +0 -7
  268. package/src/hooks/swapsApi/useSwapsApiStatus.ts +1 -11
  269. package/src/hooks/swapsApi/useSwapsApiSubmitIntent.ts +1 -15
  270. package/src/hooks/swapsApi/useSwapsApiSubmitTx.ts +0 -21
  271. package/src/hooks/swapsApi/useSwapsApiSubmitTxStatus.ts +2 -19
  272. package/src/hooks/swapsApi/useSwapsApiTokens.ts +0 -7
  273. package/src/hooks/swapsApi/useSwapsApiTokensByChain.ts +0 -7
  274. package/src/index.ts +1 -1
  275. package/src/providers/SodaxProvider.test.ts +2 -9
  276. package/src/providers/SodaxProvider.tsx +1 -12
  277. package/src/providers/createSodaxQueryClient.ts +4 -56
  278. package/src/utils/approvalPlan.ts +9 -32
  279. package/src/utils/dex-utils.ts +5 -20
  280. package/src/utils/nearStorageGate.ts +3 -14
  281. package/src/utils/stellarGate.ts +3 -16
  282. package/src/utils/swapLifecycle.ts +7 -26
  283. package/src/utils/xrpGate.ts +1 -4
@@ -12,30 +12,15 @@ import type { MutationHookParams } from '../shared/types.js';
12
12
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
13
13
  import { unwrapResult } from '../shared/unwrapResult.js';
14
14
 
15
- /** Mutation variables for {@link useRunLeveragePositionOperation} — the calls to run as the owner. */
16
15
  export type UseRunLeveragePositionOperationVars<K extends SpokeChainKey = SpokeChainKey> = Omit<
17
16
  SpokeExecActionParams<K, false, PositionOperationParams<K, PositionDirectCall>>,
18
17
  'raw'
19
18
  >;
20
19
 
21
20
  /**
22
- * Runs position calls that DO NOT post an intent — `withdraw`, `settle` and `cancel` — as the owning
23
- * hub wallet. They are synchronous on the hub, so resolving means the work is done.
24
- *
25
- * Still routed, never sent directly: the position's `onlyOwner` is the hub wallet, so a call sent
26
- * from the signer reverts `NotOwner`. Locally through the wallet router on the hub, relayed from
27
- * anywhere else.
28
- *
29
- * USE {@link useSubmitLeveragePositionIntent} FOR `increaseLeverage` AND `decreaseLeverage`. Those
30
- * only post a request a solver fills later, and this hook does not notify the solver, so sending one
31
- * through here creates an intent nothing will fill. It expires silently and the operation is lost.
32
- * The other direction is harmless by comparison: notifying about a withdraw is noise, not damage.
33
- *
34
- * Balances are invalidated for `srcChainKey` because a withdraw pays out.
35
- *
36
- * @experimental OFF-HUB (SPOKE) ORIGINS ARE UNVERIFIED ON-CHAIN, and this is the hook that carries the
37
- * worst of it: an exit or cancellation delivering the underlying back to the spoke it
38
- * came from has never run on mainnet. Bitcoin is refused outright.
21
+ * Synchronous position calls (`withdraw`, `settle`, `cancel`) as the hub wallet; does not notify the solver, so
22
+ * use {@link useSubmitLeveragePositionIntent} for leverage changes or the intent expires unfilled.
23
+ * @experimental Off-hub (spoke) origins are unverified on-chain; Bitcoin is refused.
39
24
  */
40
25
  export function useRunLeveragePositionOperation<K extends SpokeChainKey = SpokeChainKey>({
41
26
  mutationOptions,
@@ -54,8 +39,7 @@ export function useRunLeveragePositionOperation<K extends SpokeChainKey = SpokeC
54
39
  unwrapResult(await sodax.leverageYield.runLeveragePositionOperation({ ...vars, raw: false })),
55
40
  onSuccess: async (data, vars, ctx) => {
56
41
  invalidateBalances(queryClient, vars.params.srcChainKey);
57
- // A position write changes every position read — account, pending slot, the list itself — and a
58
- // partner that has to remember this leaves the UI stale after the one action it just took.
42
+ // A position write affects every position read (account, pending slot, list).
59
43
  queryClient.invalidateQueries({ queryKey: ['leverageYield'] });
60
44
  await mutationOptions?.onSuccess?.(data, vars, ctx);
61
45
  },
@@ -11,25 +11,14 @@ import type { MutationHookParams } from '../shared/types.js';
11
11
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
12
12
  import { unwrapResult } from '../shared/unwrapResult.js';
13
13
 
14
- /** Mutation variables for {@link useSubmitLeveragePositionIntent} — the calls to run as the owner. */
15
14
  export type UseSubmitLeveragePositionIntentVars<K extends SpokeChainKey = SpokeChainKey> = Omit<
16
15
  SpokeExecActionParams<K, false, PositionOperationParams<K, PositionBatchCall>>,
17
16
  'raw'
18
17
  >;
19
18
 
20
19
  /**
21
- * Runs position calls that POST A SOLVER INTENT — `increaseLeverage` and `decreaseLeverage` — as the
22
- * owning hub wallet, then reports it.
23
- *
24
- * USE {@link useRunLeveragePositionOperation} for `withdraw`, `settle` and `cancel`. The split is the
25
- * SDK's: those three are synchronous on the hub and need no notification, while these two only post
26
- * a request a solver fills later. Sending a leverage change through the other hook leaves an intent
27
- * nothing will fill, and it expires without a word.
28
- *
29
- * A position permits one intent at a time, so poll `useLeveragePositionPending` rather than assuming
30
- * the next call may go out.
31
- *
32
- * @experimental Off-hub (spoke) origins are unverified on-chain; see the SDK method.
20
+ * Intent-posting position calls (`increaseLeverage`, `decreaseLeverage`); one intent at a time, so gate on `useLeveragePositionPending`.
21
+ * @experimental Off-hub (spoke) origins are unverified on-chain.
33
22
  */
34
23
  export function useSubmitLeveragePositionIntent<K extends SpokeChainKey = SpokeChainKey>({
35
24
  mutationOptions,
@@ -46,8 +35,7 @@ export function useSubmitLeveragePositionIntent<K extends SpokeChainKey = SpokeC
46
35
  mutationFn: async vars =>
47
36
  unwrapResult(await sodax.leverageYield.submitLeveragePositionIntent({ ...vars, raw: false })),
48
37
  onSuccess: async (data, vars, ctx) => {
49
- // The slot is occupied the moment this resolves, and the row's controls gate on it — so the
50
- // pending read has to be refetched even though nothing has filled yet.
38
+ // The pending slot is occupied as soon as this resolves, before any fill.
51
39
  queryClient.invalidateQueries({ queryKey: ['leverageYield'] });
52
40
  await mutationOptions?.onSuccess?.(data, vars, ctx);
53
41
  },
@@ -1,16 +1,6 @@
1
- /**
2
- * Leverage Yield API hooks — typed React Query wrappers over `sodax.api.leverageYield.*` (the
3
- * LeverageYieldApiService HTTP client). One hook per endpoint of the backend Leverage Yield API.
4
- *
5
- * Distinct from the on-chain `leverageYield/` hooks (`useLeverageYieldDeposit`/…), which drive the
6
- * `LeverageYieldService` path (wallet → hub chain). These hooks call the backend HTTP API instead.
7
- */
8
-
9
- // Vault registry
10
1
  export * from './useLeverageYieldApiVaults.js';
11
2
  export * from './useLeverageYieldApiVault.js';
12
3
 
13
- // Vault reads
14
4
  export * from './useLeverageYieldApiAsset.js';
15
5
  export * from './useLeverageYieldApiPosition.js';
16
6
  export * from './useLeverageYieldApiApr.js';
@@ -23,19 +13,16 @@ export * from './useLeverageYieldApiPreviewRedeem.js';
23
13
  export * from './useLeverageYieldApiShareBalance.js';
24
14
  export * from './useLeverageYieldApiMaxWithdraw.js';
25
15
 
26
- // Quote · deadline · allowance
27
16
  export * from './useLeverageYieldApiDepositQuote.js';
28
17
  export * from './useLeverageYieldApiWithdrawQuote.js';
29
18
  export * from './useLeverageYieldApiDeadline.js';
30
19
  export * from './useLeverageYieldApiAllowance.js';
31
20
 
32
- // Approve · create intent (deposit / withdraw)
33
21
  export * from './useLeverageYieldApiApprove.js';
34
22
  export * from './useLeverageYieldApiApproveAndBroadcast.js';
35
23
  export * from './useLeverageYieldApiCreateDepositIntent.js';
36
24
  export * from './useLeverageYieldApiCreateWithdrawIntent.js';
37
25
 
38
- // Intent lifecycle: submit · status · cancel · hash · packet · extra-data · lookup
39
26
  export * from './useLeverageYieldApiSubmitIntent.js';
40
27
  export * from './useLeverageYieldApiStatus.js';
41
28
  export * from './useLeverageYieldApiCancelIntent.js';
@@ -45,11 +32,9 @@ export * from './useLeverageYieldApiIntentExtraData.js';
45
32
  export * from './useLeverageYieldApiFilledIntent.js';
46
33
  export * from './useLeverageYieldApiIntent.js';
47
34
 
48
- // Gas · fees
49
35
  export * from './useLeverageYieldApiEstimateGas.js';
50
36
  export * from './useLeverageYieldApiPartnerFee.js';
51
37
  export * from './useLeverageYieldApiSolverFee.js';
52
38
 
53
- // Submit-tx state machine
54
39
  export * from './useLeverageYieldApiSubmitTx.js';
55
40
  export * from './useLeverageYieldApiSubmitTxStatus.js';
@@ -13,14 +13,7 @@ export type UseLeverageYieldApiAllowanceParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to check whether the deposit input-token allowance is already sufficient for an intent
18
- * via the leverage-yield API — `sodax.api.leverageYield.checkAllowance`. Returns `{ valid }`.
19
- * (Withdraw needs no spoke allowance — it spends lsoda* from the hub wallet.)
20
- *
21
- * @example
22
- * const { data: allowance } = useLeverageYieldApiAllowance({ params: { body: depositIntentParams } });
23
- */
16
+ /** Deposit-only: a withdraw needs no spoke allowance (it spends lsoda* from the hub wallet). */
24
17
  export const useLeverageYieldApiAllowance = ({
25
18
  params,
26
19
  queryOptions,
@@ -5,18 +5,15 @@ import { unwrapResult } from '../shared/unwrapResult.js';
5
5
  import type { MutationHookParams } from '../shared/types.js';
6
6
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
7
7
 
8
- /**
9
- * Mutation variables for {@link useLeverageYieldApiApprove}. The per-request `apiConfig` override belongs here
10
- * rather than at the hook level — different calls in the same component can target different
11
- * endpoints without re-rendering.
12
- */
8
+ /** Per-call `apiConfig` so calls in one component can target different endpoints. */
13
9
  export type UseLeverageYieldApiApproveVars = {
14
10
  body: CreateDepositIntentParamsV2;
15
11
  apiConfig?: RequestOverrideConfig;
16
12
  };
17
13
 
18
14
  /**
19
- * React hook to build an unsigned token-approval transaction for the deposit input token via the leverage-yield API — `sodax.api.leverageYield.approve`.
15
+ * Returns the unsigned `{ tx, resetTx? }`; the reset must be mined before the approve.
16
+ * Prefer {@link useLeverageYieldApiApproveAndBroadcast}, which owns that ordering.
20
17
  */
21
18
  export const useLeverageYieldApiApprove = ({
22
19
  mutationOptions,
@@ -1,13 +1,6 @@
1
1
  /**
2
- * The leverage-yield API can return two approval transactions, and the second is only a valid state
3
- * transition once the first has been mined. That ordering is what this hook exists to own.
4
- *
5
- * `runApprovalPlan` itself — every chain family, every progress phase — is covered by the swaps and
6
- * bridge suites; this one pins what is leverage-yield-specific: the client method it asks for the
7
- * plan, that the ordering survives, that errors name THIS hook, and its own invalidation key.
8
- *
9
- * Follows the package convention of testing hooks without a renderer: the React Query wrapper is
10
- * mocked so `mutationFn` can be captured and driven directly.
2
+ * Pins leverage-yield specifics: client method, reset-before-approve ordering, error hook name, invalidation key.
3
+ * `runApprovalPlan` itself is covered by the swaps/bridge suites; React Query is mocked to capture `mutationFn`.
11
4
  */
12
5
 
13
6
  import { ChainKeys } from '@sodax/sdk';
@@ -65,7 +58,6 @@ function evmProvider(calls: string[], onWait?: (hash: string) => string | void)
65
58
  };
66
59
  }
67
60
 
68
- /** One render, then the captured `mutationFn` invoked with `vars`. */
69
61
  // biome-ignore lint/suspicious/noExplicitAny: vars mirror the hook's generic mutation variables.
70
62
  const run = (vars: any) => {
71
63
  useLeverageYieldApiApproveAndBroadcast();
@@ -112,8 +104,7 @@ describe('useLeverageYieldApiApproveAndBroadcast', () => {
112
104
  const result = await run({ body: body(ChainKeys.ARBITRUM_MAINNET), walletProvider: evmProvider(calls) });
113
105
 
114
106
  expect(result).toEqual({ resetTxHash: RESET_HASH, approveTxHash: APPROVE_HASH });
115
- // The wait has to sit between the two sends; approving over an unconfirmed reset reverts. This is
116
- // the transaction `useLeverageYieldApiApprove` callers were dropping.
107
+ // The wait must sit between the two sends; approving over an unconfirmed reset reverts.
117
108
  expect(calls).toEqual(['send:0xreset', `wait:${RESET_HASH}`, 'send:0xapprove', `wait:${APPROVE_HASH}`]);
118
109
  });
119
110
 
@@ -136,8 +127,7 @@ describe('useLeverageYieldApiApproveAndBroadcast', () => {
136
127
  });
137
128
 
138
129
  it('names this hook, not a sibling, in an error from the shared plan runner', async () => {
139
- // The runner is shared with the swaps and bridge hooks; a hard-coded prefix there would point a
140
- // leverage-yield integrator at the wrong hook.
130
+ // The runner is shared with swaps and bridge; a hard-coded hook name there would misdirect integrators.
141
131
  approve.mockResolvedValue({ ok: true, value: { tx: APPROVE_TX } });
142
132
 
143
133
  await expect(run({ body: body(ChainKeys.SOLANA_MAINNET), walletProvider: {} })).rejects.toThrow(
@@ -24,30 +24,9 @@ export type UseLeverageYieldApiApproveAndBroadcastVars<K extends SpokeChainKey =
24
24
  };
25
25
 
26
26
  /**
27
- * React hook that runs the whole leverage-yield-API deposit approval: asks the API for the
28
- * transactions, then signs, broadcasts, and waits for each one. (Only a deposit needs a spoke
29
- * allowance — a withdraw spends `lsoda*` from the hub wallet.)
30
- *
31
- * Prefer this over {@link useLeverageYieldApiApprove}, which hands back the unsigned
32
- * `{ tx, resetTx? }` and leaves the ordering — reset mined first, then approve — to the caller. A
33
- * deposit token of the 2017 TetherToken lineage rejects an allowance change from one non-zero value
34
- * to another, so broadcasting the approve without the reset spends the user's gas on a transaction
35
- * that is certain to revert. Confirmation happens inside the hook, so it invalidates
36
- * `['leverageYieldApi','allowance']` itself — after waiting up to about 15 seconds for the API to report
37
- * the allowance as valid, since its RPC can trail the node that confirmed the approve. It resolves after
38
- * that wait either way, so read the allowance rather than treating success as `valid`.
39
- *
40
- * Supports the chains the leverage-yield API can approve on — the hub (Sonic), EVM spokes, and
41
- * Stellar. Every other chain reports its allowance as always sufficient, so approval never runs.
42
- *
43
- * `onProgress` reports each transaction as `{ step, phase, index, total }`, so the UI can name the
44
- * wallet prompt the user is looking at instead of one flat "Approving…" across two signatures.
45
- *
46
- * @example
47
- * const { mutateAsyncSafe: approve } = useLeverageYieldApiApproveAndBroadcast();
48
- * const result = await approve({ body: depositIntentParams, walletProvider, onProgress: setStep });
49
- * if (!result.ok) return;
50
- * const { resetTxHash, approveTxHash } = result.value; // resetTxHash only on a guarded token
27
+ * Signs and confirms the deposit approval plan, mining the reset before the approve (USDT-lineage tokens revert).
28
+ * Resolves after waiting up to ~15s for the API allowance to turn valid, valid or not: read the allowance.
29
+ * Approval runs only on the hub, EVM spokes and Stellar; other chains report the allowance as always sufficient.
51
30
  */
52
31
  export const useLeverageYieldApiApproveAndBroadcast = <K extends SpokeChainKey = SpokeChainKey>({
53
32
  mutationOptions,
@@ -79,8 +58,7 @@ export const useLeverageYieldApiApproveAndBroadcast = <K extends SpokeChainKey =
79
58
  return hashes;
80
59
  },
81
60
  onSuccess: async (data, vars, ctx) => {
82
- // Awaited: the mutation must not resolve — re-enabling Approve — before the allowance query
83
- // has actually refetched, or a stale cached `valid: false` re-enables a duplicate approval.
61
+ // Awaited so a stale cached `valid: false` cannot re-enable Approve before the refetch lands.
84
62
  await queryClient.invalidateQueries({ queryKey: ['leverageYieldApi', 'allowance'] });
85
63
  await mutationOptions?.onSuccess?.(data, vars, ctx);
86
64
  },
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiAprParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to fetch the AAVE-only steady-state APR for a leverage-yield vault via the leverage-yield API —
18
- * `sodax.api.leverageYield.getApr`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiApr({ params: { vault: '0x...' } });
22
- */
16
+ /** AAVE-only steady-state APR; {@link useLeverageYieldApiEffectiveApr} includes LSD yield. */
23
17
  export const useLeverageYieldApiApr = ({
24
18
  params,
25
19
  queryOptions,
@@ -13,13 +13,6 @@ export type UseLeverageYieldApiAssetParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to fetch the underlying hub asset for a leverage-yield vault via the leverage-yield API —
18
- * `sodax.api.leverageYield.getAsset`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiAsset({ params: { vault: '0x...' } });
22
- */
23
16
  export const useLeverageYieldApiAsset = ({
24
17
  params,
25
18
  queryOptions,
@@ -5,19 +5,13 @@ import { unwrapResult } from '../shared/unwrapResult.js';
5
5
  import type { MutationHookParams } from '../shared/types.js';
6
6
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
7
7
 
8
- /**
9
- * Mutation variables for {@link useLeverageYieldApiCancelIntent}. The per-request `apiConfig` override belongs here
10
- * rather than at the hook level — different calls in the same component can target different
11
- * endpoints without re-rendering.
12
- */
8
+ /** Per-call `apiConfig` so calls in one component can target different endpoints. */
13
9
  export type UseLeverageYieldApiCancelIntentVars = {
14
10
  body: CancelIntentRequestV2;
15
11
  apiConfig?: RequestOverrideConfig;
16
12
  };
17
13
 
18
- /**
19
- * React hook to build an unsigned cancel-intent transaction via the leverage-yield API — `sodax.api.leverageYield.cancelIntent`.
20
- */
14
+ /** Builds an unsigned cancel-intent tx for the caller to sign and broadcast. */
21
15
  export const useLeverageYieldApiCancelIntent = ({
22
16
  mutationOptions,
23
17
  }: MutationHookParams<CancelIntentResponseV2, UseLeverageYieldApiCancelIntentVars> = {}): SafeUseMutationResult<
@@ -5,19 +5,13 @@ import { unwrapResult } from '../shared/unwrapResult.js';
5
5
  import type { MutationHookParams } from '../shared/types.js';
6
6
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
7
7
 
8
- /**
9
- * Mutation variables for {@link useLeverageYieldApiCreateDepositIntent}. The per-request `apiConfig` override belongs here
10
- * rather than at the hook level — different calls in the same component can target different
11
- * endpoints without re-rendering.
12
- */
8
+ /** Per-call `apiConfig` so calls in one component can target different endpoints. */
13
9
  export type UseLeverageYieldApiCreateDepositIntentVars = {
14
10
  body: CreateDepositIntentParamsV2;
15
11
  apiConfig?: RequestOverrideConfig;
16
12
  };
17
13
 
18
- /**
19
- * React hook to build an unsigned deposit create-intent transaction (any token → lsoda* shares) via the leverage-yield API — `sodax.api.leverageYield.createDepositIntent`.
20
- */
14
+ /** Builds an unsigned deposit create-intent tx (any token → lsoda* shares). */
21
15
  export const useLeverageYieldApiCreateDepositIntent = ({
22
16
  mutationOptions,
23
17
  }: MutationHookParams<CreateIntentResponseV2, UseLeverageYieldApiCreateDepositIntentVars> = {}): SafeUseMutationResult<
@@ -5,19 +5,13 @@ import { unwrapResult } from '../shared/unwrapResult.js';
5
5
  import type { MutationHookParams } from '../shared/types.js';
6
6
  import { useSafeMutation, type SafeUseMutationResult } from '../shared/useSafeMutation.js';
7
7
 
8
- /**
9
- * Mutation variables for {@link useLeverageYieldApiCreateWithdrawIntent}. The per-request `apiConfig` override belongs here
10
- * rather than at the hook level — different calls in the same component can target different
11
- * endpoints without re-rendering.
12
- */
8
+ /** Per-call `apiConfig` so calls in one component can target different endpoints. */
13
9
  export type UseLeverageYieldApiCreateWithdrawIntentVars = {
14
10
  body: CreateWithdrawIntentParamsV2;
15
11
  apiConfig?: RequestOverrideConfig;
16
12
  };
17
13
 
18
- /**
19
- * React hook to build an unsigned withdraw create-intent transaction (lsoda* shares → any token) via the leverage-yield API — `sodax.api.leverageYield.createWithdrawIntent`.
20
- */
14
+ /** Builds an unsigned withdraw create-intent tx (lsoda* shares → any token). */
21
15
  export const useLeverageYieldApiCreateWithdrawIntent = ({
22
16
  mutationOptions,
23
17
  }: MutationHookParams<CreateIntentResponseV2, UseLeverageYieldApiCreateWithdrawIntentVars> = {}): SafeUseMutationResult<
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiDeadlineParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to compute a deposit/withdraw deadline (hub timestamp + `offsetSeconds`, default 300s)
18
- * via the leverage-yield API — `sodax.api.leverageYield.getDeadline`.
19
- *
20
- * @example
21
- * const { data: deadline } = useLeverageYieldApiDeadline({ params: { query: { offsetSeconds: 600 } } });
22
- */
16
+ /** Deadline = hub timestamp + `offsetSeconds` (default 300s). */
23
17
  export const useLeverageYieldApiDeadline = ({
24
18
  params,
25
19
  queryOptions,
@@ -19,21 +19,7 @@ export type UseLeverageYieldApiDepositQuoteParams = ReadHookParams<
19
19
  }
20
20
  >;
21
21
 
22
- /**
23
- * React hook to quote a swap-style leverage-yield deposit (any token → lsoda* shares) via the
24
- * leverage-yield API — `sodax.api.leverageYield.getDepositQuote`. Pass `query.includeTxData = true`
25
- * to also build the unsigned create-intent transaction (`srcAddress` then required in the body).
26
- *
27
- * @example
28
- * const { data: quote } = useLeverageYieldApiDepositQuote({
29
- * params: {
30
- * body: {
31
- * vault: '0x...', tokenSrc: '0x...', tokenSrcChainKey: '0xa4b1.arbitrum',
32
- * amount: '1000000', quoteType: 'exact_input',
33
- * },
34
- * },
35
- * });
36
- */
22
+ /** `query.includeTxData = true` also builds the unsigned create-intent tx and requires `srcAddress` in the body. */
37
23
  export const useLeverageYieldApiDepositQuote = ({
38
24
  params,
39
25
  queryOptions,
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiEffectiveAprParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to fetch the honest combined AAVE + LSD effective APR for a leverage-yield vault via the leverage-yield API —
18
- * `sodax.api.leverageYield.getEffectiveApr`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiEffectiveApr({ params: { vault: '0x...' } });
22
- */
16
+ /** Combined AAVE + LSD effective APR. */
23
17
  export const useLeverageYieldApiEffectiveApr = ({
24
18
  params,
25
19
  queryOptions,
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiEstimateGasParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to estimate gas for a raw transaction on a spoke chain via the leverage-yield API —
18
- * `sodax.api.leverageYield.estimateGas`. Returns `{ gas }` (chain-specific shape).
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiEstimateGas({ params: { body: { chainKey: 'sonic', tx: {...} } } });
22
- */
16
+ /** Returns `{ gas }` in a chain-specific shape. */
23
17
  export const useLeverageYieldApiEstimateGas = ({
24
18
  params,
25
19
  queryOptions,
@@ -13,12 +13,7 @@ export type UseLeverageYieldApiFilledIntentParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to get the on-chain fill state for an intent by its hub-chain tx hash via the leverage-yield API — `sodax.api.leverageYield.getFilledIntent`.
18
- *
19
- * @example
20
- * const { data } = useLeverageYieldApiFilledIntent({ params: { txHash: '0x123...' } });
21
- */
16
+ /** On-chain fill state, keyed by the intent's hub-chain tx hash. */
22
17
  export const useLeverageYieldApiFilledIntent = ({
23
18
  params,
24
19
  queryOptions,
@@ -13,12 +13,7 @@ export type UseLeverageYieldApiIntentParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to look up an Intent struct by its hub-chain creation tx hash via the leverage-yield API — `sodax.api.leverageYield.getIntent`.
18
- *
19
- * @example
20
- * const { data } = useLeverageYieldApiIntent({ params: { txHash: '0x123...' } });
21
- */
16
+ /** Looks up the Intent struct by its hub-chain creation tx hash. */
22
17
  export const useLeverageYieldApiIntent = ({
23
18
  params,
24
19
  queryOptions,
@@ -13,14 +13,7 @@ export type UseLeverageYieldApiIntentExtraDataParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to recover the relay extra data needed by `/leverage-yield/intents/submit` via the
18
- * leverage-yield API — `sodax.api.leverageYield.getIntentSubmitTxExtraData`. Provide EITHER `txHash`
19
- * OR `intent` in the body.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiIntentExtraData({ params: { body: { txHash: '0x...' } } });
23
- */
16
+ /** Relay extra data for `/leverage-yield/intents/submit`; the body takes EITHER `txHash` OR `intent`. */
24
17
  export const useLeverageYieldApiIntentExtraData = ({
25
18
  params,
26
19
  queryOptions,
@@ -13,13 +13,6 @@ export type UseLeverageYieldApiIntentHashParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to compute the keccak256 hash of an Intent struct via the leverage-yield API —
18
- * `sodax.api.leverageYield.getIntentHash`. Returns `{ hash }`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiIntentHash({ params: { intent } });
22
- */
23
16
  export const useLeverageYieldApiIntentHash = ({
24
17
  params,
25
18
  queryOptions,
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiIntentPacketParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to long-poll the relayer until the fill packet lands on the destination chain via the
18
- * leverage-yield API — `sodax.api.leverageYield.getSolvedIntentPacket`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiIntentPacket({ params: { body: { chainId: 'sonic', fillTxHash: '0x...' } } });
22
- */
16
+ /** Long-polls the relayer until the fill packet lands on the destination chain. */
23
17
  export const useLeverageYieldApiIntentPacket = ({
24
18
  params,
25
19
  queryOptions,
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiLsdAprParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to fetch the off-chain LSD staking-APR snapshot for a leverage-yield vault via the leverage-yield API —
18
- * `sodax.api.leverageYield.getLsdApr`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiLsdApr({ params: { vault: '0x...' } });
22
- */
16
+ /** Off-chain LSD staking-APR snapshot. */
23
17
  export const useLeverageYieldApiLsdApr = ({
24
18
  params,
25
19
  queryOptions,
@@ -14,13 +14,7 @@ export type UseLeverageYieldApiMaxWithdrawParams = ReadHookParams<
14
14
  }
15
15
  >;
16
16
 
17
- /**
18
- * React hook to get the maximum assets an owner can withdraw (ERC-4626 maxWithdraw) via the leverage-yield API —
19
- * `sodax.api.leverageYield.getMaxWithdraw`.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiMaxWithdraw({ params: { vault: '0x...', owner: '1000000000000000000' } });
23
- */
17
+ /** ERC-4626 `maxWithdraw` for `owner`. */
24
18
  export const useLeverageYieldApiMaxWithdraw = ({
25
19
  params,
26
20
  queryOptions,
@@ -13,13 +13,7 @@ export type UseLeverageYieldApiPartnerFeeParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to compute the partner fee for a given input amount via the leverage-yield API — `sodax.api.leverageYield.getPartnerFee`.
18
- * Returns `{ fee }` (decimal string).
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiPartnerFee({ params: { amount: '1000000' } });
22
- */
16
+ /** Returns `{ fee }` as a decimal string. */
23
17
  export const useLeverageYieldApiPartnerFee = ({
24
18
  params,
25
19
  queryOptions,
@@ -13,13 +13,6 @@ export type UseLeverageYieldApiPositionParams = ReadHookParams<
13
13
  }
14
14
  >;
15
15
 
16
- /**
17
- * React hook to fetch a leveraged-position snapshot for a leverage-yield vault via the leverage-yield API —
18
- * `sodax.api.leverageYield.getPosition`.
19
- *
20
- * @example
21
- * const { data } = useLeverageYieldApiPosition({ params: { vault: '0x...' } });
22
- */
23
16
  export const useLeverageYieldApiPosition = ({
24
17
  params,
25
18
  queryOptions,
@@ -14,13 +14,7 @@ export type UseLeverageYieldApiPreviewDepositParams = ReadHookParams<
14
14
  }
15
15
  >;
16
16
 
17
- /**
18
- * React hook to preview the shares minted for depositing `assets` (ERC-4626 previewDeposit) via the leverage-yield API —
19
- * `sodax.api.leverageYield.previewDeposit`.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiPreviewDeposit({ params: { vault: '0x...', assets: '1000000000000000000' } });
23
- */
17
+ /** ERC-4626 `previewDeposit`: shares minted for `assets`. */
24
18
  export const useLeverageYieldApiPreviewDeposit = ({
25
19
  params,
26
20
  queryOptions,
@@ -14,13 +14,7 @@ export type UseLeverageYieldApiPreviewRedeemParams = ReadHookParams<
14
14
  }
15
15
  >;
16
16
 
17
- /**
18
- * React hook to preview the assets returned for redeeming `shares` (ERC-4626 previewRedeem) via the leverage-yield API —
19
- * `sodax.api.leverageYield.previewRedeem`.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiPreviewRedeem({ params: { vault: '0x...', shares: '1000000000000000000' } });
23
- */
17
+ /** ERC-4626 `previewRedeem`: assets returned for `shares`. */
24
18
  export const useLeverageYieldApiPreviewRedeem = ({
25
19
  params,
26
20
  queryOptions,
@@ -14,13 +14,7 @@ export type UseLeverageYieldApiPreviewWithdrawParams = ReadHookParams<
14
14
  }
15
15
  >;
16
16
 
17
- /**
18
- * React hook to preview the shares burned to withdraw `assets` (ERC-4626 previewWithdraw) via the leverage-yield API —
19
- * `sodax.api.leverageYield.previewWithdraw`.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiPreviewWithdraw({ params: { vault: '0x...', assets: '1000000000000000000' } });
23
- */
17
+ /** ERC-4626 `previewWithdraw`: shares burned to withdraw `assets`. */
24
18
  export const useLeverageYieldApiPreviewWithdraw = ({
25
19
  params,
26
20
  queryOptions,
@@ -14,13 +14,6 @@ export type UseLeverageYieldApiShareBalanceParams = ReadHookParams<
14
14
  }
15
15
  >;
16
16
 
17
- /**
18
- * React hook to get an owner's vault share (lsoda*) balance via the leverage-yield API —
19
- * `sodax.api.leverageYield.getShareBalance`.
20
- *
21
- * @example
22
- * const { data } = useLeverageYieldApiShareBalance({ params: { vault: '0x...', owner: '1000000000000000000' } });
23
- */
24
17
  export const useLeverageYieldApiShareBalance = ({
25
18
  params,
26
19
  queryOptions,