@fhevm/sdk 1.1.0-alpha.6 → 1.1.0-alpha.7
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/_cjs/core/_version.js +1 -1
- package/_cjs/core/actions/base/index.js +1 -17
- package/_cjs/core/actions/base/index.js.map +1 -1
- package/_cjs/core/actions/base/signDecryptionPermit.js +0 -3
- package/_cjs/core/actions/base/signDecryptionPermit.js.map +1 -1
- package/_cjs/core/actions/chain/index.js +1 -13
- package/_cjs/core/actions/chain/index.js.map +1 -1
- package/_cjs/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -1
- package/_cjs/core/actions/chain/serializeSignedDecryptionPermit.js.map +1 -1
- package/_cjs/core/actions/decrypt/canDecryptValue.js.map +1 -1
- package/_cjs/core/actions/decrypt/canDecryptValues.js.map +1 -1
- package/_cjs/core/actions/decrypt/canDecryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValue.js +1 -0
- package/_cjs/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValues.js +2 -0
- package/_cjs/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js +2 -0
- package/_cjs/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/actions/decrypt/index.js +1 -3
- package/_cjs/core/actions/decrypt/index.js.map +1 -1
- package/_cjs/core/actions/host/index.js +1 -9
- package/_cjs/core/actions/host/index.js.map +1 -1
- package/_cjs/core/base/cachedFetch.js +2 -1
- package/_cjs/core/base/cachedFetch.js.map +1 -1
- package/_cjs/core/base/uint.js +7 -0
- package/_cjs/core/base/uint.js.map +1 -1
- package/_cjs/core/clients/decorators/base.js +1 -1
- package/_cjs/core/clients/decorators/base.js.map +1 -1
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js +4 -1
- package/_cjs/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js +1 -1
- package/_cjs/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js.map +1 -1
- package/_cjs/core/host-contracts/getCurrentKmsContextAndEpoch-p.js +1 -1
- package/_cjs/core/host-contracts/getCurrentKmsContextAndEpoch-p.js.map +1 -1
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js +1 -1
- package/_cjs/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -1
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js +1 -1
- package/_cjs/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -1
- package/_cjs/core/kms/PublicDecryptionProof-p.js +4 -4
- package/_cjs/core/kms/SignedDecryptionPermit-p.js +33 -199
- package/_cjs/core/kms/SignedDecryptionPermit-p.js.map +1 -1
- package/_cjs/core/kms/SignedDecryptionPermitV1-p.js +217 -0
- package/_cjs/core/kms/SignedDecryptionPermitV1-p.js.map +1 -0
- package/_cjs/core/kms/SignedDecryptionPermitV2-p.js +184 -0
- package/_cjs/core/kms/SignedDecryptionPermitV2-p.js.map +1 -0
- package/_cjs/core/kms/{createKmsDelegatedUserDecryptEip712.js → createKmsDelegatedUserDecryptEip712V1.js} +9 -9
- package/_cjs/core/kms/createKmsDelegatedUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/kms/{createKmsUserDecryptEip712.js → createKmsUserDecryptEip712V1.js} +16 -16
- package/_cjs/core/kms/createKmsUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/kms/decryptValuesFromPairs.js +18 -2
- package/_cjs/core/kms/decryptValuesFromPairs.js.map +1 -1
- package/_cjs/core/kms/{fetchKmsSigncryptedShares-p.js → fetchKmsSigncryptedSharesV1-p.js} +18 -8
- package/_cjs/core/kms/fetchKmsSigncryptedSharesV1-p.js.map +1 -0
- package/_cjs/core/kms/fetchKmsSigncryptedSharesV2-p.js +95 -0
- package/_cjs/core/kms/fetchKmsSigncryptedSharesV2-p.js.map +1 -0
- package/_cjs/core/kms/{kmsDelegatedUserDecryptEip712Types.js → kmsDelegatedUserDecryptEip712V1Types.js} +8 -8
- package/_cjs/core/kms/kmsDelegatedUserDecryptEip712V1Types.js.map +1 -0
- package/_cjs/core/kms/{kmsUserDecryptEip712Types.js → kmsUserDecryptEip712V1Types.js} +8 -8
- package/_cjs/core/kms/kmsUserDecryptEip712V1Types.js.map +1 -0
- package/_cjs/core/kms/kmsUserDecryptEip712V2Types.js.map +1 -1
- package/_cjs/core/kms/publicDecrypt.js +2 -2
- package/_cjs/core/kms/utils.js +0 -19
- package/_cjs/core/kms/utils.js.map +1 -1
- package/_cjs/core/kms/verifyKmsPublicDecryptEip712-p.js +1 -1
- package/_cjs/core/modules/decrypt/module/api-p.js +5 -5
- package/_cjs/core/modules/decrypt/module/init-p.js +6 -7
- package/_cjs/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_cjs/core/modules/encrypt/module/init-p.js +12 -11
- package/_cjs/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchPublicDecrypt.js +3 -3
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/module/{fetchDelegatedUserDecrypt.js → fetchDelegatedUserDecryptV1.js} +1 -1
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecryptV1.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchPublicDecrypt.js +1 -1
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js +11 -45
- package/_cjs/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/module/fetchUserDecryptV1.js +52 -0
- package/_cjs/core/modules/relayer/module/fetchUserDecryptV1.js.map +1 -0
- package/_cjs/core/modules/relayer/module/fetchUserDecryptV2.js +54 -0
- package/_cjs/core/modules/relayer/module/fetchUserDecryptV2.js.map +1 -0
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseFailed.js +10 -2
- package/_cjs/core/modules/relayer/module/guards/RelayerResponseFailed.js.map +1 -1
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js +5 -2
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js.map +1 -1
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js +2 -0
- package/_cjs/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js.map +1 -1
- package/_cjs/core/modules/relayer/module/index.js +2 -2
- package/_cjs/core/modules/relayer/module/index.js.map +1 -1
- package/_cjs/core/runtime/HyperWasmSolver-p.js +1 -6
- package/_cjs/core/runtime/HyperWasmSolver-p.js.map +1 -1
- package/_cjs/core/utils-p/decrypt/{verifyKmsDelegatedUserDecryptEip712.js → verifyKmsDelegatedUserDecryptEip712V1.js} +5 -5
- package/_cjs/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/{verifyKmsUserDecryptEip712.js → verifyKmsUserDecryptEip712V1.js} +5 -5
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.js +30 -0
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.js.map +1 -0
- package/_cjs/wasm/tfhe/loadTfheLib.js.map +1 -1
- package/_cjs/wasm/tkms/loadKmsLib.js.map +1 -1
- package/_esm/core/_version.js +1 -1
- package/_esm/core/actions/base/index.js +0 -8
- package/_esm/core/actions/base/index.js.map +1 -1
- package/_esm/core/actions/base/signDecryptionPermit.js +0 -6
- package/_esm/core/actions/base/signDecryptionPermit.js.map +1 -1
- package/_esm/core/actions/chain/index.js +0 -6
- package/_esm/core/actions/chain/index.js.map +1 -1
- package/_esm/core/actions/chain/parseSignedDecryptionPermit.js.map +1 -1
- package/_esm/core/actions/chain/serializeSignedDecryptionPermit.js.map +1 -1
- package/_esm/core/actions/decrypt/canDecryptValue.js +40 -0
- package/_esm/core/actions/decrypt/canDecryptValue.js.map +1 -1
- package/_esm/core/actions/decrypt/canDecryptValues.js +1 -0
- package/_esm/core/actions/decrypt/canDecryptValues.js.map +1 -1
- package/_esm/core/actions/decrypt/canDecryptValuesFromPairs.js +1 -0
- package/_esm/core/actions/decrypt/canDecryptValuesFromPairs.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValue.js +1 -0
- package/_esm/core/actions/decrypt/decryptValue.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValues.js +2 -0
- package/_esm/core/actions/decrypt/decryptValues.js.map +1 -1
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js +2 -0
- package/_esm/core/actions/decrypt/decryptValuesFromPairs.js.map +1 -1
- package/_esm/core/actions/decrypt/index.js +0 -1
- package/_esm/core/actions/decrypt/index.js.map +1 -1
- package/_esm/core/actions/host/index.js +0 -4
- package/_esm/core/actions/host/index.js.map +1 -1
- package/_esm/core/base/cachedFetch.js +1 -0
- package/_esm/core/base/cachedFetch.js.map +1 -1
- package/_esm/core/base/uint.js +7 -0
- package/_esm/core/base/uint.js.map +1 -1
- package/_esm/core/clients/decorators/base.js +2 -4
- package/_esm/core/clients/decorators/base.js.map +1 -1
- package/_esm/core/coprocessor/coprocessorEip712Types.js +2 -2
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js +5 -2
- package/_esm/core/host-contracts/canDecryptValuesFromPairs.js.map +1 -1
- package/_esm/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js +2 -2
- package/_esm/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.js.map +1 -1
- package/_esm/core/host-contracts/getCurrentKmsContextAndEpoch-p.js +2 -2
- package/_esm/core/host-contracts/getCurrentKmsContextAndEpoch-p.js.map +1 -1
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js +2 -2
- package/_esm/core/host-contracts/getCurrentKmsContextId-p.js.map +1 -1
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js +2 -2
- package/_esm/core/host-contracts/getKmsContextSignersAndThreshold-p.js.map +1 -1
- package/_esm/core/kms/PublicDecryptionProof-p.js +4 -4
- package/_esm/core/kms/SignedDecryptionPermit-p.js +48 -245
- package/_esm/core/kms/SignedDecryptionPermit-p.js.map +1 -1
- package/_esm/core/kms/SignedDecryptionPermitV1-p.js +258 -0
- package/_esm/core/kms/SignedDecryptionPermitV1-p.js.map +1 -0
- package/_esm/core/kms/SignedDecryptionPermitV2-p.js +204 -0
- package/_esm/core/kms/SignedDecryptionPermitV2-p.js.map +1 -0
- package/_esm/core/kms/{createKmsDelegatedUserDecryptEip712.js → createKmsDelegatedUserDecryptEip712V1.js} +8 -8
- package/_esm/core/kms/createKmsDelegatedUserDecryptEip712V1.js.map +1 -0
- package/_esm/core/kms/createKmsPublicDecryptEip712.js +1 -1
- package/_esm/core/kms/{createKmsUserDecryptEip712.js → createKmsUserDecryptEip712V1.js} +16 -16
- package/_esm/core/kms/createKmsUserDecryptEip712V1.js.map +1 -0
- package/_esm/core/kms/decryptValuesFromPairs.js +18 -2
- package/_esm/core/kms/decryptValuesFromPairs.js.map +1 -1
- package/_esm/core/kms/{fetchKmsSigncryptedShares-p.js → fetchKmsSigncryptedSharesV1-p.js} +23 -13
- package/_esm/core/kms/fetchKmsSigncryptedSharesV1-p.js.map +1 -0
- package/_esm/core/kms/fetchKmsSigncryptedSharesV2-p.js +119 -0
- package/_esm/core/kms/fetchKmsSigncryptedSharesV2-p.js.map +1 -0
- package/_esm/core/kms/{kmsDelegatedUserDecryptEip712Types.js → kmsDelegatedUserDecryptEip712V1Types.js} +9 -8
- package/_esm/core/kms/kmsDelegatedUserDecryptEip712V1Types.js.map +1 -0
- package/_esm/core/kms/kmsPublicDecryptEip712Types.js +1 -1
- package/_esm/core/kms/{kmsUserDecryptEip712Types.js → kmsUserDecryptEip712V1Types.js} +9 -8
- package/_esm/core/kms/kmsUserDecryptEip712V1Types.js.map +1 -0
- package/_esm/core/kms/kmsUserDecryptEip712V2Types.js +2 -1
- package/_esm/core/kms/kmsUserDecryptEip712V2Types.js.map +1 -1
- package/_esm/core/kms/publicDecrypt.js +2 -2
- package/_esm/core/kms/utils.js +0 -18
- package/_esm/core/kms/utils.js.map +1 -1
- package/_esm/core/kms/verifyKmsPublicDecryptEip712-p.js +2 -2
- package/_esm/core/modules/decrypt/module/api-p.js +6 -6
- package/_esm/core/modules/decrypt/module/init-p.js +7 -7
- package/_esm/core/modules/decrypt/module/init-p.js.map +1 -1
- package/_esm/core/modules/encrypt/module/init-p.js +13 -11
- package/_esm/core/modules/encrypt/module/init-p.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/fetchPublicDecrypt.js +3 -3
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/module/{fetchDelegatedUserDecrypt.js → fetchDelegatedUserDecryptV1.js} +1 -1
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecryptV1.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchPublicDecrypt.js +1 -1
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js +11 -46
- package/_esm/core/modules/relayer/module/fetchUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/module/fetchUserDecryptV1.js +53 -0
- package/_esm/core/modules/relayer/module/fetchUserDecryptV1.js.map +1 -0
- package/_esm/core/modules/relayer/module/fetchUserDecryptV2.js +56 -0
- package/_esm/core/modules/relayer/module/fetchUserDecryptV2.js.map +1 -0
- package/_esm/core/modules/relayer/module/guards/RelayerResponseFailed.js +10 -2
- package/_esm/core/modules/relayer/module/guards/RelayerResponseFailed.js.map +1 -1
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js +6 -3
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.js.map +1 -1
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js +2 -0
- package/_esm/core/modules/relayer/module/guards/api-errors/RelayerApiError503.js.map +1 -1
- package/_esm/core/modules/relayer/module/index.js +1 -1
- package/_esm/core/modules/relayer/module/index.js.map +1 -1
- package/_esm/core/runtime/HyperWasmSolver-p.js +1 -6
- package/_esm/core/runtime/HyperWasmSolver-p.js.map +1 -1
- package/_esm/core/utils-p/decrypt/{verifyKmsDelegatedUserDecryptEip712.js → verifyKmsDelegatedUserDecryptEip712V1.js} +5 -5
- package/_esm/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712V1.js.map +1 -0
- package/_esm/core/utils-p/decrypt/{verifyKmsUserDecryptEip712.js → verifyKmsUserDecryptEip712V1.js} +5 -5
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712V1.js.map +1 -0
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.js +27 -0
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.js.map +1 -0
- package/_types/core/actions/base/index.d.ts +0 -8
- package/_types/core/actions/base/index.d.ts.map +1 -1
- package/_types/core/actions/base/signDecryptionPermit.d.ts +4 -5
- package/_types/core/actions/base/signDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/chain/index.d.ts +1 -7
- package/_types/core/actions/chain/index.d.ts.map +1 -1
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts +1 -0
- package/_types/core/actions/chain/parseSignedDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/chain/serializeSignedDecryptionPermit.d.ts +3 -2
- package/_types/core/actions/chain/serializeSignedDecryptionPermit.d.ts.map +1 -1
- package/_types/core/actions/decrypt/canDecryptValue.d.ts +3 -4
- package/_types/core/actions/decrypt/canDecryptValue.d.ts.map +1 -1
- package/_types/core/actions/decrypt/canDecryptValues.d.ts +3 -4
- package/_types/core/actions/decrypt/canDecryptValues.d.ts.map +1 -1
- package/_types/core/actions/decrypt/canDecryptValuesFromPairs.d.ts +3 -4
- package/_types/core/actions/decrypt/canDecryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValue.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValues.d.ts.map +1 -1
- package/_types/core/actions/decrypt/decryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/actions/decrypt/index.d.ts +0 -1
- package/_types/core/actions/decrypt/index.d.ts.map +1 -1
- package/_types/core/actions/host/index.d.ts +0 -4
- package/_types/core/actions/host/index.d.ts.map +1 -1
- package/_types/core/base/cachedFetch.d.ts +1 -0
- package/_types/core/base/cachedFetch.d.ts.map +1 -1
- package/_types/core/base/uint.d.ts +2 -1
- package/_types/core/base/uint.d.ts.map +1 -1
- package/_types/core/clients/decorators/base.d.ts +12 -23
- package/_types/core/clients/decorators/base.d.ts.map +1 -1
- package/_types/core/host-contracts/canDecryptValuesFromPairs.d.ts +2 -2
- package/_types/core/host-contracts/canDecryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/kms/PublicDecryptionProof-p.d.ts +1 -1
- package/_types/core/kms/SignedDecryptionPermit-p.d.ts +15 -29
- package/_types/core/kms/SignedDecryptionPermit-p.d.ts.map +1 -1
- package/_types/core/kms/SignedDecryptionPermitV1-p.d.ts +7 -0
- package/_types/core/kms/SignedDecryptionPermitV1-p.d.ts.map +1 -0
- package/_types/core/kms/SignedDecryptionPermitV2-p.d.ts +7 -0
- package/_types/core/kms/SignedDecryptionPermitV2-p.d.ts.map +1 -0
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712V1.d.ts +15 -0
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/kms/createKmsUserDecryptEip712V1.d.ts +26 -0
- package/_types/core/kms/createKmsUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/kms/createKmsUserDecryptEip712V2.d.ts +1 -1
- package/_types/core/kms/createKmsUserDecryptEip712V2.d.ts.map +1 -1
- package/_types/core/kms/decryptValuesFromPairs.d.ts +4 -11
- package/_types/core/kms/decryptValuesFromPairs.d.ts.map +1 -1
- package/_types/core/kms/{fetchKmsSigncryptedShares-p.d.ts → fetchKmsSigncryptedSharesV1-p.d.ts} +10 -12
- package/_types/core/kms/fetchKmsSigncryptedSharesV1-p.d.ts.map +1 -0
- package/_types/core/kms/fetchKmsSigncryptedSharesV2-p.d.ts +28 -0
- package/_types/core/kms/fetchKmsSigncryptedSharesV2-p.d.ts.map +1 -0
- package/_types/core/kms/kmsDelegatedUserDecryptEip712V1Types.d.ts +3 -0
- package/_types/core/kms/kmsDelegatedUserDecryptEip712V1Types.d.ts.map +1 -0
- package/_types/core/kms/kmsUserDecryptEip712V1Types.d.ts +3 -0
- package/_types/core/kms/kmsUserDecryptEip712V1Types.d.ts.map +1 -0
- package/_types/core/kms/kmsUserDecryptEip712V2Types.d.ts.map +1 -1
- package/_types/core/kms/utils.d.ts +0 -4
- package/_types/core/kms/utils.d.ts.map +1 -1
- package/_types/core/kms/verifyKmsPublicDecryptEip712-p.d.ts +1 -1
- package/_types/core/modules/encrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/modules/relayer/cleartext/fetchUserDecrypt.d.ts +2 -2
- package/_types/core/modules/relayer/cleartext/fetchUserDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/{fetchDelegatedUserDecrypt.d.ts → fetchDelegatedUserDecryptV1.d.ts} +1 -1
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecryptV1.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchUserDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/fetchUserDecryptV1.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchUserDecryptV1.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/fetchUserDecryptV2.d.ts +3 -0
- package/_types/core/modules/relayer/module/fetchUserDecryptV2.d.ts.map +1 -0
- package/_types/core/modules/relayer/module/guards/RelayerResponseFailed.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.d.ts +1 -1
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.d.ts.map +1 -1
- package/_types/core/modules/relayer/module/guards/api-errors/RelayerApiError503.d.ts.map +1 -1
- package/_types/core/modules/relayer/types.d.ts +18 -5
- package/_types/core/modules/relayer/types.d.ts.map +1 -1
- package/_types/core/types/kms.d.ts +18 -19
- package/_types/core/types/kms.d.ts.map +1 -1
- package/_types/core/types/logger.d.ts +3 -3
- package/_types/core/types/logger.d.ts.map +1 -1
- package/_types/core/types/record-p.d.ts +2 -1
- package/_types/core/types/record-p.d.ts.map +1 -1
- package/_types/core/types/relayer-p.d.ts +27 -5
- package/_types/core/types/relayer-p.d.ts.map +1 -1
- package/_types/core/types/signedDecryptionPermit.d.ts +37 -26
- package/_types/core/types/signedDecryptionPermit.d.ts.map +1 -1
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712V1.d.ts +14 -0
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712V1.d.ts +14 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.d.ts +14 -0
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.d.ts.map +1 -0
- package/_types/core/utils-p/runtime/recoverSigners.d.ts +2 -2
- package/core/_version.ts +1 -1
- package/core/actions/base/index.ts +0 -42
- package/core/actions/base/signDecryptionPermit.ts +3 -31
- package/core/actions/chain/index.ts +0 -28
- package/core/actions/chain/parseSignedDecryptionPermit.ts +1 -0
- package/core/actions/chain/serializeSignedDecryptionPermit.ts +3 -2
- package/core/actions/decrypt/canDecryptValue.ts +2 -16
- package/core/actions/decrypt/canDecryptValues.ts +2 -16
- package/core/actions/decrypt/canDecryptValuesFromPairs.ts +2 -16
- package/core/actions/decrypt/decryptValue.ts +2 -1
- package/core/actions/decrypt/decryptValues.ts +3 -1
- package/core/actions/decrypt/decryptValuesFromPairs.ts +3 -1
- package/core/actions/decrypt/index.ts +0 -6
- package/core/actions/host/index.ts +0 -20
- package/core/base/cachedFetch.ts +1 -0
- package/core/base/uint.ts +18 -1
- package/core/clients/decorators/base.ts +13 -37
- package/core/coprocessor/coprocessorEip712Types.ts +2 -2
- package/core/host-contracts/canDecryptValuesFromPairs.ts +7 -7
- package/core/host-contracts/getCoprocessorContextSignersAndThreshold-p.ts +2 -2
- package/core/host-contracts/getCurrentKmsContextAndEpoch-p.ts +2 -2
- package/core/host-contracts/getCurrentKmsContextId-p.ts +2 -2
- package/core/host-contracts/getKmsContextSignersAndThreshold-p.ts +2 -2
- package/core/kms/PublicDecryptionProof-p.ts +5 -5
- package/core/kms/SignedDecryptionPermit-p.ts +67 -357
- package/core/kms/SignedDecryptionPermitV1-p.ts +350 -0
- package/core/kms/SignedDecryptionPermitV2-p.ts +292 -0
- package/core/kms/{createKmsDelegatedUserDecryptEip712.ts → createKmsDelegatedUserDecryptEip712V1.ts} +16 -16
- package/core/kms/createKmsPublicDecryptEip712.ts +1 -1
- package/core/kms/{createKmsUserDecryptEip712.ts → createKmsUserDecryptEip712V1.ts} +26 -24
- package/core/kms/createKmsUserDecryptEip712V2.ts +1 -1
- package/core/kms/decryptValuesFromPairs.ts +34 -22
- package/core/kms/{fetchKmsSigncryptedShares-p.ts → fetchKmsSigncryptedSharesV1-p.ts} +35 -30
- package/core/kms/fetchKmsSigncryptedSharesV2-p.ts +176 -0
- package/core/kms/{kmsDelegatedUserDecryptEip712Types.ts → kmsDelegatedUserDecryptEip712V1Types.ts} +9 -8
- package/core/kms/kmsPublicDecryptEip712Types.ts +1 -1
- package/core/kms/{kmsUserDecryptEip712Types.ts → kmsUserDecryptEip712V1Types.ts} +9 -8
- package/core/kms/kmsUserDecryptEip712V2Types.ts +2 -1
- package/core/kms/publicDecrypt.ts +2 -2
- package/core/kms/utils.ts +0 -32
- package/core/kms/verifyKmsPublicDecryptEip712-p.ts +3 -3
- package/core/modules/decrypt/module/api-p.ts +8 -8
- package/core/modules/decrypt/module/init-p.ts +7 -7
- package/core/modules/encrypt/module/init-p.ts +16 -11
- package/core/modules/relayer/cleartext/fetchPublicDecrypt.ts +3 -3
- package/core/modules/relayer/cleartext/fetchUserDecrypt.ts +2 -2
- package/core/modules/relayer/module/fetchPublicDecrypt.ts +1 -1
- package/core/modules/relayer/module/fetchUserDecrypt.ts +20 -56
- package/core/modules/relayer/module/fetchUserDecryptV1.ts +69 -0
- package/core/modules/relayer/module/fetchUserDecryptV2.ts +71 -0
- package/core/modules/relayer/module/guards/RelayerResponseFailed.ts +10 -2
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError400NoDetails.ts +6 -3
- package/core/modules/relayer/module/guards/api-errors/RelayerApiError503.ts +2 -0
- package/core/modules/relayer/module/index.ts +1 -1
- package/core/modules/relayer/types.ts +24 -5
- package/core/runtime/HyperWasmSolver-p.ts +1 -5
- package/core/types/kms.ts +40 -28
- package/core/types/logger.ts +3 -3
- package/core/types/record-p.ts +2 -1
- package/core/types/relayer-p.ts +48 -5
- package/core/types/signedDecryptionPermit.ts +47 -26
- package/core/utils-p/decrypt/{verifyKmsDelegatedUserDecryptEip712.ts → verifyKmsDelegatedUserDecryptEip712V1.ts} +9 -9
- package/core/utils-p/decrypt/{verifyKmsUserDecryptEip712.ts → verifyKmsUserDecryptEip712V1.ts} +9 -9
- package/core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.ts +43 -0
- package/core/utils-p/runtime/recoverSigners.ts +2 -2
- package/package.json +1 -1
- package/_cjs/core/actions/base/createVerifiedInputProofFromRawBytes.js +0 -10
- package/_cjs/core/actions/base/createVerifiedInputProofFromRawBytes.js.map +0 -1
- package/_cjs/core/actions/base/fetchKmsSigncryptedShares.js +0 -19
- package/_cjs/core/actions/base/fetchKmsSigncryptedShares.js.map +0 -1
- package/_cjs/core/actions/base/fetchVerifiedInputProof.js +0 -11
- package/_cjs/core/actions/base/fetchVerifiedInputProof.js.map +0 -1
- package/_cjs/core/actions/base/readKmsSignersContext.js +0 -11
- package/_cjs/core/actions/base/readKmsSignersContext.js.map +0 -1
- package/_cjs/core/actions/base/verifyHandlesCoprocessorSignatures.js +0 -31
- package/_cjs/core/actions/base/verifyHandlesCoprocessorSignatures.js.map +0 -1
- package/_cjs/core/actions/base/verifyInputProof.js +0 -24
- package/_cjs/core/actions/base/verifyInputProof.js.map +0 -1
- package/_cjs/core/actions/base/verifyZkProofCoprocessorSignatures.js +0 -17
- package/_cjs/core/actions/base/verifyZkProofCoprocessorSignatures.js.map +0 -1
- package/_cjs/core/actions/chain/createCoprocessorEip712Domain.js +0 -11
- package/_cjs/core/actions/chain/createCoprocessorEip712Domain.js.map +0 -1
- package/_cjs/core/actions/chain/createKmsDelegatedUserDecryptEip712.js +0 -17
- package/_cjs/core/actions/chain/createKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_cjs/core/actions/chain/createKmsEip712Domain.js +0 -11
- package/_cjs/core/actions/chain/createKmsEip712Domain.js.map +0 -1
- package/_cjs/core/actions/chain/createKmsUserDecryptEip712.js +0 -16
- package/_cjs/core/actions/chain/createKmsUserDecryptEip712.js.map +0 -1
- package/_cjs/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js +0 -8
- package/_cjs/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_cjs/core/actions/chain/verifyKmsUserDecryptEip712.js +0 -8
- package/_cjs/core/actions/chain/verifyKmsUserDecryptEip712.js.map +0 -1
- package/_cjs/core/actions/decrypt/decryptKmsSigncryptedShares.js +0 -13
- package/_cjs/core/actions/decrypt/decryptKmsSigncryptedShares.js.map +0 -1
- package/_cjs/core/kms/createKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_cjs/core/kms/createKmsUserDecryptEip712.js.map +0 -1
- package/_cjs/core/kms/fetchKmsSigncryptedShares-p.js.map +0 -1
- package/_cjs/core/kms/kmsDelegatedUserDecryptEip712Types.js.map +0 -1
- package/_cjs/core/kms/kmsUserDecryptEip712Types.js.map +0 -1
- package/_cjs/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +0 -1
- package/_cjs/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_cjs/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js.map +0 -1
- package/_esm/core/actions/base/createVerifiedInputProofFromRawBytes.js +0 -7
- package/_esm/core/actions/base/createVerifiedInputProofFromRawBytes.js.map +0 -1
- package/_esm/core/actions/base/fetchKmsSigncryptedShares.js +0 -17
- package/_esm/core/actions/base/fetchKmsSigncryptedShares.js.map +0 -1
- package/_esm/core/actions/base/fetchVerifiedInputProof.js +0 -8
- package/_esm/core/actions/base/fetchVerifiedInputProof.js.map +0 -1
- package/_esm/core/actions/base/readKmsSignersContext.js +0 -10
- package/_esm/core/actions/base/readKmsSignersContext.js.map +0 -1
- package/_esm/core/actions/base/verifyHandlesCoprocessorSignatures.js +0 -35
- package/_esm/core/actions/base/verifyHandlesCoprocessorSignatures.js.map +0 -1
- package/_esm/core/actions/base/verifyInputProof.js +0 -22
- package/_esm/core/actions/base/verifyInputProof.js.map +0 -1
- package/_esm/core/actions/base/verifyZkProofCoprocessorSignatures.js +0 -14
- package/_esm/core/actions/base/verifyZkProofCoprocessorSignatures.js.map +0 -1
- package/_esm/core/actions/chain/createCoprocessorEip712Domain.js +0 -8
- package/_esm/core/actions/chain/createCoprocessorEip712Domain.js.map +0 -1
- package/_esm/core/actions/chain/createKmsDelegatedUserDecryptEip712.js +0 -15
- package/_esm/core/actions/chain/createKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_esm/core/actions/chain/createKmsEip712Domain.js +0 -8
- package/_esm/core/actions/chain/createKmsEip712Domain.js.map +0 -1
- package/_esm/core/actions/chain/createKmsUserDecryptEip712.js +0 -14
- package/_esm/core/actions/chain/createKmsUserDecryptEip712.js.map +0 -1
- package/_esm/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js +0 -5
- package/_esm/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_esm/core/actions/chain/verifyKmsUserDecryptEip712.js +0 -5
- package/_esm/core/actions/chain/verifyKmsUserDecryptEip712.js.map +0 -1
- package/_esm/core/actions/decrypt/decryptKmsSigncryptedShares.js +0 -11
- package/_esm/core/actions/decrypt/decryptKmsSigncryptedShares.js.map +0 -1
- package/_esm/core/kms/createKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_esm/core/kms/createKmsUserDecryptEip712.js.map +0 -1
- package/_esm/core/kms/fetchKmsSigncryptedShares-p.js.map +0 -1
- package/_esm/core/kms/kmsDelegatedUserDecryptEip712Types.js.map +0 -1
- package/_esm/core/kms/kmsUserDecryptEip712Types.js.map +0 -1
- package/_esm/core/modules/relayer/module/fetchDelegatedUserDecrypt.js.map +0 -1
- package/_esm/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.js.map +0 -1
- package/_esm/core/utils-p/decrypt/verifyKmsUserDecryptEip712.js.map +0 -1
- package/_types/core/actions/base/createVerifiedInputProofFromRawBytes.d.ts +0 -14
- package/_types/core/actions/base/createVerifiedInputProofFromRawBytes.d.ts.map +0 -1
- package/_types/core/actions/base/fetchKmsSigncryptedShares.d.ts +0 -41
- package/_types/core/actions/base/fetchKmsSigncryptedShares.d.ts.map +0 -1
- package/_types/core/actions/base/fetchVerifiedInputProof.d.ts +0 -14
- package/_types/core/actions/base/fetchVerifiedInputProof.d.ts.map +0 -1
- package/_types/core/actions/base/readKmsSignersContext.d.ts +0 -6
- package/_types/core/actions/base/readKmsSignersContext.d.ts.map +0 -1
- package/_types/core/actions/base/verifyHandlesCoprocessorSignatures.d.ts +0 -14
- package/_types/core/actions/base/verifyHandlesCoprocessorSignatures.d.ts.map +0 -1
- package/_types/core/actions/base/verifyInputProof.d.ts +0 -14
- package/_types/core/actions/base/verifyInputProof.d.ts.map +0 -1
- package/_types/core/actions/base/verifyZkProofCoprocessorSignatures.d.ts +0 -11
- package/_types/core/actions/base/verifyZkProofCoprocessorSignatures.d.ts.map +0 -1
- package/_types/core/actions/chain/createCoprocessorEip712Domain.d.ts +0 -7
- package/_types/core/actions/chain/createCoprocessorEip712Domain.d.ts.map +0 -1
- package/_types/core/actions/chain/createKmsDelegatedUserDecryptEip712.d.ts +0 -15
- package/_types/core/actions/chain/createKmsDelegatedUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/actions/chain/createKmsEip712Domain.d.ts +0 -7
- package/_types/core/actions/chain/createKmsEip712Domain.d.ts.map +0 -1
- package/_types/core/actions/chain/createKmsUserDecryptEip712.d.ts +0 -14
- package/_types/core/actions/chain/createKmsUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts +0 -7
- package/_types/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/actions/chain/verifyKmsUserDecryptEip712.d.ts +0 -7
- package/_types/core/actions/chain/verifyKmsUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/actions/decrypt/decryptKmsSigncryptedShares.d.ts +0 -13
- package/_types/core/actions/decrypt/decryptKmsSigncryptedShares.d.ts.map +0 -1
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712.d.ts +0 -15
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts +0 -26
- package/_types/core/kms/createKmsUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/kms/fetchKmsSigncryptedShares-p.d.ts.map +0 -1
- package/_types/core/kms/kmsDelegatedUserDecryptEip712Types.d.ts +0 -3
- package/_types/core/kms/kmsDelegatedUserDecryptEip712Types.d.ts.map +0 -1
- package/_types/core/kms/kmsUserDecryptEip712Types.d.ts +0 -3
- package/_types/core/kms/kmsUserDecryptEip712Types.d.ts.map +0 -1
- package/_types/core/modules/relayer/module/fetchDelegatedUserDecrypt.d.ts.map +0 -1
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.d.ts +0 -14
- package/_types/core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712.d.ts.map +0 -1
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712.d.ts +0 -14
- package/_types/core/utils-p/decrypt/verifyKmsUserDecryptEip712.d.ts.map +0 -1
- package/core/actions/base/createVerifiedInputProofFromRawBytes.ts +0 -24
- package/core/actions/base/fetchKmsSigncryptedShares.ts +0 -83
- package/core/actions/base/fetchVerifiedInputProof.ts +0 -25
- package/core/actions/base/readKmsSignersContext.ts +0 -20
- package/core/actions/base/verifyHandlesCoprocessorSignatures.ts +0 -60
- package/core/actions/base/verifyInputProof.ts +0 -45
- package/core/actions/base/verifyZkProofCoprocessorSignatures.ts +0 -32
- package/core/actions/chain/createCoprocessorEip712Domain.ts +0 -16
- package/core/actions/chain/createKmsDelegatedUserDecryptEip712.ts +0 -36
- package/core/actions/chain/createKmsEip712Domain.ts +0 -16
- package/core/actions/chain/createKmsUserDecryptEip712.ts +0 -34
- package/core/actions/chain/verifyKmsDelegatedUserDecryptEip712.ts +0 -16
- package/core/actions/chain/verifyKmsUserDecryptEip712.ts +0 -16
- package/core/actions/decrypt/decryptKmsSigncryptedShares.ts +0 -34
- /package/core/modules/relayer/module/{fetchDelegatedUserDecrypt.ts → fetchDelegatedUserDecryptV1.ts} +0 -0
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KmsDelegatedUserDecryptEip712V1, KmsUserDecryptEip712V1, KmsUserDecryptEip712V2 } from './kms.js';
|
|
2
2
|
import type { Bytes65Hex, BytesHex, ChecksummedAddress } from './primitives.js';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
5
|
-
* to request decryption of the signer's own FHE handles from the KMS.
|
|
6
|
-
*
|
|
7
|
-
* Created once, serializable, and reusable across multiple decrypt calls.
|
|
4
|
+
* Common fields shared by all signed decryption permit versions.
|
|
8
5
|
*/
|
|
9
6
|
export type SignedDecryptionPermitBase = {
|
|
10
7
|
/** The EIP-712 signature. */
|
|
@@ -14,33 +11,47 @@ export type SignedDecryptionPermitBase = {
|
|
|
14
11
|
/**
|
|
15
12
|
* The account that owns the encrypted data this permit covers.
|
|
16
13
|
*
|
|
17
|
-
* - **Self permit:** equals `signerAddress
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* - **Delegated permit:** differs from `signerAddress`. Step by step:
|
|
21
|
-
* 1. Alice owns encrypted values on-chain (ebool, euint8, etc.).
|
|
22
|
-
* 2. Alice calls the ACL contract to grant Bob permission to decrypt her data.
|
|
23
|
-
* 3. Bob signs an EIP-712 delegated decryption permit referencing Alice as the
|
|
24
|
-
* `encryptedDataOwnerAddress` (= `delegatorAddress` in the EIP-712 message).
|
|
25
|
-
* 4. The KMS verifies Bob's signature (`signerAddress`) and that Alice
|
|
26
|
-
* (`encryptedDataOwnerAddress`) has granted him on-chain permission.
|
|
27
|
-
* 5. Bob can now decrypt Alice's encrypted values using this permit.
|
|
14
|
+
* - **Self permit:** equals `signerAddress`.
|
|
15
|
+
* - **Delegated permit:** differs from `signerAddress`. The owner has granted
|
|
16
|
+
* the signer permission via `FHE.delegateUserDecryption()` on-chain.
|
|
28
17
|
*/
|
|
29
18
|
readonly encryptedDataOwnerAddress: ChecksummedAddress;
|
|
30
19
|
/** The E2E transport public key embedded in the EIP-712 message. */
|
|
31
20
|
readonly transportPublicKey: BytesHex;
|
|
32
|
-
/**
|
|
21
|
+
/** `true` when the signer is decrypting on behalf of another account (delegated permit). */
|
|
22
|
+
readonly isDelegated: boolean;
|
|
23
|
+
/** @throws If the permit has expired. */
|
|
33
24
|
assertNotExpired(): void;
|
|
34
25
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Signed decryption permit produced by protocol v13 and below.
|
|
28
|
+
*
|
|
29
|
+
* Narrow to self vs delegated via `eip712.primaryType`:
|
|
30
|
+
* - `'UserDecryptRequestVerification'` → self permit (`encryptedDataOwnerAddress === signerAddress`)
|
|
31
|
+
* - `'DelegatedUserDecryptRequestVerification'` → delegated permit
|
|
32
|
+
*/
|
|
33
|
+
export type SignedDecryptionPermitV1 = SignedDecryptionPermitBase & {
|
|
34
|
+
readonly version: 1;
|
|
35
|
+
readonly eip712: KmsUserDecryptEip712V1 | KmsDelegatedUserDecryptEip712V1;
|
|
39
36
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Signed decryption permit produced by protocol v14 and above.
|
|
39
|
+
*
|
|
40
|
+
* Uses the unified `KmsUserDecryptEip712V2` EIP-712 shape — there is no longer
|
|
41
|
+
* a separate delegated variant. The `encryptedDataOwnerAddress` is read from
|
|
42
|
+
* `eip712.message.userAddress` and may differ from `signerAddress`.
|
|
43
|
+
*
|
|
44
|
+
* Discriminate from {@link SignedDecryptionPermitV1} with `permit.version === 2`.
|
|
45
|
+
*/
|
|
46
|
+
export type SignedDecryptionPermitV2 = SignedDecryptionPermitBase & {
|
|
47
|
+
readonly version: 2;
|
|
48
|
+
readonly eip712: KmsUserDecryptEip712V2;
|
|
44
49
|
};
|
|
45
|
-
|
|
50
|
+
/**
|
|
51
|
+
* A signed decryption permit, covering all protocol versions.
|
|
52
|
+
*
|
|
53
|
+
* Narrow by version: `permit.version === 1` → {@link SignedDecryptionPermitV1},
|
|
54
|
+
* `permit.version === 2` → {@link SignedDecryptionPermitV2}.
|
|
55
|
+
*/
|
|
56
|
+
export type SignedDecryptionPermit = SignedDecryptionPermitV1 | SignedDecryptionPermitV2;
|
|
46
57
|
//# sourceMappingURL=signedDecryptionPermit.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signedDecryptionPermit.d.ts","sourceRoot":"","sources":["../../../core/types/signedDecryptionPermit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"signedDecryptionPermit.d.ts","sourceRoot":"","sources":["../../../core/types/signedDecryptionPermit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAChH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhF;;GAEG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,6BAA6B;IAC7B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,0CAA0C;IAC1C,QAAQ,CAAC,aAAa,EAAE,kBAAkB,CAAC;IAC3C;;;;;;OAMG;IACH,QAAQ,CAAC,yBAAyB,EAAE,kBAAkB,CAAC;IACvD,oEAAoE;IACpE,QAAQ,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IACtC,4FAA4F;IAC5F,QAAQ,CAAC,WAAW,EAAE,OAAO,CAAC;IAE9B,yCAAyC;IACzC,gBAAgB,IAAI,IAAI,CAAC;CAC1B,CAAC;AAMF;;;;;;GAMG;AACH,MAAM,MAAM,wBAAwB,GAAG,0BAA0B,GAAG;IAClE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,sBAAsB,GAAG,+BAA+B,CAAC;CAC3E,CAAC;AAMF;;;;;;;;GAQG;AACH,MAAM,MAAM,wBAAwB,GAAG,0BAA0B,GAAG;IAClE,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;IACpB,QAAQ,CAAC,MAAM,EAAE,sBAAsB,CAAC;CACzC,CAAC;AAIF;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FhevmRuntime } from '../../types/coreFhevmRuntime.js';
|
|
2
|
+
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
3
|
+
import type { KmsDelegatedUserDecryptEip712V1Message } from '../../types/kms.js';
|
|
4
|
+
import type { Bytes65Hex, ChecksummedAddress } from '../../types/primitives.js';
|
|
5
|
+
export type VerifyKmsDelegatedUserDecryptEip712V1Parameters = {
|
|
6
|
+
readonly signer: ChecksummedAddress;
|
|
7
|
+
readonly message: KmsDelegatedUserDecryptEip712V1Message;
|
|
8
|
+
readonly signature: Bytes65Hex;
|
|
9
|
+
};
|
|
10
|
+
export declare function verifyKmsDelegatedUserDecryptEip712V1(context: {
|
|
11
|
+
readonly chain: FhevmChain;
|
|
12
|
+
readonly runtime: FhevmRuntime;
|
|
13
|
+
}, parameters: VerifyKmsDelegatedUserDecryptEip712V1Parameters): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=verifyKmsDelegatedUserDecryptEip712V1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyKmsDelegatedUserDecryptEip712V1.d.ts","sourceRoot":"","sources":["../../../../core/utils-p/decrypt/verifyKmsDelegatedUserDecryptEip712V1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAmC,sCAAsC,EAAE,MAAM,oBAAoB,CAAC;AAClH,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMhF,MAAM,MAAM,+CAA+C,GAAG;IAC5D,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,sCAAsC,CAAC;IACzD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC;AAEF,wBAAsB,qCAAqC,CACzD,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,EACvE,UAAU,EAAE,+CAA+C,GAC1D,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FhevmRuntime } from '../../types/coreFhevmRuntime.js';
|
|
2
|
+
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
3
|
+
import type { KmsUserDecryptEip712V1Message } from '../../types/kms.js';
|
|
4
|
+
import type { Bytes65Hex, ChecksummedAddress } from '../../types/primitives.js';
|
|
5
|
+
export type VerifyKmsUserDecryptEip712V1Parameters = {
|
|
6
|
+
readonly signer: ChecksummedAddress;
|
|
7
|
+
readonly message: KmsUserDecryptEip712V1Message;
|
|
8
|
+
readonly signature: Bytes65Hex;
|
|
9
|
+
};
|
|
10
|
+
export declare function verifyKmsUserDecryptEip712V1(context: {
|
|
11
|
+
readonly chain: FhevmChain;
|
|
12
|
+
readonly runtime: FhevmRuntime;
|
|
13
|
+
}, parameters: VerifyKmsUserDecryptEip712V1Parameters): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=verifyKmsUserDecryptEip712V1.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyKmsUserDecryptEip712V1.d.ts","sourceRoot":"","sources":["../../../../core/utils-p/decrypt/verifyKmsUserDecryptEip712V1.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAA0B,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMhF,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,EACvE,UAAU,EAAE,sCAAsC,GACjD,OAAO,CAAC,IAAI,CAAC,CA4Bf"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FhevmRuntime } from '../../types/coreFhevmRuntime.js';
|
|
2
|
+
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
3
|
+
import type { KmsUserDecryptEip712V2Message } from '../../types/kms.js';
|
|
4
|
+
import type { Bytes65Hex, ChecksummedAddress } from '../../types/primitives.js';
|
|
5
|
+
export type VerifyKmsUserDecryptEip712V2Parameters = {
|
|
6
|
+
readonly signer: ChecksummedAddress;
|
|
7
|
+
readonly message: KmsUserDecryptEip712V2Message;
|
|
8
|
+
readonly signature: Bytes65Hex;
|
|
9
|
+
};
|
|
10
|
+
export declare function verifyKmsUserDecryptEip712V2(context: {
|
|
11
|
+
readonly chain: FhevmChain;
|
|
12
|
+
readonly runtime: FhevmRuntime;
|
|
13
|
+
}, parameters: VerifyKmsUserDecryptEip712V2Parameters): Promise<void>;
|
|
14
|
+
//# sourceMappingURL=verifyKmsUserDecryptEip712V2.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verifyKmsUserDecryptEip712V2.d.ts","sourceRoot":"","sources":["../../../../core/utils-p/decrypt/verifyKmsUserDecryptEip712V2.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAA0B,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAMhF,MAAM,MAAM,sCAAsC,GAAG;IACnD,QAAQ,CAAC,MAAM,EAAE,kBAAkB,CAAC;IACpC,QAAQ,CAAC,OAAO,EAAE,6BAA6B,CAAC;IAChD,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC;AAEF,wBAAsB,4BAA4B,CAChD,OAAO,EAAE;IAAE,QAAQ,CAAC,KAAK,EAAE,UAAU,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,YAAY,CAAA;CAAE,EACvE,UAAU,EAAE,sCAAsC,GACjD,OAAO,CAAC,IAAI,CAAC,CAwBf"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type { RecoverTypedDataAddressModuleFunction } from '../../modules/ethereum/types.js';
|
|
2
2
|
import type { FhevmRuntime } from '../../types/coreFhevmRuntime.js';
|
|
3
3
|
import type { ChecksummedAddress } from '../../types/primitives.js';
|
|
4
|
-
type
|
|
4
|
+
type Eip712TypesType = Record<string, ReadonlyArray<{
|
|
5
5
|
name: string;
|
|
6
6
|
type: string;
|
|
7
7
|
}>>;
|
|
8
|
-
export type RecoverSignersParameters<T extends
|
|
8
|
+
export type RecoverSignersParameters<T extends Eip712TypesType> = {
|
|
9
9
|
readonly domain: Parameters<RecoverTypedDataAddressModuleFunction['recoverTypedDataAddress']>[0]['domain'];
|
|
10
10
|
readonly types: T;
|
|
11
11
|
readonly primaryType: string & keyof T;
|
package/core/_version.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export { type ReadKmsSignersContextReturnType, readKmsSignersContext } from './readKmsSignersContext.js';
|
|
2
|
-
|
|
3
1
|
export {
|
|
4
2
|
type DecryptPublicValueParameters,
|
|
5
3
|
type DecryptPublicValueReturnType,
|
|
@@ -32,48 +30,8 @@ export {
|
|
|
32
30
|
canDecryptPublicValues,
|
|
33
31
|
} from './canDecryptPublicValues.js';
|
|
34
32
|
|
|
35
|
-
export {
|
|
36
|
-
type CreateVerifiedInputProofFromRawBytesParameters,
|
|
37
|
-
type CreateVerifiedInputProofFromRawBytesReturnType,
|
|
38
|
-
createVerifiedInputProofFromRawBytes,
|
|
39
|
-
} from './createVerifiedInputProofFromRawBytes.js';
|
|
40
|
-
|
|
41
|
-
export {
|
|
42
|
-
type ReadCoprocessorSignersContextReturnType,
|
|
43
|
-
readCoprocessorSignersContext,
|
|
44
|
-
} from './readCoprocessorSignersContext.js';
|
|
45
|
-
|
|
46
|
-
export {
|
|
47
|
-
type VerifyInputProofParameters,
|
|
48
|
-
type VerifyInputProofReturnType,
|
|
49
|
-
verifyInputProof,
|
|
50
|
-
} from './verifyInputProof.js';
|
|
51
|
-
|
|
52
|
-
export {
|
|
53
|
-
type FetchVerifiedInputProofParameters,
|
|
54
|
-
type FetchVerifiedInputProofReturnType,
|
|
55
|
-
fetchVerifiedInputProof,
|
|
56
|
-
} from './fetchVerifiedInputProof.js';
|
|
57
|
-
|
|
58
33
|
export {
|
|
59
34
|
type FetchEncryptedValuesParameters,
|
|
60
35
|
type FetchEncryptedValuesReturnType,
|
|
61
36
|
fetchEncryptedValues,
|
|
62
37
|
} from './fetchEncryptedValues.js';
|
|
63
|
-
|
|
64
|
-
export {
|
|
65
|
-
type VerifyZkProofCoprocessorSignaturesParameters,
|
|
66
|
-
verifyZkProofCoprocessorSignatures,
|
|
67
|
-
} from './verifyZkProofCoprocessorSignatures.js';
|
|
68
|
-
|
|
69
|
-
export {
|
|
70
|
-
type FetchSelfKmsSigncryptedSharesParameters,
|
|
71
|
-
type FetchDelegatedKmsSigncryptedSharesParameters,
|
|
72
|
-
type FetchKmsSigncryptedSharesReturnType,
|
|
73
|
-
fetchKmsSigncryptedShares,
|
|
74
|
-
} from './fetchKmsSigncryptedShares.js';
|
|
75
|
-
|
|
76
|
-
export {
|
|
77
|
-
type VerifyHandlesCoprocessorSignaturesParameters,
|
|
78
|
-
verifyHandlesCoprocessorSignatures,
|
|
79
|
-
} from './verifyHandlesCoprocessorSignatures.js';
|
|
@@ -1,43 +1,15 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
SignDecryptionPermitParameters,
|
|
3
|
-
SignSelfDecryptionPermitParameters,
|
|
4
|
-
SignDelegatedDecryptionPermitParameters,
|
|
5
|
-
} from '../../kms/SignedDecryptionPermit-p.js';
|
|
1
|
+
import type { SignDecryptionPermitParameters } from '../../kms/SignedDecryptionPermit-p.js';
|
|
6
2
|
import type { Fhevm } from '../../types/coreFhevmClient.js';
|
|
7
3
|
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
8
|
-
import type {
|
|
9
|
-
SignedDecryptionPermit,
|
|
10
|
-
SignedDelegatedDecryptionPermit,
|
|
11
|
-
SignedSelfDecryptionPermit,
|
|
12
|
-
} from '../../types/signedDecryptionPermit.js';
|
|
4
|
+
import type { SignedDecryptionPermit } from '../../types/signedDecryptionPermit.js';
|
|
13
5
|
import { signDecryptionPermit as signDecryptionPermit_ } from '../../kms/SignedDecryptionPermit-p.js';
|
|
14
6
|
|
|
15
|
-
export type {
|
|
16
|
-
SignDecryptionPermitParameters,
|
|
17
|
-
SignSelfDecryptionPermitParameters,
|
|
18
|
-
SignDelegatedDecryptionPermitParameters,
|
|
19
|
-
};
|
|
7
|
+
export type { SignDecryptionPermitParameters };
|
|
20
8
|
export type SignDecryptionPermitReturnType = SignedDecryptionPermit;
|
|
21
9
|
|
|
22
|
-
export async function signDecryptionPermit(
|
|
23
|
-
fhevm: Fhevm<FhevmChain>,
|
|
24
|
-
parameters: SignSelfDecryptionPermitParameters,
|
|
25
|
-
): Promise<SignedSelfDecryptionPermit>;
|
|
26
|
-
|
|
27
|
-
export async function signDecryptionPermit(
|
|
28
|
-
fhevm: Fhevm<FhevmChain>,
|
|
29
|
-
parameters: SignDelegatedDecryptionPermitParameters,
|
|
30
|
-
): Promise<SignedDelegatedDecryptionPermit>;
|
|
31
|
-
|
|
32
10
|
export async function signDecryptionPermit(
|
|
33
11
|
fhevm: Fhevm<FhevmChain>,
|
|
34
12
|
parameters: SignDecryptionPermitParameters,
|
|
35
13
|
): Promise<SignedDecryptionPermit> {
|
|
36
|
-
// The public overloads guarantee the correct pairing.
|
|
37
|
-
// The if/else narrows parameters via delegatorAddress, so TS can match each branch
|
|
38
|
-
// to the correct overload of signDecryptionPermit_ without any casts.
|
|
39
|
-
if (parameters.delegatorAddress !== undefined) {
|
|
40
|
-
return signDecryptionPermit_(fhevm, parameters);
|
|
41
|
-
}
|
|
42
14
|
return signDecryptionPermit_(fhevm, parameters);
|
|
43
15
|
}
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
export {
|
|
2
|
-
type VerifyKmsDelegatedUserDecryptEip712Parameters,
|
|
3
|
-
verifyKmsDelegatedUserDecryptEip712,
|
|
4
|
-
} from './verifyKmsDelegatedUserDecryptEip712.js';
|
|
5
|
-
|
|
6
|
-
export { type CreateKmsEIP712DomainReturnType, createKmsEIP712Domain } from './createKmsEip712Domain.js';
|
|
7
|
-
|
|
8
1
|
export {
|
|
9
2
|
type FetchFheEncryptionKeyBytesParameters,
|
|
10
3
|
type FetchFheEncryptionKeyBytesReturnType,
|
|
@@ -23,33 +16,12 @@ export {
|
|
|
23
16
|
serializeTransportKeyPair,
|
|
24
17
|
} from './serializeTransportKeyPair.js';
|
|
25
18
|
|
|
26
|
-
export {
|
|
27
|
-
type CreateKmsDelegatedUserDecryptEip712Parameters,
|
|
28
|
-
type CreateKmsDelegatedUserDecryptEip712ReturnType,
|
|
29
|
-
createKmsDelegatedUserDecryptEip712,
|
|
30
|
-
} from './createKmsDelegatedUserDecryptEip712.js';
|
|
31
|
-
|
|
32
|
-
export { type VerifyKmsUserDecryptEip712Parameters, verifyKmsUserDecryptEip712 } from './verifyKmsUserDecryptEip712.js';
|
|
33
|
-
|
|
34
|
-
export {
|
|
35
|
-
type CreateCoprocessorEip712DomainReturnType,
|
|
36
|
-
createCoprocessorEip712Domain,
|
|
37
|
-
} from './createCoprocessorEip712Domain.js';
|
|
38
|
-
|
|
39
19
|
export {
|
|
40
20
|
type SignDecryptionPermitParameters,
|
|
41
|
-
type SignSelfDecryptionPermitParameters,
|
|
42
|
-
type SignDelegatedDecryptionPermitParameters,
|
|
43
21
|
type SignDecryptionPermitReturnType,
|
|
44
22
|
signDecryptionPermit,
|
|
45
23
|
} from '../base/signDecryptionPermit.js';
|
|
46
24
|
|
|
47
|
-
export {
|
|
48
|
-
type CreateKmsUserDecryptEip712Parameters,
|
|
49
|
-
type CreateKmsUserDecryptEip712ReturnType,
|
|
50
|
-
createKmsUserDecryptEip712,
|
|
51
|
-
} from './createKmsUserDecryptEip712.js';
|
|
52
|
-
|
|
53
25
|
export {
|
|
54
26
|
type SerializeSignedDecryptionPermitParameters,
|
|
55
27
|
type SerializeSignedDecryptionPermitReturnType,
|
|
@@ -10,6 +10,7 @@ import { parseSignedDecryptionPermit as parseSignedDecryptionPermit_ } from '../
|
|
|
10
10
|
export type ParseSignedDecryptionPermitParameters = {
|
|
11
11
|
/** The serialized permit — a previously parsed permit object. */
|
|
12
12
|
readonly serializedPermit: {
|
|
13
|
+
readonly version: number;
|
|
13
14
|
readonly eip712: Eip712Like;
|
|
14
15
|
readonly signature: string;
|
|
15
16
|
readonly signerAddress: string;
|
|
@@ -2,7 +2,7 @@ import type { Fhevm, OptionalNativeClient } from '../../types/coreFhevmClient.js
|
|
|
2
2
|
import type { FhevmRuntime } from '../../types/coreFhevmRuntime.js';
|
|
3
3
|
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
4
4
|
import type { SignedDecryptionPermit } from '../../types/signedDecryptionPermit.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { Eip712Like } from '../../types/kms.js';
|
|
6
6
|
import { serializeSignedDecryptionPermitToJSON } from '../../kms/SignedDecryptionPermit-p.js';
|
|
7
7
|
|
|
8
8
|
////////////////////////////////////////////////////////////////////////////////
|
|
@@ -12,7 +12,8 @@ export type SerializeSignedDecryptionPermitParameters = {
|
|
|
12
12
|
};
|
|
13
13
|
|
|
14
14
|
export type SerializeSignedDecryptionPermitReturnType = {
|
|
15
|
-
readonly
|
|
15
|
+
readonly version: number;
|
|
16
|
+
readonly eip712: Eip712Like;
|
|
16
17
|
readonly signature: string;
|
|
17
18
|
readonly signerAddress: string;
|
|
18
19
|
};
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
2
1
|
import type { Fhevm } from '../../types/coreFhevmClient.js';
|
|
3
2
|
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
4
|
-
import type {
|
|
5
|
-
SignedDelegatedDecryptionPermit,
|
|
6
|
-
SignedSelfDecryptionPermit,
|
|
7
|
-
} from '../../types/signedDecryptionPermit.js';
|
|
3
|
+
import type { SignedDecryptionPermit } from '../../types/signedDecryptionPermit.js';
|
|
8
4
|
import type { TransportKeyPair } from '../../kms/TransportKeyPair-p.js';
|
|
9
5
|
import type { EncryptedValueLike } from '../../types/encryptedTypes.js';
|
|
10
6
|
import { canDecryptValuesFromPairs as canDecryptValuesFromPairs_ } from '../../host-contracts/canDecryptValuesFromPairs.js';
|
|
@@ -23,7 +19,7 @@ export type CanDecryptValueWithUserAddressParameters = CanDecryptValueParameters
|
|
|
23
19
|
};
|
|
24
20
|
|
|
25
21
|
export type CanDecryptValueWithPermitParameters = CanDecryptValueParametersBase & {
|
|
26
|
-
readonly signedPermit:
|
|
22
|
+
readonly signedPermit: SignedDecryptionPermit;
|
|
27
23
|
readonly transportKeyPair?: TransportKeyPair | undefined;
|
|
28
24
|
};
|
|
29
25
|
|
|
@@ -77,16 +73,6 @@ export type CanDecryptValueReturnType = {
|
|
|
77
73
|
* - the target user address and `contractAddress` must be different
|
|
78
74
|
*/
|
|
79
75
|
|
|
80
|
-
export async function canDecryptValue(
|
|
81
|
-
fhevm: Fhevm<FhevmChain>,
|
|
82
|
-
parameters: CanDecryptValueWithUserAddressParameters,
|
|
83
|
-
): Promise<CanDecryptValueReturnType>;
|
|
84
|
-
|
|
85
|
-
export async function canDecryptValue(
|
|
86
|
-
fhevm: Fhevm<FhevmChain>,
|
|
87
|
-
parameters: CanDecryptValueWithPermitParameters,
|
|
88
|
-
): Promise<CanDecryptValueReturnType>;
|
|
89
|
-
|
|
90
76
|
export async function canDecryptValue(
|
|
91
77
|
fhevm: Fhevm<FhevmChain>,
|
|
92
78
|
parameters: CanDecryptValueWithUserAddressParameters | CanDecryptValueWithPermitParameters,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
2
1
|
import type { Fhevm } from '../../types/coreFhevmClient.js';
|
|
3
2
|
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
4
|
-
import type {
|
|
5
|
-
SignedDelegatedDecryptionPermit,
|
|
6
|
-
SignedSelfDecryptionPermit,
|
|
7
|
-
} from '../../types/signedDecryptionPermit.js';
|
|
3
|
+
import type { SignedDecryptionPermit } from '../../types/signedDecryptionPermit.js';
|
|
8
4
|
import type { TransportKeyPair } from '../../kms/TransportKeyPair-p.js';
|
|
9
5
|
import type { EncryptedValueLike } from '../../types/encryptedTypes.js';
|
|
10
6
|
import { canDecryptValuesFromPairs as canDecryptValuesFromPairs_ } from '../../host-contracts/canDecryptValuesFromPairs.js';
|
|
@@ -23,7 +19,7 @@ export type CanDecryptValuesWithUserAddressParameters = CanDecryptValuesParamete
|
|
|
23
19
|
};
|
|
24
20
|
|
|
25
21
|
export type CanDecryptValuesWithPermitParameters = CanDecryptValuesParametersBase & {
|
|
26
|
-
readonly signedPermit:
|
|
22
|
+
readonly signedPermit: SignedDecryptionPermit;
|
|
27
23
|
readonly transportKeyPair?: TransportKeyPair | undefined;
|
|
28
24
|
};
|
|
29
25
|
|
|
@@ -37,16 +33,6 @@ export type CanDecryptValuesReturnType = {
|
|
|
37
33
|
|
|
38
34
|
////////////////////////////////////////////////////////////////////////////////
|
|
39
35
|
|
|
40
|
-
export async function canDecryptValues(
|
|
41
|
-
fhevm: Fhevm<FhevmChain>,
|
|
42
|
-
parameters: CanDecryptValuesWithUserAddressParameters,
|
|
43
|
-
): Promise<CanDecryptValuesReturnType>;
|
|
44
|
-
|
|
45
|
-
export async function canDecryptValues(
|
|
46
|
-
fhevm: Fhevm<FhevmChain>,
|
|
47
|
-
parameters: CanDecryptValuesWithPermitParameters,
|
|
48
|
-
): Promise<CanDecryptValuesReturnType>;
|
|
49
|
-
|
|
50
36
|
export async function canDecryptValues(
|
|
51
37
|
fhevm: Fhevm<FhevmChain>,
|
|
52
38
|
parameters: CanDecryptValuesWithUserAddressParameters | CanDecryptValuesWithPermitParameters,
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/unified-signatures */
|
|
2
1
|
import type { Fhevm } from '../../types/coreFhevmClient.js';
|
|
3
2
|
import type { FhevmChain } from '../../types/fhevmChain.js';
|
|
4
|
-
import type {
|
|
5
|
-
SignedDelegatedDecryptionPermit,
|
|
6
|
-
SignedSelfDecryptionPermit,
|
|
7
|
-
} from '../../types/signedDecryptionPermit.js';
|
|
3
|
+
import type { SignedDecryptionPermit } from '../../types/signedDecryptionPermit.js';
|
|
8
4
|
import type { TransportKeyPair } from '../../kms/TransportKeyPair-p.js';
|
|
9
5
|
import type { EncryptedValueLike } from '../../types/encryptedTypes.js';
|
|
10
6
|
import { canDecryptValuesFromPairs as canDecryptValuesFromPairs_ } from '../../host-contracts/canDecryptValuesFromPairs.js';
|
|
@@ -25,7 +21,7 @@ export type CanDecryptValuesFromPairsWithUserAddressParameters = CanDecryptValue
|
|
|
25
21
|
};
|
|
26
22
|
|
|
27
23
|
export type CanDecryptValuesFromPairsWithPermitParameters = CanDecryptValuesFromPairsParametersBase & {
|
|
28
|
-
readonly signedPermit:
|
|
24
|
+
readonly signedPermit: SignedDecryptionPermit;
|
|
29
25
|
readonly transportKeyPair?: TransportKeyPair | undefined;
|
|
30
26
|
};
|
|
31
27
|
|
|
@@ -39,16 +35,6 @@ export type CanDecryptValuesFromPairsReturnType = {
|
|
|
39
35
|
|
|
40
36
|
////////////////////////////////////////////////////////////////////////////////
|
|
41
37
|
|
|
42
|
-
export async function canDecryptValuesFromPairs(
|
|
43
|
-
fhevm: Fhevm<FhevmChain>,
|
|
44
|
-
parameters: CanDecryptValuesFromPairsWithUserAddressParameters,
|
|
45
|
-
): Promise<CanDecryptValuesFromPairsReturnType>;
|
|
46
|
-
|
|
47
|
-
export async function canDecryptValuesFromPairs(
|
|
48
|
-
fhevm: Fhevm<FhevmChain>,
|
|
49
|
-
parameters: CanDecryptValuesFromPairsWithPermitParameters,
|
|
50
|
-
): Promise<CanDecryptValuesFromPairsReturnType>;
|
|
51
|
-
|
|
52
38
|
export async function canDecryptValuesFromPairs(
|
|
53
39
|
fhevm: Fhevm<FhevmChain>,
|
|
54
40
|
parameters: CanDecryptValuesFromPairsWithUserAddressParameters | CanDecryptValuesFromPairsWithPermitParameters,
|
|
@@ -38,6 +38,7 @@ export async function decryptValue(
|
|
|
38
38
|
{
|
|
39
39
|
handle: toFhevmHandle(encryptedValue),
|
|
40
40
|
contractAddress: sanitizedContractAddress,
|
|
41
|
+
ownerAddress: addressToChecksummedAddress(parameters.signedPermit.encryptedDataOwnerAddress),
|
|
41
42
|
},
|
|
42
43
|
];
|
|
43
44
|
|
|
@@ -46,7 +47,7 @@ export async function decryptValue(
|
|
|
46
47
|
const typedValues = await decryptValuesFromPairs_(f, {
|
|
47
48
|
...rest,
|
|
48
49
|
pairs: sanitizedPairs,
|
|
49
|
-
}
|
|
50
|
+
});
|
|
50
51
|
|
|
51
52
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
52
53
|
return typedValues[0]!;
|
|
@@ -34,10 +34,12 @@ export async function decryptValues(
|
|
|
34
34
|
assertIsAddress(contractAddress, {});
|
|
35
35
|
const sanitizedContractAddress = addressToChecksummedAddress(contractAddress);
|
|
36
36
|
|
|
37
|
+
const ownerAddress = addressToChecksummedAddress(parameters.signedPermit.encryptedDataOwnerAddress);
|
|
37
38
|
const sanitizedPairs = encryptedValues.map((ev) => {
|
|
38
39
|
return {
|
|
39
40
|
handle: toFhevmHandle(ev),
|
|
40
41
|
contractAddress: sanitizedContractAddress,
|
|
42
|
+
ownerAddress,
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
|
|
@@ -46,5 +48,5 @@ export async function decryptValues(
|
|
|
46
48
|
return decryptValuesFromPairs_(f, {
|
|
47
49
|
...rest,
|
|
48
50
|
pairs: sanitizedPairs,
|
|
49
|
-
}
|
|
51
|
+
});
|
|
50
52
|
}
|
|
@@ -33,11 +33,13 @@ export async function decryptValuesFromPairs(
|
|
|
33
33
|
): Promise<DecryptValuesFromPairsReturnType> {
|
|
34
34
|
const { pairs, ...rest } = parameters;
|
|
35
35
|
|
|
36
|
+
const ownerAddress = addressToChecksummedAddress(parameters.signedPermit.encryptedDataOwnerAddress);
|
|
36
37
|
const sanitizedPairs = pairs.map((pair) => {
|
|
37
38
|
assertIsAddress(pair.contractAddress, {});
|
|
38
39
|
return {
|
|
39
40
|
handle: toFhevmHandle(pair.encryptedValue),
|
|
40
41
|
contractAddress: addressToChecksummedAddress(pair.contractAddress),
|
|
42
|
+
ownerAddress,
|
|
41
43
|
};
|
|
42
44
|
});
|
|
43
45
|
|
|
@@ -46,5 +48,5 @@ export async function decryptValuesFromPairs(
|
|
|
46
48
|
return decryptValuesFromPairs_(f, {
|
|
47
49
|
...rest,
|
|
48
50
|
pairs: sanitizedPairs,
|
|
49
|
-
}
|
|
51
|
+
});
|
|
50
52
|
}
|
|
@@ -16,12 +16,6 @@ export { type DecryptValueParameters, type DecryptValueReturnType, decryptValue
|
|
|
16
16
|
|
|
17
17
|
export { type DecryptValuesParameters, type DecryptValuesReturnType, decryptValues } from './decryptValues.js';
|
|
18
18
|
|
|
19
|
-
export {
|
|
20
|
-
type DecryptKmsSigncryptedSharesParameters,
|
|
21
|
-
type DecryptKmsSigncryptedSharesReturnType,
|
|
22
|
-
decryptKmsSigncryptedShares,
|
|
23
|
-
} from './decryptKmsSigncryptedShares.js';
|
|
24
|
-
|
|
25
19
|
export {
|
|
26
20
|
type CanDecryptValuesFromPairsWithUserAddressParameters,
|
|
27
21
|
type CanDecryptValuesFromPairsWithPermitParameters,
|
|
@@ -10,24 +10,4 @@ export {
|
|
|
10
10
|
isAllowedForDecryption,
|
|
11
11
|
} from './isAllowedForDecryption.js';
|
|
12
12
|
|
|
13
|
-
export { type ResolveChainIdParameters, type ResolveChainIdReturnType, resolveChainId } from './resolveChainId.js';
|
|
14
|
-
|
|
15
|
-
export {
|
|
16
|
-
type ReadFhevmExecutorContractDataParameters,
|
|
17
|
-
type ReadFhevmExecutorContractDataReturnType,
|
|
18
|
-
readFhevmExecutorContractData,
|
|
19
|
-
} from './readFhevmExecutorContractData.js';
|
|
20
|
-
|
|
21
|
-
export {
|
|
22
|
-
type ReadKmsVerifierContractDataParameters,
|
|
23
|
-
type ReadKmsVerifierContractDataReturnType,
|
|
24
|
-
readKmsVerifierContractData,
|
|
25
|
-
} from './readKmsVerifierContractData.js';
|
|
26
|
-
|
|
27
13
|
export { type PersistAllowedParameters, type PersistAllowedReturnType, persistAllowed } from './persistAllowed.js';
|
|
28
|
-
|
|
29
|
-
export {
|
|
30
|
-
type ReadInputVerifierContractDataParameters,
|
|
31
|
-
type ReadInputVerifierContractDataReturnType,
|
|
32
|
-
readInputVerifierContractData,
|
|
33
|
-
} from './readInputVerifierContractData.js';
|
package/core/base/cachedFetch.ts
CHANGED
|
@@ -23,6 +23,7 @@ type CachedFetchOptions<TContext, TParams, TResult> = {
|
|
|
23
23
|
};
|
|
24
24
|
|
|
25
25
|
export const CACHE_TTL_24H = 24 * 60 * 60 * 1000; // 24 hours
|
|
26
|
+
export const CACHE_TTL_15MIN = 15 * 1000; // 15 min
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* Creates a cached, deduplicating wrapper around an async fetch function.
|
package/core/base/uint.ts
CHANGED
|
@@ -23,7 +23,12 @@ import type {
|
|
|
23
23
|
UintTypeName,
|
|
24
24
|
ValueTypeName,
|
|
25
25
|
} from '../types/primitives.js';
|
|
26
|
-
import type {
|
|
26
|
+
import type {
|
|
27
|
+
RecordWithPropertyType,
|
|
28
|
+
RecordUintPropertyType,
|
|
29
|
+
RecordUint256PropertyType,
|
|
30
|
+
RecordUintNumberPropertyType,
|
|
31
|
+
} from '../types/record-p.js';
|
|
27
32
|
import type { ErrorMetadataParams } from './errors/ErrorBase.js';
|
|
28
33
|
import { isRecordNonNullableProperty, typeofProperty } from './record.js';
|
|
29
34
|
import { InvalidPropertyError } from './errors/InvalidPropertyError.js';
|
|
@@ -615,6 +620,18 @@ export function assertRecordUintProperty<K extends string>(
|
|
|
615
620
|
|
|
616
621
|
////////////////////////////////////////////////////////////////////////////////
|
|
617
622
|
|
|
623
|
+
export function isRecordUintNumberProperty<K extends string>(
|
|
624
|
+
record: unknown,
|
|
625
|
+
property: K,
|
|
626
|
+
): record is RecordUintNumberPropertyType<K> {
|
|
627
|
+
if (!isRecordNonNullableProperty(record, property)) {
|
|
628
|
+
return false;
|
|
629
|
+
}
|
|
630
|
+
return isUintNumber(record[property]);
|
|
631
|
+
}
|
|
632
|
+
|
|
633
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
634
|
+
|
|
618
635
|
export function isRecordUint256Property<K extends string>(
|
|
619
636
|
record: unknown,
|
|
620
637
|
property: K,
|