@agirails/sdk 2.2.0 → 2.2.2
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/ACTPClient.d.ts +200 -0
- package/dist/ACTPClient.d.ts.map +1 -1
- package/dist/ACTPClient.js +266 -2
- package/dist/ACTPClient.js.map +1 -1
- package/dist/abi/ACTPKernel.json +16 -0
- package/dist/adapters/AdapterRegistry.d.ts +140 -0
- package/dist/adapters/AdapterRegistry.d.ts.map +1 -0
- package/dist/adapters/AdapterRegistry.js +166 -0
- package/dist/adapters/AdapterRegistry.js.map +1 -0
- package/dist/adapters/AdapterRouter.d.ts +165 -0
- package/dist/adapters/AdapterRouter.d.ts.map +1 -0
- package/dist/adapters/AdapterRouter.js +350 -0
- package/dist/adapters/AdapterRouter.js.map +1 -0
- package/dist/adapters/BaseAdapter.d.ts +17 -0
- package/dist/adapters/BaseAdapter.d.ts.map +1 -1
- package/dist/adapters/BaseAdapter.js +21 -0
- package/dist/adapters/BaseAdapter.js.map +1 -1
- package/dist/adapters/BasicAdapter.d.ts +72 -3
- package/dist/adapters/BasicAdapter.d.ts.map +1 -1
- package/dist/adapters/BasicAdapter.js +170 -2
- package/dist/adapters/BasicAdapter.js.map +1 -1
- package/dist/adapters/IAdapter.d.ts +230 -0
- package/dist/adapters/IAdapter.d.ts.map +1 -0
- package/dist/adapters/IAdapter.js +44 -0
- package/dist/adapters/IAdapter.js.map +1 -0
- package/dist/adapters/StandardAdapter.d.ts +70 -1
- package/dist/adapters/StandardAdapter.d.ts.map +1 -1
- package/dist/adapters/StandardAdapter.js +184 -0
- package/dist/adapters/StandardAdapter.js.map +1 -1
- package/dist/adapters/X402Adapter.d.ts +208 -0
- package/dist/adapters/X402Adapter.d.ts.map +1 -0
- package/dist/adapters/X402Adapter.js +423 -0
- package/dist/adapters/X402Adapter.js.map +1 -0
- package/dist/adapters/index.d.ts +8 -0
- package/dist/adapters/index.d.ts.map +1 -1
- package/dist/adapters/index.js +19 -1
- package/dist/adapters/index.js.map +1 -1
- package/dist/cli/commands/init.d.ts +4 -0
- package/dist/cli/commands/init.d.ts.map +1 -1
- package/dist/cli/commands/init.js +184 -4
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/config/networks.js +3 -3
- package/dist/config/networks.js.map +1 -1
- package/dist/erc8004/ERC8004Bridge.d.ts +155 -0
- package/dist/erc8004/ERC8004Bridge.d.ts.map +1 -0
- package/dist/erc8004/ERC8004Bridge.js +325 -0
- package/dist/erc8004/ERC8004Bridge.js.map +1 -0
- package/dist/erc8004/ReputationReporter.d.ts +223 -0
- package/dist/erc8004/ReputationReporter.d.ts.map +1 -0
- package/dist/erc8004/ReputationReporter.js +266 -0
- package/dist/erc8004/ReputationReporter.js.map +1 -0
- package/dist/erc8004/index.d.ts +36 -0
- package/dist/erc8004/index.d.ts.map +1 -0
- package/dist/erc8004/index.js +46 -0
- package/dist/erc8004/index.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +21 -2
- package/dist/index.js.map +1 -1
- package/dist/protocol/ACTPKernel.d.ts +1 -1
- package/dist/protocol/ACTPKernel.d.ts.map +1 -1
- package/dist/protocol/ACTPKernel.js +16 -7
- package/dist/protocol/ACTPKernel.js.map +1 -1
- package/dist/runtime/BlockchainRuntime.d.ts.map +1 -1
- package/dist/runtime/BlockchainRuntime.js +2 -0
- package/dist/runtime/BlockchainRuntime.js.map +1 -1
- package/dist/runtime/IACTPRuntime.d.ts +6 -0
- package/dist/runtime/IACTPRuntime.d.ts.map +1 -1
- package/dist/runtime/MockRuntime.d.ts +12 -0
- package/dist/runtime/MockRuntime.d.ts.map +1 -1
- package/dist/runtime/MockRuntime.js +41 -0
- package/dist/runtime/MockRuntime.js.map +1 -1
- package/dist/runtime/types/MockState.d.ts +6 -0
- package/dist/runtime/types/MockState.d.ts.map +1 -1
- package/dist/runtime/types/MockState.js.map +1 -1
- package/dist/types/adapter.d.ts +359 -0
- package/dist/types/adapter.d.ts.map +1 -0
- package/dist/types/adapter.js +115 -0
- package/dist/types/adapter.js.map +1 -0
- package/dist/types/erc8004.d.ts +184 -0
- package/dist/types/erc8004.d.ts.map +1 -0
- package/dist/types/erc8004.js +132 -0
- package/dist/types/erc8004.js.map +1 -0
- package/dist/types/index.d.ts +3 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -1
- package/dist/types/transaction.d.ts +12 -0
- package/dist/types/transaction.d.ts.map +1 -1
- package/dist/types/x402.d.ts +162 -0
- package/dist/types/x402.d.ts.map +1 -0
- package/dist/types/x402.js +162 -0
- package/dist/types/x402.js.map +1 -0
- package/package.json +3 -2
- package/src/ACTPClient.ts +318 -2
- package/src/abi/ACTPKernel.json +16 -0
- package/src/adapters/AdapterRegistry.ts +173 -0
- package/src/adapters/AdapterRouter.ts +417 -0
- package/src/adapters/BaseAdapter.ts +25 -0
- package/src/adapters/BasicAdapter.ts +199 -3
- package/src/adapters/IAdapter.ts +292 -0
- package/src/adapters/StandardAdapter.ts +220 -1
- package/src/adapters/X402Adapter.ts +653 -0
- package/src/adapters/index.ts +27 -0
- package/src/cli/commands/init.ts +208 -3
- package/src/config/networks.ts +3 -3
- package/src/erc8004/ERC8004Bridge.ts +461 -0
- package/src/erc8004/ReputationReporter.ts +472 -0
- package/src/erc8004/index.ts +61 -0
- package/src/index.ts +43 -0
- package/src/protocol/ACTPKernel.ts +26 -7
- package/src/runtime/BlockchainRuntime.ts +2 -0
- package/src/runtime/IACTPRuntime.ts +6 -0
- package/src/runtime/MockRuntime.ts +42 -0
- package/src/runtime/types/MockState.ts +7 -0
- package/src/types/adapter.ts +296 -0
- package/src/types/erc8004.ts +293 -0
- package/src/types/index.ts +3 -0
- package/src/types/transaction.ts +12 -0
- package/src/types/x402.ts +219 -0
|
@@ -59,6 +59,18 @@ class StandardAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
59
59
|
super(requesterAddress);
|
|
60
60
|
this.runtime = runtime;
|
|
61
61
|
this.easHelper = easHelper;
|
|
62
|
+
/**
|
|
63
|
+
* Adapter metadata for router selection.
|
|
64
|
+
*/
|
|
65
|
+
this.metadata = {
|
|
66
|
+
id: 'standard',
|
|
67
|
+
name: 'Standard Adapter',
|
|
68
|
+
usesEscrow: true,
|
|
69
|
+
supportsDisputes: true,
|
|
70
|
+
requiresIdentity: false,
|
|
71
|
+
settlementMode: 'timed', // Auto-release after dispute window
|
|
72
|
+
priority: 60, // Higher priority than basic (preferred when escrow required)
|
|
73
|
+
};
|
|
62
74
|
}
|
|
63
75
|
/**
|
|
64
76
|
* Create a transaction (INITIATED state, no escrow yet).
|
|
@@ -109,6 +121,7 @@ class StandardAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
109
121
|
deadline,
|
|
110
122
|
disputeWindow,
|
|
111
123
|
serviceDescription: params.serviceDescription,
|
|
124
|
+
agentId: params.agentId, // ERC-8004 agent ID for reputation reporting
|
|
112
125
|
});
|
|
113
126
|
}
|
|
114
127
|
/**
|
|
@@ -268,6 +281,177 @@ class StandardAdapter extends BaseAdapter_1.BaseAdapter {
|
|
|
268
281
|
async getTransaction(txId) {
|
|
269
282
|
return this.runtime.getTransaction(txId);
|
|
270
283
|
}
|
|
284
|
+
// ==========================================================================
|
|
285
|
+
// IAdapter Implementation
|
|
286
|
+
// ==========================================================================
|
|
287
|
+
/**
|
|
288
|
+
* Unified pay method for IAdapter interface.
|
|
289
|
+
*
|
|
290
|
+
* Creates transaction AND links escrow in one call.
|
|
291
|
+
*
|
|
292
|
+
* @param params - Unified payment parameters
|
|
293
|
+
* @returns Promise resolving to unified payment result
|
|
294
|
+
*/
|
|
295
|
+
async pay(params) {
|
|
296
|
+
// Validate using IAdapter validate()
|
|
297
|
+
this.validate(params);
|
|
298
|
+
// Map to StandardTransactionParams
|
|
299
|
+
const standardParams = {
|
|
300
|
+
provider: params.to,
|
|
301
|
+
amount: params.amount,
|
|
302
|
+
deadline: params.deadline,
|
|
303
|
+
disputeWindow: params.disputeWindow,
|
|
304
|
+
serviceDescription: params.description,
|
|
305
|
+
agentId: params.erc8004AgentId, // Pass ERC-8004 agent ID
|
|
306
|
+
};
|
|
307
|
+
// Create transaction
|
|
308
|
+
const txId = await this.createTransaction(standardParams);
|
|
309
|
+
// Link escrow (auto-transitions to COMMITTED)
|
|
310
|
+
await this.linkEscrow(txId);
|
|
311
|
+
// Fetch transaction for response
|
|
312
|
+
const tx = await this.runtime.getTransaction(txId);
|
|
313
|
+
if (!tx) {
|
|
314
|
+
throw new Error(`Transaction ${txId} not found after creation`);
|
|
315
|
+
}
|
|
316
|
+
const provider = this.validateAddress(params.to, 'to');
|
|
317
|
+
const deadline = tx.deadline;
|
|
318
|
+
return {
|
|
319
|
+
txId,
|
|
320
|
+
escrowId: txId,
|
|
321
|
+
adapter: this.metadata.id,
|
|
322
|
+
state: 'COMMITTED',
|
|
323
|
+
success: true,
|
|
324
|
+
amount: this.formatAmount(tx.amount),
|
|
325
|
+
releaseRequired: true, // ACTP requires explicit release()
|
|
326
|
+
provider,
|
|
327
|
+
requester: this.requesterAddress,
|
|
328
|
+
deadline: new Date(deadline * 1000).toISOString(),
|
|
329
|
+
erc8004AgentId: params.erc8004AgentId, // Return agent ID
|
|
330
|
+
};
|
|
331
|
+
}
|
|
332
|
+
/**
|
|
333
|
+
* Check if this adapter can handle the given parameters.
|
|
334
|
+
*
|
|
335
|
+
* StandardAdapter can handle any Ethereum address recipient.
|
|
336
|
+
*
|
|
337
|
+
* @param params - Payment parameters to check
|
|
338
|
+
* @returns True if params have a valid Ethereum address
|
|
339
|
+
*/
|
|
340
|
+
canHandle(params) {
|
|
341
|
+
// StandardAdapter handles Ethereum addresses only
|
|
342
|
+
if (typeof params.to !== 'string') {
|
|
343
|
+
return false;
|
|
344
|
+
}
|
|
345
|
+
// Check if it's an Ethereum address (0x-prefixed hex)
|
|
346
|
+
return /^0x[a-fA-F0-9]{40}$/.test(params.to);
|
|
347
|
+
}
|
|
348
|
+
/**
|
|
349
|
+
* Validate parameters before execution.
|
|
350
|
+
*
|
|
351
|
+
* @param params - Parameters to validate
|
|
352
|
+
* @throws {ValidationError} If params are invalid
|
|
353
|
+
*/
|
|
354
|
+
validate(params) {
|
|
355
|
+
// Validate address
|
|
356
|
+
this.validateAddress(params.to, 'to');
|
|
357
|
+
// Validate amount (will throw if invalid)
|
|
358
|
+
this.parseAmount(params.amount);
|
|
359
|
+
// Validate deadline if provided
|
|
360
|
+
if (params.deadline !== undefined) {
|
|
361
|
+
this.parseDeadline(params.deadline);
|
|
362
|
+
}
|
|
363
|
+
// Validate dispute window if provided
|
|
364
|
+
if (params.disputeWindow !== undefined) {
|
|
365
|
+
this.validateDisputeWindow(params.disputeWindow);
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Get transaction status by ID.
|
|
370
|
+
*
|
|
371
|
+
* Returns TransactionStatus with action hints.
|
|
372
|
+
*
|
|
373
|
+
* @param txId - Transaction ID
|
|
374
|
+
* @returns Promise resolving to transaction status
|
|
375
|
+
*/
|
|
376
|
+
async getStatus(txId) {
|
|
377
|
+
const tx = await this.runtime.getTransaction(txId);
|
|
378
|
+
if (!tx) {
|
|
379
|
+
throw new Error(`Transaction ${txId} not found`);
|
|
380
|
+
}
|
|
381
|
+
const now = this.runtime.time.now();
|
|
382
|
+
const disputeWindowEnds = tx.completedAt
|
|
383
|
+
? tx.completedAt + tx.disputeWindow
|
|
384
|
+
: undefined;
|
|
385
|
+
return {
|
|
386
|
+
state: tx.state,
|
|
387
|
+
canStartWork: tx.state === 'COMMITTED',
|
|
388
|
+
canDeliver: tx.state === 'IN_PROGRESS',
|
|
389
|
+
canRelease: tx.state === 'DELIVERED' &&
|
|
390
|
+
disputeWindowEnds !== undefined &&
|
|
391
|
+
now >= disputeWindowEnds,
|
|
392
|
+
canDispute: tx.state === 'DELIVERED' &&
|
|
393
|
+
disputeWindowEnds !== undefined &&
|
|
394
|
+
now < disputeWindowEnds,
|
|
395
|
+
amount: this.formatAmount(tx.amount),
|
|
396
|
+
deadline: new Date(tx.deadline * 1000).toISOString(),
|
|
397
|
+
disputeWindowEnds: disputeWindowEnds
|
|
398
|
+
? new Date(disputeWindowEnds * 1000).toISOString()
|
|
399
|
+
: undefined,
|
|
400
|
+
provider: tx.provider,
|
|
401
|
+
requester: tx.requester,
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
/**
|
|
405
|
+
* Transition to IN_PROGRESS state (provider starts work).
|
|
406
|
+
*
|
|
407
|
+
* @param txId - Transaction ID
|
|
408
|
+
*/
|
|
409
|
+
async startWork(txId) {
|
|
410
|
+
await this.runtime.transitionState(txId, 'IN_PROGRESS');
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Transition to DELIVERED state (provider completes work).
|
|
414
|
+
*
|
|
415
|
+
* When no proof is provided, fetches the transaction's actual disputeWindow
|
|
416
|
+
* and encodes it as proof. This ensures consistency with the dispute window
|
|
417
|
+
* specified at transaction creation time.
|
|
418
|
+
*
|
|
419
|
+
* @param txId - Transaction ID
|
|
420
|
+
* @param proof - Optional delivery proof (ABI-encoded dispute window).
|
|
421
|
+
* If not provided, uses transaction's disputeWindow.
|
|
422
|
+
*/
|
|
423
|
+
async deliver(txId, proof) {
|
|
424
|
+
let deliveryProof = proof;
|
|
425
|
+
if (!deliveryProof) {
|
|
426
|
+
// Fetch transaction to get its actual disputeWindow
|
|
427
|
+
const tx = await this.runtime.getTransaction(txId);
|
|
428
|
+
if (!tx) {
|
|
429
|
+
throw new Error(`Transaction ${txId} not found`);
|
|
430
|
+
}
|
|
431
|
+
// Use transaction's disputeWindow, not a default
|
|
432
|
+
deliveryProof = this.encodeDisputeWindowProof(tx.disputeWindow);
|
|
433
|
+
}
|
|
434
|
+
await this.runtime.transitionState(txId, 'DELIVERED', deliveryProof);
|
|
435
|
+
}
|
|
436
|
+
/**
|
|
437
|
+
* Release escrow funds (EXPLICIT settlement).
|
|
438
|
+
*
|
|
439
|
+
* Wrapper around releaseEscrow() for IAdapter interface.
|
|
440
|
+
*
|
|
441
|
+
* @param escrowId - Escrow ID (usually same as txId)
|
|
442
|
+
* @param attestationUID - Optional attestation UID for verification
|
|
443
|
+
*/
|
|
444
|
+
async release(escrowId, attestationUID) {
|
|
445
|
+
// Find txId from escrowId (they're usually the same)
|
|
446
|
+
const legacyMatch = escrowId.match(/^escrow-(.+)-\d+$/);
|
|
447
|
+
const txId = legacyMatch ? legacyMatch[1] : escrowId;
|
|
448
|
+
if (attestationUID) {
|
|
449
|
+
await this.releaseEscrow(escrowId, { txId, attestationUID });
|
|
450
|
+
}
|
|
451
|
+
else {
|
|
452
|
+
await this.releaseEscrow(escrowId);
|
|
453
|
+
}
|
|
454
|
+
}
|
|
271
455
|
}
|
|
272
456
|
exports.StandardAdapter = StandardAdapter;
|
|
273
457
|
//# sourceMappingURL=StandardAdapter.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StandardAdapter.js","sourceRoot":"","sources":["../../src/adapters/StandardAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,+CAA6D;
|
|
1
|
+
{"version":3,"file":"StandardAdapter.js","sourceRoot":"","sources":["../../src/adapters/StandardAdapter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AAEH,+CAA6D;AAoC7D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAa,eAAgB,SAAQ,yBAAW;IAc9C;;;;;;OAMG;IACH,YACU,OAAqB,EAC7B,gBAAwB,EAChB,SAAqB;QAE7B,KAAK,CAAC,gBAAgB,CAAC,CAAC;QAJhB,YAAO,GAAP,OAAO,CAAc;QAErB,cAAS,GAAT,SAAS,CAAY;QAvB/B;;WAEG;QACa,aAAQ,GAAoB;YAC1C,EAAE,EAAE,UAAU;YACd,IAAI,EAAE,kBAAkB;YACxB,UAAU,EAAE,IAAI;YAChB,gBAAgB,EAAE,IA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O escrow, NO state machine, NO disputes - just pay and receive.
|
|
6
|
+
*
|
|
7
|
+
* This is fundamentally different from ACTP:
|
|
8
|
+
* - ACTP: escrow → state machine → disputes → explicit release
|
|
9
|
+
* - x402: atomic payment → instant settlement → done
|
|
10
|
+
*
|
|
11
|
+
* Use x402 for:
|
|
12
|
+
* - Simple API calls (pay-per-request)
|
|
13
|
+
* - Instant delivery (response IS the delivery)
|
|
14
|
+
* - Low-value, high-frequency transactions
|
|
15
|
+
*
|
|
16
|
+
* Use ACTP for:
|
|
17
|
+
* - Complex services requiring verification
|
|
18
|
+
* - High-value transactions needing dispute protection
|
|
19
|
+
* - Multi-step deliveries
|
|
20
|
+
*
|
|
21
|
+
* @module adapters/X402Adapter
|
|
22
|
+
*/
|
|
23
|
+
import { BaseAdapter } from './BaseAdapter';
|
|
24
|
+
import { IAdapter, TransactionStatus } from './IAdapter';
|
|
25
|
+
import { AdapterMetadata, UnifiedPayParams, UnifiedPayResult } from '../types/adapter';
|
|
26
|
+
import { X402Network } from '../types/x402';
|
|
27
|
+
/** Type for fetch function (cross-platform compatible) */
|
|
28
|
+
export type FetchFunction = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
29
|
+
/**
|
|
30
|
+
* Transfer function for atomic payments.
|
|
31
|
+
*
|
|
32
|
+
* @param to - Recipient address
|
|
33
|
+
* @param amount - Amount in USDC wei (string)
|
|
34
|
+
* @returns Transaction hash as proof
|
|
35
|
+
*/
|
|
36
|
+
export type TransferFunction = (to: string, amount: string) => Promise<string>;
|
|
37
|
+
/** Supported HTTP methods for x402 requests */
|
|
38
|
+
export type X402HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
39
|
+
/**
|
|
40
|
+
* Extended payment parameters for x402 with full HTTP support.
|
|
41
|
+
*/
|
|
42
|
+
export interface X402PayParams extends UnifiedPayParams {
|
|
43
|
+
/** HTTP method (default: GET) */
|
|
44
|
+
method?: X402HttpMethod;
|
|
45
|
+
/** Custom request headers */
|
|
46
|
+
headers?: Record<string, string>;
|
|
47
|
+
/** Request body (string or object, will be JSON.stringify'd if object) */
|
|
48
|
+
body?: string | Record<string, unknown>;
|
|
49
|
+
/** Content-Type header (default: application/json for POST/PUT/PATCH with body) */
|
|
50
|
+
contentType?: string;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Configuration options for X402Adapter.
|
|
54
|
+
*/
|
|
55
|
+
export interface X402AdapterConfig {
|
|
56
|
+
/** Expected network for validation (must match server's X-Payment-Network) */
|
|
57
|
+
expectedNetwork: X402Network;
|
|
58
|
+
/** Transfer function for atomic payments (required) */
|
|
59
|
+
transferFn: TransferFunction;
|
|
60
|
+
/** Request timeout in milliseconds (default: 30000) */
|
|
61
|
+
requestTimeout?: number;
|
|
62
|
+
/** Custom fetch function for testing (default: global fetch) */
|
|
63
|
+
fetchFn?: FetchFunction;
|
|
64
|
+
/** Default headers to include in all requests */
|
|
65
|
+
defaultHeaders?: Record<string, string>;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* X402Adapter - Atomic HTTP payment protocol.
|
|
69
|
+
*
|
|
70
|
+
* Key characteristics:
|
|
71
|
+
* - usesEscrow: false (direct payment)
|
|
72
|
+
* - supportsDisputes: false (atomic = final)
|
|
73
|
+
* - settlementMode: 'atomic' (instant)
|
|
74
|
+
* - releaseRequired: false (no escrow to release)
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* const adapter = new X402Adapter(requesterAddress, {
|
|
79
|
+
* expectedNetwork: 'base-sepolia',
|
|
80
|
+
* transferFn: async (to, amount) => {
|
|
81
|
+
* const tx = await usdcContract.transfer(to, amount);
|
|
82
|
+
* return tx.hash;
|
|
83
|
+
* },
|
|
84
|
+
* });
|
|
85
|
+
*
|
|
86
|
+
* const result = await adapter.pay({
|
|
87
|
+
* to: 'https://api.provider.com/service',
|
|
88
|
+
* amount: '10', // Hint only, actual amount from 402
|
|
89
|
+
* });
|
|
90
|
+
*
|
|
91
|
+
* // That's it! No release() needed.
|
|
92
|
+
* console.log(result.response?.status); // 200
|
|
93
|
+
* console.log(result.releaseRequired); // false
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
export declare class X402Adapter extends BaseAdapter implements IAdapter {
|
|
97
|
+
private config;
|
|
98
|
+
/**
|
|
99
|
+
* Adapter metadata - atomic, no escrow.
|
|
100
|
+
*/
|
|
101
|
+
readonly metadata: AdapterMetadata;
|
|
102
|
+
private readonly timeout;
|
|
103
|
+
private readonly fetchFn;
|
|
104
|
+
private readonly defaultHeaders;
|
|
105
|
+
private readonly transferFn;
|
|
106
|
+
/** Local cache of payments for status lookups */
|
|
107
|
+
private readonly payments;
|
|
108
|
+
/**
|
|
109
|
+
* Creates a new X402Adapter instance.
|
|
110
|
+
*
|
|
111
|
+
* @param requesterAddress - The requester's Ethereum address
|
|
112
|
+
* @param config - X402-specific configuration
|
|
113
|
+
*/
|
|
114
|
+
constructor(requesterAddress: string, config: X402AdapterConfig);
|
|
115
|
+
/**
|
|
116
|
+
* Check if this adapter can handle the given parameters.
|
|
117
|
+
*
|
|
118
|
+
* X402Adapter handles HTTPS URLs only (security requirement).
|
|
119
|
+
*/
|
|
120
|
+
canHandle(params: UnifiedPayParams): boolean;
|
|
121
|
+
/**
|
|
122
|
+
* Validate parameters before execution.
|
|
123
|
+
*/
|
|
124
|
+
validate(params: UnifiedPayParams): void;
|
|
125
|
+
/**
|
|
126
|
+
* Execute atomic x402 payment flow with full HTTP support.
|
|
127
|
+
*
|
|
128
|
+
* 1. Request endpoint → get 402
|
|
129
|
+
* 2. Parse payment headers
|
|
130
|
+
* 3. Execute atomic USDC transfer
|
|
131
|
+
* 4. Retry with tx hash as proof (same method/headers/body)
|
|
132
|
+
* 5. Return response (settlement complete!)
|
|
133
|
+
*
|
|
134
|
+
* @param params - Payment parameters with optional HTTP method, headers, body
|
|
135
|
+
*/
|
|
136
|
+
pay(params: UnifiedPayParams | X402PayParams): Promise<UnifiedPayResult>;
|
|
137
|
+
/**
|
|
138
|
+
* Serialize request body to string.
|
|
139
|
+
*/
|
|
140
|
+
private serializeBody;
|
|
141
|
+
/**
|
|
142
|
+
* Get payment status by transaction hash.
|
|
143
|
+
*
|
|
144
|
+
* For atomic payments, status is simple:
|
|
145
|
+
* - If tx exists → SETTLED (atomic = instant settlement)
|
|
146
|
+
*/
|
|
147
|
+
getStatus(txId: string): Promise<TransactionStatus>;
|
|
148
|
+
/**
|
|
149
|
+
* Not applicable for atomic payments.
|
|
150
|
+
* @throws {Error} Always - x402 has no lifecycle
|
|
151
|
+
*/
|
|
152
|
+
startWork(_txId: string): Promise<void>;
|
|
153
|
+
/**
|
|
154
|
+
* Not applicable for atomic payments.
|
|
155
|
+
* @throws {Error} Always - x402 has no lifecycle
|
|
156
|
+
*/
|
|
157
|
+
deliver(_txId: string, _proof?: string): Promise<void>;
|
|
158
|
+
/**
|
|
159
|
+
* Not applicable for atomic payments.
|
|
160
|
+
* @throws {Error} Always - x402 has no escrow
|
|
161
|
+
*/
|
|
162
|
+
release(_escrowId: string, _attestationUID?: string): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Make an HTTP request with full options support.
|
|
165
|
+
*
|
|
166
|
+
* @param url - Request URL
|
|
167
|
+
* @param method - HTTP method
|
|
168
|
+
* @param customHeaders - Custom headers from request params
|
|
169
|
+
* @param body - Request body (optional)
|
|
170
|
+
* @param contentType - Content-Type header (optional)
|
|
171
|
+
* @param proofHeaders - Payment proof headers for retry (optional)
|
|
172
|
+
*/
|
|
173
|
+
private makeRequest;
|
|
174
|
+
/**
|
|
175
|
+
* Parse X-Payment-* headers from 402 response.
|
|
176
|
+
*/
|
|
177
|
+
private parsePaymentHeaders;
|
|
178
|
+
/**
|
|
179
|
+
* Validate payment address from header.
|
|
180
|
+
*/
|
|
181
|
+
private validatePaymentAddress;
|
|
182
|
+
/**
|
|
183
|
+
* Execute atomic payment - direct transfer to provider.
|
|
184
|
+
*
|
|
185
|
+
* This is the key difference from ACTP:
|
|
186
|
+
* - No escrow
|
|
187
|
+
* - No state machine
|
|
188
|
+
* - Just transfer and done
|
|
189
|
+
*/
|
|
190
|
+
private executeAtomicPayment;
|
|
191
|
+
/**
|
|
192
|
+
* Retry request with payment proof (tx hash).
|
|
193
|
+
* Uses the same HTTP method, headers, and body as the original request.
|
|
194
|
+
*
|
|
195
|
+
* @param endpoint - Request URL
|
|
196
|
+
* @param txHash - Payment transaction hash as proof
|
|
197
|
+
* @param method - Original HTTP method
|
|
198
|
+
* @param customHeaders - Original custom headers
|
|
199
|
+
* @param body - Original request body
|
|
200
|
+
* @param contentType - Original content-type
|
|
201
|
+
*/
|
|
202
|
+
private retryWithProof;
|
|
203
|
+
/**
|
|
204
|
+
* Create result for free services (200 on initial request).
|
|
205
|
+
*/
|
|
206
|
+
private createFreeServiceResult;
|
|
207
|
+
}
|
|
208
|
+
//# sourceMappingURL=X402Adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"X402Adapter.d.ts","sourceRoot":"","sources":["../../src/adapters/X402Adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,WAAW,EAAmB,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,iBAAiB,EAA2B,MAAM,YAAY,CAAC;AAClF,OAAO,EACL,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EACjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAML,WAAW,EAEZ,MAAM,eAAe,CAAC;AAMvB,0DAA0D;AAC1D,MAAM,MAAM,aAAa,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAEhG;;;;;;GAMG;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,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