@fhevm/sdk 1.1.0-alpha.6 → 1.1.0-alpha.8
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 +5 -5
- 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/encrypt/encryptValue.js +2 -1
- package/_cjs/core/actions/encrypt/encryptValue.js.map +1 -1
- package/_cjs/core/actions/encrypt/encryptValues.js +2 -1
- package/_cjs/core/actions/encrypt/encryptValues.js.map +1 -1
- package/_cjs/core/actions/encrypt/generateZkProof.js +2 -1
- package/_cjs/core/actions/encrypt/generateZkProof.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/actions/host/readKmsVerifierContractData.js +1 -1
- package/_cjs/core/actions/host/readKmsVerifierContractData.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/handle/FheType.js +4 -0
- package/_cjs/core/handle/FheType.js.map +1 -1
- package/_cjs/core/host-contracts/HostContractVersion-p.js +4 -0
- package/_cjs/core/host-contracts/HostContractVersion-p.js.map +1 -1
- package/_cjs/core/host-contracts/KmsSignersContext-p.js +15 -25
- package/_cjs/core/host-contracts/KmsSignersContext-p.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/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +7 -6
- package/_cjs/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -1
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js +54 -66
- package/_cjs/core/host-contracts/readKmsSignersContext-p.js.map +1 -1
- package/_cjs/core/kms/KmsSigncryptedShares-p.js +40 -4
- package/_cjs/core/kms/KmsSigncryptedShares-p.js.map +1 -1
- package/_cjs/core/kms/PublicDecryptionProof-p.js +8 -7
- package/_cjs/core/kms/PublicDecryptionProof-p.js.map +1 -1
- 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 +204 -0
- package/_cjs/core/kms/SignedDecryptionPermitV1-p.js.map +1 -0
- package/_cjs/core/kms/SignedDecryptionPermitV2-p.js +172 -0
- package/_cjs/core/kms/SignedDecryptionPermitV2-p.js.map +1 -0
- package/_cjs/core/kms/{createKmsDelegatedUserDecryptEip712.js → createKmsDelegatedUserDecryptEip712V1.js} +12 -13
- package/_cjs/core/kms/createKmsDelegatedUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/kms/{createKmsUserDecryptEip712.js → createKmsUserDecryptEip712V1.js} +22 -21
- package/_cjs/core/kms/createKmsUserDecryptEip712V1.js.map +1 -0
- package/_cjs/core/kms/createKmsUserDecryptEip712V2.js +4 -5
- package/_cjs/core/kms/createKmsUserDecryptEip712V2.js.map +1 -1
- 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} +19 -9
- 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/kmsExtraData-p.js +234 -0
- package/_cjs/core/kms/kmsExtraData-p.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 +5 -5
- package/_cjs/core/kms/publicDecrypt.js.map +1 -1
- package/_cjs/core/kms/utils.js +0 -19
- package/_cjs/core/kms/utils.js.map +1 -1
- package/_cjs/core/kms/verifyKmsPublicDecryptEip712-p.js +6 -5
- package/_cjs/core/kms/verifyKmsPublicDecryptEip712-p.js.map +1 -1
- package/_cjs/core/modules/decrypt/mock.js +6 -6
- package/_cjs/core/modules/decrypt/mock.js.map +1 -1
- package/_cjs/core/modules/decrypt/module/api-p.js +12 -12
- package/_cjs/core/modules/decrypt/module/api-p.js.map +1 -1
- 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/fetchCoprocessorSignatures.js +53 -3
- package/_cjs/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/{fetchDelegatedUserDecrypt.js → fetchDelegatedUserDecryptV1.js} +67 -21
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecryptV1.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchPublicDecrypt.js +64 -7
- package/_cjs/core/modules/relayer/cleartext/fetchPublicDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js +9 -108
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecryptV1.js +163 -0
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecryptV1.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecryptV2.js +7 -0
- package/_cjs/core/modules/relayer/cleartext/fetchUserDecryptV2.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/forgeFhevmV1.js +83 -0
- package/_cjs/core/modules/relayer/cleartext/forgeFhevmV1.js.map +1 -0
- package/_cjs/core/modules/relayer/cleartext/mock.js +2 -2
- package/_cjs/core/modules/relayer/cleartext/mock.js.map +1 -1
- package/_cjs/core/modules/relayer/cleartext/signers.js +14 -0
- package/_cjs/core/modules/relayer/cleartext/signers.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/ethers/internal/ethereum-ct.js +11 -0
- package/_cjs/ethers/internal/ethereum-ct.js.map +1 -1
- package/_cjs/ethers/internal/runtime-ct.js +9 -7
- package/_cjs/ethers/internal/runtime-ct.js.map +1 -1
- package/_cjs/viem/internal/ethereum-ct.js +8 -0
- package/_cjs/viem/internal/ethereum-ct.js.map +1 -1
- package/_cjs/viem/internal/runtime-ct.js +9 -7
- package/_cjs/viem/internal/runtime-ct.js.map +1 -1
- 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/encrypt/encryptValue.js +2 -1
- package/_esm/core/actions/encrypt/encryptValue.js.map +1 -1
- package/_esm/core/actions/encrypt/encryptValues.js +2 -1
- package/_esm/core/actions/encrypt/encryptValues.js.map +1 -1
- package/_esm/core/actions/encrypt/generateZkProof.js +2 -1
- package/_esm/core/actions/encrypt/generateZkProof.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/actions/host/readKmsVerifierContractData.js +2 -2
- package/_esm/core/actions/host/readKmsVerifierContractData.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/handle/FheType.js +10 -0
- package/_esm/core/handle/FheType.js.map +1 -1
- package/_esm/core/host-contracts/HostContractVersion-p.js +6 -0
- package/_esm/core/host-contracts/HostContractVersion-p.js.map +1 -1
- package/_esm/core/host-contracts/KmsSignersContext-p.js +16 -25
- package/_esm/core/host-contracts/KmsSignersContext-p.js.map +1 -1
- 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/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js +6 -5
- package/_esm/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.js.map +1 -1
- package/_esm/core/host-contracts/readKmsSignersContext-p.js +132 -68
- package/_esm/core/host-contracts/readKmsSignersContext-p.js.map +1 -1
- package/_esm/core/kms/KmsSigncryptedShares-p.js +70 -4
- package/_esm/core/kms/KmsSigncryptedShares-p.js.map +1 -1
- package/_esm/core/kms/PublicDecryptionProof-p.js +8 -7
- package/_esm/core/kms/PublicDecryptionProof-p.js.map +1 -1
- 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 +228 -0
- package/_esm/core/kms/SignedDecryptionPermitV1-p.js.map +1 -0
- package/_esm/core/kms/SignedDecryptionPermitV2-p.js +192 -0
- package/_esm/core/kms/SignedDecryptionPermitV2-p.js.map +1 -0
- package/_esm/core/kms/{createKmsDelegatedUserDecryptEip712.js → createKmsDelegatedUserDecryptEip712V1.js} +11 -12
- 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} +23 -22
- package/_esm/core/kms/createKmsUserDecryptEip712V1.js.map +1 -0
- package/_esm/core/kms/createKmsUserDecryptEip712V2.js +4 -5
- package/_esm/core/kms/createKmsUserDecryptEip712V2.js.map +1 -1
- 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} +49 -15
- 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/kmsExtraData-p.js +298 -0
- package/_esm/core/kms/kmsExtraData-p.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 +6 -6
- package/_esm/core/kms/publicDecrypt.js.map +1 -1
- package/_esm/core/kms/utils.js +0 -18
- package/_esm/core/kms/utils.js.map +1 -1
- package/_esm/core/kms/verifyKmsPublicDecryptEip712-p.js +7 -6
- package/_esm/core/kms/verifyKmsPublicDecryptEip712-p.js.map +1 -1
- package/_esm/core/modules/decrypt/mock.js +6 -6
- package/_esm/core/modules/decrypt/mock.js.map +1 -1
- package/_esm/core/modules/decrypt/module/api-p.js +13 -13
- package/_esm/core/modules/decrypt/module/api-p.js.map +1 -1
- 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/fetchCoprocessorSignatures.js +69 -12
- package/_esm/core/modules/relayer/cleartext/fetchCoprocessorSignatures.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/{fetchDelegatedUserDecrypt.js → fetchDelegatedUserDecryptV1.js} +76 -22
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecryptV1.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchPublicDecrypt.js +80 -7
- package/_esm/core/modules/relayer/cleartext/fetchPublicDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js +13 -114
- package/_esm/core/modules/relayer/cleartext/fetchUserDecrypt.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/fetchUserDecryptV1.js +173 -0
- package/_esm/core/modules/relayer/cleartext/fetchUserDecryptV1.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/fetchUserDecryptV2.js +6 -0
- package/_esm/core/modules/relayer/cleartext/fetchUserDecryptV2.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/forgeFhevmV1.js +140 -0
- package/_esm/core/modules/relayer/cleartext/forgeFhevmV1.js.map +1 -0
- package/_esm/core/modules/relayer/cleartext/mock.js +1 -1
- package/_esm/core/modules/relayer/cleartext/mock.js.map +1 -1
- package/_esm/core/modules/relayer/cleartext/signers.js +26 -0
- package/_esm/core/modules/relayer/cleartext/signers.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/_esm/ethers/internal/ethereum-ct.js +12 -1
- package/_esm/ethers/internal/ethereum-ct.js.map +1 -1
- package/_esm/ethers/internal/runtime-ct.js +9 -7
- package/_esm/ethers/internal/runtime-ct.js.map +1 -1
- package/_esm/viem/internal/ethereum-ct.js +10 -2
- package/_esm/viem/internal/ethereum-ct.js.map +1 -1
- package/_esm/viem/internal/runtime-ct.js +9 -7
- package/_esm/viem/internal/runtime-ct.js.map +1 -1
- 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/encrypt/encryptValue.d.ts.map +1 -1
- package/_types/core/actions/encrypt/encryptValues.d.ts.map +1 -1
- package/_types/core/actions/encrypt/generateZkProof.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/handle/FheType.d.ts +8 -0
- package/_types/core/handle/FheType.d.ts.map +1 -1
- package/_types/core/host-contracts/HostContractVersion-p.d.ts +8 -0
- package/_types/core/host-contracts/HostContractVersion-p.d.ts.map +1 -1
- package/_types/core/host-contracts/KmsSignersContext-p.d.ts +3 -2
- package/_types/core/host-contracts/KmsSignersContext-p.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/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts +3 -2
- package/_types/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.d.ts.map +1 -1
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts +43 -26
- package/_types/core/host-contracts/readKmsSignersContext-p.d.ts.map +1 -1
- package/_types/core/kms/KmsSigncryptedShares-p.d.ts +18 -0
- package/_types/core/kms/KmsSigncryptedShares-p.d.ts.map +1 -1
- package/_types/core/kms/PublicDecryptionProof-p.d.ts +1 -1
- package/_types/core/kms/PublicDecryptionProof-p.d.ts.map +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 +16 -0
- package/_types/core/kms/createKmsDelegatedUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/kms/createKmsUserDecryptEip712V1.d.ts +27 -0
- package/_types/core/kms/createKmsUserDecryptEip712V1.d.ts.map +1 -0
- package/_types/core/kms/createKmsUserDecryptEip712V2.d.ts +3 -2
- 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/kmsExtraData-p.d.ts +66 -0
- package/_types/core/kms/kmsExtraData-p.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/publicDecrypt.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/kms/verifyKmsPublicDecryptEip712-p.d.ts.map +1 -1
- package/_types/core/modules/encrypt/module/init-p.d.ts.map +1 -1
- package/_types/core/modules/ethereum/types-ct.d.ts +20 -2
- package/_types/core/modules/ethereum/types-ct.d.ts.map +1 -1
- package/_types/core/modules/relayer/cleartext/fetchCoprocessorSignatures.d.ts.map +1 -1
- package/_types/core/modules/relayer/cleartext/{fetchDelegatedUserDecrypt.d.ts → fetchDelegatedUserDecryptV1.d.ts} +1 -1
- package/_types/core/modules/relayer/cleartext/fetchDelegatedUserDecryptV1.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchPublicDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/cleartext/fetchUserDecrypt.d.ts.map +1 -1
- package/_types/core/modules/relayer/cleartext/fetchUserDecryptV1.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchUserDecryptV1.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/fetchUserDecryptV2.d.ts +3 -0
- package/_types/core/modules/relayer/cleartext/fetchUserDecryptV2.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/forgeFhevmV1.d.ts +29 -0
- package/_types/core/modules/relayer/cleartext/forgeFhevmV1.d.ts.map +1 -0
- package/_types/core/modules/relayer/cleartext/signers.d.ts +1 -0
- package/_types/core/modules/relayer/cleartext/signers.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-p.d.ts +7 -1
- package/_types/core/types/kms-p.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/_types/ethers/internal/ethereum-ct.d.ts.map +1 -1
- package/_types/ethers/internal/runtime-ct.d.ts.map +1 -1
- package/_types/viem/internal/ethereum-ct.d.ts.map +1 -1
- package/_types/viem/internal/runtime-ct.d.ts.map +1 -1
- 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/encrypt/encryptValue.ts +4 -1
- package/core/actions/encrypt/encryptValues.ts +5 -1
- package/core/actions/encrypt/generateZkProof.ts +2 -1
- package/core/actions/host/index.ts +0 -20
- package/core/actions/host/readKmsVerifierContractData.ts +2 -2
- 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/handle/FheType.ts +11 -0
- package/core/host-contracts/HostContractVersion-p.ts +12 -0
- package/core/host-contracts/KmsSignersContext-p.ts +29 -36
- 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 +3 -2
- package/core/host-contracts/getKmsContextSignersAndThresholdFromExtraData-p.ts +10 -7
- package/core/host-contracts/readKmsSignersContext-p.ts +156 -115
- package/core/kms/KmsSigncryptedShares-p.ts +87 -4
- package/core/kms/PublicDecryptionProof-p.ts +11 -9
- package/core/kms/SignedDecryptionPermit-p.ts +67 -357
- package/core/kms/SignedDecryptionPermitV1-p.ts +308 -0
- package/core/kms/SignedDecryptionPermitV2-p.ts +275 -0
- package/core/kms/{createKmsDelegatedUserDecryptEip712.ts → createKmsDelegatedUserDecryptEip712V1.ts} +21 -21
- package/core/kms/createKmsPublicDecryptEip712.ts +1 -1
- package/core/kms/{createKmsUserDecryptEip712.ts → createKmsUserDecryptEip712V1.ts} +35 -31
- package/core/kms/createKmsUserDecryptEip712V2.ts +7 -7
- package/core/kms/decryptValuesFromPairs.ts +34 -22
- package/core/kms/{fetchKmsSigncryptedShares-p.ts → fetchKmsSigncryptedSharesV1-p.ts} +62 -45
- package/core/kms/fetchKmsSigncryptedSharesV2-p.ts +176 -0
- package/core/kms/{kmsDelegatedUserDecryptEip712Types.ts → kmsDelegatedUserDecryptEip712V1Types.ts} +9 -8
- package/core/kms/kmsExtraData-p.ts +374 -0
- 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 +10 -9
- package/core/kms/utils.ts +0 -32
- package/core/kms/verifyKmsPublicDecryptEip712-p.ts +10 -8
- package/core/modules/decrypt/mock.ts +6 -6
- package/core/modules/decrypt/module/api-p.ts +15 -15
- package/core/modules/decrypt/module/init-p.ts +7 -7
- package/core/modules/encrypt/module/init-p.ts +16 -11
- package/core/modules/ethereum/types-ct.ts +25 -2
- package/core/modules/relayer/cleartext/fetchCoprocessorSignatures.ts +98 -15
- package/core/modules/relayer/cleartext/{fetchDelegatedUserDecrypt.ts → fetchDelegatedUserDecryptV1.ts} +115 -27
- package/core/modules/relayer/cleartext/fetchPublicDecrypt.ts +115 -9
- package/core/modules/relayer/cleartext/fetchUserDecrypt.ts +23 -131
- package/core/modules/relayer/cleartext/fetchUserDecryptV1.ts +229 -0
- package/core/modules/relayer/cleartext/fetchUserDecryptV2.ts +11 -0
- package/core/modules/relayer/cleartext/forgeFhevmV1.ts +185 -0
- package/core/modules/relayer/cleartext/mock.ts +1 -1
- package/core/modules/relayer/cleartext/signers.ts +35 -0
- 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-p.ts +16 -1
- 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/ethers/internal/ethereum-ct.ts +15 -1
- package/ethers/internal/runtime-ct.ts +9 -7
- package/package.json +1 -1
- package/viem/internal/ethereum-ct.ts +14 -2
- package/viem/internal/runtime-ct.ts +9 -7
- 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/kmsExtraData.js +0 -82
- package/_cjs/core/kms/kmsExtraData.js.map +0 -1
- package/_cjs/core/kms/kmsUserDecryptEip712Types.js.map +0 -1
- package/_cjs/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.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/kmsExtraData.js +0 -99
- package/_esm/core/kms/kmsExtraData.js.map +0 -1
- package/_esm/core/kms/kmsUserDecryptEip712Types.js.map +0 -1
- package/_esm/core/modules/relayer/cleartext/fetchDelegatedUserDecrypt.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/kmsExtraData.d.ts +0 -25
- package/_types/core/kms/kmsExtraData.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/cleartext/fetchDelegatedUserDecrypt.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/kms/kmsExtraData.ts +0 -127
- /package/core/modules/relayer/module/{fetchDelegatedUserDecrypt.ts → fetchDelegatedUserDecryptV1.ts} +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { FhevmRuntime } from '../types/coreFhevmRuntime.js';
|
|
2
|
+
import type { KmsSigncryptedShare, KmsSigncryptedSharesMetadata } from '../types/kms-p.js';
|
|
3
|
+
import type { KmsSigncryptedShares } from '../types/kms.js';
|
|
4
|
+
import type { KmsSignersContext } from '../types/kmsSignersContext.js';
|
|
5
|
+
import type { ChecksummedAddress, Uint64BigInt } from '../types/primitives.js';
|
|
6
|
+
import type { FhevmChain } from '../types/fhevmChain.js';
|
|
7
|
+
import type { RelayerUserDecryptOptions } from '../types/relayer.js';
|
|
8
|
+
import type { SignedDecryptionPermit, SignedDecryptionPermitV2 } from '../types/signedDecryptionPermit.js';
|
|
9
|
+
import type { Handle } from '../types/encryptedTypes-p.js';
|
|
10
|
+
import { assertHandlesBelongToSameChainId } from '../handle/FhevmHandle.js';
|
|
11
|
+
import { createKmsSigncryptedShares } from './KmsSigncryptedShares-p.js';
|
|
12
|
+
import { readCurrentKmsSignersContext } from '../host-contracts/readKmsSignersContext-p.js';
|
|
13
|
+
import { assertIsSignedDecryptionPermit } from './SignedDecryptionPermit-p.js';
|
|
14
|
+
import { assertKmsDecryptionBitLimit } from './utils.js';
|
|
15
|
+
import { checkPersistAllowed } from '../host-contracts/checkPersistAllowed.js';
|
|
16
|
+
import { checkDelegation } from '../host-contracts/checkDelegation.js';
|
|
17
|
+
import { assertExtraDataMatchesKmsSingersContext } from '../host-contracts/KmsSignersContext-p.js';
|
|
18
|
+
import { createKmsEip712Domain } from './createKmsEip712Domain.js';
|
|
19
|
+
import { resolveFhevmTkmsVersion } from '../runtime/resolveFhevmVersions-p.js';
|
|
20
|
+
|
|
21
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
22
|
+
|
|
23
|
+
type Context = {
|
|
24
|
+
readonly runtime: FhevmRuntime;
|
|
25
|
+
readonly chain: FhevmChain;
|
|
26
|
+
readonly client: NonNullable<object>;
|
|
27
|
+
readonly options: { readonly batchRpcCalls: boolean };
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
type Parameters = {
|
|
31
|
+
readonly pairs: ReadonlyArray<{
|
|
32
|
+
readonly handle: Handle;
|
|
33
|
+
readonly contractAddress: ChecksummedAddress;
|
|
34
|
+
// When omitted, defaults to userAddress (direct-access path).
|
|
35
|
+
// Provide explicitly only for delegated handles where ownerAddress !== userAddress.
|
|
36
|
+
readonly ownerAddress?: ChecksummedAddress | undefined;
|
|
37
|
+
}>;
|
|
38
|
+
readonly signedPermit: SignedDecryptionPermit;
|
|
39
|
+
readonly options?: RelayerUserDecryptOptions | undefined;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
type ReturnType = KmsSigncryptedShares;
|
|
43
|
+
|
|
44
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
45
|
+
// fetchKmsSigncryptedSharesV2
|
|
46
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
47
|
+
|
|
48
|
+
export async function fetchKmsSigncryptedSharesV2(context: Context, parameters: Parameters): Promise<ReturnType> {
|
|
49
|
+
const { options, pairs } = parameters;
|
|
50
|
+
const signedPermit = parameters.signedPermit as SignedDecryptionPermitV2;
|
|
51
|
+
|
|
52
|
+
const tkmsVersion = await resolveFhevmTkmsVersion(context);
|
|
53
|
+
|
|
54
|
+
const relayerOptions = {
|
|
55
|
+
auth: context.runtime.config.auth,
|
|
56
|
+
...options,
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
assertIsSignedDecryptionPermit(signedPermit, {});
|
|
60
|
+
|
|
61
|
+
const { signerAddress, signature } = signedPermit;
|
|
62
|
+
const userAddress = signedPermit.eip712.message.userAddress;
|
|
63
|
+
|
|
64
|
+
// 1. Check: At least one handle/contract pair is required
|
|
65
|
+
if (pairs.length === 0) {
|
|
66
|
+
throw Error(
|
|
67
|
+
`encrypted value/contract pairs must not be empty, at least one encrypted value/contract pair is required`,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Resolve ownerAddress for each pair: defaults to userAddress (direct-access path)
|
|
72
|
+
// when not explicitly provided by the caller.
|
|
73
|
+
const resolvedPairs = pairs.map((p) => ({
|
|
74
|
+
handle: p.handle,
|
|
75
|
+
contractAddress: p.contractAddress,
|
|
76
|
+
ownerAddress: p.ownerAddress ?? userAddress,
|
|
77
|
+
}));
|
|
78
|
+
|
|
79
|
+
const handles = resolvedPairs.map((p) => p.handle);
|
|
80
|
+
Object.freeze(handles);
|
|
81
|
+
|
|
82
|
+
// 2. Check: All handles belong to the host chainId
|
|
83
|
+
assertHandlesBelongToSameChainId(handles, BigInt(context.chain.id) as Uint64BigInt);
|
|
84
|
+
|
|
85
|
+
// 3. Check: 2048 bits limit
|
|
86
|
+
assertKmsDecryptionBitLimit(handles);
|
|
87
|
+
|
|
88
|
+
// 4. Check: Expiration date
|
|
89
|
+
signedPermit.assertNotExpired();
|
|
90
|
+
|
|
91
|
+
// 5. Check: ACL permissions — split pairs by direct vs delegated access
|
|
92
|
+
const directPairs = resolvedPairs.filter((p) => p.ownerAddress.toLowerCase() === userAddress.toLowerCase());
|
|
93
|
+
const delegatedPairs = resolvedPairs.filter((p) => p.ownerAddress.toLowerCase() !== userAddress.toLowerCase());
|
|
94
|
+
|
|
95
|
+
if (directPairs.length > 0) {
|
|
96
|
+
await checkPersistAllowed(context, {
|
|
97
|
+
aclAddress: context.chain.fhevm.contracts.acl.address as ChecksummedAddress,
|
|
98
|
+
userAddress,
|
|
99
|
+
handleContractPairs: directPairs,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
if (delegatedPairs.length > 0) {
|
|
104
|
+
// Group delegated pairs by delegator (ownerAddress): a single batch may contain
|
|
105
|
+
// handles from multiple delegators, each requiring a separate ACL delegation check.
|
|
106
|
+
const byDelegator = new Map<ChecksummedAddress, Array<(typeof delegatedPairs)[number]>>();
|
|
107
|
+
for (const pair of delegatedPairs) {
|
|
108
|
+
const group = byDelegator.get(pair.ownerAddress) ?? [];
|
|
109
|
+
group.push(pair);
|
|
110
|
+
byDelegator.set(pair.ownerAddress, group);
|
|
111
|
+
}
|
|
112
|
+
for (const [delegator, groupedPairs] of byDelegator) {
|
|
113
|
+
await checkDelegation(context, {
|
|
114
|
+
aclAddress: context.chain.fhevm.contracts.acl.address as ChecksummedAddress,
|
|
115
|
+
delegate: userAddress,
|
|
116
|
+
delegator,
|
|
117
|
+
handleContractPairs: groupedPairs,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// 6. Verify the Eip712 signature
|
|
123
|
+
// Not required because a signedPermit is guaranteed to be verified.
|
|
124
|
+
|
|
125
|
+
// 7. Fetch `KmsSignersContext` on-chain (cached)
|
|
126
|
+
// Reject the permit early if it was signed against a different KMS context.
|
|
127
|
+
//
|
|
128
|
+
// TODO: The current check is a strict byte-level comparison. A permit signed
|
|
129
|
+
// with the correct `kmsContextId` but a different `extraData` encoding format
|
|
130
|
+
// (e.g. a version change in the serialization scheme) will be rejected even
|
|
131
|
+
// though the context ID matches. Consider comparing the decoded `kmsContextId`
|
|
132
|
+
// instead of the raw `extraData` bytes.
|
|
133
|
+
const requestedKmsSignersContext: KmsSignersContext = await readCurrentKmsSignersContext(context, {
|
|
134
|
+
kmsVerifierAddress: context.chain.fhevm.contracts.kmsVerifier.address as ChecksummedAddress,
|
|
135
|
+
protocolConfigAddress: context.chain.fhevm.contracts.protocolConfig?.address as ChecksummedAddress | undefined,
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
assertExtraDataMatchesKmsSingersContext(
|
|
139
|
+
{
|
|
140
|
+
extraData: signedPermit.eip712.message.extraData,
|
|
141
|
+
kmsSignersContext: requestedKmsSignersContext,
|
|
142
|
+
},
|
|
143
|
+
{ subject: 'Invalid permit' },
|
|
144
|
+
);
|
|
145
|
+
|
|
146
|
+
// 8. Fetch `KmsSigncryptedShares` from the relayer (unified V2 route)
|
|
147
|
+
const shares: readonly KmsSigncryptedShare[] = await context.runtime.relayer.fetchUserDecrypt(context, {
|
|
148
|
+
payload: {
|
|
149
|
+
handleContractPairs: resolvedPairs,
|
|
150
|
+
kmsDecryptEip712Message: signedPermit.eip712.message,
|
|
151
|
+
kmsDecryptEip712Signature: signature,
|
|
152
|
+
},
|
|
153
|
+
options: relayerOptions,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
// 9. Build and verify the sealed validated `KmsSigncryptedShares` object
|
|
157
|
+
const sharesMetadata: KmsSigncryptedSharesMetadata = {
|
|
158
|
+
kmsSignersContext: requestedKmsSignersContext,
|
|
159
|
+
eip712Domain: createKmsEip712Domain({
|
|
160
|
+
chainId: context.chain.fhevm.gateway.id,
|
|
161
|
+
verifyingContractAddressDecryption: context.chain.fhevm.gateway.contracts.decryption.address,
|
|
162
|
+
}),
|
|
163
|
+
eip712Signature: signature,
|
|
164
|
+
eip712SignerAddress: signerAddress,
|
|
165
|
+
handles,
|
|
166
|
+
tkmsVersion,
|
|
167
|
+
};
|
|
168
|
+
|
|
169
|
+
// 10. The returned KmsSigncryptedShares is guaranteed to be fully verified:
|
|
170
|
+
// uniform extraData across shares, valid extraData format, and consistency
|
|
171
|
+
// with the KmsSignersContext (see KmsSigncryptedSharesImpl invariants).
|
|
172
|
+
return await createKmsSigncryptedShares(context, {
|
|
173
|
+
metadata: sharesMetadata,
|
|
174
|
+
shares,
|
|
175
|
+
});
|
|
176
|
+
}
|
package/core/kms/{kmsDelegatedUserDecryptEip712Types.ts → kmsDelegatedUserDecryptEip712V1Types.ts}
RENAMED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KmsDelegatedUserDecryptEip712V1Types } from '../types/kms.js';
|
|
2
2
|
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
//
|
|
4
|
+
// KmsDelegatedUserDecryptEip712V1Types
|
|
5
5
|
////////////////////////////////////////////////////////////////////////////////
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// Careful: do not change any fields in this structure
|
|
8
|
+
export const kmsDelegatedUserDecryptEip712V1Types: KmsDelegatedUserDecryptEip712V1Types = {
|
|
8
9
|
EIP712Domain: [
|
|
9
10
|
{ name: 'name', type: 'string' },
|
|
10
11
|
{ name: 'version', type: 'string' },
|
|
@@ -24,8 +25,8 @@ export const kmsDelegatedUserDecryptEip712Types: KmsDelegateUserDecryptEip712Typ
|
|
|
24
25
|
] as const,
|
|
25
26
|
} as const;
|
|
26
27
|
|
|
27
|
-
Object.freeze(
|
|
28
|
-
Object.freeze(
|
|
29
|
-
Object.freeze(
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
Object.freeze(kmsDelegatedUserDecryptEip712V1Types);
|
|
29
|
+
Object.freeze(kmsDelegatedUserDecryptEip712V1Types.EIP712Domain);
|
|
30
|
+
Object.freeze(kmsDelegatedUserDecryptEip712V1Types.DelegatedUserDecryptRequestVerification);
|
|
31
|
+
kmsDelegatedUserDecryptEip712V1Types.EIP712Domain.forEach(Object.freeze);
|
|
32
|
+
kmsDelegatedUserDecryptEip712V1Types.DelegatedUserDecryptRequestVerification.forEach(Object.freeze);
|
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import type { Bytes32Hex, BytesHex, Uint256BigInt, Uint8Number } from '../types/primitives.js';
|
|
2
|
+
import type { ErrorMetadataParams } from '../base/errors/ErrorBase.js';
|
|
3
|
+
import type { HostContractVersion } from '../types/hostContract.js';
|
|
4
|
+
import type { KmsExtraData } from '../types/kms-p.js';
|
|
5
|
+
import { asUint256BigInt, asUint8Number } from '../base/uint.js';
|
|
6
|
+
import { asBytes32Hex, assertIsBytesHex } from '../base/bytes.js';
|
|
7
|
+
import { isVersionEqual, isVersionStrictlyBefore } from '../host-contracts/HostContractVersion-p.js';
|
|
8
|
+
import { InvalidTypeError } from '../base/errors/InvalidTypeError.js';
|
|
9
|
+
|
|
10
|
+
export const EXTRA_DATA_V0: Uint8Number = 0x00 as Uint8Number; // 0x00
|
|
11
|
+
export const EXTRA_DATA_V1: Uint8Number = 0x01 as Uint8Number; // 1 version byte + 32-byte big-endian context ID = 33 bytes
|
|
12
|
+
export const EXTRA_DATA_V2: Uint8Number = 0x02 as Uint8Number; // 1 version byte + 32-byte big-endian context ID + 32-byte big-endian epoch ID = 65 bytes
|
|
13
|
+
|
|
14
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
15
|
+
|
|
16
|
+
const PRIVATE_TOKEN = Symbol('KmsExtraData.token');
|
|
17
|
+
|
|
18
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
19
|
+
// ExtraDataImpl class
|
|
20
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
export class KmsExtraDataImpl implements KmsExtraData {
|
|
26
|
+
readonly #version: Uint8Number;
|
|
27
|
+
readonly #kmsContextId: Uint256BigInt;
|
|
28
|
+
readonly #kmsEpochId: Uint256BigInt;
|
|
29
|
+
|
|
30
|
+
constructor(
|
|
31
|
+
privateToken: symbol,
|
|
32
|
+
parameters: {
|
|
33
|
+
readonly version: Uint8Number;
|
|
34
|
+
readonly kmsContextId: Uint256BigInt;
|
|
35
|
+
readonly kmsEpochId: Uint256BigInt;
|
|
36
|
+
},
|
|
37
|
+
) {
|
|
38
|
+
if (privateToken !== PRIVATE_TOKEN) {
|
|
39
|
+
throw new Error('Unauthorized');
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
this.#kmsContextId = asUint256BigInt(parameters.kmsContextId);
|
|
43
|
+
this.#kmsEpochId = asUint256BigInt(parameters.kmsEpochId);
|
|
44
|
+
this.#version = asUint8Number(parameters.version);
|
|
45
|
+
|
|
46
|
+
this.#validate();
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
#validate(): void {
|
|
50
|
+
switch (this.#version) {
|
|
51
|
+
case EXTRA_DATA_V0: {
|
|
52
|
+
if (this.#kmsContextId !== 0n) {
|
|
53
|
+
throw new Error('kmsContextId must be 0 for v0 kms extraData');
|
|
54
|
+
}
|
|
55
|
+
if (this.#kmsEpochId !== 0n) {
|
|
56
|
+
throw new Error('kmsEpochId must be 0 for v0 kms extraData');
|
|
57
|
+
}
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
case EXTRA_DATA_V1: {
|
|
61
|
+
if (this.#kmsContextId === 0n) {
|
|
62
|
+
throw new Error('kmsContextId cannot be 0 for v1 kms extraData');
|
|
63
|
+
}
|
|
64
|
+
if (this.#kmsEpochId !== 0n) {
|
|
65
|
+
throw new Error('kmsEpochId must be 0 for v1 kms extraData');
|
|
66
|
+
}
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
case EXTRA_DATA_V2: {
|
|
70
|
+
if (this.#kmsContextId === 0n) {
|
|
71
|
+
throw new Error('kmsContextId cannot be 0 for v2 kms extraData');
|
|
72
|
+
}
|
|
73
|
+
if (this.#kmsEpochId === 0n) {
|
|
74
|
+
throw new Error('kmsEpochId cannot be 0 for v2 kms extraData');
|
|
75
|
+
}
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
default:
|
|
79
|
+
throw new Error(`Unsupported kms extraData version ${this.#version}`);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public get version(): Uint8Number {
|
|
84
|
+
return this.#version;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
public get kmsContextId(): Uint256BigInt {
|
|
88
|
+
return this.#kmsContextId;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
public get kmsEpochId(): Uint256BigInt {
|
|
92
|
+
return this.#kmsEpochId;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Encodes a KMS context into an extraData format.
|
|
97
|
+
* v0: `0x00`
|
|
98
|
+
* v1: `0x01` + 32-byte big-endian context ID.
|
|
99
|
+
* v2: `0x02` + 32-byte big-endian context ID + 32-byte big-endian epoch ID.
|
|
100
|
+
*/
|
|
101
|
+
public toBytesHex(): BytesHex {
|
|
102
|
+
const v = this.#version.toString(16).padStart(2, '0');
|
|
103
|
+
|
|
104
|
+
switch (this.#version) {
|
|
105
|
+
case EXTRA_DATA_V0: {
|
|
106
|
+
return `0x${v}` as BytesHex;
|
|
107
|
+
}
|
|
108
|
+
case EXTRA_DATA_V1: {
|
|
109
|
+
const contextId = this.#kmsContextId.toString(16).padStart(64, '0');
|
|
110
|
+
return `0x${v}${contextId}` as BytesHex;
|
|
111
|
+
}
|
|
112
|
+
case EXTRA_DATA_V2: {
|
|
113
|
+
const contextId = this.#kmsContextId.toString(16).padStart(64, '0');
|
|
114
|
+
const epochId = this.#kmsEpochId.toString(16).padStart(64, '0');
|
|
115
|
+
return `0x${v}${contextId}${epochId}` as BytesHex;
|
|
116
|
+
}
|
|
117
|
+
default:
|
|
118
|
+
throw new Error(`Unsupported kms extraData version ${this.#version}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
//////////////////////////////////////////////////////////////////////////////
|
|
124
|
+
|
|
125
|
+
export function fromKmsExtraDataBytesHex(extraDataBytesHex: BytesHex): KmsExtraData {
|
|
126
|
+
if ((extraDataBytesHex as string) === '0x00' || (extraDataBytesHex as string) === '0x') {
|
|
127
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
128
|
+
version: EXTRA_DATA_V0,
|
|
129
|
+
kmsContextId: 0n as Uint256BigInt,
|
|
130
|
+
kmsEpochId: 0n as Uint256BigInt,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
if (extraDataBytesHex.length <= 4) {
|
|
135
|
+
throw new Error(`Unsupported kms extraData length ${extraDataBytesHex.length}: must be more than 4 bytes`);
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
// First byte = version (characters 2-3 after '0x')
|
|
139
|
+
const version = asUint8Number(Number('0x' + extraDataBytesHex.slice(2, 4)));
|
|
140
|
+
|
|
141
|
+
if (version === EXTRA_DATA_V1) {
|
|
142
|
+
// ExtraData v1 format: 1 version byte + 32-byte big-endian context ID = 33 bytes = 66 hex chars + 2 for '0x' = 68
|
|
143
|
+
// 0x01aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
144
|
+
// ↑ ↑ ↑
|
|
145
|
+
// 0 4 68
|
|
146
|
+
// 0 1 2 3 4 5 6
|
|
147
|
+
// 01234567890123456789012345678901234567890123456789012345678901234567
|
|
148
|
+
|
|
149
|
+
if (extraDataBytesHex.length != 68) {
|
|
150
|
+
throw new Error(`Invalid kms extraData length for v1: expected 68, got ${extraDataBytesHex.length}`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// 32-byte contextId starts at byte 1 (hex chars 4..67)
|
|
154
|
+
const contextIdBytes32Hex: Bytes32Hex = asBytes32Hex(`0x${extraDataBytesHex.slice(4, 68)}`);
|
|
155
|
+
const kmsContextId = asUint256BigInt(BigInt(contextIdBytes32Hex));
|
|
156
|
+
|
|
157
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
158
|
+
version: EXTRA_DATA_V1,
|
|
159
|
+
kmsContextId,
|
|
160
|
+
kmsEpochId: 0n as Uint256BigInt,
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (version === EXTRA_DATA_V2) {
|
|
165
|
+
// ExtraData v2 format: 1 version byte + 32-byte big-endian context ID + 32-byte big-endian epoch ID = 65 bytes = 130 hex chars + 2 for '0x' = 132
|
|
166
|
+
// 0x01aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
|
|
167
|
+
// ↑ ↑ ↑ ↑
|
|
168
|
+
// 0 4 68 132
|
|
169
|
+
// 0 1 2 3 4 5 6 7 8 9 0 1 2 3
|
|
170
|
+
// 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901
|
|
171
|
+
|
|
172
|
+
if (extraDataBytesHex.length != 132) {
|
|
173
|
+
throw new Error(`Invalid extraData length for v2: expected 132, got ${extraDataBytesHex.length}`);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
// 32-byte contextId starts at byte 1 (hex chars 4..67)
|
|
177
|
+
const contextIdBytes32Hex: Bytes32Hex = asBytes32Hex(`0x${extraDataBytesHex.slice(4, 68)}`);
|
|
178
|
+
const kmsContextId = asUint256BigInt(BigInt(contextIdBytes32Hex));
|
|
179
|
+
|
|
180
|
+
// 32-byte epochId starts at byte 33 (hex chars 68..131)
|
|
181
|
+
const epochIdBytes32Hex: Bytes32Hex = asBytes32Hex(`0x${extraDataBytesHex.slice(68, 132)}`);
|
|
182
|
+
const kmsEpochId = asUint256BigInt(BigInt(epochIdBytes32Hex));
|
|
183
|
+
|
|
184
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
185
|
+
version: EXTRA_DATA_V2,
|
|
186
|
+
kmsContextId,
|
|
187
|
+
kmsEpochId: kmsEpochId,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
throw new Error(`Unsupported kms extraData version ${version}`);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
195
|
+
|
|
196
|
+
export function createKmsExtraDataV0(): KmsExtraData {
|
|
197
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
198
|
+
version: EXTRA_DATA_V0,
|
|
199
|
+
kmsContextId: 0n as Uint256BigInt,
|
|
200
|
+
kmsEpochId: 0n as Uint256BigInt,
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
205
|
+
|
|
206
|
+
export function createKmsExtraDataV1(parameters: { readonly kmsContextId: Uint256BigInt }): KmsExtraData {
|
|
207
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
208
|
+
version: EXTRA_DATA_V1,
|
|
209
|
+
kmsContextId: parameters.kmsContextId,
|
|
210
|
+
kmsEpochId: 0n as Uint256BigInt,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
215
|
+
|
|
216
|
+
export function createKmsExtraDataV2(parameters: {
|
|
217
|
+
readonly kmsContextId: Uint256BigInt;
|
|
218
|
+
readonly kmsEpochId: Uint256BigInt;
|
|
219
|
+
}): KmsExtraData {
|
|
220
|
+
return new KmsExtraDataImpl(PRIVATE_TOKEN, {
|
|
221
|
+
version: EXTRA_DATA_V2,
|
|
222
|
+
kmsContextId: parameters.kmsContextId,
|
|
223
|
+
kmsEpochId: parameters.kmsEpochId,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
228
|
+
|
|
229
|
+
export function validateKmsExtraDataParams(parameters: {
|
|
230
|
+
readonly kmsContextId: Uint256BigInt;
|
|
231
|
+
readonly kmsEpochId: Uint256BigInt;
|
|
232
|
+
}): void {
|
|
233
|
+
if (parameters.kmsEpochId !== 0n && parameters.kmsContextId === 0n) {
|
|
234
|
+
throw new Error('kmsContextId cannot be 0 if kmsEpochId is not 0');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
239
|
+
|
|
240
|
+
export function createKmsExtraData(parameters: {
|
|
241
|
+
readonly kmsContextId: Uint256BigInt;
|
|
242
|
+
readonly kmsEpochId: Uint256BigInt;
|
|
243
|
+
}): KmsExtraData {
|
|
244
|
+
validateKmsExtraDataParams(parameters);
|
|
245
|
+
|
|
246
|
+
if (parameters.kmsEpochId === 0n) {
|
|
247
|
+
if (parameters.kmsContextId === 0n) {
|
|
248
|
+
return createKmsExtraDataV0();
|
|
249
|
+
}
|
|
250
|
+
return createKmsExtraDataV1({
|
|
251
|
+
kmsContextId: parameters.kmsContextId,
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
return createKmsExtraDataV2({
|
|
256
|
+
kmsContextId: parameters.kmsContextId,
|
|
257
|
+
kmsEpochId: parameters.kmsEpochId,
|
|
258
|
+
});
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
262
|
+
|
|
263
|
+
export function equalsKmsExtraData(a: KmsExtraData, b: KmsExtraData): boolean {
|
|
264
|
+
assertIsKmsExtraData(a, {});
|
|
265
|
+
assertIsKmsExtraData(b, {});
|
|
266
|
+
return a.version === b.version && a.kmsContextId === b.kmsContextId && a.kmsEpochId === b.kmsEpochId;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Module-only helper. Narrows an unknown value to the concrete
|
|
273
|
+
* {@link KmsExtraDataImpl} class by verifying it via {@link assertIsKmsExtraData}
|
|
274
|
+
* and returning it typed as the implementation class, so other functions in this
|
|
275
|
+
* module can reach class-only members. Prefer this over a bare cast.
|
|
276
|
+
*
|
|
277
|
+
* Must never be exported: `Impl` classes are internal to the SDK and never leave
|
|
278
|
+
* the module, so a function that hands one back must stay module-private too.
|
|
279
|
+
* The public surface exposes only the {@link KmsExtraData} interface.
|
|
280
|
+
*
|
|
281
|
+
* @param value - The value to narrow.
|
|
282
|
+
* @returns The same value typed as {@link KmsExtraDataImpl}.
|
|
283
|
+
* @throws {InvalidTypeError} If `value` is not a {@link KmsExtraDataImpl} instance.
|
|
284
|
+
*/
|
|
285
|
+
function _asKmsExtraDataImpl(value: unknown): KmsExtraDataImpl {
|
|
286
|
+
assertIsKmsExtraData(value, {});
|
|
287
|
+
return value as KmsExtraDataImpl;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
291
|
+
|
|
292
|
+
export function isKmsExtraData(value: unknown): value is KmsExtraData {
|
|
293
|
+
return value instanceof KmsExtraDataImpl;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
297
|
+
|
|
298
|
+
export function assertIsKmsExtraData(
|
|
299
|
+
value: unknown,
|
|
300
|
+
options: { readonly subject?: string } & ErrorMetadataParams,
|
|
301
|
+
): asserts value is KmsExtraData {
|
|
302
|
+
if (!isKmsExtraData(value)) {
|
|
303
|
+
throw new InvalidTypeError(
|
|
304
|
+
{
|
|
305
|
+
subject: options.subject,
|
|
306
|
+
type: typeof value,
|
|
307
|
+
expectedType: 'KmsExtraData',
|
|
308
|
+
},
|
|
309
|
+
options,
|
|
310
|
+
);
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
315
|
+
|
|
316
|
+
export function assertIsKmsExtraDataBytesHex(
|
|
317
|
+
value: unknown,
|
|
318
|
+
options: { subject?: string } & ErrorMetadataParams,
|
|
319
|
+
): asserts value is BytesHex {
|
|
320
|
+
if (value === '0x00' || value === '0x') {
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
assertIsBytesHex(value, options);
|
|
325
|
+
|
|
326
|
+
// Will valid extraData length too
|
|
327
|
+
fromKmsExtraDataBytesHex(value);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
////////////////////////////////////////////////////////////////////////////////
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Returns `true` if `kmsExtraData`'s version is accepted by the given
|
|
334
|
+
* KMSVerifier contract version.
|
|
335
|
+
*
|
|
336
|
+
* | KMSVerifier version | protocol | max extraData version |
|
|
337
|
+
* | ------------------- | --------------- | --------------------- |
|
|
338
|
+
* | < 0.2.0 | v0.11.0 | v0 |
|
|
339
|
+
* | 0.2.0 – 0.3.x | v0.12.0/v0.13.0 | v1 |
|
|
340
|
+
* | 0.4.0 | v0.14.0 | v2 |
|
|
341
|
+
* | > 0.4.0 | v0.14.1+ | not checked (`true`) |
|
|
342
|
+
*/
|
|
343
|
+
export function isKmsExtraDataCompatibleWithKmsVerifier(
|
|
344
|
+
kmsExtraData: KmsExtraData,
|
|
345
|
+
kmsVerifierVersion: HostContractVersion,
|
|
346
|
+
): boolean {
|
|
347
|
+
const ed = _asKmsExtraDataImpl(kmsExtraData);
|
|
348
|
+
|
|
349
|
+
// Protocol v0.11.0
|
|
350
|
+
if (isVersionStrictlyBefore(kmsVerifierVersion, { major: 0, minor: 2 })) {
|
|
351
|
+
return ed.version <= EXTRA_DATA_V0;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Protocol v0.12.0/v0.13.0
|
|
355
|
+
if (isVersionStrictlyBefore(kmsVerifierVersion, { major: 0, minor: 4 })) {
|
|
356
|
+
return ed.version <= EXTRA_DATA_V1;
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// Protocol v0.14.0
|
|
360
|
+
if (isVersionEqual(kmsVerifierVersion, { major: 0, minor: 4, patch: 0 })) {
|
|
361
|
+
return ed.version <= EXTRA_DATA_V2;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
// Protocol v0.14.1+ (beyond the versions this SDK release knows about).
|
|
365
|
+
//
|
|
366
|
+
// We deliberately return `true` (compatible) instead of guessing an upper
|
|
367
|
+
// bound on `extraData.version`. On v0.14.0 the KMSVerifier reverts for
|
|
368
|
+
// `extraData.version > 2`, but we cannot know the accepted range of future
|
|
369
|
+
// contract versions. Pre-validating here would risk rejecting extraData that
|
|
370
|
+
// a newer contract actually supports. If the on-chain contract does reject it,
|
|
371
|
+
// the call reverts — and surfacing that revert is the source of truth, not a
|
|
372
|
+
// speculative client-side check.
|
|
373
|
+
return true;
|
|
374
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { KmsPublicDecryptEip712Types } from '../types/kms.js';
|
|
2
2
|
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
//
|
|
4
|
+
// KmsPublicDecryptEip712Types
|
|
5
5
|
////////////////////////////////////////////////////////////////////////////////
|
|
6
6
|
|
|
7
7
|
export const kmsPublicDecryptEip712Types: KmsPublicDecryptEip712Types = {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { KmsUserDecryptEip712V1Types } from '../types/kms.js';
|
|
2
2
|
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
//
|
|
4
|
+
// KmsUserDecryptEip712V1Types
|
|
5
5
|
////////////////////////////////////////////////////////////////////////////////
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
// Careful: do not change any fields in this structure
|
|
8
|
+
export const kmsUserDecryptEip712V1Types: KmsUserDecryptEip712V1Types = {
|
|
8
9
|
EIP712Domain: [
|
|
9
10
|
{ name: 'name', type: 'string' },
|
|
10
11
|
{ name: 'version', type: 'string' },
|
|
@@ -23,8 +24,8 @@ export const kmsUserDecryptEip712Types: KmsUserDecryptEip712Types = {
|
|
|
23
24
|
] as const,
|
|
24
25
|
} as const;
|
|
25
26
|
|
|
26
|
-
Object.freeze(
|
|
27
|
-
Object.freeze(
|
|
28
|
-
Object.freeze(
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
Object.freeze(kmsUserDecryptEip712V1Types);
|
|
28
|
+
Object.freeze(kmsUserDecryptEip712V1Types.EIP712Domain);
|
|
29
|
+
Object.freeze(kmsUserDecryptEip712V1Types.UserDecryptRequestVerification);
|
|
30
|
+
kmsUserDecryptEip712V1Types.EIP712Domain.forEach(Object.freeze);
|
|
31
|
+
kmsUserDecryptEip712V1Types.UserDecryptRequestVerification.forEach(Object.freeze);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import type { KmsUserDecryptEip712V2Types } from '../types/kms.js';
|
|
2
2
|
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
//
|
|
4
|
+
// KmsUserDecryptEip712V2Types (RFC-016)
|
|
5
5
|
////////////////////////////////////////////////////////////////////////////////
|
|
6
6
|
|
|
7
|
+
// Careful: do not change any fields in this structure
|
|
7
8
|
export const kmsUserDecryptEip712V2Types: KmsUserDecryptEip712V2Types = {
|
|
8
9
|
EIP712Domain: [
|
|
9
10
|
{ name: 'name', type: 'string' },
|