@atxp/client 0.10.11 → 0.10.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index10.js +2 -2
- package/dist/_virtual/index11.js +2 -2
- package/dist/_virtual/index14.js +2 -2
- package/dist/_virtual/index15.js +2 -2
- package/dist/_virtual/index17.js +2 -2
- package/dist/_virtual/index18.js +2 -2
- package/dist/_virtual/index19.js +2 -2
- package/dist/_virtual/index20.js +2 -2
- package/dist/_virtual/index3.js +2 -2
- package/dist/_virtual/index4.js +2 -2
- package/dist/index.cjs +9 -70
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +3 -60
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -70
- package/dist/index.js.map +1 -1
- package/dist/mppProtocolHandler.d.ts +1 -9
- package/dist/mppProtocolHandler.d.ts.map +1 -1
- package/dist/mppProtocolHandler.js +7 -16
- package/dist/mppProtocolHandler.js.map +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/compile/validate/index.js +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -1
- package/dist/node_modules/@modelcontextprotocol/sdk/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/discriminator/index.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/dist/node_modules/ajv-formats/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/dist/node_modules/fast-uri/index.js +1 -1
- package/dist/paymentClient.d.ts +8 -16
- package/dist/paymentClient.d.ts.map +1 -1
- package/dist/paymentClient.js +8 -15
- package/dist/paymentClient.js.map +1 -1
- package/dist/paymentHeaders.d.ts +11 -0
- package/dist/paymentHeaders.d.ts.map +1 -0
- package/dist/paymentHeaders.js +32 -0
- package/dist/paymentHeaders.js.map +1 -0
- package/dist/x402ProtocolHandler.d.ts +0 -5
- package/dist/x402ProtocolHandler.d.ts.map +1 -1
- package/dist/x402ProtocolHandler.js +4 -12
- package/dist/x402ProtocolHandler.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Account, Logger, FetchLike, Currency, Network, DestinationMaker, AuthorizationServerUrl, AccountId, OAuthDb, ProtocolFlag, OAuthResourceClient, ClientCredentials, PKCEValues, AccessToken, PaymentRequestOption, Source, Destination,
|
|
1
|
+
import { Account, Logger, FetchLike, Currency, Network, DestinationMaker, AuthorizationServerUrl, AccountId, OAuthDb, ProtocolFlag, OAuthResourceClient, ClientCredentials, PKCEValues, AccessToken, PaymentRequestOption, Source, Destination, AuthorizeResult } from '@atxp/common';
|
|
2
2
|
export { ATXPAccount, Account, AuthorizeResult, PaymentMaker } from '@atxp/common';
|
|
3
3
|
import { ClientOptions, Client } from '@modelcontextprotocol/sdk/client/index.js';
|
|
4
4
|
import { Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
@@ -468,9 +468,6 @@ declare class PassthroughDestinationMaker implements DestinationMaker {
|
|
|
468
468
|
makeDestinations(option: PaymentRequestOption, _logger: Logger, _paymentRequestId: string, _sources: Source[]): Promise<Destination[]>;
|
|
469
469
|
}
|
|
470
470
|
|
|
471
|
-
interface X402ProtocolHandlerConfig {
|
|
472
|
-
accountsServer?: string;
|
|
473
|
-
}
|
|
474
471
|
/**
|
|
475
472
|
* Protocol handler for X402 payment challenges.
|
|
476
473
|
*
|
|
@@ -479,8 +476,6 @@ interface X402ProtocolHandlerConfig {
|
|
|
479
476
|
*/
|
|
480
477
|
declare class X402ProtocolHandler implements ProtocolHandler {
|
|
481
478
|
readonly protocol = "x402";
|
|
482
|
-
private accountsServer;
|
|
483
|
-
constructor(config?: X402ProtocolHandlerConfig);
|
|
484
479
|
canHandle(response: Response): Promise<boolean>;
|
|
485
480
|
handlePaymentChallenge(response: Response, originalRequest: {
|
|
486
481
|
url: string | URL;
|
|
@@ -505,12 +500,6 @@ declare class ATXPProtocolHandler implements ProtocolHandler {
|
|
|
505
500
|
private extractPaymentRequests;
|
|
506
501
|
}
|
|
507
502
|
|
|
508
|
-
/**
|
|
509
|
-
* Configuration for MPP protocol handler.
|
|
510
|
-
*/
|
|
511
|
-
interface MPPProtocolHandlerConfig {
|
|
512
|
-
accountsServer?: string;
|
|
513
|
-
}
|
|
514
503
|
/**
|
|
515
504
|
* Protocol handler for MPP (Machine Payments Protocol) payment challenges.
|
|
516
505
|
*
|
|
@@ -518,13 +507,11 @@ interface MPPProtocolHandlerConfig {
|
|
|
518
507
|
* 1. HTTP level: HTTP 402 with WWW-Authenticate: Payment header
|
|
519
508
|
* 2. MCP level: JSON-RPC error with code -32042 containing MPP data
|
|
520
509
|
*
|
|
521
|
-
* Handles the challenge by calling /authorize/
|
|
510
|
+
* Handles the challenge by calling /authorize/auto on the accounts service
|
|
522
511
|
* and retrying with an Authorization: Payment header.
|
|
523
512
|
*/
|
|
524
513
|
declare class MPPProtocolHandler implements ProtocolHandler {
|
|
525
514
|
readonly protocol = "mpp";
|
|
526
|
-
private accountsServer;
|
|
527
|
-
constructor(config?: MPPProtocolHandlerConfig);
|
|
528
515
|
canHandle(response: Response): Promise<boolean>;
|
|
529
516
|
handlePaymentChallenge(response: Response, originalRequest: {
|
|
530
517
|
url: string | URL;
|
|
@@ -558,50 +545,6 @@ declare class MPPProtocolHandler implements ProtocolHandler {
|
|
|
558
545
|
* @returns New Headers object with protocol-specific payment headers added
|
|
559
546
|
*/
|
|
560
547
|
declare function buildPaymentHeaders(result: AuthorizeResult, originalHeaders?: HeadersInit): Headers;
|
|
561
|
-
/**
|
|
562
|
-
* Client for authorizing payments.
|
|
563
|
-
*
|
|
564
|
-
* Resolves the payment protocol via protocolFlag, then delegates to
|
|
565
|
-
* account.authorize() for the actual authorization logic.
|
|
566
|
-
*/
|
|
567
|
-
declare class PaymentClient {
|
|
568
|
-
private protocolFlag?;
|
|
569
|
-
private logger;
|
|
570
|
-
constructor(config: {
|
|
571
|
-
protocolFlag?: ProtocolFlag;
|
|
572
|
-
logger: Logger;
|
|
573
|
-
/** @deprecated No longer used — authorization delegates to account.authorize() */
|
|
574
|
-
accountsServer?: string;
|
|
575
|
-
/** @deprecated No longer used — authorization delegates to account.authorize() */
|
|
576
|
-
fetchFn?: FetchLike;
|
|
577
|
-
});
|
|
578
|
-
/**
|
|
579
|
-
* Authorize a payment by delegating to the account's authorize method.
|
|
580
|
-
*
|
|
581
|
-
* PaymentClient resolves the protocol (via explicit param or protocolFlag),
|
|
582
|
-
* then delegates all protocol-specific logic to account.authorize().
|
|
583
|
-
*
|
|
584
|
-
* @param params.account - The account to authorize the payment through
|
|
585
|
-
* @param params.userId - Passed to protocolFlag for protocol selection
|
|
586
|
-
* @param params.destination - Payment destination address
|
|
587
|
-
* @param params.protocol - Explicit protocol override (skips protocolFlag)
|
|
588
|
-
* @param params.amount - Payment amount
|
|
589
|
-
* @param params.memo - Payment memo
|
|
590
|
-
* @param params.paymentRequirements - X402 payment requirements
|
|
591
|
-
* @param params.challenge - MPP challenge object
|
|
592
|
-
* @returns AuthorizeResult with protocol and opaque credential
|
|
593
|
-
*/
|
|
594
|
-
authorize(params: {
|
|
595
|
-
account: Account;
|
|
596
|
-
userId: string;
|
|
597
|
-
destination: string;
|
|
598
|
-
protocol?: PaymentProtocol;
|
|
599
|
-
amount?: BigNumber;
|
|
600
|
-
memo?: string;
|
|
601
|
-
paymentRequirements?: unknown;
|
|
602
|
-
challenge?: unknown;
|
|
603
|
-
}): Promise<AuthorizeResult>;
|
|
604
|
-
}
|
|
605
548
|
|
|
606
|
-
export { ATXPDestinationMaker, ATXPLocalAccount, ATXPPaymentError, ATXPProtocolHandler, DEFAULT_CLIENT_CONFIG, GasEstimationError, InsufficientFundsError, MPPProtocolHandler, OAuthAuthenticationRequiredError, OAuthClient, POLYGON_AMOY, POLYGON_MAINNET, PassthroughDestinationMaker,
|
|
549
|
+
export { ATXPDestinationMaker, ATXPLocalAccount, ATXPPaymentError, ATXPProtocolHandler, DEFAULT_CLIENT_CONFIG, GasEstimationError, InsufficientFundsError, MPPProtocolHandler, OAuthAuthenticationRequiredError, OAuthClient, POLYGON_AMOY, POLYGON_MAINNET, PassthroughDestinationMaker, PaymentExpiredError, PaymentNetworkError, PaymentServerError, RpcError, TransactionRevertedError, USDC_CONTRACT_ADDRESS_POLYGON_AMOY, USDC_CONTRACT_ADDRESS_POLYGON_MAINNET, USDC_CONTRACT_ADDRESS_WORLD_MAINNET, USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA, UnsupportedCurrencyError, UserRejectedError, WORLD_CHAIN_MAINNET, WORLD_CHAIN_SEPOLIA, X402ProtocolHandler, atxpClient, atxpFetch, buildClientConfig, buildPaymentHeaders, buildStreamableTransport, getPolygonAmoyWithRPC, getPolygonByChainId, getPolygonMainnetWithRPC, getPolygonUSDCAddress, getWorldChainByChainId, getWorldChainMainnetWithRPC, getWorldChainSepoliaWithRPC, getWorldChainUSDCAddress };
|
|
607
550
|
export type { AccountIdString, ClientArgs, ClientConfig, FetchWrapper, Hex, OAuthClientConfig, PaymentFailureContext, PolygonChain, ProspectivePayment, ProtocolConfig, ProtocolHandler, WorldChain };
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,UAAU,EACX,MAAM,iBAAiB,CAAC;AAGzB,OAAO,EACL,gCAAgC,EAChC,KAAK,iBAAiB,EACt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O,EACL,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,mBAAmB,EACpB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EACL,kBAAkB,EACnB,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,mBAAmB,EACnB,KAAK,eAAe,EACrB,MAAM,qBAAqB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -24967,49 +24967,6 @@ function buildPaymentHeaders(result, originalHeaders) {
|
|
|
24967
24967
|
}
|
|
24968
24968
|
return headers;
|
|
24969
24969
|
}
|
|
24970
|
-
/**
|
|
24971
|
-
* Client for authorizing payments.
|
|
24972
|
-
*
|
|
24973
|
-
* Resolves the payment protocol via protocolFlag, then delegates to
|
|
24974
|
-
* account.authorize() for the actual authorization logic.
|
|
24975
|
-
*/
|
|
24976
|
-
class PaymentClient {
|
|
24977
|
-
constructor(config) {
|
|
24978
|
-
this.protocolFlag = config.protocolFlag;
|
|
24979
|
-
this.logger = config.logger;
|
|
24980
|
-
}
|
|
24981
|
-
/**
|
|
24982
|
-
* Authorize a payment by delegating to the account's authorize method.
|
|
24983
|
-
*
|
|
24984
|
-
* PaymentClient resolves the protocol (via explicit param or protocolFlag),
|
|
24985
|
-
* then delegates all protocol-specific logic to account.authorize().
|
|
24986
|
-
*
|
|
24987
|
-
* @param params.account - The account to authorize the payment through
|
|
24988
|
-
* @param params.userId - Passed to protocolFlag for protocol selection
|
|
24989
|
-
* @param params.destination - Payment destination address
|
|
24990
|
-
* @param params.protocol - Explicit protocol override (skips protocolFlag)
|
|
24991
|
-
* @param params.amount - Payment amount
|
|
24992
|
-
* @param params.memo - Payment memo
|
|
24993
|
-
* @param params.paymentRequirements - X402 payment requirements
|
|
24994
|
-
* @param params.challenge - MPP challenge object
|
|
24995
|
-
* @returns AuthorizeResult with protocol and opaque credential
|
|
24996
|
-
*/
|
|
24997
|
-
async authorize(params) {
|
|
24998
|
-
const { account, userId, destination } = params;
|
|
24999
|
-
// Determine protocol
|
|
25000
|
-
const protocol = params.protocol
|
|
25001
|
-
?? (this.protocolFlag ? this.protocolFlag(userId, destination) : 'atxp');
|
|
25002
|
-
// Delegate to the account's authorize method
|
|
25003
|
-
return account.authorize({
|
|
25004
|
-
protocol,
|
|
25005
|
-
amount: params.amount,
|
|
25006
|
-
destination,
|
|
25007
|
-
memo: params.memo,
|
|
25008
|
-
paymentRequirements: params.paymentRequirements,
|
|
25009
|
-
challenge: params.challenge,
|
|
25010
|
-
});
|
|
25011
|
-
}
|
|
25012
|
-
}
|
|
25013
24970
|
|
|
25014
24971
|
function isX402Challenge(obj) {
|
|
25015
24972
|
if (typeof obj !== 'object' || obj === null)
|
|
@@ -25025,9 +24982,8 @@ function isX402Challenge(obj) {
|
|
|
25025
24982
|
* Creates payment headers using the x402 library and retries the request.
|
|
25026
24983
|
*/
|
|
25027
24984
|
class X402ProtocolHandler {
|
|
25028
|
-
constructor(
|
|
24985
|
+
constructor() {
|
|
25029
24986
|
this.protocol = 'x402';
|
|
25030
|
-
this.accountsServer = config?.accountsServer ?? 'https://accounts.atxp.ai';
|
|
25031
24987
|
}
|
|
25032
24988
|
async canHandle(response) {
|
|
25033
24989
|
if (response.status !== 402)
|
|
@@ -25093,16 +25049,9 @@ class X402ProtocolHandler {
|
|
|
25093
25049
|
// Authorize via account.authorize() — ATXPAccount calls the accounts
|
|
25094
25050
|
// service, BaseAccount signs locally. No fallback — each account type
|
|
25095
25051
|
// handles authorization according to its capabilities.
|
|
25096
|
-
const
|
|
25097
|
-
|
|
25098
|
-
logger,
|
|
25099
|
-
fetchFn,
|
|
25100
|
-
});
|
|
25101
|
-
const authorizeResult = await client.authorize({
|
|
25102
|
-
account,
|
|
25103
|
-
userId: accountId,
|
|
25052
|
+
const authorizeResult = await account.authorize({
|
|
25053
|
+
protocols: ['x402'],
|
|
25104
25054
|
destination: url,
|
|
25105
|
-
protocol: 'x402',
|
|
25106
25055
|
paymentRequirements: selectedPaymentRequirements,
|
|
25107
25056
|
});
|
|
25108
25057
|
const paymentHeader = authorizeResult.credential;
|
|
@@ -25251,13 +25200,12 @@ class ATXPProtocolHandler {
|
|
|
25251
25200
|
* 1. HTTP level: HTTP 402 with WWW-Authenticate: Payment header
|
|
25252
25201
|
* 2. MCP level: JSON-RPC error with code -32042 containing MPP data
|
|
25253
25202
|
*
|
|
25254
|
-
* Handles the challenge by calling /authorize/
|
|
25203
|
+
* Handles the challenge by calling /authorize/auto on the accounts service
|
|
25255
25204
|
* and retrying with an Authorization: Payment header.
|
|
25256
25205
|
*/
|
|
25257
25206
|
class MPPProtocolHandler {
|
|
25258
|
-
constructor(
|
|
25207
|
+
constructor() {
|
|
25259
25208
|
this.protocol = 'mpp';
|
|
25260
|
-
this.accountsServer = config?.accountsServer ?? 'https://accounts.atxp.ai';
|
|
25261
25209
|
}
|
|
25262
25210
|
async canHandle(response) {
|
|
25263
25211
|
if (hasMPPChallenge(response))
|
|
@@ -25363,20 +25311,12 @@ class MPPProtocolHandler {
|
|
|
25363
25311
|
async authorizeAndRetry(challenge, prospectivePayment, originalRequest, config, bodyText, originalResponse) {
|
|
25364
25312
|
const { account, logger, fetchFn, onPayment } = config;
|
|
25365
25313
|
try {
|
|
25366
|
-
logger.debug('MPP: calling /authorize/
|
|
25367
|
-
const client = new PaymentClient({
|
|
25368
|
-
accountsServer: this.accountsServer,
|
|
25369
|
-
logger,
|
|
25370
|
-
fetchFn,
|
|
25371
|
-
});
|
|
25372
|
-
const accountId = await account.getAccountId();
|
|
25314
|
+
logger.debug('MPP: calling /authorize/auto on accounts service');
|
|
25373
25315
|
let authorizeResult;
|
|
25374
25316
|
try {
|
|
25375
|
-
authorizeResult = await
|
|
25376
|
-
|
|
25377
|
-
userId: accountId,
|
|
25317
|
+
authorizeResult = await account.authorize({
|
|
25318
|
+
protocols: ['mpp'],
|
|
25378
25319
|
destination: typeof originalRequest.url === 'string' ? originalRequest.url : originalRequest.url.toString(),
|
|
25379
|
-
protocol: 'mpp',
|
|
25380
25320
|
challenge,
|
|
25381
25321
|
});
|
|
25382
25322
|
}
|
|
@@ -25384,7 +25324,7 @@ class MPPProtocolHandler {
|
|
|
25384
25324
|
// AuthorizationError = server rejected the request (HTTP error from accounts)
|
|
25385
25325
|
// Other errors = data validation or network failure
|
|
25386
25326
|
if (authorizeError instanceof AuthorizationError) {
|
|
25387
|
-
logger.debug(`MPP:
|
|
25327
|
+
logger.debug(`MPP: authorize rejected (${authorizeError.statusCode}), returning original response`);
|
|
25388
25328
|
return this.reconstructResponse(bodyText, originalResponse);
|
|
25389
25329
|
}
|
|
25390
25330
|
throw authorizeError;
|
|
@@ -25419,5 +25359,5 @@ class MPPProtocolHandler {
|
|
|
25419
25359
|
}
|
|
25420
25360
|
}
|
|
25421
25361
|
|
|
25422
|
-
export { ATXPDestinationMaker, ATXPLocalAccount, ATXPPaymentError, ATXPProtocolHandler, DEFAULT_CLIENT_CONFIG, GasEstimationError, InsufficientFundsError, MPPProtocolHandler, OAuthAuthenticationRequiredError, OAuthClient, POLYGON_AMOY, POLYGON_MAINNET, PassthroughDestinationMaker,
|
|
25362
|
+
export { ATXPDestinationMaker, ATXPLocalAccount, ATXPPaymentError, ATXPProtocolHandler, DEFAULT_CLIENT_CONFIG, GasEstimationError, InsufficientFundsError, MPPProtocolHandler, OAuthAuthenticationRequiredError, OAuthClient, POLYGON_AMOY, POLYGON_MAINNET, PassthroughDestinationMaker, PaymentExpiredError, PaymentNetworkError, PaymentServerError, RpcError, TransactionRevertedError, USDC_CONTRACT_ADDRESS_POLYGON_AMOY, USDC_CONTRACT_ADDRESS_POLYGON_MAINNET, USDC_CONTRACT_ADDRESS_WORLD_MAINNET, USDC_CONTRACT_ADDRESS_WORLD_SEPOLIA, UnsupportedCurrencyError, UserRejectedError, WORLD_CHAIN_MAINNET, WORLD_CHAIN_SEPOLIA, X402ProtocolHandler, atxpClient, atxpFetch, buildClientConfig, buildPaymentHeaders, buildStreamableTransport, getPolygonAmoyWithRPC, getPolygonByChainId, getPolygonMainnetWithRPC, getPolygonUSDCAddress, getWorldChainByChainId, getWorldChainMainnetWithRPC, getWorldChainSepoliaWithRPC, getWorldChainUSDCAddress };
|
|
25423
25363
|
//# sourceMappingURL=index.js.map
|