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
|
@@ -3,6 +3,8 @@ import * as Address from './Address.js'
|
|
|
3
3
|
import * as Bytes from './Bytes.js'
|
|
4
4
|
import * as Errors from './Errors.js'
|
|
5
5
|
import * as Hex from './Hex.js'
|
|
6
|
+
import * as formatAbiParameters from './internal/human-readable/formatAbiParameters.js'
|
|
7
|
+
import * as parseAbiParameters from './internal/human-readable/parseAbiParameters.js'
|
|
6
8
|
import * as internal from './internal/abiParameters.js'
|
|
7
9
|
import * as Cursor from './internal/cursor.js'
|
|
8
10
|
import * as Solidity from './Solidity.js'
|
|
@@ -13,6 +15,16 @@ export type AbiParameters = readonly abitype.AbiParameter[]
|
|
|
13
15
|
/** A parameter on an {@link ox#AbiParameters.AbiParameters}. */
|
|
14
16
|
export type Parameter = abitype.AbiParameter
|
|
15
17
|
|
|
18
|
+
export {
|
|
19
|
+
InvalidAbiParametersError,
|
|
20
|
+
InvalidAbiTypeParameterError,
|
|
21
|
+
InvalidFunctionModifierError,
|
|
22
|
+
InvalidModifierError,
|
|
23
|
+
InvalidParameterError,
|
|
24
|
+
SolidityProtectedKeywordError,
|
|
25
|
+
} from './internal/human-readable/errors.js'
|
|
26
|
+
export { InvalidParenthesisError } from './internal/human-readable/errors.js'
|
|
27
|
+
|
|
16
28
|
/** A packed ABI type. */
|
|
17
29
|
export type PackedAbiType =
|
|
18
30
|
| abitype.SolidityAddress
|
|
@@ -97,7 +109,9 @@ export function decode(
|
|
|
97
109
|
for (let i = 0; i < parameters.length; ++i) {
|
|
98
110
|
const param = parameters[i] as Parameter
|
|
99
111
|
try {
|
|
100
|
-
|
|
112
|
+
// Zero-width types (e.g. `uint256[0]`, empty tuples) at the end of the
|
|
113
|
+
// data consume no bytes, so the cursor may already be exhausted.
|
|
114
|
+
if (consumed < bytes.length) cursor.setPosition(consumed)
|
|
101
115
|
const [data_, consumed_] = internal.decodeParameter(cursor, param, {
|
|
102
116
|
checksumAddress,
|
|
103
117
|
staticPosition: 0,
|
|
@@ -386,11 +400,18 @@ export function format<
|
|
|
386
400
|
Parameter | abitype.AbiEventParameter,
|
|
387
401
|
...(readonly (Parameter | abitype.AbiEventParameter)[]),
|
|
388
402
|
],
|
|
389
|
-
):
|
|
390
|
-
return
|
|
403
|
+
): format.ReturnType<parameters> {
|
|
404
|
+
return formatAbiParameters.formatAbiParameters(parameters)
|
|
391
405
|
}
|
|
392
406
|
|
|
393
407
|
export declare namespace format {
|
|
408
|
+
type ReturnType<
|
|
409
|
+
parameters extends readonly [
|
|
410
|
+
Parameter | abitype.AbiEventParameter,
|
|
411
|
+
...(readonly (Parameter | abitype.AbiEventParameter)[]),
|
|
412
|
+
] = readonly [Parameter, ...(readonly Parameter[])],
|
|
413
|
+
> = formatAbiParameters.FormatAbiParameters<parameters>
|
|
414
|
+
|
|
394
415
|
type ErrorType = Errors.GlobalErrorType
|
|
395
416
|
}
|
|
396
417
|
|
|
@@ -416,6 +437,22 @@ export declare namespace format {
|
|
|
416
437
|
*
|
|
417
438
|
* parameters
|
|
418
439
|
* //^?
|
|
440
|
+
* //
|
|
441
|
+
* //
|
|
442
|
+
* //
|
|
443
|
+
* //
|
|
444
|
+
* //
|
|
445
|
+
* //
|
|
446
|
+
* //
|
|
447
|
+
* //
|
|
448
|
+
* //
|
|
449
|
+
* //
|
|
450
|
+
* //
|
|
451
|
+
* //
|
|
452
|
+
* //
|
|
453
|
+
* //
|
|
454
|
+
* //
|
|
455
|
+
* //
|
|
419
456
|
* ```
|
|
420
457
|
*
|
|
421
458
|
* @example
|
|
@@ -432,6 +469,22 @@ export declare namespace format {
|
|
|
432
469
|
*
|
|
433
470
|
* parameters
|
|
434
471
|
* //^?
|
|
472
|
+
* //
|
|
473
|
+
* //
|
|
474
|
+
* //
|
|
475
|
+
* //
|
|
476
|
+
* //
|
|
477
|
+
* //
|
|
478
|
+
* //
|
|
479
|
+
* //
|
|
480
|
+
* //
|
|
481
|
+
* //
|
|
482
|
+
* //
|
|
483
|
+
* //
|
|
484
|
+
* //
|
|
485
|
+
* //
|
|
486
|
+
* //
|
|
487
|
+
* //
|
|
435
488
|
* ```
|
|
436
489
|
*
|
|
437
490
|
* @example
|
|
@@ -447,6 +500,22 @@ export declare namespace format {
|
|
|
447
500
|
*
|
|
448
501
|
* parameters
|
|
449
502
|
* //^?
|
|
503
|
+
* //
|
|
504
|
+
* //
|
|
505
|
+
* //
|
|
506
|
+
* //
|
|
507
|
+
* //
|
|
508
|
+
* //
|
|
509
|
+
* //
|
|
510
|
+
* //
|
|
511
|
+
* //
|
|
512
|
+
* //
|
|
513
|
+
* //
|
|
514
|
+
* //
|
|
515
|
+
* //
|
|
516
|
+
* //
|
|
517
|
+
* //
|
|
518
|
+
* //
|
|
450
519
|
* ```
|
|
451
520
|
*
|
|
452
521
|
*
|
|
@@ -460,9 +529,9 @@ export function from<
|
|
|
460
529
|
parameters: parameters | AbiParameters | string | readonly string[],
|
|
461
530
|
): from.ReturnType<parameters> {
|
|
462
531
|
if (Array.isArray(parameters) && typeof parameters[0] === 'string')
|
|
463
|
-
return
|
|
532
|
+
return parseAbiParameters.parseAbiParameters(parameters) as never
|
|
464
533
|
if (typeof parameters === 'string')
|
|
465
|
-
return
|
|
534
|
+
return parseAbiParameters.parseAbiParameters(parameters) as never
|
|
466
535
|
return parameters as never
|
|
467
536
|
}
|
|
468
537
|
|
|
@@ -470,9 +539,9 @@ export declare namespace from {
|
|
|
470
539
|
type ReturnType<
|
|
471
540
|
parameters extends AbiParameters | string | readonly string[],
|
|
472
541
|
> = parameters extends string
|
|
473
|
-
?
|
|
542
|
+
? parseAbiParameters.ParseAbiParameters<parameters>
|
|
474
543
|
: parameters extends readonly string[]
|
|
475
|
-
?
|
|
544
|
+
? parseAbiParameters.ParseAbiParameters<parameters>
|
|
476
545
|
: parameters
|
|
477
546
|
|
|
478
547
|
type ErrorType = Errors.GlobalErrorType
|
|
@@ -519,7 +588,7 @@ export class DataSizeTooSmallError extends Errors.BaseError {
|
|
|
519
588
|
}) {
|
|
520
589
|
super(`Data size of ${size} bytes is too small for given parameters.`, {
|
|
521
590
|
metaMessages: [
|
|
522
|
-
`Params: (${
|
|
591
|
+
`Params: (${formatAbiParameters.formatAbiParameters(parameters as readonly [Parameter])})`,
|
|
523
592
|
`Data: ${data} (${size} bytes)`,
|
|
524
593
|
],
|
|
525
594
|
})
|
package/src/core/AccountProof.ts
CHANGED
|
@@ -130,22 +130,25 @@ export declare namespace fromRpc {
|
|
|
130
130
|
* @param proof - The account proof to convert.
|
|
131
131
|
* @returns An RPC account proof.
|
|
132
132
|
*/
|
|
133
|
-
export function toRpc(proof:
|
|
133
|
+
export function toRpc(proof: toRpc.Input): Rpc {
|
|
134
134
|
return {
|
|
135
135
|
address: proof.address,
|
|
136
|
-
balance:
|
|
136
|
+
balance: Quantity.fromNumberish(proof.balance),
|
|
137
137
|
codeHash: proof.codeHash,
|
|
138
|
-
nonce:
|
|
138
|
+
nonce: Quantity.fromNumberish(proof.nonce),
|
|
139
139
|
storageHash: proof.storageHash,
|
|
140
140
|
accountProof: proof.accountProof,
|
|
141
141
|
storageProof: proof.storageProof.map((slot) => ({
|
|
142
142
|
key: slot.key,
|
|
143
143
|
proof: slot.proof,
|
|
144
|
-
value: Quantity.
|
|
144
|
+
value: Quantity.fromNumberish(slot.value),
|
|
145
145
|
})),
|
|
146
146
|
}
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export declare namespace toRpc {
|
|
150
|
+
/** Numberish input accepted by {@link ox#AccountProof.(toRpc:function)}. */
|
|
151
|
+
type Input = AccountProof<Hex.Hex | bigint | number, Hex.Hex | number>
|
|
152
|
+
|
|
150
153
|
type ErrorType = Errors.GlobalErrorType
|
|
151
154
|
}
|
|
@@ -2,6 +2,7 @@ import type * as Address from './Address.js'
|
|
|
2
2
|
import type * as Errors from './Errors.js'
|
|
3
3
|
import * as Hash from './Hash.js'
|
|
4
4
|
import * as Hex from './Hex.js'
|
|
5
|
+
import * as Quantity from './internal/quantity.js'
|
|
5
6
|
import type { Compute, Mutable, Undefined } from './internal/types.js'
|
|
6
7
|
import * as Rlp from './Rlp.js'
|
|
7
8
|
import * as Signature from './Signature.js'
|
|
@@ -497,18 +498,21 @@ export declare namespace hash {
|
|
|
497
498
|
* @param authorization - An Authorization.
|
|
498
499
|
* @returns An RPC-formatted Authorization.
|
|
499
500
|
*/
|
|
500
|
-
export function toRpc(authorization:
|
|
501
|
+
export function toRpc(authorization: toRpc.Input): Rpc {
|
|
501
502
|
const { address, chainId, nonce, ...signature } = authorization
|
|
502
503
|
|
|
503
504
|
return {
|
|
504
505
|
address,
|
|
505
|
-
chainId:
|
|
506
|
-
nonce:
|
|
506
|
+
chainId: Quantity.fromNumberish(chainId),
|
|
507
|
+
nonce: Quantity.fromNumberish(nonce),
|
|
507
508
|
...Signature.toRpc(signature),
|
|
508
509
|
}
|
|
509
510
|
}
|
|
510
511
|
|
|
511
512
|
export declare namespace toRpc {
|
|
513
|
+
/** Numberish input accepted by {@link ox#Authorization.(toRpc:function)}. */
|
|
514
|
+
type Input = Signed<Hex.Hex | bigint | number, Hex.Hex | number>
|
|
515
|
+
|
|
512
516
|
type ErrorType = Errors.GlobalErrorType
|
|
513
517
|
}
|
|
514
518
|
|
|
@@ -534,11 +538,14 @@ export declare namespace toRpc {
|
|
|
534
538
|
* @param authorizationList - An Authorization List.
|
|
535
539
|
* @returns An RPC-formatted Authorization List.
|
|
536
540
|
*/
|
|
537
|
-
export function toRpcList(authorizationList:
|
|
541
|
+
export function toRpcList(authorizationList: toRpcList.Input): ListRpc {
|
|
538
542
|
return authorizationList.map(toRpc)
|
|
539
543
|
}
|
|
540
544
|
|
|
541
545
|
export declare namespace toRpcList {
|
|
546
|
+
/** Numberish input accepted by {@link ox#Authorization.(toRpcList:function)}. */
|
|
547
|
+
type Input = ListSigned<Hex.Hex | bigint | number, Hex.Hex | number>
|
|
548
|
+
|
|
542
549
|
type ErrorType = Errors.GlobalErrorType
|
|
543
550
|
}
|
|
544
551
|
|
package/src/core/Block.ts
CHANGED
|
@@ -148,7 +148,7 @@ export function toRpc<
|
|
|
148
148
|
includeTransactions extends boolean = false,
|
|
149
149
|
blockTag extends Tag = 'latest',
|
|
150
150
|
>(
|
|
151
|
-
block:
|
|
151
|
+
block: toRpc.Input<includeTransactions, blockTag>,
|
|
152
152
|
_options: toRpc.Options<includeTransactions, blockTag> = {},
|
|
153
153
|
): Rpc<boolean, blockTag> {
|
|
154
154
|
const transactions = block.transactions.map((transaction) => {
|
|
@@ -156,30 +156,30 @@ export function toRpc<
|
|
|
156
156
|
return Transaction.toRpc(transaction as any) as any
|
|
157
157
|
})
|
|
158
158
|
return {
|
|
159
|
-
baseFeePerGas: Quantity.
|
|
160
|
-
blobGasUsed: Quantity.
|
|
161
|
-
excessBlobGas: Quantity.
|
|
159
|
+
baseFeePerGas: Quantity.fromNumberishOptional(block.baseFeePerGas),
|
|
160
|
+
blobGasUsed: Quantity.fromNumberishOptional(block.blobGasUsed),
|
|
161
|
+
excessBlobGas: Quantity.fromNumberishOptional(block.excessBlobGas),
|
|
162
162
|
extraData: block.extraData,
|
|
163
|
-
difficulty: Quantity.
|
|
164
|
-
gasLimit:
|
|
165
|
-
gasUsed:
|
|
163
|
+
difficulty: Quantity.fromNumberishOptional(block.difficulty),
|
|
164
|
+
gasLimit: Quantity.fromNumberish(block.gasLimit),
|
|
165
|
+
gasUsed: Quantity.fromNumberish(block.gasUsed),
|
|
166
166
|
hash: block.hash,
|
|
167
167
|
logsBloom: block.logsBloom,
|
|
168
168
|
miner: block.miner,
|
|
169
169
|
mixHash: block.mixHash,
|
|
170
170
|
nonce: block.nonce,
|
|
171
|
-
number: (
|
|
172
|
-
?
|
|
173
|
-
:
|
|
171
|
+
number: (block.number === null
|
|
172
|
+
? null
|
|
173
|
+
: Quantity.fromNumberish(block.number)) as never,
|
|
174
174
|
parentBeaconBlockRoot: block.parentBeaconBlockRoot,
|
|
175
175
|
parentHash: block.parentHash,
|
|
176
176
|
receiptsRoot: block.receiptsRoot,
|
|
177
177
|
sealFields: block.sealFields,
|
|
178
178
|
sha3Uncles: block.sha3Uncles,
|
|
179
|
-
size:
|
|
179
|
+
size: Quantity.fromNumberish(block.size),
|
|
180
180
|
stateRoot: block.stateRoot,
|
|
181
|
-
timestamp:
|
|
182
|
-
totalDifficulty: Quantity.
|
|
181
|
+
timestamp: Quantity.fromNumberish(block.timestamp),
|
|
182
|
+
totalDifficulty: Quantity.fromNumberishOptional(block.totalDifficulty),
|
|
183
183
|
transactions,
|
|
184
184
|
transactionsRoot: block.transactionsRoot,
|
|
185
185
|
uncles: block.uncles,
|
|
@@ -189,6 +189,17 @@ export function toRpc<
|
|
|
189
189
|
}
|
|
190
190
|
|
|
191
191
|
export declare namespace toRpc {
|
|
192
|
+
/** Numberish input accepted by {@link ox#Block.(toRpc:function)}. */
|
|
193
|
+
type Input<
|
|
194
|
+
includeTransactions extends boolean = false,
|
|
195
|
+
blockTag extends Tag = 'latest',
|
|
196
|
+
> = Block<
|
|
197
|
+
includeTransactions,
|
|
198
|
+
blockTag,
|
|
199
|
+
Hex.Hex | bigint | number,
|
|
200
|
+
Hex.Hex | number
|
|
201
|
+
>
|
|
202
|
+
|
|
192
203
|
type Options<
|
|
193
204
|
includeTransactions extends boolean = false,
|
|
194
205
|
blockTag extends Tag = 'latest',
|
|
@@ -113,23 +113,28 @@ export function fromRpc(rpcBlockOverrides: Rpc): BlockOverrides {
|
|
|
113
113
|
* @param blockOverrides - The block overrides to convert.
|
|
114
114
|
* @returns An instantiated {@link ox#BlockOverrides.Rpc}.
|
|
115
115
|
*/
|
|
116
|
-
export function toRpc(blockOverrides:
|
|
116
|
+
export function toRpc(blockOverrides: toRpc.Input): Rpc {
|
|
117
117
|
const rpc: Rpc = {}
|
|
118
|
-
if (
|
|
119
|
-
rpc.baseFeePerGas = Quantity.
|
|
120
|
-
if (
|
|
121
|
-
rpc.blobBaseFee = Quantity.
|
|
118
|
+
if (blockOverrides.baseFeePerGas !== undefined)
|
|
119
|
+
rpc.baseFeePerGas = Quantity.fromNumberish(blockOverrides.baseFeePerGas)
|
|
120
|
+
if (blockOverrides.blobBaseFee !== undefined)
|
|
121
|
+
rpc.blobBaseFee = Quantity.fromNumberish(blockOverrides.blobBaseFee)
|
|
122
122
|
if (typeof blockOverrides.feeRecipient === 'string')
|
|
123
123
|
rpc.feeRecipient = blockOverrides.feeRecipient
|
|
124
|
-
if (
|
|
125
|
-
rpc.gasLimit = Quantity.
|
|
126
|
-
if (
|
|
127
|
-
rpc.number = Quantity.
|
|
128
|
-
if (
|
|
129
|
-
rpc.prevRandao = Quantity.
|
|
130
|
-
if (
|
|
131
|
-
rpc.time = Quantity.
|
|
124
|
+
if (blockOverrides.gasLimit !== undefined)
|
|
125
|
+
rpc.gasLimit = Quantity.fromNumberish(blockOverrides.gasLimit)
|
|
126
|
+
if (blockOverrides.number !== undefined)
|
|
127
|
+
rpc.number = Quantity.fromNumberish(blockOverrides.number)
|
|
128
|
+
if (blockOverrides.prevRandao !== undefined)
|
|
129
|
+
rpc.prevRandao = Quantity.fromNumberish(blockOverrides.prevRandao)
|
|
130
|
+
if (blockOverrides.time !== undefined)
|
|
131
|
+
rpc.time = Quantity.fromNumberish(blockOverrides.time)
|
|
132
132
|
if (blockOverrides.withdrawals !== undefined)
|
|
133
133
|
rpc.withdrawals = blockOverrides.withdrawals.map(Withdrawal.toRpc)
|
|
134
134
|
return rpc
|
|
135
135
|
}
|
|
136
|
+
|
|
137
|
+
export declare namespace toRpc {
|
|
138
|
+
/** Numberish input accepted by {@link ox#BlockOverrides.(toRpc:function)}. */
|
|
139
|
+
type Input = BlockOverrides<Hex.Hex | bigint | number, Hex.Hex | number>
|
|
140
|
+
}
|
package/src/core/Filter.ts
CHANGED
|
@@ -123,7 +123,7 @@ export declare namespace fromRpc {
|
|
|
123
123
|
* @param filter - The filter to convert.
|
|
124
124
|
* @returns An RPC filter.
|
|
125
125
|
*/
|
|
126
|
-
export function toRpc(filter:
|
|
126
|
+
export function toRpc(filter: toRpc.Input): Rpc {
|
|
127
127
|
const { address, topics, fromBlock, toBlock, blockHash } = filter
|
|
128
128
|
return {
|
|
129
129
|
...(typeof address !== 'undefined' ? { address } : {}),
|
|
@@ -132,20 +132,23 @@ export function toRpc(filter: Filter): Rpc {
|
|
|
132
132
|
...(typeof fromBlock !== 'undefined'
|
|
133
133
|
? {
|
|
134
134
|
fromBlock:
|
|
135
|
-
typeof fromBlock === '
|
|
136
|
-
?
|
|
137
|
-
: fromBlock,
|
|
135
|
+
typeof fromBlock === 'string'
|
|
136
|
+
? fromBlock
|
|
137
|
+
: Hex.fromNumber(fromBlock),
|
|
138
138
|
}
|
|
139
139
|
: {}),
|
|
140
140
|
...(typeof toBlock !== 'undefined'
|
|
141
141
|
? {
|
|
142
142
|
toBlock:
|
|
143
|
-
typeof toBlock === '
|
|
143
|
+
typeof toBlock === 'string' ? toBlock : Hex.fromNumber(toBlock),
|
|
144
144
|
}
|
|
145
145
|
: {}),
|
|
146
146
|
} as unknown as Rpc
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
export declare namespace toRpc {
|
|
150
|
+
/** Numberish input accepted by {@link ox#Filter.(toRpc:function)}. */
|
|
151
|
+
type Input = Filter<Hex.Hex | bigint | number>
|
|
152
|
+
|
|
150
153
|
type ErrorType = Errors.GlobalErrorType
|
|
151
154
|
}
|
package/src/core/Log.ts
CHANGED
|
@@ -23,7 +23,7 @@ export type Log<
|
|
|
23
23
|
/** Index of this log within its block or `null` if pending */
|
|
24
24
|
logIndex: pending extends true ? null : numberType
|
|
25
25
|
/** List of topics associated with this log */
|
|
26
|
-
topics:
|
|
26
|
+
topics: Hex.Hex[]
|
|
27
27
|
/** Hash of the transaction that created this log or `null` if pending */
|
|
28
28
|
transactionHash: pending extends true ? null : Hex.Hex
|
|
29
29
|
/** Index of the transaction that created this log or `null` if pending */
|
|
@@ -217,31 +217,35 @@ export declare namespace fromRpc {
|
|
|
217
217
|
* @returns An RPC log.
|
|
218
218
|
*/
|
|
219
219
|
export function toRpc<
|
|
220
|
-
const log extends
|
|
220
|
+
const log extends toRpc.Input,
|
|
221
221
|
pending extends boolean = false,
|
|
222
222
|
>(log: log, _options: toRpc.Options<pending> = {}): Rpc<pending> {
|
|
223
223
|
return {
|
|
224
224
|
address: log.address,
|
|
225
225
|
blockHash: log.blockHash,
|
|
226
|
-
blockNumber: Quantity.
|
|
226
|
+
blockNumber: Quantity.fromNumberishOptional(log.blockNumber) ?? null,
|
|
227
227
|
...('blockTimestamp' in log
|
|
228
228
|
? {
|
|
229
229
|
blockTimestamp:
|
|
230
230
|
log.blockTimestamp === null
|
|
231
231
|
? null
|
|
232
|
-
: Quantity.
|
|
232
|
+
: Quantity.fromNumberishOptional(log.blockTimestamp),
|
|
233
233
|
}
|
|
234
234
|
: {}),
|
|
235
235
|
data: log.data,
|
|
236
|
-
logIndex: Quantity.
|
|
236
|
+
logIndex: Quantity.fromNumberishOptional(log.logIndex) ?? null,
|
|
237
237
|
topics: log.topics,
|
|
238
238
|
transactionHash: log.transactionHash,
|
|
239
|
-
transactionIndex:
|
|
239
|
+
transactionIndex:
|
|
240
|
+
Quantity.fromNumberishOptional(log.transactionIndex) ?? null,
|
|
240
241
|
removed: log.removed,
|
|
241
242
|
} as Rpc as never
|
|
242
243
|
}
|
|
243
244
|
|
|
244
245
|
export declare namespace toRpc {
|
|
246
|
+
/** Numberish input accepted by {@link ox#Log.(toRpc:function)}. */
|
|
247
|
+
type Input = Log<boolean, Hex.Hex | bigint | number, Hex.Hex | number>
|
|
248
|
+
|
|
245
249
|
type Options<pending extends boolean = false> = {
|
|
246
250
|
pending?: pending | boolean | undefined
|
|
247
251
|
}
|
package/src/core/Rlp.ts
CHANGED
|
@@ -5,6 +5,9 @@ import * as internal_bytes from './internal/bytes.js'
|
|
|
5
5
|
import * as Cursor from './internal/cursor.js'
|
|
6
6
|
import type { ExactPartial, RecursiveArray } from './internal/types.js'
|
|
7
7
|
|
|
8
|
+
/** Maximum nesting depth permitted when decoding an RLP value. */
|
|
9
|
+
const depthLimit = 1_024
|
|
10
|
+
|
|
8
11
|
/**
|
|
9
12
|
* Decodes a Recursive-Length Prefix (RLP) value into a {@link ox#Bytes.Bytes} value.
|
|
10
13
|
*
|
|
@@ -68,6 +71,12 @@ export function to<
|
|
|
68
71
|
})
|
|
69
72
|
const result = decodeRlpCursor(cursor, to_)
|
|
70
73
|
|
|
74
|
+
// RLP payloads encode exactly one item (Yellow Paper, Appendix B).
|
|
75
|
+
if (cursor.position < cursor.bytes.length)
|
|
76
|
+
throw new TrailingBytesError({
|
|
77
|
+
count: cursor.bytes.length - cursor.position,
|
|
78
|
+
})
|
|
79
|
+
|
|
71
80
|
return result as to.ReturnType<to>
|
|
72
81
|
}
|
|
73
82
|
|
|
@@ -82,6 +91,7 @@ export declare namespace to {
|
|
|
82
91
|
| decodeRlpCursor.ErrorType
|
|
83
92
|
| Cursor.create.ErrorType
|
|
84
93
|
| Hex.InvalidLengthError
|
|
94
|
+
| TrailingBytesError
|
|
85
95
|
| Errors.GlobalErrorType
|
|
86
96
|
}
|
|
87
97
|
|
|
@@ -91,7 +101,11 @@ export declare namespace to {
|
|
|
91
101
|
export function decodeRlpCursor<to extends 'Hex' | 'Bytes' = 'Hex'>(
|
|
92
102
|
cursor: Cursor.Cursor,
|
|
93
103
|
to: to | 'Hex' | 'Bytes' | undefined = 'Hex',
|
|
104
|
+
depth = 0,
|
|
94
105
|
): decodeRlpCursor.ReturnType<to> {
|
|
106
|
+
if (depth >= depthLimit)
|
|
107
|
+
throw new DepthLimitExceededError({ limit: depthLimit })
|
|
108
|
+
|
|
95
109
|
if (cursor.bytes.length === 0)
|
|
96
110
|
return (
|
|
97
111
|
to === 'Hex' ? Hex.fromBytes(cursor.bytes) : cursor.bytes
|
|
@@ -111,7 +125,12 @@ export function decodeRlpCursor<to extends 'Hex' | 'Bytes' = 'Hex'>(
|
|
|
111
125
|
|
|
112
126
|
// list
|
|
113
127
|
const length = readLength(cursor, prefix, 0xc0)
|
|
114
|
-
return readList(
|
|
128
|
+
return readList(
|
|
129
|
+
cursor,
|
|
130
|
+
length,
|
|
131
|
+
to,
|
|
132
|
+
depth + 1,
|
|
133
|
+
) as {} as decodeRlpCursor.ReturnType<to>
|
|
115
134
|
}
|
|
116
135
|
|
|
117
136
|
/** @internal */
|
|
@@ -121,6 +140,7 @@ export declare namespace decodeRlpCursor {
|
|
|
121
140
|
| Hex.fromBytes.ErrorType
|
|
122
141
|
| readLength.ErrorType
|
|
123
142
|
| readList.ErrorType
|
|
143
|
+
| DepthLimitExceededError
|
|
124
144
|
| Errors.GlobalErrorType
|
|
125
145
|
}
|
|
126
146
|
|
|
@@ -149,17 +169,27 @@ export function readList<to extends 'Hex' | 'Bytes'>(
|
|
|
149
169
|
cursor: Cursor.Cursor,
|
|
150
170
|
length: number,
|
|
151
171
|
to: to | 'Hex' | 'Bytes',
|
|
172
|
+
depth = 0,
|
|
152
173
|
) {
|
|
153
174
|
const position = cursor.position
|
|
154
175
|
const value: decodeRlpCursor.ReturnType<to>[] = []
|
|
155
176
|
while (cursor.position - position < length)
|
|
156
|
-
value.push(decodeRlpCursor(cursor, to))
|
|
177
|
+
value.push(decodeRlpCursor(cursor, to, depth))
|
|
178
|
+
// Items must consume exactly the declared list length.
|
|
179
|
+
if (cursor.position - position !== length)
|
|
180
|
+
throw new ListBoundaryExceededError({
|
|
181
|
+
consumed: cursor.position - position,
|
|
182
|
+
declared: length,
|
|
183
|
+
})
|
|
157
184
|
return value
|
|
158
185
|
}
|
|
159
186
|
|
|
160
187
|
/** @internal */
|
|
161
188
|
export declare namespace readList {
|
|
162
|
-
type ErrorType =
|
|
189
|
+
type ErrorType =
|
|
190
|
+
| DepthLimitExceededError
|
|
191
|
+
| ListBoundaryExceededError
|
|
192
|
+
| Errors.GlobalErrorType
|
|
163
193
|
}
|
|
164
194
|
|
|
165
195
|
/**
|
|
@@ -643,3 +673,36 @@ function writeBigEndian(
|
|
|
643
673
|
function invalidNibble(hex: Hex.Hex): Errors.BaseError {
|
|
644
674
|
return new Errors.BaseError(`Invalid hex string \`${hex}\`.`)
|
|
645
675
|
}
|
|
676
|
+
|
|
677
|
+
/** Thrown when an RLP value nests deeper than the decode depth limit. */
|
|
678
|
+
export class DepthLimitExceededError extends Errors.BaseError {
|
|
679
|
+
override readonly name = 'Rlp.DepthLimitExceededError'
|
|
680
|
+
|
|
681
|
+
constructor({ limit }: { limit: number }) {
|
|
682
|
+
super(`RLP depth limit of \`${limit}\` exceeded.`)
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
|
|
686
|
+
/** Thrown when RLP list items overrun the list's declared length. */
|
|
687
|
+
export class ListBoundaryExceededError extends Errors.BaseError {
|
|
688
|
+
override readonly name = 'Rlp.ListBoundaryExceededError'
|
|
689
|
+
|
|
690
|
+
constructor({ consumed, declared }: { consumed: number; declared: number }) {
|
|
691
|
+
super(
|
|
692
|
+
`RLP list items consumed \`${consumed}\` bytes but the list declared a length of \`${declared}\`.`,
|
|
693
|
+
)
|
|
694
|
+
}
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/** Thrown when an RLP payload contains bytes after the decoded item. */
|
|
698
|
+
export class TrailingBytesError extends Errors.BaseError {
|
|
699
|
+
override readonly name = 'Rlp.TrailingBytesError'
|
|
700
|
+
|
|
701
|
+
constructor({ count }: { count: number }) {
|
|
702
|
+
super(
|
|
703
|
+
`RLP payload encodes a single item, but \`${count}\` trailing ${
|
|
704
|
+
count === 1 ? 'byte remains' : 'bytes remain'
|
|
705
|
+
}.`,
|
|
706
|
+
)
|
|
707
|
+
}
|
|
708
|
+
}
|
package/src/core/RpcSchema.ts
CHANGED
|
@@ -289,7 +289,7 @@ export type FromViem<schema extends readonly ViemSchemaItem[]> = {
|
|
|
289
289
|
* Each method's name comes from its key. Both `params` and `ReturnType` are
|
|
290
290
|
* derived from the Zod schema's input (wire) type, since raw JSON-RPC clients
|
|
291
291
|
* send and receive wire values. Decode wire results to their native
|
|
292
|
-
* representation explicitly via
|
|
292
|
+
* representation explicitly via `zod.RpcSchema.decodeReturns`.
|
|
293
293
|
*
|
|
294
294
|
* @example
|
|
295
295
|
* ```ts twoslash
|
|
@@ -331,7 +331,7 @@ export type Schema = Generic | FromZod.Namespace
|
|
|
331
331
|
|
|
332
332
|
/**
|
|
333
333
|
* Resolves a {@link ox#RpcSchema.Schema} input to an Ox {@link ox#RpcSchema.Generic}.
|
|
334
|
-
* A Zod namespace is converted via {@link ox#RpcSchema.FromZod}; a `Generic` is
|
|
334
|
+
* A Zod namespace is converted via {@link ox#RpcSchema.(FromZod:type)}; a `Generic` is
|
|
335
335
|
* passed through; otherwise falls back to {@link ox#RpcSchema.Default}.
|
|
336
336
|
*/
|
|
337
337
|
export type ToGeneric<schema extends Schema | undefined> =
|
package/src/core/Signature.ts
CHANGED
|
@@ -2,6 +2,7 @@ import { secp256k1 } from '@noble/curves/secp256k1.js'
|
|
|
2
2
|
import * as Bytes from './Bytes.js'
|
|
3
3
|
import * as Errors from './Errors.js'
|
|
4
4
|
import * as Hex from './Hex.js'
|
|
5
|
+
import * as Quantity from './internal/quantity.js'
|
|
5
6
|
import type { Compute, ExactPartial, OneOf } from './internal/types.js'
|
|
6
7
|
import * as Json from './Json.js'
|
|
7
8
|
import * as Solidity from './Solidity.js'
|
|
@@ -806,16 +807,19 @@ export declare namespace toLegacy {
|
|
|
806
807
|
* @param signature - The {@link ox#Signature.Signature} to convert.
|
|
807
808
|
* @returns The converted {@link ox#Signature.Rpc}.
|
|
808
809
|
*/
|
|
809
|
-
export function toRpc(signature:
|
|
810
|
+
export function toRpc(signature: toRpc.Input): Rpc {
|
|
810
811
|
const { r, s, yParity } = signature
|
|
811
812
|
return {
|
|
812
813
|
r,
|
|
813
814
|
s,
|
|
814
|
-
yParity: yParity
|
|
815
|
+
yParity: Quantity.fromNumberish(yParity),
|
|
815
816
|
}
|
|
816
817
|
}
|
|
817
818
|
|
|
818
819
|
export declare namespace toRpc {
|
|
820
|
+
/** Numberish input accepted by {@link ox#Signature.(toRpc:function)}. */
|
|
821
|
+
type Input = Signature<true, Hex.Hex | number>
|
|
822
|
+
|
|
819
823
|
type ErrorType = Errors.GlobalErrorType
|
|
820
824
|
}
|
|
821
825
|
|
|
@@ -110,20 +110,20 @@ export function fromRpc(rpcStateOverrides: Rpc): StateOverrides {
|
|
|
110
110
|
* @param stateOverrides - The state overrides to convert.
|
|
111
111
|
* @returns An instantiated {@link ox#StateOverrides.Rpc}.
|
|
112
112
|
*/
|
|
113
|
-
export function toRpc(stateOverrides:
|
|
113
|
+
export function toRpc(stateOverrides: toRpc.Input): Rpc {
|
|
114
114
|
const rpcStateOverrides: Rpc = {}
|
|
115
115
|
for (const [address, accountOverrides] of Object.entries(stateOverrides)) {
|
|
116
116
|
const accountOverridesRpc: RpcAccountOverrides = {}
|
|
117
|
-
if (
|
|
118
|
-
accountOverridesRpc.balance = Quantity.
|
|
117
|
+
if (accountOverrides.balance !== undefined)
|
|
118
|
+
accountOverridesRpc.balance = Quantity.fromNumberish(
|
|
119
119
|
accountOverrides.balance,
|
|
120
120
|
)
|
|
121
121
|
if (accountOverrides.code) accountOverridesRpc.code = accountOverrides.code
|
|
122
122
|
if (accountOverrides.movePrecompileToAddress)
|
|
123
123
|
accountOverridesRpc.movePrecompileToAddress =
|
|
124
124
|
accountOverrides.movePrecompileToAddress
|
|
125
|
-
if (
|
|
126
|
-
accountOverridesRpc.nonce = Quantity.
|
|
125
|
+
if (accountOverrides.nonce !== undefined)
|
|
126
|
+
accountOverridesRpc.nonce = Quantity.fromNumberish(accountOverrides.nonce)
|
|
127
127
|
if (accountOverrides.state)
|
|
128
128
|
accountOverridesRpc.state = accountOverrides.state
|
|
129
129
|
if (accountOverrides.stateDiff)
|
|
@@ -132,3 +132,8 @@ export function toRpc(stateOverrides: StateOverrides): Rpc {
|
|
|
132
132
|
}
|
|
133
133
|
return rpcStateOverrides
|
|
134
134
|
}
|
|
135
|
+
|
|
136
|
+
export declare namespace toRpc {
|
|
137
|
+
/** Numberish input accepted by {@link ox#StateOverrides.(toRpc:function)}. */
|
|
138
|
+
type Input = StateOverrides<Hex.Hex | bigint | number>
|
|
139
|
+
}
|