ox 1.0.0-beta.2 → 1.0.0-beta.20
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/dist/core/Abi.d.ts +6 -2
- package/dist/core/Abi.d.ts.map +1 -1
- package/dist/core/Abi.js +6 -3
- package/dist/core/Abi.js.map +1 -1
- package/dist/core/AbiConstructor.d.ts +2 -1
- package/dist/core/AbiConstructor.d.ts.map +1 -1
- package/dist/core/AbiConstructor.js +2 -2
- package/dist/core/AbiConstructor.js.map +1 -1
- package/dist/core/AbiError.d.ts +3 -1
- package/dist/core/AbiError.d.ts.map +1 -1
- package/dist/core/AbiError.js +2 -2
- package/dist/core/AbiError.js.map +1 -1
- package/dist/core/AbiEvent.d.ts +3 -1
- package/dist/core/AbiEvent.d.ts.map +1 -1
- package/dist/core/AbiEvent.js +2 -2
- package/dist/core/AbiEvent.js.map +1 -1
- package/dist/core/AbiFunction.d.ts +3 -1
- package/dist/core/AbiFunction.d.ts.map +1 -1
- package/dist/core/AbiFunction.js +2 -2
- package/dist/core/AbiFunction.js.map +1 -1
- package/dist/core/AbiItem.d.ts +6 -3
- package/dist/core/AbiItem.d.ts.map +1 -1
- package/dist/core/AbiItem.js +9 -7
- package/dist/core/AbiItem.js.map +1 -1
- package/dist/core/AbiParameter.d.ts +88 -0
- package/dist/core/AbiParameter.d.ts.map +1 -0
- package/dist/core/AbiParameter.js +82 -0
- package/dist/core/AbiParameter.js.map +1 -0
- package/dist/core/AbiParameters.d.ts +58 -2
- package/dist/core/AbiParameters.d.ts.map +1 -1
- package/dist/core/AbiParameters.js +60 -6
- package/dist/core/AbiParameters.js.map +1 -1
- package/dist/core/AccountProof.d.ts +3 -1
- package/dist/core/AccountProof.d.ts.map +1 -1
- package/dist/core/AccountProof.js +3 -4
- package/dist/core/AccountProof.js.map +1 -1
- package/dist/core/Authorization.d.ts +6 -2
- package/dist/core/Authorization.d.ts.map +1 -1
- package/dist/core/Authorization.js +3 -2
- package/dist/core/Authorization.js.map +1 -1
- package/dist/core/Block.d.ts +3 -1
- package/dist/core/Block.d.ts.map +1 -1
- package/dist/core/Block.js +12 -13
- package/dist/core/Block.js.map +1 -1
- package/dist/core/BlockOverrides.d.ts +5 -1
- package/dist/core/BlockOverrides.d.ts.map +1 -1
- package/dist/core/BlockOverrides.js +12 -12
- package/dist/core/BlockOverrides.js.map +1 -1
- package/dist/core/Filter.d.ts +3 -1
- package/dist/core/Filter.d.ts.map +1 -1
- package/dist/core/Filter.js +4 -4
- package/dist/core/Filter.js.map +1 -1
- package/dist/core/Log.d.ts +4 -2
- package/dist/core/Log.d.ts.map +1 -1
- package/dist/core/Log.js +4 -4
- package/dist/core/Log.js.map +1 -1
- package/dist/core/Rlp.d.ts +27 -5
- package/dist/core/Rlp.d.ts.map +1 -1
- package/dist/core/Rlp.js +40 -4
- package/dist/core/Rlp.js.map +1 -1
- package/dist/core/RpcSchema.d.ts +2 -2
- package/dist/core/Signature.d.ts +3 -1
- package/dist/core/Signature.d.ts.map +1 -1
- package/dist/core/Signature.js +2 -1
- package/dist/core/Signature.js.map +1 -1
- package/dist/core/StateOverrides.d.ts +5 -1
- package/dist/core/StateOverrides.d.ts.map +1 -1
- package/dist/core/StateOverrides.js +4 -4
- package/dist/core/StateOverrides.js.map +1 -1
- package/dist/core/Transaction.d.ts +3 -1
- package/dist/core/Transaction.d.ts.map +1 -1
- package/dist/core/Transaction.js +26 -26
- package/dist/core/Transaction.js.map +1 -1
- package/dist/core/TransactionReceipt.d.ts +3 -1
- package/dist/core/TransactionReceipt.d.ts.map +1 -1
- package/dist/core/TransactionReceipt.js +8 -8
- package/dist/core/TransactionReceipt.js.map +1 -1
- package/dist/core/TransactionRequest.d.ts +3 -1
- package/dist/core/TransactionRequest.d.ts.map +1 -1
- package/dist/core/TransactionRequest.js +11 -10
- package/dist/core/TransactionRequest.js.map +1 -1
- package/dist/core/TxEnvelope.d.ts +3 -1
- package/dist/core/TxEnvelope.d.ts.map +1 -1
- package/dist/core/TxEnvelope.js.map +1 -1
- package/dist/core/TxEnvelopeEip1559.d.ts +3 -1
- package/dist/core/TxEnvelopeEip1559.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip1559.js +12 -11
- package/dist/core/TxEnvelopeEip1559.js.map +1 -1
- package/dist/core/TxEnvelopeEip2930.d.ts +3 -1
- package/dist/core/TxEnvelopeEip2930.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip2930.js +10 -9
- package/dist/core/TxEnvelopeEip2930.js.map +1 -1
- package/dist/core/TxEnvelopeEip4844.d.ts +3 -1
- package/dist/core/TxEnvelopeEip4844.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip4844.js +16 -13
- package/dist/core/TxEnvelopeEip4844.js.map +1 -1
- package/dist/core/TxEnvelopeEip7702.d.ts +3 -1
- package/dist/core/TxEnvelopeEip7702.d.ts.map +1 -1
- package/dist/core/TxEnvelopeEip7702.js +12 -11
- package/dist/core/TxEnvelopeEip7702.js.map +1 -1
- package/dist/core/TxEnvelopeLegacy.d.ts +7 -1
- package/dist/core/TxEnvelopeLegacy.d.ts.map +1 -1
- package/dist/core/TxEnvelopeLegacy.js +9 -8
- package/dist/core/TxEnvelopeLegacy.js.map +1 -1
- package/dist/core/Withdrawal.d.ts +4 -2
- package/dist/core/Withdrawal.d.ts.map +1 -1
- package/dist/core/Withdrawal.js +4 -4
- package/dist/core/Withdrawal.js.map +1 -1
- package/dist/core/internal/abiParameters.d.ts.map +1 -1
- package/dist/core/internal/abiParameters.js +21 -3
- package/dist/core/internal/abiParameters.js.map +1 -1
- package/dist/core/internal/human-readable/errors.d.ts +103 -0
- package/dist/core/internal/human-readable/errors.d.ts.map +1 -0
- package/dist/core/internal/human-readable/errors.js +142 -0
- package/dist/core/internal/human-readable/errors.js.map +1 -0
- package/dist/core/internal/human-readable/formatAbi.d.ts +19 -0
- package/dist/core/internal/human-readable/formatAbi.d.ts.map +1 -0
- package/dist/core/internal/human-readable/formatAbi.js +18 -0
- package/dist/core/internal/human-readable/formatAbi.js.map +1 -0
- package/dist/core/internal/human-readable/formatAbiItem.d.ts +23 -0
- package/dist/core/internal/human-readable/formatAbiItem.d.ts.map +1 -0
- package/dist/core/internal/human-readable/formatAbiItem.js +25 -0
- package/dist/core/internal/human-readable/formatAbiItem.js.map +1 -0
- package/dist/core/internal/human-readable/formatAbiParameter.d.ts +41 -0
- package/dist/core/internal/human-readable/formatAbiParameter.d.ts.map +1 -0
- package/dist/core/internal/human-readable/formatAbiParameter.js +36 -0
- package/dist/core/internal/human-readable/formatAbiParameter.js.map +1 -0
- package/dist/core/internal/human-readable/formatAbiParameters.d.ts +26 -0
- package/dist/core/internal/human-readable/formatAbiParameters.d.ts.map +1 -0
- package/dist/core/internal/human-readable/formatAbiParameters.js +19 -0
- package/dist/core/internal/human-readable/formatAbiParameters.js.map +1 -0
- package/dist/core/internal/human-readable/parseAbi.d.ts +22 -0
- package/dist/core/internal/human-readable/parseAbi.d.ts.map +1 -0
- package/dist/core/internal/human-readable/parseAbi.js +22 -0
- package/dist/core/internal/human-readable/parseAbi.js.map +1 -0
- package/dist/core/internal/human-readable/parseAbiItem.d.ts +23 -0
- package/dist/core/internal/human-readable/parseAbiItem.d.ts.map +1 -0
- package/dist/core/internal/human-readable/parseAbiItem.js +30 -0
- package/dist/core/internal/human-readable/parseAbiItem.js.map +1 -0
- package/dist/core/internal/human-readable/parseAbiParameter.d.ts +28 -0
- package/dist/core/internal/human-readable/parseAbiParameter.d.ts.map +1 -0
- package/dist/core/internal/human-readable/parseAbiParameter.js +32 -0
- package/dist/core/internal/human-readable/parseAbiParameter.js.map +1 -0
- package/dist/core/internal/human-readable/parseAbiParameters.d.ts +38 -0
- package/dist/core/internal/human-readable/parseAbiParameters.d.ts.map +1 -0
- package/dist/core/internal/human-readable/parseAbiParameters.js +39 -0
- package/dist/core/internal/human-readable/parseAbiParameters.js.map +1 -0
- package/dist/core/internal/human-readable/regex.d.ts +9 -0
- package/dist/core/internal/human-readable/regex.d.ts.map +1 -0
- package/dist/core/internal/human-readable/regex.js +12 -0
- package/dist/core/internal/human-readable/regex.js.map +1 -0
- package/dist/core/internal/human-readable/runtime/cache.d.ts +22 -0
- package/dist/core/internal/human-readable/runtime/cache.d.ts.map +1 -0
- package/dist/core/internal/human-readable/runtime/cache.js +86 -0
- package/dist/core/internal/human-readable/runtime/cache.js.map +1 -0
- package/dist/core/internal/human-readable/runtime/signatures.d.ts +39 -0
- package/dist/core/internal/human-readable/runtime/signatures.d.ts.map +1 -0
- package/dist/core/internal/human-readable/runtime/signatures.js +67 -0
- package/dist/core/internal/human-readable/runtime/signatures.js.map +1 -0
- package/dist/core/internal/human-readable/runtime/structs.d.ts +3 -0
- package/dist/core/internal/human-readable/runtime/structs.d.ts.map +1 -0
- package/dist/core/internal/human-readable/runtime/structs.js +79 -0
- package/dist/core/internal/human-readable/runtime/structs.js.map +1 -0
- package/dist/core/internal/human-readable/runtime/utils.d.ts +205 -0
- package/dist/core/internal/human-readable/runtime/utils.d.ts.map +1 -0
- package/dist/core/internal/human-readable/runtime/utils.js +232 -0
- package/dist/core/internal/human-readable/runtime/utils.js.map +1 -0
- package/dist/core/internal/human-readable/types/signatures.d.ts +38 -0
- package/dist/core/internal/human-readable/types/signatures.d.ts.map +1 -0
- package/dist/core/internal/human-readable/types/signatures.js +2 -0
- package/dist/core/internal/human-readable/types/signatures.js.map +1 -0
- package/dist/core/internal/human-readable/types/structs.d.ts +48 -0
- package/dist/core/internal/human-readable/types/structs.d.ts.map +1 -0
- package/dist/core/internal/human-readable/types/structs.js +2 -0
- package/dist/core/internal/human-readable/types/structs.js.map +1 -0
- package/dist/core/internal/human-readable/types/utils.d.ts +163 -0
- package/dist/core/internal/human-readable/types/utils.d.ts.map +1 -0
- package/dist/core/internal/human-readable/types/utils.js +2 -0
- package/dist/core/internal/human-readable/types/utils.js.map +1 -0
- package/dist/core/internal/human-readable/types.d.ts +29 -0
- package/dist/core/internal/human-readable/types.d.ts.map +1 -0
- package/dist/core/internal/human-readable/types.js +2 -0
- package/dist/core/internal/human-readable/types.js.map +1 -0
- package/dist/core/internal/quantity.d.ts +15 -0
- package/dist/core/internal/quantity.d.ts.map +1 -1
- package/dist/core/internal/quantity.js +23 -0
- package/dist/core/internal/quantity.js.map +1 -1
- package/dist/core/internal/rpcSchemas/eth.d.ts +56 -10
- package/dist/core/internal/rpcSchemas/eth.d.ts.map +1 -1
- package/dist/erc4337/UserOperation.d.ts +3 -1
- package/dist/erc4337/UserOperation.d.ts.map +1 -1
- package/dist/erc4337/UserOperation.js +11 -10
- package/dist/erc4337/UserOperation.js.map +1 -1
- package/dist/erc4337/UserOperationGas.d.ts +5 -1
- package/dist/erc4337/UserOperationGas.d.ts.map +1 -1
- package/dist/erc4337/UserOperationGas.js +8 -8
- package/dist/erc4337/UserOperationGas.js.map +1 -1
- package/dist/erc4337/UserOperationReceipt.d.ts +5 -1
- package/dist/erc4337/UserOperationReceipt.d.ts.map +1 -1
- package/dist/erc4337/UserOperationReceipt.js +4 -4
- package/dist/erc4337/UserOperationReceipt.js.map +1 -1
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -1
- package/dist/tempo/AuthorizationTempo.d.ts +6 -2
- package/dist/tempo/AuthorizationTempo.d.ts.map +1 -1
- package/dist/tempo/AuthorizationTempo.js +3 -2
- package/dist/tempo/AuthorizationTempo.js.map +1 -1
- package/dist/tempo/Channel.d.ts +8 -14
- package/dist/tempo/Channel.d.ts.map +1 -1
- package/dist/tempo/Channel.js +4 -8
- package/dist/tempo/Channel.js.map +1 -1
- package/dist/tempo/KeyAuthorization.d.ts +8 -6
- package/dist/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/tempo/KeyAuthorization.js +10 -8
- package/dist/tempo/KeyAuthorization.js.map +1 -1
- package/dist/tempo/MultisigConfig.d.ts +37 -85
- package/dist/tempo/MultisigConfig.d.ts.map +1 -1
- package/dist/tempo/MultisigConfig.js +39 -83
- package/dist/tempo/MultisigConfig.js.map +1 -1
- package/dist/tempo/PoolId.d.ts +8 -7
- package/dist/tempo/PoolId.d.ts.map +1 -1
- package/dist/tempo/PoolId.js +10 -6
- package/dist/tempo/PoolId.js.map +1 -1
- package/dist/tempo/RpcSchemaTempo.d.ts +1 -1
- package/dist/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.d.ts +35 -31
- package/dist/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/tempo/SignatureEnvelope.js +56 -51
- package/dist/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/tempo/Transaction.d.ts +19 -6
- package/dist/tempo/Transaction.d.ts.map +1 -1
- package/dist/tempo/Transaction.js +41 -13
- package/dist/tempo/Transaction.js.map +1 -1
- package/dist/tempo/TransactionReceipt.d.ts +3 -1
- package/dist/tempo/TransactionReceipt.d.ts.map +1 -1
- package/dist/tempo/TransactionReceipt.js.map +1 -1
- package/dist/tempo/TransactionRequest.d.ts +18 -3
- package/dist/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/tempo/TransactionRequest.js +72 -35
- package/dist/tempo/TransactionRequest.js.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.d.ts +2 -3
- package/dist/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/tempo/TxEnvelopeTempo.js +5 -6
- package/dist/tempo/TxEnvelopeTempo.js.map +1 -1
- package/dist/tempo/index.d.ts +6 -26
- package/dist/tempo/index.d.ts.map +1 -1
- package/dist/tempo/index.js +6 -26
- package/dist/tempo/index.js.map +1 -1
- package/dist/zod/Abi.d.ts +214 -0
- package/dist/zod/Abi.d.ts.map +1 -0
- package/dist/zod/Abi.js +5 -0
- package/dist/zod/Abi.js.map +1 -0
- package/dist/zod/AbiConstructor.d.ts +58 -0
- package/dist/zod/AbiConstructor.d.ts.map +1 -0
- package/dist/zod/AbiConstructor.js +18 -0
- package/dist/zod/AbiConstructor.js.map +1 -0
- package/dist/zod/AbiError.d.ts +20 -0
- package/dist/zod/AbiError.d.ts.map +1 -0
- package/dist/zod/AbiError.js +9 -0
- package/dist/zod/AbiError.js.map +1 -0
- package/dist/zod/AbiEvent.d.ts +23 -0
- package/dist/zod/AbiEvent.d.ts.map +1 -0
- package/dist/zod/AbiEvent.js +11 -0
- package/dist/zod/AbiEvent.js.map +1 -0
- package/dist/zod/AbiFallback.d.ts +16 -0
- package/dist/zod/AbiFallback.d.ts.map +1 -0
- package/dist/zod/AbiFallback.js +16 -0
- package/dist/zod/AbiFallback.js.map +1 -0
- package/dist/zod/AbiFunction.d.ts +109 -0
- package/dist/zod/AbiFunction.d.ts.map +1 -0
- package/dist/zod/AbiFunction.js +26 -0
- package/dist/zod/AbiFunction.js.map +1 -0
- package/dist/zod/AbiItem.d.ts +216 -0
- package/dist/zod/AbiItem.d.ts.map +1 -0
- package/dist/zod/AbiItem.js +26 -0
- package/dist/zod/AbiItem.js.map +1 -0
- package/dist/zod/AbiParameter.d.ts +32 -0
- package/dist/zod/AbiParameter.d.ts.map +1 -0
- package/dist/zod/AbiParameter.js +28 -0
- package/dist/zod/AbiParameter.js.map +1 -0
- package/dist/zod/AbiParameters.d.ts +30 -0
- package/dist/zod/AbiParameters.d.ts.map +1 -0
- package/dist/zod/AbiParameters.js +6 -0
- package/dist/zod/AbiParameters.js.map +1 -0
- package/dist/zod/AbiReceive.d.ts +6 -0
- package/dist/zod/AbiReceive.d.ts.map +1 -0
- package/dist/zod/AbiReceive.js +7 -0
- package/dist/zod/AbiReceive.js.map +1 -0
- package/dist/zod/AccountProof.d.ts +20 -0
- package/dist/zod/AccountProof.d.ts.map +1 -1
- package/dist/zod/AccountProof.js +24 -14
- package/dist/zod/AccountProof.js.map +1 -1
- package/dist/zod/Authorization.d.ts +43 -0
- package/dist/zod/Authorization.d.ts.map +1 -1
- package/dist/zod/Authorization.js +36 -16
- package/dist/zod/Authorization.js.map +1 -1
- package/dist/zod/BigInt.d.ts +2 -0
- package/dist/zod/BigInt.d.ts.map +1 -1
- package/dist/zod/BigInt.js +6 -1
- package/dist/zod/BigInt.js.map +1 -1
- package/dist/zod/Block.d.ts +219 -0
- package/dist/zod/Block.d.ts.map +1 -1
- package/dist/zod/Block.js +24 -20
- package/dist/zod/Block.js.map +1 -1
- package/dist/zod/BlockOverrides.d.ts +16 -0
- package/dist/zod/BlockOverrides.d.ts.map +1 -1
- package/dist/zod/BlockOverrides.js +15 -10
- package/dist/zod/BlockOverrides.js.map +1 -1
- package/dist/zod/Filter.d.ts +14 -0
- package/dist/zod/Filter.d.ts.map +1 -1
- package/dist/zod/Filter.js +24 -19
- package/dist/zod/Filter.js.map +1 -1
- package/dist/zod/Log.d.ts +15 -2
- package/dist/zod/Log.d.ts.map +1 -1
- package/dist/zod/Log.js +18 -13
- package/dist/zod/Log.js.map +1 -1
- package/dist/zod/Number.d.ts +2 -0
- package/dist/zod/Number.d.ts.map +1 -1
- package/dist/zod/Number.js +6 -1
- package/dist/zod/Number.js.map +1 -1
- package/dist/zod/RpcSchema.d.ts +318 -112
- package/dist/zod/RpcSchema.d.ts.map +1 -1
- package/dist/zod/RpcSchema.js +30 -82
- package/dist/zod/RpcSchema.js.map +1 -1
- package/dist/zod/Signature.d.ts +6 -0
- package/dist/zod/Signature.d.ts.map +1 -1
- package/dist/zod/Signature.js +9 -1
- package/dist/zod/Signature.js.map +1 -1
- package/dist/zod/Solidity.d.ts +15 -0
- package/dist/zod/Solidity.d.ts.map +1 -0
- package/dist/zod/Solidity.js +41 -0
- package/dist/zod/Solidity.js.map +1 -0
- package/dist/zod/StateOverrides.d.ts +32 -0
- package/dist/zod/StateOverrides.d.ts.map +1 -1
- package/dist/zod/StateOverrides.js +25 -18
- package/dist/zod/StateOverrides.js.map +1 -1
- package/dist/zod/Transaction.d.ts +312 -0
- package/dist/zod/Transaction.d.ts.map +1 -1
- package/dist/zod/Transaction.js +138 -93
- package/dist/zod/Transaction.js.map +1 -1
- package/dist/zod/TransactionEnvelope.d.ts +222 -0
- package/dist/zod/TransactionEnvelope.d.ts.map +1 -1
- package/dist/zod/TransactionEnvelope.js +19 -3
- package/dist/zod/TransactionEnvelope.js.map +1 -1
- package/dist/zod/TransactionReceipt.d.ts +32 -1
- package/dist/zod/TransactionReceipt.d.ts.map +1 -1
- package/dist/zod/TransactionReceipt.js +24 -19
- package/dist/zod/TransactionReceipt.js.map +1 -1
- package/dist/zod/TransactionRequest.d.ts +34 -0
- package/dist/zod/TransactionRequest.d.ts.map +1 -1
- package/dist/zod/TransactionRequest.js +28 -23
- package/dist/zod/TransactionRequest.js.map +1 -1
- package/dist/zod/TxEnvelopeEip1559.d.ts +44 -0
- package/dist/zod/TxEnvelopeEip1559.d.ts.map +1 -1
- package/dist/zod/TxEnvelopeEip1559.js +23 -14
- package/dist/zod/TxEnvelopeEip1559.js.map +1 -1
- package/dist/zod/TxEnvelopeEip2930.d.ts +42 -0
- package/dist/zod/TxEnvelopeEip2930.d.ts.map +1 -1
- package/dist/zod/TxEnvelopeEip2930.js +21 -12
- package/dist/zod/TxEnvelopeEip2930.js.map +1 -1
- package/dist/zod/TxEnvelopeEip4844.d.ts +58 -0
- package/dist/zod/TxEnvelopeEip4844.d.ts.map +1 -1
- package/dist/zod/TxEnvelopeEip4844.js +29 -20
- package/dist/zod/TxEnvelopeEip4844.js.map +1 -1
- package/dist/zod/TxEnvelopeEip7702.d.ts +60 -0
- package/dist/zod/TxEnvelopeEip7702.d.ts.map +1 -1
- package/dist/zod/TxEnvelopeEip7702.js +25 -16
- package/dist/zod/TxEnvelopeEip7702.js.map +1 -1
- package/dist/zod/TxEnvelopeLegacy.d.ts +34 -0
- package/dist/zod/TxEnvelopeLegacy.d.ts.map +1 -1
- package/dist/zod/TxEnvelopeLegacy.js +19 -10
- package/dist/zod/TxEnvelopeLegacy.js.map +1 -1
- package/dist/zod/TypedData.d.ts +226 -0
- package/dist/zod/TypedData.d.ts.map +1 -0
- package/dist/zod/TypedData.js +84 -0
- package/dist/zod/TypedData.js.map +1 -0
- package/dist/zod/Uint.d.ts +4 -0
- package/dist/zod/Uint.d.ts.map +1 -1
- package/dist/zod/Uint.js +14 -1
- package/dist/zod/Uint.js.map +1 -1
- package/dist/zod/Withdrawal.d.ts +7 -0
- package/dist/zod/Withdrawal.d.ts.map +1 -1
- package/dist/zod/Withdrawal.js +11 -6
- package/dist/zod/Withdrawal.js.map +1 -1
- package/dist/zod/internal/Integer.d.ts +15 -0
- package/dist/zod/internal/Integer.d.ts.map +1 -1
- package/dist/zod/internal/Integer.js +39 -0
- package/dist/zod/internal/Integer.js.map +1 -1
- package/dist/zod/internal/TransactionEnvelope.d.ts +38 -28
- package/dist/zod/internal/TransactionEnvelope.d.ts.map +1 -1
- package/dist/zod/internal/TransactionEnvelope.js +22 -15
- package/dist/zod/internal/TransactionEnvelope.js.map +1 -1
- package/dist/zod/internal/rpcSchemas/Eth.d.ts +260 -123
- package/dist/zod/internal/rpcSchemas/Eth.d.ts.map +1 -1
- package/dist/zod/internal/rpcSchemas/Eth.js +17 -6
- package/dist/zod/internal/rpcSchemas/Eth.js.map +1 -1
- package/dist/zod/internal/rpcSchemas/Wallet.d.ts +1 -1
- package/dist/zod/tempo/AuthorizationTempo.d.ts +405 -12
- package/dist/zod/tempo/AuthorizationTempo.d.ts.map +1 -1
- package/dist/zod/tempo/AuthorizationTempo.js +20 -0
- package/dist/zod/tempo/AuthorizationTempo.js.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.d.ts +838 -69
- package/dist/zod/tempo/KeyAuthorization.d.ts.map +1 -1
- package/dist/zod/tempo/KeyAuthorization.js +49 -8
- package/dist/zod/tempo/KeyAuthorization.js.map +1 -1
- package/dist/zod/tempo/RpcSchemaTempo.d.ts +218 -36
- package/dist/zod/tempo/RpcSchemaTempo.d.ts.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.d.ts +0 -6
- package/dist/zod/tempo/SignatureEnvelope.d.ts.map +1 -1
- package/dist/zod/tempo/SignatureEnvelope.js +0 -2
- package/dist/zod/tempo/SignatureEnvelope.js.map +1 -1
- package/dist/zod/tempo/Transaction.d.ts +2203 -192
- package/dist/zod/tempo/Transaction.d.ts.map +1 -1
- package/dist/zod/tempo/Transaction.js +113 -33
- package/dist/zod/tempo/Transaction.js.map +1 -1
- package/dist/zod/tempo/TransactionReceipt.d.ts +34 -1
- package/dist/zod/tempo/TransactionReceipt.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionReceipt.js +26 -21
- package/dist/zod/tempo/TransactionReceipt.js.map +1 -1
- package/dist/zod/tempo/TransactionRequest.d.ts +1049 -57
- package/dist/zod/tempo/TransactionRequest.d.ts.map +1 -1
- package/dist/zod/tempo/TransactionRequest.js +141 -26
- package/dist/zod/tempo/TransactionRequest.js.map +1 -1
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts +225 -18
- package/dist/zod/tempo/TxEnvelopeTempo.d.ts.map +1 -1
- package/dist/zod/tempo/TxEnvelopeTempo.js +1 -1
- package/dist/zod/tempo/TxEnvelopeTempo.js.map +1 -1
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts +0 -3
- package/dist/zod/tempo/ZoneRpcAuthentication.d.ts.map +1 -1
- package/dist/zod/tempo/z.d.ts +0 -1
- package/dist/zod/tempo/z.d.ts.map +1 -1
- package/dist/zod/tempo/z.js +0 -1
- package/dist/zod/tempo/z.js.map +1 -1
- package/dist/zod/z.d.ts +15 -3
- package/dist/zod/z.d.ts.map +1 -1
- package/dist/zod/z.js +15 -3
- package/dist/zod/z.js.map +1 -1
- package/package.json +66 -11
- package/src/CHANGELOG.md +18 -0
- package/src/core/Abi.bench.ts +30 -0
- package/src/core/Abi.ts +13 -4
- package/src/core/AbiConstructor.ts +3 -2
- package/src/core/AbiError.ts +6 -2
- package/src/core/AbiEvent.ts +6 -2
- package/src/core/AbiFunction.ts +6 -2
- package/src/core/AbiItem.bench.ts +19 -0
- package/src/core/AbiItem.ts +20 -10
- package/src/core/AbiParameter.bench.ts +35 -0
- package/src/core/AbiParameter.ts +126 -0
- package/src/core/AbiParameters.bench.ts +22 -0
- package/src/core/AbiParameters.ts +77 -8
- package/src/core/AccountProof.ts +7 -4
- package/src/core/Authorization.ts +11 -4
- package/src/core/Block.ts +24 -13
- package/src/core/BlockOverrides.ts +18 -13
- package/src/core/Filter.ts +8 -5
- package/src/core/Log.ts +10 -6
- package/src/core/Rlp.ts +66 -3
- package/src/core/RpcSchema.ts +2 -2
- package/src/core/Signature.ts +6 -2
- package/src/core/StateOverrides.ts +10 -5
- package/src/core/Transaction.ts +37 -26
- package/src/core/TransactionReceipt.ts +17 -8
- package/src/core/TransactionRequest.ts +21 -11
- package/src/core/TxEnvelope.ts +9 -2
- package/src/core/TxEnvelopeEip1559.ts +21 -12
- package/src/core/TxEnvelopeEip2930.ts +17 -10
- package/src/core/TxEnvelopeEip4844.ts +25 -14
- package/src/core/TxEnvelopeEip7702.ts +21 -12
- package/src/core/TxEnvelopeLegacy.ts +20 -9
- package/src/core/Withdrawal.ts +9 -5
- package/src/core/_test/Abi.test.ts +4 -0
- package/src/core/_test/AbiItem.test.ts +3 -0
- package/src/core/_test/AbiParameter.test-d.ts +41 -0
- package/src/core/_test/AbiParameter.test.ts +84 -0
- package/src/core/_test/AbiParameters.decode.test.ts +88 -12
- package/src/core/_test/AbiParameters.encode.test.ts +68 -0
- package/src/core/_test/AbiParameters.test.ts +7 -0
- package/src/core/_test/AccountProof.test.ts +56 -0
- package/src/core/_test/Authorization.test.ts +29 -0
- package/src/core/_test/Block.test.ts +98 -0
- package/src/core/_test/BlockOverrides.test.ts +50 -0
- package/src/core/_test/Filter.test.ts +32 -0
- package/src/core/_test/Log.test.ts +42 -0
- package/src/core/_test/Rlp.test.ts +101 -0
- package/src/core/_test/RpcSchema.test-d.ts +12 -0
- package/src/core/_test/Signature.test.ts +14 -0
- package/src/core/_test/StateOverrides.test.ts +51 -0
- package/src/core/_test/Transaction.test.ts +64 -0
- package/src/core/_test/TransactionEnvelopeEip1559.test.ts +41 -0
- package/src/core/_test/TransactionEnvelopeEip2930.test.ts +38 -0
- package/src/core/_test/TransactionEnvelopeEip4844.test.ts +47 -0
- package/src/core/_test/TransactionEnvelopeEip7702.test.ts +71 -0
- package/src/core/_test/TransactionEnvelopeLegacy.test.ts +38 -0
- package/src/core/_test/TransactionReceipt.test.ts +54 -0
- package/src/core/_test/Withdrawal.test.ts +33 -0
- package/src/core/_test/index.test.ts +1 -0
- package/src/core/internal/abiParameters.ts +21 -3
- package/src/core/internal/human-readable/_snap/formatAbi.test.ts.snap +74 -0
- package/src/core/internal/human-readable/_snap/parseAbi.test.ts.snap +2353 -0
- package/src/core/internal/human-readable/errors.test.ts +258 -0
- package/src/core/internal/human-readable/errors.ts +205 -0
- package/src/core/internal/human-readable/formatAbi.test-d.ts +144 -0
- package/src/core/internal/human-readable/formatAbi.test.ts +23 -0
- package/src/core/internal/human-readable/formatAbi.ts +37 -0
- package/src/core/internal/human-readable/formatAbiItem.test-d.ts +115 -0
- package/src/core/internal/human-readable/formatAbiItem.test.ts +102 -0
- package/src/core/internal/human-readable/formatAbiItem.ts +136 -0
- package/src/core/internal/human-readable/formatAbiParameter.test-d.ts +125 -0
- package/src/core/internal/human-readable/formatAbiParameter.test.ts +126 -0
- package/src/core/internal/human-readable/formatAbiParameter.ts +86 -0
- package/src/core/internal/human-readable/formatAbiParameters.test-d.ts +92 -0
- package/src/core/internal/human-readable/formatAbiParameters.test.ts +32 -0
- package/src/core/internal/human-readable/formatAbiParameters.ts +46 -0
- package/src/core/internal/human-readable/human-readable.bench-d.ts +58 -0
- package/src/core/internal/human-readable/integration.test.ts +68 -0
- package/src/core/internal/human-readable/parseAbi.test-d.ts +188 -0
- package/src/core/internal/human-readable/parseAbi.test.ts +82 -0
- package/src/core/internal/human-readable/parseAbi.ts +59 -0
- package/src/core/internal/human-readable/parseAbiItem.test-d.ts +183 -0
- package/src/core/internal/human-readable/parseAbiItem.test.ts +264 -0
- package/src/core/internal/human-readable/parseAbiItem.ts +91 -0
- package/src/core/internal/human-readable/parseAbiParameter.test-d.ts +68 -0
- package/src/core/internal/human-readable/parseAbiParameter.test.ts +207 -0
- package/src/core/internal/human-readable/parseAbiParameter.ts +95 -0
- package/src/core/internal/human-readable/parseAbiParameters.test-d.ts +160 -0
- package/src/core/internal/human-readable/parseAbiParameters.test.ts +80 -0
- package/src/core/internal/human-readable/parseAbiParameters.ts +123 -0
- package/src/core/internal/human-readable/regex.ts +15 -0
- package/src/core/internal/human-readable/runtime/cache.ts +96 -0
- package/src/core/internal/human-readable/runtime/signatures.test.ts +236 -0
- package/src/core/internal/human-readable/runtime/signatures.ts +106 -0
- package/src/core/internal/human-readable/runtime/structs.test.ts +210 -0
- package/src/core/internal/human-readable/runtime/structs.ts +97 -0
- package/src/core/internal/human-readable/runtime/utils.test.ts +717 -0
- package/src/core/internal/human-readable/runtime/utils.ts +344 -0
- package/src/core/internal/human-readable/types/signatures.test-d.ts +255 -0
- package/src/core/internal/human-readable/types/signatures.ts +369 -0
- package/src/core/internal/human-readable/types/structs.test-d.ts +221 -0
- package/src/core/internal/human-readable/types/structs.ts +88 -0
- package/src/core/internal/human-readable/types/utils.test-d.ts +1029 -0
- package/src/core/internal/human-readable/types/utils.ts +392 -0
- package/src/core/internal/human-readable/types.ts +69 -0
- package/src/core/internal/quantity.ts +29 -0
- package/src/core/internal/rpcSchemas/eth.ts +76 -10
- package/src/erc4337/UserOperation.ts +26 -11
- package/src/erc4337/UserOperationGas.ts +19 -8
- package/src/erc4337/UserOperationReceipt.ts +14 -4
- package/src/index.ts +38 -0
- package/src/tempo/AuthorizationTempo.ts +11 -4
- package/src/tempo/Channel.test.ts +2 -23
- package/src/tempo/Channel.ts +10 -22
- package/src/tempo/KeyAuthorization.test.ts +22 -0
- package/src/tempo/KeyAuthorization.ts +20 -14
- package/src/tempo/MultisigConfig.test.ts +54 -37
- package/src/tempo/MultisigConfig.ts +59 -134
- package/src/tempo/PoolId.test.ts +7 -41
- package/src/tempo/PoolId.ts +15 -10
- package/src/tempo/RpcSchemaTempo.ts +1 -1
- package/src/tempo/SignatureEnvelope.test.ts +118 -17
- package/src/tempo/SignatureEnvelope.ts +81 -73
- package/src/tempo/Transaction.test.ts +0 -15
- package/src/tempo/Transaction.ts +78 -19
- package/src/tempo/TransactionReceipt.ts +9 -1
- package/src/tempo/TransactionRequest.test.ts +174 -1
- package/src/tempo/TransactionRequest.ts +98 -39
- package/src/tempo/TxEnvelopeTempo.test.ts +2 -2
- package/src/tempo/TxEnvelopeTempo.ts +7 -7
- package/src/tempo/e2e.test.ts +221 -43
- package/src/tempo/index.ts +6 -26
- package/src/version.ts +1 -1
- package/src/zod/Abi.ts +5 -0
- package/src/zod/AbiConstructor.ts +24 -0
- package/src/zod/AbiError.ts +9 -0
- package/src/zod/AbiEvent.ts +11 -0
- package/src/zod/AbiFallback.ts +22 -0
- package/src/zod/AbiFunction.ts +32 -0
- package/src/zod/AbiItem.ts +28 -0
- package/src/zod/AbiParameter.ts +36 -0
- package/src/zod/AbiParameters.ts +7 -0
- package/src/zod/AbiReceive.ts +7 -0
- package/src/zod/AccountProof.ts +36 -14
- package/src/zod/Authorization.ts +65 -18
- package/src/zod/BigInt.ts +12 -1
- package/src/zod/Block.ts +68 -26
- package/src/zod/BlockOverrides.ts +24 -10
- package/src/zod/Filter.ts +26 -21
- package/src/zod/Log.ts +23 -13
- package/src/zod/Number.ts +12 -1
- package/src/zod/RpcSchema.ts +123 -29
- package/src/zod/Signature.ts +18 -3
- package/src/zod/Solidity.ts +83 -0
- package/src/zod/StateOverrides.ts +31 -19
- package/src/zod/Transaction.ts +254 -101
- package/src/zod/TransactionEnvelope.ts +27 -3
- package/src/zod/TransactionReceipt.ts +34 -19
- package/src/zod/TransactionRequest.ts +42 -23
- package/src/zod/TxEnvelopeEip1559.ts +34 -13
- package/src/zod/TxEnvelopeEip2930.ts +32 -11
- package/src/zod/TxEnvelopeEip4844.ts +40 -19
- package/src/zod/TxEnvelopeEip7702.ts +46 -15
- package/src/zod/TxEnvelopeLegacy.ts +30 -9
- package/src/zod/TypedData.ts +111 -0
- package/src/zod/Uint.ts +19 -0
- package/src/zod/Withdrawal.ts +18 -6
- package/src/zod/_test/Abi.test-d.ts +46 -0
- package/src/zod/_test/Abi.test.ts +163 -0
- package/src/zod/_test/AccountProof.test.ts +32 -0
- package/src/zod/_test/Authorization.test.ts +42 -0
- package/src/zod/_test/BigInt.test.ts +9 -1
- package/src/zod/_test/Block.test.ts +54 -0
- package/src/zod/_test/BlockOverrides.test.ts +35 -0
- package/src/zod/_test/Filter.test.ts +34 -0
- package/src/zod/_test/Log.test.ts +49 -0
- package/src/zod/_test/Number.test.ts +8 -1
- package/src/zod/_test/RpcSchema.test-d.ts +46 -0
- package/src/zod/_test/RpcSchema.test.ts +70 -0
- package/src/zod/_test/Signature.test.ts +10 -0
- package/src/zod/_test/StateOverrides.test.ts +26 -0
- package/src/zod/_test/Transaction.test.ts +30 -0
- package/src/zod/_test/TransactionEnvelope.test.ts +34 -0
- package/src/zod/_test/TransactionReceipt.test.ts +45 -1
- package/src/zod/_test/TransactionRequest.test.ts +31 -0
- package/src/zod/_test/TxEnvelope.test.ts +32 -0
- package/src/zod/_test/TypedData.test-d.ts +20 -0
- package/src/zod/_test/TypedData.test.ts +87 -0
- package/src/zod/_test/Uint.test.ts +15 -0
- package/src/zod/_test/Withdrawal.test.ts +35 -0
- package/src/zod/_test/z.test-d.ts +6 -0
- package/src/zod/_test/z.test.ts +17 -0
- package/src/zod/internal/Integer.ts +58 -0
- package/src/zod/internal/TransactionEnvelope.ts +33 -17
- package/src/zod/internal/rpcSchemas/Eth.ts +20 -6
- package/src/zod/tempo/AuthorizationTempo.ts +25 -0
- package/src/zod/tempo/KeyAuthorization.ts +58 -8
- package/src/zod/tempo/SignatureEnvelope.ts +0 -2
- package/src/zod/tempo/Transaction.ts +148 -33
- package/src/zod/tempo/TransactionReceipt.ts +36 -21
- package/src/zod/tempo/TransactionRequest.ts +154 -28
- package/src/zod/tempo/TxEnvelopeTempo.ts +1 -1
- package/src/zod/tempo/_test/AuthorizationTempo.test.ts +24 -0
- package/src/zod/tempo/_test/KeyAuthorization.test.ts +85 -0
- package/src/zod/tempo/_test/SignatureEnvelope.test.ts +0 -2
- package/src/zod/tempo/_test/Transaction.test.ts +178 -0
- package/src/zod/tempo/_test/TransactionReceipt.test.ts +26 -0
- package/src/zod/tempo/_test/TransactionRequest.test.ts +73 -0
- package/src/zod/tempo/z.ts +0 -1
- package/src/zod/z.ts +16 -2
- package/dist/tempo/TokenId.d.ts +0 -87
- package/dist/tempo/TokenId.d.ts.map +0 -1
- package/dist/tempo/TokenId.js +0 -123
- package/dist/tempo/TokenId.js.map +0 -1
- package/dist/zod/tempo/TokenId.d.ts +0 -6
- package/dist/zod/tempo/TokenId.d.ts.map +0 -1
- package/dist/zod/tempo/TokenId.js +0 -14
- package/dist/zod/tempo/TokenId.js.map +0 -1
- package/src/tempo/TokenId.bench.ts +0 -36
- package/src/tempo/TokenId.test.ts +0 -79
- package/src/tempo/TokenId.ts +0 -141
- package/src/zod/tempo/TokenId.ts +0 -15
- package/src/zod/tempo/_test/TokenId.test-d.ts +0 -17
- package/src/zod/tempo/_test/TokenId.test.ts +0 -21
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { AbiParameter } from 'ox'
|
|
2
|
+
import { describe, expectTypeOf, test } from 'vp/test'
|
|
3
|
+
|
|
4
|
+
describe('AbiParameter.format', () => {
|
|
5
|
+
test('infers parameter', () => {
|
|
6
|
+
const formatted = AbiParameter.format(value)
|
|
7
|
+
expectTypeOf(formatted).toEqualTypeOf<'address spender'>()
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
test('not narrowable', () => {
|
|
11
|
+
const formatted = AbiParameter.format({} as AbiParameter.AbiParameter)
|
|
12
|
+
expectTypeOf(formatted).toEqualTypeOf<string>()
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const value = {
|
|
16
|
+
name: 'spender',
|
|
17
|
+
type: 'address',
|
|
18
|
+
} as const
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
describe('AbiParameter.from', () => {
|
|
22
|
+
test('infers parameter', () => {
|
|
23
|
+
const parameter = AbiParameter.from(value)
|
|
24
|
+
expectTypeOf(parameter).toEqualTypeOf(value)
|
|
25
|
+
})
|
|
26
|
+
|
|
27
|
+
test('from signature', () => {
|
|
28
|
+
const parameter = AbiParameter.from('address spender')
|
|
29
|
+
expectTypeOf(parameter).toEqualTypeOf(value)
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
test('not narrowable', () => {
|
|
33
|
+
const parameter = AbiParameter.from({} as AbiParameter.AbiParameter)
|
|
34
|
+
expectTypeOf(parameter).toEqualTypeOf<AbiParameter.AbiParameter>()
|
|
35
|
+
})
|
|
36
|
+
|
|
37
|
+
const value = {
|
|
38
|
+
name: 'spender',
|
|
39
|
+
type: 'address',
|
|
40
|
+
} as const
|
|
41
|
+
})
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { AbiParameter } from 'ox'
|
|
2
|
+
import { describe, expect, test } from 'vp/test'
|
|
3
|
+
|
|
4
|
+
describe('from', () => {
|
|
5
|
+
test('json parameter', () => {
|
|
6
|
+
expect(AbiParameter.from({ name: 'spender', type: 'address' }))
|
|
7
|
+
.toMatchInlineSnapshot(`
|
|
8
|
+
{
|
|
9
|
+
"name": "spender",
|
|
10
|
+
"type": "address",
|
|
11
|
+
}
|
|
12
|
+
`)
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
test('human-readable parameter', () => {
|
|
16
|
+
expect(AbiParameter.from('address spender')).toMatchInlineSnapshot(`
|
|
17
|
+
{
|
|
18
|
+
"name": "spender",
|
|
19
|
+
"type": "address",
|
|
20
|
+
}
|
|
21
|
+
`)
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
test('human-readable parameter with structs', () => {
|
|
25
|
+
expect(
|
|
26
|
+
AbiParameter.from([
|
|
27
|
+
'struct Foo { address spender; uint256 amount; }',
|
|
28
|
+
'Foo foo',
|
|
29
|
+
]),
|
|
30
|
+
).toMatchInlineSnapshot(`
|
|
31
|
+
{
|
|
32
|
+
"components": [
|
|
33
|
+
{
|
|
34
|
+
"name": "spender",
|
|
35
|
+
"type": "address",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"name": "amount",
|
|
39
|
+
"type": "uint256",
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
"name": "foo",
|
|
43
|
+
"type": "tuple",
|
|
44
|
+
}
|
|
45
|
+
`)
|
|
46
|
+
})
|
|
47
|
+
})
|
|
48
|
+
|
|
49
|
+
describe('format', () => {
|
|
50
|
+
test('parameter', () => {
|
|
51
|
+
expect(
|
|
52
|
+
AbiParameter.format({ name: 'spender', type: 'address' }),
|
|
53
|
+
).toMatchInlineSnapshot(`"address spender"`)
|
|
54
|
+
})
|
|
55
|
+
|
|
56
|
+
test('tuple parameter', () => {
|
|
57
|
+
expect(
|
|
58
|
+
AbiParameter.format({
|
|
59
|
+
components: [
|
|
60
|
+
{ name: 'spender', type: 'address' },
|
|
61
|
+
{ name: 'amount', type: 'uint256' },
|
|
62
|
+
],
|
|
63
|
+
name: 'foo',
|
|
64
|
+
type: 'tuple',
|
|
65
|
+
}),
|
|
66
|
+
).toMatchInlineSnapshot(`"(address spender, uint256 amount) foo"`)
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
test('exports', () => {
|
|
71
|
+
expect(Object.keys(AbiParameter)).toMatchInlineSnapshot(`
|
|
72
|
+
[
|
|
73
|
+
"InvalidAbiParameterError",
|
|
74
|
+
"InvalidAbiTypeParameterError",
|
|
75
|
+
"InvalidFunctionModifierError",
|
|
76
|
+
"InvalidModifierError",
|
|
77
|
+
"InvalidParameterError",
|
|
78
|
+
"SolidityProtectedKeywordError",
|
|
79
|
+
"InvalidParenthesisError",
|
|
80
|
+
"format",
|
|
81
|
+
"from",
|
|
82
|
+
]
|
|
83
|
+
`)
|
|
84
|
+
})
|
|
@@ -1601,22 +1601,12 @@ test('zst', () => {
|
|
|
1601
1601
|
expect(() =>
|
|
1602
1602
|
AbiParameters.decode([{ type: 'uint256[0][4294967295]' }], payload),
|
|
1603
1603
|
).toThrowErrorMatchingInlineSnapshot(
|
|
1604
|
-
`
|
|
1605
|
-
[AbiParameters.DataSizeTooSmallError: Data size of 64 bytes is too small for given parameters.
|
|
1606
|
-
|
|
1607
|
-
Params: (uint256[0][4294967295])
|
|
1608
|
-
Data: 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000FFFFFFFF (64 bytes)]
|
|
1609
|
-
`,
|
|
1604
|
+
'[Cursor.RecursiveReadLimitExceededError: Recursive read limit of `8192` exceeded (recursive read count: `8193`).]',
|
|
1610
1605
|
)
|
|
1611
1606
|
expect(() =>
|
|
1612
1607
|
AbiParameters.decode([{ type: 'uint32[0][4294967295]' }], payload),
|
|
1613
1608
|
).toThrowErrorMatchingInlineSnapshot(
|
|
1614
|
-
`
|
|
1615
|
-
[AbiParameters.DataSizeTooSmallError: Data size of 64 bytes is too small for given parameters.
|
|
1616
|
-
|
|
1617
|
-
Params: (uint32[0][4294967295])
|
|
1618
|
-
Data: 0x000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000FFFFFFFF (64 bytes)]
|
|
1619
|
-
`,
|
|
1609
|
+
'[Cursor.RecursiveReadLimitExceededError: Recursive read limit of `8192` exceeded (recursive read count: `8193`).]',
|
|
1620
1610
|
)
|
|
1621
1611
|
expect(() =>
|
|
1622
1612
|
AbiParameters.decode(
|
|
@@ -1798,3 +1788,89 @@ test('recursive 2', () => {
|
|
|
1798
1788
|
'[Cursor.RecursiveReadLimitExceededError: Recursive read limit of `8192` exceeded (recursive read count: `8193`).]',
|
|
1799
1789
|
)
|
|
1800
1790
|
})
|
|
1791
|
+
|
|
1792
|
+
describe('zero-width types', () => {
|
|
1793
|
+
test('zero-length fixed array', () => {
|
|
1794
|
+
expect(
|
|
1795
|
+
AbiParameters.decode(
|
|
1796
|
+
[{ type: 'uint256[0]' }, { type: 'uint256' }],
|
|
1797
|
+
'0x0000000000000000000000000000000000000000000000000000000000000003',
|
|
1798
|
+
),
|
|
1799
|
+
).toEqual([[], 3n])
|
|
1800
|
+
})
|
|
1801
|
+
|
|
1802
|
+
test('trailing empty tuple', () => {
|
|
1803
|
+
expect(
|
|
1804
|
+
AbiParameters.decode(
|
|
1805
|
+
[{ type: 'uint256' }, { type: 'tuple', components: [] }],
|
|
1806
|
+
'0x0000000000000000000000000000000000000000000000000000000000000005',
|
|
1807
|
+
),
|
|
1808
|
+
).toEqual([5n, []])
|
|
1809
|
+
})
|
|
1810
|
+
|
|
1811
|
+
test('zero-length fixed array of dynamic type', () => {
|
|
1812
|
+
expect(
|
|
1813
|
+
AbiParameters.decode(
|
|
1814
|
+
[{ type: 'string[0]' }, { type: 'uint256' }],
|
|
1815
|
+
'0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003',
|
|
1816
|
+
),
|
|
1817
|
+
).toEqual([[], 3n])
|
|
1818
|
+
})
|
|
1819
|
+
|
|
1820
|
+
test('standalone zero-length fixed array of dynamic type', () => {
|
|
1821
|
+
// The head is a single offset word pointing at an empty tail.
|
|
1822
|
+
expect(
|
|
1823
|
+
AbiParameters.decode(
|
|
1824
|
+
[{ type: 'string[0]' }],
|
|
1825
|
+
'0x0000000000000000000000000000000000000000000000000000000000000020',
|
|
1826
|
+
),
|
|
1827
|
+
).toEqual([[]])
|
|
1828
|
+
expect(
|
|
1829
|
+
AbiParameters.decode(
|
|
1830
|
+
[{ type: 'bytes[0]' }],
|
|
1831
|
+
'0x0000000000000000000000000000000000000000000000000000000000000020',
|
|
1832
|
+
),
|
|
1833
|
+
).toEqual([[]])
|
|
1834
|
+
})
|
|
1835
|
+
|
|
1836
|
+
test('round-trip', () => {
|
|
1837
|
+
const cases = [
|
|
1838
|
+
{
|
|
1839
|
+
parameters: [{ type: 'uint256[0]' }, { type: 'uint256' }],
|
|
1840
|
+
values: [[], 3n],
|
|
1841
|
+
},
|
|
1842
|
+
{
|
|
1843
|
+
parameters: [{ type: 'uint256' }, { type: 'tuple', components: [] }],
|
|
1844
|
+
values: [5n, []],
|
|
1845
|
+
},
|
|
1846
|
+
{
|
|
1847
|
+
parameters: [{ type: 'string[0]' }, { type: 'uint256' }],
|
|
1848
|
+
values: [[], 3n],
|
|
1849
|
+
},
|
|
1850
|
+
{
|
|
1851
|
+
parameters: [{ type: 'uint256[0]' }, { type: 'string' }],
|
|
1852
|
+
values: [[], 'hello'],
|
|
1853
|
+
},
|
|
1854
|
+
{
|
|
1855
|
+
parameters: [{ type: 'uint256[0][2]' }, { type: 'uint256' }],
|
|
1856
|
+
values: [[[], []], 9n],
|
|
1857
|
+
},
|
|
1858
|
+
{
|
|
1859
|
+
parameters: [{ type: 'string[0]' }],
|
|
1860
|
+
values: [[]],
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
parameters: [{ type: 'tuple', components: [{ type: 'string[0]' }] }],
|
|
1864
|
+
values: [[[]]],
|
|
1865
|
+
},
|
|
1866
|
+
] as const
|
|
1867
|
+
for (const { parameters, values } of cases) {
|
|
1868
|
+
expect(
|
|
1869
|
+
AbiParameters.decode(
|
|
1870
|
+
parameters,
|
|
1871
|
+
AbiParameters.encode(parameters, values as never),
|
|
1872
|
+
),
|
|
1873
|
+
).toEqual(values)
|
|
1874
|
+
}
|
|
1875
|
+
})
|
|
1876
|
+
})
|
|
@@ -1963,3 +1963,71 @@ test('https://github.com/wevm/viem/issues/1960', () => {
|
|
|
1963
1963
|
`[BaseError: Invalid boolean value: "true" (type: string). Expected: \`true\` or \`false\`.]`,
|
|
1964
1964
|
)
|
|
1965
1965
|
})
|
|
1966
|
+
|
|
1967
|
+
describe('zero-width types', () => {
|
|
1968
|
+
// Per the ABI spec, `enc(T[0])` and `enc(())` are zero-length: a zero-length
|
|
1969
|
+
// fixed array or empty tuple contributes no bytes. Expected values verified
|
|
1970
|
+
// against ethers `AbiCoder.defaultAbiCoder()`.
|
|
1971
|
+
test('zero-length fixed array', () => {
|
|
1972
|
+
expect(
|
|
1973
|
+
AbiParameters.encode(
|
|
1974
|
+
[{ type: 'uint256[0]' }, { type: 'uint256' }],
|
|
1975
|
+
[[], 3n],
|
|
1976
|
+
),
|
|
1977
|
+
).toBe('0x0000000000000000000000000000000000000000000000000000000000000003')
|
|
1978
|
+
})
|
|
1979
|
+
|
|
1980
|
+
test('empty tuple', () => {
|
|
1981
|
+
expect(
|
|
1982
|
+
AbiParameters.encode(
|
|
1983
|
+
[{ type: 'uint256' }, { type: 'tuple', components: [] }],
|
|
1984
|
+
[5n, []],
|
|
1985
|
+
),
|
|
1986
|
+
).toBe('0x0000000000000000000000000000000000000000000000000000000000000005')
|
|
1987
|
+
})
|
|
1988
|
+
|
|
1989
|
+
test('empty tuple only', () => {
|
|
1990
|
+
expect(
|
|
1991
|
+
AbiParameters.encode([{ type: 'tuple', components: [] }], [[]]),
|
|
1992
|
+
).toBe('0x')
|
|
1993
|
+
})
|
|
1994
|
+
|
|
1995
|
+
test('nested zero-length fixed arrays', () => {
|
|
1996
|
+
expect(
|
|
1997
|
+
AbiParameters.encode(
|
|
1998
|
+
[{ type: 'uint256[0][2]' }, { type: 'uint256' }],
|
|
1999
|
+
[[[], []], 9n],
|
|
2000
|
+
),
|
|
2001
|
+
).toBe('0x0000000000000000000000000000000000000000000000000000000000000009')
|
|
2002
|
+
expect(
|
|
2003
|
+
AbiParameters.encode(
|
|
2004
|
+
[{ type: 'uint256[2][0]' }, { type: 'uint256' }],
|
|
2005
|
+
[[], 9n],
|
|
2006
|
+
),
|
|
2007
|
+
).toBe('0x0000000000000000000000000000000000000000000000000000000000000009')
|
|
2008
|
+
})
|
|
2009
|
+
|
|
2010
|
+
test('offsets skip zero-width parameters', () => {
|
|
2011
|
+
expect(
|
|
2012
|
+
AbiParameters.encode(
|
|
2013
|
+
[{ type: 'uint256[0]' }, { type: 'string' }],
|
|
2014
|
+
[[], 'hello'],
|
|
2015
|
+
),
|
|
2016
|
+
).toBe(
|
|
2017
|
+
'0x0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000',
|
|
2018
|
+
)
|
|
2019
|
+
})
|
|
2020
|
+
|
|
2021
|
+
// `T[0]` of a dynamic `T` is dynamic per the ABI spec: 32-byte offset
|
|
2022
|
+
// pointing at a zero-length tail.
|
|
2023
|
+
test('zero-length fixed array of dynamic type', () => {
|
|
2024
|
+
expect(
|
|
2025
|
+
AbiParameters.encode(
|
|
2026
|
+
[{ type: 'string[0]' }, { type: 'uint256' }],
|
|
2027
|
+
[[], 3n],
|
|
2028
|
+
),
|
|
2029
|
+
).toBe(
|
|
2030
|
+
'0x00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000003',
|
|
2031
|
+
)
|
|
2032
|
+
})
|
|
2033
|
+
})
|
|
@@ -360,6 +360,13 @@ describe('format', () => {
|
|
|
360
360
|
test('exports', () => {
|
|
361
361
|
expect(Object.keys(AbiParameters)).toMatchInlineSnapshot(`
|
|
362
362
|
[
|
|
363
|
+
"InvalidAbiParametersError",
|
|
364
|
+
"InvalidAbiTypeParameterError",
|
|
365
|
+
"InvalidFunctionModifierError",
|
|
366
|
+
"InvalidModifierError",
|
|
367
|
+
"InvalidParameterError",
|
|
368
|
+
"SolidityProtectedKeywordError",
|
|
369
|
+
"InvalidParenthesisError",
|
|
363
370
|
"decode",
|
|
364
371
|
"encode",
|
|
365
372
|
"encodePacked",
|
|
@@ -90,6 +90,62 @@ describe('toRpc', () => {
|
|
|
90
90
|
`)
|
|
91
91
|
})
|
|
92
92
|
|
|
93
|
+
test('numberish inputs', () => {
|
|
94
|
+
const fromBigint = AccountProof.toRpc({
|
|
95
|
+
address: '0xb9CAB4F0E46F7F6b1024b5A7463734fa68E633f9',
|
|
96
|
+
balance: 1n,
|
|
97
|
+
codeHash:
|
|
98
|
+
'0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470',
|
|
99
|
+
nonce: 2,
|
|
100
|
+
storageHash:
|
|
101
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
102
|
+
accountProof: ['0xabcd', '0x1234'],
|
|
103
|
+
storageProof: [
|
|
104
|
+
{
|
|
105
|
+
key: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
106
|
+
proof: ['0xdead'],
|
|
107
|
+
value: 3n,
|
|
108
|
+
},
|
|
109
|
+
],
|
|
110
|
+
})
|
|
111
|
+
const fromNumber = AccountProof.toRpc({
|
|
112
|
+
address: '0xb9CAB4F0E46F7F6b1024b5A7463734fa68E633f9',
|
|
113
|
+
balance: 1,
|
|
114
|
+
codeHash:
|
|
115
|
+
'0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470',
|
|
116
|
+
nonce: 2,
|
|
117
|
+
storageHash:
|
|
118
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
119
|
+
accountProof: ['0xabcd', '0x1234'],
|
|
120
|
+
storageProof: [
|
|
121
|
+
{
|
|
122
|
+
key: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
123
|
+
proof: ['0xdead'],
|
|
124
|
+
value: 3,
|
|
125
|
+
},
|
|
126
|
+
],
|
|
127
|
+
})
|
|
128
|
+
const fromHex = AccountProof.toRpc({
|
|
129
|
+
address: '0xb9CAB4F0E46F7F6b1024b5A7463734fa68E633f9',
|
|
130
|
+
balance: '0x1',
|
|
131
|
+
codeHash:
|
|
132
|
+
'0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470',
|
|
133
|
+
nonce: '0x2',
|
|
134
|
+
storageHash:
|
|
135
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
136
|
+
accountProof: ['0xabcd', '0x1234'],
|
|
137
|
+
storageProof: [
|
|
138
|
+
{
|
|
139
|
+
key: '0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
140
|
+
proof: ['0xdead'],
|
|
141
|
+
value: '0x3',
|
|
142
|
+
},
|
|
143
|
+
],
|
|
144
|
+
})
|
|
145
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
146
|
+
expect(fromBigint).toEqual(fromHex)
|
|
147
|
+
})
|
|
148
|
+
|
|
93
149
|
test('round-trip', () => {
|
|
94
150
|
const value = {
|
|
95
151
|
address: '0xb9CAB4F0E46F7F6b1024b5A7463734fa68E633f9',
|
|
@@ -425,6 +425,35 @@ describe('toRpc', () => {
|
|
|
425
425
|
}
|
|
426
426
|
`)
|
|
427
427
|
})
|
|
428
|
+
|
|
429
|
+
test('numberish inputs', () => {
|
|
430
|
+
const fromBigint = Authorization.toRpc({
|
|
431
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
432
|
+
chainId: 1,
|
|
433
|
+
nonce: 1n,
|
|
434
|
+
r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
|
|
435
|
+
s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
|
|
436
|
+
yParity: 0,
|
|
437
|
+
})
|
|
438
|
+
const fromNumber = Authorization.toRpc({
|
|
439
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
440
|
+
chainId: 1,
|
|
441
|
+
nonce: 1,
|
|
442
|
+
r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
|
|
443
|
+
s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
|
|
444
|
+
yParity: 0,
|
|
445
|
+
})
|
|
446
|
+
const fromHex = Authorization.toRpc({
|
|
447
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
448
|
+
chainId: '0x1',
|
|
449
|
+
nonce: '0x1',
|
|
450
|
+
r: '0x635dc2033e60185bb36709c29c75d64ea51dfbd91c32ef4be198e4ceb169fb4d',
|
|
451
|
+
s: '0x50c2667ac4c771072746acfdcf1f1483336dcca8bd2df47cd83175dbe60f0540',
|
|
452
|
+
yParity: 0,
|
|
453
|
+
})
|
|
454
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
455
|
+
expect(fromBigint).toEqual(fromHex)
|
|
456
|
+
})
|
|
428
457
|
})
|
|
429
458
|
|
|
430
459
|
describe('toRpcList', () => {
|
|
@@ -548,6 +548,104 @@ describe('toRpc', () => {
|
|
|
548
548
|
`)
|
|
549
549
|
})
|
|
550
550
|
|
|
551
|
+
test('numberish inputs', () => {
|
|
552
|
+
const input = {
|
|
553
|
+
extraData: '0x',
|
|
554
|
+
hash: '0xebc3644804e4040c0a74c5a5bbbc6b46a71a5d4010fe0c92ebb2fdf4a43ea5dd',
|
|
555
|
+
logsBloom:
|
|
556
|
+
'0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000',
|
|
557
|
+
miner: '0x0000000000000000000000000000000000000000',
|
|
558
|
+
mixHash:
|
|
559
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
560
|
+
nonce: '0x0000000000000000',
|
|
561
|
+
parentBeaconBlockRoot: undefined,
|
|
562
|
+
parentHash:
|
|
563
|
+
'0xe55516ad8029e53cd32087f14653d851401b05245abb1b2d6ed4ddcc597ac5a6',
|
|
564
|
+
receiptsRoot:
|
|
565
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
566
|
+
sealFields: [
|
|
567
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
568
|
+
'0x0000000000000000',
|
|
569
|
+
],
|
|
570
|
+
sha3Uncles:
|
|
571
|
+
'0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347',
|
|
572
|
+
stateRoot:
|
|
573
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
574
|
+
transactions: [],
|
|
575
|
+
transactionsRoot:
|
|
576
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
577
|
+
uncles: [],
|
|
578
|
+
withdrawalsRoot:
|
|
579
|
+
'0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421',
|
|
580
|
+
} satisfies Partial<Parameters<typeof Block.toRpc>[0]>
|
|
581
|
+
const fromBigint = Block.toRpc({
|
|
582
|
+
...input,
|
|
583
|
+
baseFeePerGas: 1n,
|
|
584
|
+
blobGasUsed: 2n,
|
|
585
|
+
difficulty: 3n,
|
|
586
|
+
excessBlobGas: 4n,
|
|
587
|
+
gasLimit: 5n,
|
|
588
|
+
gasUsed: 6n,
|
|
589
|
+
number: 7n,
|
|
590
|
+
size: 8n,
|
|
591
|
+
timestamp: 9n,
|
|
592
|
+
totalDifficulty: 10n,
|
|
593
|
+
withdrawals: [
|
|
594
|
+
{
|
|
595
|
+
address: '0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f',
|
|
596
|
+
amount: 11n,
|
|
597
|
+
index: 12,
|
|
598
|
+
validatorIndex: 13,
|
|
599
|
+
},
|
|
600
|
+
],
|
|
601
|
+
})
|
|
602
|
+
const fromNumber = Block.toRpc({
|
|
603
|
+
...input,
|
|
604
|
+
baseFeePerGas: 1,
|
|
605
|
+
blobGasUsed: 2,
|
|
606
|
+
difficulty: 3,
|
|
607
|
+
excessBlobGas: 4,
|
|
608
|
+
gasLimit: 5,
|
|
609
|
+
gasUsed: 6,
|
|
610
|
+
number: 7,
|
|
611
|
+
size: 8,
|
|
612
|
+
timestamp: 9,
|
|
613
|
+
totalDifficulty: 10,
|
|
614
|
+
withdrawals: [
|
|
615
|
+
{
|
|
616
|
+
address: '0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f',
|
|
617
|
+
amount: 11,
|
|
618
|
+
index: 12,
|
|
619
|
+
validatorIndex: 13,
|
|
620
|
+
},
|
|
621
|
+
],
|
|
622
|
+
})
|
|
623
|
+
const fromHex = Block.toRpc({
|
|
624
|
+
...input,
|
|
625
|
+
baseFeePerGas: '0x1',
|
|
626
|
+
blobGasUsed: '0x2',
|
|
627
|
+
difficulty: '0x3',
|
|
628
|
+
excessBlobGas: '0x4',
|
|
629
|
+
gasLimit: '0x5',
|
|
630
|
+
gasUsed: '0x6',
|
|
631
|
+
number: '0x7',
|
|
632
|
+
size: '0x8',
|
|
633
|
+
timestamp: '0x9',
|
|
634
|
+
totalDifficulty: '0xa',
|
|
635
|
+
withdrawals: [
|
|
636
|
+
{
|
|
637
|
+
address: '0xb9d7934878b5fb9610b3fe8a5e441e8fad7e293f',
|
|
638
|
+
amount: '0xb',
|
|
639
|
+
index: '0xc',
|
|
640
|
+
validatorIndex: '0xd',
|
|
641
|
+
},
|
|
642
|
+
],
|
|
643
|
+
})
|
|
644
|
+
|
|
645
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
646
|
+
expect(fromBigint).toEqual(fromHex)
|
|
647
|
+
})
|
|
648
|
+
|
|
551
649
|
test('behavior: nullish values', () => {
|
|
552
650
|
const block = Block.toRpc(
|
|
553
651
|
{
|
|
@@ -107,4 +107,54 @@ describe('toRpc', () => {
|
|
|
107
107
|
}
|
|
108
108
|
`)
|
|
109
109
|
})
|
|
110
|
+
|
|
111
|
+
test('numberish inputs', () => {
|
|
112
|
+
const input = {
|
|
113
|
+
feeRecipient: '0x0000000000000000000000000000000000000000',
|
|
114
|
+
withdrawals: [
|
|
115
|
+
{
|
|
116
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
117
|
+
amount: 1n,
|
|
118
|
+
index: 0,
|
|
119
|
+
validatorIndex: 1,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
address: '0x0000000000000000000000000000000000000000',
|
|
123
|
+
amount: 1n,
|
|
124
|
+
index: 0,
|
|
125
|
+
validatorIndex: 1,
|
|
126
|
+
},
|
|
127
|
+
],
|
|
128
|
+
} satisfies Parameters<typeof BlockOverrides.toRpc>[0]
|
|
129
|
+
const fromBigint = BlockOverrides.toRpc({
|
|
130
|
+
...input,
|
|
131
|
+
baseFeePerGas: 1n,
|
|
132
|
+
blobBaseFee: 2n,
|
|
133
|
+
gasLimit: 4n,
|
|
134
|
+
number: 5n,
|
|
135
|
+
prevRandao: 6n,
|
|
136
|
+
time: 78187493520n,
|
|
137
|
+
})
|
|
138
|
+
const fromNumber = BlockOverrides.toRpc({
|
|
139
|
+
...input,
|
|
140
|
+
baseFeePerGas: 1,
|
|
141
|
+
blobBaseFee: 2,
|
|
142
|
+
gasLimit: 4,
|
|
143
|
+
number: 5,
|
|
144
|
+
prevRandao: 6,
|
|
145
|
+
time: 78187493520,
|
|
146
|
+
})
|
|
147
|
+
const fromHex = BlockOverrides.toRpc({
|
|
148
|
+
...input,
|
|
149
|
+
baseFeePerGas: '0x1',
|
|
150
|
+
blobBaseFee: '0x2',
|
|
151
|
+
gasLimit: '0x4',
|
|
152
|
+
number: '0x5',
|
|
153
|
+
prevRandao: '0x6',
|
|
154
|
+
time: '0x1234567890',
|
|
155
|
+
})
|
|
156
|
+
|
|
157
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
158
|
+
expect(fromBigint).toEqual(fromHex)
|
|
159
|
+
})
|
|
110
160
|
})
|
|
@@ -122,6 +122,38 @@ describe('toRpc', () => {
|
|
|
122
122
|
}
|
|
123
123
|
})
|
|
124
124
|
|
|
125
|
+
test('numberish inputs', () => {
|
|
126
|
+
const fromBigint = Filter.toRpc({
|
|
127
|
+
fromBlock: 69420n,
|
|
128
|
+
toBlock: 69421n,
|
|
129
|
+
topics: [
|
|
130
|
+
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
131
|
+
null,
|
|
132
|
+
'0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1',
|
|
133
|
+
],
|
|
134
|
+
})
|
|
135
|
+
const fromNumber = Filter.toRpc({
|
|
136
|
+
fromBlock: 69420,
|
|
137
|
+
toBlock: 69421,
|
|
138
|
+
topics: [
|
|
139
|
+
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
140
|
+
null,
|
|
141
|
+
'0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1',
|
|
142
|
+
],
|
|
143
|
+
})
|
|
144
|
+
const fromHex = Filter.toRpc({
|
|
145
|
+
fromBlock: '0x10f2c',
|
|
146
|
+
toBlock: '0x10f2d',
|
|
147
|
+
topics: [
|
|
148
|
+
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
149
|
+
null,
|
|
150
|
+
'0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1',
|
|
151
|
+
],
|
|
152
|
+
})
|
|
153
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
154
|
+
expect(fromBigint).toEqual(fromHex)
|
|
155
|
+
})
|
|
156
|
+
|
|
125
157
|
test('behavior: preserves explicit `address: null`', () => {
|
|
126
158
|
const filter = Filter.toRpc({
|
|
127
159
|
address: null,
|
|
@@ -170,6 +170,48 @@ describe('toRpc', () => {
|
|
|
170
170
|
`)
|
|
171
171
|
})
|
|
172
172
|
|
|
173
|
+
test('numberish inputs', () => {
|
|
174
|
+
const input = {
|
|
175
|
+
address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
|
|
176
|
+
blockHash:
|
|
177
|
+
'0xabe69134e80a12f6a93d0aa18215b5b86c2fb338bae911790ca374a8716e01a4',
|
|
178
|
+
data: '0x',
|
|
179
|
+
removed: false,
|
|
180
|
+
topics: [
|
|
181
|
+
'0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef',
|
|
182
|
+
'0x0000000000000000000000000000000000000000000000000000000000000000',
|
|
183
|
+
'0x0000000000000000000000000c04d9e9278ec5e4d424476d3ebec70cb5d648d1',
|
|
184
|
+
'0x000000000000000000000000000000000000000000000000000000000000025b',
|
|
185
|
+
],
|
|
186
|
+
transactionHash:
|
|
187
|
+
'0xcfa52db0bc2cb5bdcb2c5bd8816df7a2f018a0e3964ab1ef4d794cf327966e93',
|
|
188
|
+
} satisfies Partial<Parameters<typeof Log.toRpc>[0]>
|
|
189
|
+
const fromBigint = Log.toRpc({
|
|
190
|
+
...input,
|
|
191
|
+
blockNumber: 19760236n,
|
|
192
|
+
blockTimestamp: 1714384847n,
|
|
193
|
+
logIndex: 271,
|
|
194
|
+
transactionIndex: 145,
|
|
195
|
+
})
|
|
196
|
+
const fromNumber = Log.toRpc({
|
|
197
|
+
...input,
|
|
198
|
+
blockNumber: 19760236,
|
|
199
|
+
blockTimestamp: 1714384847,
|
|
200
|
+
logIndex: 271,
|
|
201
|
+
transactionIndex: 145,
|
|
202
|
+
})
|
|
203
|
+
const fromHex = Log.toRpc({
|
|
204
|
+
...input,
|
|
205
|
+
blockNumber: '0x12d846c',
|
|
206
|
+
blockTimestamp: '0x662f6fcf',
|
|
207
|
+
logIndex: '0x10f',
|
|
208
|
+
transactionIndex: '0x91',
|
|
209
|
+
})
|
|
210
|
+
|
|
211
|
+
expect(fromBigint).toEqual(fromNumber)
|
|
212
|
+
expect(fromBigint).toEqual(fromHex)
|
|
213
|
+
})
|
|
214
|
+
|
|
173
215
|
test('behavior: nullish values', () => {
|
|
174
216
|
const log = Log.toRpc(
|
|
175
217
|
{
|