viem 2.10.9 → 2.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/_cjs/actions/public/call.js +3 -60
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +8 -2
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/celo/formatters.js +1 -10
- package/_cjs/celo/formatters.js.map +1 -1
- package/_cjs/celo/serializers.js +0 -25
- package/_cjs/celo/serializers.js.map +1 -1
- package/_cjs/celo/utils.js +2 -15
- package/_cjs/celo/utils.js.map +1 -1
- package/_cjs/chains/definitions/bob.js +33 -0
- package/_cjs/chains/definitions/bob.js.map +1 -0
- package/_cjs/chains/definitions/funkiSepolia.js +34 -0
- package/_cjs/chains/definitions/funkiSepolia.js.map +1 -0
- package/_cjs/chains/definitions/lisk.js +34 -0
- package/_cjs/chains/definitions/lisk.js.map +1 -0
- package/_cjs/chains/definitions/metalL2.js +53 -0
- package/_cjs/chains/definitions/metalL2.js.map +1 -0
- package/_cjs/chains/index.js +14 -6
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/op-stack/chains.js +3 -1
- package/_cjs/op-stack/chains.js.map +1 -1
- package/_cjs/utils/stateOverride.js +63 -0
- package/_cjs/utils/stateOverride.js.map +1 -0
- package/_cjs/zksync/actions/estimateFee.js +26 -0
- package/_cjs/zksync/actions/estimateFee.js.map +1 -0
- package/_cjs/zksync/actions/estimateGasL1ToL2.js +20 -0
- package/_cjs/zksync/actions/estimateGasL1ToL2.js.map +1 -0
- package/_cjs/zksync/actions/getAllBalances.js +19 -0
- package/_cjs/zksync/actions/getAllBalances.js.map +1 -0
- package/_cjs/zksync/actions/getBaseTokenL1Address.js +9 -0
- package/_cjs/zksync/actions/getBaseTokenL1Address.js.map +1 -0
- package/_cjs/zksync/actions/getBlockDetails.js +12 -0
- package/_cjs/zksync/actions/getBlockDetails.js.map +1 -0
- package/_cjs/zksync/actions/getBridgehubContractAddress.js +9 -0
- package/_cjs/zksync/actions/getBridgehubContractAddress.js.map +1 -0
- package/_cjs/zksync/actions/getDefaultBridgeAddresses.js +13 -0
- package/_cjs/zksync/actions/getDefaultBridgeAddresses.js.map +1 -0
- package/_cjs/zksync/actions/getL1Allowance.js +19 -0
- package/_cjs/zksync/actions/getL1Allowance.js.map +1 -0
- package/_cjs/zksync/actions/getL1Balance.js +23 -0
- package/_cjs/zksync/actions/getL1Balance.js.map +1 -0
- package/_cjs/zksync/actions/getL1BatchBlockRange.js +13 -0
- package/_cjs/zksync/actions/getL1BatchBlockRange.js.map +1 -0
- package/_cjs/zksync/actions/getL1BatchDetails.js +12 -0
- package/_cjs/zksync/actions/getL1BatchDetails.js.map +1 -0
- package/_cjs/zksync/actions/getL1BatchNumber.js +9 -0
- package/_cjs/zksync/actions/getL1BatchNumber.js.map +1 -0
- package/_cjs/zksync/actions/getL1ChainId.js +9 -0
- package/_cjs/zksync/actions/getL1ChainId.js.map +1 -0
- package/_cjs/zksync/actions/getL1TokenBalance.js +24 -0
- package/_cjs/zksync/actions/getL1TokenBalance.js.map +1 -0
- package/_cjs/zksync/actions/getLogProof.js +12 -0
- package/_cjs/zksync/actions/getLogProof.js.map +1 -0
- package/_cjs/zksync/actions/getMainContractAddress.js +9 -0
- package/_cjs/zksync/actions/getMainContractAddress.js.map +1 -0
- package/_cjs/zksync/actions/getRawBlockTransactions.js +13 -0
- package/_cjs/zksync/actions/getRawBlockTransactions.js.map +1 -0
- package/_cjs/zksync/actions/getTestnetPaymasterAddress.js +9 -0
- package/_cjs/zksync/actions/getTestnetPaymasterAddress.js.map +1 -0
- package/_cjs/zksync/actions/getTransactionDetails.js +12 -0
- package/_cjs/zksync/actions/getTransactionDetails.js.map +1 -0
- package/_cjs/zksync/constants/address.js +4 -1
- package/_cjs/zksync/constants/address.js.map +1 -1
- package/_cjs/zksync/decorators/publicL1.js +15 -0
- package/_cjs/zksync/decorators/publicL1.js.map +1 -0
- package/_cjs/zksync/decorators/publicL2.js +43 -0
- package/_cjs/zksync/decorators/publicL2.js.map +1 -0
- package/_cjs/zksync/errors/token-is-eth.js +17 -0
- package/_cjs/zksync/errors/token-is-eth.js.map +1 -0
- package/_cjs/zksync/index.js +41 -3
- package/_cjs/zksync/index.js.map +1 -1
- package/_cjs/zksync/types/eip1193.js +3 -0
- package/_cjs/zksync/types/eip1193.js.map +1 -0
- package/_cjs/zksync/types/proof.js +3 -0
- package/_cjs/zksync/types/proof.js.map +1 -0
- package/_cjs/zksync/utils/camelCaseKeys.js +17 -0
- package/_cjs/zksync/utils/camelCaseKeys.js.map +1 -0
- package/_cjs/zksync/utils/isEth.js +17 -0
- package/_cjs/zksync/utils/isEth.js.map +1 -0
- package/_cjs/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js +4 -3
- package/_cjs/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js.map +1 -1
- package/_cjs/zksync/utils/paymaster/getGeneralPaymasterInput.js +4 -3
- package/_cjs/zksync/utils/paymaster/getGeneralPaymasterInput.js.map +1 -1
- package/_esm/actions/public/call.js +2 -56
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +8 -2
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/celo/formatters.js +2 -11
- package/_esm/celo/formatters.js.map +1 -1
- package/_esm/celo/serializers.js +1 -29
- package/_esm/celo/serializers.js.map +1 -1
- package/_esm/celo/utils.js +1 -15
- package/_esm/celo/utils.js.map +1 -1
- package/_esm/chains/definitions/bob.js +30 -0
- package/_esm/chains/definitions/bob.js.map +1 -0
- package/_esm/chains/definitions/funkiSepolia.js +31 -0
- package/_esm/chains/definitions/funkiSepolia.js.map +1 -0
- package/_esm/chains/definitions/lisk.js +31 -0
- package/_esm/chains/definitions/lisk.js.map +1 -0
- package/_esm/chains/definitions/metalL2.js +50 -0
- package/_esm/chains/definitions/metalL2.js.map +1 -0
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/op-stack/chains.js +1 -0
- package/_esm/op-stack/chains.js.map +1 -1
- package/_esm/utils/stateOverride.js +57 -0
- package/_esm/utils/stateOverride.js.map +1 -0
- package/_esm/zksync/actions/estimateFee.js +22 -0
- package/_esm/zksync/actions/estimateFee.js.map +1 -0
- package/_esm/zksync/actions/estimateGasL1ToL2.js +16 -0
- package/_esm/zksync/actions/estimateGasL1ToL2.js.map +1 -0
- package/_esm/zksync/actions/getAllBalances.js +15 -0
- package/_esm/zksync/actions/getAllBalances.js.map +1 -0
- package/_esm/zksync/actions/getBaseTokenL1Address.js +5 -0
- package/_esm/zksync/actions/getBaseTokenL1Address.js.map +1 -0
- package/_esm/zksync/actions/getBlockDetails.js +8 -0
- package/_esm/zksync/actions/getBlockDetails.js.map +1 -0
- package/_esm/zksync/actions/getBridgehubContractAddress.js +5 -0
- package/_esm/zksync/actions/getBridgehubContractAddress.js.map +1 -0
- package/_esm/zksync/actions/getDefaultBridgeAddresses.js +9 -0
- package/_esm/zksync/actions/getDefaultBridgeAddresses.js.map +1 -0
- package/_esm/zksync/actions/getL1Allowance.js +15 -0
- package/_esm/zksync/actions/getL1Allowance.js.map +1 -0
- package/_esm/zksync/actions/getL1Balance.js +19 -0
- package/_esm/zksync/actions/getL1Balance.js.map +1 -0
- package/_esm/zksync/actions/getL1BatchBlockRange.js +9 -0
- package/_esm/zksync/actions/getL1BatchBlockRange.js.map +1 -0
- package/_esm/zksync/actions/getL1BatchDetails.js +8 -0
- package/_esm/zksync/actions/getL1BatchDetails.js.map +1 -0
- package/_esm/zksync/actions/getL1BatchNumber.js +5 -0
- package/_esm/zksync/actions/getL1BatchNumber.js.map +1 -0
- package/_esm/zksync/actions/getL1ChainId.js +5 -0
- package/_esm/zksync/actions/getL1ChainId.js.map +1 -0
- package/_esm/zksync/actions/getL1TokenBalance.js +20 -0
- package/_esm/zksync/actions/getL1TokenBalance.js.map +1 -0
- package/_esm/zksync/actions/getLogProof.js +8 -0
- package/_esm/zksync/actions/getLogProof.js.map +1 -0
- package/_esm/zksync/actions/getMainContractAddress.js +5 -0
- package/_esm/zksync/actions/getMainContractAddress.js.map +1 -0
- package/_esm/zksync/actions/getRawBlockTransactions.js +9 -0
- package/_esm/zksync/actions/getRawBlockTransactions.js.map +1 -0
- package/_esm/zksync/actions/getTestnetPaymasterAddress.js +5 -0
- package/_esm/zksync/actions/getTestnetPaymasterAddress.js.map +1 -0
- package/_esm/zksync/actions/getTransactionDetails.js +8 -0
- package/_esm/zksync/actions/getTransactionDetails.js.map +1 -0
- package/_esm/zksync/constants/address.js +3 -0
- package/_esm/zksync/constants/address.js.map +1 -1
- package/_esm/zksync/decorators/publicL1.js +12 -0
- package/_esm/zksync/decorators/publicL1.js.map +1 -0
- package/_esm/zksync/decorators/publicL2.js +39 -0
- package/_esm/zksync/decorators/publicL2.js.map +1 -0
- package/_esm/zksync/errors/token-is-eth.js +13 -0
- package/_esm/zksync/errors/token-is-eth.js.map +1 -0
- package/_esm/zksync/index.js +20 -1
- package/_esm/zksync/index.js.map +1 -1
- package/_esm/zksync/types/eip1193.js +2 -0
- package/_esm/zksync/types/eip1193.js.map +1 -0
- package/_esm/zksync/types/proof.js +2 -0
- package/_esm/zksync/types/proof.js.map +1 -0
- package/_esm/zksync/utils/camelCaseKeys.js +13 -0
- package/_esm/zksync/utils/camelCaseKeys.js.map +1 -0
- package/_esm/zksync/utils/isEth.js +13 -0
- package/_esm/zksync/utils/isEth.js.map +1 -0
- package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js +2 -1
- package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js.map +1 -1
- package/_esm/zksync/utils/paymaster/getGeneralPaymasterInput.js +2 -1
- package/_esm/zksync/utils/paymaster/getGeneralPaymasterInput.js.map +1 -1
- package/_types/actions/public/call.d.ts +3 -12
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts +2 -0
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/celo/chainConfig.d.ts +58 -526
- package/_types/celo/chainConfig.d.ts.map +1 -1
- package/_types/celo/formatters.d.ts +29 -263
- package/_types/celo/formatters.d.ts.map +1 -1
- package/_types/celo/index.d.ts +1 -1
- package/_types/celo/index.d.ts.map +1 -1
- package/_types/celo/serializers.d.ts +2 -3
- package/_types/celo/serializers.d.ts.map +1 -1
- package/_types/celo/types.d.ts +7 -31
- package/_types/celo/types.d.ts.map +1 -1
- package/_types/celo/utils.d.ts +1 -2
- package/_types/celo/utils.d.ts.map +1 -1
- package/_types/chains/definitions/bob.d.ts +34 -0
- package/_types/chains/definitions/bob.d.ts.map +1 -0
- package/_types/chains/definitions/celo.d.ts +58 -526
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +58 -526
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/funkiSepolia.d.ts +1064 -0
- package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -0
- package/_types/chains/definitions/lisk.d.ts +1453 -0
- package/_types/chains/definitions/lisk.d.ts.map +1 -0
- package/_types/chains/definitions/metalL2.d.ts +1080 -0
- package/_types/chains/definitions/metalL2.d.ts.map +1 -0
- package/_types/chains/definitions/playfiAlbireo.d.ts +8 -8
- package/_types/chains/definitions/zkSync.d.ts +8 -8
- package/_types/chains/definitions/zkSyncInMemoryNode.d.ts +8 -8
- package/_types/chains/definitions/zkSyncLocalNode.d.ts +8 -8
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +8 -8
- package/_types/chains/definitions/zkSyncTestnet.d.ts +8 -8
- package/_types/chains/index.d.ts +5 -1
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/op-stack/chains.d.ts +1 -0
- package/_types/op-stack/chains.d.ts.map +1 -1
- package/_types/op-stack/types/transaction.d.ts +2 -2
- package/_types/op-stack/types/transaction.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +11 -3
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/stateOverride.d.ts +16 -0
- package/_types/utils/stateOverride.d.ts.map +1 -0
- package/_types/zksync/actions/estimateFee.d.ts +11 -0
- package/_types/zksync/actions/estimateFee.d.ts.map +1 -0
- package/_types/zksync/actions/estimateGasL1ToL2.d.ts +10 -0
- package/_types/zksync/actions/estimateGasL1ToL2.d.ts.map +1 -0
- package/_types/zksync/actions/getAllBalances.d.ts +12 -0
- package/_types/zksync/actions/getAllBalances.d.ts.map +1 -0
- package/_types/zksync/actions/getBaseTokenL1Address.d.ts +9 -0
- package/_types/zksync/actions/getBaseTokenL1Address.d.ts.map +1 -0
- package/_types/zksync/actions/getBlockDetails.d.ts +10 -0
- package/_types/zksync/actions/getBlockDetails.d.ts.map +1 -0
- package/_types/zksync/actions/getBridgehubContractAddress.d.ts +9 -0
- package/_types/zksync/actions/getBridgehubContractAddress.d.ts.map +1 -0
- package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts +9 -0
- package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts.map +1 -0
- package/_types/zksync/actions/getL1Allowance.d.ts +17 -0
- package/_types/zksync/actions/getL1Allowance.d.ts.map +1 -0
- package/_types/zksync/actions/getL1Balance.d.ts +23 -0
- package/_types/zksync/actions/getL1Balance.d.ts.map +1 -0
- package/_types/zksync/actions/getL1BatchBlockRange.d.ts +11 -0
- package/_types/zksync/actions/getL1BatchBlockRange.d.ts.map +1 -0
- package/_types/zksync/actions/getL1BatchDetails.d.ts +10 -0
- package/_types/zksync/actions/getL1BatchDetails.d.ts.map +1 -0
- package/_types/zksync/actions/getL1BatchNumber.d.ts +9 -0
- package/_types/zksync/actions/getL1BatchNumber.d.ts.map +1 -0
- package/_types/zksync/actions/getL1ChainId.d.ts +9 -0
- package/_types/zksync/actions/getL1ChainId.d.ts.map +1 -0
- package/_types/zksync/actions/getL1TokenBalance.d.ts +24 -0
- package/_types/zksync/actions/getL1TokenBalance.d.ts.map +1 -0
- package/_types/zksync/actions/getLogProof.d.ts +14 -0
- package/_types/zksync/actions/getLogProof.d.ts.map +1 -0
- package/_types/zksync/actions/getMainContractAddress.d.ts +9 -0
- package/_types/zksync/actions/getMainContractAddress.d.ts.map +1 -0
- package/_types/zksync/actions/getRawBlockTransactions.d.ts +11 -0
- package/_types/zksync/actions/getRawBlockTransactions.d.ts.map +1 -0
- package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts +9 -0
- package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts.map +1 -0
- package/_types/zksync/actions/getTransactionDetails.d.ts +13 -0
- package/_types/zksync/actions/getTransactionDetails.d.ts.map +1 -0
- package/_types/zksync/chainConfig.d.ts +8 -8
- package/_types/zksync/constants/address.d.ts +3 -0
- package/_types/zksync/constants/address.d.ts.map +1 -1
- package/_types/zksync/decorators/publicL1.d.ts +145 -0
- package/_types/zksync/decorators/publicL1.d.ts.map +1 -0
- package/_types/zksync/decorators/publicL2.d.ts +322 -0
- package/_types/zksync/decorators/publicL2.d.ts.map +1 -0
- package/_types/zksync/errors/token-is-eth.d.ts +9 -0
- package/_types/zksync/errors/token-is-eth.d.ts.map +1 -0
- package/_types/zksync/formatters.d.ts +8 -8
- package/_types/zksync/index.d.ts +21 -2
- package/_types/zksync/index.d.ts.map +1 -1
- package/_types/zksync/types/block.d.ts +30 -1
- package/_types/zksync/types/block.d.ts.map +1 -1
- package/_types/zksync/types/contract.d.ts +6 -0
- package/_types/zksync/types/contract.d.ts.map +1 -1
- package/_types/zksync/types/eip1193.d.ts +152 -0
- package/_types/zksync/types/eip1193.d.ts.map +1 -0
- package/_types/zksync/types/fee.d.ts +6 -0
- package/_types/zksync/types/fee.d.ts.map +1 -1
- package/_types/zksync/types/proof.d.ts +7 -0
- package/_types/zksync/types/proof.d.ts.map +1 -0
- package/_types/zksync/types/transaction.d.ts +66 -6
- package/_types/zksync/types/transaction.d.ts.map +1 -1
- package/_types/zksync/utils/camelCaseKeys.d.ts +2 -0
- package/_types/zksync/utils/camelCaseKeys.d.ts.map +1 -0
- package/_types/zksync/utils/isEth.d.ts +3 -0
- package/_types/zksync/utils/isEth.d.ts.map +1 -0
- package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts +1 -1
- package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts.map +1 -1
- package/_types/zksync/utils/paymaster/getGeneralPaymasterInput.d.ts +1 -1
- package/_types/zksync/utils/paymaster/getGeneralPaymasterInput.d.ts.map +1 -1
- package/actions/public/call.ts +8 -91
- package/actions/public/estimateGas.ts +11 -1
- package/celo/formatters.ts +3 -11
- package/celo/index.ts +0 -2
- package/celo/serializers.ts +2 -50
- package/celo/types.ts +6 -41
- package/celo/utils.ts +1 -24
- package/chains/definitions/bob.ts +30 -0
- package/chains/definitions/funkiSepolia.ts +32 -0
- package/chains/definitions/lisk.ts +31 -0
- package/chains/definitions/metalL2.ts +51 -0
- package/chains/index.ts +4 -2
- package/errors/version.ts +1 -1
- package/op-stack/chains.ts +1 -0
- package/op-stack/types/transaction.ts +2 -2
- package/package.json +1 -1
- package/types/eip1193.ts +11 -1
- package/utils/stateOverride.ts +98 -0
- package/zksync/actions/estimateFee.ts +46 -0
- package/zksync/actions/estimateGasL1ToL2.ts +38 -0
- package/zksync/actions/getAllBalances.ts +33 -0
- package/zksync/actions/getBaseTokenL1Address.ts +18 -0
- package/zksync/actions/getBlockDetails.ts +27 -0
- package/zksync/actions/getBridgehubContractAddress.ts +18 -0
- package/zksync/actions/getDefaultBridgeAddresses.ts +22 -0
- package/zksync/actions/getL1Allowance.ts +43 -0
- package/zksync/actions/getL1Balance.ts +68 -0
- package/zksync/actions/getL1BatchBlockRange.ts +26 -0
- package/zksync/actions/getL1BatchDetails.ts +27 -0
- package/zksync/actions/getL1BatchNumber.ts +18 -0
- package/zksync/actions/getL1ChainId.ts +18 -0
- package/zksync/actions/getL1TokenBalance.ts +63 -0
- package/zksync/actions/getLogProof.ts +28 -0
- package/zksync/actions/getMainContractAddress.ts +18 -0
- package/zksync/actions/getRawBlockTransactions.ts +26 -0
- package/zksync/actions/getTestnetPaymasterAddress.ts +18 -0
- package/zksync/actions/getTransactionDetails.ts +27 -0
- package/zksync/constants/address.ts +9 -0
- package/zksync/decorators/publicL1.ts +180 -0
- package/zksync/decorators/publicL2.ts +443 -0
- package/zksync/errors/token-is-eth.ts +16 -0
- package/zksync/index.ts +85 -6
- package/zksync/types/block.ts +37 -1
- package/zksync/types/contract.ts +8 -0
- package/zksync/types/eip1193.ts +155 -0
- package/zksync/types/fee.ts +7 -0
- package/zksync/types/proof.ts +7 -0
- package/zksync/types/transaction.ts +86 -12
- package/zksync/utils/camelCaseKeys.ts +11 -0
- package/zksync/utils/isEth.ts +20 -0
- package/zksync/utils/paymaster/getApprovalBasedPaymasterInput.ts +5 -2
- package/zksync/utils/paymaster/getGeneralPaymasterInput.ts +5 -2
@@ -0,0 +1,443 @@
|
|
1
|
+
import type { Address } from 'abitype'
|
2
|
+
import type { Client } from '../../clients/createClient.js'
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js'
|
4
|
+
import type { Account } from '../../types/account.js'
|
5
|
+
import { estimateFee } from '../actions/estimateFee.js'
|
6
|
+
import type {
|
7
|
+
EstimateFeeParameters,
|
8
|
+
EstimateFeeReturnType,
|
9
|
+
} from '../actions/estimateFee.js'
|
10
|
+
import {
|
11
|
+
type EstimateGasL1ToL2Parameters,
|
12
|
+
type EstimateGasL1ToL2ReturnType,
|
13
|
+
estimateGasL1ToL2,
|
14
|
+
} from '../actions/estimateGasL1ToL2.js'
|
15
|
+
import {
|
16
|
+
type GetAllBalancesParameters,
|
17
|
+
type GetAllBalancesReturnType,
|
18
|
+
getAllBalances,
|
19
|
+
} from '../actions/getAllBalances.js'
|
20
|
+
import {
|
21
|
+
type GetBaseTokenL1AddressReturnType,
|
22
|
+
getBaseTokenL1Address,
|
23
|
+
} from '../actions/getBaseTokenL1Address.js'
|
24
|
+
import {
|
25
|
+
type GetBlockDetailsParameters,
|
26
|
+
type GetBlockDetailsReturnType,
|
27
|
+
getBlockDetails,
|
28
|
+
} from '../actions/getBlockDetails.js'
|
29
|
+
import {
|
30
|
+
type GetBridgehubContractAddressReturnType,
|
31
|
+
getBridgehubContractAddress,
|
32
|
+
} from '../actions/getBridgehubContractAddress.js'
|
33
|
+
import {
|
34
|
+
type GetDefaultBridgeAddressesReturnType,
|
35
|
+
getDefaultBridgeAddresses,
|
36
|
+
} from '../actions/getDefaultBridgeAddresses.js'
|
37
|
+
import {
|
38
|
+
type GetL1BatchBlockRangeParameters,
|
39
|
+
type GetL1BatchBlockRangeReturnParameters,
|
40
|
+
getL1BatchBlockRange,
|
41
|
+
} from '../actions/getL1BatchBlockRange.js'
|
42
|
+
import {
|
43
|
+
type GetL1BatchDetailsParameters,
|
44
|
+
type GetL1BatchDetailsReturnType,
|
45
|
+
getL1BatchDetails,
|
46
|
+
} from '../actions/getL1BatchDetails.js'
|
47
|
+
import {
|
48
|
+
type GetL1BatchNumberReturnType,
|
49
|
+
getL1BatchNumber,
|
50
|
+
} from '../actions/getL1BatchNumber.js'
|
51
|
+
import {
|
52
|
+
type GetL1ChainIdReturnType,
|
53
|
+
getL1ChainId,
|
54
|
+
} from '../actions/getL1ChainId.js'
|
55
|
+
import {
|
56
|
+
type GetLogProofParameters,
|
57
|
+
type GetLogProofReturnType,
|
58
|
+
getLogProof,
|
59
|
+
} from '../actions/getLogProof.js'
|
60
|
+
import {
|
61
|
+
type GetMainContractAddressReturnType,
|
62
|
+
getMainContractAddress,
|
63
|
+
} from '../actions/getMainContractAddress.js'
|
64
|
+
import {
|
65
|
+
type GetRawBlockTransactionsParameters,
|
66
|
+
type GetRawBlockTransactionsReturnType,
|
67
|
+
getRawBlockTransactions,
|
68
|
+
} from '../actions/getRawBlockTransactions.js'
|
69
|
+
import {
|
70
|
+
type GetTestnetPaymasterAddressReturnType,
|
71
|
+
getTestnetPaymasterAddress,
|
72
|
+
} from '../actions/getTestnetPaymasterAddress.js'
|
73
|
+
import {
|
74
|
+
type GetTransactionDetailsParameters,
|
75
|
+
type GetTransactionDetailsReturnType,
|
76
|
+
getTransactionDetails,
|
77
|
+
} from '../actions/getTransactionDetails.js'
|
78
|
+
import type { ChainEIP712 } from '../types/chain.js'
|
79
|
+
|
80
|
+
export type PublicActionsL2<
|
81
|
+
TChain extends ChainEIP712 | undefined = ChainEIP712 | undefined,
|
82
|
+
TAccount extends Account | undefined = Account | undefined,
|
83
|
+
> = {
|
84
|
+
/**
|
85
|
+
* Returns the addresses of the default zkSync Era bridge contracts on both L1 and L2.
|
86
|
+
*
|
87
|
+
* @returns The Addresses of the default zkSync Era bridge contracts on both L1 and L2. {@link DefaultBridgeAddressesReturnType}
|
88
|
+
*
|
89
|
+
* @example
|
90
|
+
* import { createPublicClient, http } from 'viem'
|
91
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
92
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
93
|
+
*
|
94
|
+
* const client = createPublicClient({
|
95
|
+
* chain: zkSyncLocalNode,
|
96
|
+
* transport: http(),
|
97
|
+
* }).extend(publicActionsL2())
|
98
|
+
*
|
99
|
+
* const addresses = await client.getDefaultBridgeAddresses();
|
100
|
+
*/
|
101
|
+
getDefaultBridgeAddresses: () => Promise<GetDefaultBridgeAddressesReturnType>
|
102
|
+
|
103
|
+
/**
|
104
|
+
* Returns Testnet Paymaster Address.
|
105
|
+
*
|
106
|
+
* @returns The Address. {@link Address}
|
107
|
+
*
|
108
|
+
* @example
|
109
|
+
* import { createPublicClient, http } from 'viem'
|
110
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
111
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
112
|
+
*
|
113
|
+
* const client = createPublicClient({
|
114
|
+
* chain: zkSyncLocalNode,
|
115
|
+
* transport: http(),
|
116
|
+
* }).extend(publicActionsL2())
|
117
|
+
*
|
118
|
+
* const address = await client.getTestnetPaymasterAddress();
|
119
|
+
*/
|
120
|
+
getTestnetPaymasterAddress: () => Promise<GetTestnetPaymasterAddressReturnType>
|
121
|
+
|
122
|
+
/**
|
123
|
+
* Returns the Chain Id of underlying L1 network.
|
124
|
+
*
|
125
|
+
* @returns number
|
126
|
+
*
|
127
|
+
* @example
|
128
|
+
* import { createPublicClient, http } from 'viem'
|
129
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
130
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
131
|
+
*
|
132
|
+
* const client = createPublicClient({
|
133
|
+
* chain: zkSyncLocalNode,
|
134
|
+
* transport: http(),
|
135
|
+
* }).extend(publicActionsL2())
|
136
|
+
*
|
137
|
+
* const chainId = await client.getL1ChainId();
|
138
|
+
*/
|
139
|
+
|
140
|
+
getL1ChainId: () => Promise<GetL1ChainIdReturnType>
|
141
|
+
|
142
|
+
/**
|
143
|
+
* Returns the address of a Main zkSync Contract.
|
144
|
+
*
|
145
|
+
* @returns The Address. {@link Address}
|
146
|
+
*
|
147
|
+
* @example
|
148
|
+
* import { createPublicClient, http } from 'viem'
|
149
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
150
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
151
|
+
*
|
152
|
+
* const client = createPublicClient({
|
153
|
+
* chain: zkSyncLocalNode,
|
154
|
+
* transport: http(),
|
155
|
+
* }).extend(publicActionsL2())
|
156
|
+
*
|
157
|
+
* const address = await client.getMainContractAddress();
|
158
|
+
*/
|
159
|
+
getMainContractAddress: () => Promise<GetMainContractAddressReturnType>
|
160
|
+
|
161
|
+
/**
|
162
|
+
* Returns all known balances for a given account.
|
163
|
+
*
|
164
|
+
* @returns The balances for a given account. {@link GetAllBalancesReturnType}
|
165
|
+
* @param args - {@link GetAllBalancesParameters}
|
166
|
+
*
|
167
|
+
* @example
|
168
|
+
* import { createPublicClient, http } from 'viem'
|
169
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
170
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
171
|
+
*
|
172
|
+
* const client = createPublicClient({
|
173
|
+
* chain: zkSyncLocalNode,
|
174
|
+
* transport: http(),
|
175
|
+
* }).extend(publicActionsL2())
|
176
|
+
*
|
177
|
+
* const balances = await client.getAllBalances({account: "0x36615Cf349d7F6344891B1e7CA7C72883F5dc049"});
|
178
|
+
*/
|
179
|
+
getAllBalances: (
|
180
|
+
args: GetAllBalancesParameters,
|
181
|
+
) => Promise<GetAllBalancesReturnType>
|
182
|
+
|
183
|
+
/**
|
184
|
+
* Returns data of transactions in a block.
|
185
|
+
*
|
186
|
+
* @returns data of transactions {@link RawBlockTransactions}
|
187
|
+
* @param args - {@link GetRawBlockTransactionsParameters}
|
188
|
+
*
|
189
|
+
* @example
|
190
|
+
* import { createPublicClient, http } from 'viem'
|
191
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
192
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
193
|
+
*
|
194
|
+
* const client = createPublicClient({
|
195
|
+
* chain: zkSyncLocalNode,
|
196
|
+
* transport: http(),
|
197
|
+
* }).extend(publicActionsL2())
|
198
|
+
*
|
199
|
+
* const rawTx = await client.getRawBlockTransaction({number: 1});
|
200
|
+
*/
|
201
|
+
getRawBlockTransaction: (
|
202
|
+
args: GetRawBlockTransactionsParameters,
|
203
|
+
) => Promise<GetRawBlockTransactionsReturnType>
|
204
|
+
|
205
|
+
/**
|
206
|
+
* Returns additional zkSync-specific information about the L2 block.
|
207
|
+
*
|
208
|
+
* @returns zkSync-specific information about the L2 block {@link BaseBlockDetails}
|
209
|
+
* @param args - {@link GetBlockDetailsParameters}
|
210
|
+
*
|
211
|
+
* @example
|
212
|
+
* import { createPublicClient, http } from 'viem'
|
213
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
214
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
215
|
+
*
|
216
|
+
* const client = createPublicClient({
|
217
|
+
* chain: zkSyncLocalNode,
|
218
|
+
* transport: http(),
|
219
|
+
* }).extend(publicActionsL2())
|
220
|
+
*
|
221
|
+
* const blockDetails = await client.getBlockDetails({number: 1});
|
222
|
+
*/
|
223
|
+
getBlockDetails: (
|
224
|
+
args: GetBlockDetailsParameters,
|
225
|
+
) => Promise<GetBlockDetailsReturnType>
|
226
|
+
|
227
|
+
/**
|
228
|
+
* Returns data pertaining to a given batch.
|
229
|
+
*
|
230
|
+
* @returns data pertaining to a given batch {@link BatchDetails}
|
231
|
+
* @param args - {@link GetL1BatchDetailsParameters}
|
232
|
+
*
|
233
|
+
* @example
|
234
|
+
* import { createPublicClient, http } from 'viem'
|
235
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
236
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
237
|
+
*
|
238
|
+
* const client = createPublicClient({
|
239
|
+
* chain: zkSyncLocalNode,
|
240
|
+
* transport: http(),
|
241
|
+
* }).extend(publicActionsL2())
|
242
|
+
*
|
243
|
+
* const batchDetails = await client.getL1BatchDetails({number: 1});
|
244
|
+
*/
|
245
|
+
getL1BatchDetails: (
|
246
|
+
args: GetL1BatchDetailsParameters,
|
247
|
+
) => Promise<GetL1BatchDetailsReturnType>
|
248
|
+
|
249
|
+
/**
|
250
|
+
* Returns the range of blocks contained within a batch given by batch number.
|
251
|
+
*
|
252
|
+
* @returns range of blocks contained withing a batch {@link GetL1BatchBlockRangeReturnParameters}
|
253
|
+
* @param args - {@link GetL1BatchBlockRangeParameters}
|
254
|
+
*
|
255
|
+
* @example
|
256
|
+
* import { createPublicClient, http } from 'viem'
|
257
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
258
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
259
|
+
*
|
260
|
+
* const client = createPublicClient({
|
261
|
+
* chain: zkSyncLocalNode,
|
262
|
+
* transport: http(),
|
263
|
+
* }).extend(publicActionsL2())
|
264
|
+
*
|
265
|
+
* const batchBlockRange = await client.getL1BatchBlockRange({number: 1});
|
266
|
+
*/
|
267
|
+
getL1BatchBlockRange: (
|
268
|
+
args: GetL1BatchBlockRangeParameters,
|
269
|
+
) => Promise<GetL1BatchBlockRangeReturnParameters>
|
270
|
+
|
271
|
+
/**
|
272
|
+
* Returns the latest L1 batch number
|
273
|
+
*
|
274
|
+
* @returns latest L1 batch number
|
275
|
+
*
|
276
|
+
* @example
|
277
|
+
* import { createPublicClient, http } from 'viem'
|
278
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
279
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
280
|
+
*
|
281
|
+
* const client = createPublicClient({
|
282
|
+
* chain: zkSyncLocalNode,
|
283
|
+
* transport: http(),
|
284
|
+
* }).extend(publicActionsL2())
|
285
|
+
*
|
286
|
+
* const latestNumber = await client.getL1BatchNumber({number: 1});
|
287
|
+
*/
|
288
|
+
getL1BatchNumber: () => Promise<GetL1BatchNumberReturnType>
|
289
|
+
|
290
|
+
/**
|
291
|
+
* Given a transaction hash, and an index of the L2 to L1 log produced within the transaction, it returns the proof for the corresponding L2 to L1 log.
|
292
|
+
*
|
293
|
+
* @returns the proof for the corresponding L2 to L1 log.
|
294
|
+
*
|
295
|
+
* @example
|
296
|
+
* import { createPublicClient, http } from 'viem'
|
297
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
298
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
299
|
+
*
|
300
|
+
* const client = createPublicClient({
|
301
|
+
* chain: zkSyncLocalNode,
|
302
|
+
* transport: http(),
|
303
|
+
* }).extend(publicActionsL2())
|
304
|
+
*
|
305
|
+
* const proof = await client.getLogProof({txHash: "0x...",index:1});
|
306
|
+
*/
|
307
|
+
getLogProof: (args: GetLogProofParameters) => Promise<GetLogProofReturnType>
|
308
|
+
|
309
|
+
/**
|
310
|
+
* Returns data from a specific transaction given by the transaction hash
|
311
|
+
*
|
312
|
+
* @returns data from a specific transaction given by the transaction hash
|
313
|
+
*
|
314
|
+
*
|
315
|
+
* @example
|
316
|
+
* import { createPublicClient, http } from 'viem'
|
317
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
318
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
319
|
+
*
|
320
|
+
* const client = createPublicClient({
|
321
|
+
* chain: zkSyncLocalNode,
|
322
|
+
* transport: http(),
|
323
|
+
* }).extend(publicActionsL2())
|
324
|
+
*
|
325
|
+
* const details = await client.getTransactionDetails({txHash: "0x..."});
|
326
|
+
*/
|
327
|
+
getTransactionDetails: (
|
328
|
+
args: GetTransactionDetailsParameters,
|
329
|
+
) => Promise<GetTransactionDetailsReturnType>
|
330
|
+
|
331
|
+
/**
|
332
|
+
* Returns an estimated Fee for requested transaction.
|
333
|
+
*
|
334
|
+
* @returns an estimated {@link Fee} for requested transaction.
|
335
|
+
* @param args - {@link EstimateFeeParameters}
|
336
|
+
*
|
337
|
+
* @example
|
338
|
+
* import { createPublicClient, http } from 'viem'
|
339
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
340
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
341
|
+
*
|
342
|
+
* const client = createPublicClient({
|
343
|
+
* chain: zkSyncLocalNode,
|
344
|
+
* transport: http(),
|
345
|
+
* }).extend(publicActionsL2())
|
346
|
+
*
|
347
|
+
* const details = await client.estimateFee({transactionRequest: {...}}});
|
348
|
+
*/
|
349
|
+
estimateFee: (
|
350
|
+
args: EstimateFeeParameters<TChain, TAccount>,
|
351
|
+
) => Promise<EstimateFeeReturnType>
|
352
|
+
|
353
|
+
/**
|
354
|
+
* Returns an estimated gas for L1 to L2 execution.
|
355
|
+
*
|
356
|
+
* @returns an estimated gas.
|
357
|
+
* @param args - {@link EstimateGasL1ToL2Parameters}
|
358
|
+
*
|
359
|
+
* @example
|
360
|
+
* import { createPublicClient, http } from 'viem'
|
361
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
362
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
363
|
+
*
|
364
|
+
* const client = createPublicClient({
|
365
|
+
* chain: zkSyncLocalNode,
|
366
|
+
* transport: http(),
|
367
|
+
* }).extend(publicActionsL2())
|
368
|
+
*
|
369
|
+
* const details = await client.estimateGasL1ToL2({transactionRequest: {...}}});
|
370
|
+
*/
|
371
|
+
estimateGasL1ToL2: (
|
372
|
+
args: EstimateGasL1ToL2Parameters<TChain, TAccount>,
|
373
|
+
) => Promise<EstimateGasL1ToL2ReturnType>
|
374
|
+
|
375
|
+
/**
|
376
|
+
* Returns the Bridgehub smart contract address.
|
377
|
+
*
|
378
|
+
* @returns address of the Bridgehub smart contract address.
|
379
|
+
*
|
380
|
+
*
|
381
|
+
* @example
|
382
|
+
* import { createPublicClient, http } from 'viem'
|
383
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
384
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
385
|
+
*
|
386
|
+
* const client = createPublicClient({
|
387
|
+
* chain: zkSyncLocalNode,
|
388
|
+
* transport: http(),
|
389
|
+
* }).extend(publicActionsL2())
|
390
|
+
*
|
391
|
+
* const address = await client.getBridgehubContractAddress();
|
392
|
+
*/
|
393
|
+
getBridgehubContractAddress: () => Promise<GetBridgehubContractAddressReturnType>
|
394
|
+
|
395
|
+
/**
|
396
|
+
* Returns the address of the base L1 token.
|
397
|
+
*
|
398
|
+
* @returns address of the base L1 token.
|
399
|
+
*
|
400
|
+
*
|
401
|
+
* @example
|
402
|
+
* import { createPublicClient, http } from 'viem'
|
403
|
+
* import { zkSyncLocalNode } from 'viem/chains'
|
404
|
+
* import { publicActionsL2 } from 'viem/zksync'
|
405
|
+
*
|
406
|
+
* const client = createPublicClient({
|
407
|
+
* chain: zkSyncLocalNode,
|
408
|
+
* transport: http(),
|
409
|
+
* }).extend(publicActionsL2())
|
410
|
+
*
|
411
|
+
* const address = await client.getBaseTokenL1Address();
|
412
|
+
*/
|
413
|
+
getBaseTokenL1Address: () => Promise<GetBaseTokenL1AddressReturnType>
|
414
|
+
}
|
415
|
+
|
416
|
+
export function publicActionsL2() {
|
417
|
+
return <
|
418
|
+
TTransport extends Transport = Transport,
|
419
|
+
TChain extends ChainEIP712 | undefined = ChainEIP712 | undefined,
|
420
|
+
TAccount extends Account | undefined = Account | undefined,
|
421
|
+
>(
|
422
|
+
client: Client<TTransport, TChain, TAccount>,
|
423
|
+
): PublicActionsL2<TChain, TAccount> => {
|
424
|
+
return {
|
425
|
+
estimateGasL1ToL2: (args) => estimateGasL1ToL2(client, args),
|
426
|
+
getDefaultBridgeAddresses: () => getDefaultBridgeAddresses(client),
|
427
|
+
getTestnetPaymasterAddress: () => getTestnetPaymasterAddress(client),
|
428
|
+
getL1ChainId: () => getL1ChainId(client),
|
429
|
+
getMainContractAddress: () => getMainContractAddress(client),
|
430
|
+
getAllBalances: (args) => getAllBalances(client, args),
|
431
|
+
getRawBlockTransaction: (args) => getRawBlockTransactions(client, args),
|
432
|
+
getBlockDetails: (args) => getBlockDetails(client, args),
|
433
|
+
getL1BatchDetails: (args) => getL1BatchDetails(client, args),
|
434
|
+
getL1BatchBlockRange: (args) => getL1BatchBlockRange(client, args),
|
435
|
+
getL1BatchNumber: () => getL1BatchNumber(client),
|
436
|
+
getLogProof: (args) => getLogProof(client, args),
|
437
|
+
getTransactionDetails: (args) => getTransactionDetails(client, args),
|
438
|
+
estimateFee: (args) => estimateFee(client, args),
|
439
|
+
getBridgehubContractAddress: () => getBridgehubContractAddress(client),
|
440
|
+
getBaseTokenL1Address: () => getBaseTokenL1Address(client),
|
441
|
+
}
|
442
|
+
}
|
443
|
+
}
|
@@ -0,0 +1,16 @@
|
|
1
|
+
import { BaseError } from '../../errors/base.js'
|
2
|
+
|
3
|
+
export type TokenIsEthErrorType = TokenIsEthError & {
|
4
|
+
name: 'TokenIsEthError'
|
5
|
+
}
|
6
|
+
export class TokenIsEthError extends BaseError {
|
7
|
+
override name = 'TokenIsEthError'
|
8
|
+
|
9
|
+
constructor() {
|
10
|
+
super(
|
11
|
+
['Token is an ETH token.', '', 'ETH token cannot be retrived.'].join(
|
12
|
+
'\n',
|
13
|
+
),
|
14
|
+
)
|
15
|
+
}
|
16
|
+
}
|
package/zksync/index.ts
CHANGED
@@ -1,3 +1,76 @@
|
|
1
|
+
export {
|
2
|
+
type DeployContractErrorType,
|
3
|
+
type DeployContractParameters,
|
4
|
+
type DeployContractReturnType,
|
5
|
+
deployContract,
|
6
|
+
} from './actions/deployContract.js'
|
7
|
+
export {
|
8
|
+
type EstimateFeeParameters,
|
9
|
+
type EstimateFeeReturnType,
|
10
|
+
estimateFee,
|
11
|
+
} from './actions/estimateFee.js'
|
12
|
+
export {
|
13
|
+
type GetAllBalancesParameters,
|
14
|
+
type GetAllBalancesReturnType,
|
15
|
+
getAllBalances,
|
16
|
+
} from './actions/getAllBalances.js'
|
17
|
+
export {
|
18
|
+
type GetBlockDetailsParameters,
|
19
|
+
type GetBlockDetailsReturnType,
|
20
|
+
getBlockDetails,
|
21
|
+
} from './actions/getBlockDetails.js'
|
22
|
+
export {
|
23
|
+
type GetDefaultBridgeAddressesReturnType,
|
24
|
+
getDefaultBridgeAddresses,
|
25
|
+
} from './actions/getDefaultBridgeAddresses.js'
|
26
|
+
export { getBridgehubContractAddress } from './actions/getBridgehubContractAddress.js'
|
27
|
+
export {
|
28
|
+
type GetL1AllowanceErrorType,
|
29
|
+
type GetL1AllowanceParameters,
|
30
|
+
type GetL1AllowanceReturnType,
|
31
|
+
getL1Allowance,
|
32
|
+
} from './actions/getL1Allowance.js'
|
33
|
+
export {
|
34
|
+
type GetL1BalanceErrorType,
|
35
|
+
type GetL1BalanceParameters,
|
36
|
+
type GetL1BalanceReturnType,
|
37
|
+
getL1Balance,
|
38
|
+
} from './actions/getL1Balance.js'
|
39
|
+
export {
|
40
|
+
type GetL1BatchBlockRangeParameters,
|
41
|
+
type GetL1BatchBlockRangeReturnParameters,
|
42
|
+
getL1BatchBlockRange,
|
43
|
+
} from './actions/getL1BatchBlockRange.js'
|
44
|
+
export {
|
45
|
+
type GetL1BatchDetailsParameters,
|
46
|
+
type GetL1BatchDetailsReturnType,
|
47
|
+
getL1BatchDetails,
|
48
|
+
} from './actions/getL1BatchDetails.js'
|
49
|
+
export { getL1BatchNumber } from './actions/getL1BatchNumber.js'
|
50
|
+
export { getL1ChainId } from './actions/getL1ChainId.js'
|
51
|
+
export {
|
52
|
+
type GetL1TokenBalanceErrorType,
|
53
|
+
type GetL1TokenBalanceParameters,
|
54
|
+
type GetL1TokenBalanceReturnType,
|
55
|
+
getL1TokenBalance,
|
56
|
+
} from './actions/getL1TokenBalance.js'
|
57
|
+
export {
|
58
|
+
type GetLogProofReturnType,
|
59
|
+
type GetLogProofParameters,
|
60
|
+
getLogProof,
|
61
|
+
} from './actions/getLogProof.js'
|
62
|
+
export { getMainContractAddress } from './actions/getMainContractAddress.js'
|
63
|
+
export {
|
64
|
+
type GetRawBlockTransactionsParameters,
|
65
|
+
type GetRawBlockTransactionsReturnType,
|
66
|
+
getRawBlockTransactions,
|
67
|
+
} from './actions/getRawBlockTransactions.js'
|
68
|
+
export { getTestnetPaymasterAddress } from './actions/getTestnetPaymasterAddress.js'
|
69
|
+
export {
|
70
|
+
type GetTransactionDetailsParameters,
|
71
|
+
type GetTransactionDetailsReturnType,
|
72
|
+
getTransactionDetails,
|
73
|
+
} from './actions/getTransactionDetails.js'
|
1
74
|
export {
|
2
75
|
type SendTransactionErrorType,
|
3
76
|
type SendTransactionParameters,
|
@@ -22,12 +95,6 @@ export {
|
|
22
95
|
type SignTransactionReturnType,
|
23
96
|
signTransaction,
|
24
97
|
} from './actions/signTransaction.js'
|
25
|
-
export {
|
26
|
-
type DeployContractErrorType,
|
27
|
-
type DeployContractParameters,
|
28
|
-
type DeployContractReturnType,
|
29
|
-
deployContract,
|
30
|
-
} from './actions/deployContract.js'
|
31
98
|
|
32
99
|
export {
|
33
100
|
zkSync,
|
@@ -42,6 +109,16 @@ export {
|
|
42
109
|
type Eip712WalletActions,
|
43
110
|
} from './decorators/eip712.js'
|
44
111
|
|
112
|
+
export {
|
113
|
+
publicActionsL1,
|
114
|
+
type PublicActionsL1,
|
115
|
+
} from './decorators/publicL1.js'
|
116
|
+
|
117
|
+
export {
|
118
|
+
publicActionsL2,
|
119
|
+
type PublicActionsL2,
|
120
|
+
} from './decorators/publicL2.js'
|
121
|
+
|
45
122
|
export { serializeTransaction } from './serializers.js'
|
46
123
|
|
47
124
|
export type {
|
@@ -66,6 +143,7 @@ export type {
|
|
66
143
|
export type {
|
67
144
|
TransactionRequestEIP712,
|
68
145
|
ZkSyncEIP712TransactionSignable,
|
146
|
+
ZkSyncRawBlockTransactions,
|
69
147
|
ZkSyncRpcTransaction,
|
70
148
|
ZkSyncRpcTransactionEIP712,
|
71
149
|
ZkSyncRpcTransactionPriority,
|
@@ -83,6 +161,7 @@ export type {
|
|
83
161
|
ZkSyncTransactionSerialized,
|
84
162
|
ZkSyncTransactionSerializedEIP712,
|
85
163
|
ZkSyncTransactionType,
|
164
|
+
ZkSyncTransactionDetails,
|
86
165
|
} from './types/transaction.js'
|
87
166
|
|
88
167
|
export {
|
package/zksync/types/block.ts
CHANGED
@@ -1,8 +1,17 @@
|
|
1
|
+
import type { Address } from 'abitype'
|
1
2
|
import type { Block, BlockTag } from '../../types/block.js'
|
2
|
-
import type { Hex } from '../../types/misc.js'
|
3
|
+
import type { Hash, Hex } from '../../types/misc.js'
|
3
4
|
import type { RpcBlock } from '../../types/rpc.js'
|
4
5
|
import type { ZkSyncRpcTransaction, ZkSyncTransaction } from './transaction.js'
|
5
6
|
|
7
|
+
export type ZkSyncBatchDetails = Omit<
|
8
|
+
ZkSyncBlockDetails,
|
9
|
+
'operatorAddress' | 'protocolVersion'
|
10
|
+
> & {
|
11
|
+
l1GasPrice: number
|
12
|
+
l2FairGasPrice: number
|
13
|
+
}
|
14
|
+
|
6
15
|
export type ZkSyncBlockOverrides = {
|
7
16
|
l1BatchNumber: bigint | null
|
8
17
|
l1BatchTimestamp: bigint | null
|
@@ -19,10 +28,33 @@ export type ZkSyncBlock<
|
|
19
28
|
> &
|
20
29
|
ZkSyncBlockOverrides
|
21
30
|
|
31
|
+
export type ZkSyncBlockDetails = {
|
32
|
+
number: number
|
33
|
+
timestamp: number
|
34
|
+
l1BatchNumber: number
|
35
|
+
l1TxCount: number
|
36
|
+
l2TxCount: number
|
37
|
+
rootHash?: Hash
|
38
|
+
status: string
|
39
|
+
commitTxHash?: Hash
|
40
|
+
committedAt?: Date
|
41
|
+
proveTxHash?: Hash
|
42
|
+
provenAt?: Date
|
43
|
+
executeTxHash?: Hash
|
44
|
+
executedAt?: Date
|
45
|
+
baseSystemContractsHashes: {
|
46
|
+
bootloader: Hash
|
47
|
+
default_aa: Hash
|
48
|
+
}
|
49
|
+
operatorAddress: Address
|
50
|
+
protocolVersion?: string
|
51
|
+
}
|
52
|
+
|
22
53
|
export type ZkSyncRpcBlockOverrides = {
|
23
54
|
l1BatchNumber: Hex | null
|
24
55
|
l1BatchTimestamp: Hex | null
|
25
56
|
}
|
57
|
+
|
26
58
|
export type ZkSyncRpcBlock<
|
27
59
|
TBlockTag extends BlockTag = BlockTag,
|
28
60
|
TIncludeTransactions extends boolean = boolean,
|
@@ -32,3 +64,7 @@ export type ZkSyncRpcBlock<
|
|
32
64
|
ZkSyncRpcTransaction<TBlockTag extends 'pending' ? true : false>
|
33
65
|
> &
|
34
66
|
ZkSyncRpcBlockOverrides
|
67
|
+
|
68
|
+
export type ZkSyncNumberParameter = {
|
69
|
+
number: number
|
70
|
+
}
|