@catena/sdk 0.0.0-bootstrap.0 → 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.
@@ -0,0 +1,1096 @@
1
+ import * as v from "valibot";
2
+ //#region src/offer-receipt.d.ts
3
+ /**
4
+ * `acceptIndex` exists only on offers (it points at an `accepts[]` entry);
5
+ * receipts get their own schema without it so the public receipt type does
6
+ * not advertise a field receipts never carry.
7
+ */
8
+ declare const x402SignedArtifactSchema: v.VariantSchema<"format", [v.LooseObjectSchema<{
9
+ readonly format: v.LiteralSchema<"eip712", undefined>;
10
+ readonly acceptIndex: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
11
+ readonly payload: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
12
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 65-byte hex signature">]>;
13
+ }, undefined>, v.LooseObjectSchema<{
14
+ readonly format: v.LiteralSchema<"jws", undefined>;
15
+ readonly acceptIndex: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
16
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, "Expected a JWS compact serialization">]>;
17
+ }, undefined>], undefined>;
18
+ declare const x402SignedReceiptSchema: v.VariantSchema<"format", [v.LooseObjectSchema<{
19
+ readonly format: v.LiteralSchema<"eip712", undefined>;
20
+ readonly payload: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
21
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 65-byte hex signature">]>;
22
+ }, undefined>, v.LooseObjectSchema<{
23
+ readonly format: v.LiteralSchema<"jws", undefined>;
24
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, "Expected a JWS compact serialization">]>;
25
+ }, undefined>], undefined>;
26
+ /**
27
+ * A seller-signed offer from a 402 challenge's `extensions["offer-receipt"]`
28
+ * (x402 Offer & Receipt extension), relayed to Catena verbatim for
29
+ * verification and storage as payment evidence. `eip712` artifacts carry the
30
+ * signed payload alongside the signature; `jws` artifacts carry it inside the
31
+ * compact serialization.
32
+ */
33
+ type X402SignedOffer = v.InferOutput<typeof x402SignedArtifactSchema>;
34
+ /**
35
+ * A seller-signed receipt from the paid retry's `PAYMENT-RESPONSE`
36
+ * `extensions["offer-receipt"]`, relayed to Catena verbatim for verification
37
+ * and storage as payment evidence — the seller's attestation that it was paid
38
+ * and delivered.
39
+ */
40
+ type X402SignedReceipt = v.InferOutput<typeof x402SignedReceiptSchema>;
41
+ //#endregion
42
+ //#region src/user-agent.d.ts
43
+ /**
44
+ * Optional caller identification prepended to the User-Agent, Stripe-style
45
+ * (`name/version (url)`). Telemetry only: the value is self-reported and
46
+ * spoofable, so it must never carry authority — client kind and privilege
47
+ * are derived server-side from the OAuth client_id.
48
+ */
49
+ interface AppInfo {
50
+ name: string;
51
+ version?: string;
52
+ url?: string;
53
+ }
54
+ //#endregion
55
+ //#region src/schemas.d.ts
56
+ /**
57
+ * A response value known to this SDK release, or an opaque string added by a
58
+ * newer server. The known half preserves editor autocomplete without making an
59
+ * additive server change fail validation in an installed client. Blank and
60
+ * whitespace-only values still fail validation.
61
+ */
62
+ type ExtensibleString<TKnown extends readonly string[]> = TKnown[number] | (string & {});
63
+ declare const agentSchema: v.ObjectSchema<{
64
+ readonly id: v.StringSchema<undefined>;
65
+ readonly name: v.StringSchema<undefined>;
66
+ readonly status: v.StringSchema<undefined>;
67
+ readonly organizationId: v.StringSchema<undefined>;
68
+ }, undefined>;
69
+ type Agent = v.InferOutput<typeof agentSchema>;
70
+ declare const POLICY_RULE_TYPES: readonly ["per_transaction_amount", "daily_amount", "weekly_amount", "monthly_amount", "hourly_count", "daily_count"];
71
+ declare const POLICY_RULE_ACTIONS: readonly ["block", "require_approval"];
72
+ declare const ACCOUNT_AGGREGATION_SCOPES: readonly ["per_account", "across_accounts"];
73
+ declare const ACTOR_AGGREGATION_SCOPES: readonly ["per_agent", "per_policy"];
74
+ declare const POLICY_CAPABILITIES: readonly ["query_balance", "read", "send", "transfer"];
75
+ declare const COUNTERPARTY_ACTIONS: readonly ["allow", "block", "require_approval"];
76
+ declare const COUNTERPARTY_RULE_MODES: readonly ["open", "restricted"];
77
+ declare const policySchema: v.ObjectSchema<{
78
+ readonly id: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
79
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
80
+ readonly version: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
81
+ readonly name: v.StringSchema<undefined>;
82
+ readonly capabilities: v.ArraySchema<v.StringSchema<undefined>, undefined>;
83
+ readonly counterpartyRules: v.OptionalSchema<v.ObjectSchema<{
84
+ readonly mode: v.GenericSchema<string, ExtensibleString<readonly ["open", "restricted"]>>;
85
+ readonly allowedCounterparties: v.OptionalSchema<v.ArraySchema<v.StringSchema<undefined>, undefined>, undefined>;
86
+ readonly createAction: v.OptionalSchema<v.GenericSchema<string, ExtensibleString<readonly ["allow", "block", "require_approval"]>>, undefined>;
87
+ readonly requestPaymentDetailsAction: v.OptionalSchema<v.GenericSchema<string, ExtensibleString<readonly ["allow", "block", "require_approval"]>>, undefined>;
88
+ readonly allowCreate: v.OptionalSchema<v.BooleanSchema<undefined>, undefined>;
89
+ }, undefined>, undefined>;
90
+ readonly policyCapabilities: v.ArraySchema<v.ObjectSchema<{
91
+ readonly id: v.StringSchema<undefined>;
92
+ readonly organizationId: v.StringSchema<undefined>;
93
+ readonly policyId: v.StringSchema<undefined>;
94
+ readonly capability: v.GenericSchema<string, ExtensibleString<readonly ["query_balance", "read", "send", "transfer"]>>;
95
+ readonly accountId: v.StringSchema<undefined>;
96
+ readonly rules: v.ArraySchema<v.ObjectSchema<{
97
+ readonly id: v.StringSchema<undefined>;
98
+ readonly ruleType: v.GenericSchema<string, ExtensibleString<readonly ["per_transaction_amount", "daily_amount", "weekly_amount", "monthly_amount", "hourly_count", "daily_count"]>>;
99
+ readonly thresholdAmount: v.OptionalSchema<v.ObjectSchema<{
100
+ /**
101
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
102
+ * atomic units.
103
+ */
104
+ readonly amount: v.StringSchema<undefined>;
105
+ /**
106
+ * Asset identifier, e.g. "USD".
107
+ */
108
+ readonly asset_id: v.StringSchema<undefined>;
109
+ }, undefined>, undefined>;
110
+ readonly thresholdCount: v.OptionalSchema<v.NumberSchema<undefined>, undefined>;
111
+ readonly action: v.GenericSchema<string, ExtensibleString<readonly ["block", "require_approval"]>>;
112
+ readonly requiredApprovals: v.NumberSchema<undefined>;
113
+ readonly accountAggregationScope: v.GenericSchema<string, ExtensibleString<readonly ["per_account", "across_accounts"]>>;
114
+ readonly actorAggregationScope: v.GenericSchema<string, ExtensibleString<readonly ["per_agent", "per_policy"]>>;
115
+ readonly displayOrder: v.NumberSchema<undefined>;
116
+ }, undefined>, undefined>;
117
+ readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
118
+ readonly updatedAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
119
+ }, undefined>, undefined>;
120
+ /**
121
+ * "override" means a temporary policy override is active; `expiresAt` is
122
+ * when it lapses and the base policy applies again. Absent on servers
123
+ * that predate overrides and under the base policy respectively.
124
+ */
125
+ readonly kind: v.OptionalSchema<v.PicklistSchema<["base", "override"], undefined>, undefined>;
126
+ readonly expiresAt: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
127
+ }, undefined>;
128
+ type Policy = v.InferOutput<typeof policySchema>;
129
+ declare const accountsResponseSchema: v.ObjectSchema<{
130
+ readonly accounts: v.ArraySchema<v.ObjectSchema<{
131
+ readonly id: v.StringSchema<undefined>;
132
+ readonly name: v.StringSchema<undefined>;
133
+ readonly type: v.StringSchema<undefined>;
134
+ readonly currency: v.StringSchema<undefined>;
135
+ }, undefined>, undefined>;
136
+ }, undefined>;
137
+ type AccountsResponse = v.InferOutput<typeof accountsResponseSchema>;
138
+ declare const accountBalanceResponseSchema: v.ObjectSchema<{
139
+ readonly accountId: v.StringSchema<undefined>;
140
+ /**
141
+ * @deprecated Flat alias of `balances.total`; use `balances` instead.
142
+ */
143
+ readonly balance: v.ObjectSchema<{
144
+ /**
145
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
146
+ * atomic units.
147
+ */
148
+ readonly amount: v.StringSchema<undefined>;
149
+ /**
150
+ * Asset identifier, e.g. "USD".
151
+ */
152
+ readonly asset_id: v.StringSchema<undefined>;
153
+ }, undefined>;
154
+ /**
155
+ * `available` (what a send is checked against) is `total` minus reserved
156
+ * funds. Absent only from API deployments that predate the field.
157
+ */
158
+ readonly balances: v.OptionalSchema<v.ObjectSchema<{
159
+ readonly total: v.ObjectSchema<{
160
+ /**
161
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
162
+ * atomic units.
163
+ */
164
+ readonly amount: v.StringSchema<undefined>;
165
+ /**
166
+ * Asset identifier, e.g. "USD".
167
+ */
168
+ readonly asset_id: v.StringSchema<undefined>;
169
+ }, undefined>;
170
+ readonly available: v.ObjectSchema<{
171
+ /**
172
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
173
+ * atomic units.
174
+ */
175
+ readonly amount: v.StringSchema<undefined>;
176
+ /**
177
+ * Asset identifier, e.g. "USD".
178
+ */
179
+ readonly asset_id: v.StringSchema<undefined>;
180
+ }, undefined>;
181
+ }, undefined>, undefined>;
182
+ }, undefined>;
183
+ type AccountBalanceResponse = v.InferOutput<typeof accountBalanceResponseSchema>;
184
+ declare const ACCOUNT_TRANSACTION_TYPES: readonly ["operator-send", "operator-transfer", "operator-deposit", "operator-refund", "microdeposit"];
185
+ declare const ACCOUNT_TRANSACTION_STATUSES: readonly ["pending", "processing", "completed", "failed", "reversed"];
186
+ declare const ACCOUNT_TRANSACTION_MOVEMENT_STATUSES: readonly ["initiated", "provider_pending", "processing", "completed", "failed", "reversed", "manual_review"];
187
+ declare const SEND_METHODS: readonly ["ach", "wire", "on-chain"];
188
+ declare const ACCOUNT_TRANSACTION_METHODS: readonly ["ach", "wire", "on-chain"];
189
+ declare const accountTransactionsResponseSchema: v.ObjectSchema<{
190
+ readonly accountId: v.StringSchema<undefined>;
191
+ readonly transactions: v.ArraySchema<v.ObjectSchema<{
192
+ readonly id: v.StringSchema<undefined>;
193
+ readonly type: v.GenericSchema<string, ExtensibleString<readonly ["operator-send", "operator-transfer", "operator-deposit", "operator-refund", "microdeposit"]>>;
194
+ /**
195
+ * Display action — `receive` for on-chain receives, distinct from the raw
196
+ * `type`. Optional to tolerate an API deployed before this field existed.
197
+ */
198
+ readonly action: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
199
+ readonly status: v.GenericSchema<string, ExtensibleString<readonly ["pending", "processing", "completed", "failed", "reversed"]>>;
200
+ readonly movementStatus: v.GenericSchema<string, ExtensibleString<readonly ["initiated", "provider_pending", "processing", "completed", "failed", "reversed", "manual_review"]>>;
201
+ readonly direction: v.PicklistSchema<["incoming", "outgoing"], undefined>;
202
+ readonly amount: v.ObjectSchema<{
203
+ /**
204
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
205
+ * atomic units.
206
+ */
207
+ readonly amount: v.StringSchema<undefined>;
208
+ /**
209
+ * Asset identifier, e.g. "USD".
210
+ */
211
+ readonly asset_id: v.StringSchema<undefined>;
212
+ }, undefined>;
213
+ readonly fee: v.ObjectSchema<{
214
+ /**
215
+ * Decimal string in the asset's major unit: "12.50" is $12.50. Never cents or
216
+ * atomic units.
217
+ */
218
+ readonly amount: v.StringSchema<undefined>;
219
+ /**
220
+ * Asset identifier, e.g. "USD".
221
+ */
222
+ readonly asset_id: v.StringSchema<undefined>;
223
+ }, undefined>;
224
+ readonly currency: v.StringSchema<undefined>;
225
+ readonly counterpartyName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
226
+ readonly method: v.OptionalSchema<v.GenericSchema<string, ExtensibleString<readonly ["ach", "wire", "on-chain"]>>, undefined>;
227
+ readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
228
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
229
+ readonly txHash: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
230
+ readonly createdAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
231
+ readonly completedAt: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>;
232
+ }, undefined>, undefined>;
233
+ readonly total: v.NumberSchema<undefined>;
234
+ }, undefined>;
235
+ type AccountTransactionsResponse = v.InferOutput<typeof accountTransactionsResponseSchema>;
236
+ type AccountTransactionsParams = {
237
+ /**
238
+ * Inclusive lower bound on `createdAt`, as an ISO 8601 timestamp.
239
+ */
240
+ start?: string;
241
+ /**
242
+ * Inclusive upper bound on `createdAt`, as an ISO 8601 timestamp.
243
+ */
244
+ end?: string;
245
+ /**
246
+ * Page size; positive integer, defaults to 50, values above 200 are
247
+ * clamped to 200. Non-integer or non-positive values are rejected (400).
248
+ */
249
+ limit?: number;
250
+ /**
251
+ * Rows to skip; nonnegative integer, defaults to 0. Non-integer or
252
+ * negative values are rejected (400).
253
+ */
254
+ offset?: number;
255
+ };
256
+ declare const ACCOUNT_DEPOSIT_ADDRESS_SOURCES: readonly ["wallet", "liquidation"];
257
+ declare const accountDepositAddressResponseSchema: v.ObjectSchema<{
258
+ readonly accountId: v.StringSchema<undefined>;
259
+ readonly address: v.StringSchema<undefined>;
260
+ readonly liquidationAddressId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
261
+ readonly source: v.GenericSchema<string, ExtensibleString<readonly ["wallet", "liquidation"]>>;
262
+ }, undefined>;
263
+ type AccountDepositAddressResponse = v.InferOutput<typeof accountDepositAddressResponseSchema>;
264
+ /**
265
+ * Widened network/asset inputs: autocomplete from the literal half, but any
266
+ * string is accepted — the server is the enforcement boundary, so a network
267
+ * or asset added server-side never becomes a compile-time wall for an older
268
+ * SDK. Response schemas parse plain strings for the same reason.
269
+ */
270
+ type OnchainNetworkInput = "base" | "base-sepolia" | (string & {});
271
+ type OnchainAssetInput = "usdc" | (string & {});
272
+ type AccountDepositAddressParams = {
273
+ network: OnchainNetworkInput;
274
+ asset: OnchainAssetInput;
275
+ };
276
+ /**
277
+ * Rails are modeled tolerantly rather than as a variant on `type`: each
278
+ * field is present only on the rail types it applies to (wallet rails carry
279
+ * `walletAddress`/`network`, bank rails carry `bankName`/`accountNumber`),
280
+ * and a server that later adds a new rail type must not break older clients.
281
+ */
282
+ declare const counterpartySchema: v.ObjectSchema<{
283
+ readonly id: v.StringSchema<undefined>;
284
+ readonly name: v.StringSchema<undefined>;
285
+ /**
286
+ * Server-derived payment-detail readiness. Current values are "ready" and
287
+ * "awaiting_details"; treat other strings as future lifecycle states.
288
+ * Optional so this SDK can still read responses from older servers.
289
+ */
290
+ readonly status: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
291
+ readonly rails: v.ArraySchema<v.ObjectSchema<{
292
+ readonly id: v.StringSchema<undefined>;
293
+ /**
294
+ * Rail kind — currently "wallet" or "bank"; treat other values as
295
+ * future rail types. Sends must match method to rail: "ach" and
296
+ * "wire" need a bank rail, "on-chain" needs a wallet rail.
297
+ */
298
+ readonly type: v.StringSchema<undefined>;
299
+ readonly walletAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
300
+ readonly network: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
301
+ readonly bankName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
302
+ readonly accountNumber: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
303
+ }, undefined>, undefined>;
304
+ }, undefined>;
305
+ type Counterparty = v.InferOutput<typeof counterpartySchema>;
306
+ declare const counterpartiesResponseSchema: v.ObjectSchema<{
307
+ readonly counterparties: v.ArraySchema<v.ObjectSchema<{
308
+ readonly id: v.StringSchema<undefined>;
309
+ readonly name: v.StringSchema<undefined>;
310
+ /**
311
+ * Server-derived payment-detail readiness. Current values are "ready" and
312
+ * "awaiting_details"; treat other strings as future lifecycle states.
313
+ * Optional so this SDK can still read responses from older servers.
314
+ */
315
+ readonly status: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
316
+ readonly rails: v.ArraySchema<v.ObjectSchema<{
317
+ readonly id: v.StringSchema<undefined>;
318
+ /**
319
+ * Rail kind — currently "wallet" or "bank"; treat other values as
320
+ * future rail types. Sends must match method to rail: "ach" and
321
+ * "wire" need a bank rail, "on-chain" needs a wallet rail.
322
+ */
323
+ readonly type: v.StringSchema<undefined>;
324
+ readonly walletAddress: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
325
+ readonly network: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
326
+ readonly bankName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
327
+ readonly accountNumber: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
328
+ }, undefined>, undefined>;
329
+ }, undefined>, undefined>;
330
+ }, undefined>;
331
+ type CounterpartiesResponse = v.InferOutput<typeof counterpartiesResponseSchema>;
332
+ type CounterpartiesParams = {
333
+ /**
334
+ * Only counterparties with a wallet rail at this address.
335
+ */
336
+ address?: `0x${string}` | undefined;
337
+ /**
338
+ * Only counterparties with a wallet rail on this network.
339
+ */
340
+ network?: OnchainNetworkInput | undefined;
341
+ };
342
+ declare const INTENT_ACTION_TYPES: readonly ["send", "transfer", "create_counterparty", "request_counterparty_details", "x402", "mpp", "policy_override"];
343
+ declare const wireIntentResultSchema: v.ObjectSchema<{
344
+ readonly id: v.StringSchema<undefined>;
345
+ /**
346
+ * Resolved source account, pinned at creation even if policy later changes.
347
+ * Omitted for actions without an account and by older servers.
348
+ */
349
+ readonly accountId: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
350
+ readonly type: v.GenericSchema<string, ExtensibleString<readonly ["send", "transfer", "create_counterparty", "request_counterparty_details", "x402", "mpp", "policy_override"]>>;
351
+ /**
352
+ * Disposition of the intent:
353
+ *
354
+ * - "pending" — accepted but not yet executing, typically parked for a human
355
+ * approval; `reasons` says why and `expiresAt` when it lapses.
356
+ * - "processing" — accepted and in progress. Executing intents advance on their
357
+ * own; poll `getIntent`. An approved MPP or x402 payment instead rests here
358
+ * until the paid request is re-run — polling never advances it — and
359
+ * `expiresAt` is when that grant lapses.
360
+ * - "completed" — the action succeeded: money moved for send and transfer; for
361
+ * MPP and x402 the payment authorization was delivered
362
+ * (`data.paymentCredential.value`), with on-chain settlement verified
363
+ * separately; for create_counterparty the counterparty exists.
364
+ * - "blocked" — declined by policy or denied by an operator; `reasons` explains
365
+ * why approval was required, not necessarily why it was denied. Terminal.
366
+ * - "failed" — failed, expired, or reversed. Terminal.
367
+ */
368
+ readonly status: v.PicklistSchema<["pending", "processing", "completed", "blocked", "failed"], undefined>;
369
+ /**
370
+ * Human-readable explanations for a pending, blocked, or failed status.
371
+ */
372
+ readonly reasons: v.ArraySchema<v.StringSchema<undefined>, undefined>;
373
+ /**
374
+ * Deadline for an awaiting state: while parked for approval, when the
375
+ * request self-expires; while an approved payment grant rests, when the
376
+ * grant lapses. Optional to tolerate an API deployed before this field
377
+ * existed.
378
+ */
379
+ readonly expiresAt: v.OptionalSchema<v.NullableSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>, undefined>, null>;
380
+ /**
381
+ * True when `submitIntent` matched an earlier request and the server handed
382
+ * that intent back rather than accepting a new action — so a `completed`
383
+ * status describes the earlier movement, not one this call made. Check
384
+ * `data.transaction` to see which movement it is. Always false on a read, and
385
+ * on an API deployed before this field existed.
386
+ */
387
+ readonly replayed: v.OptionalSchema<v.BooleanSchema<undefined>, false>;
388
+ /**
389
+ * Intent-type-specific payload. A completed payment intent carries the
390
+ * credential to present to the seller at `data.paymentCredential`
391
+ * (`{ protocol, value }`, where `value` is the serialized retry credential)
392
+ * and its transaction at `data.transaction`; `data.x402` is a deprecated
393
+ * x402-specific copy of both.
394
+ */
395
+ readonly data: v.OptionalSchema<v.NullableSchema<v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>, undefined>, null>;
396
+ readonly metadata: v.OptionalSchema<v.ObjectSchema<{
397
+ readonly dataUrl: v.NullableSchema<v.StringSchema<undefined>, undefined>;
398
+ }, undefined>, undefined>;
399
+ readonly nextAction: v.OptionalSchema<v.ObjectSchema<{
400
+ readonly type: v.LiteralSchema<"submit_stamp", undefined>;
401
+ readonly signingRequestId: v.StringSchema<undefined>;
402
+ readonly signer: v.ObjectSchema<{
403
+ readonly algorithm: v.LiteralSchema<"p256", undefined>;
404
+ readonly publicKeyHex: v.StringSchema<undefined>;
405
+ }, undefined>;
406
+ readonly preparedBody: v.ObjectSchema<{
407
+ readonly body: v.StringSchema<undefined>;
408
+ readonly bodyHash: v.StringSchema<undefined>;
409
+ readonly expiresAt: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.IsoTimestampAction<string, undefined>]>;
410
+ readonly prepareToken: v.StringSchema<undefined>;
411
+ }, undefined>;
412
+ }, undefined>, undefined>;
413
+ }, undefined>;
414
+ type WireIntentResult = v.InferOutput<typeof wireIntentResultSchema>;
415
+ /**
416
+ * Public view of an intent, as returned by `submitIntent` and `getIntent`.
417
+ * Branch on `status`; `reasons` explains non-completed outcomes.
418
+ *
419
+ * The co-signing step inside `submitIntent` is not resumable from a re-read
420
+ * intent: one awaiting its co-signature reads as plain "processing" here.
421
+ * Recovery from a failed submit follows `IntentSubmitError`'s outcome
422
+ * contract: a new `submitIntent` only when the outcome was "not-submitted";
423
+ * when it was "unknown", poll `getIntent` to a terminal status and submit
424
+ * again only if it ended blocked or failed.
425
+ */
426
+ type IntentResult = Omit<WireIntentResult, "nextAction">;
427
+ declare const sendMethodSchema: v.PicklistSchema<readonly ["ach", "wire", "on-chain"], undefined>;
428
+ type SendMethod = v.InferOutput<typeof sendMethodSchema>;
429
+ /**
430
+ * The `PaymentRequirements` a 402 challenge names, relayed to the API
431
+ * verbatim. Loose on purpose: the API is the enforcement boundary (shape,
432
+ * guardrails, policy); the client only needs the discriminating fields to
433
+ * pick a candidate from `accepts`.
434
+ */
435
+ declare const x402PaymentRequirementsSchema: v.LooseObjectSchema<{
436
+ readonly scheme: v.StringSchema<undefined>;
437
+ readonly network: v.StringSchema<undefined>;
438
+ readonly asset: v.StringSchema<undefined>;
439
+ readonly amount: v.StringSchema<undefined>;
440
+ readonly payTo: v.StringSchema<undefined>;
441
+ readonly maxTimeoutSeconds: v.NumberSchema<undefined>;
442
+ }, undefined>;
443
+ type X402PaymentRequirements = v.InferOutput<typeof x402PaymentRequirementsSchema>;
444
+ declare const x402ResourceSchema: v.LooseObjectSchema<{
445
+ readonly url: v.StringSchema<undefined>;
446
+ /**
447
+ * Human-readable name of the paid service, when the challenge advertises
448
+ * one — a suggested name when creating the counterparty. Parsed leniently:
449
+ * a malformed value (non-string, or over-long) drops to undefined rather
450
+ * than failing the whole challenge parse, which would silently downgrade
451
+ * an otherwise-payable 402 to an unpaid passthrough.
452
+ */
453
+ readonly serviceName: v.SchemaWithFallback<v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
454
+ }, undefined>;
455
+ type X402Resource = v.InferOutput<typeof x402ResourceSchema>;
456
+ declare const x402AuthorizationSchema: v.ObjectSchema<{
457
+ /**
458
+ * Wallet address the transfer draws from. Must be the paying account's
459
+ * wallet address; the server rejects any other value. A mixed-case
460
+ * spelling must carry a valid EIP-55 checksum; all-lowercase is accepted.
461
+ */
462
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 20-byte hex address">]>;
463
+ /**
464
+ * Recipient address. Must equal the requirement's `payTo` (case may
465
+ * differ) and resolve to a saved counterparty wallet rail. A mixed-case
466
+ * spelling must carry a valid EIP-55 checksum; all-lowercase is accepted.
467
+ */
468
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 20-byte hex address">]>;
469
+ /**
470
+ * Amount in atomic token units as a canonical decimal string (no leading
471
+ * zeros). Must equal the requirement's `amount`.
472
+ */
473
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
474
+ /**
475
+ * Unix seconds the authorization becomes valid, as a canonical decimal
476
+ * string. Must not be in the future.
477
+ */
478
+ readonly validAfter: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
479
+ /**
480
+ * Unix seconds the authorization expires, as a canonical decimal string.
481
+ * Bounded by the requirement's `maxTimeoutSeconds` and must leave time to
482
+ * settle.
483
+ */
484
+ readonly validBefore: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
485
+ /**
486
+ * 32-byte hex nonce (`0x` + 64 hex characters), unique per payment for
487
+ * the wallet. A nonce ever used by an earlier payment is refused; retry
488
+ * with a fresh one.
489
+ */
490
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 32-byte hex nonce">]>;
491
+ }, undefined>;
492
+ /**
493
+ * Caller-supplied EIP-3009 `TransferWithAuthorization` message. When present
494
+ * on an x402 action, the server validates and signs these exact values
495
+ * instead of minting its own authorization, so the returned payment
496
+ * signature verifies against typed data the caller constructed.
497
+ */
498
+ type X402Authorization = v.InferOutput<typeof x402AuthorizationSchema>;
499
+ declare const mppChallengeSchema: v.ObjectSchema<{
500
+ /**
501
+ * Seller-issued challenge identifier.
502
+ */
503
+ readonly id: v.StringSchema<undefined>;
504
+ /**
505
+ * Seller protection space that issued the challenge.
506
+ */
507
+ readonly realm: v.StringSchema<undefined>;
508
+ /**
509
+ * Supported MPP payment method.
510
+ */
511
+ readonly method: v.PicklistSchema<["evm", "usdc"], undefined>;
512
+ /**
513
+ * Catena supports MPP charge intents only.
514
+ */
515
+ readonly intent: v.LiteralSchema<"charge", undefined>;
516
+ /**
517
+ * Base64url-encoded, canonical MPP payment request.
518
+ */
519
+ readonly request: v.StringSchema<undefined>;
520
+ /**
521
+ * Optional seller description of the charge.
522
+ */
523
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
524
+ /**
525
+ * Optional seller-declared request-body digest, relayed unchanged.
526
+ */
527
+ readonly digest: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
528
+ /**
529
+ * UTC challenge expiry timestamp.
530
+ */
531
+ readonly expires: v.StringSchema<undefined>;
532
+ /**
533
+ * Alternate field for the credential when HTTP Authorization is occupied.
534
+ */
535
+ readonly header: v.OptionalSchema<v.LiteralSchema<"Payment-Authorization", undefined>, undefined>;
536
+ /**
537
+ * Opaque base64url seller state, relayed unchanged.
538
+ */
539
+ readonly opaque: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
540
+ }, undefined>;
541
+ /**
542
+ * Serialized MPP challenge accepted by the Catena intent API. `request` is
543
+ * the challenge's base64url-encoded payment request; `digest`, when present,
544
+ * is relayed unchanged for the seller to verify.
545
+ */
546
+ type MppChallenge = v.InferOutput<typeof mppChallengeSchema>;
547
+ declare const mppResourceSchema: v.ObjectSchema<{
548
+ /**
549
+ * Absolute URL of the paid resource.
550
+ */
551
+ readonly url: v.StringSchema<undefined>;
552
+ /**
553
+ * Optional human-readable seller or service name.
554
+ */
555
+ readonly serviceName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
556
+ }, undefined>;
557
+ /**
558
+ * Optional seller resource metadata attached by low-level callers.
559
+ */
560
+ type MppResource = v.InferOutput<typeof mppResourceSchema>;
561
+ declare const mppActionSchema: v.ObjectSchema<{
562
+ /**
563
+ * MPP payment action discriminator.
564
+ */
565
+ readonly type: v.LiteralSchema<"mpp", undefined>;
566
+ /**
567
+ * Catena account whose wallet authorizes the charge.
568
+ */
569
+ readonly accountId: v.StringSchema<undefined>;
570
+ /**
571
+ * Serialized seller challenge to authorize.
572
+ */
573
+ readonly challenge: v.ObjectSchema<{
574
+ /**
575
+ * Seller-issued challenge identifier.
576
+ */
577
+ readonly id: v.StringSchema<undefined>;
578
+ /**
579
+ * Seller protection space that issued the challenge.
580
+ */
581
+ readonly realm: v.StringSchema<undefined>;
582
+ /**
583
+ * Supported MPP payment method.
584
+ */
585
+ readonly method: v.PicklistSchema<["evm", "usdc"], undefined>;
586
+ /**
587
+ * Catena supports MPP charge intents only.
588
+ */
589
+ readonly intent: v.LiteralSchema<"charge", undefined>;
590
+ /**
591
+ * Base64url-encoded, canonical MPP payment request.
592
+ */
593
+ readonly request: v.StringSchema<undefined>;
594
+ /**
595
+ * Optional seller description of the charge.
596
+ */
597
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
598
+ /**
599
+ * Optional seller-declared request-body digest, relayed unchanged.
600
+ */
601
+ readonly digest: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
602
+ /**
603
+ * UTC challenge expiry timestamp.
604
+ */
605
+ readonly expires: v.StringSchema<undefined>;
606
+ /**
607
+ * Alternate field for the credential when HTTP Authorization is occupied.
608
+ */
609
+ readonly header: v.OptionalSchema<v.LiteralSchema<"Payment-Authorization", undefined>, undefined>;
610
+ /**
611
+ * Opaque base64url seller state, relayed unchanged.
612
+ */
613
+ readonly opaque: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
614
+ }, undefined>;
615
+ /**
616
+ * Optional resource binding for low-level callers.
617
+ */
618
+ readonly resource: v.OptionalSchema<v.ObjectSchema<{
619
+ /**
620
+ * Absolute URL of the paid resource.
621
+ */
622
+ readonly url: v.StringSchema<undefined>;
623
+ /**
624
+ * Optional human-readable seller or service name.
625
+ */
626
+ readonly serviceName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
627
+ }, undefined>, undefined>;
628
+ }, undefined>;
629
+ /**
630
+ * Low-level Catena intent action for an MPP charge.
631
+ */
632
+ type MppAction = v.InferOutput<typeof mppActionSchema>;
633
+ declare const POLICY_OVERRIDE_CAPABILITIES: readonly ["send", "transfer"];
634
+ declare const intentActionSchema: v.UnionSchema<[v.ObjectSchema<{
635
+ readonly type: v.LiteralSchema<"send", undefined>;
636
+ /**
637
+ * Omit when the current policy allows sends from exactly one account.
638
+ * Zero or multiple send accounts require a policy change or an explicit id.
639
+ */
640
+ readonly accountId: v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>, undefined>;
641
+ /**
642
+ * Id of one entry in a counterparty's `rails` array (from
643
+ * `listCounterparties`) — not the counterparty id itself.
644
+ */
645
+ readonly counterpartyRailId: v.StringSchema<undefined>;
646
+ /**
647
+ * Decimal USD string: "12.50" is $12.50. Never cents or atomic units.
648
+ */
649
+ readonly amount: v.StringSchema<undefined>;
650
+ readonly method: v.PicklistSchema<readonly ["ach", "wire", "on-chain"], undefined>;
651
+ readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
652
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
653
+ }, undefined>, v.ObjectSchema<{
654
+ readonly type: v.LiteralSchema<"transfer", undefined>;
655
+ readonly accountId: v.StringSchema<undefined>;
656
+ readonly toAccountId: v.StringSchema<undefined>;
657
+ /**
658
+ * Decimal USD string: "12.50" is $12.50. Never cents or atomic units.
659
+ */
660
+ readonly amount: v.StringSchema<undefined>;
661
+ readonly memo: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
662
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
663
+ }, undefined>, v.UnionSchema<[v.ObjectSchema<{
664
+ readonly type: v.LiteralSchema<"create_counterparty", undefined>;
665
+ readonly name: v.StringSchema<undefined>;
666
+ readonly email: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
667
+ readonly rail: v.NonOptionalSchema<v.UnknownSchema, undefined>;
668
+ }, undefined>, v.ObjectSchema<{
669
+ readonly type: v.LiteralSchema<"create_counterparty", undefined>;
670
+ readonly name: v.StringSchema<undefined>;
671
+ /**
672
+ * Required when no rail is supplied. This records contact information only;
673
+ * creating the counterparty does not send an email.
674
+ */
675
+ readonly email: v.StringSchema<undefined>;
676
+ }, undefined>], undefined>, v.ObjectSchema<{
677
+ readonly type: v.LiteralSchema<"request_counterparty_details", undefined>;
678
+ readonly counterpartyId: v.StringSchema<undefined>;
679
+ readonly methods: v.SchemaWithPipe<readonly [v.ObjectSchema<{
680
+ readonly bank: v.BooleanSchema<undefined>;
681
+ readonly wallet: v.BooleanSchema<undefined>;
682
+ }, undefined>, v.CheckAction<{
683
+ bank: boolean;
684
+ wallet: boolean;
685
+ }, "Select at least one payment method to request">]>;
686
+ }, undefined>, v.ObjectSchema<{
687
+ readonly type: v.LiteralSchema<"x402", undefined>;
688
+ readonly accountId: v.StringSchema<undefined>;
689
+ readonly paymentRequirements: v.LooseObjectSchema<{
690
+ readonly scheme: v.StringSchema<undefined>;
691
+ readonly network: v.StringSchema<undefined>;
692
+ readonly asset: v.StringSchema<undefined>;
693
+ readonly amount: v.StringSchema<undefined>;
694
+ readonly payTo: v.StringSchema<undefined>;
695
+ readonly maxTimeoutSeconds: v.NumberSchema<undefined>;
696
+ }, undefined>;
697
+ readonly resource: v.OptionalSchema<v.LooseObjectSchema<{
698
+ readonly url: v.StringSchema<undefined>;
699
+ /**
700
+ * Human-readable name of the paid service, when the challenge advertises
701
+ * one — a suggested name when creating the counterparty. Parsed leniently:
702
+ * a malformed value (non-string, or over-long) drops to undefined rather
703
+ * than failing the whole challenge parse, which would silently downgrade
704
+ * an otherwise-payable 402 to an unpaid passthrough.
705
+ */
706
+ readonly serviceName: v.SchemaWithFallback<v.OptionalSchema<v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 255, undefined>]>, undefined>, undefined>;
707
+ }, undefined>, undefined>;
708
+ /**
709
+ * Optional caller-supplied authorization; the server mints its own when
710
+ * absent.
711
+ */
712
+ readonly authorization: v.OptionalSchema<v.ObjectSchema<{
713
+ /**
714
+ * Wallet address the transfer draws from. Must be the paying account's
715
+ * wallet address; the server rejects any other value. A mixed-case
716
+ * spelling must carry a valid EIP-55 checksum; all-lowercase is accepted.
717
+ */
718
+ readonly from: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 20-byte hex address">]>;
719
+ /**
720
+ * Recipient address. Must equal the requirement's `payTo` (case may
721
+ * differ) and resolve to a saved counterparty wallet rail. A mixed-case
722
+ * spelling must carry a valid EIP-55 checksum; all-lowercase is accepted.
723
+ */
724
+ readonly to: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 20-byte hex address">]>;
725
+ /**
726
+ * Amount in atomic token units as a canonical decimal string (no leading
727
+ * zeros). Must equal the requirement's `amount`.
728
+ */
729
+ readonly value: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
730
+ /**
731
+ * Unix seconds the authorization becomes valid, as a canonical decimal
732
+ * string. Must not be in the future.
733
+ */
734
+ readonly validAfter: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
735
+ /**
736
+ * Unix seconds the authorization expires, as a canonical decimal string.
737
+ * Bounded by the requirement's `maxTimeoutSeconds` and must leave time to
738
+ * settle.
739
+ */
740
+ readonly validBefore: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, 78, undefined>, v.RegexAction<string, "Expected a canonical decimal integer string">]>;
741
+ /**
742
+ * 32-byte hex nonce (`0x` + 64 hex characters), unique per payment for
743
+ * the wallet. A nonce ever used by an earlier payment is refused; retry
744
+ * with a fresh one.
745
+ */
746
+ readonly nonce: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 32-byte hex nonce">]>;
747
+ }, undefined>, undefined>;
748
+ /**
749
+ * The seller's signed offer for this requirement (x402 Offer & Receipt
750
+ * extension), relayed verbatim; the server verifies it and stores it as
751
+ * payment evidence. The x402 fetch wrapper attaches it automatically when
752
+ * the 402 challenge carries one.
753
+ */
754
+ readonly signedOffer: v.OptionalSchema<v.VariantSchema<"format", [v.LooseObjectSchema<{
755
+ readonly format: v.LiteralSchema<"eip712", undefined>;
756
+ readonly acceptIndex: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
757
+ readonly payload: v.RecordSchema<v.StringSchema<undefined>, v.UnknownSchema, undefined>;
758
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, "Expected a 65-byte hex signature">]>;
759
+ }, undefined>, v.LooseObjectSchema<{
760
+ readonly format: v.LiteralSchema<"jws", undefined>;
761
+ readonly acceptIndex: v.OptionalSchema<v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 0, undefined>]>, undefined>;
762
+ readonly signature: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MaxLengthAction<string, number, undefined>, v.RegexAction<string, "Expected a JWS compact serialization">]>;
763
+ }, undefined>], undefined>, undefined>;
764
+ }, undefined>, v.ObjectSchema<{
765
+ /**
766
+ * MPP payment action discriminator.
767
+ */
768
+ readonly type: v.LiteralSchema<"mpp", undefined>;
769
+ /**
770
+ * Catena account whose wallet authorizes the charge.
771
+ */
772
+ readonly accountId: v.StringSchema<undefined>;
773
+ /**
774
+ * Serialized seller challenge to authorize.
775
+ */
776
+ readonly challenge: v.ObjectSchema<{
777
+ /**
778
+ * Seller-issued challenge identifier.
779
+ */
780
+ readonly id: v.StringSchema<undefined>;
781
+ /**
782
+ * Seller protection space that issued the challenge.
783
+ */
784
+ readonly realm: v.StringSchema<undefined>;
785
+ /**
786
+ * Supported MPP payment method.
787
+ */
788
+ readonly method: v.PicklistSchema<["evm", "usdc"], undefined>;
789
+ /**
790
+ * Catena supports MPP charge intents only.
791
+ */
792
+ readonly intent: v.LiteralSchema<"charge", undefined>;
793
+ /**
794
+ * Base64url-encoded, canonical MPP payment request.
795
+ */
796
+ readonly request: v.StringSchema<undefined>;
797
+ /**
798
+ * Optional seller description of the charge.
799
+ */
800
+ readonly description: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
801
+ /**
802
+ * Optional seller-declared request-body digest, relayed unchanged.
803
+ */
804
+ readonly digest: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
805
+ /**
806
+ * UTC challenge expiry timestamp.
807
+ */
808
+ readonly expires: v.StringSchema<undefined>;
809
+ /**
810
+ * Alternate field for the credential when HTTP Authorization is occupied.
811
+ */
812
+ readonly header: v.OptionalSchema<v.LiteralSchema<"Payment-Authorization", undefined>, undefined>;
813
+ /**
814
+ * Opaque base64url seller state, relayed unchanged.
815
+ */
816
+ readonly opaque: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
817
+ }, undefined>;
818
+ /**
819
+ * Optional resource binding for low-level callers.
820
+ */
821
+ readonly resource: v.OptionalSchema<v.ObjectSchema<{
822
+ /**
823
+ * Absolute URL of the paid resource.
824
+ */
825
+ readonly url: v.StringSchema<undefined>;
826
+ /**
827
+ * Optional human-readable seller or service name.
828
+ */
829
+ readonly serviceName: v.OptionalSchema<v.StringSchema<undefined>, undefined>;
830
+ }, undefined>, undefined>;
831
+ }, undefined>, v.ObjectSchema<{
832
+ readonly type: v.LiteralSchema<"policy_override", undefined>;
833
+ readonly operations: v.SchemaWithPipe<readonly [v.ArraySchema<v.UnionSchema<[v.StrictObjectSchema<{
834
+ readonly type: v.LiteralSchema<"increase_limit", undefined>;
835
+ readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
836
+ readonly capability: v.PicklistSchema<readonly ["send", "transfer"], undefined>;
837
+ readonly limitType: v.PicklistSchema<["per_transaction_amount", "daily_amount", "weekly_amount", "monthly_amount"], undefined>;
838
+ readonly newLimit: v.StrictObjectSchema<{
839
+ readonly amount: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.RegexAction<string, undefined>, v.CheckAction<string, "The amount must be greater than zero">]>;
840
+ readonly assetId: v.LiteralSchema<"USD", undefined>;
841
+ }, undefined>;
842
+ }, undefined>, v.StrictObjectSchema<{
843
+ readonly type: v.LiteralSchema<"increase_limit", undefined>;
844
+ readonly accountId: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.MinLengthAction<string, 1, undefined>]>;
845
+ readonly capability: v.PicklistSchema<readonly ["send", "transfer"], undefined>;
846
+ readonly limitType: v.PicklistSchema<["hourly_count", "daily_count"], undefined>;
847
+ readonly newLimit: v.StrictObjectSchema<{
848
+ readonly count: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 1, undefined>]>;
849
+ }, undefined>;
850
+ }, undefined>], undefined>, undefined>, v.MinLengthAction<({
851
+ type: "increase_limit";
852
+ accountId: string;
853
+ capability: "send" | "transfer";
854
+ limitType: "daily_amount" | "monthly_amount" | "per_transaction_amount" | "weekly_amount";
855
+ newLimit: {
856
+ amount: string;
857
+ assetId: "USD";
858
+ };
859
+ } | {
860
+ type: "increase_limit";
861
+ accountId: string;
862
+ capability: "send" | "transfer";
863
+ limitType: "daily_count" | "hourly_count";
864
+ newLimit: {
865
+ count: number;
866
+ };
867
+ })[], 1, undefined>, v.MaxLengthAction<({
868
+ type: "increase_limit";
869
+ accountId: string;
870
+ capability: "send" | "transfer";
871
+ limitType: "daily_amount" | "monthly_amount" | "per_transaction_amount" | "weekly_amount";
872
+ newLimit: {
873
+ amount: string;
874
+ assetId: "USD";
875
+ };
876
+ } | {
877
+ type: "increase_limit";
878
+ accountId: string;
879
+ capability: "send" | "transfer";
880
+ limitType: "daily_count" | "hourly_count";
881
+ newLimit: {
882
+ count: number;
883
+ };
884
+ })[], 10, undefined>, v.CheckAction<({
885
+ type: "increase_limit";
886
+ accountId: string;
887
+ capability: "send" | "transfer";
888
+ limitType: "daily_amount" | "monthly_amount" | "per_transaction_amount" | "weekly_amount";
889
+ newLimit: {
890
+ amount: string;
891
+ assetId: "USD";
892
+ };
893
+ } | {
894
+ type: "increase_limit";
895
+ accountId: string;
896
+ capability: "send" | "transfer";
897
+ limitType: "daily_count" | "hourly_count";
898
+ newLimit: {
899
+ count: number;
900
+ };
901
+ })[], "Each account, capability, and limit type may appear only once">]>;
902
+ /**
903
+ * One minute to seven days; the clock starts at approval.
904
+ */
905
+ readonly durationSeconds: v.SchemaWithPipe<readonly [v.NumberSchema<undefined>, v.IntegerAction<number, undefined>, v.MinValueAction<number, 60, undefined>, v.MaxValueAction<number, number, undefined>]>;
906
+ readonly reason: v.SchemaWithPipe<readonly [v.StringSchema<undefined>, v.TrimAction, v.MinLengthAction<string, 1, undefined>, v.MaxLengthAction<string, 280, undefined>]>;
907
+ }, undefined>], undefined>;
908
+ type IntentAction = v.InferOutput<typeof intentActionSchema>;
909
+ //#endregion
910
+ //#region src/client.d.ts
911
+ /**
912
+ * Non-OK API response. `code` is the API's stable error code — branch on it,
913
+ * not on message prose. The code is also embedded in the message so hosts
914
+ * that only print `error.message` still surface it.
915
+ */
916
+ declare class ApiError extends Error {
917
+ readonly status: number;
918
+ readonly code: string | undefined;
919
+ readonly details: Record<string, unknown> | undefined;
920
+ constructor(status: number, message: string, code?: string, details?: Record<string, unknown>);
921
+ }
922
+ /**
923
+ * An HTTP exchange exceeded the client's configured deadline. The deadline
924
+ * starts when the signed request is dispatched and remains active until the
925
+ * response body has been fully consumed and validated. This means the SDK
926
+ * stopped waiting, not that the server did no work.
927
+ */
928
+ declare class TimeoutError extends Error {
929
+ readonly timeoutMs: number;
930
+ constructor(timeoutMs: number);
931
+ }
932
+ /**
933
+ * A `submitIntent` failure after the intent was created. `outcome` is the
934
+ * contract — callers branch on effect, never on which internal phase failed:
935
+ *
936
+ * - `"not-submitted"`: nothing happened server-side after create; no money moved.
937
+ * Recovery is a new `submitIntent` invocation with a new idempotency key,
938
+ * typically after fixing the signing credential. Omit `idempotencyKey` to
939
+ * generate one, or supply a different value; do not reuse the original key.
940
+ * Reusing it finds the stranded intent and can return a 409 rather than
941
+ * restart signing. The stranded intent settles or expires server-side.
942
+ * - `"unknown"`: the failure landed where the server may have already acted. Poll
943
+ * `getIntent(intentId)` to a terminal status — completed means it succeeded;
944
+ * submit again only after blocked or failed. A blind re-submit risks a double
945
+ * effect.
946
+ *
947
+ * `cause` carries the raw underlying error for diagnostics, not contract.
948
+ * Its summary is embedded in the message so hosts that print only
949
+ * `error.message` keep the actionable detail — e.g. which key a signer
950
+ * mismatch names.
951
+ */
952
+ declare class IntentSubmitError extends Error {
953
+ readonly intentId: string;
954
+ readonly outcome: "not-submitted" | "unknown";
955
+ constructor(params: {
956
+ intentId: string;
957
+ outcome: "not-submitted" | "unknown";
958
+ cause: unknown;
959
+ });
960
+ }
961
+ /**
962
+ * Transport signature: the callable subset of the global `fetch`. Deliberately
963
+ * structural rather than `typeof globalThis.fetch` — that alias resolves
964
+ * against the consumer's platform types, where fetch may carry extra statics
965
+ * (e.g. Bun's `fetch.preconnect`) that custom transports and the x402 wrapper
966
+ * do not have. Exported so hosts can type a custom implementation and name
967
+ * what `wrapFetchWithX402Payment` returns.
968
+ */
969
+ type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
970
+ interface CatenaClientOptions {
971
+ /**
972
+ * API origin, defaulting to the hosted Catena API. Override for local
973
+ * development or a self-hosted deployment.
974
+ */
975
+ baseUrl?: string;
976
+ /**
977
+ * P-256 private key of a linked agent credential, 64 hex characters (see
978
+ * `@catena/sdk/keypair` to generate one). The public half is derived, so a
979
+ * corrupt value throws here instead of failing with 401s at the bank. The
980
+ * key signs every request (RFC 9421) and co-signs wallet sends during
981
+ * `submitIntent`. When this option is `undefined`, the client reads
982
+ * `CATENA_SECRET_KEY` from the process environment. An explicit value always
983
+ * wins and is validated even when it is empty.
984
+ */
985
+ privateKeyHex?: string;
986
+ /**
987
+ * Signature-Agent identity URL, defaulting to a URL derived from the
988
+ * key's thumbprint. The default changes on key rotation; pass a stable
989
+ * URL (an agent page, a self-hosted JWKS) when the identity must survive it.
990
+ */
991
+ identityUrl?: string;
992
+ /**
993
+ * Caller identification prepended to the User-Agent. Telemetry only —
994
+ * never carries authority.
995
+ */
996
+ appInfo?: AppInfo;
997
+ /**
998
+ * Merged into every request; per-request headers win.
999
+ */
1000
+ defaultHeaders?: Record<string, string>;
1001
+ /**
1002
+ * Transport override, defaulting to the global `fetch`. Injected so hosts can
1003
+ * route requests through a proxy or instrumentation layer, and so tests can
1004
+ * pass a stub instead of patching `globalThis.fetch`.
1005
+ */
1006
+ fetch?: FetchLike;
1007
+ /**
1008
+ * Deadline in milliseconds for each HTTP exchange, from dispatch through
1009
+ * complete response-body parsing. Defaults to 80,000ms. Multi-exchange
1010
+ * operations such as `submitIntent` receive a fresh deadline per exchange.
1011
+ * Must be a positive integer no greater than 2,147,483,647.
1012
+ */
1013
+ timeout?: number;
1014
+ }
1015
+ declare class CatenaClient {
1016
+ #private;
1017
+ constructor(opts: CatenaClientOptions & {
1018
+ privateKeyHex: string;
1019
+ });
1020
+ whoami(): Promise<Agent>;
1021
+ /**
1022
+ * Send free-form feedback about this integration to the bank's operators —
1023
+ * an in-band channel for agents to report friction, confusing errors, or
1024
+ * missing capabilities. Stored for humans to read; never a protocol or
1025
+ * money effect.
1026
+ */
1027
+ submitFeedback(body: string): Promise<void>;
1028
+ getPolicy(): Promise<Policy>;
1029
+ listAccounts(): Promise<AccountsResponse>;
1030
+ getAccountBalance(accountId: string): Promise<AccountBalanceResponse>;
1031
+ listAccountTransactions(accountId: string, params?: AccountTransactionsParams): Promise<AccountTransactionsResponse>;
1032
+ getAccountDepositAddress(accountId: string, params: AccountDepositAddressParams): Promise<AccountDepositAddressResponse>;
1033
+ listCounterparties(params?: CounterpartiesParams): Promise<CounterpartiesResponse>;
1034
+ /**
1035
+ * Submit an intent and run its full lifecycle: create, and when the server
1036
+ * requires a co-signature, stamp and submit it. Returns the final intent
1037
+ * view from the submit response itself — no follow-up `getIntent` needed.
1038
+ * The result is a disposition, not a guarantee of execution — the intent
1039
+ * may be completed, blocked, or parked pending approval; branch on `status`
1040
+ * and read `reasons`.
1041
+ *
1042
+ * Generates a fresh idempotency key for this invocation when none is
1043
+ * supplied. Pass an explicit `idempotencyKey` when separate invocations or
1044
+ * processes must identify the same logical operation. The server does not
1045
+ * infer operation identity from matching request payloads.
1046
+ *
1047
+ * Errors: create-phase failures propagate unwrapped — `ApiError` for
1048
+ * non-OK responses (callers depend on its `code`), `TimeoutError` when the
1049
+ * exchange deadline expires, and raw transport/signing errors otherwise.
1050
+ * Once the intent exists, failures surface as `IntentSubmitError` — see its
1051
+ * outcome contract.
1052
+ */
1053
+ submitIntent(params: {
1054
+ action: IntentAction;
1055
+ idempotencyKey?: string;
1056
+ }): Promise<IntentResult>;
1057
+ getIntent(id: string): Promise<IntentResult>;
1058
+ /**
1059
+ * Permanently sever this agent link: the server revokes the link's active
1060
+ * auth keys, so every request signed with this credential fails from then
1061
+ * on. Irreversible — recovery is a new linking ceremony in the host app.
1062
+ */
1063
+ unlinkAgent(): Promise<void>;
1064
+ /**
1065
+ * Report an on-chain settlement transaction for a completed protocol
1066
+ * payment. This is an untrusted hint the server stores for ops/debugging and
1067
+ * to narrow the chain verifier's log range; it is never a money effect. The
1068
+ * managed x402 and MPP fetch wrappers call this automatically when their
1069
+ * paid response carries a valid EVM transaction reference.
1070
+ */
1071
+ reportSettlement(params: {
1072
+ intentId: string;
1073
+ txHash: string;
1074
+ /**
1075
+ * The seller's signed receipt from the paid retry's `PAYMENT-RESPONSE`
1076
+ * extensions (x402 Offer & Receipt extension), relayed verbatim; the
1077
+ * server verifies it and stores it as payment evidence. The x402 fetch
1078
+ * wrapper attaches it automatically when the seller sends one.
1079
+ */
1080
+ receipt?: X402SignedReceipt;
1081
+ }): Promise<void>;
1082
+ }
1083
+ /**
1084
+ * Create a client for the Catena agent API from a linked agent's P-256 private
1085
+ * key (see `@catena/sdk/keypair` to generate one). Pass `privateKeyHex`
1086
+ * explicitly or omit it to read `CATENA_SECRET_KEY` from the process
1087
+ * environment; an explicit value always wins. This factory is the only way to
1088
+ * construct a client; `CatenaClient` is exported as a type only. Throws
1089
+ * {@link InvalidKeyError} immediately when neither credential source is
1090
+ * configured or the resolved key is malformed; throws `TypeError` when
1091
+ * `timeout` is not an integer between 1 and 2,147,483,647 milliseconds. Network
1092
+ * traffic starts with the first method call.
1093
+ */
1094
+ declare function createCatenaClient(options?: CatenaClientOptions): CatenaClient;
1095
+ //#endregion
1096
+ export { IntentResult as A, Policy as B, COUNTERPARTY_RULE_MODES as C, ExtensibleString as D, Counterparty as E, OnchainNetworkInput as F, X402Resource as G, SendMethod as H, POLICY_CAPABILITIES as I, X402SignedReceipt as J, AppInfo as K, POLICY_OVERRIDE_CAPABILITIES as L, MppChallenge as M, MppResource as N, INTENT_ACTION_TYPES as O, OnchainAssetInput as P, POLICY_RULE_ACTIONS as R, COUNTERPARTY_ACTIONS as S, CounterpartiesResponse as T, X402Authorization as U, SEND_METHODS as V, X402PaymentRequirements as W, AccountDepositAddressResponse as _, IntentSubmitError as a, AccountsResponse as b, ACCOUNT_AGGREGATION_SCOPES as c, ACCOUNT_TRANSACTION_MOVEMENT_STATUSES as d, ACCOUNT_TRANSACTION_STATUSES as f, AccountDepositAddressParams as g, AccountBalanceResponse as h, FetchLike as i, MppAction as j, IntentAction as k, ACCOUNT_DEPOSIT_ADDRESS_SOURCES as l, ACTOR_AGGREGATION_SCOPES as m, CatenaClient as n, TimeoutError as o, ACCOUNT_TRANSACTION_TYPES as p, X402SignedOffer as q, CatenaClientOptions as r, createCatenaClient as s, ApiError as t, ACCOUNT_TRANSACTION_METHODS as u, AccountTransactionsParams as v, CounterpartiesParams as w, Agent as x, AccountTransactionsResponse as y, POLICY_RULE_TYPES as z };