Skip to content

Commit

Permalink
feat(typedData): parseError
Browse files Browse the repository at this point in the history
  • Loading branch information
tmm committed Aug 20, 2024
1 parent 4b6823d commit e7b66a5
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/internal/typedData/domainSeparator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ export declare namespace domainSeparator {

type ErrorType = hashDomain.ErrorType | GlobalErrorType
}

domainSeparator.parseError = (error: unknown) =>
error as domainSeparator.ErrorType
2 changes: 2 additions & 0 deletions src/internal/typedData/encodeType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/internal/typedData/extractEip712DomainTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,6 @@ export function extractEip712DomainTypes(
export declare namespace extractEip712DomainTypes {
type ErrorType = GlobalErrorType
}

extractEip712DomainTypes.parseError = (error: unknown) =>
error as extractEip712DomainTypes.ErrorType
2 changes: 2 additions & 0 deletions src/internal/typedData/hashDomain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,5 @@ export declare namespace hashDomain {

type ErrorType = hashStruct.ErrorType | GlobalErrorType
}

hashDomain.parseError = (error: unknown) => error as hashDomain.ErrorType
2 changes: 2 additions & 0 deletions src/internal/typedData/hashStruct.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, unknown>
primaryType: string
Expand Down
2 changes: 2 additions & 0 deletions src/internal/typedData/hashTypedData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,5 @@ export declare namespace hashTypedData {
| validateTypedData.ErrorType
| GlobalErrorType
}

hashTypedData.parseError = (error: unknown) => error as hashTypedData.ErrorType

0 comments on commit e7b66a5

Please sign in to comment.