diff --git a/.changeset/angry-cars-poke.md b/.changeset/angry-cars-poke.md new file mode 100644 index 0000000000..d5c50c3e3a --- /dev/null +++ b/.changeset/angry-cars-poke.md @@ -0,0 +1,5 @@ +--- +"viem": patch +--- + +**ZKsync:** Fixed `TransactionReceipt` formatter & type. diff --git a/src/zksync/formatters.ts b/src/zksync/formatters.ts index aeff174c70..f4857ffc80 100644 --- a/src/zksync/formatters.ts +++ b/src/zksync/formatters.ts @@ -81,7 +81,7 @@ export const formatters = { return { blockNumber: hexToBigInt(l2ToL1Log.blockHash), blockHash: l2ToL1Log.blockHash, - l1BatchNumber: hexToBigInt(l2ToL1Log.l1BatchNumber), + l1BatchNumber: l2ToL1Log.l1BatchNumber ? hexToBigInt(l2ToL1Log.l1BatchNumber) : null, transactionIndex: hexToBigInt(l2ToL1Log.transactionIndex), shardId: hexToBigInt(l2ToL1Log.shardId), isService: l2ToL1Log.isService, diff --git a/src/zksync/types/log.ts b/src/zksync/types/log.ts index a8345492af..f22db6721b 100644 --- a/src/zksync/types/log.ts +++ b/src/zksync/types/log.ts @@ -45,7 +45,7 @@ export type ZksyncL2ToL1Log = { export type ZksyncRpcL2ToL1Log = { blockNumber: Hex blockHash: Hex - l1BatchNumber: Hex + l1BatchNumber: Hex | null transactionIndex: Hex shardId: Hex isService: boolean