@sodax/dapp-kit 0.0.1-rc.8 → 1.0.0-beta

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 (137) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +157 -60
  3. package/dist/index.d.mts +1558 -0
  4. package/dist/index.d.ts +1558 -4
  5. package/dist/index.js +1030 -135
  6. package/dist/index.js.map +1 -1
  7. package/dist/index.mjs +988 -134
  8. package/dist/index.mjs.map +1 -1
  9. package/package.json +7 -8
  10. package/src/contexts/index.ts +3 -2
  11. package/src/hooks/backend/README.md +135 -0
  12. package/src/hooks/backend/index.ts +23 -0
  13. package/src/hooks/backend/useBackendAllMoneyMarketAssets.ts +49 -0
  14. package/src/hooks/backend/useBackendAllMoneyMarketBorrowers.ts +61 -0
  15. package/src/hooks/backend/useBackendIntentByHash.ts +53 -0
  16. package/src/hooks/backend/useBackendIntentByTxHash.ts +57 -0
  17. package/src/hooks/backend/useBackendMoneyMarketAsset.ts +57 -0
  18. package/src/hooks/backend/useBackendMoneyMarketAssetBorrowers.ts +67 -0
  19. package/src/hooks/backend/useBackendMoneyMarketAssetSuppliers.ts +67 -0
  20. package/src/hooks/backend/useBackendMoneyMarketPosition.ts +56 -0
  21. package/src/hooks/backend/useBackendOrderbook.ts +63 -0
  22. package/src/hooks/bridge/index.ts +5 -0
  23. package/src/hooks/bridge/useBridge.ts +57 -0
  24. package/src/hooks/bridge/useBridgeAllowance.ts +49 -0
  25. package/src/hooks/bridge/useBridgeApprove.ts +68 -0
  26. package/src/hooks/bridge/useGetBridgeableAmount.ts +50 -0
  27. package/src/hooks/bridge/useGetBridgeableTokens.ts +62 -0
  28. package/src/hooks/index.ts +4 -0
  29. package/src/hooks/migrate/index.ts +4 -0
  30. package/src/hooks/migrate/types.ts +15 -0
  31. package/src/hooks/migrate/useMigrate.tsx +110 -0
  32. package/src/hooks/migrate/useMigrationAllowance.tsx +79 -0
  33. package/src/hooks/migrate/useMigrationApprove.tsx +129 -0
  34. package/src/hooks/mm/index.ts +2 -1
  35. package/src/hooks/mm/useAToken.ts +47 -0
  36. package/src/hooks/mm/useBorrow.ts +2 -2
  37. package/src/hooks/mm/useMMAllowance.ts +2 -1
  38. package/src/hooks/mm/useMMApprove.ts +2 -1
  39. package/src/hooks/mm/useRepay.ts +2 -2
  40. package/src/hooks/mm/useReservesData.ts +1 -8
  41. package/src/hooks/mm/useReservesHumanized.ts +30 -0
  42. package/src/hooks/mm/useReservesList.ts +29 -0
  43. package/src/hooks/mm/useReservesUsdFormat.ts +38 -0
  44. package/src/hooks/mm/useSupply.ts +2 -2
  45. package/src/hooks/mm/useUserFormattedSummary.ts +54 -0
  46. package/src/hooks/mm/useUserReservesData.ts +30 -37
  47. package/src/hooks/mm/useWithdraw.ts +2 -2
  48. package/src/hooks/provider/useHubProvider.ts +3 -3
  49. package/src/hooks/provider/useSpokeProvider.ts +50 -18
  50. package/src/hooks/shared/index.ts +4 -0
  51. package/src/hooks/shared/useDeriveUserWalletAddress.ts +44 -0
  52. package/src/hooks/shared/useEstimateGas.ts +18 -0
  53. package/src/hooks/shared/useRequestTrustline.ts +103 -0
  54. package/src/hooks/shared/useStellarTrustlineCheck.ts +71 -0
  55. package/src/hooks/staking/index.ts +19 -0
  56. package/src/hooks/staking/useCancelUnstake.ts +52 -0
  57. package/src/hooks/staking/useClaim.ts +46 -0
  58. package/src/hooks/staking/useConvertedAssets.ts +47 -0
  59. package/src/hooks/staking/useInstantUnstake.ts +50 -0
  60. package/src/hooks/staking/useInstantUnstakeAllowance.ts +59 -0
  61. package/src/hooks/staking/useInstantUnstakeApprove.ts +52 -0
  62. package/src/hooks/staking/useInstantUnstakeRatio.ts +54 -0
  63. package/src/hooks/staking/useStake.ts +47 -0
  64. package/src/hooks/staking/useStakeAllowance.ts +57 -0
  65. package/src/hooks/staking/useStakeApprove.ts +50 -0
  66. package/src/hooks/staking/useStakeRatio.ts +53 -0
  67. package/src/hooks/staking/useStakingConfig.ts +40 -0
  68. package/src/hooks/staking/useStakingInfo.ts +50 -0
  69. package/src/hooks/staking/useUnstake.ts +54 -0
  70. package/src/hooks/staking/useUnstakeAllowance.ts +58 -0
  71. package/src/hooks/staking/useUnstakeApprove.ts +52 -0
  72. package/src/hooks/staking/useUnstakingInfo.ts +53 -0
  73. package/src/hooks/staking/useUnstakingInfoWithPenalty.ts +59 -0
  74. package/src/hooks/swap/index.ts +2 -1
  75. package/src/hooks/swap/useCancelSwap.ts +44 -0
  76. package/src/hooks/swap/useQuote.ts +21 -7
  77. package/src/hooks/swap/useStatus.ts +4 -4
  78. package/src/hooks/swap/{useCreateIntentOrder.ts → useSwap.ts} +19 -14
  79. package/src/hooks/swap/useSwapAllowance.ts +5 -1
  80. package/src/hooks/swap/useSwapApprove.ts +14 -14
  81. package/src/index.ts +0 -1
  82. package/src/providers/SodaxProvider.tsx +8 -20
  83. package/dist/contexts/index.d.ts +0 -8
  84. package/dist/contexts/index.d.ts.map +0 -1
  85. package/dist/core/index.d.ts +0 -4
  86. package/dist/core/index.d.ts.map +0 -1
  87. package/dist/hooks/index.d.ts +0 -5
  88. package/dist/hooks/index.d.ts.map +0 -1
  89. package/dist/hooks/mm/index.d.ts +0 -10
  90. package/dist/hooks/mm/index.d.ts.map +0 -1
  91. package/dist/hooks/mm/useBorrow.d.ts +0 -35
  92. package/dist/hooks/mm/useBorrow.d.ts.map +0 -1
  93. package/dist/hooks/mm/useHubWalletAddress.d.ts +0 -24
  94. package/dist/hooks/mm/useHubWalletAddress.d.ts.map +0 -1
  95. package/dist/hooks/mm/useMMAllowance.d.ts +0 -26
  96. package/dist/hooks/mm/useMMAllowance.d.ts.map +0 -1
  97. package/dist/hooks/mm/useMMApprove.d.ts +0 -27
  98. package/dist/hooks/mm/useMMApprove.d.ts.map +0 -1
  99. package/dist/hooks/mm/useRepay.d.ts +0 -35
  100. package/dist/hooks/mm/useRepay.d.ts.map +0 -1
  101. package/dist/hooks/mm/useReservesData.d.ts +0 -19
  102. package/dist/hooks/mm/useReservesData.d.ts.map +0 -1
  103. package/dist/hooks/mm/useSupply.d.ts +0 -34
  104. package/dist/hooks/mm/useSupply.d.ts.map +0 -1
  105. package/dist/hooks/mm/useUserReservesData.d.ts +0 -9
  106. package/dist/hooks/mm/useUserReservesData.d.ts.map +0 -1
  107. package/dist/hooks/mm/useWithdraw.d.ts +0 -33
  108. package/dist/hooks/mm/useWithdraw.d.ts.map +0 -1
  109. package/dist/hooks/provider/index.d.ts +0 -3
  110. package/dist/hooks/provider/index.d.ts.map +0 -1
  111. package/dist/hooks/provider/useHubProvider.d.ts +0 -3
  112. package/dist/hooks/provider/useHubProvider.d.ts.map +0 -1
  113. package/dist/hooks/provider/useSpokeProvider.d.ts +0 -18
  114. package/dist/hooks/provider/useSpokeProvider.d.ts.map +0 -1
  115. package/dist/hooks/shared/index.d.ts +0 -2
  116. package/dist/hooks/shared/index.d.ts.map +0 -1
  117. package/dist/hooks/shared/useSodaxContext.d.ts +0 -8
  118. package/dist/hooks/shared/useSodaxContext.d.ts.map +0 -1
  119. package/dist/hooks/swap/index.d.ts +0 -6
  120. package/dist/hooks/swap/index.d.ts.map +0 -1
  121. package/dist/hooks/swap/useCreateIntentOrder.d.ts +0 -33
  122. package/dist/hooks/swap/useCreateIntentOrder.d.ts.map +0 -1
  123. package/dist/hooks/swap/useQuote.d.ts +0 -39
  124. package/dist/hooks/swap/useQuote.d.ts.map +0 -1
  125. package/dist/hooks/swap/useStatus.d.ts +0 -31
  126. package/dist/hooks/swap/useStatus.d.ts.map +0 -1
  127. package/dist/hooks/swap/useSwapAllowance.d.ts +0 -23
  128. package/dist/hooks/swap/useSwapAllowance.d.ts.map +0 -1
  129. package/dist/hooks/swap/useSwapApprove.d.ts +0 -26
  130. package/dist/hooks/swap/useSwapApprove.d.ts.map +0 -1
  131. package/dist/index.d.ts.map +0 -1
  132. package/dist/providers/SodaxProvider.d.ts +0 -10
  133. package/dist/providers/SodaxProvider.d.ts.map +0 -1
  134. package/dist/providers/index.d.ts +0 -2
  135. package/dist/providers/index.d.ts.map +0 -1
  136. package/src/core/index.ts +0 -35
  137. package/src/hooks/mm/useHubWalletAddress.ts +0 -49
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) [2025] [Sodax]
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -10,24 +10,60 @@ dApp Kit is a collection of React components, hooks, and utilities designed to s
10
10
  - Withdraw tokens from the money market (`useWithdraw`)
11
11
  - Borrow tokens from the money market (`useBorrow`)
12
12
  - Repay borrowed tokens (`useRepay`)
13
- - Get user reserves data (`useUserReservesData`)
14
- - Calculate hub wallet address by using spoke chain id and spoke chain wallet address (`useHubWalletAddress`)
15
- - Get reserves data (`useReservesData`)
16
13
  - Check token allowance (`useMMAllowance`)
17
14
  - Approve token spending (`useMMApprove`)
15
+ - Get user reserves data (`useUserReservesData`)
16
+ - Get reserves data (`useReservesData`)
17
+ - Get humanized reserves data (`useReservesHumanized`)
18
+ - Get list of reserves (`useReservesList`)
19
+ - Get USD formatted reserves data (`useReservesUsdFormat`)
20
+ - Get formatted user portfolio summary (`useUserFormattedSummary`)
18
21
 
19
22
  - Swap/Intent
20
23
  - Get quote for an intent order (`useQuote`)
21
- - Create and submit an intent order (`useCreateIntentOrder`)
24
+ - Create and submit an swap intent order (`useSwap`)
22
25
  - Get status of an intent order (`useStatus`)
23
26
  - Check token allowance (`useSwapAllowance`)
24
27
  - Approve token spending (`useSwapApprove`)
28
+ - Cancel a swap intent order (`useCancelSwap`)
25
29
 
26
30
  - Provider
27
31
  - Get hub chain provider (`useHubProvider`)
28
32
  - Get spoke chain provider (`useSpokeProvider`)
29
33
  - Get wallet provider (`useWalletProvider`)
30
34
 
35
+ - Bridge
36
+ - Bridge tokens between chains (`useBridge`)
37
+ - Check token allowance for bridging (`useBridgeAllowance`)
38
+ - Approve source token for bridging (`useBridgeApprove`)
39
+ - Get max amount available to be bridged (`useGetBridgeableAmount`)
40
+ - Get available destination tokens based on provided source token (`useGetBridgeableTokens`)
41
+
42
+ - Shared
43
+ - Derive user wallet address for hub abstraction (`useDeriveUserWalletAddress`)
44
+ - Check if Stellar trustline is established for an asset (`useStellarTrustlineCheck`)
45
+ - Request creation of Stellar trustline line for an asset (`useRequestTrustline`)
46
+
47
+ - Staking
48
+ - Stake SODA tokens to receive xSODA shares (`useStake`)
49
+ - Unstake xSODA shares (`useUnstake`)
50
+ - Instant unstake xSODA shares with penalty (`useInstantUnstake`)
51
+ - Claim unstaked SODA tokens after unstaking period (`useClaim`)
52
+ - Cancel unstake request (`useCancelUnstake`)
53
+ - Check SODA token allowance for staking (`useStakeAllowance`)
54
+ - Approve SODA token spending for staking (`useStakeApprove`)
55
+ - Check xSODA token allowance for unstaking (`useUnstakeAllowance`)
56
+ - Approve xSODA token spending for unstaking (`useUnstakeApprove`)
57
+ - Check xSODA token allowance for instant unstaking (`useInstantUnstakeAllowance`)
58
+ - Approve xSODA token spending for instant unstaking (`useInstantUnstakeApprove`)
59
+ - Get comprehensive staking information (`useStakingInfo`)
60
+ - Get unstaking information with penalty details (`useUnstakingInfoWithPenalty`)
61
+ - Get unstaking information (`useUnstakingInfo`)
62
+ - Get staking configuration (`useStakingConfig`)
63
+ - Get stake ratio (SODA to xSODA conversion rate) (`useStakeRatio`)
64
+ - Get instant unstake ratio (xSODA to SODA conversion rate with penalty) (`useInstantUnstakeRatio`)
65
+ - Get converted assets amount for xSODA shares (`useConvertedAssets`)
66
+
31
67
  ## Installation
32
68
 
33
69
  ```bash
@@ -43,56 +79,43 @@ pnpm add @sodax/dapp-kit
43
79
  1. First, install the required dependencies:
44
80
 
45
81
  ```bash
46
- npm install @sodax/dapp-kit @tanstack/react-query @sodax/wallet-sdk
82
+ pnpm install @sodax/dapp-kit @tanstack/react-query @sodax/wallet-sdk-react
47
83
  ```
48
84
 
49
85
  2. Set up the providers in your app:
50
86
 
51
87
  ```typescript
52
88
  import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
53
- import { XWagmiProviders } from '@sodax/wallet-sdk';
89
+ import { SodaxWalletProvider } from '@sodax/wallet-sdk-react';
54
90
  import { SodaxProvider } from '@sodax/dapp-kit';
55
- import { SONIC_MAINNET_CHAIN_ID } from '@sodax/types';
91
+ import type { RpcConfig } from '@sodax/types';
56
92
 
57
93
  const queryClient = new QueryClient();
58
94
 
59
- // Configure Sodax
60
- const sodaxConfig = {
61
- hubProviderConfig: {
62
- hubRpcUrl: 'https://rpc.soniclabs.com',
63
- chainConfig: getHubChainConfig(SONIC_MAINNET_CHAIN_ID),
64
- },
65
- moneyMarket: getMoneyMarketConfig(SONIC_MAINNET_CHAIN_ID),
66
- solver: {
67
- intentsContract: '0x6382D6ccD780758C5e8A6123c33ee8F4472F96ef',
68
- solverApiEndpoint: 'https://sodax-solver.iconblockchain.xyz',
69
- partnerFee: {
70
- address: '0x0Ab764AB3816cD036Ea951bE973098510D8105A6',
71
- percentage: 100, // 1%
72
- },
73
- },
74
- relayerApiEndpoint: 'https://xcall-relay.nw.iconblockchain.xyz',
95
+ const rpcConfig: RpcConfig = {
96
+ // EVM chains
97
+ sonic: 'https://rpc.soniclabs.com',
98
+ '0xa86a.avax': 'https://api.avax.network/ext/bc/C/rpc',
99
+ '0xa4b1.arbitrum': 'https://arb1.arbitrum.io/rpc',
100
+ '0x2105.base': 'https://mainnet.base.org',
101
+ '0x38.bsc': 'https://bsc-dataseed1.binance.org',
102
+ '0xa.optimism': 'https://mainnet.optimism.io',
103
+ '0x89.polygon': 'https://polygon-rpc.com',
104
+
105
+ // Other chains
106
+ '0x1.icon': 'https://ctz.solidwallet.io/api/v3',
107
+ solana: 'https://solana-mainnet.g.alchemy.com/v2/your-api-key',
108
+ sui: 'https://fullnode.mainnet.sui.io',
109
+ 'injective-1': 'https://sentry.tm.injective.network:26657',
75
110
  };
76
111
 
77
112
  function App() {
78
113
  return (
79
- <SodaxProvider testnet={false} config={sodaxConfig}>
114
+ <SodaxProvider testnet={false} rpcConfig={rpcConfig}>
80
115
  <QueryClientProvider client={queryClient}>
81
- <XWagmiProviders
82
- config={{
83
- EVM: {
84
- wagmiConfig: wagmiConfig,
85
- },
86
- SUI: {
87
- isMainnet: true,
88
- },
89
- SOLANA: {
90
- endpoint: 'https://solana-mainnet.g.alchemy.com/v2/your-api-key',
91
- },
92
- }}
93
- >
116
+ <SodaxWalletProvider rpcConfig={rpcConfig}>
94
117
  <YourApp />
95
- </XWagmiProviders>
118
+ </SodaxWalletProvider>
96
119
  </QueryClientProvider>
97
120
  </SodaxProvider>
98
121
  );
@@ -103,7 +126,7 @@ function App() {
103
126
 
104
127
  ```typescript
105
128
  // Connect Wallet Operations
106
- import { useXConnectors, useXConnect, useXAccount } from '@sodax/wallet-sdk';
129
+ import { useXConnectors, useXConnect, useXAccount } from '@sodax/wallet-sdk-react';
107
130
  const evmConnectors = useXConnectors('EVM');
108
131
  const { mutateAsync: connect, isPending } = useXConnect();
109
132
  const account = useXAccount('EVM');
@@ -159,8 +182,26 @@ function TokenManagementComponent() {
159
182
  };
160
183
  }
161
184
 
185
+ // Wallet Address Derivation
186
+ import { useDeriveUserWalletAddress, useSpokeProvider } from '@sodax/dapp-kit';
187
+
188
+ function WalletAddressComponent() {
189
+ const spokeProvider = useSpokeProvider(chainId, walletProvider);
190
+
191
+ // Derive user wallet address for hub abstraction
192
+ const { data: derivedAddress, isLoading, error } = useDeriveUserWalletAddress(spokeProvider, userAddress);
193
+
194
+ return (
195
+ <div>
196
+ {isLoading && <div>Deriving wallet address...</div>}
197
+ {error && <div>Error: {error.message}</div>}
198
+ {derivedAddress && <div>Derived Address: {derivedAddress}</div>}
199
+ </div>
200
+ );
201
+ }
202
+
162
203
  // Swap Operations
163
- import { useQuote, useCreateIntentOrder, useStatus } from '@sodax/dapp-kit';
204
+ import { useQuote, useSwap, useStatus } from '@sodax/dapp-kit';
164
205
 
165
206
  function SwapComponent() {
166
207
  // Get quote for an intent order
@@ -174,9 +215,9 @@ function SwapComponent() {
174
215
  });
175
216
 
176
217
  // Create and submit an intent order
177
- const { mutateAsync: createOrder, isPending: isCreating } = useCreateIntentOrder();
178
- const handleCreateOrder = async () => {
179
- const order = await createOrder({
218
+ const { mutateAsync: swap, isPending: isCreating } = useSwap();
219
+ const handleSwap = async () => {
220
+ const order = await swap({
180
221
  token_src: '0x...',
181
222
  token_src_blockchain_id: '0xa86a.avax',
182
223
  token_dst: '0x...',
@@ -189,6 +230,53 @@ function SwapComponent() {
189
230
  // Get status of an intent order
190
231
  const { data: orderStatus } = useStatus('0x...');
191
232
  }
233
+
234
+ // Bridge Operations
235
+ import { useBridge, useBridgeAllowance, useBridgeApprove, useGetBridgeableAmount, useGetBridgeableTokens } from '@sodax/dapp-kit';
236
+
237
+ function BridgeComponent() {
238
+ const spokeProvider = useSpokeProvider(chainId, walletProvider);
239
+
240
+ // Get available destination tokens for bridging
241
+ const { data: bridgeableTokens, isLoading: isTokensLoading } = useGetBridgeableTokens(
242
+ '0x2105.base', // from chain
243
+ '0x89.polygon', // to chain
244
+ '0x...' // source token address
245
+ );
246
+
247
+ // Get maximum amount available to bridge
248
+ const { data: bridgeableAmount } = useGetBridgeableAmount(
249
+ { address: '0x...', xChainId: '0x2105.base' }, // from token
250
+ { address: '0x...', xChainId: '0x89.polygon' } // to token
251
+ );
252
+
253
+ // Check token allowance for bridge
254
+ const { data: hasAllowed } = useBridgeAllowance(bridgeParams, spokeProvider);
255
+
256
+ // Approve tokens for bridge
257
+ const { approve: approveBridge, isLoading: isApproving } = useBridgeApprove(spokeProvider);
258
+ const handleApprove = async () => {
259
+ await approveBridge(bridgeParams);
260
+ };
261
+
262
+ // Execute bridge transaction
263
+ const { mutateAsync: bridge, isPending: isBridging } = useBridge(spokeProvider);
264
+ const handleBridge = async () => {
265
+ const result = await bridge({
266
+ srcChainId: '0x2105.base',
267
+ srcAsset: '0x...',
268
+ amount: 1000n,
269
+ dstChainId: '0x89.polygon',
270
+ dstAsset: '0x...',
271
+ recipient: '0x...'
272
+ });
273
+
274
+ console.log('Bridge transaction hashes:', {
275
+ spokeTxHash: result.value[0],
276
+ hubTxHash: result.value[1]
277
+ });
278
+ };
279
+ }
192
280
  ```
193
281
 
194
282
  ## Requirements
@@ -201,31 +289,40 @@ function SwapComponent() {
201
289
 
202
290
  ### Components
203
291
 
204
- - [`SodaxProvider`](./src/providers/SodaxProvider.tsx) - Main provider component for Sodax ecosystem integration
292
+ - [`SodaxProvider`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/providers/SodaxProvider.tsx) - Main provider component for Sodax ecosystem integration
205
293
 
206
294
  ### Hooks
207
295
 
208
296
  #### Money Market Hooks
209
- - [`useBorrow()`](./src/hooks/mm/useBorrow.ts) - Borrow tokens from the money market
210
- - [`useRepay()`](./src/hooks/mm/useRepay.ts) - Repay borrowed tokens
211
- - [`useSupply()`](./src/hooks/mm/useSupply.ts) - Supply tokens to the money market
212
- - [`useWithdraw()`](./src/hooks/mm/useWithdraw.ts) - Withdraw supplied tokens
213
- - [`useUserReservesData()`](./src/hooks/mm/useUserReservesData.ts) - Get user's reserves data(supplied asset and debt)
214
- - [`useHubWalletAddress()`](./src/hooks/mm/useHubWalletAddress.ts) - Get hub wallet address for a spoke chain
215
- - [`useReservesData()`](./src/hooks/mm/useReservesData.ts) - Get reserves data
216
- - [`useMMAllowance()`](./src/hooks/mm/useMMAllowance.ts) - Check token allowance for a specific amount
217
- - [`useMMApprove()`](./src/hooks/mm/useMMApprove.ts) - Approve token spending
297
+ - [`useBorrow()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useBorrow.ts) - Borrow tokens from the money market
298
+ - [`useRepay()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useRepay.ts) - Repay borrowed tokens
299
+ - [`useSupply()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useSupply.ts) - Supply tokens to the money market
300
+ - [`useWithdraw()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useWithdraw.ts) - Withdraw supplied tokens
301
+ - [`useUserReservesData()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useUserReservesData.ts) - Get user's reserves data(supplied asset and debt)
302
+ - [`useReservesData()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useReservesData.ts) - Get reserves data
303
+ - [`useMMAllowance()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useMMAllowance.ts) - Check token allowance for a specific amount
304
+ - [`useMMApprove()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useMMApprove.ts) - Approve token spending
305
+ - [`useAToken()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/mm/useAToken.ts) - Fetch aToken token data
218
306
 
219
307
  #### Swap Hooks
220
- - [`useQuote()`](./src/hooks/swap/useQuote.ts) - Get quote for an intent order
221
- - [`useCreateIntentOrder()`](./src/hooks/swap/useCreateIntentOrder.ts) - Create and submit an intent order
222
- - [`useStatus()`](./src/hooks/swap/useStatus.ts) - Get status of an intent order
223
- - [`useSwapAllowance()`](./src/hooks/swap/useSwapAllowance.ts) - Check token allowance for an intent order
224
- - [`useSwapApprove()`](./src/hooks/swap/useSwapApprove.ts) - Approve token spending
308
+ - [`useQuote()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useQuote.ts) - Get quote for an intent order
309
+ - [`useSwap()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useSwap.ts) - Create and submit an intent order
310
+ - [`useStatus()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useStatus.ts) - Get status of an intent order
311
+ - [`useSwapAllowance()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useSwapAllowance.ts) - Check token allowance for an intent order
312
+ - [`useSwapApprove()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useSwapApprove.ts) - Approve token spending
313
+ - [`useCancelSwap()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/swap/useCancelSwap.ts) - Cancel a swap intent order
225
314
 
226
315
  #### Shared Hooks
227
- - [`useSodaxContext()`](./src/hooks/shared/useSodaxContext.ts) - Access Sodax context and configuration
228
-
316
+ - [`useSodaxContext()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/shared/useSodaxContext.ts) - Access Sodax context and configuration
317
+ - [`useEstimateGas()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/shared/useEstimateGas.ts) - Estimate gas costs for transactions
318
+ - [`useDeriveUserWalletAddress()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/shared/useDeriveUserWalletAddress.ts) - Derive user wallet address for hub abstraction
319
+
320
+ #### Bridge Hooks
321
+ - [`useBridge()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/bridge/useBridge.ts) - Execute bridge transactions to transfer tokens between chains
322
+ - [`useBridgeAllowance()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/bridge/useBridgeAllowance.ts) - Check token allowance for bridge operations
323
+ - [`useBridgeApprove()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/bridge/useBridgeApprove.ts) - Approve token spending for bridge actions
324
+ - [`useGetBridgeableAmount()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/bridge/useGetBridgeableAmount.ts) - Get maximum amount available to be bridged
325
+ - [`useGetBridgeableTokens()`](https://github.com/icon-project/sodax-frontend/tree/main/packages/dapp-kit/src/hooks/bridge/useGetBridgeableTokens.ts) - Get available destination tokens for bridging
229
326
 
230
327
  ## Contributing
231
328