@t402/core 2.3.0 → 2.4.0
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/cjs/client/index.d.ts +3 -2
- package/dist/cjs/client/index.js +70 -2
- package/dist/cjs/client/index.js.map +1 -1
- package/dist/cjs/facilitator/index.d.ts +2 -1
- package/dist/cjs/http/index.d.ts +13 -6
- package/dist/cjs/http/index.js +73 -3
- package/dist/cjs/http/index.js.map +1 -1
- package/dist/cjs/mechanisms-C7yK91d4.d.ts +1126 -0
- package/dist/cjs/server/index.d.ts +3 -2
- package/dist/cjs/server/index.js +67 -1
- package/dist/cjs/server/index.js.map +1 -1
- package/dist/cjs/{t402HTTPClient-GIweW6nh.d.ts → t402HTTPClient-DmkFydNG.d.ts} +1 -1
- package/dist/cjs/{t402HTTPResourceServer-CcpZF3af.d.ts → t402HTTPResourceServer-CybruqCk.d.ts} +1 -1
- package/dist/cjs/types/index.d.ts +2 -1
- package/dist/cjs/types/index.js +469 -2
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/cjs/types/v1/index.d.ts +2 -1
- package/dist/cjs/utils/index.d.ts +29 -2
- package/dist/cjs/utils/index.js +53 -0
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/esm/chunk-KPNYZYDS.mjs +100 -0
- package/dist/esm/chunk-KPNYZYDS.mjs.map +1 -0
- package/dist/esm/{chunk-3IUBYRYG.mjs → chunk-LJ4M5Z5U.mjs} +51 -1
- package/dist/esm/chunk-LJ4M5Z5U.mjs.map +1 -0
- package/dist/esm/{chunk-773TNE2Y.mjs → chunk-REMGOG6C.mjs} +16 -5
- package/dist/esm/{chunk-773TNE2Y.mjs.map → chunk-REMGOG6C.mjs.map} +1 -1
- package/dist/esm/client/index.d.mts +3 -2
- package/dist/esm/client/index.mjs +3 -2
- package/dist/esm/client/index.mjs.map +1 -1
- package/dist/esm/facilitator/index.d.mts +2 -1
- package/dist/esm/http/index.d.mts +13 -6
- package/dist/esm/http/index.mjs +3 -2
- package/dist/esm/mechanisms-C7yK91d4.d.mts +1126 -0
- package/dist/esm/server/index.d.mts +3 -2
- package/dist/esm/server/index.mjs +3 -2
- package/dist/esm/server/index.mjs.map +1 -1
- package/dist/esm/{t402HTTPClient-DbZqiMSO.d.mts → t402HTTPClient-Bgjn3TRU.d.mts} +1 -1
- package/dist/esm/{t402HTTPResourceServer-BbQ6HVBC.d.mts → t402HTTPResourceServer-DuZIzhRI.d.mts} +1 -1
- package/dist/esm/types/index.d.mts +2 -1
- package/dist/esm/types/index.mjs +304 -1
- package/dist/esm/types/index.mjs.map +1 -1
- package/dist/esm/types/v1/index.d.mts +2 -1
- package/dist/esm/utils/index.d.mts +29 -2
- package/dist/esm/utils/index.mjs +7 -1
- package/package.json +3 -3
- package/dist/cjs/mechanisms-B-vz5yOj.d.ts +0 -443
- package/dist/esm/chunk-3IUBYRYG.mjs.map +0 -1
- package/dist/esm/mechanisms-B-vz5yOj.d.mts +0 -443
|
@@ -0,0 +1,1126 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
type PaymentRequirementsV1 = {
|
|
4
|
+
scheme: string;
|
|
5
|
+
network: Network;
|
|
6
|
+
maxAmountRequired: string;
|
|
7
|
+
resource: string;
|
|
8
|
+
description: string;
|
|
9
|
+
mimeType: string;
|
|
10
|
+
outputSchema: Record<string, unknown>;
|
|
11
|
+
payTo: string;
|
|
12
|
+
maxTimeoutSeconds: number;
|
|
13
|
+
asset: string;
|
|
14
|
+
extra: Record<string, unknown>;
|
|
15
|
+
};
|
|
16
|
+
type PaymentRequiredV1 = {
|
|
17
|
+
t402Version: 1;
|
|
18
|
+
error?: string;
|
|
19
|
+
accepts: PaymentRequirementsV1[];
|
|
20
|
+
};
|
|
21
|
+
type PaymentPayloadV1 = {
|
|
22
|
+
t402Version: 1;
|
|
23
|
+
scheme: string;
|
|
24
|
+
network: Network;
|
|
25
|
+
payload: Record<string, unknown>;
|
|
26
|
+
};
|
|
27
|
+
type VerifyRequestV1 = {
|
|
28
|
+
paymentPayload: PaymentPayloadV1;
|
|
29
|
+
paymentRequirements: PaymentRequirementsV1;
|
|
30
|
+
};
|
|
31
|
+
type SettleRequestV1 = {
|
|
32
|
+
paymentPayload: PaymentPayloadV1;
|
|
33
|
+
paymentRequirements: PaymentRequirementsV1;
|
|
34
|
+
};
|
|
35
|
+
type SettleResponseV1 = {
|
|
36
|
+
success: boolean;
|
|
37
|
+
errorReason?: string;
|
|
38
|
+
payer?: string;
|
|
39
|
+
transaction: string;
|
|
40
|
+
network: Network;
|
|
41
|
+
};
|
|
42
|
+
type SupportedResponseV1 = {
|
|
43
|
+
kinds: {
|
|
44
|
+
t402Version: number;
|
|
45
|
+
scheme: string;
|
|
46
|
+
network: Network;
|
|
47
|
+
extra?: Record<string, unknown>;
|
|
48
|
+
}[];
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
interface ResourceServerExtension {
|
|
52
|
+
key: string;
|
|
53
|
+
enrichDeclaration?: (declaration: unknown, transportContext: unknown) => unknown;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* A2A (Agent-to-Agent) Transport Types
|
|
58
|
+
*
|
|
59
|
+
* Implements t402 payment flows over the Agent-to-Agent protocol
|
|
60
|
+
* using JSON-RPC messages and task-based state management.
|
|
61
|
+
*
|
|
62
|
+
* @see https://github.com/google-a2a/a2a-t402/v0.1
|
|
63
|
+
*/
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Payment status values used in A2A metadata
|
|
67
|
+
*/
|
|
68
|
+
type A2APaymentStatus = "payment-required" | "payment-rejected" | "payment-submitted" | "payment-verified" | "payment-completed" | "payment-failed";
|
|
69
|
+
/**
|
|
70
|
+
* A2A task states that correspond to payment states
|
|
71
|
+
*/
|
|
72
|
+
type A2ATaskState = "submitted" | "working" | "input-required" | "completed" | "canceled" | "failed" | "unknown";
|
|
73
|
+
/**
|
|
74
|
+
* A2A message part - text content
|
|
75
|
+
*/
|
|
76
|
+
interface A2ATextPart {
|
|
77
|
+
kind: "text";
|
|
78
|
+
text: string;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A2A message part - file content
|
|
82
|
+
*/
|
|
83
|
+
interface A2AFilePart {
|
|
84
|
+
kind: "file";
|
|
85
|
+
file: {
|
|
86
|
+
name?: string;
|
|
87
|
+
mimeType?: string;
|
|
88
|
+
bytes?: string;
|
|
89
|
+
uri?: string;
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* A2A message part - data content
|
|
94
|
+
*/
|
|
95
|
+
interface A2ADataPart {
|
|
96
|
+
kind: "data";
|
|
97
|
+
data: Record<string, unknown>;
|
|
98
|
+
}
|
|
99
|
+
type A2AMessagePart = A2ATextPart | A2AFilePart | A2ADataPart;
|
|
100
|
+
/**
|
|
101
|
+
* A2A payment metadata fields
|
|
102
|
+
*/
|
|
103
|
+
interface A2APaymentMetadata {
|
|
104
|
+
/** Current payment status */
|
|
105
|
+
"t402.payment.status"?: A2APaymentStatus;
|
|
106
|
+
/** Payment requirements (when status is payment-required) */
|
|
107
|
+
"t402.payment.required"?: PaymentRequired;
|
|
108
|
+
/** Payment payload (when status is payment-submitted) */
|
|
109
|
+
"t402.payment.payload"?: PaymentPayload;
|
|
110
|
+
/** Settlement receipts (when status is payment-completed or payment-failed) */
|
|
111
|
+
"t402.payment.receipts"?: SettleResponse[];
|
|
112
|
+
/** Error code (when status is payment-failed) */
|
|
113
|
+
"t402.payment.error"?: string;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* A2A message with payment metadata
|
|
117
|
+
*/
|
|
118
|
+
interface A2AMessage {
|
|
119
|
+
kind: "message";
|
|
120
|
+
messageId?: string;
|
|
121
|
+
role: "user" | "agent";
|
|
122
|
+
parts: A2AMessagePart[];
|
|
123
|
+
metadata?: A2APaymentMetadata & Record<string, unknown>;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A2A artifact (output from completed task)
|
|
127
|
+
*/
|
|
128
|
+
interface A2AArtifact {
|
|
129
|
+
kind: string;
|
|
130
|
+
name?: string;
|
|
131
|
+
mimeType?: string;
|
|
132
|
+
data?: string;
|
|
133
|
+
uri?: string;
|
|
134
|
+
metadata?: Record<string, unknown>;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* A2A task status
|
|
138
|
+
*/
|
|
139
|
+
interface A2ATaskStatus {
|
|
140
|
+
state: A2ATaskState;
|
|
141
|
+
message?: A2AMessage;
|
|
142
|
+
timestamp?: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* A2A task
|
|
146
|
+
*/
|
|
147
|
+
interface A2ATask {
|
|
148
|
+
kind: "task";
|
|
149
|
+
id: string;
|
|
150
|
+
sessionId?: string;
|
|
151
|
+
status: A2ATaskStatus;
|
|
152
|
+
artifacts?: A2AArtifact[];
|
|
153
|
+
history?: A2AMessage[];
|
|
154
|
+
metadata?: Record<string, unknown>;
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* A2A JSON-RPC request
|
|
158
|
+
*/
|
|
159
|
+
interface A2ARequest<T = unknown> {
|
|
160
|
+
jsonrpc: "2.0";
|
|
161
|
+
method: string;
|
|
162
|
+
id: string | number;
|
|
163
|
+
params?: T;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* A2A JSON-RPC response
|
|
167
|
+
*/
|
|
168
|
+
interface A2AResponse<T = unknown> {
|
|
169
|
+
jsonrpc: "2.0";
|
|
170
|
+
id: string | number;
|
|
171
|
+
result?: T;
|
|
172
|
+
error?: A2AError;
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* A2A JSON-RPC error
|
|
176
|
+
*/
|
|
177
|
+
interface A2AError {
|
|
178
|
+
code: number;
|
|
179
|
+
message: string;
|
|
180
|
+
data?: unknown;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* A2A extension declaration
|
|
184
|
+
*/
|
|
185
|
+
interface A2AExtension {
|
|
186
|
+
uri: string;
|
|
187
|
+
description?: string;
|
|
188
|
+
required?: boolean;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* A2A agent capabilities
|
|
192
|
+
*/
|
|
193
|
+
interface A2ACapabilities {
|
|
194
|
+
streaming?: boolean;
|
|
195
|
+
pushNotifications?: boolean;
|
|
196
|
+
stateTransitionHistory?: boolean;
|
|
197
|
+
extensions?: A2AExtension[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A2A agent card (service advertisement)
|
|
201
|
+
*/
|
|
202
|
+
interface A2AAgentCard {
|
|
203
|
+
name: string;
|
|
204
|
+
description?: string;
|
|
205
|
+
url: string;
|
|
206
|
+
provider?: {
|
|
207
|
+
organization?: string;
|
|
208
|
+
url?: string;
|
|
209
|
+
};
|
|
210
|
+
version?: string;
|
|
211
|
+
documentationUrl?: string;
|
|
212
|
+
capabilities?: A2ACapabilities;
|
|
213
|
+
authentication?: {
|
|
214
|
+
schemes: string[];
|
|
215
|
+
credentials?: string;
|
|
216
|
+
};
|
|
217
|
+
defaultInputModes?: string[];
|
|
218
|
+
defaultOutputModes?: string[];
|
|
219
|
+
skills?: A2ASkill[];
|
|
220
|
+
}
|
|
221
|
+
/**
|
|
222
|
+
* A2A skill definition
|
|
223
|
+
*/
|
|
224
|
+
interface A2ASkill {
|
|
225
|
+
id: string;
|
|
226
|
+
name: string;
|
|
227
|
+
description?: string;
|
|
228
|
+
tags?: string[];
|
|
229
|
+
examples?: string[];
|
|
230
|
+
inputModes?: string[];
|
|
231
|
+
outputModes?: string[];
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* T402 A2A extension URI
|
|
235
|
+
*/
|
|
236
|
+
declare const T402_A2A_EXTENSION_URI = "https://github.com/google-a2a/a2a-t402/v0.1";
|
|
237
|
+
/**
|
|
238
|
+
* HTTP header for A2A extension activation
|
|
239
|
+
*/
|
|
240
|
+
declare const A2A_EXTENSIONS_HEADER = "X-A2A-Extensions";
|
|
241
|
+
/**
|
|
242
|
+
* Check if a task is in a payment-required state
|
|
243
|
+
*/
|
|
244
|
+
declare function isPaymentRequired(task: A2ATask): boolean;
|
|
245
|
+
/**
|
|
246
|
+
* Check if a task has completed payment
|
|
247
|
+
*/
|
|
248
|
+
declare function isPaymentCompleted(task: A2ATask): boolean;
|
|
249
|
+
/**
|
|
250
|
+
* Check if a task has failed payment
|
|
251
|
+
*/
|
|
252
|
+
declare function isPaymentFailed(task: A2ATask): boolean;
|
|
253
|
+
/**
|
|
254
|
+
* Extract payment requirements from a task
|
|
255
|
+
*/
|
|
256
|
+
declare function getPaymentRequired(task: A2ATask): PaymentRequired | undefined;
|
|
257
|
+
/**
|
|
258
|
+
* Extract payment receipts from a task
|
|
259
|
+
*/
|
|
260
|
+
declare function getPaymentReceipts(task: A2ATask): SettleResponse[] | undefined;
|
|
261
|
+
/**
|
|
262
|
+
* Create a payment-required message
|
|
263
|
+
*/
|
|
264
|
+
declare function createPaymentRequiredMessage(paymentRequired: PaymentRequired, text?: string): A2AMessage;
|
|
265
|
+
/**
|
|
266
|
+
* Create a payment submission message
|
|
267
|
+
*/
|
|
268
|
+
declare function createPaymentSubmissionMessage(paymentPayload: PaymentPayload, text?: string): A2AMessage;
|
|
269
|
+
/**
|
|
270
|
+
* Create a payment completed message
|
|
271
|
+
*/
|
|
272
|
+
declare function createPaymentCompletedMessage(receipts: SettleResponse[], text?: string): A2AMessage;
|
|
273
|
+
/**
|
|
274
|
+
* Create a payment failed message
|
|
275
|
+
*/
|
|
276
|
+
declare function createPaymentFailedMessage(receipts: SettleResponse[], errorCode: string, text?: string): A2AMessage;
|
|
277
|
+
/**
|
|
278
|
+
* Create a T402 extension declaration for agent cards
|
|
279
|
+
*/
|
|
280
|
+
declare function createT402Extension(required?: boolean): A2AExtension;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Up-To Scheme Types
|
|
284
|
+
*
|
|
285
|
+
* The `upto` scheme authorizes transfer of up to a maximum amount,
|
|
286
|
+
* enabling usage-based billing where the final settlement amount
|
|
287
|
+
* is determined by actual usage.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* ```typescript
|
|
291
|
+
* // Client authorizes up to $1.00
|
|
292
|
+
* const requirements: UptoPaymentRequirements = {
|
|
293
|
+
* scheme: 'upto',
|
|
294
|
+
* network: 'eip155:8453',
|
|
295
|
+
* maxAmount: '1000000', // $1.00 in USDC
|
|
296
|
+
* minAmount: '10000', // $0.01 minimum
|
|
297
|
+
* asset: '0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913',
|
|
298
|
+
* payTo: '0x...',
|
|
299
|
+
* maxTimeoutSeconds: 300,
|
|
300
|
+
* extra: {
|
|
301
|
+
* unit: 'token',
|
|
302
|
+
* unitPrice: '100',
|
|
303
|
+
* },
|
|
304
|
+
* };
|
|
305
|
+
*
|
|
306
|
+
* // Server settles for actual usage ($0.15)
|
|
307
|
+
* const settlement: UptoSettlement = {
|
|
308
|
+
* settleAmount: '150000',
|
|
309
|
+
* usageDetails: {
|
|
310
|
+
* tokensGenerated: 1500,
|
|
311
|
+
* unitPrice: '100',
|
|
312
|
+
* },
|
|
313
|
+
* };
|
|
314
|
+
* ```
|
|
315
|
+
*/
|
|
316
|
+
|
|
317
|
+
/**
|
|
318
|
+
* Extended payment requirements for the upto scheme.
|
|
319
|
+
*/
|
|
320
|
+
interface UptoPaymentRequirements extends Omit<PaymentRequirements, "scheme" | "amount"> {
|
|
321
|
+
/** Scheme identifier - always 'upto' */
|
|
322
|
+
scheme: "upto";
|
|
323
|
+
/** Network identifier (CAIP-2 format) */
|
|
324
|
+
network: Network;
|
|
325
|
+
/** Maximum amount the client authorizes (in smallest denomination) */
|
|
326
|
+
maxAmount: string;
|
|
327
|
+
/** Minimum settlement amount (prevents dust payments) */
|
|
328
|
+
minAmount?: string;
|
|
329
|
+
/** Asset contract address or identifier */
|
|
330
|
+
asset: string;
|
|
331
|
+
/** Recipient address */
|
|
332
|
+
payTo: string;
|
|
333
|
+
/** Maximum time in seconds before payment expires */
|
|
334
|
+
maxTimeoutSeconds: number;
|
|
335
|
+
/** Additional scheme-specific data */
|
|
336
|
+
extra: UptoExtra;
|
|
337
|
+
}
|
|
338
|
+
/**
|
|
339
|
+
* Extra fields specific to the upto scheme.
|
|
340
|
+
*/
|
|
341
|
+
interface UptoExtra extends Record<string, unknown> {
|
|
342
|
+
/** Billing unit (e.g., 'token', 'request', 'second', 'byte') */
|
|
343
|
+
unit?: string;
|
|
344
|
+
/** Price per unit in smallest denomination */
|
|
345
|
+
unitPrice?: string;
|
|
346
|
+
/** EIP-712 domain name (for EVM) */
|
|
347
|
+
name?: string;
|
|
348
|
+
/** EIP-712 domain version (for EVM) */
|
|
349
|
+
version?: string;
|
|
350
|
+
/** Router contract address (for EVM) */
|
|
351
|
+
routerAddress?: string;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Base payload structure for upto scheme.
|
|
355
|
+
*/
|
|
356
|
+
interface UptoPayloadBase {
|
|
357
|
+
/** Unique nonce to prevent replay attacks */
|
|
358
|
+
nonce: string;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* EVM-specific upto payload using EIP-2612 Permit.
|
|
362
|
+
*/
|
|
363
|
+
interface UptoEvmPayload extends UptoPayloadBase {
|
|
364
|
+
/** EIP-2612 permit signature components */
|
|
365
|
+
signature: {
|
|
366
|
+
v: number;
|
|
367
|
+
r: `0x${string}`;
|
|
368
|
+
s: `0x${string}`;
|
|
369
|
+
};
|
|
370
|
+
/** Permit authorization parameters */
|
|
371
|
+
authorization: {
|
|
372
|
+
/** Token owner address */
|
|
373
|
+
owner: `0x${string}`;
|
|
374
|
+
/** Spender address (router contract) */
|
|
375
|
+
spender: `0x${string}`;
|
|
376
|
+
/** Maximum authorized value */
|
|
377
|
+
value: string;
|
|
378
|
+
/** Permit deadline (unix timestamp) */
|
|
379
|
+
deadline: string;
|
|
380
|
+
/** Permit nonce (from token contract) */
|
|
381
|
+
nonce: number;
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Alternative EVM payload with combined signature.
|
|
386
|
+
*/
|
|
387
|
+
interface UptoEvmPayloadCompact extends UptoPayloadBase {
|
|
388
|
+
/** Combined EIP-2612 permit signature */
|
|
389
|
+
signature: `0x${string}`;
|
|
390
|
+
/** Permit authorization parameters */
|
|
391
|
+
authorization: {
|
|
392
|
+
owner: `0x${string}`;
|
|
393
|
+
spender: `0x${string}`;
|
|
394
|
+
value: string;
|
|
395
|
+
deadline: string;
|
|
396
|
+
nonce: number;
|
|
397
|
+
};
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Settlement request for upto scheme.
|
|
401
|
+
*/
|
|
402
|
+
interface UptoSettlement {
|
|
403
|
+
/** Actual amount to settle (must be <= maxAmount) */
|
|
404
|
+
settleAmount: string;
|
|
405
|
+
/** Optional usage details for auditing */
|
|
406
|
+
usageDetails?: UptoUsageDetails;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Usage details for settlement auditing.
|
|
410
|
+
*/
|
|
411
|
+
interface UptoUsageDetails {
|
|
412
|
+
/** Number of units consumed */
|
|
413
|
+
unitsConsumed?: number;
|
|
414
|
+
/** Price per unit used */
|
|
415
|
+
unitPrice?: string;
|
|
416
|
+
/** Type of unit */
|
|
417
|
+
unitType?: string;
|
|
418
|
+
/** Start timestamp of usage period */
|
|
419
|
+
startTime?: number;
|
|
420
|
+
/** End timestamp of usage period */
|
|
421
|
+
endTime?: number;
|
|
422
|
+
/** Additional metadata */
|
|
423
|
+
metadata?: Record<string, unknown>;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* Settlement response for upto scheme.
|
|
427
|
+
*/
|
|
428
|
+
interface UptoSettlementResponse {
|
|
429
|
+
/** Whether settlement was successful */
|
|
430
|
+
success: boolean;
|
|
431
|
+
/** Transaction hash (if on-chain) */
|
|
432
|
+
transactionHash?: string;
|
|
433
|
+
/** Actual amount settled */
|
|
434
|
+
settledAmount: string;
|
|
435
|
+
/** Maximum amount that was authorized */
|
|
436
|
+
maxAmount: string;
|
|
437
|
+
/** Block number (if on-chain) */
|
|
438
|
+
blockNumber?: number;
|
|
439
|
+
/** Gas used (if on-chain) */
|
|
440
|
+
gasUsed?: string;
|
|
441
|
+
/** Error message if failed */
|
|
442
|
+
error?: string;
|
|
443
|
+
}
|
|
444
|
+
/**
|
|
445
|
+
* Validation result for upto payment.
|
|
446
|
+
*/
|
|
447
|
+
interface UptoValidationResult {
|
|
448
|
+
/** Whether the payment is valid */
|
|
449
|
+
isValid: boolean;
|
|
450
|
+
/** Reason if invalid */
|
|
451
|
+
invalidReason?: string;
|
|
452
|
+
/** Validated maximum amount */
|
|
453
|
+
validatedMaxAmount?: string;
|
|
454
|
+
/** Payer address */
|
|
455
|
+
payer?: string;
|
|
456
|
+
/** Expiration timestamp */
|
|
457
|
+
expiresAt?: number;
|
|
458
|
+
}
|
|
459
|
+
/**
|
|
460
|
+
* Type guard for UptoPaymentRequirements.
|
|
461
|
+
*
|
|
462
|
+
* @param requirements - The value to check
|
|
463
|
+
* @returns True if the value is UptoPaymentRequirements
|
|
464
|
+
*/
|
|
465
|
+
declare function isUptoPaymentRequirements(requirements: unknown): requirements is UptoPaymentRequirements;
|
|
466
|
+
/**
|
|
467
|
+
* Type guard for UptoEvmPayload.
|
|
468
|
+
*
|
|
469
|
+
* @param payload - The value to check
|
|
470
|
+
* @returns True if the value is UptoEvmPayload
|
|
471
|
+
*/
|
|
472
|
+
declare function isUptoEvmPayload(payload: unknown): payload is UptoEvmPayload;
|
|
473
|
+
/**
|
|
474
|
+
* Constants for upto scheme.
|
|
475
|
+
*/
|
|
476
|
+
declare const UPTO_SCHEME: "upto";
|
|
477
|
+
declare const UPTO_DEFAULTS: {
|
|
478
|
+
/** Default minimum settlement amount (prevents dust) */
|
|
479
|
+
readonly MIN_AMOUNT: "1000";
|
|
480
|
+
/** Default maximum timeout in seconds (5 minutes) */
|
|
481
|
+
readonly MAX_TIMEOUT_SECONDS: 300;
|
|
482
|
+
/** Supported billing units */
|
|
483
|
+
readonly UNITS: readonly ["token", "request", "second", "minute", "byte", "kb", "mb"];
|
|
484
|
+
};
|
|
485
|
+
type UptoUnit = (typeof UPTO_DEFAULTS.UNITS)[number];
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Standardized T402 error codes returned by the facilitator API.
|
|
489
|
+
* Error codes follow the format T402-XYYY where X is the category (1-8)
|
|
490
|
+
* and YYY is the specific error within that category.
|
|
491
|
+
*/
|
|
492
|
+
declare const ERR_INVALID_REQUEST: "T402-1001";
|
|
493
|
+
declare const ERR_MISSING_PAYLOAD: "T402-1002";
|
|
494
|
+
declare const ERR_MISSING_REQUIREMENTS: "T402-1003";
|
|
495
|
+
declare const ERR_INVALID_PAYLOAD: "T402-1004";
|
|
496
|
+
declare const ERR_INVALID_REQUIREMENTS: "T402-1005";
|
|
497
|
+
declare const ERR_INVALID_SIGNATURE: "T402-1006";
|
|
498
|
+
declare const ERR_INVALID_NETWORK: "T402-1007";
|
|
499
|
+
declare const ERR_INVALID_SCHEME: "T402-1008";
|
|
500
|
+
declare const ERR_INVALID_AMOUNT: "T402-1009";
|
|
501
|
+
declare const ERR_INVALID_ADDRESS: "T402-1010";
|
|
502
|
+
declare const ERR_EXPIRED_PAYMENT: "T402-1011";
|
|
503
|
+
declare const ERR_INVALID_NONCE: "T402-1012";
|
|
504
|
+
declare const ERR_INSUFFICIENT_AMOUNT: "T402-1013";
|
|
505
|
+
declare const ERR_INVALID_IDEMPOTENCY_KEY: "T402-1014";
|
|
506
|
+
declare const ERR_SIGNATURE_EXPIRED: "T402-1015";
|
|
507
|
+
declare const ERR_INTERNAL: "T402-2001";
|
|
508
|
+
declare const ERR_DATABASE_UNAVAILABLE: "T402-2002";
|
|
509
|
+
declare const ERR_CACHE_UNAVAILABLE: "T402-2003";
|
|
510
|
+
declare const ERR_RPC_UNAVAILABLE: "T402-2004";
|
|
511
|
+
declare const ERR_RATE_LIMITED: "T402-2005";
|
|
512
|
+
declare const ERR_SERVICE_UNAVAILABLE: "T402-2006";
|
|
513
|
+
declare const ERR_VERIFICATION_FAILED: "T402-3001";
|
|
514
|
+
declare const ERR_SETTLEMENT_FAILED: "T402-3002";
|
|
515
|
+
declare const ERR_INSUFFICIENT_BALANCE: "T402-3003";
|
|
516
|
+
declare const ERR_ALLOWANCE_INSUFFICIENT: "T402-3004";
|
|
517
|
+
declare const ERR_PAYMENT_MISMATCH: "T402-3005";
|
|
518
|
+
declare const ERR_DUPLICATE_PAYMENT: "T402-3006";
|
|
519
|
+
declare const ERR_SETTLEMENT_PENDING: "T402-3007";
|
|
520
|
+
declare const ERR_SETTLEMENT_TIMEOUT: "T402-3008";
|
|
521
|
+
declare const ERR_NONCE_REPLAY: "T402-3009";
|
|
522
|
+
declare const ERR_IDEMPOTENCY_CONFLICT: "T402-3010";
|
|
523
|
+
declare const ERR_IDEMPOTENCY_UNAVAILABLE: "T402-3011";
|
|
524
|
+
declare const ERR_PREVIOUS_REQUEST_FAILED: "T402-3012";
|
|
525
|
+
declare const ERR_REQUEST_IN_PROGRESS: "T402-3013";
|
|
526
|
+
declare const ERR_CHAIN_UNAVAILABLE: "T402-4001";
|
|
527
|
+
declare const ERR_TRANSACTION_FAILED: "T402-4002";
|
|
528
|
+
declare const ERR_TRANSACTION_REVERTED: "T402-4003";
|
|
529
|
+
declare const ERR_GAS_ESTIMATION_FAILED: "T402-4004";
|
|
530
|
+
declare const ERR_NONCE_CONFLICT: "T402-4005";
|
|
531
|
+
declare const ERR_CHAIN_CONGESTED: "T402-4006";
|
|
532
|
+
declare const ERR_CONTRACT_ERROR: "T402-4007";
|
|
533
|
+
declare const ERR_BRIDGE_UNAVAILABLE: "T402-5001";
|
|
534
|
+
declare const ERR_BRIDGE_QUOTE_FAILED: "T402-5002";
|
|
535
|
+
declare const ERR_BRIDGE_TRANSFER_FAILED: "T402-5003";
|
|
536
|
+
declare const ERR_BRIDGE_TIMEOUT: "T402-5004";
|
|
537
|
+
declare const ERR_UNSUPPORTED_ROUTE: "T402-5005";
|
|
538
|
+
declare const ERR_STREAM_NOT_FOUND: "T402-6001";
|
|
539
|
+
declare const ERR_STREAM_ALREADY_CLOSED: "T402-6002";
|
|
540
|
+
declare const ERR_STREAM_ALREADY_PAUSED: "T402-6003";
|
|
541
|
+
declare const ERR_STREAM_NOT_PAUSED: "T402-6004";
|
|
542
|
+
declare const ERR_STREAM_AMOUNT_EXCEEDED: "T402-6005";
|
|
543
|
+
declare const ERR_STREAM_EXPIRED: "T402-6006";
|
|
544
|
+
declare const ERR_STREAM_INVALID_STATE: "T402-6007";
|
|
545
|
+
declare const ERR_STREAM_RATE_LIMITED: "T402-6008";
|
|
546
|
+
declare const ERR_INTENT_NOT_FOUND: "T402-7001";
|
|
547
|
+
declare const ERR_INTENT_ALREADY_EXECUTED: "T402-7002";
|
|
548
|
+
declare const ERR_INTENT_CANCELLED: "T402-7003";
|
|
549
|
+
declare const ERR_INTENT_EXPIRED: "T402-7004";
|
|
550
|
+
declare const ERR_NO_ROUTES_AVAILABLE: "T402-7005";
|
|
551
|
+
declare const ERR_ROUTE_EXPIRED: "T402-7006";
|
|
552
|
+
declare const ERR_ROUTE_NOT_SELECTED: "T402-7007";
|
|
553
|
+
declare const ERR_INTENT_INVALID_STATE: "T402-7008";
|
|
554
|
+
declare const ERR_RESOURCE_NOT_FOUND: "T402-8001";
|
|
555
|
+
declare const ERR_RESOURCE_ALREADY_EXISTS: "T402-8002";
|
|
556
|
+
declare const ERR_INVALID_PARAMETERS: "T402-8003";
|
|
557
|
+
declare const ERR_NOT_AUTHORIZED: "T402-8004";
|
|
558
|
+
/** Union type of all T402 error codes */
|
|
559
|
+
type ErrorCode = typeof ERR_INVALID_REQUEST | typeof ERR_MISSING_PAYLOAD | typeof ERR_MISSING_REQUIREMENTS | typeof ERR_INVALID_PAYLOAD | typeof ERR_INVALID_REQUIREMENTS | typeof ERR_INVALID_SIGNATURE | typeof ERR_INVALID_NETWORK | typeof ERR_INVALID_SCHEME | typeof ERR_INVALID_AMOUNT | typeof ERR_INVALID_ADDRESS | typeof ERR_EXPIRED_PAYMENT | typeof ERR_INVALID_NONCE | typeof ERR_INSUFFICIENT_AMOUNT | typeof ERR_INVALID_IDEMPOTENCY_KEY | typeof ERR_SIGNATURE_EXPIRED | typeof ERR_INTERNAL | typeof ERR_DATABASE_UNAVAILABLE | typeof ERR_CACHE_UNAVAILABLE | typeof ERR_RPC_UNAVAILABLE | typeof ERR_RATE_LIMITED | typeof ERR_SERVICE_UNAVAILABLE | typeof ERR_VERIFICATION_FAILED | typeof ERR_SETTLEMENT_FAILED | typeof ERR_INSUFFICIENT_BALANCE | typeof ERR_ALLOWANCE_INSUFFICIENT | typeof ERR_PAYMENT_MISMATCH | typeof ERR_DUPLICATE_PAYMENT | typeof ERR_SETTLEMENT_PENDING | typeof ERR_SETTLEMENT_TIMEOUT | typeof ERR_NONCE_REPLAY | typeof ERR_IDEMPOTENCY_CONFLICT | typeof ERR_IDEMPOTENCY_UNAVAILABLE | typeof ERR_PREVIOUS_REQUEST_FAILED | typeof ERR_REQUEST_IN_PROGRESS | typeof ERR_CHAIN_UNAVAILABLE | typeof ERR_TRANSACTION_FAILED | typeof ERR_TRANSACTION_REVERTED | typeof ERR_GAS_ESTIMATION_FAILED | typeof ERR_NONCE_CONFLICT | typeof ERR_CHAIN_CONGESTED | typeof ERR_CONTRACT_ERROR | typeof ERR_BRIDGE_UNAVAILABLE | typeof ERR_BRIDGE_QUOTE_FAILED | typeof ERR_BRIDGE_TRANSFER_FAILED | typeof ERR_BRIDGE_TIMEOUT | typeof ERR_UNSUPPORTED_ROUTE | typeof ERR_STREAM_NOT_FOUND | typeof ERR_STREAM_ALREADY_CLOSED | typeof ERR_STREAM_ALREADY_PAUSED | typeof ERR_STREAM_NOT_PAUSED | typeof ERR_STREAM_AMOUNT_EXCEEDED | typeof ERR_STREAM_EXPIRED | typeof ERR_STREAM_INVALID_STATE | typeof ERR_STREAM_RATE_LIMITED | typeof ERR_INTENT_NOT_FOUND | typeof ERR_INTENT_ALREADY_EXECUTED | typeof ERR_INTENT_CANCELLED | typeof ERR_INTENT_EXPIRED | typeof ERR_NO_ROUTES_AVAILABLE | typeof ERR_ROUTE_EXPIRED | typeof ERR_ROUTE_NOT_SELECTED | typeof ERR_INTENT_INVALID_STATE | typeof ERR_RESOURCE_NOT_FOUND | typeof ERR_RESOURCE_ALREADY_EXISTS | typeof ERR_INVALID_PARAMETERS | typeof ERR_NOT_AUTHORIZED;
|
|
560
|
+
/** Structured error response from the facilitator API */
|
|
561
|
+
interface APIError {
|
|
562
|
+
code: ErrorCode;
|
|
563
|
+
message: string;
|
|
564
|
+
details?: string;
|
|
565
|
+
retry?: boolean;
|
|
566
|
+
}
|
|
567
|
+
/** Returns the HTTP status code for a given error code */
|
|
568
|
+
declare function httpStatusForCode(code: ErrorCode): number;
|
|
569
|
+
/** Returns true if the error code is a client error (T402-1xxx) */
|
|
570
|
+
declare function isClientError(code: ErrorCode): boolean;
|
|
571
|
+
/** Returns true if the error code is a server error (T402-2xxx) */
|
|
572
|
+
declare function isServerError(code: ErrorCode): boolean;
|
|
573
|
+
/** Returns true if the error code is a facilitator error (T402-3xxx) */
|
|
574
|
+
declare function isFacilitatorError(code: ErrorCode): boolean;
|
|
575
|
+
/** Returns true if the error code is a chain error (T402-4xxx) */
|
|
576
|
+
declare function isChainError(code: ErrorCode): boolean;
|
|
577
|
+
/** Returns true if the error code is a bridge error (T402-5xxx) */
|
|
578
|
+
declare function isBridgeError(code: ErrorCode): boolean;
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* Zod schemas for T402 protocol types.
|
|
582
|
+
* Used for runtime validation of incoming data.
|
|
583
|
+
*/
|
|
584
|
+
declare const NetworkSchema: z.ZodString;
|
|
585
|
+
declare const ResourceInfoSchema: z.ZodObject<{
|
|
586
|
+
url: z.ZodString;
|
|
587
|
+
description: z.ZodOptional<z.ZodString>;
|
|
588
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
589
|
+
}, "strip", z.ZodTypeAny, {
|
|
590
|
+
url: string;
|
|
591
|
+
description?: string | undefined;
|
|
592
|
+
mimeType?: string | undefined;
|
|
593
|
+
}, {
|
|
594
|
+
url: string;
|
|
595
|
+
description?: string | undefined;
|
|
596
|
+
mimeType?: string | undefined;
|
|
597
|
+
}>;
|
|
598
|
+
declare const PaymentRequirementsSchema: z.ZodObject<{
|
|
599
|
+
scheme: z.ZodString;
|
|
600
|
+
network: z.ZodString;
|
|
601
|
+
asset: z.ZodString;
|
|
602
|
+
amount: z.ZodString;
|
|
603
|
+
payTo: z.ZodString;
|
|
604
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
605
|
+
extra: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
606
|
+
}, "strip", z.ZodTypeAny, {
|
|
607
|
+
scheme: string;
|
|
608
|
+
amount: string;
|
|
609
|
+
network: string;
|
|
610
|
+
asset: string;
|
|
611
|
+
payTo: string;
|
|
612
|
+
maxTimeoutSeconds: number;
|
|
613
|
+
extra: Record<string, unknown>;
|
|
614
|
+
}, {
|
|
615
|
+
scheme: string;
|
|
616
|
+
amount: string;
|
|
617
|
+
network: string;
|
|
618
|
+
asset: string;
|
|
619
|
+
payTo: string;
|
|
620
|
+
maxTimeoutSeconds: number;
|
|
621
|
+
extra: Record<string, unknown>;
|
|
622
|
+
}>;
|
|
623
|
+
declare const PaymentRequiredSchema: z.ZodObject<{
|
|
624
|
+
t402Version: z.ZodLiteral<2>;
|
|
625
|
+
error: z.ZodOptional<z.ZodString>;
|
|
626
|
+
resource: z.ZodObject<{
|
|
627
|
+
url: z.ZodString;
|
|
628
|
+
description: z.ZodOptional<z.ZodString>;
|
|
629
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
630
|
+
}, "strip", z.ZodTypeAny, {
|
|
631
|
+
url: string;
|
|
632
|
+
description?: string | undefined;
|
|
633
|
+
mimeType?: string | undefined;
|
|
634
|
+
}, {
|
|
635
|
+
url: string;
|
|
636
|
+
description?: string | undefined;
|
|
637
|
+
mimeType?: string | undefined;
|
|
638
|
+
}>;
|
|
639
|
+
accepts: z.ZodArray<z.ZodObject<{
|
|
640
|
+
scheme: z.ZodString;
|
|
641
|
+
network: z.ZodString;
|
|
642
|
+
asset: z.ZodString;
|
|
643
|
+
amount: z.ZodString;
|
|
644
|
+
payTo: z.ZodString;
|
|
645
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
646
|
+
extra: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
647
|
+
}, "strip", z.ZodTypeAny, {
|
|
648
|
+
scheme: string;
|
|
649
|
+
amount: string;
|
|
650
|
+
network: string;
|
|
651
|
+
asset: string;
|
|
652
|
+
payTo: string;
|
|
653
|
+
maxTimeoutSeconds: number;
|
|
654
|
+
extra: Record<string, unknown>;
|
|
655
|
+
}, {
|
|
656
|
+
scheme: string;
|
|
657
|
+
amount: string;
|
|
658
|
+
network: string;
|
|
659
|
+
asset: string;
|
|
660
|
+
payTo: string;
|
|
661
|
+
maxTimeoutSeconds: number;
|
|
662
|
+
extra: Record<string, unknown>;
|
|
663
|
+
}>, "many">;
|
|
664
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
665
|
+
}, "strip", z.ZodTypeAny, {
|
|
666
|
+
t402Version: 2;
|
|
667
|
+
resource: {
|
|
668
|
+
url: string;
|
|
669
|
+
description?: string | undefined;
|
|
670
|
+
mimeType?: string | undefined;
|
|
671
|
+
};
|
|
672
|
+
accepts: {
|
|
673
|
+
scheme: string;
|
|
674
|
+
amount: string;
|
|
675
|
+
network: string;
|
|
676
|
+
asset: string;
|
|
677
|
+
payTo: string;
|
|
678
|
+
maxTimeoutSeconds: number;
|
|
679
|
+
extra: Record<string, unknown>;
|
|
680
|
+
}[];
|
|
681
|
+
error?: string | undefined;
|
|
682
|
+
extensions?: Record<string, unknown> | undefined;
|
|
683
|
+
}, {
|
|
684
|
+
t402Version: 2;
|
|
685
|
+
resource: {
|
|
686
|
+
url: string;
|
|
687
|
+
description?: string | undefined;
|
|
688
|
+
mimeType?: string | undefined;
|
|
689
|
+
};
|
|
690
|
+
accepts: {
|
|
691
|
+
scheme: string;
|
|
692
|
+
amount: string;
|
|
693
|
+
network: string;
|
|
694
|
+
asset: string;
|
|
695
|
+
payTo: string;
|
|
696
|
+
maxTimeoutSeconds: number;
|
|
697
|
+
extra: Record<string, unknown>;
|
|
698
|
+
}[];
|
|
699
|
+
error?: string | undefined;
|
|
700
|
+
extensions?: Record<string, unknown> | undefined;
|
|
701
|
+
}>;
|
|
702
|
+
declare const PaymentPayloadSchema: z.ZodObject<{
|
|
703
|
+
t402Version: z.ZodLiteral<2>;
|
|
704
|
+
resource: z.ZodOptional<z.ZodObject<{
|
|
705
|
+
url: z.ZodString;
|
|
706
|
+
description: z.ZodOptional<z.ZodString>;
|
|
707
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
708
|
+
}, "strip", z.ZodTypeAny, {
|
|
709
|
+
url: string;
|
|
710
|
+
description?: string | undefined;
|
|
711
|
+
mimeType?: string | undefined;
|
|
712
|
+
}, {
|
|
713
|
+
url: string;
|
|
714
|
+
description?: string | undefined;
|
|
715
|
+
mimeType?: string | undefined;
|
|
716
|
+
}>>;
|
|
717
|
+
accepted: z.ZodObject<{
|
|
718
|
+
scheme: z.ZodString;
|
|
719
|
+
network: z.ZodString;
|
|
720
|
+
asset: z.ZodString;
|
|
721
|
+
amount: z.ZodString;
|
|
722
|
+
payTo: z.ZodString;
|
|
723
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
724
|
+
extra: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
725
|
+
}, "strip", z.ZodTypeAny, {
|
|
726
|
+
scheme: string;
|
|
727
|
+
amount: string;
|
|
728
|
+
network: string;
|
|
729
|
+
asset: string;
|
|
730
|
+
payTo: string;
|
|
731
|
+
maxTimeoutSeconds: number;
|
|
732
|
+
extra: Record<string, unknown>;
|
|
733
|
+
}, {
|
|
734
|
+
scheme: string;
|
|
735
|
+
amount: string;
|
|
736
|
+
network: string;
|
|
737
|
+
asset: string;
|
|
738
|
+
payTo: string;
|
|
739
|
+
maxTimeoutSeconds: number;
|
|
740
|
+
extra: Record<string, unknown>;
|
|
741
|
+
}>;
|
|
742
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
743
|
+
extensions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
744
|
+
}, "strip", z.ZodTypeAny, {
|
|
745
|
+
t402Version: 2;
|
|
746
|
+
accepted: {
|
|
747
|
+
scheme: string;
|
|
748
|
+
amount: string;
|
|
749
|
+
network: string;
|
|
750
|
+
asset: string;
|
|
751
|
+
payTo: string;
|
|
752
|
+
maxTimeoutSeconds: number;
|
|
753
|
+
extra: Record<string, unknown>;
|
|
754
|
+
};
|
|
755
|
+
payload: Record<string, unknown>;
|
|
756
|
+
resource?: {
|
|
757
|
+
url: string;
|
|
758
|
+
description?: string | undefined;
|
|
759
|
+
mimeType?: string | undefined;
|
|
760
|
+
} | undefined;
|
|
761
|
+
extensions?: Record<string, unknown> | undefined;
|
|
762
|
+
}, {
|
|
763
|
+
t402Version: 2;
|
|
764
|
+
accepted: {
|
|
765
|
+
scheme: string;
|
|
766
|
+
amount: string;
|
|
767
|
+
network: string;
|
|
768
|
+
asset: string;
|
|
769
|
+
payTo: string;
|
|
770
|
+
maxTimeoutSeconds: number;
|
|
771
|
+
extra: Record<string, unknown>;
|
|
772
|
+
};
|
|
773
|
+
payload: Record<string, unknown>;
|
|
774
|
+
resource?: {
|
|
775
|
+
url: string;
|
|
776
|
+
description?: string | undefined;
|
|
777
|
+
mimeType?: string | undefined;
|
|
778
|
+
} | undefined;
|
|
779
|
+
extensions?: Record<string, unknown> | undefined;
|
|
780
|
+
}>;
|
|
781
|
+
declare const VerifyResponseSchema: z.ZodObject<{
|
|
782
|
+
isValid: z.ZodBoolean;
|
|
783
|
+
invalidReason: z.ZodOptional<z.ZodString>;
|
|
784
|
+
payer: z.ZodOptional<z.ZodString>;
|
|
785
|
+
}, "strip", z.ZodTypeAny, {
|
|
786
|
+
isValid: boolean;
|
|
787
|
+
invalidReason?: string | undefined;
|
|
788
|
+
payer?: string | undefined;
|
|
789
|
+
}, {
|
|
790
|
+
isValid: boolean;
|
|
791
|
+
invalidReason?: string | undefined;
|
|
792
|
+
payer?: string | undefined;
|
|
793
|
+
}>;
|
|
794
|
+
declare const SettleResponseSchema: z.ZodObject<{
|
|
795
|
+
success: z.ZodBoolean;
|
|
796
|
+
transaction: z.ZodString;
|
|
797
|
+
network: z.ZodString;
|
|
798
|
+
errorReason: z.ZodOptional<z.ZodString>;
|
|
799
|
+
payer: z.ZodOptional<z.ZodString>;
|
|
800
|
+
}, "strip", z.ZodTypeAny, {
|
|
801
|
+
network: string;
|
|
802
|
+
success: boolean;
|
|
803
|
+
transaction: string;
|
|
804
|
+
payer?: string | undefined;
|
|
805
|
+
errorReason?: string | undefined;
|
|
806
|
+
}, {
|
|
807
|
+
network: string;
|
|
808
|
+
success: boolean;
|
|
809
|
+
transaction: string;
|
|
810
|
+
payer?: string | undefined;
|
|
811
|
+
errorReason?: string | undefined;
|
|
812
|
+
}>;
|
|
813
|
+
declare const PaymentRequirementsV1Schema: z.ZodObject<{
|
|
814
|
+
scheme: z.ZodString;
|
|
815
|
+
network: z.ZodString;
|
|
816
|
+
asset: z.ZodString;
|
|
817
|
+
amount: z.ZodString;
|
|
818
|
+
payTo: z.ZodString;
|
|
819
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
820
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
821
|
+
}, "strip", z.ZodTypeAny, {
|
|
822
|
+
scheme: string;
|
|
823
|
+
amount: string;
|
|
824
|
+
network: string;
|
|
825
|
+
asset: string;
|
|
826
|
+
payTo: string;
|
|
827
|
+
maxTimeoutSeconds: number;
|
|
828
|
+
extra?: Record<string, unknown> | undefined;
|
|
829
|
+
}, {
|
|
830
|
+
scheme: string;
|
|
831
|
+
amount: string;
|
|
832
|
+
network: string;
|
|
833
|
+
asset: string;
|
|
834
|
+
payTo: string;
|
|
835
|
+
maxTimeoutSeconds: number;
|
|
836
|
+
extra?: Record<string, unknown> | undefined;
|
|
837
|
+
}>;
|
|
838
|
+
declare const PaymentPayloadV1Schema: z.ZodObject<{
|
|
839
|
+
t402Version: z.ZodOptional<z.ZodLiteral<1>>;
|
|
840
|
+
accepted: z.ZodObject<{
|
|
841
|
+
scheme: z.ZodString;
|
|
842
|
+
network: z.ZodString;
|
|
843
|
+
asset: z.ZodString;
|
|
844
|
+
amount: z.ZodString;
|
|
845
|
+
payTo: z.ZodString;
|
|
846
|
+
maxTimeoutSeconds: z.ZodNumber;
|
|
847
|
+
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
848
|
+
}, "strip", z.ZodTypeAny, {
|
|
849
|
+
scheme: string;
|
|
850
|
+
amount: string;
|
|
851
|
+
network: string;
|
|
852
|
+
asset: string;
|
|
853
|
+
payTo: string;
|
|
854
|
+
maxTimeoutSeconds: number;
|
|
855
|
+
extra?: Record<string, unknown> | undefined;
|
|
856
|
+
}, {
|
|
857
|
+
scheme: string;
|
|
858
|
+
amount: string;
|
|
859
|
+
network: string;
|
|
860
|
+
asset: string;
|
|
861
|
+
payTo: string;
|
|
862
|
+
maxTimeoutSeconds: number;
|
|
863
|
+
extra?: Record<string, unknown> | undefined;
|
|
864
|
+
}>;
|
|
865
|
+
payload: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
866
|
+
}, "strip", z.ZodTypeAny, {
|
|
867
|
+
accepted: {
|
|
868
|
+
scheme: string;
|
|
869
|
+
amount: string;
|
|
870
|
+
network: string;
|
|
871
|
+
asset: string;
|
|
872
|
+
payTo: string;
|
|
873
|
+
maxTimeoutSeconds: number;
|
|
874
|
+
extra?: Record<string, unknown> | undefined;
|
|
875
|
+
};
|
|
876
|
+
payload: Record<string, unknown>;
|
|
877
|
+
t402Version?: 1 | undefined;
|
|
878
|
+
}, {
|
|
879
|
+
accepted: {
|
|
880
|
+
scheme: string;
|
|
881
|
+
amount: string;
|
|
882
|
+
network: string;
|
|
883
|
+
asset: string;
|
|
884
|
+
payTo: string;
|
|
885
|
+
maxTimeoutSeconds: number;
|
|
886
|
+
extra?: Record<string, unknown> | undefined;
|
|
887
|
+
};
|
|
888
|
+
payload: Record<string, unknown>;
|
|
889
|
+
t402Version?: 1 | undefined;
|
|
890
|
+
}>;
|
|
891
|
+
type ValidatedPaymentPayload = z.infer<typeof PaymentPayloadSchema>;
|
|
892
|
+
type ValidatedPaymentRequired = z.infer<typeof PaymentRequiredSchema>;
|
|
893
|
+
type ValidatedPaymentRequirements = z.infer<typeof PaymentRequirementsSchema>;
|
|
894
|
+
type ValidatedVerifyResponse = z.infer<typeof VerifyResponseSchema>;
|
|
895
|
+
type ValidatedSettleResponse = z.infer<typeof SettleResponseSchema>;
|
|
896
|
+
/**
|
|
897
|
+
* Parse and validate a PaymentPayload.
|
|
898
|
+
*
|
|
899
|
+
* @param data - The data to parse
|
|
900
|
+
* @returns The validated payment payload
|
|
901
|
+
* @throws ZodError if validation fails
|
|
902
|
+
*/
|
|
903
|
+
declare function parsePaymentPayload(data: unknown): ValidatedPaymentPayload;
|
|
904
|
+
/**
|
|
905
|
+
* Parse and validate a PaymentRequired response.
|
|
906
|
+
*
|
|
907
|
+
* @param data - The data to parse
|
|
908
|
+
* @returns The validated payment required response
|
|
909
|
+
* @throws ZodError if validation fails
|
|
910
|
+
*/
|
|
911
|
+
declare function parsePaymentRequired(data: unknown): ValidatedPaymentRequired;
|
|
912
|
+
/**
|
|
913
|
+
* Parse and validate PaymentRequirements.
|
|
914
|
+
*
|
|
915
|
+
* @param data - The data to parse
|
|
916
|
+
* @returns The validated payment requirements
|
|
917
|
+
* @throws ZodError if validation fails
|
|
918
|
+
*/
|
|
919
|
+
declare function parsePaymentRequirements(data: unknown): ValidatedPaymentRequirements;
|
|
920
|
+
/**
|
|
921
|
+
* Safely parse a PaymentPayload, returning a result object.
|
|
922
|
+
*
|
|
923
|
+
* @param data - The data to parse
|
|
924
|
+
* @returns The safe parse result
|
|
925
|
+
*/
|
|
926
|
+
declare function safeParsePaymentPayload(data: unknown): z.SafeParseReturnType<unknown, ValidatedPaymentPayload>;
|
|
927
|
+
/**
|
|
928
|
+
* Safely parse a PaymentRequired response, returning a result object.
|
|
929
|
+
*
|
|
930
|
+
* @param data - The data to parse
|
|
931
|
+
* @returns The safe parse result
|
|
932
|
+
*/
|
|
933
|
+
declare function safeParsePaymentRequired(data: unknown): z.SafeParseReturnType<unknown, ValidatedPaymentRequired>;
|
|
934
|
+
/**
|
|
935
|
+
* Safely parse PaymentRequirements, returning a result object.
|
|
936
|
+
*
|
|
937
|
+
* @param data - The data to parse
|
|
938
|
+
* @returns The safe parse result
|
|
939
|
+
*/
|
|
940
|
+
declare function safeParsePaymentRequirements(data: unknown): z.SafeParseReturnType<unknown, ValidatedPaymentRequirements>;
|
|
941
|
+
|
|
942
|
+
type Network = `${string}:${string}`;
|
|
943
|
+
type Money = string | number;
|
|
944
|
+
type AssetAmount = {
|
|
945
|
+
asset: string;
|
|
946
|
+
amount: string;
|
|
947
|
+
extra?: Record<string, unknown>;
|
|
948
|
+
};
|
|
949
|
+
type Price = Money | AssetAmount;
|
|
950
|
+
|
|
951
|
+
interface ResourceInfo {
|
|
952
|
+
url: string;
|
|
953
|
+
description?: string;
|
|
954
|
+
mimeType?: string;
|
|
955
|
+
}
|
|
956
|
+
type PaymentRequirements = {
|
|
957
|
+
scheme: string;
|
|
958
|
+
network: Network;
|
|
959
|
+
asset: string;
|
|
960
|
+
amount: string;
|
|
961
|
+
payTo: string;
|
|
962
|
+
maxTimeoutSeconds: number;
|
|
963
|
+
extra: Record<string, unknown>;
|
|
964
|
+
};
|
|
965
|
+
type PaymentRequired = {
|
|
966
|
+
t402Version: number;
|
|
967
|
+
error?: string;
|
|
968
|
+
resource: ResourceInfo;
|
|
969
|
+
accepts: PaymentRequirements[];
|
|
970
|
+
extensions?: Record<string, unknown>;
|
|
971
|
+
};
|
|
972
|
+
type PaymentPayload = {
|
|
973
|
+
t402Version: number;
|
|
974
|
+
resource?: ResourceInfo;
|
|
975
|
+
accepted: PaymentRequirements;
|
|
976
|
+
payload: Record<string, unknown>;
|
|
977
|
+
extensions?: Record<string, unknown>;
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
type VerifyRequest = {
|
|
981
|
+
paymentPayload: PaymentPayload;
|
|
982
|
+
paymentRequirements: PaymentRequirements;
|
|
983
|
+
};
|
|
984
|
+
type VerifyResponse = {
|
|
985
|
+
isValid: boolean;
|
|
986
|
+
invalidReason?: string;
|
|
987
|
+
payer?: string;
|
|
988
|
+
};
|
|
989
|
+
type SettleRequest = {
|
|
990
|
+
paymentPayload: PaymentPayload;
|
|
991
|
+
paymentRequirements: PaymentRequirements;
|
|
992
|
+
};
|
|
993
|
+
type SettleResponse = {
|
|
994
|
+
success: boolean;
|
|
995
|
+
errorReason?: string;
|
|
996
|
+
payer?: string;
|
|
997
|
+
transaction: string;
|
|
998
|
+
network: Network;
|
|
999
|
+
};
|
|
1000
|
+
type SupportedKind = {
|
|
1001
|
+
t402Version: number;
|
|
1002
|
+
scheme: string;
|
|
1003
|
+
network: Network;
|
|
1004
|
+
extra?: Record<string, unknown>;
|
|
1005
|
+
};
|
|
1006
|
+
type SupportedResponse = {
|
|
1007
|
+
kinds: SupportedKind[];
|
|
1008
|
+
extensions: string[];
|
|
1009
|
+
signers: Record<string, string[]>;
|
|
1010
|
+
};
|
|
1011
|
+
|
|
1012
|
+
/**
|
|
1013
|
+
* Money parser function that converts a numeric amount to an AssetAmount
|
|
1014
|
+
* Receives the amount as a decimal number (e.g., 1.50 for $1.50)
|
|
1015
|
+
* Returns null to indicate "cannot handle this amount", causing fallback to next parser
|
|
1016
|
+
* Always returns a Promise for consistency - use async/await
|
|
1017
|
+
*
|
|
1018
|
+
* @param amount - The decimal amount (e.g., 1.50)
|
|
1019
|
+
* @param network - The network identifier for context
|
|
1020
|
+
* @returns AssetAmount or null to try next parser
|
|
1021
|
+
*/
|
|
1022
|
+
type MoneyParser = (amount: number, network: Network) => Promise<AssetAmount | null>;
|
|
1023
|
+
interface SchemeNetworkClient {
|
|
1024
|
+
readonly scheme: string;
|
|
1025
|
+
createPaymentPayload(t402Version: number, paymentRequirements: PaymentRequirements): Promise<Pick<PaymentPayload, "t402Version" | "payload">>;
|
|
1026
|
+
}
|
|
1027
|
+
interface SchemeNetworkFacilitator {
|
|
1028
|
+
readonly scheme: string;
|
|
1029
|
+
/**
|
|
1030
|
+
* CAIP family pattern that this facilitator supports.
|
|
1031
|
+
* Used to group signers by blockchain family in the supported response.
|
|
1032
|
+
*
|
|
1033
|
+
* @example
|
|
1034
|
+
* // EVM facilitators
|
|
1035
|
+
* readonly caipFamily = "eip155:*";
|
|
1036
|
+
*
|
|
1037
|
+
* @example
|
|
1038
|
+
* // SVM facilitators
|
|
1039
|
+
* readonly caipFamily = "solana:*";
|
|
1040
|
+
*/
|
|
1041
|
+
readonly caipFamily: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* Get mechanism-specific extra data needed for the supported kinds endpoint.
|
|
1044
|
+
* This method is called when building the facilitator's supported response.
|
|
1045
|
+
*
|
|
1046
|
+
* @param network - The network identifier for context
|
|
1047
|
+
* @returns Extra data object or undefined if no extra data is needed
|
|
1048
|
+
*
|
|
1049
|
+
* @example
|
|
1050
|
+
* // EVM schemes return undefined (no extra data needed)
|
|
1051
|
+
* getExtra(network: Network): undefined {
|
|
1052
|
+
* return undefined;
|
|
1053
|
+
* }
|
|
1054
|
+
*
|
|
1055
|
+
* @example
|
|
1056
|
+
* // SVM schemes return feePayer address
|
|
1057
|
+
* getExtra(network: Network): Record<string, unknown> | undefined {
|
|
1058
|
+
* return { feePayer: this.signer.address };
|
|
1059
|
+
* }
|
|
1060
|
+
*/
|
|
1061
|
+
getExtra(network: Network): Record<string, unknown> | undefined;
|
|
1062
|
+
/**
|
|
1063
|
+
* Get signer addresses used by this facilitator for a given network.
|
|
1064
|
+
* These are included in the supported response to help clients understand
|
|
1065
|
+
* which addresses might sign/pay for transactions.
|
|
1066
|
+
*
|
|
1067
|
+
* Supports multiple addresses for load balancing, key rotation, and high availability.
|
|
1068
|
+
*
|
|
1069
|
+
* @param network - The network identifier
|
|
1070
|
+
* @returns Array of signer addresses (wallet addresses, fee payer addresses, etc.)
|
|
1071
|
+
*
|
|
1072
|
+
* @example
|
|
1073
|
+
* // EVM facilitator
|
|
1074
|
+
* getSigners(network: string): string[] {
|
|
1075
|
+
* return [...this.signer.getAddresses()];
|
|
1076
|
+
* }
|
|
1077
|
+
*
|
|
1078
|
+
* @example
|
|
1079
|
+
* // SVM facilitator
|
|
1080
|
+
* getSigners(network: string): string[] {
|
|
1081
|
+
* return [...this.signer.getAddresses()];
|
|
1082
|
+
* }
|
|
1083
|
+
*/
|
|
1084
|
+
getSigners(network: string): string[];
|
|
1085
|
+
verify(payload: PaymentPayload, requirements: PaymentRequirements): Promise<VerifyResponse>;
|
|
1086
|
+
settle(payload: PaymentPayload, requirements: PaymentRequirements): Promise<SettleResponse>;
|
|
1087
|
+
}
|
|
1088
|
+
interface SchemeNetworkServer {
|
|
1089
|
+
readonly scheme: string;
|
|
1090
|
+
/**
|
|
1091
|
+
* Convert a user-friendly price to the scheme's specific amount and asset format
|
|
1092
|
+
* Always returns a Promise for consistency
|
|
1093
|
+
*
|
|
1094
|
+
* @param price - User-friendly price (e.g., "$0.10", "0.10", { amount: "100000", asset: "USDC" })
|
|
1095
|
+
* @param network - The network identifier for context
|
|
1096
|
+
* @returns Promise that resolves to the converted amount, asset identifier, and any extra metadata
|
|
1097
|
+
*
|
|
1098
|
+
* @example
|
|
1099
|
+
* // For EVM networks with USDC:
|
|
1100
|
+
* await parsePrice("$0.10", "eip155:8453") => { amount: "100000", asset: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913" }
|
|
1101
|
+
*
|
|
1102
|
+
* // For custom schemes:
|
|
1103
|
+
* await parsePrice("10 points", "custom:network") => { amount: "10", asset: "points" }
|
|
1104
|
+
*/
|
|
1105
|
+
parsePrice(price: Price, network: Network): Promise<AssetAmount>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Build payment requirements for this scheme/network combination
|
|
1108
|
+
*
|
|
1109
|
+
* @param paymentRequirements - Base payment requirements with amount/asset already set
|
|
1110
|
+
* @param supportedKind - The supported kind from facilitator's /supported endpoint
|
|
1111
|
+
* @param supportedKind.t402Version - The t402 version
|
|
1112
|
+
* @param supportedKind.scheme - The payment scheme
|
|
1113
|
+
* @param supportedKind.network - The network identifier
|
|
1114
|
+
* @param supportedKind.extra - Optional extra metadata
|
|
1115
|
+
* @param facilitatorExtensions - Extensions supported by the facilitator
|
|
1116
|
+
* @returns Enhanced payment requirements ready to be sent to clients
|
|
1117
|
+
*/
|
|
1118
|
+
enhancePaymentRequirements(paymentRequirements: PaymentRequirements, supportedKind: {
|
|
1119
|
+
t402Version: number;
|
|
1120
|
+
scheme: string;
|
|
1121
|
+
network: Network;
|
|
1122
|
+
extra?: Record<string, unknown>;
|
|
1123
|
+
}, facilitatorExtensions: string[]): Promise<PaymentRequirements>;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
export { createPaymentFailedMessage as $, type AssetAmount as A, type A2AArtifact as B, type A2ATaskStatus as C, type A2ATask as D, type A2ARequest as E, type A2AResponse as F, type A2AError as G, type A2AExtension as H, type A2ACapabilities as I, type A2AAgentCard as J, type A2ASkill as K, A2A_EXTENSIONS_HEADER as L, type Money as M, type Network as N, isPaymentRequired as O, type PaymentRequirements as P, isPaymentCompleted as Q, type ResourceServerExtension as R, type SettleResponse as S, T402_A2A_EXTENSION_URI as T, isPaymentFailed as U, type VerifyResponse as V, getPaymentRequired as W, getPaymentReceipts as X, createPaymentRequiredMessage as Y, createPaymentSubmissionMessage as Z, createPaymentCompletedMessage as _, type PaymentPayload as a, ERR_STREAM_NOT_FOUND as a$, createT402Extension as a0, type UptoPaymentRequirements as a1, type UptoExtra as a2, type UptoPayloadBase as a3, type UptoEvmPayload as a4, type UptoEvmPayloadCompact as a5, type UptoSettlement as a6, type UptoUsageDetails as a7, type UptoSettlementResponse as a8, type UptoValidationResult as a9, ERR_RATE_LIMITED as aA, ERR_SERVICE_UNAVAILABLE as aB, ERR_VERIFICATION_FAILED as aC, ERR_SETTLEMENT_FAILED as aD, ERR_INSUFFICIENT_BALANCE as aE, ERR_ALLOWANCE_INSUFFICIENT as aF, ERR_PAYMENT_MISMATCH as aG, ERR_DUPLICATE_PAYMENT as aH, ERR_SETTLEMENT_PENDING as aI, ERR_SETTLEMENT_TIMEOUT as aJ, ERR_NONCE_REPLAY as aK, ERR_IDEMPOTENCY_CONFLICT as aL, ERR_IDEMPOTENCY_UNAVAILABLE as aM, ERR_PREVIOUS_REQUEST_FAILED as aN, ERR_REQUEST_IN_PROGRESS as aO, ERR_CHAIN_UNAVAILABLE as aP, ERR_TRANSACTION_FAILED as aQ, ERR_TRANSACTION_REVERTED as aR, ERR_GAS_ESTIMATION_FAILED as aS, ERR_NONCE_CONFLICT as aT, ERR_CHAIN_CONGESTED as aU, ERR_CONTRACT_ERROR as aV, ERR_BRIDGE_UNAVAILABLE as aW, ERR_BRIDGE_QUOTE_FAILED as aX, ERR_BRIDGE_TRANSFER_FAILED as aY, ERR_BRIDGE_TIMEOUT as aZ, ERR_UNSUPPORTED_ROUTE as a_, type UptoUnit as aa, isUptoPaymentRequirements as ab, isUptoEvmPayload as ac, UPTO_SCHEME as ad, UPTO_DEFAULTS as ae, type ErrorCode as af, type APIError as ag, ERR_INVALID_REQUEST as ah, ERR_MISSING_PAYLOAD as ai, ERR_MISSING_REQUIREMENTS as aj, ERR_INVALID_PAYLOAD as ak, ERR_INVALID_REQUIREMENTS as al, ERR_INVALID_SIGNATURE as am, ERR_INVALID_NETWORK as an, ERR_INVALID_SCHEME as ao, ERR_INVALID_AMOUNT as ap, ERR_INVALID_ADDRESS as aq, ERR_EXPIRED_PAYMENT as ar, ERR_INVALID_NONCE as as, ERR_INSUFFICIENT_AMOUNT as at, ERR_INVALID_IDEMPOTENCY_KEY as au, ERR_SIGNATURE_EXPIRED as av, ERR_INTERNAL as aw, ERR_DATABASE_UNAVAILABLE as ax, ERR_CACHE_UNAVAILABLE as ay, ERR_RPC_UNAVAILABLE as az, type SchemeNetworkFacilitator as b, ERR_STREAM_ALREADY_CLOSED as b0, ERR_STREAM_ALREADY_PAUSED as b1, ERR_STREAM_NOT_PAUSED as b2, ERR_STREAM_AMOUNT_EXCEEDED as b3, ERR_STREAM_EXPIRED as b4, ERR_STREAM_INVALID_STATE as b5, ERR_STREAM_RATE_LIMITED as b6, ERR_INTENT_NOT_FOUND as b7, ERR_INTENT_ALREADY_EXECUTED as b8, ERR_INTENT_CANCELLED as b9, parsePaymentRequirements as bA, safeParsePaymentPayload as bB, safeParsePaymentRequired as bC, safeParsePaymentRequirements as bD, type ValidatedPaymentPayload as bE, type ValidatedPaymentRequired as bF, type ValidatedPaymentRequirements as bG, type ValidatedVerifyResponse as bH, type ValidatedSettleResponse as bI, ERR_INTENT_EXPIRED as ba, ERR_NO_ROUTES_AVAILABLE as bb, ERR_ROUTE_EXPIRED as bc, ERR_ROUTE_NOT_SELECTED as bd, ERR_INTENT_INVALID_STATE as be, ERR_RESOURCE_NOT_FOUND as bf, ERR_RESOURCE_ALREADY_EXISTS as bg, ERR_INVALID_PARAMETERS as bh, ERR_NOT_AUTHORIZED as bi, httpStatusForCode as bj, isClientError as bk, isServerError as bl, isFacilitatorError as bm, isChainError as bn, isBridgeError as bo, NetworkSchema as bp, ResourceInfoSchema as bq, PaymentRequirementsSchema as br, PaymentRequiredSchema as bs, PaymentPayloadSchema as bt, VerifyResponseSchema as bu, SettleResponseSchema as bv, PaymentRequirementsV1Schema as bw, PaymentPayloadV1Schema as bx, parsePaymentPayload as by, parsePaymentRequired as bz, type PaymentRequired as c, type SchemeNetworkClient as d, type SupportedResponse as e, type SchemeNetworkServer as f, type SupportedKind as g, type Price as h, type PaymentRequirementsV1 as i, type PaymentRequiredV1 as j, type PaymentPayloadV1 as k, type VerifyRequestV1 as l, type SettleRequestV1 as m, type SettleResponseV1 as n, type SupportedResponseV1 as o, type VerifyRequest as p, type SettleRequest as q, type MoneyParser as r, type A2APaymentStatus as s, type A2ATaskState as t, type A2ATextPart as u, type A2AFilePart as v, type A2ADataPart as w, type A2AMessagePart as x, type A2APaymentMetadata as y, type A2AMessage as z };
|