Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/atxp-client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@atxp/client",
"version": "0.11.12",
"version": "0.11.10",
"description": "ATXP Client - MCP client with OAuth authentication and payment processing",
"license": "MIT",
"repository": {
Expand Down Expand Up @@ -33,8 +33,8 @@
"pack:dry": "npm pack --dry-run"
},
"dependencies": {
"@atxp/common": "0.11.11",
"@atxp/mpp": "0.11.11",
"@atxp/common": "0.11.10",
"@atxp/mpp": "0.11.10",
"@modelcontextprotocol/sdk": "^1.15.0",
"@x402/core": "^2.9.0",
"@x402/evm": "^2.9.0",
Expand Down
1 change: 1 addition & 0 deletions packages/atxp-client/src/atxpAccountHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class ATXPAccountHandler implements ProtocolHandler {
paymentRequirements: authorizeParams.paymentRequirements,
challenge: authorizeParams.challenge,
challenges: authorizeParams.challenges as unknown[] | undefined,
paymentRequestId: typeof challengeData.paymentRequestId === 'string' ? challengeData.paymentRequestId : undefined,
});
} catch (error) {
logger.error(`ATXPAccountHandler: authorize failed: ${error instanceof Error ? error.message : String(error)}`);
Expand Down
1 change: 1 addition & 0 deletions packages/atxp-client/src/x402ProtocolHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ export class X402ProtocolHandler implements ProtocolHandler {
protocols: ['x402'],
destination: url,
paymentRequirements: enrichedRequirements,
paymentRequestId: paymentChallenge.paymentRequestId,
});
const paymentHeader = authorizeResult.credential;

Expand Down
2 changes: 2 additions & 0 deletions packages/atxp-common/src/atxpAccount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ export class ATXPAccount implements Account {
body.currency = 'USDC';
// X402 fields
if (params.paymentRequirements) body.paymentRequirements = params.paymentRequirements;
// Phase 6: lets accounts key the X402 cap reservation to the challenge so it releases on settle.
if (params.paymentRequestId) body.paymentRequestId = params.paymentRequestId;
// MPP fields
if (params.challenges) body.challenges = params.challenges;
if (params.challenge) body.challenge = params.challenge;
Expand Down
5 changes: 5 additions & 0 deletions packages/atxp-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,11 @@ export interface AuthorizeParams {
challenge?: unknown;
/** MPP: array of challenges from multi-chain omni-challenge (preferred) */
challenges?: unknown[];
/**
* The challenge's payment-request id. Threaded to accounts at authorize so it can key the
* X402 binding cap reservation (upto sessions) to it and release it on settle (Phase 6).
*/
paymentRequestId?: string;
}

export interface AuthorizeResult {
Expand Down
Loading