@sodax/dapp-kit 1.0.1-beta-rc1 → 1.0.1-beta-rc3

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.js CHANGED
@@ -184,7 +184,7 @@ function useSpokeProvider(spokeChainId, walletProvider) {
184
184
  function useBorrow(spokeToken, spokeProvider) {
185
185
  const { sodax } = useSodaxContext();
186
186
  return reactQuery.useMutation({
187
- mutationFn: async (amount) => {
187
+ mutationFn: async (amount, toChainId, toAddress) => {
188
188
  if (!spokeProvider) {
189
189
  throw new Error("spokeProvider is not found");
190
190
  }
@@ -192,7 +192,9 @@ function useBorrow(spokeToken, spokeProvider) {
192
192
  {
193
193
  token: spokeToken.address,
194
194
  amount: viem.parseUnits(amount, 18),
195
- action: "borrow"
195
+ action: "borrow",
196
+ toChainId,
197
+ toAddress
196
198
  },
197
199
  spokeProvider
198
200
  );
@@ -207,7 +209,7 @@ function useBorrow(spokeToken, spokeProvider) {
207
209
  function useRepay(spokeToken, spokeProvider) {
208
210
  const { sodax } = useSodaxContext();
209
211
  return reactQuery.useMutation({
210
- mutationFn: async (amount) => {
212
+ mutationFn: async (amount, toChainId, toAddress) => {
211
213
  if (!spokeProvider) {
212
214
  throw new Error("spokeProvider is not found");
213
215
  }
@@ -215,7 +217,9 @@ function useRepay(spokeToken, spokeProvider) {
215
217
  {
216
218
  token: spokeToken.address,
217
219
  amount: viem.parseUnits(amount, spokeToken.decimals),
218
- action: "repay"
220
+ action: "repay",
221
+ toChainId,
222
+ toAddress
219
223
  },
220
224
  spokeProvider
221
225
  );
@@ -230,7 +234,7 @@ function useRepay(spokeToken, spokeProvider) {
230
234
  function useSupply(spokeToken, spokeProvider) {
231
235
  const { sodax } = useSodaxContext();
232
236
  return reactQuery.useMutation({
233
- mutationFn: async (amount) => {
237
+ mutationFn: async (amount, toChainId, toAddress) => {
234
238
  if (!spokeProvider) {
235
239
  throw new Error("spokeProvider is not found");
236
240
  }
@@ -238,7 +242,9 @@ function useSupply(spokeToken, spokeProvider) {
238
242
  {
239
243
  token: spokeToken.address,
240
244
  amount: viem.parseUnits(amount, spokeToken.decimals),
241
- action: "supply"
245
+ action: "supply",
246
+ toChainId,
247
+ toAddress
242
248
  },
243
249
  spokeProvider
244
250
  );
@@ -253,7 +259,7 @@ function useSupply(spokeToken, spokeProvider) {
253
259
  function useWithdraw(spokeToken, spokeProvider) {
254
260
  const { sodax } = useSodaxContext();
255
261
  return reactQuery.useMutation({
256
- mutationFn: async (amount) => {
262
+ mutationFn: async (amount, toChainId, toAddress) => {
257
263
  if (!spokeProvider) {
258
264
  throw new Error("spokeProvider is not found");
259
265
  }
@@ -262,7 +268,9 @@ function useWithdraw(spokeToken, spokeProvider) {
262
268
  token: spokeToken.address,
263
269
  // vault token on hub chain decimals is 18
264
270
  amount: viem.parseUnits(amount, 18),
265
- action: "withdraw"
271
+ action: "withdraw",
272
+ toChainId,
273
+ toAddress
266
274
  },
267
275
  spokeProvider
268
276
  );