viem 2.7.22 → 2.8.1
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 +20 -0
- package/_cjs/accounts/utils/sign.js +1 -0
- package/_cjs/accounts/utils/sign.js.map +1 -1
- package/_cjs/accounts/utils/signTransaction.js +11 -2
- package/_cjs/accounts/utils/signTransaction.js.map +1 -1
- package/_cjs/actions/index.js +4 -2
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/call.js +3 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js +3 -1
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/getBlobBaseFee.js +11 -0
- package/_cjs/actions/public/getBlobBaseFee.js.map +1 -0
- package/_cjs/actions/public/watchBlockNumber.js +34 -26
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +11 -2
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_cjs/actions/wallet/sendTransaction.js +13 -11
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signTransaction.js +7 -6
- package/_cjs/actions/wallet/signTransaction.js.map +1 -1
- package/_cjs/chains/celo/serializers.js +10 -15
- package/_cjs/chains/celo/serializers.js.map +1 -1
- package/_cjs/chains/definitions/plumeTestnet.js +30 -0
- package/_cjs/chains/definitions/plumeTestnet.js.map +1 -0
- package/_cjs/chains/definitions/rss3.js +49 -0
- package/_cjs/chains/definitions/rss3.js.map +1 -0
- package/_cjs/chains/definitions/rss3Sepolia.js +50 -0
- package/_cjs/chains/definitions/rss3Sepolia.js.map +1 -0
- package/_cjs/chains/index.js +9 -3
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateL1Fee.js +1 -10
- package/_cjs/chains/opStack/actions/estimateL1Fee.js.map +1 -1
- package/_cjs/chains/opStack/actions/estimateL1Gas.js +1 -10
- package/_cjs/chains/opStack/actions/estimateL1Gas.js.map +1 -1
- package/_cjs/chains/opStack/actions/finalizeWithdrawal.js +1 -1
- package/_cjs/chains/opStack/actions/finalizeWithdrawal.js.map +1 -1
- package/_cjs/chains/opStack/actions/proveWithdrawal.js +1 -1
- package/_cjs/chains/opStack/actions/proveWithdrawal.js.map +1 -1
- package/_cjs/chains/opStack/serializers.js +3 -3
- package/_cjs/chains/opStack/serializers.js.map +1 -1
- package/_cjs/chains/zksync/actions/sendTransaction.js.map +1 -1
- package/_cjs/chains/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_cjs/chains/zksync/serializers.js +6 -6
- package/_cjs/chains/zksync/serializers.js.map +1 -1
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/constants/blob.js +11 -0
- package/_cjs/constants/blob.js.map +1 -0
- package/_cjs/constants/kzg.js +7 -0
- package/_cjs/constants/kzg.js.map +1 -0
- package/_cjs/errors/blob.js +63 -0
- package/_cjs/errors/blob.js.map +1 -0
- package/_cjs/errors/transaction.js +1 -0
- package/_cjs/errors/transaction.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/errors/version.js.map +1 -1
- package/_cjs/index.js +22 -2
- package/_cjs/index.js.map +1 -1
- package/_cjs/node/index.js +3 -1
- package/_cjs/node/index.js.map +1 -1
- package/_cjs/node/trustedSetups.js +7 -0
- package/_cjs/node/trustedSetups.js.map +1 -0
- package/_cjs/types/eip4844.js +3 -0
- package/_cjs/types/eip4844.js.map +1 -0
- package/_cjs/types/kzg.js +3 -0
- package/_cjs/types/kzg.js.map +1 -0
- package/_cjs/utils/blob/blobsToCommitments.js +20 -0
- package/_cjs/utils/blob/blobsToCommitments.js.map +1 -0
- package/_cjs/utils/blob/blobsToProofs.js +26 -0
- package/_cjs/utils/blob/blobsToProofs.js.map +1 -0
- package/_cjs/utils/blob/commitmentToVersionedHash.js +14 -0
- package/_cjs/utils/blob/commitmentToVersionedHash.js.map +1 -0
- package/_cjs/utils/blob/commitmentsToVersionedHashes.js +19 -0
- package/_cjs/utils/blob/commitmentsToVersionedHashes.js.map +1 -0
- package/_cjs/utils/blob/fromBlobs.js +36 -0
- package/_cjs/utils/blob/fromBlobs.js.map +1 -0
- package/_cjs/utils/blob/sidecarsToVersionedHashes.js +19 -0
- package/_cjs/utils/blob/sidecarsToVersionedHashes.js.map +1 -0
- package/_cjs/utils/blob/toBlobSidecars.js +22 -0
- package/_cjs/utils/blob/toBlobSidecars.js.map +1 -0
- package/_cjs/utils/blob/toBlobs.js +48 -0
- package/_cjs/utils/blob/toBlobs.js.map +1 -0
- package/_cjs/utils/encoding/toRlp.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_cjs/utils/formatters/transactionRequest.js +22 -25
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_cjs/utils/kzg/defineKzg.js +11 -0
- package/_cjs/utils/kzg/defineKzg.js.map +1 -0
- package/_cjs/utils/kzg/setupKzg.js +17 -0
- package/_cjs/utils/kzg/setupKzg.js.map +1 -0
- package/_cjs/utils/signature/compactSignatureToSignature.js +3 -3
- package/_cjs/utils/signature/compactSignatureToSignature.js.map +1 -1
- package/_cjs/utils/signature/hexToSignature.js +6 -1
- package/_cjs/utils/signature/hexToSignature.js.map +1 -1
- package/_cjs/utils/signature/signatureToCompactSignature.js +3 -3
- package/_cjs/utils/signature/signatureToCompactSignature.js.map +1 -1
- package/_cjs/utils/signature/signatureToHex.js +9 -3
- package/_cjs/utils/signature/signatureToHex.js.map +1 -1
- package/_cjs/utils/transaction/assertTransaction.js +26 -1
- package/_cjs/utils/transaction/assertTransaction.js.map +1 -1
- package/_cjs/utils/transaction/getSerializedTransactionType.js +2 -0
- package/_cjs/utils/transaction/getSerializedTransactionType.js.map +1 -1
- package/_cjs/utils/transaction/getTransactionType.js +7 -1
- package/_cjs/utils/transaction/getTransactionType.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js +73 -0
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/utils/transaction/serializeAccessList.js.map +1 -1
- package/_cjs/utils/transaction/serializeTransaction.js +84 -21
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/_esm/accounts/utils/sign.js +1 -0
- package/_esm/accounts/utils/sign.js.map +1 -1
- package/_esm/accounts/utils/signTransaction.js +13 -2
- package/_esm/accounts/utils/signTransaction.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/call.js +3 -1
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/estimateGas.js +3 -1
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/getBlobBaseFee.js +27 -0
- package/_esm/actions/public/getBlobBaseFee.js.map +1 -0
- package/_esm/actions/public/watchBlockNumber.js +34 -26
- package/_esm/actions/public/watchBlockNumber.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +12 -2
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_esm/actions/wallet/sendTransaction.js +13 -11
- package/_esm/actions/wallet/sendTransaction.js.map +1 -1
- package/_esm/actions/wallet/signTransaction.js +6 -5
- package/_esm/actions/wallet/signTransaction.js.map +1 -1
- package/_esm/chains/celo/serializers.js +10 -17
- package/_esm/chains/celo/serializers.js.map +1 -1
- package/_esm/chains/definitions/plumeTestnet.js +27 -0
- package/_esm/chains/definitions/plumeTestnet.js.map +1 -0
- package/_esm/chains/definitions/rss3.js +46 -0
- package/_esm/chains/definitions/rss3.js.map +1 -0
- package/_esm/chains/definitions/rss3Sepolia.js +47 -0
- package/_esm/chains/definitions/rss3Sepolia.js.map +1 -0
- package/_esm/chains/index.js +3 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateL1Fee.js +1 -10
- package/_esm/chains/opStack/actions/estimateL1Fee.js.map +1 -1
- package/_esm/chains/opStack/actions/estimateL1Gas.js +1 -10
- package/_esm/chains/opStack/actions/estimateL1Gas.js.map +1 -1
- package/_esm/chains/opStack/actions/finalizeWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/finalizeWithdrawal.js.map +1 -1
- package/_esm/chains/opStack/actions/proveWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/proveWithdrawal.js.map +1 -1
- package/_esm/chains/opStack/serializers.js +2 -2
- package/_esm/chains/opStack/serializers.js.map +1 -1
- package/_esm/chains/zksync/actions/sendTransaction.js.map +1 -1
- package/_esm/chains/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_esm/chains/zksync/serializers.js +6 -6
- package/_esm/chains/zksync/serializers.js.map +1 -1
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/constants/blob.js +16 -0
- package/_esm/constants/blob.js.map +1 -0
- package/_esm/constants/kzg.js +7 -0
- package/_esm/constants/kzg.js.map +1 -0
- package/_esm/errors/blob.js +56 -0
- package/_esm/errors/blob.js.map +1 -0
- package/_esm/errors/transaction.js +1 -0
- package/_esm/errors/transaction.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/errors/version.js.map +1 -1
- package/_esm/index.js +10 -0
- package/_esm/index.js.map +1 -1
- package/_esm/node/index.js +1 -0
- package/_esm/node/index.js.map +1 -1
- package/_esm/node/trustedSetups.js +4 -0
- package/_esm/node/trustedSetups.js.map +1 -0
- package/_esm/types/eip4844.js +2 -0
- package/_esm/types/eip4844.js.map +1 -0
- package/_esm/types/kzg.js +2 -0
- package/_esm/types/kzg.js.map +1 -0
- package/_esm/utils/blob/blobsToCommitments.js +28 -0
- package/_esm/utils/blob/blobsToCommitments.js.map +1 -0
- package/_esm/utils/blob/blobsToProofs.js +38 -0
- package/_esm/utils/blob/blobsToProofs.js.map +1 -0
- package/_esm/utils/blob/commitmentToVersionedHash.js +27 -0
- package/_esm/utils/blob/commitmentToVersionedHash.js.map +1 -0
- package/_esm/utils/blob/commitmentsToVersionedHashes.js +32 -0
- package/_esm/utils/blob/commitmentsToVersionedHashes.js.map +1 -0
- package/_esm/utils/blob/fromBlobs.js +33 -0
- package/_esm/utils/blob/fromBlobs.js.map +1 -0
- package/_esm/utils/blob/sidecarsToVersionedHashes.js +26 -0
- package/_esm/utils/blob/sidecarsToVersionedHashes.js.map +1 -0
- package/_esm/utils/blob/toBlobSidecars.js +45 -0
- package/_esm/utils/blob/toBlobSidecars.js.map +1 -0
- package/_esm/utils/blob/toBlobs.js +58 -0
- package/_esm/utils/blob/toBlobs.js.map +1 -0
- package/_esm/utils/encoding/toRlp.js.map +1 -1
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_esm/utils/formatters/transactionRequest.js +23 -26
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/utils/kzg/defineKzg.js +21 -0
- package/_esm/utils/kzg/defineKzg.js.map +1 -0
- package/_esm/utils/kzg/setupKzg.js +25 -0
- package/_esm/utils/kzg/setupKzg.js.map +1 -0
- package/_esm/utils/signature/compactSignatureToSignature.js +3 -3
- package/_esm/utils/signature/compactSignatureToSignature.js.map +1 -1
- package/_esm/utils/signature/hexToSignature.js +6 -1
- package/_esm/utils/signature/hexToSignature.js.map +1 -1
- package/_esm/utils/signature/signatureToCompactSignature.js +4 -4
- package/_esm/utils/signature/signatureToCompactSignature.js.map +1 -1
- package/_esm/utils/signature/signatureToHex.js +11 -4
- package/_esm/utils/signature/signatureToHex.js.map +1 -1
- package/_esm/utils/transaction/assertTransaction.js +24 -0
- package/_esm/utils/transaction/assertTransaction.js.map +1 -1
- package/_esm/utils/transaction/getSerializedTransactionType.js +2 -0
- package/_esm/utils/transaction/getSerializedTransactionType.js.map +1 -1
- package/_esm/utils/transaction/getTransactionType.js +7 -1
- package/_esm/utils/transaction/getTransactionType.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js +74 -1
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/utils/transaction/serializeAccessList.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js +85 -22
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_types/accounts/types.d.ts +3 -3
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/accounts/utils/sign.d.ts.map +1 -1
- package/_types/accounts/utils/signTransaction.d.ts +5 -5
- package/_types/accounts/utils/signTransaction.d.ts.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/getBlobBaseFee.d.ts +30 -0
- package/_types/actions/public/getBlobBaseFee.d.ts.map +1 -0
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +27 -8
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/actions/wallet/sendRawTransaction.d.ts +3 -5
- package/_types/actions/wallet/sendRawTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts +4 -2
- package/_types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signTransaction.d.ts +5 -2
- package/_types/actions/wallet/signTransaction.d.ts.map +1 -1
- package/_types/chains/celo/chainConfig.d.ts +1282 -376
- package/_types/chains/celo/chainConfig.d.ts.map +1 -1
- package/_types/chains/celo/formatters.d.ts +1282 -376
- package/_types/chains/celo/formatters.d.ts.map +1 -1
- package/_types/chains/celo/serializers.d.ts +3 -4
- package/_types/chains/celo/serializers.d.ts.map +1 -1
- package/_types/chains/celo/types.d.ts +3 -8
- package/_types/chains/celo/types.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +452 -188
- package/_types/chains/definitions/ancient8.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8Sepolia.d.ts +452 -188
- package/_types/chains/definitions/ancient8Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +452 -188
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +452 -188
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +452 -188
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +1282 -376
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +1282 -376
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtal.d.ts +452 -188
- package/_types/chains/definitions/fraxtal.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtalTestnet.d.ts +452 -188
- package/_types/chains/definitions/fraxtalTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/liskSepolia.d.ts +452 -188
- package/_types/chains/definitions/liskSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts +452 -188
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +452 -188
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +452 -188
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +451 -187
- package/_types/chains/definitions/pgn.d.ts.map +1 -1
- package/_types/chains/definitions/pgnTestnet.d.ts +451 -187
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/plumeTestnet.d.ts +37 -0
- package/_types/chains/definitions/plumeTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/rss3.d.ts +1080 -0
- package/_types/chains/definitions/rss3.d.ts.map +1 -0
- package/_types/chains/definitions/rss3Sepolia.d.ts +1080 -0
- package/_types/chains/definitions/rss3Sepolia.d.ts.map +1 -0
- package/_types/chains/definitions/zkSync.d.ts +692 -32
- package/_types/chains/definitions/zkSync.d.ts.map +1 -1
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +692 -32
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zkSyncTestnet.d.ts +692 -32
- package/_types/chains/definitions/zkSyncTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +452 -188
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +452 -188
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +452 -188
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/chains/index.d.ts +4 -1
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateL1Fee.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateL1Gas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts.map +1 -1
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts.map +1 -1
- package/_types/chains/opStack/chainConfig.d.ts +452 -188
- package/_types/chains/opStack/chainConfig.d.ts.map +1 -1
- package/_types/chains/opStack/formatters.d.ts +451 -187
- package/_types/chains/opStack/formatters.d.ts.map +1 -1
- package/_types/chains/opStack/serializers.d.ts +4 -3
- package/_types/chains/opStack/serializers.d.ts.map +1 -1
- package/_types/chains/opStack/types/transaction.d.ts +4 -8
- package/_types/chains/opStack/types/transaction.d.ts.map +1 -1
- package/_types/chains/zksync/actions/sendTransaction.d.ts.map +1 -1
- package/_types/chains/zksync/chainConfig.d.ts +692 -32
- package/_types/chains/zksync/chainConfig.d.ts.map +1 -1
- package/_types/chains/zksync/formatters.d.ts +692 -32
- package/_types/chains/zksync/formatters.d.ts.map +1 -1
- package/_types/chains/zksync/serializers.d.ts +3 -3
- package/_types/chains/zksync/serializers.d.ts.map +1 -1
- package/_types/chains/zksync/types/chain.d.ts +2 -2
- package/_types/chains/zksync/types/chain.d.ts.map +1 -1
- package/_types/chains/zksync/types/eip712.d.ts +2 -2
- package/_types/chains/zksync/types/eip712.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +2 -2
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +4 -4
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/constants/blob.d.ts +11 -0
- package/_types/constants/blob.d.ts.map +1 -0
- package/_types/constants/kzg.d.ts +6 -0
- package/_types/constants/kzg.d.ts.map +1 -0
- package/_types/errors/blob.d.ts +40 -0
- package/_types/errors/blob.d.ts.map +1 -0
- package/_types/errors/transaction.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/errors/version.d.ts.map +1 -1
- package/_types/index.d.ts +11 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/node/index.d.ts +1 -0
- package/_types/node/index.d.ts.map +1 -1
- package/_types/node/trustedSetups.d.ts +3 -0
- package/_types/node/trustedSetups.d.ts.map +1 -0
- package/_types/types/account.d.ts +3 -3
- package/_types/types/account.d.ts.map +1 -1
- package/_types/types/chain.d.ts +2 -2
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +3 -3
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/eip4844.d.ts +11 -0
- package/_types/types/eip4844.d.ts.map +1 -0
- package/_types/types/fee.d.ts +2 -2
- package/_types/types/fee.d.ts.map +1 -1
- package/_types/types/kzg.d.ts +24 -0
- package/_types/types/kzg.d.ts.map +1 -0
- package/_types/types/misc.d.ts +15 -1
- package/_types/types/misc.d.ts.map +1 -1
- package/_types/types/rpc.d.ts +4 -4
- package/_types/types/rpc.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +44 -9
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/types/utils.d.ts +38 -2
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/blob/blobsToCommitments.d.ts +31 -0
- package/_types/utils/blob/blobsToCommitments.d.ts.map +1 -0
- package/_types/utils/blob/blobsToProofs.d.ts +37 -0
- package/_types/utils/blob/blobsToProofs.d.ts.map +1 -0
- package/_types/utils/blob/commitmentToVersionedHash.d.ts +35 -0
- package/_types/utils/blob/commitmentToVersionedHash.d.ts.map +1 -0
- package/_types/utils/blob/commitmentsToVersionedHashes.d.ts +34 -0
- package/_types/utils/blob/commitmentsToVersionedHashes.d.ts.map +1 -0
- package/_types/utils/blob/fromBlobs.d.ts +16 -0
- package/_types/utils/blob/fromBlobs.d.ts.map +1 -0
- package/_types/utils/blob/sidecarsToVersionedHashes.d.ts +29 -0
- package/_types/utils/blob/sidecarsToVersionedHashes.d.ts.map +1 -0
- package/_types/utils/blob/toBlobSidecars.d.ts +57 -0
- package/_types/utils/blob/toBlobSidecars.d.ts.map +1 -0
- package/_types/utils/blob/toBlobs.d.ts +28 -0
- package/_types/utils/blob/toBlobs.d.ts.map +1 -0
- package/_types/utils/encoding/toRlp.d.ts +1 -1
- package/_types/utils/encoding/toRlp.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +25 -25
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +227 -3
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/kzg/defineKzg.d.ts +21 -0
- package/_types/utils/kzg/defineKzg.d.ts.map +1 -0
- package/_types/utils/kzg/setupKzg.d.ts +21 -0
- package/_types/utils/kzg/setupKzg.d.ts.map +1 -0
- package/_types/utils/signature/hexToSignature.d.ts.map +1 -1
- package/_types/utils/signature/signatureToCompactSignature.d.ts +1 -1
- package/_types/utils/signature/signatureToHex.d.ts +2 -2
- package/_types/utils/signature/signatureToHex.d.ts.map +1 -1
- package/_types/utils/transaction/assertTransaction.d.ts +4 -1
- package/_types/utils/transaction/assertTransaction.d.ts.map +1 -1
- package/_types/utils/transaction/getSerializedTransactionType.d.ts +5 -3
- package/_types/utils/transaction/getSerializedTransactionType.d.ts.map +1 -1
- package/_types/utils/transaction/getTransactionType.d.ts +34 -3
- package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts +7 -5
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts +13 -6
- package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
- package/accounts/types.ts +9 -5
- package/accounts/utils/sign.ts +1 -0
- package/accounts/utils/signTransaction.ts +37 -22
- package/actions/index.ts +5 -0
- package/actions/public/call.ts +4 -0
- package/actions/public/estimateGas.ts +4 -0
- package/actions/public/getBlobBaseFee.ts +42 -0
- package/actions/public/watchBlockNumber.ts +33 -23
- package/actions/wallet/prepareTransactionRequest.ts +134 -61
- package/actions/wallet/sendRawTransaction.ts +3 -5
- package/actions/wallet/sendTransaction.ts +41 -31
- package/actions/wallet/signTransaction.ts +34 -18
- package/chains/celo/serializers.ts +12 -25
- package/chains/celo/types.ts +5 -10
- package/chains/definitions/plumeTestnet.ts +28 -0
- package/chains/definitions/rss3.ts +47 -0
- package/chains/definitions/rss3Sepolia.ts +48 -0
- package/chains/index.ts +3 -1
- package/chains/opStack/actions/estimateL1Fee.ts +12 -16
- package/chains/opStack/actions/estimateL1Gas.ts +12 -16
- package/chains/opStack/actions/finalizeWithdrawal.ts +3 -2
- package/chains/opStack/actions/proveWithdrawal.ts +3 -2
- package/chains/opStack/serializers.ts +5 -5
- package/chains/opStack/types/transaction.ts +9 -11
- package/chains/zksync/actions/sendTransaction.ts +2 -1
- package/chains/zksync/actions/signEip712Transaction.ts +2 -2
- package/chains/zksync/serializers.ts +14 -10
- package/chains/zksync/types/chain.ts +4 -7
- package/chains/zksync/types/eip712.ts +2 -2
- package/clients/decorators/public.ts +8 -4
- package/clients/decorators/wallet.ts +14 -6
- package/constants/blob.ts +21 -0
- package/constants/kzg.ts +9 -0
- package/errors/blob.ts +67 -0
- package/errors/transaction.ts +1 -0
- package/errors/version.ts +1 -1
- package/index.ts +64 -0
- package/node/index.ts +2 -0
- package/node/trustedSetups.ts +11 -0
- package/package.json +1 -1
- package/trusted-setups/mainnet.json +8265 -0
- package/trusted-setups/minimal.json +8265 -0
- package/types/account.ts +3 -3
- package/types/chain.ts +3 -1
- package/types/eip1193.ts +3 -3
- package/types/eip4844.ts +12 -0
- package/types/fee.ts +3 -2
- package/types/kzg.ts +32 -0
- package/types/misc.ts +20 -1
- package/types/rpc.ts +11 -6
- package/types/transaction.ts +75 -17
- package/types/utils.ts +49 -1
- package/utils/blob/blobsToCommitments.ts +69 -0
- package/utils/blob/blobsToProofs.ts +93 -0
- package/utils/blob/commitmentToVersionedHash.ts +62 -0
- package/utils/blob/commitmentsToVersionedHashes.ts +71 -0
- package/utils/blob/fromBlobs.ts +73 -0
- package/utils/blob/sidecarsToVersionedHashes.ts +66 -0
- package/utils/blob/toBlobSidecars.ts +109 -0
- package/utils/blob/toBlobs.ts +113 -0
- package/utils/encoding/toRlp.ts +2 -2
- package/utils/formatters/transaction.ts +3 -2
- package/utils/formatters/transactionRequest.ts +28 -35
- package/utils/kzg/defineKzg.ts +30 -0
- package/utils/kzg/setupKzg.ts +38 -0
- package/utils/signature/compactSignatureToSignature.ts +3 -3
- package/utils/signature/hexToSignature.ts +6 -1
- package/utils/signature/signatureToCompactSignature.ts +4 -4
- package/utils/signature/signatureToHex.ts +9 -4
- package/utils/transaction/assertTransaction.ts +41 -0
- package/utils/transaction/getSerializedTransactionType.ts +34 -11
- package/utils/transaction/getTransactionType.ts +109 -26
- package/utils/transaction/parseTransaction.ts +128 -8
- package/utils/transaction/serializeAccessList.ts +1 -1
- package/utils/transaction/serializeTransaction.ts +172 -39
@@ -0,0 +1,28 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
|
3
|
+
const sourceId = 11_155_111 // sepolia
|
4
|
+
|
5
|
+
export const plumeTestnet = /*#__PURE__*/ defineChain({
|
6
|
+
id: 161_221_135,
|
7
|
+
name: 'Plume Testnet',
|
8
|
+
nativeCurrency: {
|
9
|
+
name: 'Plume Sepolia Ether',
|
10
|
+
symbol: 'ETH',
|
11
|
+
decimals: 18,
|
12
|
+
},
|
13
|
+
rpcUrls: {
|
14
|
+
default: {
|
15
|
+
http: ['https://plume-testnet.rpc.caldera.xyz/http'],
|
16
|
+
webSocket: ['wss://plume-testnet.rpc.caldera.xyz/ws'],
|
17
|
+
},
|
18
|
+
},
|
19
|
+
blockExplorers: {
|
20
|
+
default: {
|
21
|
+
name: 'Blockscout',
|
22
|
+
url: 'https://plume-testnet.explorer.caldera.xyz',
|
23
|
+
apiUrl: 'https://plume-testnet.explorer.caldera.xyz/api',
|
24
|
+
},
|
25
|
+
},
|
26
|
+
testnet: true,
|
27
|
+
sourceId,
|
28
|
+
})
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
import { chainConfig } from '../opStack/chainConfig.js'
|
3
|
+
|
4
|
+
const sourceId = 1 // mainnet
|
5
|
+
|
6
|
+
export const rss3 = /*#__PURE__*/ defineChain({
|
7
|
+
...chainConfig,
|
8
|
+
id: 12_553,
|
9
|
+
name: 'RSS3 VSL Mainnet',
|
10
|
+
nativeCurrency: { name: 'RSS3', symbol: 'RSS3', decimals: 18 },
|
11
|
+
rpcUrls: {
|
12
|
+
default: {
|
13
|
+
http: ['https://rpc.rss3.io'],
|
14
|
+
},
|
15
|
+
},
|
16
|
+
blockExplorers: {
|
17
|
+
default: {
|
18
|
+
name: 'RSS3 VSL Mainnet Scan',
|
19
|
+
url: 'https://scan.rss3.io',
|
20
|
+
apiUrl: 'https://scan.rss3.io/api',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
contracts: {
|
24
|
+
...chainConfig.contracts,
|
25
|
+
l2OutputOracle: {
|
26
|
+
[sourceId]: {
|
27
|
+
address: '0xE6f24d2C32B3109B18ed33cF08eFb490b1e09C10',
|
28
|
+
},
|
29
|
+
},
|
30
|
+
multicall3: {
|
31
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
32
|
+
blockCreated: 14193,
|
33
|
+
},
|
34
|
+
portal: {
|
35
|
+
[sourceId]: {
|
36
|
+
address: '0x6A12432491bbbE8d3babf75F759766774C778Db4',
|
37
|
+
blockCreated: 19387057,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
l1StandardBridge: {
|
41
|
+
[sourceId]: {
|
42
|
+
address: '0x4cbab69108Aa72151EDa5A3c164eA86845f18438',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
sourceId,
|
47
|
+
})
|
@@ -0,0 +1,48 @@
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
2
|
+
import { chainConfig } from '../opStack/chainConfig.js'
|
3
|
+
|
4
|
+
const sourceId = 11_155_111 // sepolia
|
5
|
+
|
6
|
+
export const rss3Sepolia = /*#__PURE__*/ defineChain({
|
7
|
+
...chainConfig,
|
8
|
+
id: 2_331,
|
9
|
+
name: 'RSS3 VSL Sepolia Testnet',
|
10
|
+
nativeCurrency: { name: 'RSS3', symbol: 'RSS3', decimals: 18 },
|
11
|
+
rpcUrls: {
|
12
|
+
default: {
|
13
|
+
http: ['https://rpc.testnet.rss3.io'],
|
14
|
+
},
|
15
|
+
},
|
16
|
+
blockExplorers: {
|
17
|
+
default: {
|
18
|
+
name: 'RSS3 VSL Sepolia Testnet Scan',
|
19
|
+
url: 'https://scan.testnet.rss3.io',
|
20
|
+
apiUrl: 'https://scan.testnet.rss3.io/api',
|
21
|
+
},
|
22
|
+
},
|
23
|
+
contracts: {
|
24
|
+
...chainConfig.contracts,
|
25
|
+
l2OutputOracle: {
|
26
|
+
[sourceId]: {
|
27
|
+
address: '0xDb5c46C3Eaa6Ed6aE8b2379785DF7dd029C0dC81',
|
28
|
+
},
|
29
|
+
},
|
30
|
+
multicall3: {
|
31
|
+
address: '0xca11bde05977b3631167028862be2a173976ca11',
|
32
|
+
blockCreated: 55697,
|
33
|
+
},
|
34
|
+
portal: {
|
35
|
+
[sourceId]: {
|
36
|
+
address: '0xcBD77E8E1E7F06B25baDe67142cdE82652Da7b57',
|
37
|
+
blockCreated: 5345035,
|
38
|
+
},
|
39
|
+
},
|
40
|
+
l1StandardBridge: {
|
41
|
+
[sourceId]: {
|
42
|
+
address: '0xdDD29bb63B0839FB1cE0eE439Ff027738595D07B',
|
43
|
+
},
|
44
|
+
},
|
45
|
+
},
|
46
|
+
testnet: true,
|
47
|
+
sourceId,
|
48
|
+
})
|
package/chains/index.ts
CHANGED
@@ -150,6 +150,7 @@ export { pgn } from './definitions/pgn.js'
|
|
150
150
|
export { pgnTestnet } from './definitions/pgnTestnet.js'
|
151
151
|
export { phoenix } from './definitions/phoenix.js'
|
152
152
|
export { plinga } from './definitions/plinga.js'
|
153
|
+
export { plumeTestnet } from './definitions/plumeTestnet.js'
|
153
154
|
export { polygon } from './definitions/polygon.js'
|
154
155
|
export { polygonAmoy } from './definitions/polygonAmoy.js'
|
155
156
|
export { polygonMumbai } from './definitions/polygonMumbai.js'
|
@@ -163,6 +164,8 @@ export { rollux } from './definitions/rollux.js'
|
|
163
164
|
export { rolluxTestnet } from './definitions/rolluxTestnet.js'
|
164
165
|
export { ronin } from './definitions/ronin.js'
|
165
166
|
export { rootstock } from './definitions/rootstock.js'
|
167
|
+
export { rss3 } from './definitions/rss3.js'
|
168
|
+
export { rss3Sepolia } from './definitions/rss3Sepolia.js'
|
166
169
|
export { saigon } from './definitions/saigon.js'
|
167
170
|
export { sapphire } from './definitions/sapphire.js'
|
168
171
|
export { sapphireTestnet } from './definitions/sapphireTestnet.js'
|
@@ -245,7 +248,6 @@ export type {
|
|
245
248
|
CeloTransactionRequest,
|
246
249
|
CeloTransactionType,
|
247
250
|
CeloTransactionSerializable,
|
248
|
-
CeloTransactionSerializableBase,
|
249
251
|
CeloTransactionSerialized,
|
250
252
|
RpcTransactionCIP42,
|
251
253
|
RpcTransactionCIP64,
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
|
-
import { getChainId } from '../../../actions/public/getChainId.js'
|
4
3
|
import {
|
5
4
|
type ReadContractErrorType,
|
6
5
|
readContract,
|
@@ -15,12 +14,16 @@ import type { Transport } from '../../../clients/transports/createTransport.js'
|
|
15
14
|
import type { ErrorType } from '../../../errors/utils.js'
|
16
15
|
import type { Account, GetAccountParameter } from '../../../types/account.js'
|
17
16
|
import { type Chain, type GetChainParameter } from '../../../types/chain.js'
|
18
|
-
import type {
|
17
|
+
import type {
|
18
|
+
TransactionRequestEIP1559,
|
19
|
+
TransactionSerializable,
|
20
|
+
} from '../../../types/transaction.js'
|
19
21
|
import type { RequestErrorType } from '../../../utils/buildRequest.js'
|
20
22
|
import { getChainContractAddress } from '../../../utils/chain/getChainContractAddress.js'
|
21
23
|
import { type HexToNumberErrorType } from '../../../utils/encoding/fromHex.js'
|
22
24
|
import {
|
23
25
|
type AssertRequestErrorType,
|
26
|
+
type AssertRequestParameters,
|
24
27
|
assertRequest,
|
25
28
|
} from '../../../utils/transaction/assertRequest.js'
|
26
29
|
import {
|
@@ -98,29 +101,22 @@ export async function estimateL1Fee<
|
|
98
101
|
})()
|
99
102
|
|
100
103
|
// Populate transaction with required fields to accurately estimate gas.
|
101
|
-
const
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
),
|
106
|
-
(async () => {
|
107
|
-
if (chain) return chain.id
|
108
|
-
return getChainId(client)
|
109
|
-
})(),
|
110
|
-
])
|
104
|
+
const request = await prepareTransactionRequest(
|
105
|
+
client,
|
106
|
+
args as PrepareTransactionRequestParameters,
|
107
|
+
)
|
111
108
|
|
112
|
-
assertRequest(request)
|
109
|
+
assertRequest(request as AssertRequestParameters)
|
113
110
|
|
114
111
|
const transaction = serializeTransaction({
|
115
112
|
...request,
|
116
|
-
chainId,
|
117
113
|
type: 'eip1559',
|
118
|
-
})
|
114
|
+
} as TransactionSerializable)
|
119
115
|
|
120
116
|
return readContract(client, {
|
121
117
|
abi: gasPriceOracleAbi,
|
122
118
|
address: gasPriceOracleAddress,
|
123
119
|
functionName: 'getL1Fee',
|
124
|
-
args: [transaction],
|
120
|
+
args: [transaction as any],
|
125
121
|
})
|
126
122
|
}
|
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
|
-
import { getChainId } from '../../../actions/public/getChainId.js'
|
4
3
|
import {
|
5
4
|
type ReadContractErrorType,
|
6
5
|
readContract,
|
@@ -15,12 +14,16 @@ import type { Transport } from '../../../clients/transports/createTransport.js'
|
|
15
14
|
import type { ErrorType } from '../../../errors/utils.js'
|
16
15
|
import type { Account, GetAccountParameter } from '../../../types/account.js'
|
17
16
|
import { type Chain, type GetChainParameter } from '../../../types/chain.js'
|
18
|
-
import type {
|
17
|
+
import type {
|
18
|
+
TransactionRequestEIP1559,
|
19
|
+
TransactionSerializable,
|
20
|
+
} from '../../../types/transaction.js'
|
19
21
|
import type { RequestErrorType } from '../../../utils/buildRequest.js'
|
20
22
|
import { getChainContractAddress } from '../../../utils/chain/getChainContractAddress.js'
|
21
23
|
import { type HexToNumberErrorType } from '../../../utils/encoding/fromHex.js'
|
22
24
|
import {
|
23
25
|
type AssertRequestErrorType,
|
26
|
+
type AssertRequestParameters,
|
24
27
|
assertRequest,
|
25
28
|
} from '../../../utils/transaction/assertRequest.js'
|
26
29
|
import {
|
@@ -98,29 +101,22 @@ export async function estimateL1Gas<
|
|
98
101
|
})()
|
99
102
|
|
100
103
|
// Populate transaction with required fields to accurately estimate gas.
|
101
|
-
const
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
),
|
106
|
-
(async () => {
|
107
|
-
if (chain) return chain.id
|
108
|
-
return getChainId(client)
|
109
|
-
})(),
|
110
|
-
])
|
104
|
+
const request = await prepareTransactionRequest(
|
105
|
+
client,
|
106
|
+
args as PrepareTransactionRequestParameters,
|
107
|
+
)
|
111
108
|
|
112
|
-
assertRequest(request)
|
109
|
+
assertRequest(request as AssertRequestParameters)
|
113
110
|
|
114
111
|
const transaction = serializeTransaction({
|
115
112
|
...request,
|
116
|
-
chainId,
|
117
113
|
type: 'eip1559',
|
118
|
-
})
|
114
|
+
} as TransactionSerializable)
|
119
115
|
|
120
116
|
return readContract(client, {
|
121
117
|
abi: gasPriceOracleAbi,
|
122
118
|
address: gasPriceOracleAddress,
|
123
119
|
functionName: 'getL1GasUsed',
|
124
|
-
args: [transaction],
|
120
|
+
args: [transaction as any],
|
125
121
|
})
|
126
122
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
import {
|
3
3
|
type WriteContractErrorType,
|
4
|
+
type WriteContractParameters,
|
4
5
|
writeContract,
|
5
6
|
} from '../../../actions/wallet/writeContract.js'
|
6
7
|
import type { Client } from '../../../clients/createClient.js'
|
@@ -116,7 +117,7 @@ export async function finalizeWithdrawal<
|
|
116
117
|
: undefined
|
117
118
|
|
118
119
|
return writeContract(client, {
|
119
|
-
account
|
120
|
+
account: account!,
|
120
121
|
abi: portalAbi,
|
121
122
|
address: portalAddress,
|
122
123
|
chain,
|
@@ -126,5 +127,5 @@ export async function finalizeWithdrawal<
|
|
126
127
|
maxFeePerGas,
|
127
128
|
maxPriorityFeePerGas,
|
128
129
|
nonce,
|
129
|
-
})
|
130
|
+
} satisfies WriteContractParameters as any)
|
130
131
|
}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
import {
|
3
3
|
type WriteContractErrorType,
|
4
|
+
type WriteContractParameters,
|
4
5
|
writeContract,
|
5
6
|
} from '../../../actions/wallet/writeContract.js'
|
6
7
|
import type { Client } from '../../../clients/createClient.js'
|
@@ -137,7 +138,7 @@ export async function proveWithdrawal<
|
|
137
138
|
: gas ?? undefined
|
138
139
|
|
139
140
|
return writeContract(client, {
|
140
|
-
account
|
141
|
+
account: account!,
|
141
142
|
abi: portalAbi,
|
142
143
|
address: portalAddress,
|
143
144
|
chain,
|
@@ -147,5 +148,5 @@ export async function proveWithdrawal<
|
|
147
148
|
maxFeePerGas,
|
148
149
|
maxPriorityFeePerGas,
|
149
150
|
nonce,
|
150
|
-
})
|
151
|
+
} satisfies WriteContractParameters as any)
|
151
152
|
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { InvalidAddressError } from '../../errors/address.js'
|
2
2
|
import type { ErrorType } from '../../errors/utils.js'
|
3
3
|
import type { ChainSerializers } from '../../types/chain.js'
|
4
|
-
import type { Hex } from '../../types/misc.js'
|
4
|
+
import type { Hex, Signature } from '../../types/misc.js'
|
5
5
|
import type { TransactionSerializable } from '../../types/transaction.js'
|
6
6
|
import type { RequiredBy } from '../../types/utils.js'
|
7
7
|
import { isAddress } from '../../utils/address/isAddress.js'
|
@@ -10,7 +10,6 @@ import { toHex } from '../../utils/encoding/toHex.js'
|
|
10
10
|
import { toRlp } from '../../utils/encoding/toRlp.js'
|
11
11
|
import {
|
12
12
|
type SerializeTransactionErrorType as SerializeTransactionErrorType_,
|
13
|
-
type SerializeTransactionFn,
|
14
13
|
serializeTransaction as serializeTransaction_,
|
15
14
|
} from '../../utils/transaction/serializeTransaction.js'
|
16
15
|
import type {
|
@@ -27,9 +26,10 @@ export type SerializeTransactionErrorType =
|
|
27
26
|
| SerializeTransactionErrorType_
|
28
27
|
| ErrorType
|
29
28
|
|
30
|
-
export
|
31
|
-
OpStackTransactionSerializable
|
32
|
-
|
29
|
+
export function serializeTransaction(
|
30
|
+
transaction: OpStackTransactionSerializable,
|
31
|
+
signature?: Signature,
|
32
|
+
) {
|
33
33
|
if (isDeposit(transaction)) return serializeTransactionDeposit(transaction)
|
34
34
|
return serializeTransaction_(
|
35
35
|
transaction as TransactionSerializable,
|
@@ -15,7 +15,7 @@ import type {
|
|
15
15
|
TransactionSerialized,
|
16
16
|
TransactionType,
|
17
17
|
} from '../../../types/transaction.js'
|
18
|
-
import type {
|
18
|
+
import type { OneOf } from '../../../types/utils.js'
|
19
19
|
|
20
20
|
type RpcTransaction<TPending extends boolean = boolean> =
|
21
21
|
RpcTransaction_<TPending> & {
|
@@ -77,17 +77,15 @@ export type OpStackTransactionReceiptOverrides = {
|
|
77
77
|
export type OpStackTransactionReceipt = TransactionReceipt &
|
78
78
|
OpStackTransactionReceiptOverrides
|
79
79
|
|
80
|
-
export type OpStackTransactionSerializable =
|
81
|
-
|
|
82
|
-
|
83
|
-
isSystemTx?: undefined
|
84
|
-
mint?: undefined
|
85
|
-
sourceHash?: undefined
|
86
|
-
})
|
80
|
+
export type OpStackTransactionSerializable = OneOf<
|
81
|
+
TransactionSerializableDeposit | TransactionSerializable
|
82
|
+
>
|
87
83
|
|
88
84
|
export type OpStackTransactionSerialized<
|
89
|
-
TType extends OpStackTransactionType =
|
90
|
-
> =
|
85
|
+
TType extends OpStackTransactionType = OpStackTransactionType,
|
86
|
+
> = TType extends 'deposit'
|
87
|
+
? TransactionSerializedDeposit
|
88
|
+
: TransactionSerialized<TType>
|
91
89
|
|
92
90
|
export type OpStackTransactionType = TransactionType | 'deposit'
|
93
91
|
|
@@ -102,7 +100,7 @@ export type TransactionSerializableDeposit<
|
|
102
100
|
isSystemTx?: boolean
|
103
101
|
mint?: bigint
|
104
102
|
sourceHash: Hex
|
105
|
-
type
|
103
|
+
type: 'deposit'
|
106
104
|
}
|
107
105
|
|
108
106
|
export type TransactionSerializedDeposit = `0x7e${string}`
|
@@ -73,6 +73,7 @@ export async function sendTransaction<
|
|
73
73
|
client: Client<Transport, TChain, TAccount>,
|
74
74
|
args: SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
75
75
|
): Promise<SendTransactionReturnType> {
|
76
|
-
if (isEIP712Transaction(args
|
76
|
+
if (isEIP712Transaction(args as any))
|
77
|
+
return sendEip712Transaction(client, args)
|
77
78
|
return sendTransaction_(client, args)
|
78
79
|
}
|
@@ -1,12 +1,10 @@
|
|
1
|
+
import type { Signature } from '../../index.js'
|
1
2
|
import type { ChainSerializers } from '../../types/chain.js'
|
2
3
|
import type { TransactionSerializable } from '../../types/transaction.js'
|
3
4
|
import { concatHex } from '../../utils/data/concat.js'
|
4
5
|
import { toHex } from '../../utils/encoding/toHex.js'
|
5
6
|
import { toRlp } from '../../utils/encoding/toRlp.js'
|
6
|
-
import {
|
7
|
-
type SerializeTransactionFn,
|
8
|
-
serializeTransaction as serializeTransaction_,
|
9
|
-
} from '../../utils/transaction/serializeTransaction.js'
|
7
|
+
import { serializeTransaction as serializeTransaction_ } from '../../utils/transaction/serializeTransaction.js'
|
10
8
|
import type {
|
11
9
|
ZkSyncTransactionSerializable,
|
12
10
|
ZkSyncTransactionSerializableEIP712,
|
@@ -15,12 +13,18 @@ import type {
|
|
15
13
|
import { assertEip712Transaction } from './utils/assertEip712Transaction.js'
|
16
14
|
import { isEIP712Transaction } from './utils/isEip712Transaction.js'
|
17
15
|
|
18
|
-
export
|
19
|
-
ZkSyncTransactionSerializable
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
16
|
+
export function serializeTransaction(
|
17
|
+
transaction: ZkSyncTransactionSerializable,
|
18
|
+
signature?: Signature,
|
19
|
+
) {
|
20
|
+
if (isEIP712Transaction(transaction))
|
21
|
+
return serializeTransactionEIP712(
|
22
|
+
transaction as ZkSyncTransactionSerializableEIP712,
|
23
|
+
)
|
24
|
+
return serializeTransaction_(
|
25
|
+
transaction as TransactionSerializable,
|
26
|
+
signature,
|
27
|
+
)
|
24
28
|
}
|
25
29
|
|
26
30
|
export const serializers = {
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import type { ChainFormatters } from '../../../types/chain.js'
|
2
2
|
import type { Chain, ChainFormatter } from '../../../types/chain.js'
|
3
|
-
import type {
|
4
|
-
TransactionSerializable,
|
5
|
-
TransactionSerializableGeneric,
|
6
|
-
} from '../../../types/transaction.js'
|
7
3
|
import type { EIP712DomainFn } from './eip712.js'
|
4
|
+
import type { ZkSyncTransactionSerializable } from './transaction.js'
|
8
5
|
|
9
6
|
export type ChainEIP712<
|
10
7
|
formatters extends ChainFormatters | undefined = ChainFormatters | undefined,
|
@@ -17,10 +14,10 @@ export type ChainEIP712<
|
|
17
14
|
| EIP712DomainFn<
|
18
15
|
formatters extends ChainFormatters
|
19
16
|
? formatters['transactionRequest'] extends ChainFormatter
|
20
|
-
?
|
17
|
+
? ZkSyncTransactionSerializable &
|
21
18
|
Parameters<formatters['transactionRequest']['format']>[0]
|
22
|
-
:
|
23
|
-
:
|
19
|
+
: ZkSyncTransactionSerializable
|
20
|
+
: ZkSyncTransactionSerializable,
|
24
21
|
TransactionSignable
|
25
22
|
>
|
26
23
|
| undefined
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Address, TypedDataDomain } from 'abitype'
|
2
2
|
import type { Hex } from '../../../types/misc.js'
|
3
|
-
import type {
|
3
|
+
import type { ZkSyncTransactionSerializable } from './transaction.js'
|
4
4
|
|
5
5
|
type PaymasterParams = {
|
6
6
|
paymaster: Address
|
@@ -26,6 +26,6 @@ export type EIP712Domain<TransactionSignable> = {
|
|
26
26
|
|
27
27
|
export type EIP712DomainFn<
|
28
28
|
TTransactionSerializable extends
|
29
|
-
|
29
|
+
ZkSyncTransactionSerializable = ZkSyncTransactionSerializable,
|
30
30
|
TransactionSignable = {},
|
31
31
|
> = (transaction: TTransactionSerializable) => EIP712Domain<TransactionSignable>
|
@@ -217,8 +217,8 @@ import {
|
|
217
217
|
watchPendingTransactions,
|
218
218
|
} from '../../actions/public/watchPendingTransactions.js'
|
219
219
|
import {
|
220
|
-
type PrepareTransactionRequestParameterType,
|
221
220
|
type PrepareTransactionRequestParameters,
|
221
|
+
type PrepareTransactionRequestRequest,
|
222
222
|
type PrepareTransactionRequestReturnType,
|
223
223
|
prepareTransactionRequest,
|
224
224
|
} from '../../actions/wallet/prepareTransactionRequest.js'
|
@@ -1335,7 +1335,10 @@ export type PublicActions<
|
|
1335
1335
|
* })
|
1336
1336
|
*/
|
1337
1337
|
prepareTransactionRequest: <
|
1338
|
-
|
1338
|
+
const TRequest extends PrepareTransactionRequestRequest<
|
1339
|
+
TChain,
|
1340
|
+
TChainOverride
|
1341
|
+
>,
|
1339
1342
|
TChainOverride extends Chain | undefined = undefined,
|
1340
1343
|
TAccountOverride extends Account | Address | undefined = undefined,
|
1341
1344
|
>(
|
@@ -1344,7 +1347,7 @@ export type PublicActions<
|
|
1344
1347
|
TAccount,
|
1345
1348
|
TChainOverride,
|
1346
1349
|
TAccountOverride,
|
1347
|
-
|
1350
|
+
TRequest
|
1348
1351
|
>,
|
1349
1352
|
) => Promise<
|
1350
1353
|
PrepareTransactionRequestReturnType<
|
@@ -1352,7 +1355,8 @@ export type PublicActions<
|
|
1352
1355
|
TAccount,
|
1353
1356
|
TChainOverride,
|
1354
1357
|
TAccountOverride,
|
1355
|
-
|
1358
|
+
// @ts-expect-error
|
1359
|
+
TRequest
|
1356
1360
|
>
|
1357
1361
|
>
|
1358
1362
|
/**
|
@@ -23,8 +23,8 @@ import {
|
|
23
23
|
getPermissions,
|
24
24
|
} from '../../actions/wallet/getPermissions.js'
|
25
25
|
import {
|
26
|
-
type PrepareTransactionRequestParameterType,
|
27
26
|
type PrepareTransactionRequestParameters,
|
27
|
+
type PrepareTransactionRequestRequest,
|
28
28
|
type PrepareTransactionRequestReturnType,
|
29
29
|
prepareTransactionRequest,
|
30
30
|
} from '../../actions/wallet/prepareTransactionRequest.js'
|
@@ -44,6 +44,7 @@ import {
|
|
44
44
|
} from '../../actions/wallet/sendRawTransaction.js'
|
45
45
|
import {
|
46
46
|
type SendTransactionParameters,
|
47
|
+
type SendTransactionRequest,
|
47
48
|
type SendTransactionReturnType,
|
48
49
|
sendTransaction,
|
49
50
|
} from '../../actions/wallet/sendTransaction.js'
|
@@ -234,7 +235,10 @@ export type WalletActions<
|
|
234
235
|
* })
|
235
236
|
*/
|
236
237
|
prepareTransactionRequest: <
|
237
|
-
|
238
|
+
const TRequest extends PrepareTransactionRequestRequest<
|
239
|
+
TChain,
|
240
|
+
TChainOverride
|
241
|
+
>,
|
238
242
|
TChainOverride extends Chain | undefined = undefined,
|
239
243
|
TAccountOverride extends Account | Address | undefined = undefined,
|
240
244
|
>(
|
@@ -243,7 +247,7 @@ export type WalletActions<
|
|
243
247
|
TAccount,
|
244
248
|
TChainOverride,
|
245
249
|
TAccountOverride,
|
246
|
-
|
250
|
+
TRequest
|
247
251
|
>,
|
248
252
|
) => Promise<
|
249
253
|
PrepareTransactionRequestReturnType<
|
@@ -251,7 +255,8 @@ export type WalletActions<
|
|
251
255
|
TAccount,
|
252
256
|
TChainOverride,
|
253
257
|
TAccountOverride,
|
254
|
-
|
258
|
+
// @ts-expect-error
|
259
|
+
TRequest
|
255
260
|
>
|
256
261
|
>
|
257
262
|
/**
|
@@ -370,8 +375,11 @@ export type WalletActions<
|
|
370
375
|
* value: 1000000000000000000n,
|
371
376
|
* })
|
372
377
|
*/
|
373
|
-
sendTransaction: <
|
374
|
-
|
378
|
+
sendTransaction: <
|
379
|
+
const TRequest extends SendTransactionRequest<TChain, TChainOverride>,
|
380
|
+
TChainOverride extends Chain | undefined = undefined,
|
381
|
+
>(
|
382
|
+
args: SendTransactionParameters<TChain, TAccount, TChainOverride, TRequest>,
|
375
383
|
) => Promise<SendTransactionReturnType>
|
376
384
|
/**
|
377
385
|
* Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
|
@@ -0,0 +1,21 @@
|
|
1
|
+
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters
|
2
|
+
|
3
|
+
/** Blob limit per transaction. */
|
4
|
+
export const blobsPerTransaction = 2
|
5
|
+
|
6
|
+
/** The number of bytes in a BLS scalar field element. */
|
7
|
+
export const bytesPerFieldElement = 32
|
8
|
+
|
9
|
+
/** The number of field elements in a blob. */
|
10
|
+
export const fieldElementsPerBlob = 4096
|
11
|
+
|
12
|
+
/** The number of bytes in a blob. */
|
13
|
+
export const bytesPerBlob = bytesPerFieldElement * fieldElementsPerBlob
|
14
|
+
|
15
|
+
/** Blob bytes limit per transaction. */
|
16
|
+
export const maxBytesPerTransaction =
|
17
|
+
bytesPerBlob * blobsPerTransaction -
|
18
|
+
// terminator byte (0x80).
|
19
|
+
1 -
|
20
|
+
// zero byte (0x00) appended to each field element.
|
21
|
+
1 * fieldElementsPerBlob * blobsPerTransaction
|
package/constants/kzg.ts
ADDED
@@ -0,0 +1,9 @@
|
|
1
|
+
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md#parameters
|
2
|
+
|
3
|
+
/** The number of bytes in a KZG commitment. */
|
4
|
+
export const bytesPerCommitment = 48
|
5
|
+
|
6
|
+
/** The number of bytes in a KZG proof. */
|
7
|
+
export const bytesPerProof = 48
|
8
|
+
|
9
|
+
export const versionedHashVersionKzg = 1
|