feat(PR30): XRPL escrow budget fields in PolicyGrantLike#48
Merged
Conversation
…ineMaxSinglePayment to PolicyGrantLike XRPL-escrow budget enforcement requires these PA-signed fields in the PolicyGrant so the Trust Gateway can enforce ceilings from a tamper-proof source rather than trusting agent-reported values. - PolicyGrantLike: budgetMinor, budgetCurrency, budgetEscrowRef, authorizedGateway, offlineMaxSinglePayment, offlineMaxSinglePaymentCurrency - policyGrantForVerificationSchema: Zod validators for all six fields (numeric strings validated via regex) - createPolicyGrant / CreatePolicyGrantInput: factory and input type updated Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- types.ts: authorizedGateway — remove XRPL-specific "address" wording, use rail-agnostic description - types.ts: offlineMaxSinglePayment — "(drops)" → "minor units" (rail-agnostic) - types.ts: budgetEscrowRef example — add lockId to eth example for consistency with spec - createPolicyGrant.ts: add missing JSDoc for authorizedGateway, offlineMaxSinglePayment, offlineMaxSinglePaymentCurrency (other new fields had docs, these three did not) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PolicyGrantLike,policyGrantForVerificationSchema, andCreatePolicyGrantInput/createPolicyGrantfactory:budgetMinor/budgetCurrency— total authorized spend ceiling (PA-signed, tamper-proof)budgetEscrowRef— URI pointer to the on-chain XRPL escrow that pre-reserves the budgetauthorizedGateway— XRPL address of the only gateway allowed to spend against this grant's escrowofflineMaxSinglePayment/offlineMaxSinglePaymentCurrency— per-transaction cap for offline merchant acceptance (tiered trust Option A)Motivation
The Trust Gateway must enforce a budget ceiling that comes from the PA-signed grant rather than from an agent-reported value. These fields are included in the PA signature, so a compromised agent or gateway cannot forge a higher ceiling.
Test plan
npm run build— no TypeScript errorsnpm test)createPolicyGrant→verifyPolicyGrantin a manual test🤖 Generated with Claude Code