@sly_ai/sdk 0.1.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/README.md +346 -0
- package/dist/a2a.d.mts +108 -0
- package/dist/a2a.d.ts +108 -0
- package/dist/a2a.js +173 -0
- package/dist/a2a.js.map +1 -0
- package/dist/a2a.mjs +171 -0
- package/dist/a2a.mjs.map +1 -0
- package/dist/acp.d.mts +201 -0
- package/dist/acp.d.ts +201 -0
- package/dist/acp.js +143 -0
- package/dist/acp.js.map +1 -0
- package/dist/acp.mjs +141 -0
- package/dist/acp.mjs.map +1 -0
- package/dist/ap2.d.mts +188 -0
- package/dist/ap2.d.ts +188 -0
- package/dist/ap2.js +135 -0
- package/dist/ap2.js.map +1 -0
- package/dist/ap2.mjs +133 -0
- package/dist/ap2.mjs.map +1 -0
- package/dist/cards.d.mts +750 -0
- package/dist/cards.d.ts +750 -0
- package/dist/cards.js +373 -0
- package/dist/cards.js.map +1 -0
- package/dist/cards.mjs +369 -0
- package/dist/cards.mjs.map +1 -0
- package/dist/client-Cwe2CLU7.d.mts +41 -0
- package/dist/client-CyJe3uWO.d.ts +41 -0
- package/dist/index.d.mts +662 -0
- package/dist/index.d.ts +662 -0
- package/dist/index.js +2709 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2700 -0
- package/dist/index.mjs.map +1 -0
- package/dist/langchain.d.mts +11 -0
- package/dist/langchain.d.ts +11 -0
- package/dist/langchain.js +25 -0
- package/dist/langchain.js.map +1 -0
- package/dist/langchain.mjs +23 -0
- package/dist/langchain.mjs.map +1 -0
- package/dist/types-df1EICn_.d.mts +165 -0
- package/dist/types-df1EICn_.d.ts +165 -0
- package/dist/ucp.d.mts +844 -0
- package/dist/ucp.d.ts +844 -0
- package/dist/ucp.js +616 -0
- package/dist/ucp.js.map +1 -0
- package/dist/ucp.mjs +614 -0
- package/dist/ucp.mjs.map +1 -0
- package/dist/vercel.d.mts +178 -0
- package/dist/vercel.d.ts +178 -0
- package/dist/vercel.js +143 -0
- package/dist/vercel.js.map +1 -0
- package/dist/vercel.mjs +138 -0
- package/dist/vercel.mjs.map +1 -0
- package/dist/x402.d.mts +209 -0
- package/dist/x402.d.ts +209 -0
- package/dist/x402.js +476 -0
- package/dist/x402.js.map +1 -0
- package/dist/x402.mjs +471 -0
- package/dist/x402.mjs.map +1 -0
- package/package.json +118 -0
package/dist/cards.d.mts
ADDED
|
@@ -0,0 +1,750 @@
|
|
|
1
|
+
import { S as SlyClient } from './client-Cwe2CLU7.mjs';
|
|
2
|
+
import './types-df1EICn_.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Card Network Types
|
|
6
|
+
*
|
|
7
|
+
* Type definitions for Visa VIC and Mastercard Agent Pay integration
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Supported card networks
|
|
11
|
+
*/
|
|
12
|
+
type CardNetwork = 'visa' | 'mastercard';
|
|
13
|
+
/**
|
|
14
|
+
* Card network status
|
|
15
|
+
*/
|
|
16
|
+
type NetworkStatus = 'active' | 'inactive' | 'not_configured';
|
|
17
|
+
/**
|
|
18
|
+
* Agent signature verification request
|
|
19
|
+
*/
|
|
20
|
+
interface VerifyAgentSignatureRequest {
|
|
21
|
+
/** HTTP method (GET, POST, etc.) */
|
|
22
|
+
method: string;
|
|
23
|
+
/** Request path */
|
|
24
|
+
path: string;
|
|
25
|
+
/** Request headers */
|
|
26
|
+
headers: Record<string, string>;
|
|
27
|
+
/** Signature-Input header value */
|
|
28
|
+
signatureInput: string;
|
|
29
|
+
/** Signature header value */
|
|
30
|
+
signature: string;
|
|
31
|
+
/** Optional: specify which network to verify against */
|
|
32
|
+
network?: CardNetwork;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Agent signature verification result
|
|
36
|
+
*/
|
|
37
|
+
interface VerifyAgentSignatureResult {
|
|
38
|
+
/** Whether the signature is valid */
|
|
39
|
+
valid: boolean;
|
|
40
|
+
/** Detected card network */
|
|
41
|
+
network?: CardNetwork;
|
|
42
|
+
/** Key ID from the signature */
|
|
43
|
+
keyId?: string;
|
|
44
|
+
/** AI agent provider (e.g., 'anthropic', 'openai') */
|
|
45
|
+
agentProvider?: string;
|
|
46
|
+
/** Error message if verification failed */
|
|
47
|
+
error?: string;
|
|
48
|
+
/** Verification timestamp */
|
|
49
|
+
verifiedAt?: string;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Individual network configuration
|
|
53
|
+
*/
|
|
54
|
+
interface NetworkConfig {
|
|
55
|
+
/** Whether the network is configured */
|
|
56
|
+
configured: boolean;
|
|
57
|
+
/** Network status */
|
|
58
|
+
status: NetworkStatus;
|
|
59
|
+
/** Connected account ID */
|
|
60
|
+
accountId: string | null;
|
|
61
|
+
/** Whether using sandbox mode */
|
|
62
|
+
sandbox: boolean;
|
|
63
|
+
/** When the network was connected */
|
|
64
|
+
connectedAt: string | null;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Card networks response
|
|
68
|
+
*/
|
|
69
|
+
interface CardNetworksResponse {
|
|
70
|
+
/** Network configurations */
|
|
71
|
+
networks: {
|
|
72
|
+
visa: NetworkConfig;
|
|
73
|
+
mastercard: NetworkConfig;
|
|
74
|
+
};
|
|
75
|
+
/** Available capabilities based on configuration */
|
|
76
|
+
capabilities: {
|
|
77
|
+
webBotAuth: boolean;
|
|
78
|
+
paymentInstructions: boolean;
|
|
79
|
+
agentRegistration: boolean;
|
|
80
|
+
tokenization: boolean;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Verification statistics
|
|
85
|
+
*/
|
|
86
|
+
interface VerificationStats {
|
|
87
|
+
/** Total verification attempts */
|
|
88
|
+
total: number;
|
|
89
|
+
/** Successful verifications */
|
|
90
|
+
successful: number;
|
|
91
|
+
/** Failed verifications */
|
|
92
|
+
failed: number;
|
|
93
|
+
/** Breakdown by network */
|
|
94
|
+
byNetwork: {
|
|
95
|
+
visa: number;
|
|
96
|
+
mastercard: number;
|
|
97
|
+
};
|
|
98
|
+
/** Breakdown by AI provider */
|
|
99
|
+
byProvider: Record<string, number>;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Transaction statistics
|
|
103
|
+
*/
|
|
104
|
+
interface TransactionStats {
|
|
105
|
+
/** Total transactions */
|
|
106
|
+
total: number;
|
|
107
|
+
/** Total volume in USD */
|
|
108
|
+
volume: number;
|
|
109
|
+
/** Breakdown by status */
|
|
110
|
+
byStatus: {
|
|
111
|
+
completed: number;
|
|
112
|
+
pending: number;
|
|
113
|
+
failed: number;
|
|
114
|
+
};
|
|
115
|
+
/** Breakdown by network */
|
|
116
|
+
byNetwork: {
|
|
117
|
+
visa: number;
|
|
118
|
+
mastercard: number;
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* Recent transaction
|
|
123
|
+
*/
|
|
124
|
+
interface RecentTransaction {
|
|
125
|
+
id: string;
|
|
126
|
+
network: CardNetwork;
|
|
127
|
+
amount: number;
|
|
128
|
+
currency: string;
|
|
129
|
+
merchantName: string;
|
|
130
|
+
status: string;
|
|
131
|
+
createdAt: string;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Card analytics response
|
|
135
|
+
*/
|
|
136
|
+
interface CardAnalyticsResponse {
|
|
137
|
+
/** Verification statistics */
|
|
138
|
+
verifications: VerificationStats & {
|
|
139
|
+
successRate: number;
|
|
140
|
+
};
|
|
141
|
+
/** Transaction statistics */
|
|
142
|
+
transactions: TransactionStats;
|
|
143
|
+
/** Recent transactions */
|
|
144
|
+
recentTransactions: RecentTransaction[];
|
|
145
|
+
/** Analytics period */
|
|
146
|
+
period: {
|
|
147
|
+
days: number;
|
|
148
|
+
from: string;
|
|
149
|
+
to: string;
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Merchant information for Visa instructions
|
|
154
|
+
*/
|
|
155
|
+
interface VisaMerchant {
|
|
156
|
+
/** Merchant name */
|
|
157
|
+
name: string;
|
|
158
|
+
/** MCC code */
|
|
159
|
+
categoryCode: string;
|
|
160
|
+
/** Country code (default: US) */
|
|
161
|
+
country?: string;
|
|
162
|
+
/** Merchant URL */
|
|
163
|
+
url?: string;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Payment restrictions for Visa instructions
|
|
167
|
+
*/
|
|
168
|
+
interface VisaRestrictions {
|
|
169
|
+
/** Maximum transaction amount */
|
|
170
|
+
maxAmount?: number;
|
|
171
|
+
/** Allowed merchant categories */
|
|
172
|
+
allowedCategories?: string[];
|
|
173
|
+
/** Blocked merchant categories */
|
|
174
|
+
blockedCategories?: string[];
|
|
175
|
+
/** Allowed countries */
|
|
176
|
+
allowedCountries?: string[];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Create Visa payment instruction request
|
|
180
|
+
*/
|
|
181
|
+
interface CreateVisaInstructionRequest {
|
|
182
|
+
/** Payment amount */
|
|
183
|
+
amount: number;
|
|
184
|
+
/** Currency code */
|
|
185
|
+
currency: string;
|
|
186
|
+
/** Merchant information */
|
|
187
|
+
merchant: VisaMerchant;
|
|
188
|
+
/** Payment restrictions */
|
|
189
|
+
restrictions?: VisaRestrictions;
|
|
190
|
+
/** Expiration time in seconds (default: 900) */
|
|
191
|
+
expiresInSeconds?: number;
|
|
192
|
+
/** Custom metadata */
|
|
193
|
+
metadata?: Record<string, unknown>;
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Visa payment instruction
|
|
197
|
+
*/
|
|
198
|
+
interface VisaPaymentInstruction {
|
|
199
|
+
/** Instruction ID */
|
|
200
|
+
instructionId: string;
|
|
201
|
+
/** Merchant reference */
|
|
202
|
+
merchantRef: string;
|
|
203
|
+
/** Payment amount */
|
|
204
|
+
amount: number;
|
|
205
|
+
/** Currency code */
|
|
206
|
+
currency: string;
|
|
207
|
+
/** Merchant information */
|
|
208
|
+
merchant: VisaMerchant;
|
|
209
|
+
/** Payment restrictions */
|
|
210
|
+
restrictions?: VisaRestrictions;
|
|
211
|
+
/** Instruction status */
|
|
212
|
+
status: string;
|
|
213
|
+
/** Expiration timestamp */
|
|
214
|
+
expiresAt: string;
|
|
215
|
+
/** Creation timestamp */
|
|
216
|
+
createdAt: string;
|
|
217
|
+
/** Custom metadata */
|
|
218
|
+
metadata?: Record<string, unknown>;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Paginated list response
|
|
222
|
+
*/
|
|
223
|
+
interface PaginatedResponse<T> {
|
|
224
|
+
data: T[];
|
|
225
|
+
pagination: {
|
|
226
|
+
total: number;
|
|
227
|
+
limit: number;
|
|
228
|
+
offset: number;
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Create Visa token request
|
|
233
|
+
*/
|
|
234
|
+
interface CreateVisaTokenRequest {
|
|
235
|
+
/** Payment instruction ID */
|
|
236
|
+
instructionId: string;
|
|
237
|
+
/** Card token */
|
|
238
|
+
cardToken: string;
|
|
239
|
+
/** Custom metadata */
|
|
240
|
+
metadata?: Record<string, unknown>;
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Visa token
|
|
244
|
+
*/
|
|
245
|
+
interface VisaToken {
|
|
246
|
+
/** VTS token ID */
|
|
247
|
+
tokenId: string;
|
|
248
|
+
/** Instruction ID */
|
|
249
|
+
instructionId: string;
|
|
250
|
+
/** Last 4 digits of card */
|
|
251
|
+
cardLastFour: string;
|
|
252
|
+
/** Token status */
|
|
253
|
+
status: string;
|
|
254
|
+
/** Expiration timestamp */
|
|
255
|
+
expiresAt?: string;
|
|
256
|
+
/** Provisioned timestamp */
|
|
257
|
+
provisionedAt: string;
|
|
258
|
+
/** Custom metadata */
|
|
259
|
+
metadata?: Record<string, unknown>;
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Register Mastercard agent request
|
|
263
|
+
*/
|
|
264
|
+
interface RegisterMastercardAgentRequest {
|
|
265
|
+
/** PayOS agent ID */
|
|
266
|
+
agentId: string;
|
|
267
|
+
/** Agent display name */
|
|
268
|
+
agentName?: string;
|
|
269
|
+
/** Agent's public key for signing */
|
|
270
|
+
publicKey: string;
|
|
271
|
+
/** Agent capabilities */
|
|
272
|
+
capabilities?: string[];
|
|
273
|
+
/** AI provider name */
|
|
274
|
+
provider?: string;
|
|
275
|
+
/** Callback URL for notifications */
|
|
276
|
+
callbackUrl?: string;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Mastercard agent registration
|
|
280
|
+
*/
|
|
281
|
+
interface MastercardAgentRegistration {
|
|
282
|
+
/** PayOS agent ID */
|
|
283
|
+
agentId: string;
|
|
284
|
+
/** Mastercard agent ID */
|
|
285
|
+
mcAgentId: string;
|
|
286
|
+
/** Agent display name */
|
|
287
|
+
agentName: string;
|
|
288
|
+
/** Agent's public key */
|
|
289
|
+
publicKey: string;
|
|
290
|
+
/** Agent capabilities */
|
|
291
|
+
capabilities: string[];
|
|
292
|
+
/** Registration status */
|
|
293
|
+
status: string;
|
|
294
|
+
/** AI provider name */
|
|
295
|
+
provider?: string;
|
|
296
|
+
/** Callback URL */
|
|
297
|
+
callbackUrl?: string;
|
|
298
|
+
/** Registration timestamp */
|
|
299
|
+
registeredAt: string;
|
|
300
|
+
}
|
|
301
|
+
/**
|
|
302
|
+
* Create Mastercard token request
|
|
303
|
+
*/
|
|
304
|
+
interface CreateMastercardTokenRequest {
|
|
305
|
+
/** PayOS agent ID */
|
|
306
|
+
agentId: string;
|
|
307
|
+
/** Card token */
|
|
308
|
+
cardToken: string;
|
|
309
|
+
/** Expiration time in seconds (default: 3600) */
|
|
310
|
+
expiresInSeconds?: number;
|
|
311
|
+
/** Custom metadata */
|
|
312
|
+
metadata?: Record<string, unknown>;
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Mastercard agentic token
|
|
316
|
+
*/
|
|
317
|
+
interface MastercardToken {
|
|
318
|
+
/** Token reference */
|
|
319
|
+
tokenReference: string;
|
|
320
|
+
/** Mastercard agent ID */
|
|
321
|
+
mcAgentId: string;
|
|
322
|
+
/** Dynamic Transaction Verification Code */
|
|
323
|
+
dtvc: string;
|
|
324
|
+
/** Last 4 digits of card */
|
|
325
|
+
cardLastFour: string;
|
|
326
|
+
/** Token status */
|
|
327
|
+
status: string;
|
|
328
|
+
/** Expiration timestamp */
|
|
329
|
+
expiresAt: string;
|
|
330
|
+
/** Custom metadata */
|
|
331
|
+
metadata?: Record<string, unknown>;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Card network transaction
|
|
335
|
+
*/
|
|
336
|
+
interface CardTransaction {
|
|
337
|
+
id: string;
|
|
338
|
+
network: CardNetwork;
|
|
339
|
+
status: string;
|
|
340
|
+
amount: number;
|
|
341
|
+
currency: string;
|
|
342
|
+
merchantName?: string;
|
|
343
|
+
createdAt: string;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* Network test result
|
|
347
|
+
*/
|
|
348
|
+
interface NetworkTestResult {
|
|
349
|
+
success: boolean;
|
|
350
|
+
error?: string;
|
|
351
|
+
}
|
|
352
|
+
/**
|
|
353
|
+
* Network configure request
|
|
354
|
+
*/
|
|
355
|
+
interface ConfigureVisaRequest {
|
|
356
|
+
api_key: string;
|
|
357
|
+
shared_secret?: string;
|
|
358
|
+
sandbox?: boolean;
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Network configure request
|
|
362
|
+
*/
|
|
363
|
+
interface ConfigureMastercardRequest {
|
|
364
|
+
consumer_key: string;
|
|
365
|
+
private_key_pem?: string;
|
|
366
|
+
sandbox?: boolean;
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Configure result
|
|
370
|
+
*/
|
|
371
|
+
interface ConfigureResult {
|
|
372
|
+
id: string;
|
|
373
|
+
message: string;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Generate signing key request
|
|
377
|
+
*/
|
|
378
|
+
interface GenerateSigningKeyRequest {
|
|
379
|
+
/** Signing algorithm (default: ed25519) */
|
|
380
|
+
algorithm?: 'ed25519' | 'rsa-sha256';
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Generated signing key result
|
|
384
|
+
*/
|
|
385
|
+
interface GenerateSigningKeyResult {
|
|
386
|
+
/** Public key identifier used in signatures */
|
|
387
|
+
keyId: string;
|
|
388
|
+
/** Base64 encoded public key */
|
|
389
|
+
publicKey: string;
|
|
390
|
+
/** Signing algorithm */
|
|
391
|
+
algorithm: 'ed25519' | 'rsa-sha256';
|
|
392
|
+
/** Key status */
|
|
393
|
+
status: 'active' | 'suspended' | 'revoked';
|
|
394
|
+
/** Networks where public key is registered */
|
|
395
|
+
registeredNetworks: string[];
|
|
396
|
+
/** When the key was created */
|
|
397
|
+
createdAt: string;
|
|
398
|
+
}
|
|
399
|
+
/**
|
|
400
|
+
* Signing key status result
|
|
401
|
+
*/
|
|
402
|
+
interface SigningKeyStatus {
|
|
403
|
+
/** Whether the agent has a signing key */
|
|
404
|
+
hasKey: boolean;
|
|
405
|
+
/** Public key identifier */
|
|
406
|
+
keyId?: string;
|
|
407
|
+
/** Base64 encoded public key */
|
|
408
|
+
publicKey?: string;
|
|
409
|
+
/** Signing algorithm */
|
|
410
|
+
algorithm?: 'ed25519' | 'rsa-sha256';
|
|
411
|
+
/** Key status */
|
|
412
|
+
status?: 'active' | 'suspended' | 'revoked';
|
|
413
|
+
/** Networks where public key is registered */
|
|
414
|
+
registeredNetworks?: string[];
|
|
415
|
+
/** Usage statistics */
|
|
416
|
+
stats?: {
|
|
417
|
+
useCount: number;
|
|
418
|
+
lastUsedAt?: string;
|
|
419
|
+
};
|
|
420
|
+
/** When the key was created */
|
|
421
|
+
createdAt?: string;
|
|
422
|
+
}
|
|
423
|
+
/**
|
|
424
|
+
* Payment information for signing request
|
|
425
|
+
*/
|
|
426
|
+
interface SigningPaymentInfo {
|
|
427
|
+
/** Payment amount */
|
|
428
|
+
amount: number;
|
|
429
|
+
/** Currency code (default: USD) */
|
|
430
|
+
currency?: string;
|
|
431
|
+
/** Merchant name for audit trail */
|
|
432
|
+
merchantName?: string;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Sign request input
|
|
436
|
+
*/
|
|
437
|
+
interface SignRequestInput {
|
|
438
|
+
/** HTTP method */
|
|
439
|
+
method: string;
|
|
440
|
+
/** Request path */
|
|
441
|
+
path: string;
|
|
442
|
+
/** Host header value */
|
|
443
|
+
host?: string;
|
|
444
|
+
/** Request headers (lowercase keys) */
|
|
445
|
+
headers?: Record<string, string>;
|
|
446
|
+
/** Request body */
|
|
447
|
+
body?: string;
|
|
448
|
+
/** Payment info for spending limit check */
|
|
449
|
+
payment?: SigningPaymentInfo;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Sign request result
|
|
453
|
+
*/
|
|
454
|
+
interface SignRequestResult {
|
|
455
|
+
/** The Signature-Input header value */
|
|
456
|
+
signatureInput: string;
|
|
457
|
+
/** The Signature header value */
|
|
458
|
+
signature: string;
|
|
459
|
+
/** The Content-Digest header value (if body was provided) */
|
|
460
|
+
contentDigest?: string;
|
|
461
|
+
/** All headers to add to the request */
|
|
462
|
+
headers: Record<string, string>;
|
|
463
|
+
/** When the signature expires */
|
|
464
|
+
expiresAt: string;
|
|
465
|
+
/** ID of the signing request for audit trail */
|
|
466
|
+
signingRequestId?: string;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* Delete signing key result
|
|
470
|
+
*/
|
|
471
|
+
interface DeleteSigningKeyResult {
|
|
472
|
+
success: boolean;
|
|
473
|
+
message: string;
|
|
474
|
+
keyId: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
/**
|
|
478
|
+
* Card Networks Module
|
|
479
|
+
*
|
|
480
|
+
* Provides SDK integration for Visa VIC and Mastercard Agent Pay
|
|
481
|
+
* for accepting payments from AI agents.
|
|
482
|
+
*/
|
|
483
|
+
|
|
484
|
+
/**
|
|
485
|
+
* Visa-specific operations
|
|
486
|
+
*/
|
|
487
|
+
declare class VisaClient {
|
|
488
|
+
private client;
|
|
489
|
+
constructor(client: SlyClient);
|
|
490
|
+
/**
|
|
491
|
+
* Create a Visa VIC payment instruction
|
|
492
|
+
*/
|
|
493
|
+
createInstruction(params: CreateVisaInstructionRequest): Promise<VisaPaymentInstruction>;
|
|
494
|
+
/**
|
|
495
|
+
* Get a specific Visa payment instruction
|
|
496
|
+
*/
|
|
497
|
+
getInstruction(instructionId: string): Promise<VisaPaymentInstruction>;
|
|
498
|
+
/**
|
|
499
|
+
* List Visa payment instructions
|
|
500
|
+
*/
|
|
501
|
+
listInstructions(options?: {
|
|
502
|
+
status?: string;
|
|
503
|
+
limit?: number;
|
|
504
|
+
offset?: number;
|
|
505
|
+
}): Promise<PaginatedResponse<VisaPaymentInstruction>>;
|
|
506
|
+
/**
|
|
507
|
+
* Provision a VTS token for an instruction
|
|
508
|
+
*/
|
|
509
|
+
createToken(params: CreateVisaTokenRequest): Promise<VisaToken>;
|
|
510
|
+
/**
|
|
511
|
+
* Get a specific Visa token
|
|
512
|
+
*/
|
|
513
|
+
getToken(tokenId: string): Promise<VisaToken>;
|
|
514
|
+
/**
|
|
515
|
+
* List Visa tokens
|
|
516
|
+
*/
|
|
517
|
+
listTokens(options?: {
|
|
518
|
+
status?: string;
|
|
519
|
+
limit?: number;
|
|
520
|
+
offset?: number;
|
|
521
|
+
}): Promise<PaginatedResponse<VisaToken>>;
|
|
522
|
+
/**
|
|
523
|
+
* Suspend a Visa token
|
|
524
|
+
*/
|
|
525
|
+
suspendToken(tokenId: string): Promise<{
|
|
526
|
+
success: boolean;
|
|
527
|
+
message: string;
|
|
528
|
+
}>;
|
|
529
|
+
}
|
|
530
|
+
/**
|
|
531
|
+
* Mastercard-specific operations
|
|
532
|
+
*/
|
|
533
|
+
declare class MastercardClient {
|
|
534
|
+
private client;
|
|
535
|
+
constructor(client: SlyClient);
|
|
536
|
+
/**
|
|
537
|
+
* Register an agent with Mastercard Agent Pay
|
|
538
|
+
*/
|
|
539
|
+
registerAgent(params: RegisterMastercardAgentRequest): Promise<MastercardAgentRegistration>;
|
|
540
|
+
/**
|
|
541
|
+
* Get a specific Mastercard agent registration
|
|
542
|
+
*/
|
|
543
|
+
getAgent(agentId: string): Promise<MastercardAgentRegistration>;
|
|
544
|
+
/**
|
|
545
|
+
* List registered Mastercard agents
|
|
546
|
+
*/
|
|
547
|
+
listAgents(): Promise<{
|
|
548
|
+
data: MastercardAgentRegistration[];
|
|
549
|
+
}>;
|
|
550
|
+
/**
|
|
551
|
+
* Create a Mastercard agentic token with DTVC
|
|
552
|
+
*/
|
|
553
|
+
createToken(params: CreateMastercardTokenRequest): Promise<MastercardToken>;
|
|
554
|
+
/**
|
|
555
|
+
* Get a Mastercard token, optionally refreshing the DTVC
|
|
556
|
+
*/
|
|
557
|
+
getToken(tokenReference: string, options?: {
|
|
558
|
+
refresh?: boolean;
|
|
559
|
+
}): Promise<MastercardToken>;
|
|
560
|
+
/**
|
|
561
|
+
* List Mastercard tokens
|
|
562
|
+
*/
|
|
563
|
+
listTokens(options?: {
|
|
564
|
+
status?: string;
|
|
565
|
+
limit?: number;
|
|
566
|
+
offset?: number;
|
|
567
|
+
}): Promise<PaginatedResponse<MastercardToken>>;
|
|
568
|
+
/**
|
|
569
|
+
* Revoke a Mastercard token
|
|
570
|
+
*/
|
|
571
|
+
revokeToken(tokenReference: string): Promise<{
|
|
572
|
+
success: boolean;
|
|
573
|
+
message: string;
|
|
574
|
+
}>;
|
|
575
|
+
}
|
|
576
|
+
/**
|
|
577
|
+
* Cards Module - Main client for card network operations
|
|
578
|
+
*
|
|
579
|
+
* Provides unified access to:
|
|
580
|
+
* - Web Bot Auth signature verification
|
|
581
|
+
* - Network configuration and status
|
|
582
|
+
* - Visa VIC payment instructions and tokens
|
|
583
|
+
* - Mastercard Agent Pay registration and tokens
|
|
584
|
+
* - Analytics and transactions
|
|
585
|
+
*/
|
|
586
|
+
declare class CardsClient {
|
|
587
|
+
private client;
|
|
588
|
+
/** Visa-specific operations */
|
|
589
|
+
readonly visa: VisaClient;
|
|
590
|
+
/** Mastercard-specific operations */
|
|
591
|
+
readonly mastercard: MastercardClient;
|
|
592
|
+
constructor(client: SlyClient);
|
|
593
|
+
/**
|
|
594
|
+
* Verify an AI agent's Web Bot Auth signature
|
|
595
|
+
*
|
|
596
|
+
* @example
|
|
597
|
+
* ```typescript
|
|
598
|
+
* const result = await payos.cards.verifyAgentSignature({
|
|
599
|
+
* method: 'POST',
|
|
600
|
+
* path: '/checkout',
|
|
601
|
+
* headers: req.headers,
|
|
602
|
+
* signatureInput: req.headers['signature-input'],
|
|
603
|
+
* signature: req.headers['signature'],
|
|
604
|
+
* });
|
|
605
|
+
*
|
|
606
|
+
* if (result.valid) {
|
|
607
|
+
* console.log(`Verified ${result.network} agent from ${result.agentProvider}`);
|
|
608
|
+
* }
|
|
609
|
+
* ```
|
|
610
|
+
*/
|
|
611
|
+
verifyAgentSignature(params: VerifyAgentSignatureRequest): Promise<VerifyAgentSignatureResult>;
|
|
612
|
+
/**
|
|
613
|
+
* Get configured card networks and their status
|
|
614
|
+
*
|
|
615
|
+
* @example
|
|
616
|
+
* ```typescript
|
|
617
|
+
* const { networks, capabilities } = await payos.cards.getNetworks();
|
|
618
|
+
*
|
|
619
|
+
* if (networks.visa.configured) {
|
|
620
|
+
* console.log(`Visa: ${networks.visa.status}`);
|
|
621
|
+
* }
|
|
622
|
+
* ```
|
|
623
|
+
*/
|
|
624
|
+
getNetworks(): Promise<CardNetworksResponse>;
|
|
625
|
+
/**
|
|
626
|
+
* Test connection to a card network
|
|
627
|
+
*/
|
|
628
|
+
testNetwork(network: 'visa' | 'mastercard'): Promise<NetworkTestResult>;
|
|
629
|
+
/**
|
|
630
|
+
* Configure Visa VIC credentials
|
|
631
|
+
*/
|
|
632
|
+
configureVisa(params: ConfigureVisaRequest): Promise<ConfigureResult>;
|
|
633
|
+
/**
|
|
634
|
+
* Configure Mastercard Agent Pay credentials
|
|
635
|
+
*/
|
|
636
|
+
configureMastercard(params: ConfigureMastercardRequest): Promise<ConfigureResult>;
|
|
637
|
+
/**
|
|
638
|
+
* Disconnect a card network
|
|
639
|
+
*/
|
|
640
|
+
disconnectNetwork(network: 'visa' | 'mastercard'): Promise<{
|
|
641
|
+
success: boolean;
|
|
642
|
+
message: string;
|
|
643
|
+
}>;
|
|
644
|
+
/**
|
|
645
|
+
* Get comprehensive card network analytics
|
|
646
|
+
*
|
|
647
|
+
* @param days - Number of days to analyze (default: 30)
|
|
648
|
+
*
|
|
649
|
+
* @example
|
|
650
|
+
* ```typescript
|
|
651
|
+
* const analytics = await payos.cards.getAnalytics(30);
|
|
652
|
+
*
|
|
653
|
+
* console.log(`Success rate: ${analytics.verifications.successRate}%`);
|
|
654
|
+
* console.log(`Total volume: $${analytics.transactions.volume}`);
|
|
655
|
+
* ```
|
|
656
|
+
*/
|
|
657
|
+
getAnalytics(days?: number): Promise<CardAnalyticsResponse>;
|
|
658
|
+
/**
|
|
659
|
+
* Get verification statistics
|
|
660
|
+
*
|
|
661
|
+
* @param days - Number of days to analyze (default: 30)
|
|
662
|
+
*/
|
|
663
|
+
getVerificationStats(days?: number): Promise<VerificationStats>;
|
|
664
|
+
/**
|
|
665
|
+
* List card network transactions
|
|
666
|
+
*/
|
|
667
|
+
listTransactions(options?: {
|
|
668
|
+
network?: 'visa' | 'mastercard';
|
|
669
|
+
status?: string;
|
|
670
|
+
limit?: number;
|
|
671
|
+
offset?: number;
|
|
672
|
+
}): Promise<PaginatedResponse<CardTransaction>>;
|
|
673
|
+
/**
|
|
674
|
+
* Get a specific transaction
|
|
675
|
+
*/
|
|
676
|
+
getTransaction(transactionId: string): Promise<CardTransaction>;
|
|
677
|
+
/**
|
|
678
|
+
* Generate a signing key for an agent
|
|
679
|
+
*
|
|
680
|
+
* Creates an Ed25519 or RSA-SHA256 key pair for the agent to sign
|
|
681
|
+
* payment requests according to RFC 9421 (HTTP Message Signatures).
|
|
682
|
+
*
|
|
683
|
+
* @example
|
|
684
|
+
* ```typescript
|
|
685
|
+
* const key = await payos.cards.generateSigningKey('agent_123');
|
|
686
|
+
* console.log(`Public key: ${key.publicKey}`);
|
|
687
|
+
* // Register this public key with card networks (Visa TAP, MC Agent Pay)
|
|
688
|
+
* ```
|
|
689
|
+
*/
|
|
690
|
+
generateSigningKey(agentId: string, options?: GenerateSigningKeyRequest): Promise<GenerateSigningKeyResult>;
|
|
691
|
+
/**
|
|
692
|
+
* Get the signing key status for an agent
|
|
693
|
+
*
|
|
694
|
+
* @example
|
|
695
|
+
* ```typescript
|
|
696
|
+
* const status = await payos.cards.getSigningKey('agent_123');
|
|
697
|
+
* if (status.hasKey) {
|
|
698
|
+
* console.log(`Key: ${status.keyId}, Uses: ${status.stats.useCount}`);
|
|
699
|
+
* }
|
|
700
|
+
* ```
|
|
701
|
+
*/
|
|
702
|
+
getSigningKey(agentId: string): Promise<SigningKeyStatus>;
|
|
703
|
+
/**
|
|
704
|
+
* Revoke an agent's signing key
|
|
705
|
+
*
|
|
706
|
+
* After revocation, the agent will need a new key to sign requests.
|
|
707
|
+
*/
|
|
708
|
+
revokeSigningKey(agentId: string): Promise<DeleteSigningKeyResult>;
|
|
709
|
+
/**
|
|
710
|
+
* Sign a payment request for an agent
|
|
711
|
+
*
|
|
712
|
+
* Signs an HTTP request according to RFC 9421 so the agent can
|
|
713
|
+
* authenticate with merchants and card networks.
|
|
714
|
+
*
|
|
715
|
+
* Requirements:
|
|
716
|
+
* - Agent must have KYA tier >= 1
|
|
717
|
+
* - Agent must be active
|
|
718
|
+
* - Agent must have a signing key
|
|
719
|
+
* - Payment must be within spending limits
|
|
720
|
+
*
|
|
721
|
+
* @example
|
|
722
|
+
* ```typescript
|
|
723
|
+
* // Sign a payment request
|
|
724
|
+
* const signed = await payos.cards.signRequest('agent_123', {
|
|
725
|
+
* method: 'POST',
|
|
726
|
+
* path: '/api/checkout',
|
|
727
|
+
* host: 'merchant.com',
|
|
728
|
+
* body: JSON.stringify({ items: [...], total: 99.99 }),
|
|
729
|
+
* payment: {
|
|
730
|
+
* amount: 99.99,
|
|
731
|
+
* currency: 'USD',
|
|
732
|
+
* merchantName: 'Acme Store',
|
|
733
|
+
* },
|
|
734
|
+
* });
|
|
735
|
+
*
|
|
736
|
+
* // Agent uses signed headers to call merchant
|
|
737
|
+
* const response = await fetch('https://merchant.com/api/checkout', {
|
|
738
|
+
* method: 'POST',
|
|
739
|
+
* headers: {
|
|
740
|
+
* ...signed.headers,
|
|
741
|
+
* 'Content-Type': 'application/json',
|
|
742
|
+
* },
|
|
743
|
+
* body: JSON.stringify({ items: [...], total: 99.99 }),
|
|
744
|
+
* });
|
|
745
|
+
* ```
|
|
746
|
+
*/
|
|
747
|
+
signRequest(agentId: string, request: SignRequestInput): Promise<SignRequestResult>;
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
export { type CardAnalyticsResponse, type CardNetwork, type CardNetworksResponse, type CardTransaction, CardsClient, type ConfigureMastercardRequest, type ConfigureResult, type ConfigureVisaRequest, type CreateMastercardTokenRequest, type CreateVisaInstructionRequest, type CreateVisaTokenRequest, type DeleteSigningKeyResult, type GenerateSigningKeyRequest, type GenerateSigningKeyResult, type MastercardAgentRegistration, MastercardClient, type MastercardToken, type NetworkConfig, type NetworkStatus, type NetworkTestResult, type PaginatedResponse, type RecentTransaction, type RegisterMastercardAgentRequest, type SignRequestInput, type SignRequestResult, type SigningKeyStatus, type SigningPaymentInfo, type TransactionStats, type VerificationStats, type VerifyAgentSignatureRequest, type VerifyAgentSignatureResult, VisaClient, type VisaMerchant, type VisaPaymentInstruction, type VisaRestrictions, type VisaToken };
|