viem
viem copied to clipboard
feat: zks namespace
Overview
This PR focuses on adding Public L2 actions functions for zkSync.
Detailed Summary:
Constructed zksRpcScheme
for zks
namespace.
Added new Actions which interact with zksRpcScheme
methods.
Added unit tests for each Action.
Added PublicActionsL2
decorator and tests.
PR-Codex overview
This PR adds new functions to retrieve information from zkSync like L1 chain ID, batch number, main contract address, base token L1 address, etc.
Detailed summary
- Added functions to get L1 chain ID, batch number, main contract address, base token L1 address, bridgehub contract address, transaction details, raw block transactions, and batch block range
- Created corresponding test files for each new function
- Updated documentation for each new function with descriptions, usage examples, and return types
The following files were skipped due to too many changes:
src/zksync/actions/getBridgehubContractAddress.ts
,src/zksync/actions/getTestnetPaymasterAddress.ts
,site/pages/zksync/actions/getBridgehubContractAddress.md
,site/pages/zksync/actions/getTestnetPaymasterAddress.md
,site/pages/zksync/actions/estimateFee.md
,src/zksync/actions/getLogProof.test.ts
,site/pages/zksync/actions/getDefaultBridgeAddress.md
,site/pages/zksync/actions/estimateGasL1ToL2.md
,site/pages/zksync/actions/getL1BatchDetails.md
,site/pages/zksync/actions/getRawBlockTransactions.md
,src/zksync/actions/getL1BatchBlockRange.ts
,src/zksync/actions/getLogProof.ts
,site/pages/zksync/actions/getBlockDetails.md
,src/zksync/actions/getTestnetPaymasterAddress.test.ts
,site/pages/zksync/actions/getTransactionDetails.md
,src/zksync/actions/getDefaultBridgeAddresses.ts
,src/zksync/actions/estimateFee.test.ts
,src/zksync/actions/estimateGasL1ToL2.test.ts
,site/pages/zksync/actions/getL1BatchBlockRange.md
,src/zksync/actions/getDefaultBridgeAddresses.test.ts
,src/zksync/actions/getBlockDetails.test.ts
,src/zksync/actions/getL1BatchDetails.ts
,src/zksync/actions/getTransactionDetails.ts
,site/pages/zksync/actions/getLogProof.md
,site/pages/zksync/actions/getAllBalances.md
,src/zksync/actions/getAllBalances.ts
,src/zksync/actions/getBlockDetails.ts
,src/zksync/actions/estimateGasL1ToL2.ts
,site/sidebar.ts
,src/zksync/types/transaction.ts
,src/zksync/actions/estimateFee.ts
,src/zksync/actions/getAllBalances.test.ts
,src/zksync/actions/getRawBlockTransaction.ts
,src/zksync/index.ts
,src/zksync/types/zksRpcScheme.ts
,src/zksync/decorators/publicL2.test.ts
,test/src/zksyncPublicActionsL2MockData.ts
,src/zksync/decorators/publicL2.ts
✨ Ask PR-Codex anything about this PR by commenting with
/codex {your question}