diff --git a/composables/zksync/useTransaction.ts b/composables/zksync/useTransaction.ts index d8662c93b..fdfe81d6d 100644 --- a/composables/zksync/useTransaction.ts +++ b/composables/zksync/useTransaction.ts @@ -36,6 +36,7 @@ export default (getSigner: () => Promise, getProvider: () => status.value = "processing"; const signer = await getSigner(); if (!signer) throw new Error("zkSync Signer is not available"); + const provider = getProvider(); const getRequiredBridgeAddress = async () => { if (transaction.tokenAddress === ETH_TOKEN.address) return undefined; @@ -48,7 +49,8 @@ export default (getSigner: () => Promise, getProvider: () => await validateAddress(transaction.to); status.value = "waiting-for-signature"; - const tx = await signer[transaction.type === "transfer" ? "transfer" : "withdraw"]({ + const txRequest = await provider[transaction.type === "transfer" ? "getTransferTx" : "getWithdrawTx"]({ + from: await signer.getAddress(), to: transaction.to, token: transaction.tokenAddress === ETH_TOKEN.address ? ETH_TOKEN.l1Address! : transaction.tokenAddress, amount: transaction.amount, @@ -59,6 +61,9 @@ export default (getSigner: () => Promise, getProvider: () => }, }); + const txResponse = await signer.sendTransaction(txRequest); + const tx = getProvider()._wrapTransaction(txResponse); + transactionHash.value = tx.hash; status.value = "done";