Skip to content

Conversation

@MajorLift
Copy link
Contributor

@MajorLift MajorLift commented Aug 26, 2025

Explanation

This commit enables the return output of getCaip25PermissionFromLegacyPermissions to be assignable to RequestedPermissions.

Because RequestedPermissions is defined using NonEmptyArray, assigning ReturnType<typeof getCaip25PermissionFromLegacyPermissions> to RequestedPermissions currently results in the following error:

Type '{ "endowment:caip25": { caveats: { type: string; value: Caip25CaveatValue; }[]; }; }' is not assignable to type 'RequestedPermissions'.
  Property '"endowment:caip25"' is incompatible with index signature.
    Type '{ caveats: { type: string; value: Caip25CaveatValue; }[]; }' is not assignable to type 'Partial<PermissionConstraint>'.
      Types of property 'caveats' are incompatible.
        Type '{ type: string; value: Caip25CaveatValue; }[]' is not assignable to type '[CaveatConstraint, ...CaveatConstraint[]]'.
          Source provides no match for required element at position 0 in target.ts(2322)

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

This enables the method's return type to be assignable to `RequestedPermissions`
@MajorLift MajorLift requested a review from a team as a code owner August 26, 2025 12:00
@MajorLift MajorLift self-assigned this Aug 26, 2025
@MajorLift MajorLift requested a review from a team as a code owner August 26, 2025 12:03
@MajorLift MajorLift merged commit db007fc into main Aug 26, 2025
232 checks passed
@MajorLift MajorLift deleted the jongsun/fix/250826-type-fix-getCaip25PermissionFromLegacyPermissions branch August 26, 2025 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants