@sodax/dapp-kit 1.0.1-beta-rc2 → 1.0.1-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.
- package/dist/index.js +16 -8
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +16 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/hooks/mm/useBorrow.ts +4 -2
- package/src/hooks/mm/useRepay.ts +4 -2
- package/src/hooks/mm/useSupply.ts +4 -2
- package/src/hooks/mm/useWithdraw.ts +4 -2
package/dist/index.mjs
CHANGED
|
@@ -178,7 +178,7 @@ function useSpokeProvider(spokeChainId, walletProvider) {
|
|
|
178
178
|
function useBorrow(spokeToken, spokeProvider) {
|
|
179
179
|
const { sodax } = useSodaxContext();
|
|
180
180
|
return useMutation({
|
|
181
|
-
mutationFn: async (amount) => {
|
|
181
|
+
mutationFn: async (amount, toChainId, toAddress) => {
|
|
182
182
|
if (!spokeProvider) {
|
|
183
183
|
throw new Error("spokeProvider is not found");
|
|
184
184
|
}
|
|
@@ -186,7 +186,9 @@ function useBorrow(spokeToken, spokeProvider) {
|
|
|
186
186
|
{
|
|
187
187
|
token: spokeToken.address,
|
|
188
188
|
amount: parseUnits(amount, 18),
|
|
189
|
-
action: "borrow"
|
|
189
|
+
action: "borrow",
|
|
190
|
+
toChainId,
|
|
191
|
+
toAddress
|
|
190
192
|
},
|
|
191
193
|
spokeProvider
|
|
192
194
|
);
|
|
@@ -201,7 +203,7 @@ function useBorrow(spokeToken, spokeProvider) {
|
|
|
201
203
|
function useRepay(spokeToken, spokeProvider) {
|
|
202
204
|
const { sodax } = useSodaxContext();
|
|
203
205
|
return useMutation({
|
|
204
|
-
mutationFn: async (amount) => {
|
|
206
|
+
mutationFn: async (amount, toChainId, toAddress) => {
|
|
205
207
|
if (!spokeProvider) {
|
|
206
208
|
throw new Error("spokeProvider is not found");
|
|
207
209
|
}
|
|
@@ -209,7 +211,9 @@ function useRepay(spokeToken, spokeProvider) {
|
|
|
209
211
|
{
|
|
210
212
|
token: spokeToken.address,
|
|
211
213
|
amount: parseUnits(amount, spokeToken.decimals),
|
|
212
|
-
action: "repay"
|
|
214
|
+
action: "repay",
|
|
215
|
+
toChainId,
|
|
216
|
+
toAddress
|
|
213
217
|
},
|
|
214
218
|
spokeProvider
|
|
215
219
|
);
|
|
@@ -224,7 +228,7 @@ function useRepay(spokeToken, spokeProvider) {
|
|
|
224
228
|
function useSupply(spokeToken, spokeProvider) {
|
|
225
229
|
const { sodax } = useSodaxContext();
|
|
226
230
|
return useMutation({
|
|
227
|
-
mutationFn: async (amount) => {
|
|
231
|
+
mutationFn: async (amount, toChainId, toAddress) => {
|
|
228
232
|
if (!spokeProvider) {
|
|
229
233
|
throw new Error("spokeProvider is not found");
|
|
230
234
|
}
|
|
@@ -232,7 +236,9 @@ function useSupply(spokeToken, spokeProvider) {
|
|
|
232
236
|
{
|
|
233
237
|
token: spokeToken.address,
|
|
234
238
|
amount: parseUnits(amount, spokeToken.decimals),
|
|
235
|
-
action: "supply"
|
|
239
|
+
action: "supply",
|
|
240
|
+
toChainId,
|
|
241
|
+
toAddress
|
|
236
242
|
},
|
|
237
243
|
spokeProvider
|
|
238
244
|
);
|
|
@@ -247,7 +253,7 @@ function useSupply(spokeToken, spokeProvider) {
|
|
|
247
253
|
function useWithdraw(spokeToken, spokeProvider) {
|
|
248
254
|
const { sodax } = useSodaxContext();
|
|
249
255
|
return useMutation({
|
|
250
|
-
mutationFn: async (amount) => {
|
|
256
|
+
mutationFn: async (amount, toChainId, toAddress) => {
|
|
251
257
|
if (!spokeProvider) {
|
|
252
258
|
throw new Error("spokeProvider is not found");
|
|
253
259
|
}
|
|
@@ -256,7 +262,9 @@ function useWithdraw(spokeToken, spokeProvider) {
|
|
|
256
262
|
token: spokeToken.address,
|
|
257
263
|
// vault token on hub chain decimals is 18
|
|
258
264
|
amount: parseUnits(amount, 18),
|
|
259
|
-
action: "withdraw"
|
|
265
|
+
action: "withdraw",
|
|
266
|
+
toChainId,
|
|
267
|
+
toAddress
|
|
260
268
|
},
|
|
261
269
|
spokeProvider
|
|
262
270
|
);
|