@fhevm/sdk 0.0.1 → 1.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -0
- package/_cjs/core/_version.js +6 -0
- package/_cjs/core/_version.js.map +1 -0
- package/_cjs/core/actions/base/canReadPublicValue.js +13 -0
- package/_cjs/core/actions/base/canReadPublicValue.js.map +1 -0
- package/_cjs/core/actions/base/canReadPublicValues.js +13 -0
- package/_cjs/core/actions/base/canReadPublicValues.js.map +1 -0
- package/_cjs/core/actions/base/createVerifiedInputProofFromRawBytes.js +10 -0
- package/_cjs/core/actions/base/createVerifiedInputProofFromRawBytes.js.map +1 -0
- package/_cjs/core/actions/base/fetchKmsSignedcryptedShares.js +19 -0
- package/_cjs/core/actions/base/fetchKmsSignedcryptedShares.js.map +1 -0
- package/_cjs/core/actions/base/fetchVerifiedInputProof.js +11 -0
- package/_cjs/core/actions/base/fetchVerifiedInputProof.js.map +1 -0
- package/_cjs/core/actions/base/index.js +30 -0
- package/_cjs/core/actions/base/index.js.map +1 -0
- package/_cjs/core/actions/base/readCoprocessorSignersContext.js +10 -0
- package/_cjs/core/actions/base/readCoprocessorSignersContext.js.map +1 -0
- package/_cjs/core/actions/base/readKmsSignersContext.js +10 -0
- package/_cjs/core/actions/base/readKmsSignersContext.js.map +1 -0
- package/_cjs/core/actions/base/readPublicValue.js +13 -0
- package/_cjs/core/actions/base/readPublicValue.js.map +1 -0
- package/_cjs/core/actions/base/readPublicValues.js +13 -0
- package/_cjs/core/actions/base/readPublicValues.js.map +1 -0
- package/_cjs/core/actions/base/readPublicValuesWithSignatures.js +21 -0
- package/_cjs/core/actions/base/readPublicValuesWithSignatures.js.map +1 -0
- package/_cjs/core/actions/base/signDecryptionPermit.js +11 -0
- package/_cjs/core/actions/base/signDecryptionPermit.js.map +1 -0
- package/_cjs/core/actions/base/verifyHandlesCoprocessorSignatures.js +31 -0
- package/_cjs/core/actions/base/verifyHandlesCoprocessorSignatures.js.map +1 -0
- package/_cjs/core/actions/base/verifyInputProof.js +24 -0
- package/_cjs/core/actions/base/verifyInputProof.js.map +1 -0
- package/_cjs/core/actions/base/verifyZkProofCoprocessorSignatures.js +17 -0
- package/_cjs/core/actions/base/verifyZkProofCoprocessorSignatures.js.map +1 -0
- package/_cjs/core/actions/chain/createCoprocessorEip712Domain.js +11 -0
- package/_cjs/core/actions/chain/createCoprocessorEip712Domain.js.map +1 -0
- package/_cjs/core/actions/chain/createKmsDelegatedUserDecryptEip712.js +17 -0
- package/_cjs/core/actions/chain/createKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_cjs/core/actions/chain/createKmsEip712Domain.js +11 -0
- package/_cjs/core/actions/chain/createKmsEip712Domain.js.map +1 -0
- package/_cjs/core/actions/chain/createKmsUserDecryptEip712.js +16 -0
- package/_cjs/core/actions/chain/createKmsUserDecryptEip712.js.map +1 -0
- package/_cjs/core/actions/chain/fetchFheEncryptionKeyBytes.js +8 -0
- package/_cjs/core/actions/chain/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_cjs/core/actions/chain/index.js +28 -0
- package/_cjs/core/actions/chain/index.js.map +1 -0
- package/_cjs/core/actions/chain/parseSignedDecryptionPermit.js +10 -0
- package/_cjs/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -0
- package/_cjs/core/actions/chain/parseTransportKeypair.js +9 -0
- package/_cjs/core/actions/chain/parseTransportKeypair.js.map +1 -0
- package/_cjs/core/actions/chain/serializeSignedDecryptionPermit.js +8 -0
- package/_cjs/core/actions/chain/serializeSignedDecryptionPermit.js.map +1 -0
- package/_cjs/core/actions/chain/serializeTransportKeypair.js +8 -0
- package/_cjs/core/actions/chain/serializeTransportKeypair.js.map +1 -0
- package/_cjs/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js +8 -0
- package/_cjs/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_cjs/core/actions/chain/verifyKmsUserDecryptEip712.js +8 -0
- package/_cjs/core/actions/chain/verifyKmsUserDecryptEip712.js.map +1 -0
- package/_cjs/core/actions/decrypt/canDecryptValue.js +20 -0
- package/_cjs/core/actions/decrypt/canDecryptValue.js.map +1 -0
- package/_cjs/core/actions/decrypt/canDecryptValues.js +23 -0
- package/_cjs/core/actions/decrypt/canDecryptValues.js.map +1 -0
- package/_cjs/core/actions/decrypt/canDecryptValuesFromPairs.js +19 -0
- package/_cjs/core/actions/decrypt/canDecryptValuesFromPairs.js.map +1 -0
- package/_cjs/core/actions/decrypt/decryptKmsSignedcryptedShares.js +11 -0
- package/_cjs/core/actions/decrypt/decryptKmsSignedcryptedShares.js.map +1 -0
- package/_cjs/core/actions/decrypt/decryptValue.js +20 -0
- package/_cjs/core/actions/decrypt/decryptValue.js.map +1 -0
- package/_cjs/core/actions/decrypt/decryptValues.js +19 -0
- package/_cjs/core/actions/decrypt/decryptValues.js.map +1 -0
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js +18 -0
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -0
- package/_cjs/core/actions/decrypt/generateTransportKeypair.js +8 -0
- package/_cjs/core/actions/decrypt/generateTransportKeypair.js.map +1 -0
- package/_cjs/core/actions/decrypt/index.js +20 -0
- package/_cjs/core/actions/decrypt/index.js.map +1 -0
- package/_cjs/core/actions/encrypt/encryptValue.js +24 -0
- package/_cjs/core/actions/encrypt/encryptValue.js.map +1 -0
- package/_cjs/core/actions/encrypt/encryptValues.js +23 -0
- package/_cjs/core/actions/encrypt/encryptValues.js.map +1 -0
- package/_cjs/core/actions/encrypt/generateZkProof.js +17 -0
- package/_cjs/core/actions/encrypt/generateZkProof.js.map +1 -0
- package/_cjs/core/actions/encrypt/index.js +10 -0
- package/_cjs/core/actions/encrypt/index.js.map +1 -0
- package/_cjs/core/actions/host/getUserDecryptionDelegationExpirationDate.js +21 -0
- package/_cjs/core/actions/host/getUserDecryptionDelegationExpirationDate.js.map +1 -0
- package/_cjs/core/actions/host/index.js +18 -0
- package/_cjs/core/actions/host/index.js.map +1 -0
- package/_cjs/core/actions/host/isAllowedForDecryption.js +20 -0
- package/_cjs/core/actions/host/isAllowedForDecryption.js.map +1 -0
- package/_cjs/core/actions/host/persistAllowed.js +20 -0
- package/_cjs/core/actions/host/persistAllowed.js.map +1 -0
- package/_cjs/core/actions/host/readFhevmExecutorContractData.js +46 -0
- package/_cjs/core/actions/host/readFhevmExecutorContractData.js.map +1 -0
- package/_cjs/core/actions/host/readInputVerifierContractData.js +41 -0
- package/_cjs/core/actions/host/readInputVerifierContractData.js.map +1 -0
- package/_cjs/core/actions/host/readKmsVerifierContractData.js +41 -0
- package/_cjs/core/actions/host/readKmsVerifierContractData.js.map +1 -0
- package/_cjs/core/actions/host/resolveChainId.js +23 -0
- package/_cjs/core/actions/host/resolveChainId.js.map +1 -0
- package/_cjs/core/actions/host/resolveFhevmConfig.js +85 -0
- package/_cjs/core/actions/host/resolveFhevmConfig.js.map +1 -0
- package/_cjs/core/base/address.js +182 -0
- package/_cjs/core/base/address.js.map +1 -0
- package/_cjs/core/base/auth.js +32 -0
- package/_cjs/core/base/auth.js.map +1 -0
- package/_cjs/core/base/boolean.js +33 -0
- package/_cjs/core/base/boolean.js.map +1 -0
- package/_cjs/core/base/bytes.js +1016 -0
- package/_cjs/core/base/bytes.js.map +1 -0
- package/_cjs/core/base/cachedFetch.js +78 -0
- package/_cjs/core/base/cachedFetch.js.map +1 -0
- package/_cjs/core/base/errors/AddressError.js +15 -0
- package/_cjs/core/base/errors/AddressError.js.map +1 -0
- package/_cjs/core/base/errors/ChecksummedAddressError.js +17 -0
- package/_cjs/core/base/errors/ChecksummedAddressError.js.map +1 -0
- package/_cjs/core/base/errors/ErrorBase.js +70 -0
- package/_cjs/core/base/errors/ErrorBase.js.map +1 -0
- package/_cjs/core/base/errors/FetchError.js +33 -0
- package/_cjs/core/base/errors/FetchError.js.map +1 -0
- package/_cjs/core/base/errors/FheTypeError.js +45 -0
- package/_cjs/core/base/errors/FheTypeError.js.map +1 -0
- package/_cjs/core/base/errors/InternalError.js +21 -0
- package/_cjs/core/base/errors/InternalError.js.map +1 -0
- package/_cjs/core/base/errors/InvalidPropertyError.js +72 -0
- package/_cjs/core/base/errors/InvalidPropertyError.js.map +1 -0
- package/_cjs/core/base/errors/InvalidTypeError.js +31 -0
- package/_cjs/core/base/errors/InvalidTypeError.js.map +1 -0
- package/_cjs/core/base/errors/utils.js +40 -0
- package/_cjs/core/base/errors/utils.js.map +1 -0
- package/_cjs/core/base/fetch.js +98 -0
- package/_cjs/core/base/fetch.js.map +1 -0
- package/_cjs/core/base/index.js +7 -0
- package/_cjs/core/base/index.js.map +1 -0
- package/_cjs/core/base/isomorphicWorker.js +209 -0
- package/_cjs/core/base/isomorphicWorker.js.map +1 -0
- package/_cjs/core/base/object.js +30 -0
- package/_cjs/core/base/object.js.map +1 -0
- package/_cjs/core/base/promise.js +14 -0
- package/_cjs/core/base/promise.js.map +1 -0
- package/_cjs/core/base/record.js +81 -0
- package/_cjs/core/base/record.js.map +1 -0
- package/_cjs/core/base/string.js +133 -0
- package/_cjs/core/base/string.js.map +1 -0
- package/_cjs/core/base/timeout.js +19 -0
- package/_cjs/core/base/timeout.js.map +1 -0
- package/_cjs/core/base/trustedValue.js +50 -0
- package/_cjs/core/base/trustedValue.js.map +1 -0
- package/_cjs/core/base/typedValue.js +184 -0
- package/_cjs/core/base/typedValue.js.map +1 -0
- package/_cjs/core/base/uid.js +19 -0
- package/_cjs/core/base/uid.js.map +1 -0
- package/_cjs/core/base/uint.js +414 -0
- package/_cjs/core/base/uint.js.map +1 -0
- package/_cjs/core/base/wasm.js +91 -0
- package/_cjs/core/base/wasm.js.map +1 -0
- package/_cjs/core/chains/definitions/localTestnet.js +33 -0
- package/_cjs/core/chains/definitions/localTestnet.js.map +1 -0
- package/_cjs/core/chains/definitions/mainnet.js +33 -0
- package/_cjs/core/chains/definitions/mainnet.js.map +1 -0
- package/_cjs/core/chains/definitions/sepolia.js +33 -0
- package/_cjs/core/chains/definitions/sepolia.js.map +1 -0
- package/_cjs/core/chains/index.js +10 -0
- package/_cjs/core/chains/index.js.map +1 -0
- package/_cjs/core/chains/utils.js +8 -0
- package/_cjs/core/chains/utils.js.map +1 -0
- package/_cjs/core/clients/decorators/base.js +34 -0
- package/_cjs/core/clients/decorators/base.js.map +1 -0
- package/_cjs/core/clients/decorators/decrypt.js +30 -0
- package/_cjs/core/clients/decorators/decrypt.js.map +1 -0
- package/_cjs/core/clients/decorators/encrypt-p.js +13 -0
- package/_cjs/core/clients/decorators/encrypt-p.js.map +1 -0
- package/_cjs/core/clients/decorators/encrypt.js +23 -0
- package/_cjs/core/clients/decorators/encrypt.js.map +1 -0
- package/_cjs/core/coprocessor/InputProof-p.js +236 -0
- package/_cjs/core/coprocessor/InputProof-p.js.map +1 -0
- package/_cjs/core/coprocessor/ZkProof-p.js +241 -0
- package/_cjs/core/coprocessor/ZkProof-p.js.map +1 -0
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js +192 -0
- package/_cjs/core/coprocessor/ZkProofBuilder-p.js.map +1 -0
- package/_cjs/core/coprocessor/assertIsCoprocessorEip712Domain.js +19 -0
- package/_cjs/core/coprocessor/assertIsCoprocessorEip712Domain.js.map +1 -0
- package/_cjs/core/coprocessor/coprocessorEip712Types.js +17 -0
- package/_cjs/core/coprocessor/coprocessorEip712Types.js.map +1 -0
- package/_cjs/core/coprocessor/createCoprocessorEip712.js +41 -0
- package/_cjs/core/coprocessor/createCoprocessorEip712.js.map +1 -0
- package/_cjs/core/coprocessor/createCoprocessorEip712Domain.js +18 -0
- package/_cjs/core/coprocessor/createCoprocessorEip712Domain.js.map +1 -0
- package/_cjs/core/coprocessor/encrypt.js +20 -0
- package/_cjs/core/coprocessor/encrypt.js.map +1 -0
- package/_cjs/core/coprocessor/fetchVerifiedInputProof.js +41 -0
- package/_cjs/core/coprocessor/fetchVerifiedInputProof.js.map +1 -0
- package/_cjs/core/coprocessor/verifyHandlesCoprocessorSignatures.js +33 -0
- package/_cjs/core/coprocessor/verifyHandlesCoprocessorSignatures.js.map +1 -0
- package/_cjs/core/coprocessor/verifyInputProof.js +24 -0
- package/_cjs/core/coprocessor/verifyInputProof.js.map +1 -0
- package/_cjs/core/errors/AclError.js +48 -0
- package/_cjs/core/errors/AclError.js.map +1 -0
- package/_cjs/core/errors/ContractErrorBase.js +34 -0
- package/_cjs/core/errors/ContractErrorBase.js.map +1 -0
- package/_cjs/core/errors/EncryptionError.js +14 -0
- package/_cjs/core/errors/EncryptionError.js.map +1 -0
- package/_cjs/core/errors/FhevmConfigError.js +14 -0
- package/_cjs/core/errors/FhevmConfigError.js.map +1 -0
- package/_cjs/core/errors/FhevmErrorBase.js +66 -0
- package/_cjs/core/errors/FhevmErrorBase.js.map +1 -0
- package/_cjs/core/errors/FhevmHandleError.js +15 -0
- package/_cjs/core/errors/FhevmHandleError.js.map +1 -0
- package/_cjs/core/errors/InputProofError.js +25 -0
- package/_cjs/core/errors/InputProofError.js.map +1 -0
- package/_cjs/core/errors/RelayerAbortError.js +16 -0
- package/_cjs/core/errors/RelayerAbortError.js.map +1 -0
- package/_cjs/core/errors/RelayerErrorBase.js +85 -0
- package/_cjs/core/errors/RelayerErrorBase.js.map +1 -0
- package/_cjs/core/errors/RelayerFetchError.js +19 -0
- package/_cjs/core/errors/RelayerFetchError.js.map +1 -0
- package/_cjs/core/errors/RelayerFetchErrorBase.js +74 -0
- package/_cjs/core/errors/RelayerFetchErrorBase.js.map +1 -0
- package/_cjs/core/errors/RelayerMaxRetryError.js +17 -0
- package/_cjs/core/errors/RelayerMaxRetryError.js.map +1 -0
- package/_cjs/core/errors/RelayerRequestErrorBase.js +48 -0
- package/_cjs/core/errors/RelayerRequestErrorBase.js.map +1 -0
- package/_cjs/core/errors/RelayerRequestInternalError.js +45 -0
- package/_cjs/core/errors/RelayerRequestInternalError.js.map +1 -0
- package/_cjs/core/errors/RelayerResponseApiError.js +36 -0
- package/_cjs/core/errors/RelayerResponseApiError.js.map +1 -0
- package/_cjs/core/errors/RelayerResponseErrorBase.js +33 -0
- package/_cjs/core/errors/RelayerResponseErrorBase.js.map +1 -0
- package/_cjs/core/errors/RelayerResponseInputProofRejectedError.js +15 -0
- package/_cjs/core/errors/RelayerResponseInputProofRejectedError.js.map +1 -0
- package/_cjs/core/errors/RelayerResponseInvalidBodyError.js +36 -0
- package/_cjs/core/errors/RelayerResponseInvalidBodyError.js.map +1 -0
- package/_cjs/core/errors/RelayerResponseStatusError.js +17 -0
- package/_cjs/core/errors/RelayerResponseStatusError.js.map +1 -0
- package/_cjs/core/errors/RelayerStateError.js +33 -0
- package/_cjs/core/errors/RelayerStateError.js.map +1 -0
- package/_cjs/core/errors/RelayerTimeoutError.js +16 -0
- package/_cjs/core/errors/RelayerTimeoutError.js.map +1 -0
- package/_cjs/core/errors/SignersError.js +35 -0
- package/_cjs/core/errors/SignersError.js.map +1 -0
- package/_cjs/core/errors/TfheError.js +14 -0
- package/_cjs/core/errors/TfheError.js.map +1 -0
- package/_cjs/core/errors/ZkProofError.js +15 -0
- package/_cjs/core/errors/ZkProofError.js.map +1 -0
- package/_cjs/core/handle/ClearValue.js +185 -0
- package/_cjs/core/handle/ClearValue.js.map +1 -0
- package/_cjs/core/handle/EncryptedValue.js +32 -0
- package/_cjs/core/handle/EncryptedValue.js.map +1 -0
- package/_cjs/core/handle/FheType.js +298 -0
- package/_cjs/core/handle/FheType.js.map +1 -0
- package/_cjs/core/handle/FhevmHandle.js +352 -0
- package/_cjs/core/handle/FhevmHandle.js.map +1 -0
- package/_cjs/core/host-contracts/CoprocessorSignersContext-p.js +119 -0
- package/_cjs/core/host-contracts/CoprocessorSignersContext-p.js.map +1 -0
- package/_cjs/core/host-contracts/FhevmExecutorContractData-p.js +96 -0
- package/_cjs/core/host-contracts/FhevmExecutorContractData-p.js.map +1 -0
- package/_cjs/core/host-contracts/HostContractVersion-p.js +86 -0
- package/_cjs/core/host-contracts/HostContractVersion-p.js.map +1 -0
- package/_cjs/core/host-contracts/InputVerifierContractData-p.js +95 -0
- package/_cjs/core/host-contracts/InputVerifierContractData-p.js.map +1 -0
- package/_cjs/core/host-contracts/KmsSignersContext-p.js +165 -0
- package/_cjs/core/host-contracts/KmsSignersContext-p.js.map +1 -0
- package/_cjs/core/host-contracts/KmsVerifierContractData-p.js +77 -0
- package/_cjs/core/host-contracts/KmsVerifierContractData-p.js.map +1 -0
- package/_cjs/core/host-contracts/abi-fragments/fragments.js +336 -0
- package/_cjs/core/host-contracts/abi-fragments/fragments.js.map +1 -0
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js +47 -0
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -0
- package/_cjs/core/host-contracts/checkAllowedForDecryption.js +17 -0
- package/_cjs/core/host-contracts/checkAllowedForDecryption.js.map +1 -0
- package/_cjs/core/host-contracts/checkPersistAllowed.js +75 -0
- package/_cjs/core/host-contracts/checkPersistAllowed.js.map +1 -0
- package/_cjs/core/host-contracts/decryptionResultTypehash-p.js +26 -0
- package/_cjs/core/host-contracts/decryptionResultTypehash-p.js.map +1 -0
- package/_cjs/core/host-contracts/eip712Domain-p.js +43 -0
- package/_cjs/core/host-contracts/eip712Domain-p.js.map +1 -0
- package/_cjs/core/host-contracts/eip712InputVerificationTypehash-p.js +26 -0
- package/_cjs/core/host-contracts/eip712InputVerificationTypehash-p.js.map +1 -0
- package/_cjs/core/host-contracts/getAclAddress-p.js +26 -0
- package/_cjs/core/host-contracts/getAclAddress-p.js.map +1 -0
- package/_cjs/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js +72 -0
- package/_cjs/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js.map +1 -0
- package/_cjs/core/host-contracts/getCoprocessorSigners-p.js +26 -0
- package/_cjs/core/host-contracts/getCoprocessorSigners-p.js.map +1 -0
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js +40 -0
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -0
- package/_cjs/core/host-contracts/getFhevmExecutorAddress-p.js +26 -0
- package/_cjs/core/host-contracts/getFhevmExecutorAddress-p.js.map +1 -0
- package/_cjs/core/host-contracts/getHandleVersion-p.js +21 -0
- package/_cjs/core/host-contracts/getHandleVersion-p.js.map +1 -0
- package/_cjs/core/host-contracts/getHcuLimitAddress-p.js +26 -0
- package/_cjs/core/host-contracts/getHcuLimitAddress-p.js.map +1 -0
- package/_cjs/core/host-contracts/getInputVerifierAddress-p.js +26 -0
- package/_cjs/core/host-contracts/getInputVerifierAddress-p.js.map +1 -0
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js +78 -0
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -0
- package/_cjs/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +57 -0
- package/_cjs/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -0
- package/_cjs/core/host-contracts/getSignersForKmsContext-p.js +54 -0
- package/_cjs/core/host-contracts/getSignersForKmsContext-p.js.map +1 -0
- package/_cjs/core/host-contracts/isAllowedForDecryption.js +30 -0
- package/_cjs/core/host-contracts/isAllowedForDecryption.js.map +1 -0
- package/_cjs/core/host-contracts/isUserDecryptable.js +54 -0
- package/_cjs/core/host-contracts/isUserDecryptable.js.map +1 -0
- package/_cjs/core/host-contracts/persistAllowed.js +31 -0
- package/_cjs/core/host-contracts/persistAllowed.js.map +1 -0
- package/_cjs/core/host-contracts/readCoprocessorSignersContext-p.js +15 -0
- package/_cjs/core/host-contracts/readCoprocessorSignersContext-p.js.map +1 -0
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js +103 -0
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js.map +1 -0
- package/_cjs/core/key/FheEncryptionKeyCache-p.js +221 -0
- package/_cjs/core/key/FheEncryptionKeyCache-p.js.map +1 -0
- package/_cjs/core/key/FheEncryptionKeyWasm-p.js +66 -0
- package/_cjs/core/key/FheEncryptionKeyWasm-p.js.map +1 -0
- package/_cjs/core/key/deserializeFheEncryptionKey.js +18 -0
- package/_cjs/core/key/deserializeFheEncryptionKey.js.map +1 -0
- package/_cjs/core/key/fetchFheEncryptionKey.js +30 -0
- package/_cjs/core/key/fetchFheEncryptionKey.js.map +1 -0
- package/_cjs/core/key/fetchFheEncryptionKeyBytes.js +39 -0
- package/_cjs/core/key/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_cjs/core/key/fetchFheEncryptionKeyBytesWithSource.js +53 -0
- package/_cjs/core/key/fetchFheEncryptionKeyBytesWithSource.js.map +1 -0
- package/_cjs/core/key/serializeFheEncryptionKey.js +22 -0
- package/_cjs/core/key/serializeFheEncryptionKey.js.map +1 -0
- package/_cjs/core/kms/KmsSigncryptedShares-p.js +94 -0
- package/_cjs/core/kms/KmsSigncryptedShares-p.js.map +1 -0
- package/_cjs/core/kms/PublicDecryptionProof-p.js +95 -0
- package/_cjs/core/kms/PublicDecryptionProof-p.js.map +1 -0
- package/_cjs/core/kms/PublicDecryptionProof.js +8 -0
- package/_cjs/core/kms/PublicDecryptionProof.js.map +1 -0
- package/_cjs/core/kms/SignedDecryptionPermit-p.js +230 -0
- package/_cjs/core/kms/SignedDecryptionPermit-p.js.map +1 -0
- package/_cjs/core/kms/TransportKeypair-p.js +153 -0
- package/_cjs/core/kms/TransportKeypair-p.js.map +1 -0
- package/_cjs/core/kms/createKmsDelegatedUserDecryptEip712.js +72 -0
- package/_cjs/core/kms/createKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_cjs/core/kms/createKmsEip712Domain.js +33 -0
- package/_cjs/core/kms/createKmsEip712Domain.js.map +1 -0
- package/_cjs/core/kms/createKmsPublicDecryptEip712.js +39 -0
- package/_cjs/core/kms/createKmsPublicDecryptEip712.js.map +1 -0
- package/_cjs/core/kms/createKmsUserDecryptEip712.js +91 -0
- package/_cjs/core/kms/createKmsUserDecryptEip712.js.map +1 -0
- package/_cjs/core/kms/decryptKmsSignedcryptedShares-p.js +14 -0
- package/_cjs/core/kms/decryptKmsSignedcryptedShares-p.js.map +1 -0
- package/_cjs/core/kms/decryptValuesFromPairs.js +14 -0
- package/_cjs/core/kms/decryptValuesFromPairs.js.map +1 -0
- package/_cjs/core/kms/fetchKmsSignedcryptedShares-p.js +89 -0
- package/_cjs/core/kms/fetchKmsSignedcryptedShares-p.js.map +1 -0
- package/_cjs/core/kms/index.js +3 -0
- package/_cjs/core/kms/index.js.map +1 -0
- package/_cjs/core/kms/kmsDelegatedUserDecryptEip712Types.js +25 -0
- package/_cjs/core/kms/kmsDelegatedUserDecryptEip712Types.js.map +1 -0
- package/_cjs/core/kms/kmsExtraData.js +33 -0
- package/_cjs/core/kms/kmsExtraData.js.map +1 -0
- package/_cjs/core/kms/kmsPublicDecryptEip712Types.js +22 -0
- package/_cjs/core/kms/kmsPublicDecryptEip712Types.js.map +1 -0
- package/_cjs/core/kms/kmsUserDecryptEip712Types.js +24 -0
- package/_cjs/core/kms/kmsUserDecryptEip712Types.js.map +1 -0
- package/_cjs/core/kms/publicDecrypt.js +55 -0
- package/_cjs/core/kms/publicDecrypt.js.map +1 -0
- package/_cjs/core/kms/utils.js +34 -0
- package/_cjs/core/kms/utils.js.map +1 -0
- package/_cjs/core/kms/verifyKmsPublicDecryptEip712-p.js +34 -0
- package/_cjs/core/kms/verifyKmsPublicDecryptEip712-p.js.map +1 -0
- package/_cjs/core/modules/decrypt/mock.js +69 -0
- package/_cjs/core/modules/decrypt/mock.js.map +1 -0
- package/_cjs/core/modules/decrypt/module/api-p.js +197 -0
- package/_cjs/core/modules/decrypt/module/api-p.js.map +1 -0
- package/_cjs/core/modules/decrypt/module/index.js +43 -0
- package/_cjs/core/modules/decrypt/module/index.js.map +1 -0
- package/_cjs/core/modules/decrypt/module/init-p.js +124 -0
- package/_cjs/core/modules/decrypt/module/init-p.js.map +1 -0
- package/_cjs/core/modules/decrypt/types.js +3 -0
- package/_cjs/core/modules/decrypt/types.js.map +1 -0
- package/_cjs/core/modules/encrypt/mock.js +50 -0
- package/_cjs/core/modules/encrypt/mock.js.map +1 -0
- package/_cjs/core/modules/encrypt/module/api-p.js +263 -0
- package/_cjs/core/modules/encrypt/module/api-p.js.map +1 -0
- package/_cjs/core/modules/encrypt/module/index.js +22 -0
- package/_cjs/core/modules/encrypt/module/index.js.map +1 -0
- package/_cjs/core/modules/encrypt/module/init-p.js +175 -0
- package/_cjs/core/modules/encrypt/module/init-p.js.map +1 -0
- package/_cjs/core/modules/encrypt/types.js +3 -0
- package/_cjs/core/modules/encrypt/types.js.map +1 -0
- package/_cjs/core/modules/ethereum/createTrustedClient.js +9 -0
- package/_cjs/core/modules/ethereum/createTrustedClient.js.map +1 -0
- package/_cjs/core/modules/ethereum/types.js +3 -0
- package/_cjs/core/modules/ethereum/types.js.map +1 -0
- package/_cjs/core/modules/relayer/mock.js +29 -0
- package/_cjs/core/modules/relayer/mock.js.map +1 -0
- package/_cjs/core/modules/relayer/module/RelayerAsyncRequest.js +1231 -0
- package/_cjs/core/modules/relayer/module/RelayerAsyncRequest.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchCoprocessorSignatures.js +30 -0
- package/_cjs/core/modules/relayer/module/fetchCoprocessorSignatures.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecrypt.js +47 -0
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeyBytes.js +19 -0
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeySource.js +124 -0
- package/_cjs/core/modules/relayer/module/fetchFheEncryptionKeySource.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchPublicDecrypt.js +27 -0
- package/_cjs/core/modules/relayer/module/fetchPublicDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js +48 -0
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerInputProofSucceeded.js +39 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerInputProofSucceeded.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.js +21 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseFailed.js +122 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseFailed.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseQueued.js +23 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseQueued.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.js +27 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js +39 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.js +56 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError404.js +12 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError404.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError429.js +12 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError429.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError500.js +12 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError500.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js +17 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js.map +1 -0
- package/_cjs/core/modules/relayer/module/index.js +23 -0
- package/_cjs/core/modules/relayer/module/index.js.map +1 -0
- package/_cjs/core/modules/relayer/module/relayerUrl.js +36 -0
- package/_cjs/core/modules/relayer/module/relayerUrl.js.map +1 -0
- package/_cjs/core/modules/relayer/module/utils.js +22 -0
- package/_cjs/core/modules/relayer/module/utils.js.map +1 -0
- package/_cjs/core/modules/relayer/types.js +3 -0
- package/_cjs/core/modules/relayer/types.js.map +1 -0
- package/_cjs/core/runtime/CoreFhevm-p.js +221 -0
- package/_cjs/core/runtime/CoreFhevm-p.js.map +1 -0
- package/_cjs/core/runtime/CoreFhevmRuntime-p.js +156 -0
- package/_cjs/core/runtime/CoreFhevmRuntime-p.js.map +1 -0
- package/_cjs/core/runtime/FhevmRuntime.js +9 -0
- package/_cjs/core/runtime/FhevmRuntime.js.map +1 -0
- package/_cjs/core/runtime/initFhevmDecryptRuntime-p.js +11 -0
- package/_cjs/core/runtime/initFhevmDecryptRuntime-p.js.map +1 -0
- package/_cjs/core/runtime/initFhevmEncryptRuntime-p.js +11 -0
- package/_cjs/core/runtime/initFhevmEncryptRuntime-p.js.map +1 -0
- package/_cjs/core/runtime/initFhevmRuntime-p.js +12 -0
- package/_cjs/core/runtime/initFhevmRuntime-p.js.map +1 -0
- package/_cjs/core/types/auth.js +3 -0
- package/_cjs/core/types/auth.js.map +1 -0
- package/_cjs/core/types/configs.js +3 -0
- package/_cjs/core/types/configs.js.map +1 -0
- package/_cjs/core/types/coprocessor.js +3 -0
- package/_cjs/core/types/coprocessor.js.map +1 -0
- package/_cjs/core/types/coprocessorSignersContext.js +3 -0
- package/_cjs/core/types/coprocessorSignersContext.js.map +1 -0
- package/_cjs/core/types/coreFhevmClient.js +3 -0
- package/_cjs/core/types/coreFhevmClient.js.map +1 -0
- package/_cjs/core/types/coreFhevmRuntime.js +3 -0
- package/_cjs/core/types/coreFhevmRuntime.js.map +1 -0
- package/_cjs/core/types/encryptedTypes-p.js +3 -0
- package/_cjs/core/types/encryptedTypes-p.js.map +1 -0
- package/_cjs/core/types/encryptedTypes.js +3 -0
- package/_cjs/core/types/encryptedTypes.js.map +1 -0
- package/_cjs/core/types/fheEncryptionKey.js +3 -0
- package/_cjs/core/types/fheEncryptionKey.js.map +1 -0
- package/_cjs/core/types/fheType.js +3 -0
- package/_cjs/core/types/fheType.js.map +1 -0
- package/_cjs/core/types/fhevmChain.js +3 -0
- package/_cjs/core/types/fhevmChain.js.map +1 -0
- package/_cjs/core/types/fhevmClient.js +3 -0
- package/_cjs/core/types/fhevmClient.js.map +1 -0
- package/_cjs/core/types/fhevmDecryptionKey.js +3 -0
- package/_cjs/core/types/fhevmDecryptionKey.js.map +1 -0
- package/_cjs/core/types/fhevmUser.js +3 -0
- package/_cjs/core/types/fhevmUser.js.map +1 -0
- package/_cjs/core/types/hostContract.js +3 -0
- package/_cjs/core/types/hostContract.js.map +1 -0
- package/_cjs/core/types/index.js +3 -0
- package/_cjs/core/types/index.js.map +1 -0
- package/_cjs/core/types/inputProof.js +3 -0
- package/_cjs/core/types/inputProof.js.map +1 -0
- package/_cjs/core/types/kms-p.js +3 -0
- package/_cjs/core/types/kms-p.js.map +1 -0
- package/_cjs/core/types/kms.js +3 -0
- package/_cjs/core/types/kms.js.map +1 -0
- package/_cjs/core/types/kmsSignersContext.js +3 -0
- package/_cjs/core/types/kmsSignersContext.js.map +1 -0
- package/_cjs/core/types/logger.js +3 -0
- package/_cjs/core/types/logger.js.map +1 -0
- package/_cjs/core/types/other-p.js +3 -0
- package/_cjs/core/types/other-p.js.map +1 -0
- package/_cjs/core/types/primitives.js +3 -0
- package/_cjs/core/types/primitives.js.map +1 -0
- package/_cjs/core/types/publicDecryptionProof-p.js +3 -0
- package/_cjs/core/types/publicDecryptionProof-p.js.map +1 -0
- package/_cjs/core/types/record-p.js +3 -0
- package/_cjs/core/types/record-p.js.map +1 -0
- package/_cjs/core/types/relayer-p.js +3 -0
- package/_cjs/core/types/relayer-p.js.map +1 -0
- package/_cjs/core/types/relayer.js +3 -0
- package/_cjs/core/types/relayer.js.map +1 -0
- package/_cjs/core/types/signedDecryptionPermit.js +3 -0
- package/_cjs/core/types/signedDecryptionPermit.js.map +1 -0
- package/_cjs/core/types/tkms-p.js +3 -0
- package/_cjs/core/types/tkms-p.js.map +1 -0
- package/_cjs/core/types/utils.js +3 -0
- package/_cjs/core/types/utils.js.map +1 -0
- package/_cjs/core/types/zkProof-p.js +3 -0
- package/_cjs/core/types/zkProof-p.js.map +1 -0
- package/_cjs/core/types/zkProofBuilder.js +3 -0
- package/_cjs/core/types/zkProofBuilder.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/assertPermitMatchesKeypair.js +14 -0
- package/_cjs/core/utils-p/decrypt/assertPermitMatchesKeypair.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js +32 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js +32 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/verifyTkmsPublicKey.js +13 -0
- package/_cjs/core/utils-p/decrypt/verifyTkmsPublicKey.js.map +1 -0
- package/_cjs/core/utils-p/runtime/recoverSigners.js +23 -0
- package/_cjs/core/utils-p/runtime/recoverSigners.js.map +1 -0
- package/_cjs/ethers/clients/createFhevmBaseClient.js +16 -0
- package/_cjs/ethers/clients/createFhevmBaseClient.js.map +1 -0
- package/_cjs/ethers/clients/createFhevmClient.js +11 -0
- package/_cjs/ethers/clients/createFhevmClient.js.map +1 -0
- package/_cjs/ethers/clients/createFhevmDecryptClient.js +10 -0
- package/_cjs/ethers/clients/createFhevmDecryptClient.js.map +1 -0
- package/_cjs/ethers/clients/createFhevmEncryptClient.js +10 -0
- package/_cjs/ethers/clients/createFhevmEncryptClient.js.map +1 -0
- package/_cjs/ethers/decorators/decrypt.js +9 -0
- package/_cjs/ethers/decorators/decrypt.js.map +1 -0
- package/_cjs/ethers/decorators/encrypt.js +9 -0
- package/_cjs/ethers/decorators/encrypt.js.map +1 -0
- package/_cjs/ethers/index.js +20 -0
- package/_cjs/ethers/index.js.map +1 -0
- package/_cjs/ethers/internal/ethereum.js +80 -0
- package/_cjs/ethers/internal/ethereum.js.map +1 -0
- package/_cjs/ethers/internal/ethers-p.js +52 -0
- package/_cjs/ethers/internal/ethers-p.js.map +1 -0
- package/_cjs/ethers/internal/utils.js +26 -0
- package/_cjs/ethers/internal/utils.js.map +1 -0
- package/_cjs/ethers/runtime/initFhevmDecryptRuntime.js +9 -0
- package/_cjs/ethers/runtime/initFhevmDecryptRuntime.js.map +1 -0
- package/_cjs/ethers/runtime/initFhevmEncryptRuntime.js +9 -0
- package/_cjs/ethers/runtime/initFhevmEncryptRuntime.js.map +1 -0
- package/_cjs/ethers/runtime/initFhevmRuntime.js +9 -0
- package/_cjs/ethers/runtime/initFhevmRuntime.js.map +1 -0
- package/_cjs/package.json +1 -0
- package/_cjs/viem/clients/createFhevmBaseClient.js +16 -0
- package/_cjs/viem/clients/createFhevmBaseClient.js.map +1 -0
- package/_cjs/viem/clients/createFhevmClient.js +11 -0
- package/_cjs/viem/clients/createFhevmClient.js.map +1 -0
- package/_cjs/viem/clients/createFhevmDecryptClient.js +10 -0
- package/_cjs/viem/clients/createFhevmDecryptClient.js.map +1 -0
- package/_cjs/viem/clients/createFhevmEncryptClient.js +10 -0
- package/_cjs/viem/clients/createFhevmEncryptClient.js.map +1 -0
- package/_cjs/viem/decorators/decrypt.js +9 -0
- package/_cjs/viem/decorators/decrypt.js.map +1 -0
- package/_cjs/viem/decorators/encrypt.js +9 -0
- package/_cjs/viem/decorators/encrypt.js.map +1 -0
- package/_cjs/viem/index.js +20 -0
- package/_cjs/viem/index.js.map +1 -0
- package/_cjs/viem/internal/ethereum.js +68 -0
- package/_cjs/viem/internal/ethereum.js.map +1 -0
- package/_cjs/viem/internal/viem-p.js +52 -0
- package/_cjs/viem/internal/viem-p.js.map +1 -0
- package/_cjs/viem/runtime/initFhevmDecryptRuntime.js +9 -0
- package/_cjs/viem/runtime/initFhevmDecryptRuntime.js.map +1 -0
- package/_cjs/viem/runtime/initFhevmEncryptRuntime.js +9 -0
- package/_cjs/viem/runtime/initFhevmEncryptRuntime.js.map +1 -0
- package/_cjs/viem/runtime/initFhevmRuntime.js +9 -0
- package/_cjs/viem/runtime/initFhevmRuntime.js.map +1 -0
- package/_cjs/wasm/tfhe/compile-worker.js +8 -0
- package/_cjs/wasm/tfhe/startWorkers.v1.5.3.js +426 -0
- package/_cjs/wasm/tfhe/tfhe-worker.v1.5.3.inline.js +7 -0
- package/_cjs/wasm/tfhe/tfhe-worker.v1.5.3.mjs +745 -0
- package/_cjs/wasm/tfhe/tfhe.v1.5.3.d.ts +10793 -0
- package/_cjs/wasm/tfhe/tfhe.v1.5.3.js +28645 -0
- package/_cjs/wasm/tfhe/tfhe_bg.v1.5.3.wasm +0 -0
- package/_cjs/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.d.ts +1 -0
- package/_cjs/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.js +1 -0
- package/_cjs/wasm/tkms/kms_lib.v0.13.10.d.ts +586 -0
- package/_cjs/wasm/tkms/kms_lib.v0.13.10.js +2117 -0
- package/_cjs/wasm/tkms/kms_lib_bg.v0.13.10.wasm +0 -0
- package/_cjs/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.d.ts +1 -0
- package/_cjs/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.js +3 -0
- package/_cjs/wasm/wasmBaseUrl.d.ts +7 -0
- package/_cjs/wasm/wasmBaseUrl.js +14 -0
- package/_esm/core/_version.js +4 -0
- package/_esm/core/_version.js.map +1 -0
- package/_esm/core/actions/base/canReadPublicValue.js +11 -0
- package/_esm/core/actions/base/canReadPublicValue.js.map +1 -0
- package/_esm/core/actions/base/canReadPublicValues.js +11 -0
- package/_esm/core/actions/base/canReadPublicValues.js.map +1 -0
- package/_esm/core/actions/base/createVerifiedInputProofFromRawBytes.js +7 -0
- package/_esm/core/actions/base/createVerifiedInputProofFromRawBytes.js.map +1 -0
- package/_esm/core/actions/base/fetchKmsSignedcryptedShares.js +17 -0
- package/_esm/core/actions/base/fetchKmsSignedcryptedShares.js.map +1 -0
- package/_esm/core/actions/base/fetchVerifiedInputProof.js +8 -0
- package/_esm/core/actions/base/fetchVerifiedInputProof.js.map +1 -0
- package/_esm/core/actions/base/index.js +14 -0
- package/_esm/core/actions/base/index.js.map +1 -0
- package/_esm/core/actions/base/readCoprocessorSignersContext.js +9 -0
- package/_esm/core/actions/base/readCoprocessorSignersContext.js.map +1 -0
- package/_esm/core/actions/base/readKmsSignersContext.js +9 -0
- package/_esm/core/actions/base/readKmsSignersContext.js.map +1 -0
- package/_esm/core/actions/base/readPublicValue.js +11 -0
- package/_esm/core/actions/base/readPublicValue.js.map +1 -0
- package/_esm/core/actions/base/readPublicValues.js +11 -0
- package/_esm/core/actions/base/readPublicValues.js.map +1 -0
- package/_esm/core/actions/base/readPublicValuesWithSignatures.js +19 -0
- package/_esm/core/actions/base/readPublicValuesWithSignatures.js.map +1 -0
- package/_esm/core/actions/base/signDecryptionPermit.js +11 -0
- package/_esm/core/actions/base/signDecryptionPermit.js.map +1 -0
- package/_esm/core/actions/base/verifyHandlesCoprocessorSignatures.js +35 -0
- package/_esm/core/actions/base/verifyHandlesCoprocessorSignatures.js.map +1 -0
- package/_esm/core/actions/base/verifyInputProof.js +22 -0
- package/_esm/core/actions/base/verifyInputProof.js.map +1 -0
- package/_esm/core/actions/base/verifyZkProofCoprocessorSignatures.js +14 -0
- package/_esm/core/actions/base/verifyZkProofCoprocessorSignatures.js.map +1 -0
- package/_esm/core/actions/chain/createCoprocessorEip712Domain.js +8 -0
- package/_esm/core/actions/chain/createCoprocessorEip712Domain.js.map +1 -0
- package/_esm/core/actions/chain/createKmsDelegatedUserDecryptEip712.js +15 -0
- package/_esm/core/actions/chain/createKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_esm/core/actions/chain/createKmsEip712Domain.js +8 -0
- package/_esm/core/actions/chain/createKmsEip712Domain.js.map +1 -0
- package/_esm/core/actions/chain/createKmsUserDecryptEip712.js +14 -0
- package/_esm/core/actions/chain/createKmsUserDecryptEip712.js.map +1 -0
- package/_esm/core/actions/chain/fetchFheEncryptionKeyBytes.js +6 -0
- package/_esm/core/actions/chain/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_esm/core/actions/chain/index.js +13 -0
- package/_esm/core/actions/chain/index.js.map +1 -0
- package/_esm/core/actions/chain/parseSignedDecryptionPermit.js +15 -0
- package/_esm/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -0
- package/_esm/core/actions/chain/parseTransportKeypair.js +7 -0
- package/_esm/core/actions/chain/parseTransportKeypair.js.map +1 -0
- package/_esm/core/actions/chain/serializeSignedDecryptionPermit.js +11 -0
- package/_esm/core/actions/chain/serializeSignedDecryptionPermit.js.map +1 -0
- package/_esm/core/actions/chain/serializeTransportKeypair.js +6 -0
- package/_esm/core/actions/chain/serializeTransportKeypair.js.map +1 -0
- package/_esm/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js +5 -0
- package/_esm/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_esm/core/actions/chain/verifyKmsUserDecryptEip712.js +5 -0
- package/_esm/core/actions/chain/verifyKmsUserDecryptEip712.js.map +1 -0
- package/_esm/core/actions/decrypt/canDecryptValue.js +18 -0
- package/_esm/core/actions/decrypt/canDecryptValue.js.map +1 -0
- package/_esm/core/actions/decrypt/canDecryptValues.js +20 -0
- package/_esm/core/actions/decrypt/canDecryptValues.js.map +1 -0
- package/_esm/core/actions/decrypt/canDecryptValuesFromPairs.js +16 -0
- package/_esm/core/actions/decrypt/canDecryptValuesFromPairs.js.map +1 -0
- package/_esm/core/actions/decrypt/decryptKmsSignedcryptedShares.js +9 -0
- package/_esm/core/actions/decrypt/decryptKmsSignedcryptedShares.js.map +1 -0
- package/_esm/core/actions/decrypt/decryptValue.js +18 -0
- package/_esm/core/actions/decrypt/decryptValue.js.map +1 -0
- package/_esm/core/actions/decrypt/decryptValues.js +16 -0
- package/_esm/core/actions/decrypt/decryptValues.js.map +1 -0
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js +15 -0
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -0
- package/_esm/core/actions/decrypt/generateTransportKeypair.js +6 -0
- package/_esm/core/actions/decrypt/generateTransportKeypair.js.map +1 -0
- package/_esm/core/actions/decrypt/index.js +9 -0
- package/_esm/core/actions/decrypt/index.js.map +1 -0
- package/_esm/core/actions/encrypt/encryptValue.js +24 -0
- package/_esm/core/actions/encrypt/encryptValue.js.map +1 -0
- package/_esm/core/actions/encrypt/encryptValues.js +22 -0
- package/_esm/core/actions/encrypt/encryptValues.js.map +1 -0
- package/_esm/core/actions/encrypt/generateZkProof.js +15 -0
- package/_esm/core/actions/encrypt/generateZkProof.js.map +1 -0
- package/_esm/core/actions/encrypt/index.js +4 -0
- package/_esm/core/actions/encrypt/index.js.map +1 -0
- package/_esm/core/actions/host/getUserDecryptionDelegationExpirationDate.js +18 -0
- package/_esm/core/actions/host/getUserDecryptionDelegationExpirationDate.js.map +1 -0
- package/_esm/core/actions/host/index.js +8 -0
- package/_esm/core/actions/host/index.js.map +1 -0
- package/_esm/core/actions/host/isAllowedForDecryption.js +18 -0
- package/_esm/core/actions/host/isAllowedForDecryption.js.map +1 -0
- package/_esm/core/actions/host/persistAllowed.js +17 -0
- package/_esm/core/actions/host/persistAllowed.js.map +1 -0
- package/_esm/core/actions/host/readFhevmExecutorContractData.js +53 -0
- package/_esm/core/actions/host/readFhevmExecutorContractData.js.map +1 -0
- package/_esm/core/actions/host/readInputVerifierContractData.js +49 -0
- package/_esm/core/actions/host/readInputVerifierContractData.js.map +1 -0
- package/_esm/core/actions/host/readKmsVerifierContractData.js +49 -0
- package/_esm/core/actions/host/readKmsVerifierContractData.js.map +1 -0
- package/_esm/core/actions/host/resolveChainId.js +24 -0
- package/_esm/core/actions/host/resolveChainId.js.map +1 -0
- package/_esm/core/actions/host/resolveFhevmConfig.js +89 -0
- package/_esm/core/actions/host/resolveFhevmConfig.js.map +1 -0
- package/_esm/core/base/address.js +210 -0
- package/_esm/core/base/address.js.map +1 -0
- package/_esm/core/base/auth.js +36 -0
- package/_esm/core/base/auth.js.map +1 -0
- package/_esm/core/base/boolean.js +62 -0
- package/_esm/core/base/boolean.js.map +1 -0
- package/_esm/core/base/bytes.js +1445 -0
- package/_esm/core/base/bytes.js.map +1 -0
- package/_esm/core/base/cachedFetch.js +88 -0
- package/_esm/core/base/cachedFetch.js.map +1 -0
- package/_esm/core/base/errors/AddressError.js +11 -0
- package/_esm/core/base/errors/AddressError.js.map +1 -0
- package/_esm/core/base/errors/ChecksummedAddressError.js +13 -0
- package/_esm/core/base/errors/ChecksummedAddressError.js.map +1 -0
- package/_esm/core/base/errors/ErrorBase.js +68 -0
- package/_esm/core/base/errors/ErrorBase.js.map +1 -0
- package/_esm/core/base/errors/FetchError.js +30 -0
- package/_esm/core/base/errors/FetchError.js.map +1 -0
- package/_esm/core/base/errors/FheTypeError.js +44 -0
- package/_esm/core/base/errors/FheTypeError.js.map +1 -0
- package/_esm/core/base/errors/InternalError.js +18 -0
- package/_esm/core/base/errors/InternalError.js.map +1 -0
- package/_esm/core/base/errors/InvalidPropertyError.js +183 -0
- package/_esm/core/base/errors/InvalidPropertyError.js.map +1 -0
- package/_esm/core/base/errors/InvalidTypeError.js +57 -0
- package/_esm/core/base/errors/InvalidTypeError.js.map +1 -0
- package/_esm/core/base/errors/utils.js +36 -0
- package/_esm/core/base/errors/utils.js.map +1 -0
- package/_esm/core/base/fetch.js +210 -0
- package/_esm/core/base/fetch.js.map +1 -0
- package/_esm/core/base/index.js +2 -0
- package/_esm/core/base/index.js.map +1 -0
- package/_esm/core/base/isomorphicWorker.js +235 -0
- package/_esm/core/base/isomorphicWorker.js.map +1 -0
- package/_esm/core/base/object.js +36 -0
- package/_esm/core/base/object.js.map +1 -0
- package/_esm/core/base/promise.js +31 -0
- package/_esm/core/base/promise.js.map +1 -0
- package/_esm/core/base/record.js +149 -0
- package/_esm/core/base/record.js.map +1 -0
- package/_esm/core/base/string.js +163 -0
- package/_esm/core/base/string.js.map +1 -0
- package/_esm/core/base/timeout.js +26 -0
- package/_esm/core/base/timeout.js.map +1 -0
- package/_esm/core/base/trustedValue.js +83 -0
- package/_esm/core/base/trustedValue.js.map +1 -0
- package/_esm/core/base/typedValue.js +236 -0
- package/_esm/core/base/typedValue.js.map +1 -0
- package/_esm/core/base/uid.js +17 -0
- package/_esm/core/base/uid.js.map +1 -0
- package/_esm/core/base/uint.js +402 -0
- package/_esm/core/base/uint.js.map +1 -0
- package/_esm/core/base/wasm.js +84 -0
- package/_esm/core/base/wasm.js.map +1 -0
- package/_esm/core/chains/definitions/localTestnet.js +30 -0
- package/_esm/core/chains/definitions/localTestnet.js.map +1 -0
- package/_esm/core/chains/definitions/mainnet.js +30 -0
- package/_esm/core/chains/definitions/mainnet.js.map +1 -0
- package/_esm/core/chains/definitions/sepolia.js +30 -0
- package/_esm/core/chains/definitions/sepolia.js.map +1 -0
- package/_esm/core/chains/index.js +4 -0
- package/_esm/core/chains/index.js.map +1 -0
- package/_esm/core/chains/utils.js +5 -0
- package/_esm/core/chains/utils.js.map +1 -0
- package/_esm/core/clients/decorators/base.js +36 -0
- package/_esm/core/clients/decorators/base.js.map +1 -0
- package/_esm/core/clients/decorators/decrypt.js +32 -0
- package/_esm/core/clients/decorators/decrypt.js.map +1 -0
- package/_esm/core/clients/decorators/encrypt-p.js +12 -0
- package/_esm/core/clients/decorators/encrypt-p.js.map +1 -0
- package/_esm/core/clients/decorators/encrypt.js +22 -0
- package/_esm/core/clients/decorators/encrypt.js.map +1 -0
- package/_esm/core/coprocessor/InputProof-p.js +268 -0
- package/_esm/core/coprocessor/InputProof-p.js.map +1 -0
- package/_esm/core/coprocessor/ZkProof-p.js +343 -0
- package/_esm/core/coprocessor/ZkProof-p.js.map +1 -0
- package/_esm/core/coprocessor/ZkProofBuilder-p.js +208 -0
- package/_esm/core/coprocessor/ZkProofBuilder-p.js.map +1 -0
- package/_esm/core/coprocessor/assertIsCoprocessorEip712Domain.js +16 -0
- package/_esm/core/coprocessor/assertIsCoprocessorEip712Domain.js.map +1 -0
- package/_esm/core/coprocessor/coprocessorEip712Types.js +34 -0
- package/_esm/core/coprocessor/coprocessorEip712Types.js.map +1 -0
- package/_esm/core/coprocessor/createCoprocessorEip712.js +41 -0
- package/_esm/core/coprocessor/createCoprocessorEip712.js.map +1 -0
- package/_esm/core/coprocessor/createCoprocessorEip712Domain.js +15 -0
- package/_esm/core/coprocessor/createCoprocessorEip712Domain.js.map +1 -0
- package/_esm/core/coprocessor/encrypt.js +18 -0
- package/_esm/core/coprocessor/encrypt.js.map +1 -0
- package/_esm/core/coprocessor/fetchVerifiedInputProof.js +47 -0
- package/_esm/core/coprocessor/fetchVerifiedInputProof.js.map +1 -0
- package/_esm/core/coprocessor/verifyHandlesCoprocessorSignatures.js +37 -0
- package/_esm/core/coprocessor/verifyHandlesCoprocessorSignatures.js.map +1 -0
- package/_esm/core/coprocessor/verifyInputProof.js +22 -0
- package/_esm/core/coprocessor/verifyInputProof.js.map +1 -0
- package/_esm/core/errors/AclError.js +43 -0
- package/_esm/core/errors/AclError.js.map +1 -0
- package/_esm/core/errors/ContractErrorBase.js +30 -0
- package/_esm/core/errors/ContractErrorBase.js.map +1 -0
- package/_esm/core/errors/EncryptionError.js +10 -0
- package/_esm/core/errors/EncryptionError.js.map +1 -0
- package/_esm/core/errors/FhevmConfigError.js +10 -0
- package/_esm/core/errors/FhevmConfigError.js.map +1 -0
- package/_esm/core/errors/FhevmErrorBase.js +62 -0
- package/_esm/core/errors/FhevmErrorBase.js.map +1 -0
- package/_esm/core/errors/FhevmHandleError.js +11 -0
- package/_esm/core/errors/FhevmHandleError.js.map +1 -0
- package/_esm/core/errors/InputProofError.js +20 -0
- package/_esm/core/errors/InputProofError.js.map +1 -0
- package/_esm/core/errors/RelayerAbortError.js +15 -0
- package/_esm/core/errors/RelayerAbortError.js.map +1 -0
- package/_esm/core/errors/RelayerErrorBase.js +83 -0
- package/_esm/core/errors/RelayerErrorBase.js.map +1 -0
- package/_esm/core/errors/RelayerFetchError.js +18 -0
- package/_esm/core/errors/RelayerFetchError.js.map +1 -0
- package/_esm/core/errors/RelayerFetchErrorBase.js +71 -0
- package/_esm/core/errors/RelayerFetchErrorBase.js.map +1 -0
- package/_esm/core/errors/RelayerMaxRetryError.js +16 -0
- package/_esm/core/errors/RelayerMaxRetryError.js.map +1 -0
- package/_esm/core/errors/RelayerRequestErrorBase.js +44 -0
- package/_esm/core/errors/RelayerRequestErrorBase.js.map +1 -0
- package/_esm/core/errors/RelayerRequestInternalError.js +44 -0
- package/_esm/core/errors/RelayerRequestInternalError.js.map +1 -0
- package/_esm/core/errors/RelayerResponseApiError.js +35 -0
- package/_esm/core/errors/RelayerResponseApiError.js.map +1 -0
- package/_esm/core/errors/RelayerResponseErrorBase.js +29 -0
- package/_esm/core/errors/RelayerResponseErrorBase.js.map +1 -0
- package/_esm/core/errors/RelayerResponseInputProofRejectedError.js +14 -0
- package/_esm/core/errors/RelayerResponseInputProofRejectedError.js.map +1 -0
- package/_esm/core/errors/RelayerResponseInvalidBodyError.js +35 -0
- package/_esm/core/errors/RelayerResponseInvalidBodyError.js.map +1 -0
- package/_esm/core/errors/RelayerResponseStatusError.js +16 -0
- package/_esm/core/errors/RelayerResponseStatusError.js.map +1 -0
- package/_esm/core/errors/RelayerStateError.js +32 -0
- package/_esm/core/errors/RelayerStateError.js.map +1 -0
- package/_esm/core/errors/RelayerTimeoutError.js +15 -0
- package/_esm/core/errors/RelayerTimeoutError.js.map +1 -0
- package/_esm/core/errors/SignersError.js +29 -0
- package/_esm/core/errors/SignersError.js.map +1 -0
- package/_esm/core/errors/TfheError.js +10 -0
- package/_esm/core/errors/TfheError.js.map +1 -0
- package/_esm/core/errors/ZkProofError.js +11 -0
- package/_esm/core/errors/ZkProofError.js.map +1 -0
- package/_esm/core/handle/ClearValue.js +272 -0
- package/_esm/core/handle/ClearValue.js.map +1 -0
- package/_esm/core/handle/EncryptedValue.js +26 -0
- package/_esm/core/handle/EncryptedValue.js.map +1 -0
- package/_esm/core/handle/FheType.js +430 -0
- package/_esm/core/handle/FheType.js.map +1 -0
- package/_esm/core/handle/FhevmHandle.js +545 -0
- package/_esm/core/handle/FhevmHandle.js.map +1 -0
- package/_esm/core/host-contracts/CoprocessorSignersContext-p.js +125 -0
- package/_esm/core/host-contracts/CoprocessorSignersContext-p.js.map +1 -0
- package/_esm/core/host-contracts/FhevmExecutorContractData-p.js +102 -0
- package/_esm/core/host-contracts/FhevmExecutorContractData-p.js.map +1 -0
- package/_esm/core/host-contracts/HostContractVersion-p.js +113 -0
- package/_esm/core/host-contracts/HostContractVersion-p.js.map +1 -0
- package/_esm/core/host-contracts/InputVerifierContractData-p.js +102 -0
- package/_esm/core/host-contracts/InputVerifierContractData-p.js.map +1 -0
- package/_esm/core/host-contracts/KmsSignersContext-p.js +177 -0
- package/_esm/core/host-contracts/KmsSignersContext-p.js.map +1 -0
- package/_esm/core/host-contracts/KmsVerifierContractData-p.js +84 -0
- package/_esm/core/host-contracts/KmsVerifierContractData-p.js.map +1 -0
- package/_esm/core/host-contracts/abi-fragments/fragments.js +393 -0
- package/_esm/core/host-contracts/abi-fragments/fragments.js.map +1 -0
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js +45 -0
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -0
- package/_esm/core/host-contracts/checkAllowedForDecryption.js +15 -0
- package/_esm/core/host-contracts/checkAllowedForDecryption.js.map +1 -0
- package/_esm/core/host-contracts/checkPersistAllowed.js +83 -0
- package/_esm/core/host-contracts/checkPersistAllowed.js.map +1 -0
- package/_esm/core/host-contracts/decryptionResultTypehash-p.js +29 -0
- package/_esm/core/host-contracts/decryptionResultTypehash-p.js.map +1 -0
- package/_esm/core/host-contracts/eip712Domain-p.js +46 -0
- package/_esm/core/host-contracts/eip712Domain-p.js.map +1 -0
- package/_esm/core/host-contracts/eip712InputVerificationTypehash-p.js +29 -0
- package/_esm/core/host-contracts/eip712InputVerificationTypehash-p.js.map +1 -0
- package/_esm/core/host-contracts/getAclAddress-p.js +29 -0
- package/_esm/core/host-contracts/getAclAddress-p.js.map +1 -0
- package/_esm/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js +92 -0
- package/_esm/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js.map +1 -0
- package/_esm/core/host-contracts/getCoprocessorSigners-p.js +29 -0
- package/_esm/core/host-contracts/getCoprocessorSigners-p.js.map +1 -0
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js +50 -0
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -0
- package/_esm/core/host-contracts/getFhevmExecutorAddress-p.js +29 -0
- package/_esm/core/host-contracts/getFhevmExecutorAddress-p.js.map +1 -0
- package/_esm/core/host-contracts/getHandleVersion-p.js +24 -0
- package/_esm/core/host-contracts/getHandleVersion-p.js.map +1 -0
- package/_esm/core/host-contracts/getHcuLimitAddress-p.js +29 -0
- package/_esm/core/host-contracts/getHcuLimitAddress-p.js.map +1 -0
- package/_esm/core/host-contracts/getInputVerifierAddress-p.js +29 -0
- package/_esm/core/host-contracts/getInputVerifierAddress-p.js.map +1 -0
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js +108 -0
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -0
- package/_esm/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +73 -0
- package/_esm/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -0
- package/_esm/core/host-contracts/getSignersForKmsContext-p.js +64 -0
- package/_esm/core/host-contracts/getSignersForKmsContext-p.js.map +1 -0
- package/_esm/core/host-contracts/isAllowedForDecryption.js +29 -0
- package/_esm/core/host-contracts/isAllowedForDecryption.js.map +1 -0
- package/_esm/core/host-contracts/isUserDecryptable.js +56 -0
- package/_esm/core/host-contracts/isUserDecryptable.js.map +1 -0
- package/_esm/core/host-contracts/persistAllowed.js +30 -0
- package/_esm/core/host-contracts/persistAllowed.js.map +1 -0
- package/_esm/core/host-contracts/readCoprocessorSignersContext-p.js +14 -0
- package/_esm/core/host-contracts/readCoprocessorSignersContext-p.js.map +1 -0
- package/_esm/core/host-contracts/readKmsSignersContext-p.js +116 -0
- package/_esm/core/host-contracts/readKmsSignersContext-p.js.map +1 -0
- package/_esm/core/key/FheEncryptionKeyCache-p.js +278 -0
- package/_esm/core/key/FheEncryptionKeyCache-p.js.map +1 -0
- package/_esm/core/key/FheEncryptionKeyWasm-p.js +73 -0
- package/_esm/core/key/FheEncryptionKeyWasm-p.js.map +1 -0
- package/_esm/core/key/deserializeFheEncryptionKey.js +16 -0
- package/_esm/core/key/deserializeFheEncryptionKey.js.map +1 -0
- package/_esm/core/key/fetchFheEncryptionKey.js +29 -0
- package/_esm/core/key/fetchFheEncryptionKey.js.map +1 -0
- package/_esm/core/key/fetchFheEncryptionKeyBytes.js +46 -0
- package/_esm/core/key/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_esm/core/key/fetchFheEncryptionKeyBytesWithSource.js +57 -0
- package/_esm/core/key/fetchFheEncryptionKeyBytesWithSource.js.map +1 -0
- package/_esm/core/key/serializeFheEncryptionKey.js +21 -0
- package/_esm/core/key/serializeFheEncryptionKey.js.map +1 -0
- package/_esm/core/kms/KmsSigncryptedShares-p.js +141 -0
- package/_esm/core/kms/KmsSigncryptedShares-p.js.map +1 -0
- package/_esm/core/kms/PublicDecryptionProof-p.js +122 -0
- package/_esm/core/kms/PublicDecryptionProof-p.js.map +1 -0
- package/_esm/core/kms/PublicDecryptionProof.js +8 -0
- package/_esm/core/kms/PublicDecryptionProof.js.map +1 -0
- package/_esm/core/kms/SignedDecryptionPermit-p.js +286 -0
- package/_esm/core/kms/SignedDecryptionPermit-p.js.map +1 -0
- package/_esm/core/kms/TransportKeypair-p.js +211 -0
- package/_esm/core/kms/TransportKeypair-p.js.map +1 -0
- package/_esm/core/kms/createKmsDelegatedUserDecryptEip712.js +73 -0
- package/_esm/core/kms/createKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_esm/core/kms/createKmsEip712Domain.js +40 -0
- package/_esm/core/kms/createKmsEip712Domain.js.map +1 -0
- package/_esm/core/kms/createKmsPublicDecryptEip712.js +39 -0
- package/_esm/core/kms/createKmsPublicDecryptEip712.js.map +1 -0
- package/_esm/core/kms/createKmsUserDecryptEip712.js +100 -0
- package/_esm/core/kms/createKmsUserDecryptEip712.js.map +1 -0
- package/_esm/core/kms/decryptKmsSignedcryptedShares-p.js +14 -0
- package/_esm/core/kms/decryptKmsSignedcryptedShares-p.js.map +1 -0
- package/_esm/core/kms/decryptValuesFromPairs.js +14 -0
- package/_esm/core/kms/decryptValuesFromPairs.js.map +1 -0
- package/_esm/core/kms/fetchKmsSignedcryptedShares-p.js +124 -0
- package/_esm/core/kms/fetchKmsSignedcryptedShares-p.js.map +1 -0
- package/_esm/core/kms/index.js +2 -0
- package/_esm/core/kms/index.js.map +1 -0
- package/_esm/core/kms/kmsDelegatedUserDecryptEip712Types.js +28 -0
- package/_esm/core/kms/kmsDelegatedUserDecryptEip712Types.js.map +1 -0
- package/_esm/core/kms/kmsExtraData.js +35 -0
- package/_esm/core/kms/kmsExtraData.js.map +1 -0
- package/_esm/core/kms/kmsPublicDecryptEip712Types.js +25 -0
- package/_esm/core/kms/kmsPublicDecryptEip712Types.js.map +1 -0
- package/_esm/core/kms/kmsUserDecryptEip712Types.js +27 -0
- package/_esm/core/kms/kmsUserDecryptEip712Types.js.map +1 -0
- package/_esm/core/kms/publicDecrypt.js +65 -0
- package/_esm/core/kms/publicDecrypt.js.map +1 -0
- package/_esm/core/kms/utils.js +38 -0
- package/_esm/core/kms/utils.js.map +1 -0
- package/_esm/core/kms/verifyKmsPublicDecryptEip712-p.js +46 -0
- package/_esm/core/kms/verifyKmsPublicDecryptEip712-p.js.map +1 -0
- package/_esm/core/modules/decrypt/mock.js +82 -0
- package/_esm/core/modules/decrypt/mock.js.map +1 -0
- package/_esm/core/modules/decrypt/module/api-p.js +228 -0
- package/_esm/core/modules/decrypt/module/api-p.js.map +1 -0
- package/_esm/core/modules/decrypt/module/index.js +44 -0
- package/_esm/core/modules/decrypt/module/index.js.map +1 -0
- package/_esm/core/modules/decrypt/module/init-p.js +115 -0
- package/_esm/core/modules/decrypt/module/init-p.js.map +1 -0
- package/_esm/core/modules/decrypt/types.js +2 -0
- package/_esm/core/modules/decrypt/types.js.map +1 -0
- package/_esm/core/modules/encrypt/mock.js +63 -0
- package/_esm/core/modules/encrypt/mock.js.map +1 -0
- package/_esm/core/modules/encrypt/module/api-p.js +288 -0
- package/_esm/core/modules/encrypt/module/api-p.js.map +1 -0
- package/_esm/core/modules/encrypt/module/index.js +21 -0
- package/_esm/core/modules/encrypt/module/index.js.map +1 -0
- package/_esm/core/modules/encrypt/module/init-p.js +179 -0
- package/_esm/core/modules/encrypt/module/init-p.js.map +1 -0
- package/_esm/core/modules/encrypt/types.js +2 -0
- package/_esm/core/modules/encrypt/types.js.map +1 -0
- package/_esm/core/modules/ethereum/createTrustedClient.js +6 -0
- package/_esm/core/modules/ethereum/createTrustedClient.js.map +1 -0
- package/_esm/core/modules/ethereum/types.js +2 -0
- package/_esm/core/modules/ethereum/types.js.map +1 -0
- package/_esm/core/modules/relayer/mock.js +28 -0
- package/_esm/core/modules/relayer/mock.js.map +1 -0
- package/_esm/core/modules/relayer/module/RelayerAsyncRequest.js +1576 -0
- package/_esm/core/modules/relayer/module/RelayerAsyncRequest.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchCoprocessorSignatures.js +30 -0
- package/_esm/core/modules/relayer/module/fetchCoprocessorSignatures.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecrypt.js +48 -0
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeyBytes.js +21 -0
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeyBytes.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeySource.js +137 -0
- package/_esm/core/modules/relayer/module/fetchFheEncryptionKeySource.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchPublicDecrypt.js +28 -0
- package/_esm/core/modules/relayer/module/fetchPublicDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js +49 -0
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerInputProofSucceeded.js +74 -0
- package/_esm/core/modules/relayer/module/guards/RelayerInputProofSucceeded.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.js +42 -0
- package/_esm/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerResponseFailed.js +162 -0
- package/_esm/core/modules/relayer/module/guards/RelayerResponseFailed.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerResponseQueued.js +38 -0
- package/_esm/core/modules/relayer/module/guards/RelayerResponseQueued.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.js +52 -0
- package/_esm/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js +45 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.js +65 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError404.js +18 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError404.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError429.js +18 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError429.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError500.js +18 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError500.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js +23 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js.map +1 -0
- package/_esm/core/modules/relayer/module/index.js +22 -0
- package/_esm/core/modules/relayer/module/index.js.map +1 -0
- package/_esm/core/modules/relayer/module/relayerUrl.js +33 -0
- package/_esm/core/modules/relayer/module/relayerUrl.js.map +1 -0
- package/_esm/core/modules/relayer/module/utils.js +19 -0
- package/_esm/core/modules/relayer/module/utils.js.map +1 -0
- package/_esm/core/modules/relayer/types.js +2 -0
- package/_esm/core/modules/relayer/types.js.map +1 -0
- package/_esm/core/runtime/CoreFhevm-p.js +248 -0
- package/_esm/core/runtime/CoreFhevm-p.js.map +1 -0
- package/_esm/core/runtime/CoreFhevmRuntime-p.js +190 -0
- package/_esm/core/runtime/CoreFhevmRuntime-p.js.map +1 -0
- package/_esm/core/runtime/FhevmRuntime.js +2 -0
- package/_esm/core/runtime/FhevmRuntime.js.map +1 -0
- package/_esm/core/runtime/initFhevmDecryptRuntime-p.js +8 -0
- package/_esm/core/runtime/initFhevmDecryptRuntime-p.js.map +1 -0
- package/_esm/core/runtime/initFhevmEncryptRuntime-p.js +8 -0
- package/_esm/core/runtime/initFhevmEncryptRuntime-p.js.map +1 -0
- package/_esm/core/runtime/initFhevmRuntime-p.js +9 -0
- package/_esm/core/runtime/initFhevmRuntime-p.js.map +1 -0
- package/_esm/core/types/auth.js +2 -0
- package/_esm/core/types/auth.js.map +1 -0
- package/_esm/core/types/configs.js +2 -0
- package/_esm/core/types/configs.js.map +1 -0
- package/_esm/core/types/coprocessor.js +2 -0
- package/_esm/core/types/coprocessor.js.map +1 -0
- package/_esm/core/types/coprocessorSignersContext.js +2 -0
- package/_esm/core/types/coprocessorSignersContext.js.map +1 -0
- package/_esm/core/types/coreFhevmClient.js +2 -0
- package/_esm/core/types/coreFhevmClient.js.map +1 -0
- package/_esm/core/types/coreFhevmRuntime.js +2 -0
- package/_esm/core/types/coreFhevmRuntime.js.map +1 -0
- package/_esm/core/types/encryptedTypes-p.js +2 -0
- package/_esm/core/types/encryptedTypes-p.js.map +1 -0
- package/_esm/core/types/encryptedTypes.js +2 -0
- package/_esm/core/types/encryptedTypes.js.map +1 -0
- package/_esm/core/types/fheEncryptionKey.js +2 -0
- package/_esm/core/types/fheEncryptionKey.js.map +1 -0
- package/_esm/core/types/fheType.js +2 -0
- package/_esm/core/types/fheType.js.map +1 -0
- package/_esm/core/types/fhevmChain.js +2 -0
- package/_esm/core/types/fhevmChain.js.map +1 -0
- package/_esm/core/types/fhevmClient.js +2 -0
- package/_esm/core/types/fhevmClient.js.map +1 -0
- package/_esm/core/types/fhevmDecryptionKey.js +2 -0
- package/_esm/core/types/fhevmDecryptionKey.js.map +1 -0
- package/_esm/core/types/fhevmUser.js +2 -0
- package/_esm/core/types/fhevmUser.js.map +1 -0
- package/_esm/core/types/hostContract.js +2 -0
- package/_esm/core/types/hostContract.js.map +1 -0
- package/_esm/core/types/index.js +2 -0
- package/_esm/core/types/index.js.map +1 -0
- package/_esm/core/types/inputProof.js +2 -0
- package/_esm/core/types/inputProof.js.map +1 -0
- package/_esm/core/types/kms-p.js +2 -0
- package/_esm/core/types/kms-p.js.map +1 -0
- package/_esm/core/types/kms.js +2 -0
- package/_esm/core/types/kms.js.map +1 -0
- package/_esm/core/types/kmsSignersContext.js +2 -0
- package/_esm/core/types/kmsSignersContext.js.map +1 -0
- package/_esm/core/types/logger.js +2 -0
- package/_esm/core/types/logger.js.map +1 -0
- package/_esm/core/types/other-p.js +2 -0
- package/_esm/core/types/other-p.js.map +1 -0
- package/_esm/core/types/primitives.js +3 -0
- package/_esm/core/types/primitives.js.map +1 -0
- package/_esm/core/types/publicDecryptionProof-p.js +2 -0
- package/_esm/core/types/publicDecryptionProof-p.js.map +1 -0
- package/_esm/core/types/record-p.js +2 -0
- package/_esm/core/types/record-p.js.map +1 -0
- package/_esm/core/types/relayer-p.js +2 -0
- package/_esm/core/types/relayer-p.js.map +1 -0
- package/_esm/core/types/relayer.js +2 -0
- package/_esm/core/types/relayer.js.map +1 -0
- package/_esm/core/types/signedDecryptionPermit.js +2 -0
- package/_esm/core/types/signedDecryptionPermit.js.map +1 -0
- package/_esm/core/types/tkms-p.js +2 -0
- package/_esm/core/types/tkms-p.js.map +1 -0
- package/_esm/core/types/utils.js +2 -0
- package/_esm/core/types/utils.js.map +1 -0
- package/_esm/core/types/zkProof-p.js +2 -0
- package/_esm/core/types/zkProof-p.js.map +1 -0
- package/_esm/core/types/zkProofBuilder.js +2 -0
- package/_esm/core/types/zkProofBuilder.js.map +1 -0
- package/_esm/core/utils-p/decrypt/assertPermitMatchesKeypair.js +19 -0
- package/_esm/core/utils-p/decrypt/assertPermitMatchesKeypair.js.map +1 -0
- package/_esm/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js +31 -0
- package/_esm/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js.map +1 -0
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js +31 -0
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js.map +1 -0
- package/_esm/core/utils-p/decrypt/verifyTkmsPublicKey.js +16 -0
- package/_esm/core/utils-p/decrypt/verifyTkmsPublicKey.js.map +1 -0
- package/_esm/core/utils-p/runtime/recoverSigners.js +21 -0
- package/_esm/core/utils-p/runtime/recoverSigners.js.map +1 -0
- package/_esm/ethers/clients/createFhevmBaseClient.js +14 -0
- package/_esm/ethers/clients/createFhevmBaseClient.js.map +1 -0
- package/_esm/ethers/clients/createFhevmClient.js +9 -0
- package/_esm/ethers/clients/createFhevmClient.js.map +1 -0
- package/_esm/ethers/clients/createFhevmDecryptClient.js +8 -0
- package/_esm/ethers/clients/createFhevmDecryptClient.js.map +1 -0
- package/_esm/ethers/clients/createFhevmEncryptClient.js +9 -0
- package/_esm/ethers/clients/createFhevmEncryptClient.js.map +1 -0
- package/_esm/ethers/decorators/decrypt.js +7 -0
- package/_esm/ethers/decorators/decrypt.js.map +1 -0
- package/_esm/ethers/decorators/encrypt.js +7 -0
- package/_esm/ethers/decorators/encrypt.js.map +1 -0
- package/_esm/ethers/index.js +9 -0
- package/_esm/ethers/index.js.map +1 -0
- package/_esm/ethers/internal/ethereum.js +112 -0
- package/_esm/ethers/internal/ethereum.js.map +1 -0
- package/_esm/ethers/internal/ethers-p.js +79 -0
- package/_esm/ethers/internal/ethers-p.js.map +1 -0
- package/_esm/ethers/internal/utils.js +27 -0
- package/_esm/ethers/internal/utils.js.map +1 -0
- package/_esm/ethers/runtime/initFhevmDecryptRuntime.js +7 -0
- package/_esm/ethers/runtime/initFhevmDecryptRuntime.js.map +1 -0
- package/_esm/ethers/runtime/initFhevmEncryptRuntime.js +7 -0
- package/_esm/ethers/runtime/initFhevmEncryptRuntime.js.map +1 -0
- package/_esm/ethers/runtime/initFhevmRuntime.js +7 -0
- package/_esm/ethers/runtime/initFhevmRuntime.js.map +1 -0
- package/_esm/package.json +1 -0
- package/_esm/viem/clients/createFhevmBaseClient.js +14 -0
- package/_esm/viem/clients/createFhevmBaseClient.js.map +1 -0
- package/_esm/viem/clients/createFhevmClient.js +9 -0
- package/_esm/viem/clients/createFhevmClient.js.map +1 -0
- package/_esm/viem/clients/createFhevmDecryptClient.js +8 -0
- package/_esm/viem/clients/createFhevmDecryptClient.js.map +1 -0
- package/_esm/viem/clients/createFhevmEncryptClient.js +9 -0
- package/_esm/viem/clients/createFhevmEncryptClient.js.map +1 -0
- package/_esm/viem/decorators/decrypt.js +7 -0
- package/_esm/viem/decorators/decrypt.js.map +1 -0
- package/_esm/viem/decorators/encrypt.js +7 -0
- package/_esm/viem/decorators/encrypt.js.map +1 -0
- package/_esm/viem/index.js +9 -0
- package/_esm/viem/index.js.map +1 -0
- package/_esm/viem/internal/ethereum.js +99 -0
- package/_esm/viem/internal/ethereum.js.map +1 -0
- package/_esm/viem/internal/viem-p.js +79 -0
- package/_esm/viem/internal/viem-p.js.map +1 -0
- package/_esm/viem/runtime/initFhevmDecryptRuntime.js +7 -0
- package/_esm/viem/runtime/initFhevmDecryptRuntime.js.map +1 -0
- package/_esm/viem/runtime/initFhevmEncryptRuntime.js +7 -0
- package/_esm/viem/runtime/initFhevmEncryptRuntime.js.map +1 -0
- package/_esm/viem/runtime/initFhevmRuntime.js +7 -0
- package/_esm/viem/runtime/initFhevmRuntime.js.map +1 -0
- package/_esm/wasm/tfhe/compile-worker.js +8 -0
- package/_esm/wasm/tfhe/startWorkers.v1.5.3.js +426 -0
- package/_esm/wasm/tfhe/tfhe-worker.v1.5.3.inline.js +7 -0
- package/_esm/wasm/tfhe/tfhe-worker.v1.5.3.mjs +745 -0
- package/_esm/wasm/tfhe/tfhe.v1.5.3.d.ts +10793 -0
- package/_esm/wasm/tfhe/tfhe.v1.5.3.js +28645 -0
- package/_esm/wasm/tfhe/tfhe_bg.v1.5.3.wasm +0 -0
- package/_esm/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.d.ts +1 -0
- package/_esm/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.js +1 -0
- package/_esm/wasm/tkms/kms_lib.v0.13.10.d.ts +586 -0
- package/_esm/wasm/tkms/kms_lib.v0.13.10.js +2117 -0
- package/_esm/wasm/tkms/kms_lib_bg.v0.13.10.wasm +0 -0
- package/_esm/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.d.ts +1 -0
- package/_esm/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.js +3 -0
- package/_esm/wasm/wasmBaseUrl.d.ts +7 -0
- package/_esm/wasm/wasmBaseUrl.js +14 -0
- package/_types/core/_version.d.ts +3 -0
- package/_types/core/_version.d.ts.map +1 -0
- package/_types/core/actions/base/canReadPublicValue.d.ts +9 -0
- package/_types/core/actions/base/canReadPublicValue.d.ts.map +1 -0
- package/_types/core/actions/base/canReadPublicValues.d.ts +9 -0
- package/_types/core/actions/base/canReadPublicValues.d.ts.map +1 -0
- package/_types/core/actions/base/createVerifiedInputProofFromRawBytes.d.ts +14 -0
- package/_types/core/actions/base/createVerifiedInputProofFromRawBytes.d.ts.map +1 -0
- package/_types/core/actions/base/fetchKmsSignedcryptedShares.d.ts +41 -0
- package/_types/core/actions/base/fetchKmsSignedcryptedShares.d.ts.map +1 -0
- package/_types/core/actions/base/fetchVerifiedInputProof.d.ts +14 -0
- package/_types/core/actions/base/fetchVerifiedInputProof.d.ts.map +1 -0
- package/_types/core/actions/base/index.d.ts +15 -0
- package/_types/core/actions/base/index.d.ts.map +1 -0
- package/_types/core/actions/base/readCoprocessorSignersContext.d.ts +6 -0
- package/_types/core/actions/base/readCoprocessorSignersContext.d.ts.map +1 -0
- package/_types/core/actions/base/readKmsSignersContext.d.ts +6 -0
- package/_types/core/actions/base/readKmsSignersContext.d.ts.map +1 -0
- package/_types/core/actions/base/readPublicValue.d.ts +12 -0
- package/_types/core/actions/base/readPublicValue.d.ts.map +1 -0
- package/_types/core/actions/base/readPublicValues.d.ts +12 -0
- package/_types/core/actions/base/readPublicValues.d.ts.map +1 -0
- package/_types/core/actions/base/readPublicValuesWithSignatures.d.ts +21 -0
- package/_types/core/actions/base/readPublicValuesWithSignatures.d.ts.map +1 -0
- package/_types/core/actions/base/signDecryptionPermit.d.ts +9 -0
- package/_types/core/actions/base/signDecryptionPermit.d.ts.map +1 -0
- package/_types/core/actions/base/verifyHandlesCoprocessorSignatures.d.ts +14 -0
- package/_types/core/actions/base/verifyHandlesCoprocessorSignatures.d.ts.map +1 -0
- package/_types/core/actions/base/verifyInputProof.d.ts +14 -0
- package/_types/core/actions/base/verifyInputProof.d.ts.map +1 -0
- package/_types/core/actions/base/verifyZkProofCoprocessorSignatures.d.ts +11 -0
- package/_types/core/actions/base/verifyZkProofCoprocessorSignatures.d.ts.map +1 -0
- package/_types/core/actions/chain/createCoprocessorEip712Domain.d.ts +7 -0
- package/_types/core/actions/chain/createCoprocessorEip712Domain.d.ts.map +1 -0
- package/_types/core/actions/chain/createKmsDelegatedUserDecryptEip712.d.ts +15 -0
- package/_types/core/actions/chain/createKmsDelegatedUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/actions/chain/createKmsEip712Domain.d.ts +7 -0
- package/_types/core/actions/chain/createKmsEip712Domain.d.ts.map +1 -0
- package/_types/core/actions/chain/createKmsUserDecryptEip712.d.ts +14 -0
- package/_types/core/actions/chain/createKmsUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/actions/chain/fetchFheEncryptionKeyBytes.d.ts +12 -0
- package/_types/core/actions/chain/fetchFheEncryptionKeyBytes.d.ts.map +1 -0
- package/_types/core/actions/chain/index.d.ts +13 -0
- package/_types/core/actions/chain/index.d.ts.map +1 -0
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts +21 -0
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts.map +1 -0
- package/_types/core/actions/chain/parseTransportKeypair.d.ts +11 -0
- package/_types/core/actions/chain/parseTransportKeypair.d.ts.map +1 -0
- package/_types/core/actions/chain/serializeSignedDecryptionPermit.d.ts +21 -0
- package/_types/core/actions/chain/serializeSignedDecryptionPermit.d.ts.map +1 -0
- package/_types/core/actions/chain/serializeTransportKeypair.d.ts +14 -0
- package/_types/core/actions/chain/serializeTransportKeypair.d.ts.map +1 -0
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts +7 -0
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/actions/chain/verifyKmsUserDecryptEip712.d.ts +7 -0
- package/_types/core/actions/chain/verifyKmsUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/actions/decrypt/canDecryptValue.d.ts +66 -0
- package/_types/core/actions/decrypt/canDecryptValue.d.ts.map +1 -0
- package/_types/core/actions/decrypt/canDecryptValues.d.ts +27 -0
- package/_types/core/actions/decrypt/canDecryptValues.d.ts.map +1 -0
- package/_types/core/actions/decrypt/canDecryptValuesFromPairs.d.ts +29 -0
- package/_types/core/actions/decrypt/canDecryptValuesFromPairs.d.ts.map +1 -0
- package/_types/core/actions/decrypt/decryptKmsSignedcryptedShares.d.ts +13 -0
- package/_types/core/actions/decrypt/decryptKmsSignedcryptedShares.d.ts.map +1 -0
- package/_types/core/actions/decrypt/decryptValue.d.ts +26 -0
- package/_types/core/actions/decrypt/decryptValue.d.ts.map +1 -0
- package/_types/core/actions/decrypt/decryptValues.d.ts +26 -0
- package/_types/core/actions/decrypt/decryptValues.d.ts.map +1 -0
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts +28 -0
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts.map +1 -0
- package/_types/core/actions/decrypt/generateTransportKeypair.d.ts +7 -0
- package/_types/core/actions/decrypt/generateTransportKeypair.d.ts.map +1 -0
- package/_types/core/actions/decrypt/index.d.ts +11 -0
- package/_types/core/actions/decrypt/index.d.ts.map +1 -0
- package/_types/core/actions/encrypt/encryptValue.d.ts +18 -0
- package/_types/core/actions/encrypt/encryptValue.d.ts.map +1 -0
- package/_types/core/actions/encrypt/encryptValues.d.ts +18 -0
- package/_types/core/actions/encrypt/encryptValues.d.ts.map +1 -0
- package/_types/core/actions/encrypt/generateZkProof.d.ts +13 -0
- package/_types/core/actions/encrypt/generateZkProof.d.ts.map +1 -0
- package/_types/core/actions/encrypt/index.d.ts +6 -0
- package/_types/core/actions/encrypt/index.d.ts.map +1 -0
- package/_types/core/actions/host/getUserDecryptionDelegationExpirationDate.d.ts +8 -0
- package/_types/core/actions/host/getUserDecryptionDelegationExpirationDate.d.ts.map +1 -0
- package/_types/core/actions/host/index.d.ts +8 -0
- package/_types/core/actions/host/index.d.ts.map +1 -0
- package/_types/core/actions/host/isAllowedForDecryption.d.ts +11 -0
- package/_types/core/actions/host/isAllowedForDecryption.d.ts.map +1 -0
- package/_types/core/actions/host/persistAllowed.d.ts +12 -0
- package/_types/core/actions/host/persistAllowed.d.ts.map +1 -0
- package/_types/core/actions/host/readFhevmExecutorContractData.d.ts +9 -0
- package/_types/core/actions/host/readFhevmExecutorContractData.d.ts.map +1 -0
- package/_types/core/actions/host/readInputVerifierContractData.d.ts +9 -0
- package/_types/core/actions/host/readInputVerifierContractData.d.ts.map +1 -0
- package/_types/core/actions/host/readKmsVerifierContractData.d.ts +9 -0
- package/_types/core/actions/host/readKmsVerifierContractData.d.ts.map +1 -0
- package/_types/core/actions/host/resolveChainId.d.ts +9 -0
- package/_types/core/actions/host/resolveChainId.d.ts.map +1 -0
- package/_types/core/actions/host/resolveFhevmConfig.d.ts +38 -0
- package/_types/core/actions/host/resolveFhevmConfig.d.ts.map +1 -0
- package/_types/core/base/address.d.ts +52 -0
- package/_types/core/base/address.d.ts.map +1 -0
- package/_types/core/base/auth.d.ts +10 -0
- package/_types/core/base/auth.d.ts.map +1 -0
- package/_types/core/base/boolean.d.ts +45 -0
- package/_types/core/base/boolean.d.ts.map +1 -0
- package/_types/core/base/bytes.d.ts +822 -0
- package/_types/core/base/bytes.d.ts.map +1 -0
- package/_types/core/base/cachedFetch.d.ts +75 -0
- package/_types/core/base/cachedFetch.d.ts.map +1 -0
- package/_types/core/base/errors/AddressError.d.ts +12 -0
- package/_types/core/base/errors/AddressError.d.ts.map +1 -0
- package/_types/core/base/errors/ChecksummedAddressError.d.ts +12 -0
- package/_types/core/base/errors/ChecksummedAddressError.d.ts.map +1 -0
- package/_types/core/base/errors/ErrorBase.d.ts +23 -0
- package/_types/core/base/errors/ErrorBase.d.ts.map +1 -0
- package/_types/core/base/errors/FetchError.d.ts +14 -0
- package/_types/core/base/errors/FetchError.d.ts.map +1 -0
- package/_types/core/base/errors/FheTypeError.d.ts +14 -0
- package/_types/core/base/errors/FheTypeError.d.ts.map +1 -0
- package/_types/core/base/errors/InternalError.d.ts +12 -0
- package/_types/core/base/errors/InternalError.d.ts.map +1 -0
- package/_types/core/base/errors/InvalidPropertyError.d.ts +116 -0
- package/_types/core/base/errors/InvalidPropertyError.d.ts.map +1 -0
- package/_types/core/base/errors/InvalidTypeError.d.ts +44 -0
- package/_types/core/base/errors/InvalidTypeError.d.ts.map +1 -0
- package/_types/core/base/errors/utils.d.ts +4 -0
- package/_types/core/base/errors/utils.d.ts.map +1 -0
- package/_types/core/base/fetch.d.ts +70 -0
- package/_types/core/base/fetch.d.ts.map +1 -0
- package/_types/core/base/index.d.ts +2 -0
- package/_types/core/base/index.d.ts.map +1 -0
- package/_types/core/base/isomorphicWorker.d.ts +50 -0
- package/_types/core/base/isomorphicWorker.d.ts.map +1 -0
- package/_types/core/base/object.d.ts +15 -0
- package/_types/core/base/object.d.ts.map +1 -0
- package/_types/core/base/promise.d.ts +22 -0
- package/_types/core/base/promise.d.ts.map +1 -0
- package/_types/core/base/record.d.ts +88 -0
- package/_types/core/base/record.d.ts.map +1 -0
- package/_types/core/base/string.d.ts +75 -0
- package/_types/core/base/string.d.ts.map +1 -0
- package/_types/core/base/timeout.d.ts +7 -0
- package/_types/core/base/timeout.d.ts.map +1 -0
- package/_types/core/base/trustedValue.d.ts +54 -0
- package/_types/core/base/trustedValue.d.ts.map +1 -0
- package/_types/core/base/typedValue.d.ts +104 -0
- package/_types/core/base/typedValue.d.ts.map +1 -0
- package/_types/core/base/uid.d.ts +2 -0
- package/_types/core/base/uid.d.ts.map +1 -0
- package/_types/core/base/uint.d.ts +128 -0
- package/_types/core/base/uint.d.ts.map +1 -0
- package/_types/core/base/wasm.d.ts +16 -0
- package/_types/core/base/wasm.d.ts.map +1 -0
- package/_types/core/chains/definitions/localTestnet.d.ts +29 -0
- package/_types/core/chains/definitions/localTestnet.d.ts.map +1 -0
- package/_types/core/chains/definitions/mainnet.d.ts +29 -0
- package/_types/core/chains/definitions/mainnet.d.ts.map +1 -0
- package/_types/core/chains/definitions/sepolia.d.ts +3 -0
- package/_types/core/chains/definitions/sepolia.d.ts.map +1 -0
- package/_types/core/chains/index.d.ts +5 -0
- package/_types/core/chains/index.d.ts.map +1 -0
- package/_types/core/chains/utils.d.ts +3 -0
- package/_types/core/chains/utils.d.ts.map +1 -0
- package/_types/core/clients/decorators/base.d.ts +117 -0
- package/_types/core/clients/decorators/base.d.ts.map +1 -0
- package/_types/core/clients/decorators/decrypt.d.ts +25 -0
- package/_types/core/clients/decorators/decrypt.d.ts.map +1 -0
- package/_types/core/clients/decorators/encrypt-p.d.ts +5 -0
- package/_types/core/clients/decorators/encrypt-p.d.ts.map +1 -0
- package/_types/core/clients/decorators/encrypt.d.ts +12 -0
- package/_types/core/clients/decorators/encrypt.d.ts.map +1 -0
- package/_types/core/coprocessor/InputProof-p.d.ts +55 -0
- package/_types/core/coprocessor/InputProof-p.d.ts.map +1 -0
- package/_types/core/coprocessor/ZkProof-p.d.ts +39 -0
- package/_types/core/coprocessor/ZkProof-p.d.ts.map +1 -0
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts +20 -0
- package/_types/core/coprocessor/ZkProofBuilder-p.d.ts.map +1 -0
- package/_types/core/coprocessor/assertIsCoprocessorEip712Domain.d.ts +4 -0
- package/_types/core/coprocessor/assertIsCoprocessorEip712Domain.d.ts.map +1 -0
- package/_types/core/coprocessor/coprocessorEip712Types.d.ts +4 -0
- package/_types/core/coprocessor/coprocessorEip712Types.d.ts.map +1 -0
- package/_types/core/coprocessor/createCoprocessorEip712.d.ts +13 -0
- package/_types/core/coprocessor/createCoprocessorEip712.d.ts.map +1 -0
- package/_types/core/coprocessor/createCoprocessorEip712Domain.d.ts +6 -0
- package/_types/core/coprocessor/createCoprocessorEip712Domain.d.ts.map +1 -0
- package/_types/core/coprocessor/encrypt.d.ts +26 -0
- package/_types/core/coprocessor/encrypt.d.ts.map +1 -0
- package/_types/core/coprocessor/fetchVerifiedInputProof.d.ts +23 -0
- package/_types/core/coprocessor/fetchVerifiedInputProof.d.ts.map +1 -0
- package/_types/core/coprocessor/verifyHandlesCoprocessorSignatures.d.ts +23 -0
- package/_types/core/coprocessor/verifyHandlesCoprocessorSignatures.d.ts.map +1 -0
- package/_types/core/coprocessor/verifyInputProof.d.ts +23 -0
- package/_types/core/coprocessor/verifyInputProof.d.ts.map +1 -0
- package/_types/core/errors/AclError.d.ts +28 -0
- package/_types/core/errors/AclError.d.ts.map +1 -0
- package/_types/core/errors/ContractErrorBase.d.ts +18 -0
- package/_types/core/errors/ContractErrorBase.d.ts.map +1 -0
- package/_types/core/errors/EncryptionError.d.ts +11 -0
- package/_types/core/errors/EncryptionError.d.ts.map +1 -0
- package/_types/core/errors/FhevmConfigError.d.ts +11 -0
- package/_types/core/errors/FhevmConfigError.d.ts.map +1 -0
- package/_types/core/errors/FhevmErrorBase.d.ts +21 -0
- package/_types/core/errors/FhevmErrorBase.d.ts.map +1 -0
- package/_types/core/errors/FhevmHandleError.d.ts +13 -0
- package/_types/core/errors/FhevmHandleError.d.ts.map +1 -0
- package/_types/core/errors/InputProofError.d.ts +20 -0
- package/_types/core/errors/InputProofError.d.ts.map +1 -0
- package/_types/core/errors/RelayerAbortError.d.ts +14 -0
- package/_types/core/errors/RelayerAbortError.d.ts.map +1 -0
- package/_types/core/errors/RelayerErrorBase.d.ts +23 -0
- package/_types/core/errors/RelayerErrorBase.d.ts.map +1 -0
- package/_types/core/errors/RelayerFetchError.d.ts +17 -0
- package/_types/core/errors/RelayerFetchError.d.ts.map +1 -0
- package/_types/core/errors/RelayerFetchErrorBase.d.ts +29 -0
- package/_types/core/errors/RelayerFetchErrorBase.d.ts.map +1 -0
- package/_types/core/errors/RelayerMaxRetryError.d.ts +14 -0
- package/_types/core/errors/RelayerMaxRetryError.d.ts.map +1 -0
- package/_types/core/errors/RelayerRequestErrorBase.d.ts +20 -0
- package/_types/core/errors/RelayerRequestErrorBase.d.ts.map +1 -0
- package/_types/core/errors/RelayerRequestInternalError.d.ts +20 -0
- package/_types/core/errors/RelayerRequestInternalError.d.ts.map +1 -0
- package/_types/core/errors/RelayerResponseApiError.d.ts +19 -0
- package/_types/core/errors/RelayerResponseApiError.d.ts.map +1 -0
- package/_types/core/errors/RelayerResponseErrorBase.d.ts +15 -0
- package/_types/core/errors/RelayerResponseErrorBase.d.ts.map +1 -0
- package/_types/core/errors/RelayerResponseInputProofRejectedError.d.ts +14 -0
- package/_types/core/errors/RelayerResponseInputProofRejectedError.d.ts.map +1 -0
- package/_types/core/errors/RelayerResponseInvalidBodyError.d.ts +20 -0
- package/_types/core/errors/RelayerResponseInvalidBodyError.d.ts.map +1 -0
- package/_types/core/errors/RelayerResponseStatusError.d.ts +17 -0
- package/_types/core/errors/RelayerResponseStatusError.d.ts.map +1 -0
- package/_types/core/errors/RelayerStateError.d.ts +20 -0
- package/_types/core/errors/RelayerStateError.d.ts.map +1 -0
- package/_types/core/errors/RelayerTimeoutError.d.ts +16 -0
- package/_types/core/errors/RelayerTimeoutError.d.ts.map +1 -0
- package/_types/core/errors/SignersError.d.ts +33 -0
- package/_types/core/errors/SignersError.d.ts.map +1 -0
- package/_types/core/errors/TfheError.d.ts +13 -0
- package/_types/core/errors/TfheError.d.ts.map +1 -0
- package/_types/core/errors/ZkProofError.d.ts +11 -0
- package/_types/core/errors/ZkProofError.d.ts.map +1 -0
- package/_types/core/handle/ClearValue.d.ts +88 -0
- package/_types/core/handle/ClearValue.d.ts.map +1 -0
- package/_types/core/handle/EncryptedValue.d.ts +6 -0
- package/_types/core/handle/EncryptedValue.d.ts.map +1 -0
- package/_types/core/handle/FheType.d.ts +164 -0
- package/_types/core/handle/FheType.d.ts.map +1 -0
- package/_types/core/handle/FhevmHandle.d.ts +118 -0
- package/_types/core/handle/FhevmHandle.d.ts.map +1 -0
- package/_types/core/host-contracts/CoprocessorSignersContext-p.d.ts +20 -0
- package/_types/core/host-contracts/CoprocessorSignersContext-p.d.ts.map +1 -0
- package/_types/core/host-contracts/FhevmExecutorContractData-p.d.ts +18 -0
- package/_types/core/host-contracts/FhevmExecutorContractData-p.d.ts.map +1 -0
- package/_types/core/host-contracts/HostContractVersion-p.d.ts +47 -0
- package/_types/core/host-contracts/HostContractVersion-p.d.ts.map +1 -0
- package/_types/core/host-contracts/InputVerifierContractData-p.d.ts +17 -0
- package/_types/core/host-contracts/InputVerifierContractData-p.d.ts.map +1 -0
- package/_types/core/host-contracts/KmsSignersContext-p.d.ts +39 -0
- package/_types/core/host-contracts/KmsSignersContext-p.d.ts.map +1 -0
- package/_types/core/host-contracts/KmsVerifierContractData-p.d.ts +17 -0
- package/_types/core/host-contracts/KmsVerifierContractData-p.d.ts.map +1 -0
- package/_types/core/host-contracts/abi-fragments/fragments.d.ts +78 -0
- package/_types/core/host-contracts/abi-fragments/fragments.d.ts.map +1 -0
- package/_types/core/host-contracts/canDecryptValuesFromPairs.d.ts +38 -0
- package/_types/core/host-contracts/canDecryptValuesFromPairs.d.ts.map +1 -0
- package/_types/core/host-contracts/checkAllowedForDecryption.d.ts +19 -0
- package/_types/core/host-contracts/checkAllowedForDecryption.d.ts.map +1 -0
- package/_types/core/host-contracts/checkPersistAllowed.d.ts +21 -0
- package/_types/core/host-contracts/checkPersistAllowed.d.ts.map +1 -0
- package/_types/core/host-contracts/decryptionResultTypehash-p.d.ts +18 -0
- package/_types/core/host-contracts/decryptionResultTypehash-p.d.ts.map +1 -0
- package/_types/core/host-contracts/eip712Domain-p.d.ts +23 -0
- package/_types/core/host-contracts/eip712Domain-p.d.ts.map +1 -0
- package/_types/core/host-contracts/eip712InputVerificationTypehash-p.d.ts +18 -0
- package/_types/core/host-contracts/eip712InputVerificationTypehash-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getAclAddress-p.d.ts +18 -0
- package/_types/core/host-contracts/getAclAddress-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.d.ts +28 -0
- package/_types/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getCoprocessorSigners-p.d.ts +18 -0
- package/_types/core/host-contracts/getCoprocessorSigners-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getCurrentKmsContextId-p.d.ts +25 -0
- package/_types/core/host-contracts/getCurrentKmsContextId-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getFhevmExecutorAddress-p.d.ts +18 -0
- package/_types/core/host-contracts/getFhevmExecutorAddress-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getHandleVersion-p.d.ts +18 -0
- package/_types/core/host-contracts/getHandleVersion-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getHcuLimitAddress-p.d.ts +18 -0
- package/_types/core/host-contracts/getHcuLimitAddress-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getInputVerifierAddress-p.d.ts +18 -0
- package/_types/core/host-contracts/getInputVerifierAddress-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getKmsContextSignersAndThreshold-p.d.ts +38 -0
- package/_types/core/host-contracts/getKmsContextSignersAndThreshold-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts +34 -0
- package/_types/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts.map +1 -0
- package/_types/core/host-contracts/getSignersForKmsContext-p.d.ts +27 -0
- package/_types/core/host-contracts/getSignersForKmsContext-p.d.ts.map +1 -0
- package/_types/core/host-contracts/isAllowedForDecryption.d.ts +18 -0
- package/_types/core/host-contracts/isAllowedForDecryption.d.ts.map +1 -0
- package/_types/core/host-contracts/isUserDecryptable.d.ts +29 -0
- package/_types/core/host-contracts/isUserDecryptable.d.ts.map +1 -0
- package/_types/core/host-contracts/persistAllowed.d.ts +18 -0
- package/_types/core/host-contracts/persistAllowed.d.ts.map +1 -0
- package/_types/core/host-contracts/readCoprocessorSignersContext-p.d.ts +17 -0
- package/_types/core/host-contracts/readCoprocessorSignersContext-p.d.ts.map +1 -0
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts +62 -0
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts.map +1 -0
- package/_types/core/key/FheEncryptionKeyCache-p.d.ts +93 -0
- package/_types/core/key/FheEncryptionKeyCache-p.d.ts.map +1 -0
- package/_types/core/key/FheEncryptionKeyWasm-p.d.ts +13 -0
- package/_types/core/key/FheEncryptionKeyWasm-p.d.ts.map +1 -0
- package/_types/core/key/deserializeFheEncryptionKey.d.ts +6 -0
- package/_types/core/key/deserializeFheEncryptionKey.d.ts.map +1 -0
- package/_types/core/key/fetchFheEncryptionKey.d.ts +12 -0
- package/_types/core/key/fetchFheEncryptionKey.d.ts.map +1 -0
- package/_types/core/key/fetchFheEncryptionKeyBytes.d.ts +12 -0
- package/_types/core/key/fetchFheEncryptionKeyBytes.d.ts.map +1 -0
- package/_types/core/key/fetchFheEncryptionKeyBytesWithSource.d.ts +4 -0
- package/_types/core/key/fetchFheEncryptionKeyBytesWithSource.d.ts.map +1 -0
- package/_types/core/key/serializeFheEncryptionKey.d.ts +6 -0
- package/_types/core/key/serializeFheEncryptionKey.d.ts.map +1 -0
- package/_types/core/kms/KmsSigncryptedShares-p.d.ts +39 -0
- package/_types/core/kms/KmsSigncryptedShares-p.d.ts.map +1 -0
- package/_types/core/kms/PublicDecryptionProof-p.d.ts +42 -0
- package/_types/core/kms/PublicDecryptionProof-p.d.ts.map +1 -0
- package/_types/core/kms/PublicDecryptionProof.d.ts +3 -0
- package/_types/core/kms/PublicDecryptionProof.d.ts.map +1 -0
- package/_types/core/kms/SignedDecryptionPermit-p.d.ts +78 -0
- package/_types/core/kms/SignedDecryptionPermit-p.d.ts.map +1 -0
- package/_types/core/kms/TransportKeypair-p.d.ts +54 -0
- package/_types/core/kms/TransportKeypair-p.d.ts.map +1 -0
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712.d.ts +15 -0
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/kms/createKmsEip712Domain.d.ts +17 -0
- package/_types/core/kms/createKmsEip712Domain.d.ts.map +1 -0
- package/_types/core/kms/createKmsPublicDecryptEip712.d.ts +11 -0
- package/_types/core/kms/createKmsPublicDecryptEip712.d.ts.map +1 -0
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts +26 -0
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/kms/decryptKmsSignedcryptedShares-p.d.ts +15 -0
- package/_types/core/kms/decryptKmsSignedcryptedShares-p.d.ts.map +1 -0
- package/_types/core/kms/decryptValuesFromPairs.d.ts +36 -0
- package/_types/core/kms/decryptValuesFromPairs.d.ts.map +1 -0
- package/_types/core/kms/fetchKmsSignedcryptedShares-p.d.ts +34 -0
- package/_types/core/kms/fetchKmsSignedcryptedShares-p.d.ts.map +1 -0
- package/_types/core/kms/index.d.ts +2 -0
- package/_types/core/kms/index.d.ts.map +1 -0
- package/_types/core/kms/kmsDelegatedUserDecryptEip712Types.d.ts +3 -0
- package/_types/core/kms/kmsDelegatedUserDecryptEip712Types.d.ts.map +1 -0
- package/_types/core/kms/kmsExtraData.d.ts +18 -0
- package/_types/core/kms/kmsExtraData.d.ts.map +1 -0
- package/_types/core/kms/kmsPublicDecryptEip712Types.d.ts +3 -0
- package/_types/core/kms/kmsPublicDecryptEip712Types.d.ts.map +1 -0
- package/_types/core/kms/kmsUserDecryptEip712Types.d.ts +3 -0
- package/_types/core/kms/kmsUserDecryptEip712Types.d.ts.map +1 -0
- package/_types/core/kms/publicDecrypt.d.ts +22 -0
- package/_types/core/kms/publicDecrypt.d.ts.map +1 -0
- package/_types/core/kms/utils.d.ts +16 -0
- package/_types/core/kms/utils.d.ts.map +1 -0
- package/_types/core/kms/verifyKmsPublicDecryptEip712-p.d.ts +18 -0
- package/_types/core/kms/verifyKmsPublicDecryptEip712-p.d.ts.map +1 -0
- package/_types/core/modules/decrypt/mock.d.ts +11 -0
- package/_types/core/modules/decrypt/mock.d.ts.map +1 -0
- package/_types/core/modules/decrypt/module/api-p.d.ts +9 -0
- package/_types/core/modules/decrypt/module/api-p.d.ts.map +1 -0
- package/_types/core/modules/decrypt/module/index.d.ts +4 -0
- package/_types/core/modules/decrypt/module/index.d.ts.map +1 -0
- package/_types/core/modules/decrypt/module/init-p.d.ts +5 -0
- package/_types/core/modules/decrypt/module/init-p.d.ts.map +1 -0
- package/_types/core/modules/decrypt/types.d.ts +96 -0
- package/_types/core/modules/decrypt/types.d.ts.map +1 -0
- package/_types/core/modules/encrypt/mock.d.ts +10 -0
- package/_types/core/modules/encrypt/mock.d.ts.map +1 -0
- package/_types/core/modules/encrypt/module/api-p.d.ts +13 -0
- package/_types/core/modules/encrypt/module/api-p.d.ts.map +1 -0
- package/_types/core/modules/encrypt/module/index.d.ts +3 -0
- package/_types/core/modules/encrypt/module/index.d.ts.map +1 -0
- package/_types/core/modules/encrypt/module/init-p.d.ts +8 -0
- package/_types/core/modules/encrypt/module/init-p.d.ts.map +1 -0
- package/_types/core/modules/encrypt/types.d.ts +105 -0
- package/_types/core/modules/encrypt/types.d.ts.map +1 -0
- package/_types/core/modules/ethereum/createTrustedClient.d.ts +3 -0
- package/_types/core/modules/ethereum/createTrustedClient.d.ts.map +1 -0
- package/_types/core/modules/ethereum/types.d.ts +89 -0
- package/_types/core/modules/ethereum/types.d.ts.map +1 -0
- package/_types/core/modules/relayer/mock.d.ts +3 -0
- package/_types/core/modules/relayer/mock.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/RelayerAsyncRequest.d.ts +190 -0
- package/_types/core/modules/relayer/module/RelayerAsyncRequest.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchCoprocessorSignatures.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchCoprocessorSignatures.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchFheEncryptionKeyBytes.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchFheEncryptionKeyBytes.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchFheEncryptionKeySource.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchFheEncryptionKeySource.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchPublicDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchPublicDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchUserDecrypt.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchUserDecrypt.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerInputProofSucceeded.d.ts +22 -0
- package/_types/core/modules/relayer/module/guards/RelayerInputProofSucceeded.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.d.ts +18 -0
- package/_types/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerResponseFailed.d.ts +55 -0
- package/_types/core/modules/relayer/module/guards/RelayerResponseFailed.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerResponseQueued.d.ts +24 -0
- package/_types/core/modules/relayer/module/guards/RelayerResponseQueued.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.d.ts +20 -0
- package/_types/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.d.ts +15 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.d.ts +18 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError404.d.ts +13 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError404.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError429.d.ts +13 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError429.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError500.d.ts +13 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError500.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError503.d.ts +13 -0
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError503.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/index.d.ts +3 -0
- package/_types/core/modules/relayer/module/index.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/relayerUrl.d.ts +6 -0
- package/_types/core/modules/relayer/module/relayerUrl.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/utils.d.ts +3 -0
- package/_types/core/modules/relayer/module/utils.d.ts.map +1 -0
- package/_types/core/modules/relayer/types.d.ts +96 -0
- package/_types/core/modules/relayer/types.d.ts.map +1 -0
- package/_types/core/runtime/CoreFhevm-p.d.ts +46 -0
- package/_types/core/runtime/CoreFhevm-p.d.ts.map +1 -0
- package/_types/core/runtime/CoreFhevmRuntime-p.d.ts +25 -0
- package/_types/core/runtime/CoreFhevmRuntime-p.d.ts.map +1 -0
- package/_types/core/runtime/FhevmRuntime.d.ts +3 -0
- package/_types/core/runtime/FhevmRuntime.d.ts.map +1 -0
- package/_types/core/runtime/initFhevmDecryptRuntime-p.d.ts +3 -0
- package/_types/core/runtime/initFhevmDecryptRuntime-p.d.ts.map +1 -0
- package/_types/core/runtime/initFhevmEncryptRuntime-p.d.ts +3 -0
- package/_types/core/runtime/initFhevmEncryptRuntime-p.d.ts.map +1 -0
- package/_types/core/runtime/initFhevmRuntime-p.d.ts +3 -0
- package/_types/core/runtime/initFhevmRuntime-p.d.ts.map +1 -0
- package/_types/core/types/auth.d.ts +41 -0
- package/_types/core/types/auth.d.ts.map +1 -0
- package/_types/core/types/configs.d.ts +21 -0
- package/_types/core/types/configs.d.ts.map +1 -0
- package/_types/core/types/coprocessor.d.ts +71 -0
- package/_types/core/types/coprocessor.d.ts.map +1 -0
- package/_types/core/types/coprocessorSignersContext.d.ts +14 -0
- package/_types/core/types/coprocessorSignersContext.d.ts.map +1 -0
- package/_types/core/types/coreFhevmClient.d.ts +33 -0
- package/_types/core/types/coreFhevmClient.d.ts.map +1 -0
- package/_types/core/types/coreFhevmRuntime.d.ts +36 -0
- package/_types/core/types/coreFhevmRuntime.d.ts.map +1 -0
- package/_types/core/types/encryptedTypes-p.d.ts +104 -0
- package/_types/core/types/encryptedTypes-p.d.ts.map +1 -0
- package/_types/core/types/encryptedTypes.d.ts +35 -0
- package/_types/core/types/encryptedTypes.d.ts.map +1 -0
- package/_types/core/types/fheEncryptionKey.d.ts +77 -0
- package/_types/core/types/fheEncryptionKey.d.ts.map +1 -0
- package/_types/core/types/fheType.d.ts +99 -0
- package/_types/core/types/fheType.d.ts.map +1 -0
- package/_types/core/types/fhevmChain.d.ts +75 -0
- package/_types/core/types/fhevmChain.d.ts.map +1 -0
- package/_types/core/types/fhevmClient.d.ts +11 -0
- package/_types/core/types/fhevmClient.d.ts.map +1 -0
- package/_types/core/types/fhevmDecryptionKey.d.ts +4 -0
- package/_types/core/types/fhevmDecryptionKey.d.ts.map +1 -0
- package/_types/core/types/fhevmUser.d.ts +7 -0
- package/_types/core/types/fhevmUser.d.ts.map +1 -0
- package/_types/core/types/hostContract.d.ts +22 -0
- package/_types/core/types/hostContract.d.ts.map +1 -0
- package/_types/core/types/index.d.ts +3 -0
- package/_types/core/types/index.d.ts.map +1 -0
- package/_types/core/types/inputProof.d.ts +74 -0
- package/_types/core/types/inputProof.d.ts.map +1 -0
- package/_types/core/types/kms-p.d.ts +17 -0
- package/_types/core/types/kms-p.d.ts.map +1 -0
- package/_types/core/types/kms.d.ts +179 -0
- package/_types/core/types/kms.d.ts.map +1 -0
- package/_types/core/types/kmsSignersContext.d.ts +48 -0
- package/_types/core/types/kmsSignersContext.d.ts.map +1 -0
- package/_types/core/types/logger.d.ts +5 -0
- package/_types/core/types/logger.d.ts.map +1 -0
- package/_types/core/types/other-p.d.ts +11 -0
- package/_types/core/types/other-p.d.ts.map +1 -0
- package/_types/core/types/primitives.d.ts +527 -0
- package/_types/core/types/primitives.d.ts.map +1 -0
- package/_types/core/types/publicDecryptionProof-p.d.ts +27 -0
- package/_types/core/types/publicDecryptionProof-p.d.ts.map +1 -0
- package/_types/core/types/record-p.d.ts +18 -0
- package/_types/core/types/record-p.d.ts.map +1 -0
- package/_types/core/types/relayer-p.d.ts +285 -0
- package/_types/core/types/relayer-p.d.ts.map +1 -0
- package/_types/core/types/relayer.d.ts +106 -0
- package/_types/core/types/relayer.d.ts.map +1 -0
- package/_types/core/types/signedDecryptionPermit.d.ts +46 -0
- package/_types/core/types/signedDecryptionPermit.d.ts.map +1 -0
- package/_types/core/types/tkms-p.d.ts +5 -0
- package/_types/core/types/tkms-p.d.ts.map +1 -0
- package/_types/core/types/utils.d.ts +34 -0
- package/_types/core/types/utils.d.ts.map +1 -0
- package/_types/core/types/zkProof-p.d.ts +21 -0
- package/_types/core/types/zkProof-p.d.ts.map +1 -0
- package/_types/core/types/zkProofBuilder.d.ts +23 -0
- package/_types/core/types/zkProofBuilder.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/assertPermitMatchesKeypair.d.ts +12 -0
- package/_types/core/utils-p/decrypt/assertPermitMatchesKeypair.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.d.ts +14 -0
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712.d.ts +14 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyTkmsPublicKey.d.ts +16 -0
- package/_types/core/utils-p/decrypt/verifyTkmsPublicKey.d.ts.map +1 -0
- package/_types/core/utils-p/runtime/recoverSigners.d.ts +23 -0
- package/_types/core/utils-p/runtime/recoverSigners.d.ts.map +1 -0
- package/_types/ethers/clients/createFhevmBaseClient.d.ts +11 -0
- package/_types/ethers/clients/createFhevmBaseClient.d.ts.map +1 -0
- package/_types/ethers/clients/createFhevmClient.d.ts +11 -0
- package/_types/ethers/clients/createFhevmClient.d.ts.map +1 -0
- package/_types/ethers/clients/createFhevmDecryptClient.d.ts +11 -0
- package/_types/ethers/clients/createFhevmDecryptClient.d.ts.map +1 -0
- package/_types/ethers/clients/createFhevmEncryptClient.d.ts +11 -0
- package/_types/ethers/clients/createFhevmEncryptClient.d.ts.map +1 -0
- package/_types/ethers/decorators/decrypt.d.ts +6 -0
- package/_types/ethers/decorators/decrypt.d.ts.map +1 -0
- package/_types/ethers/decorators/encrypt.d.ts +6 -0
- package/_types/ethers/decorators/encrypt.d.ts.map +1 -0
- package/_types/ethers/index.d.ts +9 -0
- package/_types/ethers/index.d.ts.map +1 -0
- package/_types/ethers/internal/ethereum.d.ts +11 -0
- package/_types/ethers/internal/ethereum.d.ts.map +1 -0
- package/_types/ethers/internal/ethers-p.d.ts +39 -0
- package/_types/ethers/internal/ethers-p.d.ts.map +1 -0
- package/_types/ethers/internal/utils.d.ts +10 -0
- package/_types/ethers/internal/utils.d.ts.map +1 -0
- package/_types/ethers/runtime/initFhevmDecryptRuntime.d.ts +2 -0
- package/_types/ethers/runtime/initFhevmDecryptRuntime.d.ts.map +1 -0
- package/_types/ethers/runtime/initFhevmEncryptRuntime.d.ts +2 -0
- package/_types/ethers/runtime/initFhevmEncryptRuntime.d.ts.map +1 -0
- package/_types/ethers/runtime/initFhevmRuntime.d.ts +2 -0
- package/_types/ethers/runtime/initFhevmRuntime.d.ts.map +1 -0
- package/_types/viem/clients/createFhevmBaseClient.d.ts +11 -0
- package/_types/viem/clients/createFhevmBaseClient.d.ts.map +1 -0
- package/_types/viem/clients/createFhevmClient.d.ts +11 -0
- package/_types/viem/clients/createFhevmClient.d.ts.map +1 -0
- package/_types/viem/clients/createFhevmDecryptClient.d.ts +11 -0
- package/_types/viem/clients/createFhevmDecryptClient.d.ts.map +1 -0
- package/_types/viem/clients/createFhevmEncryptClient.d.ts +11 -0
- package/_types/viem/clients/createFhevmEncryptClient.d.ts.map +1 -0
- package/_types/viem/decorators/decrypt.d.ts +6 -0
- package/_types/viem/decorators/decrypt.d.ts.map +1 -0
- package/_types/viem/decorators/encrypt.d.ts +6 -0
- package/_types/viem/decorators/encrypt.d.ts.map +1 -0
- package/_types/viem/index.d.ts +9 -0
- package/_types/viem/index.d.ts.map +1 -0
- package/_types/viem/internal/ethereum.d.ts +11 -0
- package/_types/viem/internal/ethereum.d.ts.map +1 -0
- package/_types/viem/internal/viem-p.d.ts +39 -0
- package/_types/viem/internal/viem-p.d.ts.map +1 -0
- package/_types/viem/runtime/initFhevmDecryptRuntime.d.ts +2 -0
- package/_types/viem/runtime/initFhevmDecryptRuntime.d.ts.map +1 -0
- package/_types/viem/runtime/initFhevmEncryptRuntime.d.ts +2 -0
- package/_types/viem/runtime/initFhevmEncryptRuntime.d.ts.map +1 -0
- package/_types/viem/runtime/initFhevmRuntime.d.ts +2 -0
- package/_types/viem/runtime/initFhevmRuntime.d.ts.map +1 -0
- package/core/_version.ts +3 -0
- package/core/actions/base/canReadPublicValue.ts +28 -0
- package/core/actions/base/canReadPublicValues.ts +28 -0
- package/core/actions/base/createVerifiedInputProofFromRawBytes.ts +24 -0
- package/core/actions/base/fetchKmsSignedcryptedShares.ts +83 -0
- package/core/actions/base/fetchVerifiedInputProof.ts +25 -0
- package/core/actions/base/index.ts +69 -0
- package/core/actions/base/package.json +6 -0
- package/core/actions/base/readCoprocessorSignersContext.ts +21 -0
- package/core/actions/base/readKmsSignersContext.ts +19 -0
- package/core/actions/base/readPublicValue.ts +31 -0
- package/core/actions/base/readPublicValues.ts +31 -0
- package/core/actions/base/readPublicValuesWithSignatures.ts +53 -0
- package/core/actions/base/signDecryptionPermit.ts +41 -0
- package/core/actions/base/verifyHandlesCoprocessorSignatures.ts +60 -0
- package/core/actions/base/verifyInputProof.ts +45 -0
- package/core/actions/base/verifyZkProofCoprocessorSignatures.ts +32 -0
- package/core/actions/chain/createCoprocessorEip712Domain.ts +16 -0
- package/core/actions/chain/createKmsDelegatedUserDecryptEip712.ts +37 -0
- package/core/actions/chain/createKmsEip712Domain.ts +16 -0
- package/core/actions/chain/createKmsUserDecryptEip712.ts +35 -0
- package/core/actions/chain/fetchFheEncryptionKeyBytes.ts +24 -0
- package/core/actions/chain/index.ts +63 -0
- package/core/actions/chain/package.json +6 -0
- package/core/actions/chain/parseSignedDecryptionPermit.ts +35 -0
- package/core/actions/chain/parseTransportKeypair.ts +24 -0
- package/core/actions/chain/serializeSignedDecryptionPermit.ts +31 -0
- package/core/actions/chain/serializeTransportKeypair.ts +28 -0
- package/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.ts +16 -0
- package/core/actions/chain/verifyKmsUserDecryptEip712.ts +16 -0
- package/core/actions/decrypt/canDecryptValue.ts +109 -0
- package/core/actions/decrypt/canDecryptValues.ts +71 -0
- package/core/actions/decrypt/canDecryptValuesFromPairs.ts +68 -0
- package/core/actions/decrypt/decryptKmsSignedcryptedShares.ts +31 -0
- package/core/actions/decrypt/decryptValue.ts +69 -0
- package/core/actions/decrypt/decryptValues.ts +66 -0
- package/core/actions/decrypt/decryptValuesFromPairs.ts +66 -0
- package/core/actions/decrypt/generateTransportKeypair.ts +19 -0
- package/core/actions/decrypt/index.ts +58 -0
- package/core/actions/decrypt/package.json +6 -0
- package/core/actions/encrypt/encryptValue.ts +52 -0
- package/core/actions/encrypt/encryptValues.ts +51 -0
- package/core/actions/encrypt/generateZkProof.ts +34 -0
- package/core/actions/encrypt/index.ts +12 -0
- package/core/actions/encrypt/package.json +6 -0
- package/core/actions/host/getUserDecryptionDelegationExpirationDate.ts +32 -0
- package/core/actions/host/index.ts +33 -0
- package/core/actions/host/isAllowedForDecryption.ts +35 -0
- package/core/actions/host/package.json +6 -0
- package/core/actions/host/persistAllowed.ts +35 -0
- package/core/actions/host/readFhevmExecutorContractData.ts +74 -0
- package/core/actions/host/readInputVerifierContractData.ts +74 -0
- package/core/actions/host/readKmsVerifierContractData.ts +75 -0
- package/core/actions/host/resolveChainId.ts +42 -0
- package/core/actions/host/resolveFhevmConfig.ts +191 -0
- package/core/base/address.ts +303 -0
- package/core/base/auth.ts +38 -0
- package/core/base/boolean.ts +72 -0
- package/core/base/bytes.ts +2060 -0
- package/core/base/cachedFetch.ts +184 -0
- package/core/base/errors/AddressError.ts +20 -0
- package/core/base/errors/ChecksummedAddressError.ts +23 -0
- package/core/base/errors/ErrorBase.ts +79 -0
- package/core/base/errors/FetchError.ts +27 -0
- package/core/base/errors/FheTypeError.ts +62 -0
- package/core/base/errors/InternalError.ts +33 -0
- package/core/base/errors/InvalidPropertyError.ts +232 -0
- package/core/base/errors/InvalidTypeError.ts +87 -0
- package/core/base/errors/utils.ts +41 -0
- package/core/base/fetch.ts +284 -0
- package/core/base/index.ts +1 -0
- package/core/base/isomorphicWorker.ts +283 -0
- package/core/base/object.ts +41 -0
- package/core/base/promise.ts +31 -0
- package/core/base/record.ts +201 -0
- package/core/base/string.ts +214 -0
- package/core/base/timeout.ts +32 -0
- package/core/base/trustedValue.ts +110 -0
- package/core/base/typedValue.ts +326 -0
- package/core/base/uid.ts +17 -0
- package/core/base/uint.ts +630 -0
- package/core/base/wasm.ts +97 -0
- package/core/chains/definitions/localTestnet.ts +30 -0
- package/core/chains/definitions/mainnet.ts +30 -0
- package/core/chains/definitions/sepolia.ts +32 -0
- package/core/chains/index.ts +6 -0
- package/core/chains/package.json +6 -0
- package/core/chains/utils.ts +6 -0
- package/core/clients/decorators/base.ts +203 -0
- package/core/clients/decorators/decrypt.ts +85 -0
- package/core/clients/decorators/encrypt-p.ts +18 -0
- package/core/clients/decorators/encrypt.ts +47 -0
- package/core/coprocessor/InputProof-p.ts +424 -0
- package/core/coprocessor/ZkProof-p.ts +477 -0
- package/core/coprocessor/ZkProofBuilder-p.ts +295 -0
- package/core/coprocessor/assertIsCoprocessorEip712Domain.ts +23 -0
- package/core/coprocessor/coprocessorEip712Types.ts +39 -0
- package/core/coprocessor/createCoprocessorEip712.ts +69 -0
- package/core/coprocessor/createCoprocessorEip712Domain.ts +25 -0
- package/core/coprocessor/encrypt.ts +48 -0
- package/core/coprocessor/fetchVerifiedInputProof.ts +84 -0
- package/core/coprocessor/verifyHandlesCoprocessorSignatures.ts +66 -0
- package/core/coprocessor/verifyInputProof.ts +50 -0
- package/core/errors/AclError.ts +55 -0
- package/core/errors/ContractErrorBase.ts +38 -0
- package/core/errors/EncryptionError.ts +22 -0
- package/core/errors/FhevmConfigError.ts +22 -0
- package/core/errors/FhevmErrorBase.ts +53 -0
- package/core/errors/FhevmHandleError.ts +20 -0
- package/core/errors/InputProofError.ts +43 -0
- package/core/errors/RelayerAbortError.ts +27 -0
- package/core/errors/RelayerErrorBase.ts +81 -0
- package/core/errors/RelayerFetchError.ts +35 -0
- package/core/errors/RelayerFetchErrorBase.ts +90 -0
- package/core/errors/RelayerMaxRetryError.ts +28 -0
- package/core/errors/RelayerRequestErrorBase.ts +56 -0
- package/core/errors/RelayerRequestInternalError.ts +52 -0
- package/core/errors/RelayerResponseApiError.ts +43 -0
- package/core/errors/RelayerResponseErrorBase.ts +35 -0
- package/core/errors/RelayerResponseInputProofRejectedError.ts +28 -0
- package/core/errors/RelayerResponseInvalidBodyError.ts +43 -0
- package/core/errors/RelayerResponseStatusError.ts +33 -0
- package/core/errors/RelayerStateError.ts +39 -0
- package/core/errors/RelayerTimeoutError.ts +31 -0
- package/core/errors/SignersError.ts +73 -0
- package/core/errors/TfheError.ts +26 -0
- package/core/errors/ZkProofError.ts +23 -0
- package/core/handle/ClearValue.ts +341 -0
- package/core/handle/EncryptedValue.ts +29 -0
- package/core/handle/FheType.ts +545 -0
- package/core/handle/FhevmHandle.ts +740 -0
- package/core/host-contracts/CoprocessorSignersContext-p.ts +167 -0
- package/core/host-contracts/FhevmExecutorContractData-p.ts +133 -0
- package/core/host-contracts/HostContractVersion-p.ts +155 -0
- package/core/host-contracts/InputVerifierContractData-p.ts +133 -0
- package/core/host-contracts/KmsSignersContext-p.ts +238 -0
- package/core/host-contracts/KmsVerifierContractData-p.ts +110 -0
- package/core/host-contracts/abi-fragments/fragments.ts +460 -0
- package/core/host-contracts/canDecryptValuesFromPairs.ts +94 -0
- package/core/host-contracts/checkAllowedForDecryption.ts +36 -0
- package/core/host-contracts/checkPersistAllowed.ts +115 -0
- package/core/host-contracts/decryptionResultTypehash-p.ts +47 -0
- package/core/host-contracts/eip712Domain-p.ts +75 -0
- package/core/host-contracts/eip712InputVerificationTypehash-p.ts +47 -0
- package/core/host-contracts/getAclAddress-p.ts +47 -0
- package/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.ts +136 -0
- package/core/host-contracts/getCoprocessorSigners-p.ts +47 -0
- package/core/host-contracts/getCurrentKmsContextId-p.ts +74 -0
- package/core/host-contracts/getFhevmExecutorAddress-p.ts +47 -0
- package/core/host-contracts/getHandleVersion-p.ts +43 -0
- package/core/host-contracts/getHcuLimitAddress-p.ts +47 -0
- package/core/host-contracts/getInputVerifierAddress-p.ts +47 -0
- package/core/host-contracts/getKmsContextSignersAndThreshold-p.ts +149 -0
- package/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.ts +110 -0
- package/core/host-contracts/getSignersForKmsContext-p.ts +90 -0
- package/core/host-contracts/isAllowedForDecryption.ts +65 -0
- package/core/host-contracts/isUserDecryptable.ts +92 -0
- package/core/host-contracts/persistAllowed.ts +68 -0
- package/core/host-contracts/readCoprocessorSignersContext-p.ts +34 -0
- package/core/host-contracts/readKmsSignersContext-p.ts +221 -0
- package/core/key/FheEncryptionKeyCache-p.ts +326 -0
- package/core/key/FheEncryptionKeyWasm-p.ts +97 -0
- package/core/key/deserializeFheEncryptionKey.ts +24 -0
- package/core/key/fetchFheEncryptionKey.ts +46 -0
- package/core/key/fetchFheEncryptionKeyBytes.ts +69 -0
- package/core/key/fetchFheEncryptionKeyBytesWithSource.ts +72 -0
- package/core/key/serializeFheEncryptionKey.ts +36 -0
- package/core/kms/KmsSigncryptedShares-p.ts +169 -0
- package/core/kms/PublicDecryptionProof-p.ts +181 -0
- package/core/kms/PublicDecryptionProof.ts +10 -0
- package/core/kms/SignedDecryptionPermit-p.ts +453 -0
- package/core/kms/TransportKeypair-p.ts +278 -0
- package/core/kms/createKmsDelegatedUserDecryptEip712.ts +135 -0
- package/core/kms/createKmsEip712Domain.ts +67 -0
- package/core/kms/createKmsPublicDecryptEip712.ts +59 -0
- package/core/kms/createKmsUserDecryptEip712.ts +172 -0
- package/core/kms/decryptKmsSignedcryptedShares-p.ts +37 -0
- package/core/kms/decryptValuesFromPairs.ts +57 -0
- package/core/kms/fetchKmsSignedcryptedShares-p.ts +211 -0
- package/core/kms/index.ts +1 -0
- package/core/kms/kmsDelegatedUserDecryptEip712Types.ts +31 -0
- package/core/kms/kmsExtraData.ts +51 -0
- package/core/kms/kmsPublicDecryptEip712Types.ts +28 -0
- package/core/kms/kmsUserDecryptEip712Types.ts +30 -0
- package/core/kms/publicDecrypt.ts +109 -0
- package/core/kms/utils.ts +60 -0
- package/core/kms/verifyKmsPublicDecryptEip712-p.ts +75 -0
- package/core/modules/decrypt/mock.ts +134 -0
- package/core/modules/decrypt/module/api-p.ts +388 -0
- package/core/modules/decrypt/module/index.ts +73 -0
- package/core/modules/decrypt/module/init-p.ts +166 -0
- package/core/modules/decrypt/types.ts +214 -0
- package/core/modules/encrypt/mock.ts +111 -0
- package/core/modules/encrypt/module/api-p.ts +433 -0
- package/core/modules/encrypt/module/index.ts +47 -0
- package/core/modules/encrypt/module/init-p.ts +249 -0
- package/core/modules/encrypt/types.ts +225 -0
- package/core/modules/ethereum/createTrustedClient.ts +9 -0
- package/core/modules/ethereum/types.ts +153 -0
- package/core/modules/relayer/mock.ts +47 -0
- package/core/modules/relayer/module/RelayerAsyncRequest.ts +1771 -0
- package/core/modules/relayer/module/fetchCoprocessorSignatures.ts +45 -0
- package/core/modules/relayer/module/fetchDelegatedUserDecrypt.ts +67 -0
- package/core/modules/relayer/module/fetchFheEncryptionKeyBytes.ts +34 -0
- package/core/modules/relayer/module/fetchFheEncryptionKeySource.ts +166 -0
- package/core/modules/relayer/module/fetchPublicDecrypt.ts +40 -0
- package/core/modules/relayer/module/fetchUserDecrypt.ts +65 -0
- package/core/modules/relayer/module/guards/RelayerInputProofSucceeded.ts +106 -0
- package/core/modules/relayer/module/guards/RelayerPublicDecryptSucceeded.ts +59 -0
- package/core/modules/relayer/module/guards/RelayerResponseFailed.ts +244 -0
- package/core/modules/relayer/module/guards/RelayerResponseQueued.ts +51 -0
- package/core/modules/relayer/module/guards/RelayerUserDecryptSucceeded.ts +77 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.ts +65 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError400WithDetails.ts +87 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError404.ts +25 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError429.ts +25 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError500.ts +25 -0
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError503.ts +30 -0
- package/core/modules/relayer/module/index.ts +24 -0
- package/core/modules/relayer/module/relayerUrl.ts +38 -0
- package/core/modules/relayer/module/utils.ts +20 -0
- package/core/modules/relayer/types.ts +183 -0
- package/core/runtime/CoreFhevm-p.ts +409 -0
- package/core/runtime/CoreFhevmRuntime-p.ts +266 -0
- package/core/runtime/FhevmRuntime.ts +2 -0
- package/core/runtime/initFhevmDecryptRuntime-p.ts +9 -0
- package/core/runtime/initFhevmEncryptRuntime-p.ts +9 -0
- package/core/runtime/initFhevmRuntime-p.ts +10 -0
- package/core/types/auth.ts +44 -0
- package/core/types/configs.ts +29 -0
- package/core/types/coprocessor.ts +83 -0
- package/core/types/coprocessorSignersContext.ts +15 -0
- package/core/types/coreFhevmClient.ts +55 -0
- package/core/types/coreFhevmRuntime.ts +44 -0
- package/core/types/encryptedTypes-p.ts +226 -0
- package/core/types/encryptedTypes.ts +41 -0
- package/core/types/fheEncryptionKey.ts +106 -0
- package/core/types/fheType.ts +137 -0
- package/core/types/fhevmChain.ts +86 -0
- package/core/types/fhevmClient.ts +30 -0
- package/core/types/fhevmDecryptionKey.ts +8 -0
- package/core/types/fhevmUser.ts +7 -0
- package/core/types/hostContract.ts +27 -0
- package/core/types/index.ts +2 -0
- package/core/types/inputProof.ts +87 -0
- package/core/types/kms-p.ts +18 -0
- package/core/types/kms.ts +132 -0
- package/core/types/kmsSignersContext.ts +48 -0
- package/core/types/logger.ts +4 -0
- package/core/types/other-p.ts +12 -0
- package/core/types/primitives.ts +641 -0
- package/core/types/publicDecryptionProof-p.ts +33 -0
- package/core/types/record-p.ts +32 -0
- package/core/types/relayer-p.ts +406 -0
- package/core/types/relayer.ts +183 -0
- package/core/types/signedDecryptionPermit.ts +50 -0
- package/core/types/tkms-p.ts +5 -0
- package/core/types/utils.ts +34 -0
- package/core/types/zkProof-p.ts +29 -0
- package/core/types/zkProofBuilder.ts +36 -0
- package/core/utils-p/decrypt/assertPermitMatchesKeypair.ts +27 -0
- package/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.ts +47 -0
- package/core/utils-p/decrypt/verifyKmsUserDecryptEip712.ts +47 -0
- package/core/utils-p/decrypt/verifyTkmsPublicKey.ts +27 -0
- package/core/utils-p/runtime/recoverSigners.ts +46 -0
- package/ethers/clients/createFhevmBaseClient.ts +24 -0
- package/ethers/clients/createFhevmClient.ts +20 -0
- package/ethers/clients/createFhevmDecryptClient.ts +21 -0
- package/ethers/clients/createFhevmEncryptClient.ts +24 -0
- package/ethers/decorators/decrypt.ts +12 -0
- package/ethers/decorators/encrypt.ts +12 -0
- package/ethers/index.ts +10 -0
- package/ethers/internal/ethereum.ts +165 -0
- package/ethers/internal/ethers-p.ts +105 -0
- package/ethers/internal/utils.ts +41 -0
- package/ethers/package.json +6 -0
- package/ethers/runtime/initFhevmDecryptRuntime.ts +8 -0
- package/ethers/runtime/initFhevmEncryptRuntime.ts +8 -0
- package/ethers/runtime/initFhevmRuntime.ts +8 -0
- package/package.json +90 -2
- package/tsconfig.json +9 -0
- package/viem/clients/createFhevmBaseClient.ts +24 -0
- package/viem/clients/createFhevmClient.ts +20 -0
- package/viem/clients/createFhevmDecryptClient.ts +18 -0
- package/viem/clients/createFhevmEncryptClient.ts +21 -0
- package/viem/decorators/decrypt.ts +12 -0
- package/viem/decorators/encrypt.ts +12 -0
- package/viem/index.ts +10 -0
- package/viem/internal/ethereum.ts +145 -0
- package/viem/internal/viem-p.ts +105 -0
- package/viem/package.json +6 -0
- package/viem/runtime/initFhevmDecryptRuntime.ts +8 -0
- package/viem/runtime/initFhevmEncryptRuntime.ts +8 -0
- package/viem/runtime/initFhevmRuntime.ts +8 -0
- package/wasm/tfhe/compile-worker.js +8 -0
- package/wasm/tfhe/startWorkers.v1.5.3.js +426 -0
- package/wasm/tfhe/tfhe-worker.v1.5.3.inline.js +7 -0
- package/wasm/tfhe/tfhe-worker.v1.5.3.mjs +745 -0
- package/wasm/tfhe/tfhe.v1.5.3.d.ts +10793 -0
- package/wasm/tfhe/tfhe.v1.5.3.js +28645 -0
- package/wasm/tfhe/tfhe_bg.v1.5.3.wasm +0 -0
- package/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.d.ts +1 -0
- package/wasm/tfhe/tfhe_bg.v1.5.3.wasm.base64.js +1 -0
- package/wasm/tkms/kms_lib.v0.13.10.d.ts +586 -0
- package/wasm/tkms/kms_lib.v0.13.10.js +2117 -0
- package/wasm/tkms/kms_lib_bg.v0.13.10.wasm +0 -0
- package/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.d.ts +1 -0
- package/wasm/tkms/kms_lib_bg.v0.13.10.wasm.base64.js +3 -0
- package/wasm/wasmBaseUrl.d.ts +7 -0
- package/wasm/wasmBaseUrl.js +14 -0
|
@@ -0,0 +1,1445 @@
|
|
|
1
|
+
import { assertRecordArrayProperty, isRecordNonNullableProperty, typeofProperty } from './record.js';
|
|
2
|
+
import { is0x, isNo0x, remove0x } from './string.js';
|
|
3
|
+
import { InvalidPropertyError } from './errors/InvalidPropertyError.js';
|
|
4
|
+
import { InvalidTypeError } from './errors/InvalidTypeError.js';
|
|
5
|
+
import { isUintForByteLength } from './uint.js';
|
|
6
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
7
|
+
/**
|
|
8
|
+
* Maps BytesXX type names to their corresponding byte lengths.
|
|
9
|
+
* Type is derived from BytesTypeNameToByteLengthMap to ensure consistency.
|
|
10
|
+
*/
|
|
11
|
+
export const ByteLengthForType = {
|
|
12
|
+
bytes1: 1,
|
|
13
|
+
bytes2: 2,
|
|
14
|
+
bytes4: 4,
|
|
15
|
+
bytes8: 8,
|
|
16
|
+
bytes20: 20,
|
|
17
|
+
bytes21: 21,
|
|
18
|
+
bytes32: 32,
|
|
19
|
+
bytes65: 65,
|
|
20
|
+
};
|
|
21
|
+
Object.freeze(ByteLengthForType);
|
|
22
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
23
|
+
const bytesHexRegex = /^0x[a-fA-F0-9]*$/;
|
|
24
|
+
const bytesHexNo0xRegex = /^[a-fA-F0-9]*$/;
|
|
25
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
26
|
+
// isBytesXX
|
|
27
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
28
|
+
export function isBytes(value, byteLength) {
|
|
29
|
+
if (value === undefined || value === null) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
if (!(value instanceof Uint8Array)) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return byteLength !== undefined ? value.length === byteLength : true;
|
|
36
|
+
}
|
|
37
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
38
|
+
export function isBytesForType(value, typeName) {
|
|
39
|
+
return isBytes(value, typeName !== undefined ? ByteLengthForType[typeName] : undefined);
|
|
40
|
+
}
|
|
41
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
42
|
+
export function isBytes1(value) {
|
|
43
|
+
return isBytes(value, 1);
|
|
44
|
+
}
|
|
45
|
+
export function isBytes8(value) {
|
|
46
|
+
return isBytes(value, 8);
|
|
47
|
+
}
|
|
48
|
+
export function isBytes20(value) {
|
|
49
|
+
return isBytes(value, 20);
|
|
50
|
+
}
|
|
51
|
+
export function isBytes21(value) {
|
|
52
|
+
return isBytes(value, 21);
|
|
53
|
+
}
|
|
54
|
+
export function isBytes32(value) {
|
|
55
|
+
return isBytes(value, 32);
|
|
56
|
+
}
|
|
57
|
+
export function isBytes65(value) {
|
|
58
|
+
return isBytes(value, 65);
|
|
59
|
+
}
|
|
60
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
61
|
+
// isBytesXXHex
|
|
62
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
63
|
+
export function isBytesHex(value, byteLength) {
|
|
64
|
+
if (!is0x(value)) {
|
|
65
|
+
return false;
|
|
66
|
+
}
|
|
67
|
+
if (byteLength !== undefined && value.length !== 2 * byteLength + 2) {
|
|
68
|
+
return false;
|
|
69
|
+
}
|
|
70
|
+
if ((value.length - 2) % 2 !== 0) {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
return bytesHexRegex.test(value);
|
|
74
|
+
}
|
|
75
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
76
|
+
export function isBytes1Hex(value) {
|
|
77
|
+
return isBytesHex(value, 1);
|
|
78
|
+
}
|
|
79
|
+
export function isBytes8Hex(value) {
|
|
80
|
+
return isBytesHex(value, 8);
|
|
81
|
+
}
|
|
82
|
+
export function isBytes20Hex(value) {
|
|
83
|
+
return isBytesHex(value, 20);
|
|
84
|
+
}
|
|
85
|
+
export function isBytes21Hex(value) {
|
|
86
|
+
return isBytesHex(value, 21);
|
|
87
|
+
}
|
|
88
|
+
export function isBytes32Hex(value) {
|
|
89
|
+
return isBytesHex(value, 32);
|
|
90
|
+
}
|
|
91
|
+
export function isBytes65Hex(value) {
|
|
92
|
+
return isBytesHex(value, 65);
|
|
93
|
+
}
|
|
94
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
95
|
+
// isBytesXXHexNo0x
|
|
96
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
97
|
+
export function isBytesHexNo0x(value, byteLength) {
|
|
98
|
+
if (!isNo0x(value)) {
|
|
99
|
+
return false;
|
|
100
|
+
}
|
|
101
|
+
if (byteLength !== undefined && value.length !== 2 * byteLength) {
|
|
102
|
+
return false;
|
|
103
|
+
}
|
|
104
|
+
if (value.length % 2 !== 0) {
|
|
105
|
+
return false;
|
|
106
|
+
}
|
|
107
|
+
if (!bytesHexNo0xRegex.test(value)) {
|
|
108
|
+
return false;
|
|
109
|
+
}
|
|
110
|
+
return true;
|
|
111
|
+
}
|
|
112
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
113
|
+
export function isBytes1HexNo0x(value) {
|
|
114
|
+
return isBytesHexNo0x(value, 1);
|
|
115
|
+
}
|
|
116
|
+
export function isBytes8HexNo0x(value) {
|
|
117
|
+
return isBytesHexNo0x(value, 8);
|
|
118
|
+
}
|
|
119
|
+
export function isBytes20HexNo0x(value) {
|
|
120
|
+
return isBytesHexNo0x(value, 20);
|
|
121
|
+
}
|
|
122
|
+
export function isBytes21HexNo0x(value) {
|
|
123
|
+
return isBytesHexNo0x(value, 21);
|
|
124
|
+
}
|
|
125
|
+
export function isBytes32HexNo0x(value) {
|
|
126
|
+
return isBytesHexNo0x(value, 32);
|
|
127
|
+
}
|
|
128
|
+
export function isBytes65HexNo0x(value) {
|
|
129
|
+
return isBytesHexNo0x(value, 65);
|
|
130
|
+
}
|
|
131
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
132
|
+
// assertIsBytesXX
|
|
133
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
134
|
+
export function assertIsBytes(value, options) {
|
|
135
|
+
if (!isBytes(value, options?.byteLength)) {
|
|
136
|
+
throw new InvalidTypeError({
|
|
137
|
+
subject: options?.subject,
|
|
138
|
+
expectedType: `bytes${options?.byteLength ?? ''}`,
|
|
139
|
+
}, options ?? {});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
export function assertIsBytesForType(value, options) {
|
|
143
|
+
if (!isBytesForType(value, options?.typeName)) {
|
|
144
|
+
throw new InvalidTypeError({
|
|
145
|
+
subject: options?.subject,
|
|
146
|
+
expectedType: options?.typeName ?? 'bytes',
|
|
147
|
+
}, options ?? {});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
export function assertIsBytes1(value, options) {
|
|
151
|
+
assertIsBytes(value, { byteLength: 1, ...options });
|
|
152
|
+
}
|
|
153
|
+
export function assertIsBytes8(value, options) {
|
|
154
|
+
assertIsBytes(value, { byteLength: 8, ...options });
|
|
155
|
+
}
|
|
156
|
+
export function assertIsBytes20(value, options) {
|
|
157
|
+
assertIsBytes(value, { byteLength: 20, ...options });
|
|
158
|
+
}
|
|
159
|
+
export function assertIsBytes21(value, options) {
|
|
160
|
+
assertIsBytes(value, { byteLength: 21, ...options });
|
|
161
|
+
}
|
|
162
|
+
export function assertIsBytes32(value, options) {
|
|
163
|
+
assertIsBytes(value, { byteLength: 32, ...options });
|
|
164
|
+
}
|
|
165
|
+
export function assertIsBytes65(value, options) {
|
|
166
|
+
assertIsBytes(value, { byteLength: 65, ...options });
|
|
167
|
+
}
|
|
168
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
169
|
+
export function asBytesForType(value, options) {
|
|
170
|
+
assertIsBytesForType(value, options);
|
|
171
|
+
return value;
|
|
172
|
+
}
|
|
173
|
+
export function asBytes(value, options) {
|
|
174
|
+
assertIsBytes(value, options);
|
|
175
|
+
return value;
|
|
176
|
+
}
|
|
177
|
+
export function asBytes1(value, options) {
|
|
178
|
+
assertIsBytes(value, { byteLength: 1, ...options });
|
|
179
|
+
return value;
|
|
180
|
+
}
|
|
181
|
+
export function asBytes8(value, options) {
|
|
182
|
+
assertIsBytes(value, { byteLength: 8, ...options });
|
|
183
|
+
return value;
|
|
184
|
+
}
|
|
185
|
+
export function asBytes20(value, options) {
|
|
186
|
+
assertIsBytes(value, { byteLength: 20, ...options });
|
|
187
|
+
return value;
|
|
188
|
+
}
|
|
189
|
+
export function asBytes21(value, options) {
|
|
190
|
+
assertIsBytes(value, { byteLength: 21, ...options });
|
|
191
|
+
return value;
|
|
192
|
+
}
|
|
193
|
+
export function asBytes32(value, options) {
|
|
194
|
+
assertIsBytes(value, { byteLength: 32, ...options });
|
|
195
|
+
return value;
|
|
196
|
+
}
|
|
197
|
+
export function asBytes65(value, options) {
|
|
198
|
+
assertIsBytes(value, { byteLength: 65, ...options });
|
|
199
|
+
return value;
|
|
200
|
+
}
|
|
201
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
202
|
+
// assertIsBytesXXHex
|
|
203
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
204
|
+
/**
|
|
205
|
+
* Assertion function that validates a value is a valid hex bytes string.
|
|
206
|
+
* A valid BytesHex string must start with "0x" followed by an even number of hexadecimal characters.
|
|
207
|
+
* Throws an `InvalidTypeError` if validation fails.
|
|
208
|
+
*
|
|
209
|
+
* @param value - The value to validate (can be any type)
|
|
210
|
+
* @param options - Validation options
|
|
211
|
+
* @param options.byteLength - Optional expected byte length (e.g., 8, 20, 32)
|
|
212
|
+
* @param options.subject - Optional name of the value being validated (used in error messages)
|
|
213
|
+
* @throws {InvalidTypeError} When the value is not a string or not valid BytesHex format
|
|
214
|
+
* @throws {never} No other errors are thrown
|
|
215
|
+
*
|
|
216
|
+
* @example
|
|
217
|
+
* ```typescript
|
|
218
|
+
* function processHash(hash: unknown) {
|
|
219
|
+
* assertIsBytesHex(hash, { byteLength: 32, subject: 'hash' });
|
|
220
|
+
* console.log(hash); // TypeScript now knows hash is BytesHex
|
|
221
|
+
* }
|
|
222
|
+
* ```
|
|
223
|
+
*/
|
|
224
|
+
export function assertIsBytesHex(value, options) {
|
|
225
|
+
if (!isBytesHex(value, options.byteLength)) {
|
|
226
|
+
throw new InvalidTypeError({
|
|
227
|
+
subject: options.subject,
|
|
228
|
+
type: typeof value,
|
|
229
|
+
expectedType: `bytes${options.byteLength ?? ''}Hex`,
|
|
230
|
+
}, options);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Asserts that a value is either a `Bytes` (Uint8Array) or a `BytesHex` (hex string).
|
|
235
|
+
*
|
|
236
|
+
* @throws {InvalidTypeError} When the value is neither `Bytes` nor `BytesHex`.
|
|
237
|
+
*/
|
|
238
|
+
export function assertIsBytesOrBytesHex(value, options) {
|
|
239
|
+
// faster
|
|
240
|
+
if (isBytes(value)) {
|
|
241
|
+
return;
|
|
242
|
+
}
|
|
243
|
+
// slower
|
|
244
|
+
if (isBytesHex(value)) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
throw new InvalidTypeError({
|
|
248
|
+
subject: options.subject,
|
|
249
|
+
type: typeof value,
|
|
250
|
+
expectedType: 'Bytes | BytesHex',
|
|
251
|
+
}, options);
|
|
252
|
+
}
|
|
253
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
254
|
+
export function assertIsBytes1Hex(value, options) {
|
|
255
|
+
assertIsBytesHex(value, { byteLength: 1, ...options });
|
|
256
|
+
}
|
|
257
|
+
export function assertIsBytes8Hex(value, options) {
|
|
258
|
+
assertIsBytesHex(value, { byteLength: 8, ...options });
|
|
259
|
+
}
|
|
260
|
+
export function assertIsBytes20Hex(value, options) {
|
|
261
|
+
assertIsBytesHex(value, { byteLength: 20, ...options });
|
|
262
|
+
}
|
|
263
|
+
export function assertIsBytes21Hex(value, options) {
|
|
264
|
+
assertIsBytesHex(value, { byteLength: 21, ...options });
|
|
265
|
+
}
|
|
266
|
+
export function assertIsBytes32Hex(value, options) {
|
|
267
|
+
assertIsBytesHex(value, { byteLength: 32, ...options });
|
|
268
|
+
}
|
|
269
|
+
export function assertIsBytes65Hex(value, options) {
|
|
270
|
+
assertIsBytesHex(value, { byteLength: 65, ...options });
|
|
271
|
+
}
|
|
272
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
273
|
+
export function asBytesHex(value, options) {
|
|
274
|
+
assertIsBytesHex(value, options ?? {});
|
|
275
|
+
return value;
|
|
276
|
+
}
|
|
277
|
+
export function asBytes1Hex(value, options) {
|
|
278
|
+
assertIsBytesHex(value, { byteLength: 1, ...options });
|
|
279
|
+
return value;
|
|
280
|
+
}
|
|
281
|
+
export function asBytes8Hex(value, options) {
|
|
282
|
+
assertIsBytesHex(value, { byteLength: 8, ...options });
|
|
283
|
+
return value;
|
|
284
|
+
}
|
|
285
|
+
export function asBytes20Hex(value, options) {
|
|
286
|
+
assertIsBytesHex(value, { byteLength: 20, ...options });
|
|
287
|
+
return value;
|
|
288
|
+
}
|
|
289
|
+
export function asBytes21Hex(value, options) {
|
|
290
|
+
assertIsBytesHex(value, { byteLength: 21, ...options });
|
|
291
|
+
return value;
|
|
292
|
+
}
|
|
293
|
+
export function asBytes32Hex(value, options) {
|
|
294
|
+
assertIsBytesHex(value, { byteLength: 32, ...options });
|
|
295
|
+
return value;
|
|
296
|
+
}
|
|
297
|
+
export function asBytes65Hex(value, options) {
|
|
298
|
+
assertIsBytesHex(value, { byteLength: 65, ...options });
|
|
299
|
+
return value;
|
|
300
|
+
}
|
|
301
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
302
|
+
// assertIsBytesXXHexNo0x
|
|
303
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
304
|
+
/**
|
|
305
|
+
* Assertion function that validates a value is a valid hex bytes string without "0x" prefix.
|
|
306
|
+
* A valid BytesHexNo0x string must contain only hexadecimal characters (no "0x" prefix).
|
|
307
|
+
* Throws an `InvalidTypeError` if validation fails.
|
|
308
|
+
*
|
|
309
|
+
* @param value - The value to validate (can be any type)
|
|
310
|
+
* @param options - Validation options
|
|
311
|
+
* @param options.byteLength - Optional expected byte length (e.g., 8, 20, 32)
|
|
312
|
+
* @param options.subject - Optional name of the value being validated (used in error messages)
|
|
313
|
+
* @throws {InvalidTypeError} When the value is not a string or not valid BytesHexNo0x format
|
|
314
|
+
* @throws {never} No other errors are thrown
|
|
315
|
+
*
|
|
316
|
+
* @example
|
|
317
|
+
* ```typescript
|
|
318
|
+
* function processSignature(sig: unknown) {
|
|
319
|
+
* assertIsBytesHexNo0x(sig, { byteLength: 65, subject: 'signature' });
|
|
320
|
+
* console.log(sig); // TypeScript now knows sig is BytesHexNo0x
|
|
321
|
+
* }
|
|
322
|
+
* ```
|
|
323
|
+
*/
|
|
324
|
+
export function assertIsBytesHexNo0x(value, options) {
|
|
325
|
+
if (!isBytesHexNo0x(value, options.byteLength)) {
|
|
326
|
+
throw new InvalidTypeError({
|
|
327
|
+
subject: options.subject,
|
|
328
|
+
type: typeof value,
|
|
329
|
+
expectedType: `bytes${options.byteLength ?? ''}HexNo0x`,
|
|
330
|
+
}, options);
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
334
|
+
export function assertIsBytes1HexNo0x(value, options) {
|
|
335
|
+
assertIsBytesHexNo0x(value, { byteLength: 1, ...options });
|
|
336
|
+
}
|
|
337
|
+
export function assertIsBytes8HexNo0x(value, options) {
|
|
338
|
+
assertIsBytesHexNo0x(value, { byteLength: 8, ...options });
|
|
339
|
+
}
|
|
340
|
+
export function assertIsBytes20HexNo0x(value, options) {
|
|
341
|
+
assertIsBytesHexNo0x(value, { byteLength: 20, ...options });
|
|
342
|
+
}
|
|
343
|
+
export function assertIsBytes21HexNo0x(value, options) {
|
|
344
|
+
assertIsBytesHexNo0x(value, { byteLength: 21, ...options });
|
|
345
|
+
}
|
|
346
|
+
export function assertIsBytes32HexNo0x(value, options) {
|
|
347
|
+
assertIsBytesHexNo0x(value, { byteLength: 32, ...options });
|
|
348
|
+
}
|
|
349
|
+
export function assertIsBytes65HexNo0x(value, options) {
|
|
350
|
+
assertIsBytesHexNo0x(value, { byteLength: 65, ...options });
|
|
351
|
+
}
|
|
352
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
353
|
+
// asBytesXXHexNo0x
|
|
354
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
355
|
+
export function asBytesHexNo0x(value, options) {
|
|
356
|
+
assertIsBytesHexNo0x(value, options ?? {});
|
|
357
|
+
return value;
|
|
358
|
+
}
|
|
359
|
+
export function asBytes1HexNo0x(value, options) {
|
|
360
|
+
assertIsBytesHexNo0x(value, { byteLength: 1, ...options });
|
|
361
|
+
return value;
|
|
362
|
+
}
|
|
363
|
+
export function asBytes8HexNo0x(value, options) {
|
|
364
|
+
assertIsBytesHexNo0x(value, { byteLength: 8, ...options });
|
|
365
|
+
return value;
|
|
366
|
+
}
|
|
367
|
+
export function asBytes20HexNo0x(value, options) {
|
|
368
|
+
assertIsBytesHexNo0x(value, { byteLength: 20, ...options });
|
|
369
|
+
return value;
|
|
370
|
+
}
|
|
371
|
+
export function asBytes21HexNo0x(value, options) {
|
|
372
|
+
assertIsBytesHexNo0x(value, { byteLength: 21, ...options });
|
|
373
|
+
return value;
|
|
374
|
+
}
|
|
375
|
+
export function asBytes32HexNo0x(value, options) {
|
|
376
|
+
assertIsBytesHexNo0x(value, { byteLength: 32, ...options });
|
|
377
|
+
return value;
|
|
378
|
+
}
|
|
379
|
+
export function asBytes65HexNo0x(value, options) {
|
|
380
|
+
assertIsBytesHexNo0x(value, { byteLength: 65, ...options });
|
|
381
|
+
return value;
|
|
382
|
+
}
|
|
383
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
384
|
+
// assertIsBytesXXHexArray
|
|
385
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
386
|
+
/**
|
|
387
|
+
* Assertion function that validates a value is an array of valid hex bytes strings.
|
|
388
|
+
* Each element must start with "0x" followed by hexadecimal characters.
|
|
389
|
+
* Throws an `InvalidTypeError` if validation fails.
|
|
390
|
+
*
|
|
391
|
+
* @param value - The value to validate (can be any type)
|
|
392
|
+
* @param options - Validation options
|
|
393
|
+
* @param options.byteLength - Optional expected byte length for each element (e.g., 8, 20, 32)
|
|
394
|
+
* @param options.subject - Optional name of the value being validated (used in error messages)
|
|
395
|
+
* @throws {InvalidTypeError} When the value is not an array or any element is not valid BytesHex format
|
|
396
|
+
* @throws {never} No other errors are thrown
|
|
397
|
+
*
|
|
398
|
+
* @example
|
|
399
|
+
* ```typescript
|
|
400
|
+
* function processHashes(hashes: unknown) {
|
|
401
|
+
* assertIsBytesHexArray(hashes, { byteLength: 32, subject: 'hashes' });
|
|
402
|
+
* hashes.forEach(hash => console.log(hash)); // TypeScript knows each is BytesHex
|
|
403
|
+
* }
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
export function assertIsBytesHexArray(value, options) {
|
|
407
|
+
if (!Array.isArray(value)) {
|
|
408
|
+
throw new InvalidTypeError({
|
|
409
|
+
subject: options.subject,
|
|
410
|
+
type: typeof value,
|
|
411
|
+
expectedType: `bytes${options.byteLength ?? ''}Hex[]`,
|
|
412
|
+
}, options);
|
|
413
|
+
}
|
|
414
|
+
for (let i = 0; i < value.length; ++i) {
|
|
415
|
+
if (!isBytesHex(value[i], options.byteLength)) {
|
|
416
|
+
throw new InvalidTypeError({
|
|
417
|
+
subject: options.subject,
|
|
418
|
+
index: i,
|
|
419
|
+
type: typeof value[i],
|
|
420
|
+
expectedType: `bytes${options.byteLength ?? ''}Hex`,
|
|
421
|
+
}, options);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
}
|
|
425
|
+
export function assertIsBytesArray(value, options) {
|
|
426
|
+
if (!Array.isArray(value)) {
|
|
427
|
+
throw new InvalidTypeError({
|
|
428
|
+
subject: options.subject,
|
|
429
|
+
type: typeof value,
|
|
430
|
+
expectedType: `bytes${options.byteLength ?? ''}[]`,
|
|
431
|
+
}, options);
|
|
432
|
+
}
|
|
433
|
+
for (let i = 0; i < value.length; ++i) {
|
|
434
|
+
if (!isBytes(value[i], options.byteLength)) {
|
|
435
|
+
throw new InvalidTypeError({
|
|
436
|
+
subject: options.subject,
|
|
437
|
+
index: i,
|
|
438
|
+
type: typeof value[i],
|
|
439
|
+
expectedType: `bytes${options.byteLength ?? ''}`,
|
|
440
|
+
}, options);
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
445
|
+
export function assertIsBytes1HexArray(value, options) {
|
|
446
|
+
assertIsBytesHexArray(value, { byteLength: 1, ...options });
|
|
447
|
+
}
|
|
448
|
+
export function assertIsBytes8HexArray(value, options) {
|
|
449
|
+
assertIsBytesHexArray(value, { byteLength: 8, ...options });
|
|
450
|
+
}
|
|
451
|
+
export function assertIsBytes20HexArray(value, options) {
|
|
452
|
+
assertIsBytesHexArray(value, { byteLength: 20, ...options });
|
|
453
|
+
}
|
|
454
|
+
export function assertIsBytes21HexArray(value, options) {
|
|
455
|
+
assertIsBytesHexArray(value, { byteLength: 21, ...options });
|
|
456
|
+
}
|
|
457
|
+
export function assertIsBytes32HexArray(value, options) {
|
|
458
|
+
assertIsBytesHexArray(value, { byteLength: 32, ...options });
|
|
459
|
+
}
|
|
460
|
+
export function assertIsBytes65HexArray(value, options) {
|
|
461
|
+
assertIsBytesHexArray(value, { byteLength: 65, ...options });
|
|
462
|
+
}
|
|
463
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
464
|
+
export function assertIsBytes32Array(value, options) {
|
|
465
|
+
assertIsBytesArray(value, { byteLength: 32, ...options });
|
|
466
|
+
}
|
|
467
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
468
|
+
// isRecordBytesXXHexProperty
|
|
469
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
470
|
+
/**
|
|
471
|
+
* Type guard that checks if a property exists on an object and is a valid hex bytes string.
|
|
472
|
+
* A valid BytesHex string starts with "0x" followed by an even number of hexadecimal characters.
|
|
473
|
+
*
|
|
474
|
+
* @template K - The property key type (string literal)
|
|
475
|
+
* @param record - The value to check (can be any type)
|
|
476
|
+
* @param property - The property name to check for
|
|
477
|
+
* @param byteLength - Optional byte length (e.g., 8, 20, 32)
|
|
478
|
+
* @returns True if `o` is an object with the specified property that is a valid BytesHex string
|
|
479
|
+
*
|
|
480
|
+
* @example
|
|
481
|
+
* ```typescript
|
|
482
|
+
* const data: unknown = { hash: "0x1234abcd", value: 42 };
|
|
483
|
+
* if (isRecordBytesHexProperty(data, 'hash')) {
|
|
484
|
+
* console.log(data.hash); // "0x1234abcd"
|
|
485
|
+
* }
|
|
486
|
+
* ```
|
|
487
|
+
*/
|
|
488
|
+
export function isRecordBytesHexProperty(record, property, byteLength) {
|
|
489
|
+
if (!isRecordNonNullableProperty(record, property)) {
|
|
490
|
+
return false;
|
|
491
|
+
}
|
|
492
|
+
return isBytesHex(record[property], byteLength);
|
|
493
|
+
}
|
|
494
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
495
|
+
export function isRecordBytes1HexProperty(record, property) {
|
|
496
|
+
return isRecordBytesHexProperty(record, property, 1);
|
|
497
|
+
}
|
|
498
|
+
export function isRecordBytes8HexProperty(record, property) {
|
|
499
|
+
return isRecordBytesHexProperty(record, property, 8);
|
|
500
|
+
}
|
|
501
|
+
export function isRecordBytes20HexProperty(record, property) {
|
|
502
|
+
return isRecordBytesHexProperty(record, property, 20);
|
|
503
|
+
}
|
|
504
|
+
export function isRecordBytes21HexProperty(record, property) {
|
|
505
|
+
return isRecordBytesHexProperty(record, property, 21);
|
|
506
|
+
}
|
|
507
|
+
export function isRecordBytes32HexProperty(record, property) {
|
|
508
|
+
return isRecordBytesHexProperty(record, property, 32);
|
|
509
|
+
}
|
|
510
|
+
export function isRecordBytes65HexProperty(record, property) {
|
|
511
|
+
return isRecordBytesHexProperty(record, property, 65);
|
|
512
|
+
}
|
|
513
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
514
|
+
// assertRecordBytesXXHexProperty
|
|
515
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
516
|
+
/**
|
|
517
|
+
* Assertion function that validates a property exists on an object and is a valid hex bytes string.
|
|
518
|
+
* A valid BytesHex string must start with "0x" followed by an even number of hexadecimal characters.
|
|
519
|
+
* Throws an `InvalidPropertyError` if validation fails.
|
|
520
|
+
*
|
|
521
|
+
* @template K - The property key type (string literal)
|
|
522
|
+
* @param record - The value to validate (can be any type)
|
|
523
|
+
* @param property - The property name to check for
|
|
524
|
+
* @param recordName - The name of the object being validated (used in error messages)
|
|
525
|
+
* @throws {InvalidPropertyError} When the property is missing, not a string, or not valid BytesHex format
|
|
526
|
+
* @throws {never} No other errors are thrown
|
|
527
|
+
*
|
|
528
|
+
* @example
|
|
529
|
+
* ```typescript
|
|
530
|
+
* function processTransaction(data: unknown) {
|
|
531
|
+
* assertRecordBytesHexProperty(data, 'txHash', 'transaction');
|
|
532
|
+
* console.log(data.txHash); // e.g., "0x1234..."
|
|
533
|
+
* }
|
|
534
|
+
* ```
|
|
535
|
+
*/
|
|
536
|
+
export function assertRecordBytesHexProperty(record, property, recordName, options) {
|
|
537
|
+
if (!isRecordBytesHexProperty(record, property, options.byteLength)) {
|
|
538
|
+
throw new InvalidPropertyError({
|
|
539
|
+
subject: recordName,
|
|
540
|
+
property,
|
|
541
|
+
expectedType: `bytes${options.byteLength ?? ''}Hex`,
|
|
542
|
+
type: typeofProperty(record, property),
|
|
543
|
+
}, options);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
547
|
+
export function assertRecordBytes1HexProperty(record, property, recordName, options) {
|
|
548
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
549
|
+
byteLength: 1,
|
|
550
|
+
...options,
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
export function assertRecordBytes8HexProperty(record, property, recordName, options) {
|
|
554
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
555
|
+
byteLength: 8,
|
|
556
|
+
...options,
|
|
557
|
+
});
|
|
558
|
+
}
|
|
559
|
+
export function assertRecordBytes20HexProperty(record, property, recordName, options) {
|
|
560
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
561
|
+
byteLength: 20,
|
|
562
|
+
...options,
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
export function assertRecordBytes21HexProperty(record, property, recordName, options) {
|
|
566
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
567
|
+
byteLength: 21,
|
|
568
|
+
...options,
|
|
569
|
+
});
|
|
570
|
+
}
|
|
571
|
+
export function assertRecordBytes32HexProperty(record, property, recordName, options) {
|
|
572
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
573
|
+
byteLength: 32,
|
|
574
|
+
...options,
|
|
575
|
+
});
|
|
576
|
+
}
|
|
577
|
+
export function assertRecordBytes65HexProperty(record, property, recordName, options) {
|
|
578
|
+
assertRecordBytesHexProperty(record, property, recordName, {
|
|
579
|
+
byteLength: 65,
|
|
580
|
+
...options,
|
|
581
|
+
});
|
|
582
|
+
}
|
|
583
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
584
|
+
// isRecordBytesHexXXNo0xProperty
|
|
585
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
586
|
+
/**
|
|
587
|
+
* Type guard that checks if a property exists on an object and is a valid hex bytes string without "0x" prefix.
|
|
588
|
+
* A valid BytesHexNo0x string contains only hexadecimal characters (no "0x" prefix).
|
|
589
|
+
*
|
|
590
|
+
* @template K - The property key type (string literal)
|
|
591
|
+
* @param record - The value to check (can be any type)
|
|
592
|
+
* @param property - The property name to check for
|
|
593
|
+
* @param byteLength - Optional byte length (e.g., 8, 20, 32)
|
|
594
|
+
* @returns True if `o` is an object with the specified property that is a valid BytesHexNo0x string
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* ```typescript
|
|
598
|
+
* const data: unknown = { signature: "1234abcd", value: 42 };
|
|
599
|
+
* if (isRecordBytesHexNo0xProperty(data, 'signature')) {
|
|
600
|
+
* console.log(data.signature); // "1234abcd"
|
|
601
|
+
* }
|
|
602
|
+
* ```
|
|
603
|
+
*/
|
|
604
|
+
export function isRecordBytesHexNo0xProperty(record, property, byteLength) {
|
|
605
|
+
if (!isRecordNonNullableProperty(record, property)) {
|
|
606
|
+
return false;
|
|
607
|
+
}
|
|
608
|
+
return isBytesHexNo0x(record[property], byteLength);
|
|
609
|
+
}
|
|
610
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
611
|
+
// assertRecordBytesXXHexNo0xProperty
|
|
612
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
613
|
+
/**
|
|
614
|
+
* Assertion function that validates a property exists on an object and is a valid hex bytes string without "0x" prefix.
|
|
615
|
+
* A valid BytesHexNo0x string contains only hexadecimal characters (no "0x" prefix).
|
|
616
|
+
* Throws an `InvalidPropertyError` if validation fails.
|
|
617
|
+
*
|
|
618
|
+
* @template K - The property key type (string literal)
|
|
619
|
+
* @param record - The value to validate (can be any type)
|
|
620
|
+
* @param property - The property name to check for
|
|
621
|
+
* @param recordName - The name of the object being validated (used in error messages)
|
|
622
|
+
* @param options - Validation options
|
|
623
|
+
* @param options.byteLength - Optional expected byte length (e.g., 8, 20, 32)
|
|
624
|
+
* @throws {InvalidPropertyError} When the property is missing, not a string, or not valid BytesHexNo0x format
|
|
625
|
+
* @throws {never} No other errors are thrown
|
|
626
|
+
*
|
|
627
|
+
* @example
|
|
628
|
+
* ```typescript
|
|
629
|
+
* function processData(data: unknown) {
|
|
630
|
+
* assertRecordBytesHexNo0xProperty(data, 'signature', 'response', {});
|
|
631
|
+
* console.log(data.signature); // e.g., "1234abcd..."
|
|
632
|
+
* }
|
|
633
|
+
* ```
|
|
634
|
+
*/
|
|
635
|
+
export function assertRecordBytesHexNo0xProperty(record, property, recordName, options) {
|
|
636
|
+
if (!isRecordBytesHexNo0xProperty(record, property, options.byteLength)) {
|
|
637
|
+
throw new InvalidPropertyError({
|
|
638
|
+
subject: recordName,
|
|
639
|
+
property,
|
|
640
|
+
expectedType: `bytes${options.byteLength ?? ''}HexNo0x`,
|
|
641
|
+
type: typeofProperty(record, property),
|
|
642
|
+
}, options);
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
646
|
+
// assertRecordBytesXXHexArrayProperty
|
|
647
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
648
|
+
/**
|
|
649
|
+
* Assertion function that validates a property exists on an object, is an array,
|
|
650
|
+
* and every element is a valid hex bytes string (with "0x" prefix).
|
|
651
|
+
* Throws an `InvalidPropertyError` if validation fails.
|
|
652
|
+
*
|
|
653
|
+
* @template K - The property key type (string literal)
|
|
654
|
+
* @param record - The record to validate (can be any type)
|
|
655
|
+
* @param property - The property name to check for
|
|
656
|
+
* @param recordName - The name of the record being validated (used in error messages)
|
|
657
|
+
* @throws {InvalidPropertyError} When the property is missing, not an array, or any element is not valid BytesHex
|
|
658
|
+
* @throws {never} No other errors are thrown
|
|
659
|
+
*
|
|
660
|
+
* @example
|
|
661
|
+
* ```typescript
|
|
662
|
+
* function processHashes(data: unknown) {
|
|
663
|
+
* assertRecordBytesHexArrayProperty(data, 'txHashes', 'transaction');
|
|
664
|
+
* data.txHashes.forEach(hash => {
|
|
665
|
+
* console.log(hash); // e.g., "0x1234abcd..."
|
|
666
|
+
* });
|
|
667
|
+
* }
|
|
668
|
+
* ```
|
|
669
|
+
*/
|
|
670
|
+
export function assertRecordBytesHexArrayProperty(record, property, recordName, options) {
|
|
671
|
+
assertRecordArrayProperty(record, property, recordName, options);
|
|
672
|
+
const arr = record[property];
|
|
673
|
+
for (let i = 0; i < arr.length; ++i) {
|
|
674
|
+
if (!isBytesHex(arr[i], options.byteLength)) {
|
|
675
|
+
throw new InvalidPropertyError({
|
|
676
|
+
subject: recordName,
|
|
677
|
+
index: i,
|
|
678
|
+
property,
|
|
679
|
+
expectedType: `bytes${options.byteLength ?? ''}Hex`,
|
|
680
|
+
type: typeof arr[i],
|
|
681
|
+
}, options);
|
|
682
|
+
}
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
686
|
+
export function assertRecordBytes1HexArrayProperty(record, property, recordName, options) {
|
|
687
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
688
|
+
byteLength: 1,
|
|
689
|
+
...options,
|
|
690
|
+
});
|
|
691
|
+
}
|
|
692
|
+
export function assertRecordBytes8HexArrayProperty(record, property, recordName, options) {
|
|
693
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
694
|
+
byteLength: 8,
|
|
695
|
+
...options,
|
|
696
|
+
});
|
|
697
|
+
}
|
|
698
|
+
export function assertRecordBytes20HexArrayProperty(record, property, recordName, options) {
|
|
699
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
700
|
+
byteLength: 20,
|
|
701
|
+
...options,
|
|
702
|
+
});
|
|
703
|
+
}
|
|
704
|
+
export function assertRecordBytes21HexArrayProperty(record, property, recordName, options) {
|
|
705
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
706
|
+
byteLength: 21,
|
|
707
|
+
...options,
|
|
708
|
+
});
|
|
709
|
+
}
|
|
710
|
+
export function assertRecordBytes32HexArrayProperty(record, property, recordName, options) {
|
|
711
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
712
|
+
byteLength: 32,
|
|
713
|
+
...options,
|
|
714
|
+
});
|
|
715
|
+
}
|
|
716
|
+
export function assertRecordBytes65HexArrayProperty(record, property, recordName, options) {
|
|
717
|
+
assertRecordBytesHexArrayProperty(record, property, recordName, {
|
|
718
|
+
byteLength: 65,
|
|
719
|
+
...options,
|
|
720
|
+
});
|
|
721
|
+
}
|
|
722
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
723
|
+
/**
|
|
724
|
+
* Assertion function that validates a property exists on an object, is an array,
|
|
725
|
+
* and every element is a valid hex bytes string (without "0x" prefix).
|
|
726
|
+
* Throws an `InvalidPropertyError` if validation fails.
|
|
727
|
+
*
|
|
728
|
+
* @template K - The property key type (string literal)
|
|
729
|
+
* @param record - The value to validate (can be any type)
|
|
730
|
+
* @param property - The property name to check for
|
|
731
|
+
* @param recordName - The name of the object being validated (used in error messages)
|
|
732
|
+
* @throws {InvalidPropertyError} When the property is missing, not an array, or any element is not valid BytesHexNo0x
|
|
733
|
+
* @throws {never} No other errors are thrown
|
|
734
|
+
*
|
|
735
|
+
* @example
|
|
736
|
+
* ```typescript
|
|
737
|
+
* function processSignatures(data: unknown) {
|
|
738
|
+
* assertRecordBytesHexNo0xArrayProperty(data, 'signatures', 'response');
|
|
739
|
+
* data.signatures.forEach(sig => {
|
|
740
|
+
* console.log(sig); // e.g., "1234abcd..." (no 0x prefix)
|
|
741
|
+
* });
|
|
742
|
+
* }
|
|
743
|
+
* ```
|
|
744
|
+
*/
|
|
745
|
+
export function assertRecordBytesHexNo0xArrayProperty(record, property, recordName, options) {
|
|
746
|
+
assertRecordArrayProperty(record, property, recordName, options);
|
|
747
|
+
const arr = record[property];
|
|
748
|
+
for (let i = 0; i < arr.length; ++i) {
|
|
749
|
+
if (!isBytesHexNo0x(arr[i])) {
|
|
750
|
+
throw new InvalidPropertyError({
|
|
751
|
+
subject: recordName,
|
|
752
|
+
index: i,
|
|
753
|
+
property,
|
|
754
|
+
expectedType: `bytes${options.byteLength ?? ''}HexNo0x`,
|
|
755
|
+
type: typeof arr[i],
|
|
756
|
+
}, options);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
761
|
+
// - isRecordUint8ArrayProperty
|
|
762
|
+
// - assertRecordUint8ArrayProperty
|
|
763
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
764
|
+
export function isRecordUint8ArrayProperty(o, property) {
|
|
765
|
+
if (!isRecordNonNullableProperty(o, property)) {
|
|
766
|
+
return false;
|
|
767
|
+
}
|
|
768
|
+
return o[property] instanceof Uint8Array;
|
|
769
|
+
}
|
|
770
|
+
export function assertRecordUint8ArrayProperty(o, property, objName, options) {
|
|
771
|
+
if (!isRecordUint8ArrayProperty(o, property)) {
|
|
772
|
+
throw new InvalidPropertyError({
|
|
773
|
+
subject: objName,
|
|
774
|
+
property,
|
|
775
|
+
expectedType: 'Uint8Array',
|
|
776
|
+
type: typeofProperty(o, property),
|
|
777
|
+
}, options);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
781
|
+
// Hex
|
|
782
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
783
|
+
const HEX_CHARS = {
|
|
784
|
+
'0': 0,
|
|
785
|
+
'1': 1,
|
|
786
|
+
'2': 2,
|
|
787
|
+
'3': 3,
|
|
788
|
+
'4': 4,
|
|
789
|
+
'5': 5,
|
|
790
|
+
'6': 6,
|
|
791
|
+
'7': 7,
|
|
792
|
+
'8': 8,
|
|
793
|
+
'9': 9,
|
|
794
|
+
a: 10,
|
|
795
|
+
b: 11,
|
|
796
|
+
c: 12,
|
|
797
|
+
d: 13,
|
|
798
|
+
e: 14,
|
|
799
|
+
f: 15,
|
|
800
|
+
A: 10,
|
|
801
|
+
B: 11,
|
|
802
|
+
C: 12,
|
|
803
|
+
D: 13,
|
|
804
|
+
E: 14,
|
|
805
|
+
F: 15,
|
|
806
|
+
};
|
|
807
|
+
Object.freeze(HEX_CHARS);
|
|
808
|
+
const HEX_BYTES = Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));
|
|
809
|
+
Object.freeze(HEX_BYTES);
|
|
810
|
+
const HEX_CHARS_CODES = new Uint8Array([
|
|
811
|
+
48,
|
|
812
|
+
49,
|
|
813
|
+
50,
|
|
814
|
+
51,
|
|
815
|
+
52,
|
|
816
|
+
53,
|
|
817
|
+
54,
|
|
818
|
+
55,
|
|
819
|
+
56,
|
|
820
|
+
57, // '0'-'9'
|
|
821
|
+
97,
|
|
822
|
+
98,
|
|
823
|
+
99,
|
|
824
|
+
100,
|
|
825
|
+
101,
|
|
826
|
+
102, // 'a'-'f'
|
|
827
|
+
]);
|
|
828
|
+
/**
|
|
829
|
+
* Convert a Uint8Array to a hex string (without 0x prefix).
|
|
830
|
+
*
|
|
831
|
+
* @param bytes - The byte array to convert. If `undefined` or empty, returns `""`.
|
|
832
|
+
* @returns A lowercase hex string with even length (2 chars per byte), without `0x` prefix.
|
|
833
|
+
*
|
|
834
|
+
* @example
|
|
835
|
+
* bytesToHexNo0x(new Uint8Array([0x48, 0x65])) // "4865"
|
|
836
|
+
* bytesToHexNo0x(new Uint8Array([0x0a])) // "0a"
|
|
837
|
+
* bytesToHexNo0x(undefined) // ""
|
|
838
|
+
* bytesToHexNo0x(new Uint8Array([])) // ""
|
|
839
|
+
*/
|
|
840
|
+
export function bytesToHexNo0x(bytes) {
|
|
841
|
+
if (!bytes || bytes.length === 0) {
|
|
842
|
+
return '';
|
|
843
|
+
}
|
|
844
|
+
let hex = '';
|
|
845
|
+
for (const byte of bytes) {
|
|
846
|
+
hex += byte.toString(16).padStart(2, '0');
|
|
847
|
+
}
|
|
848
|
+
return hex;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Convert a Uint8Array to a `0x`-prefixed hex string.
|
|
852
|
+
*
|
|
853
|
+
* @param bytes - The byte array to convert. If `undefined` or empty, returns `"0x"`.
|
|
854
|
+
* @returns A lowercase `0x`-prefixed hex string with even length (2 chars per byte after prefix).
|
|
855
|
+
*
|
|
856
|
+
* @example
|
|
857
|
+
* bytesToHex(new Uint8Array([0x48, 0x65])) // "0x4865"
|
|
858
|
+
* bytesToHex(new Uint8Array([0x0a])) // "0x0a"
|
|
859
|
+
* bytesToHex(undefined) // "0x"
|
|
860
|
+
* bytesToHex(new Uint8Array([])) // "0x"
|
|
861
|
+
*/
|
|
862
|
+
export function bytesToHex(bytes) {
|
|
863
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
864
|
+
}
|
|
865
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
866
|
+
/**
|
|
867
|
+
* Convert a 1-byte long Uint8Array to a 0x prefixed hex string (length=4)
|
|
868
|
+
*/
|
|
869
|
+
export function bytes1ToHex(bytes) {
|
|
870
|
+
if (!isBytes1(bytes)) {
|
|
871
|
+
throw new Error('Invalid bytes1 argument');
|
|
872
|
+
}
|
|
873
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
874
|
+
}
|
|
875
|
+
/**
|
|
876
|
+
* Convert a 8-bytes long Uint8Array to a 0x prefixed hex string (length=18)
|
|
877
|
+
*/
|
|
878
|
+
export function bytes8ToHex(bytes) {
|
|
879
|
+
if (!isBytes8(bytes)) {
|
|
880
|
+
throw new Error('Invalid bytes8 argument');
|
|
881
|
+
}
|
|
882
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Convert a 20-bytes long Uint8Array to a 0x prefixed hex string (length=42)
|
|
886
|
+
*/
|
|
887
|
+
export function bytes20ToHex(bytes) {
|
|
888
|
+
if (!isBytes20(bytes)) {
|
|
889
|
+
throw new Error('Invalid bytes20 argument');
|
|
890
|
+
}
|
|
891
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
892
|
+
}
|
|
893
|
+
/**
|
|
894
|
+
* Convert a 21-bytes long Uint8Array to a 0x prefixed hex string (length=44)
|
|
895
|
+
*/
|
|
896
|
+
export function bytes21ToHex(bytes) {
|
|
897
|
+
if (!isBytes21(bytes)) {
|
|
898
|
+
throw new Error('Invalid bytes21 argument');
|
|
899
|
+
}
|
|
900
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
901
|
+
}
|
|
902
|
+
/**
|
|
903
|
+
* Convert a 32-bytes long Uint8Array to a 0x prefixed hex string (length=66).
|
|
904
|
+
*
|
|
905
|
+
* @param bytes - Input to convert (asserted to be Bytes32)
|
|
906
|
+
* @returns Hex string with 0x prefix
|
|
907
|
+
* @throws Error if bytes is not a valid 32-byte Uint8Array
|
|
908
|
+
*/
|
|
909
|
+
export function bytes32ToHex(bytes) {
|
|
910
|
+
if (!isBytes32(bytes)) {
|
|
911
|
+
throw new Error('Invalid bytes32 argument');
|
|
912
|
+
}
|
|
913
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
914
|
+
}
|
|
915
|
+
/**
|
|
916
|
+
* Convert a 65-bytes long Uint8Array to a 0x prefixed hex string (length=132)
|
|
917
|
+
*/
|
|
918
|
+
export function bytes65ToHex(bytes) {
|
|
919
|
+
if (!isBytes65(bytes)) {
|
|
920
|
+
throw new Error('Invalid bytes65 argument');
|
|
921
|
+
}
|
|
922
|
+
return `0x${bytesToHexNo0x(bytes)}`;
|
|
923
|
+
}
|
|
924
|
+
export function bytesToHexLarge(bytes, no0x) {
|
|
925
|
+
const len = no0x === true ? bytes.length * 2 : bytes.length * 2 + 2;
|
|
926
|
+
const out = new Uint8Array(len);
|
|
927
|
+
let i0 = 0;
|
|
928
|
+
if (no0x !== true) {
|
|
929
|
+
out[0] = 48; // '0'
|
|
930
|
+
out[1] = 120; // 'x'
|
|
931
|
+
i0 = 2;
|
|
932
|
+
}
|
|
933
|
+
let j = i0;
|
|
934
|
+
for (const byte of bytes) {
|
|
935
|
+
// byte >> 4 is always 0–15, byte & 0xf is always 0–15
|
|
936
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
937
|
+
out[j] = HEX_CHARS_CODES[byte >> 4];
|
|
938
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
939
|
+
out[j + 1] = HEX_CHARS_CODES[byte & 0xf];
|
|
940
|
+
j += 2;
|
|
941
|
+
}
|
|
942
|
+
const txt = new TextDecoder().decode(out);
|
|
943
|
+
if (no0x === true) {
|
|
944
|
+
return txt;
|
|
945
|
+
}
|
|
946
|
+
else {
|
|
947
|
+
return txt;
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
/**
|
|
951
|
+
* Convert a hex string prefixed by 0x or not to a Uint8Array
|
|
952
|
+
* Any invalid byte string is converted to 0
|
|
953
|
+
* "0xzzff" = [0, 255]
|
|
954
|
+
* "0xzfff" = [0, 255]
|
|
955
|
+
*/
|
|
956
|
+
export function hexToBytes(hexString) {
|
|
957
|
+
if (hexString.length % 2 !== 0) {
|
|
958
|
+
throw new Error('Invalid hex string: odd length');
|
|
959
|
+
}
|
|
960
|
+
const arr = hexString.replace(/^(0x)/, '').match(/.{1,2}/g);
|
|
961
|
+
if (!arr)
|
|
962
|
+
return new Uint8Array();
|
|
963
|
+
return Uint8Array.from(arr.map((byte) => parseInt(byte, 16)));
|
|
964
|
+
}
|
|
965
|
+
/**
|
|
966
|
+
* Convert a hex string (with or without 0x prefix) to a 1-byte Uint8Array.
|
|
967
|
+
* Left-pads with zeros if shorter than 1 byte.
|
|
968
|
+
* Empty string or "0x" returns 1 zero byte.
|
|
969
|
+
*
|
|
970
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
971
|
+
* @returns 1-byte Uint8Array
|
|
972
|
+
* @throws Error if hex string has odd length or exceeds 2 hex characters
|
|
973
|
+
*
|
|
974
|
+
* @example
|
|
975
|
+
* // Full 1-byte input
|
|
976
|
+
* hexToBytes1("0xff") // Uint8Array [255]
|
|
977
|
+
*
|
|
978
|
+
* @example
|
|
979
|
+
* // Empty input - returns 1 zero byte
|
|
980
|
+
* hexToBytes1("") // Uint8Array [0]
|
|
981
|
+
* hexToBytes1("0x") // Uint8Array [0]
|
|
982
|
+
*/
|
|
983
|
+
export function hexToBytes1(hexString) {
|
|
984
|
+
const hex = remove0x(hexString);
|
|
985
|
+
if (hex.length % 2 !== 0 || hex.length > 2) {
|
|
986
|
+
throw new Error('Invalid bytes1 hex string');
|
|
987
|
+
}
|
|
988
|
+
return hexToBytes('0x' + hex.padStart(2, '0'));
|
|
989
|
+
}
|
|
990
|
+
/**
|
|
991
|
+
* Convert a hex string (with or without 0x prefix) to an 8-byte Uint8Array.
|
|
992
|
+
* Left-pads with zeros if shorter than 8 bytes.
|
|
993
|
+
* Empty string or "0x" returns 8 zero bytes.
|
|
994
|
+
*
|
|
995
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
996
|
+
* @returns 8-byte Uint8Array
|
|
997
|
+
* @throws Error if hex string has odd length or exceeds 16 hex characters
|
|
998
|
+
*
|
|
999
|
+
* @example
|
|
1000
|
+
* // Full 8-byte input
|
|
1001
|
+
* hexToBytes8("0x0102030405060708") // Uint8Array [1,2,3,4,5,6,7,8]
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* // Short input - left-padded with zeros
|
|
1005
|
+
* hexToBytes8("0x1234") // Uint8Array [0,0,0,0,0,0,0x12,0x34]
|
|
1006
|
+
* hexToBytes8("1234") // Same result, 0x prefix optional
|
|
1007
|
+
* hexToBytes8("0xff") // Uint8Array [0,0,0,0,0,0,0,255]
|
|
1008
|
+
*
|
|
1009
|
+
* @example
|
|
1010
|
+
* // Empty input - returns 8 zero bytes
|
|
1011
|
+
* hexToBytes8("") // Uint8Array [0,0,0,0,0,0,0,0]
|
|
1012
|
+
* hexToBytes8("0x") // Uint8Array [0,0,0,0,0,0,0,0]
|
|
1013
|
+
*/
|
|
1014
|
+
export function hexToBytes8(hexString) {
|
|
1015
|
+
const hex = remove0x(hexString);
|
|
1016
|
+
if (hex.length % 2 !== 0 || hex.length > 16) {
|
|
1017
|
+
throw new Error('Invalid bytes8 hex string');
|
|
1018
|
+
}
|
|
1019
|
+
return hexToBytes('0x' + hex.padStart(16, '0'));
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Convert a hex string (with or without 0x prefix) to a 20-byte Uint8Array.
|
|
1023
|
+
* Left-pads with zeros if shorter than 20 bytes.
|
|
1024
|
+
* Empty string or "0x" returns 20 zero bytes.
|
|
1025
|
+
*
|
|
1026
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
1027
|
+
* @returns 20-byte Uint8Array (suitable for Ethereum addresses)
|
|
1028
|
+
* @throws Error if hex string has odd length or exceeds 40 hex characters
|
|
1029
|
+
*
|
|
1030
|
+
* @example
|
|
1031
|
+
* // Full 20-byte address
|
|
1032
|
+
* hexToBytes20("0x742d35Cc6634C0532925a3b844Bc9e7595f8fE00")
|
|
1033
|
+
* // Uint8Array [0x74,0x2d,0x35,...,0xf8,0xfe,0x00]
|
|
1034
|
+
*
|
|
1035
|
+
* @example
|
|
1036
|
+
* // Short input - left-padded with zeros
|
|
1037
|
+
* hexToBytes20("0x1234") // Uint8Array [0,0,...,0,0x12,0x34] (18 zeros + 2 bytes)
|
|
1038
|
+
* hexToBytes20("0xff") // Uint8Array [0,0,...,0,255] (19 zeros + 1 byte)
|
|
1039
|
+
*
|
|
1040
|
+
* @example
|
|
1041
|
+
* // Empty input - returns 20 zero bytes
|
|
1042
|
+
* hexToBytes20("") // Uint8Array [0,0,0,...,0] (20 zeros)
|
|
1043
|
+
* hexToBytes20("0x") // Uint8Array [0,0,0,...,0] (20 zeros)
|
|
1044
|
+
*/
|
|
1045
|
+
export function hexToBytes20(hexString) {
|
|
1046
|
+
const hex = remove0x(hexString);
|
|
1047
|
+
if (hex.length % 2 !== 0 || hex.length > 40) {
|
|
1048
|
+
throw new Error('Invalid bytes20 hex string');
|
|
1049
|
+
}
|
|
1050
|
+
return hexToBytes('0x' + hex.padStart(40, '0'));
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Convert a hex string (with or without 0x prefix) to a 21-byte Uint8Array.
|
|
1054
|
+
* Left-pads with zeros if shorter than 21 bytes.
|
|
1055
|
+
* Empty string or "0x" returns 21 zero bytes.
|
|
1056
|
+
*
|
|
1057
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
1058
|
+
* @returns 21-byte Uint8Array
|
|
1059
|
+
* @throws Error if hex string has odd length or exceeds 42 hex characters
|
|
1060
|
+
*
|
|
1061
|
+
* @example
|
|
1062
|
+
* // Full 21-byte input
|
|
1063
|
+
* hexToBytes21("0x01" + "00".repeat(20)) // Uint8Array [1,0,0,...,0] (21 bytes)
|
|
1064
|
+
*
|
|
1065
|
+
* @example
|
|
1066
|
+
* // Short input - left-padded with zeros
|
|
1067
|
+
* hexToBytes21("0x1234") // Uint8Array [0,0,...,0,0x12,0x34] (19 zeros + 2 bytes)
|
|
1068
|
+
* hexToBytes21("0xff") // Uint8Array [0,0,...,0,255] (20 zeros + 1 byte)
|
|
1069
|
+
*
|
|
1070
|
+
* @example
|
|
1071
|
+
* // Empty input - returns 21 zero bytes
|
|
1072
|
+
* hexToBytes21("") // Uint8Array [0,0,0,...,0] (21 zeros)
|
|
1073
|
+
* hexToBytes21("0x") // Uint8Array [0,0,0,...,0] (21 zeros)
|
|
1074
|
+
*/
|
|
1075
|
+
export function hexToBytes21(hexString) {
|
|
1076
|
+
const hex = remove0x(hexString);
|
|
1077
|
+
if (hex.length % 2 !== 0 || hex.length > 42) {
|
|
1078
|
+
throw new Error('Invalid bytes21 hex string');
|
|
1079
|
+
}
|
|
1080
|
+
return hexToBytes('0x' + hex.padStart(42, '0'));
|
|
1081
|
+
}
|
|
1082
|
+
/**
|
|
1083
|
+
* Convert a hex string (with or without 0x prefix) to a 32-byte Uint8Array.
|
|
1084
|
+
* Left-pads with zeros if shorter than 32 bytes.
|
|
1085
|
+
* Empty string or "0x" returns 32 zero bytes.
|
|
1086
|
+
*
|
|
1087
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
1088
|
+
* @returns 32-byte Uint8Array (suitable for hashes, private keys, etc.)
|
|
1089
|
+
* @throws Error if hex string has odd length or exceeds 64 hex characters
|
|
1090
|
+
*
|
|
1091
|
+
* @example
|
|
1092
|
+
* // Full 32-byte hash
|
|
1093
|
+
* hexToBytes32("0xabcdef..." /* 64 hex chars *\/) // Uint8Array [0xab,0xcd,0xef,...]
|
|
1094
|
+
*
|
|
1095
|
+
* @example
|
|
1096
|
+
* // Short input - left-padded with zeros (useful for encoding small numbers)
|
|
1097
|
+
* hexToBytes32("0x1234") // Uint8Array [0,0,...,0,0x12,0x34] (30 zeros + 2 bytes)
|
|
1098
|
+
* hexToBytes32("0x01") // Uint8Array [0,0,...,0,1] (31 zeros + 1 byte)
|
|
1099
|
+
* hexToBytes32("0xff") // Uint8Array [0,0,...,0,255] (31 zeros + 1 byte)
|
|
1100
|
+
*
|
|
1101
|
+
* @example
|
|
1102
|
+
* // Empty input - returns 32 zero bytes
|
|
1103
|
+
* hexToBytes32("") // Uint8Array [0,0,0,...,0] (32 zeros)
|
|
1104
|
+
* hexToBytes32("0x") // Uint8Array [0,0,0,...,0] (32 zeros)
|
|
1105
|
+
*/
|
|
1106
|
+
export function hexToBytes32(hexString) {
|
|
1107
|
+
const hex = remove0x(hexString);
|
|
1108
|
+
if (hex.length % 2 !== 0 || hex.length > 64) {
|
|
1109
|
+
throw new Error('Invalid bytes32 hex string');
|
|
1110
|
+
}
|
|
1111
|
+
return hexToBytes('0x' + hex.padStart(64, '0'));
|
|
1112
|
+
}
|
|
1113
|
+
/**
|
|
1114
|
+
* Convert a hex string (with or without 0x prefix) to a 65-byte Uint8Array.
|
|
1115
|
+
* Left-pads with zeros if shorter than 65 bytes.
|
|
1116
|
+
* Empty string or "0x" returns 65 zero bytes.
|
|
1117
|
+
*
|
|
1118
|
+
* @param hexString - Hex string with or without 0x prefix
|
|
1119
|
+
* @returns 65-byte Uint8Array (suitable for ECDSA signatures with recovery byte)
|
|
1120
|
+
* @throws Error if hex string has odd length or exceeds 130 hex characters
|
|
1121
|
+
*
|
|
1122
|
+
* @example
|
|
1123
|
+
* // Full 65-byte signature (r + s + v)
|
|
1124
|
+
* hexToBytes65("0x" + "ab".repeat(65)) // Uint8Array [0xab,0xab,...] (65 bytes)
|
|
1125
|
+
*
|
|
1126
|
+
* @example
|
|
1127
|
+
* // Short input - left-padded with zeros
|
|
1128
|
+
* hexToBytes65("0x1234") // Uint8Array [0,0,...,0,0x12,0x34] (63 zeros + 2 bytes)
|
|
1129
|
+
* hexToBytes65("0xff") // Uint8Array [0,0,...,0,255] (64 zeros + 1 byte)
|
|
1130
|
+
*
|
|
1131
|
+
* @example
|
|
1132
|
+
* // Empty input - returns 65 zero bytes
|
|
1133
|
+
* hexToBytes65("") // Uint8Array [0,0,0,...,0] (65 zeros)
|
|
1134
|
+
* hexToBytes65("0x") // Uint8Array [0,0,0,...,0] (65 zeros)
|
|
1135
|
+
*/
|
|
1136
|
+
export function hexToBytes65(hexString) {
|
|
1137
|
+
const hex = remove0x(hexString);
|
|
1138
|
+
if (hex.length % 2 !== 0 || hex.length > 130) {
|
|
1139
|
+
throw new Error('Invalid bytes65 hex string');
|
|
1140
|
+
}
|
|
1141
|
+
return hexToBytes('0x' + hex.padStart(130, '0'));
|
|
1142
|
+
}
|
|
1143
|
+
/**
|
|
1144
|
+
* Convert a hex string prefixed by 0x or not to a Uint8Array
|
|
1145
|
+
*/
|
|
1146
|
+
export function hexToBytesFaster(hexString, options) {
|
|
1147
|
+
const strict = options?.strict === true;
|
|
1148
|
+
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
|
|
1149
|
+
const offset = hexString[0] === '0' && hexString[1] === 'x' ? 2 : 0;
|
|
1150
|
+
const len = hexString.length - offset;
|
|
1151
|
+
if (len % 2 !== 0) {
|
|
1152
|
+
throw new InvalidTypeError({
|
|
1153
|
+
subject: options?.subject,
|
|
1154
|
+
expectedType: 'bytesHex',
|
|
1155
|
+
metaMessages: ['hex string length must be even'],
|
|
1156
|
+
}, options ?? {});
|
|
1157
|
+
}
|
|
1158
|
+
if (options?.byteLength !== undefined) {
|
|
1159
|
+
if (len !== options.byteLength) {
|
|
1160
|
+
throw new InvalidTypeError({
|
|
1161
|
+
subject: options.subject,
|
|
1162
|
+
expectedType: 'bytesHex',
|
|
1163
|
+
metaMessages: [`expected ${options.byteLength} bytes, got ${len / 2}`],
|
|
1164
|
+
}, options);
|
|
1165
|
+
}
|
|
1166
|
+
}
|
|
1167
|
+
const bytes = new Uint8Array(len / 2);
|
|
1168
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1169
|
+
// If index is out of bounds, hexString[] returns undefined which
|
|
1170
|
+
// propagates through HEX_CHARS as undefined, caught by the check below.
|
|
1171
|
+
/* eslint-disable @typescript-eslint/non-nullable-type-assertion-style */
|
|
1172
|
+
const hi = HEX_CHARS[hexString[offset + i * 2]];
|
|
1173
|
+
const lo = HEX_CHARS[hexString[offset + i * 2 + 1]];
|
|
1174
|
+
/* eslint-enable @typescript-eslint/non-nullable-type-assertion-style */
|
|
1175
|
+
if (hi === undefined || lo === undefined) {
|
|
1176
|
+
if (strict) {
|
|
1177
|
+
throw new InvalidTypeError({
|
|
1178
|
+
subject: options.subject,
|
|
1179
|
+
expectedType: 'bytesHex',
|
|
1180
|
+
metaMessages: [`invalid hex character at position ${offset + i * 2}`],
|
|
1181
|
+
}, options);
|
|
1182
|
+
}
|
|
1183
|
+
bytes[i] = ((hi ?? 0) << 4) | (lo ?? 0);
|
|
1184
|
+
continue;
|
|
1185
|
+
}
|
|
1186
|
+
bytes[i] = (hi << 4) | lo;
|
|
1187
|
+
}
|
|
1188
|
+
return bytes;
|
|
1189
|
+
}
|
|
1190
|
+
/**
|
|
1191
|
+
* Convert a Uint8Array to a bigint (big-endian interpretation).
|
|
1192
|
+
* The most significant byte is at index 0.
|
|
1193
|
+
*
|
|
1194
|
+
* @param byteArray - The byte array to convert (big-endian)
|
|
1195
|
+
* @returns The bigint representation of the bytes
|
|
1196
|
+
*
|
|
1197
|
+
* @example
|
|
1198
|
+
* // Standard conversion (big-endian)
|
|
1199
|
+
* bytesToBigInt(new Uint8Array([0x01, 0x00])) // 256n (0x0100)
|
|
1200
|
+
* bytesToBigInt(new Uint8Array([0xff])) // 255n
|
|
1201
|
+
* bytesToBigInt(new Uint8Array([0x01, 0x02, 0x03])) // 66051n (0x010203)
|
|
1202
|
+
*
|
|
1203
|
+
* @example
|
|
1204
|
+
* // Edge cases
|
|
1205
|
+
* bytesToBigInt(new Uint8Array([])) // 0n
|
|
1206
|
+
* bytesToBigInt(new Uint8Array([0])) // 0n
|
|
1207
|
+
* bytesToBigInt(undefined) // 0n
|
|
1208
|
+
*
|
|
1209
|
+
* @example
|
|
1210
|
+
* // 32-byte value (e.g., uint256)
|
|
1211
|
+
* const bytes32 = new Uint8Array(32);
|
|
1212
|
+
* bytes32[31] = 0x2a; // 42 in last byte
|
|
1213
|
+
* bytesToBigInt(bytes32) // 42n
|
|
1214
|
+
*/
|
|
1215
|
+
export function bytesToBigInt(byteArray) {
|
|
1216
|
+
if (!byteArray || byteArray.length === 0) {
|
|
1217
|
+
return BigInt(0);
|
|
1218
|
+
}
|
|
1219
|
+
let result = BigInt(0);
|
|
1220
|
+
for (const byte of byteArray) {
|
|
1221
|
+
result = (result << BigInt(8)) | BigInt(byte);
|
|
1222
|
+
}
|
|
1223
|
+
return result;
|
|
1224
|
+
}
|
|
1225
|
+
export function bigIntToBytesHex(value, options) {
|
|
1226
|
+
const byteLength = options?.byteLength;
|
|
1227
|
+
// checks overflow and negative values
|
|
1228
|
+
if (!isUintForByteLength(value, byteLength)) {
|
|
1229
|
+
throw new InvalidTypeError({
|
|
1230
|
+
subject: options?.subject,
|
|
1231
|
+
type: typeof value,
|
|
1232
|
+
expectedType: 'uintBigInt',
|
|
1233
|
+
}, options ?? {});
|
|
1234
|
+
}
|
|
1235
|
+
let v = value.toString(16);
|
|
1236
|
+
if (byteLength !== undefined) {
|
|
1237
|
+
v = v.padStart(byteLength * 2, '0');
|
|
1238
|
+
}
|
|
1239
|
+
if (v.length % 2 !== 0) {
|
|
1240
|
+
return ('0x0' + v);
|
|
1241
|
+
}
|
|
1242
|
+
return ('0x' + v);
|
|
1243
|
+
}
|
|
1244
|
+
/**
|
|
1245
|
+
* Converts an array of Bytes32 or Bytes32Hex values to a uniform Bytes32Hex array.
|
|
1246
|
+
* Accepts mixed input: both 32-byte Uint8Arrays and hex strings are normalized to Bytes32Hex.
|
|
1247
|
+
*
|
|
1248
|
+
* @param arr - Array of Bytes32 (Uint8Array) or Bytes32Hex (string) or Bytes32HexAble values.
|
|
1249
|
+
* @returns Array of Bytes32Hex strings.
|
|
1250
|
+
*/
|
|
1251
|
+
export function toBytes32HexArray(arr) {
|
|
1252
|
+
return arr.map((b) => {
|
|
1253
|
+
if (typeof b === 'string') {
|
|
1254
|
+
return asBytes32Hex(b);
|
|
1255
|
+
}
|
|
1256
|
+
else if (isBytes(b)) {
|
|
1257
|
+
return bytesToHexLarge(asBytes32(b));
|
|
1258
|
+
}
|
|
1259
|
+
else if (typeof b === 'object' && b !== null && 'bytes32Hex' in b) {
|
|
1260
|
+
// Bytes32HexAble
|
|
1261
|
+
return asBytes32Hex(b.bytes32Hex);
|
|
1262
|
+
}
|
|
1263
|
+
else {
|
|
1264
|
+
throw new InvalidTypeError({
|
|
1265
|
+
expectedType: 'bytes32Hex[]',
|
|
1266
|
+
}, {});
|
|
1267
|
+
}
|
|
1268
|
+
});
|
|
1269
|
+
}
|
|
1270
|
+
/**
|
|
1271
|
+
* Converts a Bytes32 or Bytes32Hex values to a Bytes32.
|
|
1272
|
+
* Accepts mixed input: both 32-byte Uint8Arrays and hex strings are normalized to Bytes32.
|
|
1273
|
+
*/
|
|
1274
|
+
export function toBytes32(value) {
|
|
1275
|
+
if (isBytes(value)) {
|
|
1276
|
+
return asBytes32(value);
|
|
1277
|
+
}
|
|
1278
|
+
else if (typeof value === 'string') {
|
|
1279
|
+
return hexToBytes32(asBytes32Hex(value));
|
|
1280
|
+
}
|
|
1281
|
+
else if (
|
|
1282
|
+
// Bytes32Able
|
|
1283
|
+
typeof value === 'object' &&
|
|
1284
|
+
value !== null &&
|
|
1285
|
+
'bytes32' in value) {
|
|
1286
|
+
return asBytes32(value.bytes32);
|
|
1287
|
+
}
|
|
1288
|
+
else {
|
|
1289
|
+
throw new InvalidTypeError({
|
|
1290
|
+
expectedType: 'bytes32',
|
|
1291
|
+
}, {});
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Converts a Bytes or BytesHex values to a Bytes.
|
|
1296
|
+
* Accepts mixed input: both n-byte Uint8Arrays and hex strings are normalized to Bytes.
|
|
1297
|
+
*/
|
|
1298
|
+
export function toBytes(value, options) {
|
|
1299
|
+
if (isBytes(value)) {
|
|
1300
|
+
if (options?.copy === true) {
|
|
1301
|
+
return new Uint8Array(value);
|
|
1302
|
+
}
|
|
1303
|
+
return value;
|
|
1304
|
+
}
|
|
1305
|
+
else if (typeof value === 'string') {
|
|
1306
|
+
return hexToBytesFaster(value, { strict: true });
|
|
1307
|
+
}
|
|
1308
|
+
else {
|
|
1309
|
+
throw new InvalidTypeError({
|
|
1310
|
+
subject: options?.subject,
|
|
1311
|
+
expectedType: ['bytes', 'bytesHex', 'bytesHexNo0x'],
|
|
1312
|
+
}, options ?? {});
|
|
1313
|
+
}
|
|
1314
|
+
}
|
|
1315
|
+
export function concatBytes(...arrays) {
|
|
1316
|
+
let totalLength = 0;
|
|
1317
|
+
for (const arr of arrays) {
|
|
1318
|
+
totalLength += arr.length;
|
|
1319
|
+
}
|
|
1320
|
+
const result = new Uint8Array(totalLength);
|
|
1321
|
+
let offset = 0;
|
|
1322
|
+
for (const arr of arrays) {
|
|
1323
|
+
result.set(arr, offset);
|
|
1324
|
+
offset += arr.length;
|
|
1325
|
+
}
|
|
1326
|
+
return result;
|
|
1327
|
+
}
|
|
1328
|
+
export function concatBytesHex(values) {
|
|
1329
|
+
return ('0x' + values.map((v) => v.substring(2)).join(''));
|
|
1330
|
+
}
|
|
1331
|
+
/**
|
|
1332
|
+
* Compares two byte arrays for equality.
|
|
1333
|
+
*
|
|
1334
|
+
* **⚠️ WARNING: NOT TIMING-SAFE**
|
|
1335
|
+
*
|
|
1336
|
+
* This function uses early-exit comparison which leaks timing information
|
|
1337
|
+
* about where the first difference occurs. Do NOT use for comparing:
|
|
1338
|
+
* - Secret keys or passwords
|
|
1339
|
+
* - HMACs or authentication tags
|
|
1340
|
+
* - Any security-sensitive data
|
|
1341
|
+
*
|
|
1342
|
+
* For security-sensitive comparisons, use a timing-safe equals function instead.
|
|
1343
|
+
*
|
|
1344
|
+
* @param a - First byte array
|
|
1345
|
+
* @param b - Second byte array
|
|
1346
|
+
* @returns true if arrays are equal, false otherwise
|
|
1347
|
+
*/
|
|
1348
|
+
export function unsafeBytesEquals(a, b) {
|
|
1349
|
+
if (!isBytes(a) || !isBytes(b)) {
|
|
1350
|
+
return false;
|
|
1351
|
+
}
|
|
1352
|
+
if (a.length !== b.length) {
|
|
1353
|
+
return false;
|
|
1354
|
+
}
|
|
1355
|
+
for (let i = 0; i < a.length; ++i) {
|
|
1356
|
+
if (a[i] !== b[i]) {
|
|
1357
|
+
return false;
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
return true;
|
|
1361
|
+
}
|
|
1362
|
+
/**
|
|
1363
|
+
* Normalizes byte-like values to a Uint8Array.
|
|
1364
|
+
*
|
|
1365
|
+
* Handles both same-realm and cross-realm inputs (e.g., from iframes or
|
|
1366
|
+
* different JavaScript contexts).
|
|
1367
|
+
*
|
|
1368
|
+
* Supported input types:
|
|
1369
|
+
* - `Uint8Array` - returned as-is (same-realm) or re-wrapped (cross-realm)
|
|
1370
|
+
* - `ArrayBuffer` - wrapped in a new Uint8Array
|
|
1371
|
+
*
|
|
1372
|
+
* Other TypedArray types (Uint16Array, Int32Array, etc.) are explicitly
|
|
1373
|
+
* rejected to prevent silent endianness-dependent byte reinterpretation.
|
|
1374
|
+
*
|
|
1375
|
+
* @param value - The value to normalize
|
|
1376
|
+
* @returns A `Uint8Array` representing the bytes
|
|
1377
|
+
* @throws `TypeError` If the value is not a Uint8Array or ArrayBuffer
|
|
1378
|
+
*
|
|
1379
|
+
* @example
|
|
1380
|
+
* ```ts
|
|
1381
|
+
* normalizeBytes(new Uint8Array([1, 2, 3])); // ✅ returns as-is
|
|
1382
|
+
* normalizeBytes(new ArrayBuffer(8)); // ✅ wraps in Uint8Array
|
|
1383
|
+
* normalizeBytes(new Uint16Array([1, 2])); // ❌ throws TypeError
|
|
1384
|
+
* normalizeBytes(iframeUint8Array); // ✅ cross-realm supported
|
|
1385
|
+
* ```
|
|
1386
|
+
*/
|
|
1387
|
+
export function normalizeBytes(value) {
|
|
1388
|
+
// same realm Uint8Array
|
|
1389
|
+
if (value instanceof Uint8Array)
|
|
1390
|
+
return value;
|
|
1391
|
+
// same realm ArrayBuffer
|
|
1392
|
+
if (value instanceof ArrayBuffer)
|
|
1393
|
+
return new Uint8Array(value);
|
|
1394
|
+
const tag = Object.prototype.toString.call(value);
|
|
1395
|
+
// cross realm Uint8Array
|
|
1396
|
+
if (ArrayBuffer.isView(value) && tag === '[object Uint8Array]') {
|
|
1397
|
+
return new Uint8Array(value.buffer, value.byteOffset, value.byteLength);
|
|
1398
|
+
}
|
|
1399
|
+
// cross realm ArrayBuffer
|
|
1400
|
+
if (tag === '[object ArrayBuffer]') {
|
|
1401
|
+
return new Uint8Array(value);
|
|
1402
|
+
}
|
|
1403
|
+
throw new TypeError(`Unsupported bytes type: ${tag}`);
|
|
1404
|
+
}
|
|
1405
|
+
/**
|
|
1406
|
+
* Extracts a single byte from a bytes array at the given byte position.
|
|
1407
|
+
* @param bytes - The bytes array (Uint8Array)
|
|
1408
|
+
* @param position - Byte position (0-indexed)
|
|
1409
|
+
* @returns The byte value as Uint8Number (0-255)
|
|
1410
|
+
* @throws RangeError if position is out of bounds
|
|
1411
|
+
*/
|
|
1412
|
+
export function bytesUint8At(bytes, position) {
|
|
1413
|
+
if (position >= bytes.length) {
|
|
1414
|
+
throw new RangeError(`Position ${position} out of bounds for bytes of length ${bytes.length}`);
|
|
1415
|
+
}
|
|
1416
|
+
return bytes[position];
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Extracts a single byte from a 0x-hex string at the given byte position.
|
|
1420
|
+
* @param bytesHex - The hex string (0x-prefixed)
|
|
1421
|
+
* @param position - Byte position (0-indexed)
|
|
1422
|
+
* @throws `RangeError` if position is out of bounds
|
|
1423
|
+
*/
|
|
1424
|
+
export function bytesHexUint8At(bytesHex, position) {
|
|
1425
|
+
const bytes1Hex = bytesHexSlice(bytesHex, position, 1);
|
|
1426
|
+
return parseInt(bytes1Hex, 16);
|
|
1427
|
+
}
|
|
1428
|
+
/**
|
|
1429
|
+
* Extracts a Uint64 (8 bytes) from a 0x-hex string at the given byte position.
|
|
1430
|
+
* @param bytesHex - The hex string (0x-prefixed)
|
|
1431
|
+
* @param position - Byte position (0-indexed)
|
|
1432
|
+
* @throws `RangeError` if position is out of bounds
|
|
1433
|
+
*/
|
|
1434
|
+
export function bytesHexUint64At(bytesHex, position) {
|
|
1435
|
+
const bytes8Hex = bytesHexSlice(bytesHex, position, 8);
|
|
1436
|
+
return BigInt(bytes8Hex);
|
|
1437
|
+
}
|
|
1438
|
+
export function bytesHexSlice(bytesHex, position, length) {
|
|
1439
|
+
const index = 2 + position * 2;
|
|
1440
|
+
if (index + 2 * length > bytesHex.length) {
|
|
1441
|
+
throw new RangeError(`Position ${position} with length ${length} out of bounds`);
|
|
1442
|
+
}
|
|
1443
|
+
return `0x${bytesHex.slice(index, index + 2 * length)}`;
|
|
1444
|
+
}
|
|
1445
|
+
//# sourceMappingURL=bytes.js.map
|