diff --git a/src/internal/typedData/domainSeparator.ts b/src/internal/typedData/domainSeparator.ts index 78858f4d..97f20a52 100644 --- a/src/internal/typedData/domainSeparator.ts +++ b/src/internal/typedData/domainSeparator.ts @@ -21,3 +21,6 @@ export declare namespace domainSeparator { type ErrorType = hashDomain.ErrorType | GlobalErrorType } + +domainSeparator.parseError = (error: unknown) => + error as domainSeparator.ErrorType diff --git a/src/internal/typedData/encodeType.ts b/src/internal/typedData/encodeType.ts index ef3d3a3b..4931d9a2 100644 --- a/src/internal/typedData/encodeType.ts +++ b/src/internal/typedData/encodeType.ts @@ -29,6 +29,8 @@ export declare namespace encodeType { type ErrorType = findTypeDependencies.ErrorType | GlobalErrorType } +encodeType.parseError = (error: unknown) => error as encodeType.ErrorType + function findTypeDependencies( value: { primaryType: string diff --git a/src/internal/typedData/extractEip712DomainTypes.ts b/src/internal/typedData/extractEip712DomainTypes.ts index 4c86004f..9ce99207 100644 --- a/src/internal/typedData/extractEip712DomainTypes.ts +++ b/src/internal/typedData/extractEip712DomainTypes.ts @@ -38,3 +38,6 @@ export function extractEip712DomainTypes( export declare namespace extractEip712DomainTypes { type ErrorType = GlobalErrorType } + +extractEip712DomainTypes.parseError = (error: unknown) => + error as extractEip712DomainTypes.ErrorType diff --git a/src/internal/typedData/hashDomain.ts b/src/internal/typedData/hashDomain.ts index 0d1121f2..5a726e2b 100644 --- a/src/internal/typedData/hashDomain.ts +++ b/src/internal/typedData/hashDomain.ts @@ -20,3 +20,5 @@ export declare namespace hashDomain { type ErrorType = hashStruct.ErrorType | GlobalErrorType } + +hashDomain.parseError = (error: unknown) => error as hashDomain.ErrorType diff --git a/src/internal/typedData/hashStruct.ts b/src/internal/typedData/hashStruct.ts index 6399a24e..1a4413c4 100644 --- a/src/internal/typedData/hashStruct.ts +++ b/src/internal/typedData/hashStruct.ts @@ -29,6 +29,8 @@ export declare namespace hashStruct { type ErrorType = encodeData.ErrorType | keccak256.ErrorType | GlobalErrorType } +hashStruct.parseError = (error: unknown) => error as hashStruct.ErrorType + function encodeData(value: { data: Record primaryType: string diff --git a/src/internal/typedData/hashTypedData.ts b/src/internal/typedData/hashTypedData.ts index 87c80fae..06c8dce5 100644 --- a/src/internal/typedData/hashTypedData.ts +++ b/src/internal/typedData/hashTypedData.ts @@ -68,3 +68,5 @@ export declare namespace hashTypedData { | validateTypedData.ErrorType | GlobalErrorType } + +hashTypedData.parseError = (error: unknown) => error as hashTypedData.ErrorType