Skip to content

Commit

Permalink
fix: send assets broken from ethers v6 migration (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter authored Jan 20, 2025
1 parent 84bec2d commit da9e526
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
5 changes: 2 additions & 3 deletions composables/zksync/useTransaction.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,11 @@ export default (getSigner: () => Promise<Signer | undefined>, getProvider: () =>
});

const txResponse = await signer.sendTransaction(txRequest);
const tx = getProvider()._wrapTransaction(txResponse);

transactionHash.value = tx.hash;
transactionHash.value = txResponse.hash;
status.value = "done";

return tx;
return txResponse;
} catch (err) {
error.value = formatError(err as Error);
status.value = "not-started";
Expand Down
6 changes: 4 additions & 2 deletions store/zksync/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ethers } from "ethers";
import { $fetch } from "ofetch";
import { L1Signer, L1VoidSigner, BrowserProvider } from "zksync-ethers";
import { L1Signer, L1VoidSigner, BrowserProvider, Signer } from "zksync-ethers";

import type { Api, TokenAmount } from "@/types";
import type { BigNumberish } from "ethers";
Expand All @@ -23,7 +23,9 @@ export const useZkSyncWalletStore = defineStore("zkSyncWallet", () => {
}

const web3Provider = new BrowserProvider((await onboardStore.getWallet(eraNetwork.value.id)) as any, "any");
const eraL2Signer = web3Provider.getSigner();
const rawEthersSigner = await web3Provider.getSigner();
const eraL2Signer = Signer.from(rawEthersSigner, Number(eraNetwork.value.id), providerStore.requestProvider());

return eraL2Signer;
});
const { execute: getL1Signer, reset: resetL1Signer } = usePromise(async () => {
Expand Down

0 comments on commit da9e526

Please sign in to comment.