1+ "use client" ;
12import { useMutation , useQueryClient } from "@tanstack/react-query" ;
2- import { LiquidOpsClient } from "@/utils/LiquidOps/LiquidOps" ;
3- import { tokenInput , tokenData } from "liquidops" ;
3+ import LiquidOps , { tokenInput , tokenData } from "liquidops" ;
44import { PendingTxContext } from "@/components/PendingTransactions/PendingTransactions" ;
55import { useContext } from "react" ;
66import { Quantity } from "ao-tokens-lite" ;
77import { NotificationContext } from "@/components/notifications/NotificationProvider" ;
88import { formatQty } from "@/utils/LiquidOps/tokenFormat" ;
9+ import { createDataItemSigner } from "@permaweb/aoconnect" ;
910
1011interface BorrowParams {
1112 token : string ;
@@ -26,6 +27,9 @@ export function useBorrow({ onSuccess }: Params = {}) {
2627 const borrowMutation = useMutation ( {
2728 mutationFn : async ( { token, quantity } : BorrowParams ) => {
2829 try {
30+ const LiquidOpsClient = new LiquidOps (
31+ createDataItemSigner ( window . arweaveWallet ) ,
32+ ) ;
2933 const walletAddress = await window . arweaveWallet . getActiveAddress ( ) ;
3034 const messageId = await LiquidOpsClient . borrow ( {
3135 token,
@@ -126,6 +130,9 @@ export function useBorrow({ onSuccess }: Params = {}) {
126130 const repayMutation = useMutation ( {
127131 mutationFn : async ( { token, quantity } : RepayParams ) => {
128132 try {
133+ const LiquidOpsClient = new LiquidOps (
134+ createDataItemSigner ( window . arweaveWallet ) ,
135+ ) ;
129136 const walletAddress = await window . arweaveWallet . getActiveAddress ( ) ;
130137 const transferId = await LiquidOpsClient . repay ( {
131138 token,
0 commit comments