Skip to content

feat: new types for directed identity, improved grant#24

Merged
BlairCurrey merged 2 commits intomainfrom
blair/fix-spent-amounts
Feb 12, 2026
Merged

feat: new types for directed identity, improved grant#24
BlairCurrey merged 2 commits intomainfrom
blair/fix-spent-amounts

Conversation

@BlairCurrey
Copy link
Contributor

@BlairCurrey BlairCurrey commented Feb 3, 2026

Updates to latest open payments spec (grant spent amount fix, directed identity).

  • exports grant type guards (missed from previous release)
  • adds more explicit grant types (GrantWithAccessToken, GrantWithSubject)
  • changes grant spent amount return type to be required but nullable (ie spentReceiveAmount: Amount | null)
  • loosens client field to be string (as currently) or new object with string/jwk.

@changeset-bot
Copy link

changeset-bot bot commented Feb 3, 2026

🦋 Changeset detected

Latest commit: 042f2d4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@interledger/open-payments Minor
example-peer-to-peer Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Comment on lines +88 to +91
export type Client =
| string
| { walletAddress: string; jwk?: never }
| { jwk: JWK; walletAddress?: never }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New client type for the directed identity support.

Directed identity changes and the grant spent amount fixes were both included in new 1.3 version of spec. Perhaps they should have been more granular versions (grant spent amount fix, then directed identity).

If this is released before Rafiki is updated then the jwk option wont work. However, it may also give clients more time to update to the new pattern (string -> {walletAddress: string}. I guess if we wanted we could simply omit the { jwk: JWK; walletAddress?: never } item here for now and include once implemented in rafiki?

Copy link

@njlie njlie Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the "string" format is to be interpreted as a wallet address url, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is correct - for backwards compatibility purposes. Should be removed at some point in favor of the object only.

Copy link

@njlie njlie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +88 to +91
export type Client =
| string
| { walletAddress: string; jwk?: never }
| { jwk: JWK; walletAddress?: never }
Copy link

@njlie njlie Feb 10, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I assume that the "string" format is to be interpreted as a wallet address url, correct?

@BlairCurrey BlairCurrey merged commit 2d78b59 into main Feb 12, 2026
10 checks passed
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