@haven_ai/sdk 0.12.0-alpha.0 → 0.13.0-alpha.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/{base64-COaV1Sis.d.cts → base64-C3mJNLYR.d.cts} +2 -2
- package/dist/{base64-C5OrJLij.d.ts → base64-CxzIc3KH.d.ts} +2 -2
- package/dist/{chunk-V2ODMLDD.cjs → chunk-4Z7PKLFD.cjs} +35 -35
- package/dist/{chunk-V2ODMLDD.cjs.map → chunk-4Z7PKLFD.cjs.map} +1 -1
- package/dist/{chunk-WFTGZS24.js → chunk-CK6VRIPR.js} +3 -3
- package/dist/{chunk-WFTGZS24.js.map → chunk-CK6VRIPR.js.map} +1 -1
- package/dist/{chunk-7M3CIW7W.js → chunk-CXQ42FOA.js} +4 -4
- package/dist/{chunk-7M3CIW7W.js.map → chunk-CXQ42FOA.js.map} +1 -1
- package/dist/{chunk-ZA3NOSO2.cjs → chunk-LZHCIK7L.cjs} +2 -2
- package/dist/chunk-LZHCIK7L.cjs.map +1 -0
- package/dist/{chunk-UPEDQLAL.js → chunk-MI7LVP56.js} +2 -2
- package/dist/chunk-MI7LVP56.js.map +1 -0
- package/dist/{chunk-4JTLJVBS.cjs → chunk-Z5MTKU6O.cjs} +4 -4
- package/dist/{chunk-4JTLJVBS.cjs.map → chunk-Z5MTKU6O.cjs.map} +1 -1
- package/dist/edge.cjs +93 -93
- package/dist/edge.d.cts +4 -4
- package/dist/edge.d.ts +4 -4
- package/dist/edge.js +4 -4
- package/dist/index.cjs +347 -333
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -6
- package/dist/index.d.ts +10 -6
- package/dist/index.js +21 -7
- package/dist/index.js.map +1 -1
- package/dist/{receipt-DyUInpvF.d.ts → receipt-CTOPh2fm.d.ts} +1 -1
- package/dist/{receipt-Dy77vCea.d.cts → receipt-DwRqGjGb.d.cts} +1 -1
- package/dist/test-support.cjs +58 -21
- package/dist/test-support.cjs.map +1 -1
- package/dist/test-support.d.cts +47 -3
- package/dist/test-support.d.ts +47 -3
- package/dist/test-support.js +37 -3
- package/dist/test-support.js.map +1 -1
- package/dist/{types-CAvsjRKi.d.ts → types-3vUBmumz.d.cts} +19 -0
- package/dist/{types-CAvsjRKi.d.cts → types-3vUBmumz.d.ts} +19 -0
- package/package.json +2 -2
- package/dist/chunk-UPEDQLAL.js.map +0 -1
- package/dist/chunk-ZA3NOSO2.cjs.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk4Z7PKLFD_cjs = require('./chunk-4Z7PKLFD.cjs');
|
|
4
|
+
var chunkZ5MTKU6O_cjs = require('./chunk-Z5MTKU6O.cjs');
|
|
5
|
+
var chunkLZHCIK7L_cjs = require('./chunk-LZHCIK7L.cjs');
|
|
6
6
|
var viem = require('viem');
|
|
7
7
|
var ethers = require('ethers');
|
|
8
8
|
var async_hooks = require('async_hooks');
|
|
@@ -15,7 +15,7 @@ function signHash(privateKey, hash) {
|
|
|
15
15
|
const sig = signingKey.sign(hash);
|
|
16
16
|
return sig.serialized;
|
|
17
17
|
} catch (err) {
|
|
18
|
-
throw new
|
|
18
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
19
19
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
20
20
|
);
|
|
21
21
|
}
|
|
@@ -31,7 +31,7 @@ async function signTypedDataVerbatim(privateKey, typedData, label) {
|
|
|
31
31
|
typedData.message
|
|
32
32
|
);
|
|
33
33
|
} catch (err) {
|
|
34
|
-
throw new
|
|
34
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
35
35
|
`Failed to sign ${label}: ${err instanceof Error ? err.message : String(err)}`
|
|
36
36
|
);
|
|
37
37
|
}
|
|
@@ -46,7 +46,7 @@ function addressFromKey(privateKey) {
|
|
|
46
46
|
try {
|
|
47
47
|
return new ethers.ethers.Wallet(privateKey).address;
|
|
48
48
|
} catch (err) {
|
|
49
|
-
throw new
|
|
49
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
50
50
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
51
51
|
);
|
|
52
52
|
}
|
|
@@ -62,7 +62,7 @@ function verifySignature(hash, signature, expectedAddress) {
|
|
|
62
62
|
var DEFAULT_BASE_URL = "http://localhost:3001";
|
|
63
63
|
var DEFAULT_REQUEST_TIMEOUT = 3e4;
|
|
64
64
|
function withoutClientHeader(headers) {
|
|
65
|
-
const target =
|
|
65
|
+
const target = chunk4Z7PKLFD_cjs.HAVEN_CLIENT_HEADER.toLowerCase();
|
|
66
66
|
return Object.fromEntries(Object.entries(headers).filter(([name]) => name.toLowerCase() !== target));
|
|
67
67
|
}
|
|
68
68
|
var HavenApiTransport = class {
|
|
@@ -78,7 +78,7 @@ var HavenApiTransport = class {
|
|
|
78
78
|
this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
79
79
|
this.requestTimeout = config.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;
|
|
80
80
|
this.defaultHeaders = { ...config.defaultHeaders ?? {} };
|
|
81
|
-
this.clientIdentity = config.clientIdentity ??
|
|
81
|
+
this.clientIdentity = config.clientIdentity ?? chunk4Z7PKLFD_cjs.SDK_CLIENT_IDENTITY;
|
|
82
82
|
}
|
|
83
83
|
/**
|
|
84
84
|
* The newest `client_update` the backend sent (#3303): inside a
|
|
@@ -91,7 +91,7 @@ var HavenApiTransport = class {
|
|
|
91
91
|
}
|
|
92
92
|
recordClientUpdate(data) {
|
|
93
93
|
if (data === null || typeof data !== "object" || Array.isArray(data)) return;
|
|
94
|
-
const hint =
|
|
94
|
+
const hint = chunk4Z7PKLFD_cjs.readClientUpdate(data.client_update);
|
|
95
95
|
if (!hint) return;
|
|
96
96
|
this.lastClientUpdate = hint;
|
|
97
97
|
const store = this.requestContext.getStore();
|
|
@@ -124,7 +124,7 @@ var HavenApiTransport = class {
|
|
|
124
124
|
// JOIN `x-haven-client` and `X-Haven-Client` into one unparseable
|
|
125
125
|
// value), so neither `defaultHeaders` nor a dispatch context can
|
|
126
126
|
// misname the client; `clientIdentity` is the one way to set it.
|
|
127
|
-
[
|
|
127
|
+
[chunk4Z7PKLFD_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
|
|
128
128
|
},
|
|
129
129
|
body: body ? JSON.stringify(body) : void 0,
|
|
130
130
|
signal: controller.signal
|
|
@@ -137,16 +137,16 @@ var HavenApiTransport = class {
|
|
|
137
137
|
const rawDetails = record.details ?? record.detail;
|
|
138
138
|
const detailsText = typeof rawDetails === "string" ? rawDetails : rawDetails != null ? JSON.stringify(rawDetails) : void 0;
|
|
139
139
|
const message = errorText && detailsText ? `${errorText}: ${detailsText}` : errorText ?? detailsText ?? "API request failed";
|
|
140
|
-
throw new
|
|
140
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(message, res.status, data);
|
|
141
141
|
}
|
|
142
142
|
return data;
|
|
143
143
|
} catch (err) {
|
|
144
|
-
if (err instanceof
|
|
144
|
+
if (err instanceof chunkLZHCIK7L_cjs.HavenApiError) throw err;
|
|
145
145
|
const failureCause = { kind: "no_answer", method };
|
|
146
146
|
if (err instanceof Error && err.name === "AbortError") {
|
|
147
|
-
throw new
|
|
147
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(`Request to ${path} timed out`, 408, void 0, void 0, failureCause);
|
|
148
148
|
}
|
|
149
|
-
throw new
|
|
149
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
150
150
|
`Request to ${path} failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
151
151
|
0,
|
|
152
152
|
void 0,
|
|
@@ -172,13 +172,13 @@ async function fetchUnsignedTaxDeclaration(client) {
|
|
|
172
172
|
if (reason === "feature_disabled" || reason === "disabled" || reason === "no_company_details" || reason === "vies_not_valid") {
|
|
173
173
|
return { available: false, reason };
|
|
174
174
|
}
|
|
175
|
-
throw new
|
|
175
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
176
176
|
"The tax-declaration endpoint answered a body that is neither the \xA72.1 content nor a named unavailability reason.",
|
|
177
177
|
502
|
|
178
178
|
);
|
|
179
179
|
}
|
|
180
180
|
async function resolveTaxDeclarationHeader(client, input) {
|
|
181
|
-
if (
|
|
181
|
+
if (chunk4Z7PKLFD_cjs.isErc7710Option(input.accepted)) {
|
|
182
182
|
return { header: void 0 };
|
|
183
183
|
}
|
|
184
184
|
let content;
|
|
@@ -190,7 +190,7 @@ async function resolveTaxDeclarationHeader(client, input) {
|
|
|
190
190
|
if (!content.available) {
|
|
191
191
|
return { header: void 0 };
|
|
192
192
|
}
|
|
193
|
-
const signed =
|
|
193
|
+
const signed = chunk4Z7PKLFD_cjs.buildSignedTaxDeclaration({
|
|
194
194
|
content: content.declaration,
|
|
195
195
|
network: input.accepted.network,
|
|
196
196
|
delegateKey: input.delegateKey
|
|
@@ -199,19 +199,19 @@ async function resolveTaxDeclarationHeader(client, input) {
|
|
|
199
199
|
`[haven-sdk] signing x402 tax declaration taxId=${JSON.stringify(content.declaration.taxId)} jurisdiction=${JSON.stringify(content.declaration.jurisdiction)} principalId=${signed.declaration.principalId}
|
|
200
200
|
`
|
|
201
201
|
);
|
|
202
|
-
return { header:
|
|
202
|
+
return { header: chunk4Z7PKLFD_cjs.encodeTaxDeclarationHeader(signed) };
|
|
203
203
|
}
|
|
204
204
|
function withTaxDeclarationHeader(init, header) {
|
|
205
205
|
if (!header) {
|
|
206
|
-
if (init?.headers && new Headers(init.headers).has(
|
|
206
|
+
if (init?.headers && new Headers(init.headers).has(chunk4Z7PKLFD_cjs.X_TAX_DECLARATION_HEADER)) {
|
|
207
207
|
const headers2 = new Headers(init.headers);
|
|
208
|
-
headers2.delete(
|
|
208
|
+
headers2.delete(chunk4Z7PKLFD_cjs.X_TAX_DECLARATION_HEADER);
|
|
209
209
|
return { ...init, headers: headers2 };
|
|
210
210
|
}
|
|
211
211
|
return init ?? {};
|
|
212
212
|
}
|
|
213
213
|
const headers = new Headers(init?.headers);
|
|
214
|
-
headers.set(
|
|
214
|
+
headers.set(chunk4Z7PKLFD_cjs.X_TAX_DECLARATION_HEADER, header);
|
|
215
215
|
return { ...init, headers };
|
|
216
216
|
}
|
|
217
217
|
|
|
@@ -285,6 +285,10 @@ function mapPaymentStatusResult(raw) {
|
|
|
285
285
|
// carried through even when `null` (a real, known answer).
|
|
286
286
|
...raw.settlement_scheme !== void 0 ? { settlementScheme: raw.settlement_scheme } : {},
|
|
287
287
|
...raw.merchant_settlement_recorded === true ? { merchantSettlementRecorded: true } : {},
|
|
288
|
+
// #4530: the recorded transaction itself — absent from the raw payload
|
|
289
|
+
// (older backend, or nothing recorded) stays absent here, so the field
|
|
290
|
+
// never claims a hash the backend did not record.
|
|
291
|
+
...typeof raw.merchant_settlement_tx_hash === "string" ? { merchantSettlementTxHash: raw.merchant_settlement_tx_hash } : {},
|
|
288
292
|
// #3494: additive, mirrors the backend's own `status === 'failed'` gate —
|
|
289
293
|
// absent from the raw payload (older backend, or any non-failed status)
|
|
290
294
|
// stays absent here.
|
|
@@ -375,6 +379,12 @@ function mapPaymentReceipt(raw) {
|
|
|
375
379
|
if ("delivery_reference" in raw) {
|
|
376
380
|
receipt.deliveryReference = raw.delivery_reference ?? null;
|
|
377
381
|
}
|
|
382
|
+
if ("purchase_group_id" in raw) {
|
|
383
|
+
receipt.purchaseGroupId = raw.purchase_group_id ?? null;
|
|
384
|
+
}
|
|
385
|
+
if ("parent_payment_id" in raw) {
|
|
386
|
+
receipt.parentPaymentId = raw.parent_payment_id ?? null;
|
|
387
|
+
}
|
|
378
388
|
return receipt;
|
|
379
389
|
}
|
|
380
390
|
|
|
@@ -395,29 +405,29 @@ function paymentStateStatusCode(status, fallback = 502) {
|
|
|
395
405
|
return PAYMENT_STATE_STATUS_CODES[status] ?? fallback;
|
|
396
406
|
}
|
|
397
407
|
function phaseForStatus(status) {
|
|
398
|
-
if (status === "pending_signature") return
|
|
399
|
-
if (status === "submitted") return
|
|
400
|
-
if (status === "confirmed") return
|
|
401
|
-
if (status === "pending" || status === "pending_approval") return
|
|
402
|
-
if (status === "approved") return
|
|
403
|
-
if (status === "proposed") return
|
|
404
|
-
if (status === "executed") return
|
|
405
|
-
if (status === "rejected") return
|
|
406
|
-
if (status === "expired") return
|
|
407
|
-
if (status === "failed") return
|
|
408
|
+
if (status === "pending_signature") return chunkLZHCIK7L_cjs.AgentPaymentPhase.AgentSignatureRequired;
|
|
409
|
+
if (status === "submitted") return chunkLZHCIK7L_cjs.AgentPaymentPhase.PaymentSubmitted;
|
|
410
|
+
if (status === "confirmed") return chunkLZHCIK7L_cjs.AgentPaymentPhase.PaymentConfirmed;
|
|
411
|
+
if (status === "pending" || status === "pending_approval") return chunkLZHCIK7L_cjs.AgentPaymentPhase.UserApprovalRequired;
|
|
412
|
+
if (status === "approved") return chunkLZHCIK7L_cjs.AgentPaymentPhase.UserExecutionRequired;
|
|
413
|
+
if (status === "proposed") return chunkLZHCIK7L_cjs.AgentPaymentPhase.WaitingForAdditionalApprovals;
|
|
414
|
+
if (status === "executed") return chunkLZHCIK7L_cjs.AgentPaymentPhase.FundingSent;
|
|
415
|
+
if (status === "rejected") return chunkLZHCIK7L_cjs.AgentPaymentPhase.Rejected;
|
|
416
|
+
if (status === "expired") return chunkLZHCIK7L_cjs.AgentPaymentPhase.Expired;
|
|
417
|
+
if (status === "failed") return chunkLZHCIK7L_cjs.AgentPaymentPhase.Failed;
|
|
408
418
|
return null;
|
|
409
419
|
}
|
|
410
420
|
function nextActionForStatus(status) {
|
|
411
|
-
if (status === "pending_signature") return
|
|
412
|
-
if (status === "submitted") return
|
|
413
|
-
if (status === "confirmed") return
|
|
414
|
-
if (status === "pending" || status === "pending_approval") return
|
|
415
|
-
if (status === "approved") return
|
|
416
|
-
if (status === "proposed") return
|
|
417
|
-
if (status === "executed") return
|
|
418
|
-
if (status === "rejected") return
|
|
419
|
-
if (status === "expired") return
|
|
420
|
-
if (status === "failed") return
|
|
421
|
+
if (status === "pending_signature") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.SignAndSubmitPayment;
|
|
422
|
+
if (status === "submitted") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.CheckStatusLater;
|
|
423
|
+
if (status === "confirmed") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.None;
|
|
424
|
+
if (status === "pending" || status === "pending_approval") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
425
|
+
if (status === "approved") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
426
|
+
if (status === "proposed") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
427
|
+
if (status === "executed") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
428
|
+
if (status === "rejected") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
429
|
+
if (status === "expired") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.RequestAgainIfUserStillWantsIt;
|
|
430
|
+
if (status === "failed") return chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
421
431
|
return null;
|
|
422
432
|
}
|
|
423
433
|
function messageForState(label, status, paymentId, nextAction) {
|
|
@@ -491,17 +501,17 @@ function throwPaymentStateError(label, raw) {
|
|
|
491
501
|
const statusCode = paymentStateStatusCode(raw.status);
|
|
492
502
|
const state = paymentStateFromRaw(label, raw);
|
|
493
503
|
if (state) {
|
|
494
|
-
throw new
|
|
504
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(state.message, statusCode, state, raw);
|
|
495
505
|
}
|
|
496
506
|
if (raw.status === "pending_approval") {
|
|
497
|
-
throw
|
|
507
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic(
|
|
498
508
|
`${label} exceeds the agent's on-chain budget and was declined; no approval is pending and none will arrive (payment_id: ${raw.payment_id}).`,
|
|
499
509
|
statusCode,
|
|
500
510
|
raw
|
|
501
511
|
);
|
|
502
512
|
}
|
|
503
513
|
if (raw.status === "expired") {
|
|
504
|
-
throw new
|
|
514
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
505
515
|
`${label} expired before it could be completed (payment_id: ${raw.payment_id}).`,
|
|
506
516
|
statusCode,
|
|
507
517
|
raw
|
|
@@ -509,8 +519,8 @@ function throwPaymentStateError(label, raw) {
|
|
|
509
519
|
}
|
|
510
520
|
const paymentId = raw.payment_id ? ` (payment_id: ${raw.payment_id})` : "";
|
|
511
521
|
const message = raw.error ?? `${label} ${raw.status}${paymentId}`;
|
|
512
|
-
if (statusCode >= 500) throw
|
|
513
|
-
throw new
|
|
522
|
+
if (statusCode >= 500) throw chunkLZHCIK7L_cjs.HavenApiError.deterministic(message, statusCode, raw);
|
|
523
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(message, statusCode, raw);
|
|
514
524
|
}
|
|
515
525
|
|
|
516
526
|
// src/x402-retry-target.ts
|
|
@@ -542,7 +552,7 @@ function isSecureX402RetryTarget(url) {
|
|
|
542
552
|
return RESERVED_SUFFIXES.some((suffix) => host.endsWith(suffix));
|
|
543
553
|
}
|
|
544
554
|
var INSECURE_RETRY_TARGET_CODE = "INSECURE_RETRY_TARGET";
|
|
545
|
-
var HavenInsecureRetryTargetError = class extends
|
|
555
|
+
var HavenInsecureRetryTargetError = class extends chunkLZHCIK7L_cjs.HavenError {
|
|
546
556
|
constructor(url) {
|
|
547
557
|
super(
|
|
548
558
|
`Refusing to send a payment header to ${url}: the paid x402 retry must go to an https URL (or a loopback / reserved test host). The merchant's challenge declared this resource URL; retry with the https URL you quoted (pass it as \`url\`), and report a merchant whose challenge downgrades the scheme.`,
|
|
@@ -560,7 +570,7 @@ function assertSecureX402RetryTarget(url) {
|
|
|
560
570
|
|
|
561
571
|
// src/merchant-egress.ts
|
|
562
572
|
var MERCHANT_EGRESS_REFUSED_CODE = "MERCHANT_EGRESS_REFUSED";
|
|
563
|
-
var MerchantEgressRefusedError = class extends
|
|
573
|
+
var MerchantEgressRefusedError = class extends chunkLZHCIK7L_cjs.HavenError {
|
|
564
574
|
url;
|
|
565
575
|
refusal;
|
|
566
576
|
beforeRequest;
|
|
@@ -591,7 +601,7 @@ var MerchantEgressRefusedError = class extends chunkZA3NOSO2_cjs.HavenError {
|
|
|
591
601
|
}
|
|
592
602
|
};
|
|
593
603
|
var MERCHANT_EGRESS_RESPONSE_CAP_CODE = "MERCHANT_EGRESS_RESPONSE_CAP";
|
|
594
|
-
var MerchantEgressResponseCapError = class extends
|
|
604
|
+
var MerchantEgressResponseCapError = class extends chunkLZHCIK7L_cjs.HavenError {
|
|
595
605
|
url;
|
|
596
606
|
limitBytes;
|
|
597
607
|
constructor(message, limitBytes, url) {
|
|
@@ -775,7 +785,7 @@ var McpMerchantTransport = class {
|
|
|
775
785
|
return await this.followRedirects(url, init, signal, void 0, carriesPayment);
|
|
776
786
|
} catch (err) {
|
|
777
787
|
if (timeoutSignal.aborted) {
|
|
778
|
-
throw new
|
|
788
|
+
throw new chunkLZHCIK7L_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${url}`);
|
|
779
789
|
}
|
|
780
790
|
throw err;
|
|
781
791
|
}
|
|
@@ -809,7 +819,7 @@ var McpMerchantTransport = class {
|
|
|
809
819
|
return this.capResponse(response, finalUrl, maxBytes);
|
|
810
820
|
} catch (err) {
|
|
811
821
|
if (timeoutSignal.aborted) {
|
|
812
|
-
throw new
|
|
822
|
+
throw new chunkLZHCIK7L_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${finalUrl}`);
|
|
813
823
|
}
|
|
814
824
|
throw err;
|
|
815
825
|
}
|
|
@@ -1003,7 +1013,7 @@ var McpMerchantTransport = class {
|
|
|
1003
1013
|
text = await response.clone().text();
|
|
1004
1014
|
} catch (err) {
|
|
1005
1015
|
if (err instanceof MerchantEgressResponseCapError) throw err;
|
|
1006
|
-
if (isBodyPhaseTimeout(err)) throw new
|
|
1016
|
+
if (isBodyPhaseTimeout(err)) throw new chunkLZHCIK7L_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
|
|
1007
1017
|
return void 0;
|
|
1008
1018
|
}
|
|
1009
1019
|
if ((response.headers.get("content-type") ?? "").includes("text/event-stream")) {
|
|
@@ -1028,7 +1038,7 @@ var McpMerchantTransport = class {
|
|
|
1028
1038
|
text = await response.clone().text();
|
|
1029
1039
|
} catch (err) {
|
|
1030
1040
|
if (err instanceof MerchantEgressResponseCapError) throw err;
|
|
1031
|
-
if (isBodyPhaseTimeout(err)) throw new
|
|
1041
|
+
if (isBodyPhaseTimeout(err)) throw new chunkLZHCIK7L_cjs.MerchantTimeoutError(`Merchant response body read timed out.`);
|
|
1032
1042
|
return response;
|
|
1033
1043
|
}
|
|
1034
1044
|
const message = selectJsonRpcResult(parseSseJsonRpcMessages(text));
|
|
@@ -1090,8 +1100,8 @@ var McpMerchantTransport = class {
|
|
|
1090
1100
|
async deliverPayment(url, init, paymentHeader) {
|
|
1091
1101
|
assertSecureX402RetryTarget(url);
|
|
1092
1102
|
const headers = new Headers(init?.headers);
|
|
1093
|
-
const send =
|
|
1094
|
-
for (const name of
|
|
1103
|
+
const send = chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesFor(paymentHeader);
|
|
1104
|
+
for (const name of chunk4Z7PKLFD_cjs.X402_PAYMENT_HEADER_NAMES) {
|
|
1095
1105
|
if (send.includes(name)) headers.set(name, paymentHeader);
|
|
1096
1106
|
else headers.delete(name);
|
|
1097
1107
|
}
|
|
@@ -1178,7 +1188,7 @@ function mcpToolResultOf(value) {
|
|
|
1178
1188
|
function extractMcpPaymentRequired(toolResult) {
|
|
1179
1189
|
if (toolResult.isError !== true) return void 0;
|
|
1180
1190
|
if (isRecord(toolResult.structuredContent)) {
|
|
1181
|
-
const parsed =
|
|
1191
|
+
const parsed = chunk4Z7PKLFD_cjs.normalizePaymentRequired(toolResult.structuredContent);
|
|
1182
1192
|
if (parsed) return parsed;
|
|
1183
1193
|
}
|
|
1184
1194
|
if (Array.isArray(toolResult.content)) {
|
|
@@ -1190,7 +1200,7 @@ function extractMcpPaymentRequired(toolResult) {
|
|
|
1190
1200
|
} catch {
|
|
1191
1201
|
continue;
|
|
1192
1202
|
}
|
|
1193
|
-
const parsed =
|
|
1203
|
+
const parsed = chunk4Z7PKLFD_cjs.normalizePaymentRequired(candidate);
|
|
1194
1204
|
if (parsed) return parsed;
|
|
1195
1205
|
}
|
|
1196
1206
|
}
|
|
@@ -1214,7 +1224,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
|
|
|
1214
1224
|
if (!request) return init;
|
|
1215
1225
|
let envelope;
|
|
1216
1226
|
try {
|
|
1217
|
-
envelope =
|
|
1227
|
+
envelope = chunk4Z7PKLFD_cjs.decodeBase64Json(paymentHeader);
|
|
1218
1228
|
} catch {
|
|
1219
1229
|
return init;
|
|
1220
1230
|
}
|
|
@@ -1230,7 +1240,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
|
|
|
1230
1240
|
};
|
|
1231
1241
|
}
|
|
1232
1242
|
function encodeMcpSettlementReceipt(settlement) {
|
|
1233
|
-
return
|
|
1243
|
+
return chunk4Z7PKLFD_cjs.encodeBase64Json(settlement);
|
|
1234
1244
|
}
|
|
1235
1245
|
function bodyCarriesX402Payment(body) {
|
|
1236
1246
|
let text;
|
|
@@ -1380,7 +1390,7 @@ function deriveBudgetEndedAt(readiness, allowances, budgetEndedAt) {
|
|
|
1380
1390
|
return budgetEndedAt;
|
|
1381
1391
|
}
|
|
1382
1392
|
function formatRemainingDisplay(tokenAddress, tokenSymbol, remainingAtomic) {
|
|
1383
|
-
const token =
|
|
1393
|
+
const token = chunk4Z7PKLFD_cjs.resolveTokenFromAddress(tokenAddress);
|
|
1384
1394
|
return token ? `${formatAtomicAmount(safeBigInt(remainingAtomic), token.decimals)} ${tokenSymbol}` : `${remainingAtomic} ${tokenSymbol} (atomic; unknown decimals)`;
|
|
1385
1395
|
}
|
|
1386
1396
|
function formatTokenAmount(atomic, decimals) {
|
|
@@ -1400,7 +1410,7 @@ function mapSupersession(raw) {
|
|
|
1400
1410
|
replacementAgentId,
|
|
1401
1411
|
supersededAt,
|
|
1402
1412
|
warning: `This agent was replaced on its machine by agent ${replacementAgentId} at ${supersededAt}. This session is still running as the old agent: restart the agent runtime so it loads the new agent, and ask the user to remove this agent on its Haven agent page if it is no longer used \u2014 it keeps any budget it still holds until then.`,
|
|
1403
|
-
nextAction:
|
|
1413
|
+
nextAction: chunkLZHCIK7L_cjs.AgentPaymentNextAction.StopAndTellUser,
|
|
1404
1414
|
nextToolOmittedReason: "The next step is the user's: restart this session, and remove the superseded agent in the Haven dashboard. No Haven tool does either."
|
|
1405
1415
|
};
|
|
1406
1416
|
}
|
|
@@ -1470,7 +1480,7 @@ function summarizePendingSubBudget(row) {
|
|
|
1470
1480
|
};
|
|
1471
1481
|
}
|
|
1472
1482
|
function summarizeTaskBudget(taskBudget) {
|
|
1473
|
-
const token =
|
|
1483
|
+
const token = chunk4Z7PKLFD_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
|
|
1474
1484
|
const maxDisplay = token ? `${formatAtomicAmount(safeBigInt(taskBudget.maxAtomic), token.decimals)} ${token.symbol}` : `${taskBudget.maxAtomic} (atomic; unknown decimals)`;
|
|
1475
1485
|
const spendDisplay = (atomic) => {
|
|
1476
1486
|
if (atomic === null) return null;
|
|
@@ -1615,7 +1625,7 @@ var AccountReads = class {
|
|
|
1615
1625
|
async listTaskBudgetsSummary() {
|
|
1616
1626
|
try {
|
|
1617
1627
|
const raw = await this.transport.get("/task-budgets?status=live").catch((error) => {
|
|
1618
|
-
if (error instanceof
|
|
1628
|
+
if (error instanceof chunkLZHCIK7L_cjs.HavenApiError && error.statusCode === 400) {
|
|
1619
1629
|
return this.transport.get("/task-budgets?status=all");
|
|
1620
1630
|
}
|
|
1621
1631
|
throw error;
|
|
@@ -1731,7 +1741,7 @@ var AccountReads = class {
|
|
|
1731
1741
|
payment: payment2,
|
|
1732
1742
|
allowance: null,
|
|
1733
1743
|
warnings: [{
|
|
1734
|
-
code:
|
|
1744
|
+
code: chunkLZHCIK7L_cjs.AgentPaymentWarningCode.AllowanceCheckUnavailable,
|
|
1735
1745
|
message: `Could not read the post-purchase allowance/budget for payment ${paymentId} (${detail}). The payment itself succeeded \u2014 the on-chain policy remains the actual spend gate; this only affects the remaining-budget figure reported here.`
|
|
1736
1746
|
}]
|
|
1737
1747
|
});
|
|
@@ -1824,7 +1834,7 @@ var AccountReads = class {
|
|
|
1824
1834
|
*/
|
|
1825
1835
|
async getReceipt(paymentId) {
|
|
1826
1836
|
const { receipt } = await this.transport.get(`/payments/${paymentId}/receipt`);
|
|
1827
|
-
return { receipt, verification:
|
|
1837
|
+
return { receipt, verification: chunkZ5MTKU6O_cjs.verifyPaymentReceipt(receipt) };
|
|
1828
1838
|
}
|
|
1829
1839
|
async fetchAgent() {
|
|
1830
1840
|
const raw = await this.transport.get("/machine-payments/agent");
|
|
@@ -1860,7 +1870,7 @@ function isWaitTimeout(err) {
|
|
|
1860
1870
|
async function waitForSweepTx(tx) {
|
|
1861
1871
|
let receipt;
|
|
1862
1872
|
try {
|
|
1863
|
-
receipt = await tx.wait(1,
|
|
1873
|
+
receipt = await tx.wait(1, chunkLZHCIK7L_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS);
|
|
1864
1874
|
} catch (err) {
|
|
1865
1875
|
if (!isWaitTimeout(err)) throw err;
|
|
1866
1876
|
return { txHash: tx.hash, confirmation: "unconfirmed" };
|
|
@@ -1874,16 +1884,16 @@ var DelegateSweepApi = class {
|
|
|
1874
1884
|
}
|
|
1875
1885
|
options;
|
|
1876
1886
|
async sweepDelegate() {
|
|
1877
|
-
if (!this.options.delegateKey) throw new
|
|
1887
|
+
if (!this.options.delegateKey) throw new chunkLZHCIK7L_cjs.HavenSigningError("delegateKey is required for sweepDelegate.");
|
|
1878
1888
|
const agent = await this.options.getAgent();
|
|
1879
|
-
if (!agent.delegateAddress) throw new
|
|
1889
|
+
if (!agent.delegateAddress) throw new chunkLZHCIK7L_cjs.HavenApiError("Agent has no delegate address.", 422);
|
|
1880
1890
|
const rpcUrl = this.options.chainRpcs[agent.chainId];
|
|
1881
|
-
if (!rpcUrl) throw new
|
|
1891
|
+
if (!rpcUrl) throw new chunkLZHCIK7L_cjs.HavenApiError(`chainRpcs[${agent.chainId}] must be configured to sweep the delegate wallet.`, 422);
|
|
1882
1892
|
const provider = createJsonRpcProvider(rpcUrl);
|
|
1883
1893
|
const wallet = createWallet(this.options.delegateKey, provider);
|
|
1884
1894
|
const transfers = [];
|
|
1885
|
-
if (
|
|
1886
|
-
const contract = createErc20Contract(
|
|
1895
|
+
if (chunk4Z7PKLFD_cjs.isSweepableChain(agent.chainId)) {
|
|
1896
|
+
const contract = createErc20Contract(chunk4Z7PKLFD_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
|
|
1887
1897
|
const balance2 = await contract.balanceOf(agent.delegateAddress);
|
|
1888
1898
|
if (balance2 > 0n) {
|
|
1889
1899
|
const tx = await contract.transfer(agent.accountAddress, balance2);
|
|
@@ -1971,7 +1981,7 @@ function snapshotRequestBody(body) {
|
|
|
1971
1981
|
if (body == null) return void 0;
|
|
1972
1982
|
if (typeof body === "string") return body;
|
|
1973
1983
|
if (body instanceof URLSearchParams) return body.toString();
|
|
1974
|
-
throw new
|
|
1984
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
1975
1985
|
"Quote helpers can only capture resumable request bodies that are strings or URLSearchParams. For streams, blobs, or binary bodies, preserve the original request yourself and call the matching resume method with fresh init.",
|
|
1976
1986
|
400
|
|
1977
1987
|
);
|
|
@@ -1992,12 +2002,12 @@ function requestInitFromSnapshot(request) {
|
|
|
1992
2002
|
};
|
|
1993
2003
|
}
|
|
1994
2004
|
function noCompatiblePaymentOptionError(accepts) {
|
|
1995
|
-
const erc7710Only =
|
|
2005
|
+
const erc7710Only = chunk4Z7PKLFD_cjs.selectErc7710PaymentOption(accepts) !== null;
|
|
1996
2006
|
const unsupportedOnly = !erc7710Only && accepts.some(
|
|
1997
|
-
(opt) => opt !== null && typeof opt === "object" && !
|
|
2007
|
+
(opt) => opt !== null && typeof opt === "object" && !chunk4Z7PKLFD_cjs.isErc7710Option(opt) && (chunk4Z7PKLFD_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
|
|
1998
2008
|
);
|
|
1999
2009
|
const offeredSchemes = nonExactSchemesOnly(accepts);
|
|
2000
|
-
return new
|
|
2010
|
+
return new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2001
2011
|
"No compatible payment option found in x402 requirements. Haven supports standard x402 exact payments on Base USDC." + (offeredSchemes ? ` The merchant offered only ${offeredSchemes}; Haven pays only the 'exact' scheme. For a request with a body, this often means the body or its Content-Type was missing or invalid: send the full request again (method, body, and Content-Type: application/json for a JSON API).` : erc7710Only ? " The only Haven-compatible option this merchant advertises is tagged extra.assetTransferMethod: 'erc7710' (direct settlement), which this EIP-3009 payment path cannot settle \u2014 the limitation is the settlement scheme, not the asset. Paying this merchant requires a delegation-rail erc7710 flow (settleX402Erc7710, or the hosted MCP purchase tools)." : unsupportedOnly ? " Every option this merchant advertises asks for a transfer method or payment flow Haven cannot construct (for example extra.assetTransferMethod: 'permit2', or an unrecognized extra.paymentFlow). No payment intent was created and no funds moved." : ""),
|
|
2002
2012
|
400
|
|
2003
2013
|
);
|
|
@@ -2016,15 +2026,15 @@ function nonExactSchemesOnly(accepts) {
|
|
|
2016
2026
|
return schemes.map((s) => `'${s}'`).join(", ");
|
|
2017
2027
|
}
|
|
2018
2028
|
function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport) {
|
|
2019
|
-
const standard =
|
|
2020
|
-
const option = standard ??
|
|
2029
|
+
const standard = chunk4Z7PKLFD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
2030
|
+
const option = standard ?? chunk4Z7PKLFD_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
|
|
2021
2031
|
if (!option) {
|
|
2022
2032
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
2023
2033
|
}
|
|
2024
|
-
const token =
|
|
2034
|
+
const token = chunk4Z7PKLFD_cjs.resolveTokenFromAddress(option.asset, option.network);
|
|
2025
2035
|
return {
|
|
2026
2036
|
rail: "x402",
|
|
2027
|
-
idempotencyKey: idempotencyKey ??
|
|
2037
|
+
idempotencyKey: idempotencyKey ?? chunk4Z7PKLFD_cjs.buildX402IdempotencyKey(paymentRequired, option),
|
|
2028
2038
|
paymentRequired,
|
|
2029
2039
|
accepted: option,
|
|
2030
2040
|
acceptedScheme: standard ? "standard" : "erc7710",
|
|
@@ -2038,8 +2048,8 @@ function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport)
|
|
|
2038
2048
|
resourceUrlDiffersFromRequest: paymentRequired.resource.url !== request.url,
|
|
2039
2049
|
description: paymentRequired.resource.description ?? option.description ?? null,
|
|
2040
2050
|
mimeType: paymentRequired.resource.mimeType ?? option.mimeType ?? null,
|
|
2041
|
-
amountAtomic:
|
|
2042
|
-
amount: decimalFromUsdcAtomic(
|
|
2051
|
+
amountAtomic: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option),
|
|
2052
|
+
amount: decimalFromUsdcAtomic(chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)),
|
|
2043
2053
|
token: token?.symbol ?? "USDC",
|
|
2044
2054
|
// #1351: null when the asset is unrecognised on this network — the
|
|
2045
2055
|
// `token` fallback above is a LABEL, not evidence of 6 decimals, and a
|
|
@@ -2078,7 +2088,7 @@ function buildX402Receipt(input) {
|
|
|
2078
2088
|
payTo: input.merchantTo ?? input.accepted.payTo
|
|
2079
2089
|
},
|
|
2080
2090
|
x402: {
|
|
2081
|
-
amount:
|
|
2091
|
+
amount: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(input.accepted),
|
|
2082
2092
|
token: input.token,
|
|
2083
2093
|
network: input.accepted.network,
|
|
2084
2094
|
asset: input.accepted.asset,
|
|
@@ -2087,7 +2097,7 @@ function buildX402Receipt(input) {
|
|
|
2087
2097
|
};
|
|
2088
2098
|
}
|
|
2089
2099
|
function buildX402ResumeState(input) {
|
|
2090
|
-
const token =
|
|
2100
|
+
const token = chunk4Z7PKLFD_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
|
|
2091
2101
|
return {
|
|
2092
2102
|
rail: "x402",
|
|
2093
2103
|
paymentId: input.paymentId,
|
|
@@ -2098,8 +2108,8 @@ function buildX402ResumeState(input) {
|
|
|
2098
2108
|
request: input.request,
|
|
2099
2109
|
resourceUrl: input.paymentRequired.resource.url,
|
|
2100
2110
|
description: input.paymentRequired.resource.description ?? input.accepted.description ?? null,
|
|
2101
|
-
amountAtomic:
|
|
2102
|
-
amount: decimalFromUsdcAtomic(
|
|
2111
|
+
amountAtomic: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(input.accepted),
|
|
2112
|
+
amount: decimalFromUsdcAtomic(chunk4Z7PKLFD_cjs.x402AuthorizationAmount(input.accepted)),
|
|
2103
2113
|
token: token?.symbol ?? "USDC",
|
|
2104
2114
|
asset: input.accepted.asset,
|
|
2105
2115
|
network: input.accepted.network,
|
|
@@ -2108,7 +2118,7 @@ function buildX402ResumeState(input) {
|
|
|
2108
2118
|
};
|
|
2109
2119
|
}
|
|
2110
2120
|
function attachX402ResumeState(err, paymentRequired, accepted, idempotencyKey, request) {
|
|
2111
|
-
if (!(err instanceof
|
|
2121
|
+
if (!(err instanceof chunkLZHCIK7L_cjs.HavenPaymentStateError)) return;
|
|
2112
2122
|
if (err.state.rail !== "x402") return;
|
|
2113
2123
|
err.resumeState = buildX402ResumeState({
|
|
2114
2124
|
paymentId: err.state.paymentId,
|
|
@@ -2129,17 +2139,17 @@ function attachResumeState(err, input) {
|
|
|
2129
2139
|
}
|
|
2130
2140
|
function assertCanResumeX402(status, paymentRequired, option) {
|
|
2131
2141
|
if (status.rail !== "x402") {
|
|
2132
|
-
throw new
|
|
2142
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(
|
|
2133
2143
|
`Payment ${status.paymentId} is ${status.rail}, not x402.`,
|
|
2134
2144
|
409,
|
|
2135
2145
|
status
|
|
2136
2146
|
);
|
|
2137
2147
|
}
|
|
2138
|
-
if (status.nextAction !==
|
|
2139
|
-
throw new
|
|
2148
|
+
if (status.nextAction !== chunkLZHCIK7L_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
|
|
2149
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
|
|
2140
2150
|
}
|
|
2141
2151
|
if (!status.txHash) {
|
|
2142
|
-
throw new
|
|
2152
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2143
2153
|
`x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
|
|
2144
2154
|
502,
|
|
2145
2155
|
status,
|
|
@@ -2147,7 +2157,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
2147
2157
|
);
|
|
2148
2158
|
}
|
|
2149
2159
|
if (status.resourceUrl && status.resourceUrl !== paymentRequired.resource.url) {
|
|
2150
|
-
throw new
|
|
2160
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2151
2161
|
"x402 resume request does not match the approved resource URL.",
|
|
2152
2162
|
409,
|
|
2153
2163
|
{ status, paymentRequired },
|
|
@@ -2155,7 +2165,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
2155
2165
|
);
|
|
2156
2166
|
}
|
|
2157
2167
|
if (status.merchantAddress && !sameAddress(status.merchantAddress, option.payTo)) {
|
|
2158
|
-
throw new
|
|
2168
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2159
2169
|
"x402 resume request does not match the approved merchant.",
|
|
2160
2170
|
409,
|
|
2161
2171
|
{ status, selectedPayment: option },
|
|
@@ -2164,7 +2174,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
2164
2174
|
}
|
|
2165
2175
|
const optionChainId = chainIdFromNetwork(option.network);
|
|
2166
2176
|
if (status.chainId && optionChainId && status.chainId !== optionChainId) {
|
|
2167
|
-
throw new
|
|
2177
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2168
2178
|
"x402 resume request does not match the approved network.",
|
|
2169
2179
|
409,
|
|
2170
2180
|
{ status, selectedPayment: option },
|
|
@@ -2172,7 +2182,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
2172
2182
|
);
|
|
2173
2183
|
}
|
|
2174
2184
|
if (status.token && status.token !== "USDC") {
|
|
2175
|
-
throw new
|
|
2185
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2176
2186
|
"x402 resume request does not match the approved token.",
|
|
2177
2187
|
409,
|
|
2178
2188
|
{ status, selectedPayment: option },
|
|
@@ -2180,9 +2190,9 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
2180
2190
|
);
|
|
2181
2191
|
}
|
|
2182
2192
|
const approvedAmount = status.amount ? normalizeDecimal(status.amount) : "";
|
|
2183
|
-
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(
|
|
2193
|
+
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)));
|
|
2184
2194
|
if (approvedAmount && approvedAmount !== requestedAmount) {
|
|
2185
|
-
throw new
|
|
2195
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2186
2196
|
"x402 resume request does not match the approved amount.",
|
|
2187
2197
|
409,
|
|
2188
2198
|
{ status, selectedPayment: option },
|
|
@@ -2238,7 +2248,7 @@ var X402FundingLeg = class {
|
|
|
2238
2248
|
const cached = this.receiptCache.get(idempotencyKey);
|
|
2239
2249
|
if (!cached || cached.expiresAt <= Date.now()) return void 0;
|
|
2240
2250
|
if (!sameX402TaskBudget(cached.taskBudgetId, taskBudgetId) || !sameX402TaskBudget(cached.subBudgetId, subBudgetId)) {
|
|
2241
|
-
throw new
|
|
2251
|
+
throw new chunkLZHCIK7L_cjs.X402TaskBudgetMismatchError(
|
|
2242
2252
|
`The x402 idempotency key '${idempotencyKey}' was already used under a different authorizing budget (task '${cached.taskBudgetId ?? "none"}' vs '${taskBudgetId ?? "none"}', sub '${cached.subBudgetId ?? "none"}' vs '${subBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
|
|
2243
2253
|
idempotencyKey,
|
|
2244
2254
|
cached.taskBudgetId,
|
|
@@ -2259,7 +2269,7 @@ var X402FundingLeg = class {
|
|
|
2259
2269
|
url: paymentRequired.resource.url,
|
|
2260
2270
|
payTo: this.delegateAddress,
|
|
2261
2271
|
merchantPayTo: option.payTo,
|
|
2262
|
-
amount:
|
|
2272
|
+
amount: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option),
|
|
2263
2273
|
asset: option.asset,
|
|
2264
2274
|
network: option.network,
|
|
2265
2275
|
description: paymentRequired.resource.description,
|
|
@@ -2278,17 +2288,17 @@ var X402FundingLeg = class {
|
|
|
2278
2288
|
...subBudgetId ? { subBudgetId } : {}
|
|
2279
2289
|
});
|
|
2280
2290
|
const state = paymentStateFromRaw("x402 payment", raw);
|
|
2281
|
-
const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction ===
|
|
2291
|
+
const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction === chunkLZHCIK7L_cjs.AgentPaymentNextAction.RetryOriginalX402Request ? "approval-resume" : null;
|
|
2282
2292
|
if (executedReplay) {
|
|
2283
2293
|
const canFund = await this.delegateCanFund(
|
|
2284
2294
|
raw.chain_id ?? state?.chainId ?? chainIdFromNetwork(option.network),
|
|
2285
2295
|
option.asset,
|
|
2286
|
-
|
|
2296
|
+
chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)
|
|
2287
2297
|
);
|
|
2288
2298
|
const refuse = executedReplay === "idempotency-collision" ? canFund !== true : canFund === false;
|
|
2289
2299
|
if (refuse) {
|
|
2290
2300
|
const settledReceipt = state && executedReplay === "approval-resume" ? this.receiptFromStatus(paymentRequired, option, void 0, state) : this.receiptFromAuthorization(paymentRequired, option, void 0, raw);
|
|
2291
|
-
throw new
|
|
2301
|
+
throw new chunkLZHCIK7L_cjs.X402AlreadySettledError(
|
|
2292
2302
|
canFund === false ? "This x402 payment already settled \u2014 the delegate no longer holds the funds to authorize it again. To buy the same item a second time, pass a distinct `idempotencyKey`; the synthesised key intentionally collapses repeat calls for the same product within a 5-minute window so a retried request cannot pay twice." : "This x402 payment already settled, and whether the delegate can still fund a new authorization could not be verified (no `chainRpcs` entry for this chain). Refusing rather than issue an authorization that may be unfundable. To buy the same item a second time, pass a distinct `idempotencyKey`; to finish an interrupted payment, resume it by `paymentId`.",
|
|
2293
2303
|
settledReceipt,
|
|
2294
2304
|
canFund === false ? "settled" : "unverifiable"
|
|
@@ -2301,18 +2311,18 @@ var X402FundingLeg = class {
|
|
|
2301
2311
|
this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId, subBudgetId);
|
|
2302
2312
|
return receipt2;
|
|
2303
2313
|
}
|
|
2304
|
-
if (state?.nextAction ===
|
|
2314
|
+
if (state?.nextAction === chunkLZHCIK7L_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
|
|
2305
2315
|
const receipt2 = this.receiptFromStatus(paymentRequired, option, paymentHeader, state);
|
|
2306
2316
|
this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId, subBudgetId);
|
|
2307
2317
|
return receipt2;
|
|
2308
2318
|
}
|
|
2309
2319
|
this.assertSignableAuthorizationState("x402 payment", raw);
|
|
2310
2320
|
if (!raw.sign_data?.hash) {
|
|
2311
|
-
throw
|
|
2321
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No sign_hash returned from x402/authorize", 500, raw);
|
|
2312
2322
|
}
|
|
2313
2323
|
const sig = await this.signForData(raw.sign_data, {
|
|
2314
2324
|
asset: option.asset,
|
|
2315
|
-
amount:
|
|
2325
|
+
amount: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)
|
|
2316
2326
|
});
|
|
2317
2327
|
const execResult = await this.post(
|
|
2318
2328
|
`/payments/${raw.payment_id}/sign`,
|
|
@@ -2347,10 +2357,10 @@ var X402FundingLeg = class {
|
|
|
2347
2357
|
*/
|
|
2348
2358
|
async createPaymentHeader(paymentRequired, option, paymentId) {
|
|
2349
2359
|
if (!this.delegateKey) {
|
|
2350
|
-
throw new
|
|
2360
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
|
|
2351
2361
|
}
|
|
2352
2362
|
const account = accounts.privateKeyToAccount(this.delegateKey);
|
|
2353
|
-
const requirements =
|
|
2363
|
+
const requirements = chunk4Z7PKLFD_cjs.toStandardPaymentRequirements(paymentRequired, option);
|
|
2354
2364
|
let header;
|
|
2355
2365
|
if (paymentId) {
|
|
2356
2366
|
const unsigned = schemes.exact.evm.preparePaymentHeader(
|
|
@@ -2358,7 +2368,7 @@ var X402FundingLeg = class {
|
|
|
2358
2368
|
paymentRequired.x402Version,
|
|
2359
2369
|
requirements
|
|
2360
2370
|
);
|
|
2361
|
-
unsigned.payload.authorization.nonce =
|
|
2371
|
+
unsigned.payload.authorization.nonce = chunk4Z7PKLFD_cjs.deriveX402PaymentNonce(paymentId);
|
|
2362
2372
|
const signed = await schemes.exact.evm.signPaymentHeader(account, requirements, unsigned);
|
|
2363
2373
|
header = schemes.exact.evm.encodePayment(signed);
|
|
2364
2374
|
} else {
|
|
@@ -2369,15 +2379,15 @@ var X402FundingLeg = class {
|
|
|
2369
2379
|
);
|
|
2370
2380
|
}
|
|
2371
2381
|
if (paymentRequired.x402Version < 2) return header;
|
|
2372
|
-
const payment =
|
|
2373
|
-
return
|
|
2382
|
+
const payment = chunk4Z7PKLFD_cjs.decodeBase64Json(header);
|
|
2383
|
+
return chunk4Z7PKLFD_cjs.encodeBase64Json(chunk4Z7PKLFD_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
|
|
2374
2384
|
}
|
|
2375
2385
|
// ── Receipt mapping ──────────────────────────────────────────────
|
|
2376
2386
|
receiptFromAuthorization(paymentRequired, option, paymentHeader, raw, execResult) {
|
|
2377
2387
|
const txHash = execResult?.tx_hash ?? raw.tx_hash ?? "";
|
|
2378
2388
|
const chainId = execResult?.chain_id ?? raw.chain_id ?? chainIdFromNetwork(option.network);
|
|
2379
2389
|
const token = execResult?.token ?? raw.token ?? "USDC";
|
|
2380
|
-
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(
|
|
2390
|
+
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option));
|
|
2381
2391
|
const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
|
|
2382
2392
|
const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
|
|
2383
2393
|
const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
|
|
@@ -2399,7 +2409,7 @@ var X402FundingLeg = class {
|
|
|
2399
2409
|
}
|
|
2400
2410
|
receiptFromStatus(paymentRequired, option, paymentHeader, status) {
|
|
2401
2411
|
if (!status.txHash) {
|
|
2402
|
-
throw new
|
|
2412
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2403
2413
|
`x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
|
|
2404
2414
|
502,
|
|
2405
2415
|
status,
|
|
@@ -2410,7 +2420,7 @@ var X402FundingLeg = class {
|
|
|
2410
2420
|
paymentId: status.paymentId,
|
|
2411
2421
|
txHash: status.txHash,
|
|
2412
2422
|
token: status.token || "USDC",
|
|
2413
|
-
amount: status.amount || decimalFromUsdcAtomic(
|
|
2423
|
+
amount: status.amount || decimalFromUsdcAtomic(chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)),
|
|
2414
2424
|
to: this.delegateAddress ?? "",
|
|
2415
2425
|
resourceUrl: paymentRequired.resource.url,
|
|
2416
2426
|
explorerUrl: explorerUrlOrEmpty(status.chainId, status.txHash),
|
|
@@ -2445,12 +2455,12 @@ var X402FundingLeg = class {
|
|
|
2445
2455
|
try {
|
|
2446
2456
|
onChainReceipt = await provider.waitForTransaction(txHash, 1, timeoutMs);
|
|
2447
2457
|
} catch (err) {
|
|
2448
|
-
throw new
|
|
2458
|
+
throw new chunkLZHCIK7L_cjs.FundingConfirmationUnknownError(txHash, chainId, err instanceof Error ? err.message : String(err));
|
|
2449
2459
|
}
|
|
2450
2460
|
if (!onChainReceipt) {
|
|
2451
|
-
throw new
|
|
2461
|
+
throw new chunkLZHCIK7L_cjs.FundingConfirmationUnknownError(txHash, chainId, "no receipt within the timeout window");
|
|
2452
2462
|
}
|
|
2453
|
-
if (onChainReceipt.status !== 1) throw new
|
|
2463
|
+
if (onChainReceipt.status !== 1) throw new chunkLZHCIK7L_cjs.FundingRevertedError(txHash, chainId);
|
|
2454
2464
|
}
|
|
2455
2465
|
/**
|
|
2456
2466
|
* Can the delegate EOA still fund an authorization for `amountAtomic`?
|
|
@@ -2494,7 +2504,7 @@ var X402FundingLeg = class {
|
|
|
2494
2504
|
};
|
|
2495
2505
|
function getPaymentHeaderValidBefore(paymentHeader) {
|
|
2496
2506
|
try {
|
|
2497
|
-
const payment =
|
|
2507
|
+
const payment = chunk4Z7PKLFD_cjs.decodeBase64Json(
|
|
2498
2508
|
paymentHeader
|
|
2499
2509
|
);
|
|
2500
2510
|
const payload = payment.payload;
|
|
@@ -2549,7 +2559,7 @@ var X402Erc7710 = class {
|
|
|
2549
2559
|
*/
|
|
2550
2560
|
async settle(paymentRequired, options = {}) {
|
|
2551
2561
|
if (!this.delegateKey) {
|
|
2552
|
-
throw new
|
|
2562
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
2553
2563
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
2554
2564
|
);
|
|
2555
2565
|
}
|
|
@@ -2574,21 +2584,21 @@ var X402Erc7710 = class {
|
|
|
2574
2584
|
async prepare(paymentRequired, options = {}) {
|
|
2575
2585
|
const delegationRail = options.delegationRail ?? (await this.getAgent()).executionRail === "delegation";
|
|
2576
2586
|
if (!delegationRail) {
|
|
2577
|
-
throw new
|
|
2587
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2578
2588
|
"erc7710 settlement requires a delegation-rail account; this one is not on it. Use authorizeX402() for the standard EIP-3009 path.",
|
|
2579
2589
|
400
|
|
2580
2590
|
);
|
|
2581
2591
|
}
|
|
2582
|
-
const selection =
|
|
2592
|
+
const selection = chunk4Z7PKLFD_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
|
|
2583
2593
|
if (!selection || selection.scheme !== "erc7710") {
|
|
2584
|
-
throw new
|
|
2594
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2585
2595
|
"This merchant does not advertise an erc7710 settlement option (no accepts[] entry carries extra.assetTransferMethod: 'erc7710'). Use authorizeX402() for the standard EIP-3009 path.",
|
|
2586
2596
|
400
|
|
2587
2597
|
);
|
|
2588
2598
|
}
|
|
2589
2599
|
const option = selection.option;
|
|
2590
2600
|
const merchantPayTo = option.payTo;
|
|
2591
|
-
const amountAtomic =
|
|
2601
|
+
const amountAtomic = chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option);
|
|
2592
2602
|
const raw = await this.post("/x402", {
|
|
2593
2603
|
url: options.resourceUrl ?? paymentRequired.resource?.url,
|
|
2594
2604
|
// #2373: the full 402 challenge, persisted verbatim by the backend
|
|
@@ -2632,24 +2642,24 @@ var X402Erc7710 = class {
|
|
|
2632
2642
|
...options.subBudgetId ? { subBudgetId: options.subBudgetId } : {}
|
|
2633
2643
|
});
|
|
2634
2644
|
if (!raw.payment_id) {
|
|
2635
|
-
throw
|
|
2645
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No payment_id returned from x402/authorize", 500, raw);
|
|
2636
2646
|
}
|
|
2637
2647
|
if (raw.status === "confirmed" && raw.tx_hash) {
|
|
2638
2648
|
const requestedUrl = options.resourceUrl ?? paymentRequired.resource?.url;
|
|
2639
2649
|
const samePurchase = typeof raw.to === "string" && raw.to.toLowerCase() === merchantPayTo.toLowerCase() && raw.resource_url === requestedUrl;
|
|
2640
2650
|
if (!samePurchase) {
|
|
2641
|
-
throw new
|
|
2651
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2642
2652
|
`Idempotency key already belongs to confirmed payment ${raw.payment_id}, which is not this erc7710 purchase (different payee or resource). Nothing was signed and nothing was charged. Check that payment's status before buying again: a funded but undelivered EIP-3009 payment is recovered, not paid twice. Otherwise use a new idempotency key for this purchase.`,
|
|
2643
2653
|
409,
|
|
2644
2654
|
raw,
|
|
2645
2655
|
raw.payment_id
|
|
2646
2656
|
);
|
|
2647
2657
|
}
|
|
2648
|
-
throw new
|
|
2658
|
+
throw new chunkLZHCIK7L_cjs.X402Erc7710AlreadySettledError(raw.payment_id, raw.tx_hash, raw);
|
|
2649
2659
|
}
|
|
2650
2660
|
const signData = raw.sign_data;
|
|
2651
2661
|
if (signData?.signature_scheme !== "eip712_delegation" || !signData.typed_data) {
|
|
2652
|
-
throw
|
|
2662
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic(
|
|
2653
2663
|
`x402/authorize did not return an erc7710 settlement child (signature_scheme was ${JSON.stringify(signData?.signature_scheme)}). Refusing to sign a payload this path did not ask for.`,
|
|
2654
2664
|
500,
|
|
2655
2665
|
raw
|
|
@@ -2681,9 +2691,9 @@ var X402Erc7710 = class {
|
|
|
2681
2691
|
try {
|
|
2682
2692
|
settled = await this.post(`/x402/${paymentId}/settle`, { signature });
|
|
2683
2693
|
} catch (err) {
|
|
2684
|
-
const body = err instanceof
|
|
2685
|
-
if (err instanceof
|
|
2686
|
-
throw new
|
|
2694
|
+
const body = err instanceof chunkLZHCIK7L_cjs.HavenApiError ? err.body : void 0;
|
|
2695
|
+
if (err instanceof chunkLZHCIK7L_cjs.HavenApiError && err.statusCode === 409 && body?.code === "payment_already_settled" && typeof body.tx_hash === "string") {
|
|
2696
|
+
throw new chunkLZHCIK7L_cjs.X402Erc7710AlreadySettledError(
|
|
2687
2697
|
typeof body.payment_id === "string" ? body.payment_id : paymentId,
|
|
2688
2698
|
body.tx_hash,
|
|
2689
2699
|
body
|
|
@@ -2692,7 +2702,7 @@ var X402Erc7710 = class {
|
|
|
2692
2702
|
throw err;
|
|
2693
2703
|
}
|
|
2694
2704
|
if (!settled.payment_header) {
|
|
2695
|
-
throw
|
|
2705
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic(
|
|
2696
2706
|
"x402 settle returned no payment_header \u2014 the merchant cannot be retried.",
|
|
2697
2707
|
500,
|
|
2698
2708
|
settled
|
|
@@ -2702,9 +2712,9 @@ var X402Erc7710 = class {
|
|
|
2702
2712
|
}
|
|
2703
2713
|
};
|
|
2704
2714
|
function settlementExpectationFromQuote(settlement) {
|
|
2705
|
-
const chainId =
|
|
2715
|
+
const chainId = chunkLZHCIK7L_cjs.chainIdForNetwork(settlement.network);
|
|
2706
2716
|
if (chainId === void 0) {
|
|
2707
|
-
throw new
|
|
2717
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
2708
2718
|
`Refusing to sign the x402 settlement child: the merchant's network ${JSON.stringify(settlement.network)} is not one this SDK can verify a settlement child on.`
|
|
2709
2719
|
);
|
|
2710
2720
|
}
|
|
@@ -2754,7 +2764,7 @@ function x402ToolReceipt(receipt) {
|
|
|
2754
2764
|
};
|
|
2755
2765
|
}
|
|
2756
2766
|
function toolError(err) {
|
|
2757
|
-
if (err instanceof
|
|
2767
|
+
if (err instanceof chunkLZHCIK7L_cjs.HavenPaymentStateError) {
|
|
2758
2768
|
return {
|
|
2759
2769
|
success: false,
|
|
2760
2770
|
payment_id: err.state.paymentId,
|
|
@@ -2799,7 +2809,7 @@ function toolError(err) {
|
|
|
2799
2809
|
error: err.message
|
|
2800
2810
|
};
|
|
2801
2811
|
}
|
|
2802
|
-
if (err instanceof
|
|
2812
|
+
if (err instanceof chunkLZHCIK7L_cjs.HavenApiError) {
|
|
2803
2813
|
return {
|
|
2804
2814
|
success: false,
|
|
2805
2815
|
status_code: err.statusCode,
|
|
@@ -2863,14 +2873,14 @@ var MerchantCompletion = class {
|
|
|
2863
2873
|
}
|
|
2864
2874
|
async retryRequest(url, initialInit, paymentRequired, receipt) {
|
|
2865
2875
|
if (!receipt.accepted) {
|
|
2866
|
-
throw
|
|
2876
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No accepted x402 option was recorded for payment retry", 500);
|
|
2867
2877
|
}
|
|
2868
2878
|
if (!receipt.paymentHeader) {
|
|
2869
|
-
throw
|
|
2879
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No x402 payment header was returned for payment retry", 500);
|
|
2870
2880
|
}
|
|
2871
2881
|
let retryInit = initialInit;
|
|
2872
2882
|
if (this.getTaxDeclarationHeader && this.delegateKey) {
|
|
2873
|
-
const scheme =
|
|
2883
|
+
const scheme = chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesFor(receipt.paymentHeader);
|
|
2874
2884
|
const isEip3009 = scheme.length > 1;
|
|
2875
2885
|
if (isEip3009) {
|
|
2876
2886
|
const resolved = await this.getTaxDeclarationHeader({
|
|
@@ -2920,7 +2930,7 @@ var MerchantCompletion = class {
|
|
|
2920
2930
|
delegate_to: receipt.to
|
|
2921
2931
|
}
|
|
2922
2932
|
});
|
|
2923
|
-
throw new
|
|
2933
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
2924
2934
|
"x402 retry failed after Haven funded the delegate wallet; reconciliation may be required. The merchant may still settle late: check the payment status before sweeping the delegate.",
|
|
2925
2935
|
inBandRejection ? X402_RETRY_REJECTED_STATUS : merchant.merchant_status,
|
|
2926
2936
|
{
|
|
@@ -2950,7 +2960,7 @@ var MerchantCompletion = class {
|
|
|
2950
2960
|
merchantStatus: retryResponse.status,
|
|
2951
2961
|
challengePayload: paymentRequired,
|
|
2952
2962
|
selectedPayment: receipt.accepted,
|
|
2953
|
-
paymentProofHeaderName:
|
|
2963
|
+
paymentProofHeaderName: chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
|
|
2954
2964
|
paymentProofHeader: receipt.paymentHeader,
|
|
2955
2965
|
protocolReceiptHeaderName,
|
|
2956
2966
|
protocolReceiptHeader
|
|
@@ -3014,18 +3024,18 @@ var MerchantCompletion = class {
|
|
|
3014
3024
|
async resolveCompletionContext(input) {
|
|
3015
3025
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
3016
3026
|
if (status.rail !== "x402") {
|
|
3017
|
-
throw new
|
|
3027
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(
|
|
3018
3028
|
`Payment ${status.paymentId} is ${status.rail}, not x402.`,
|
|
3019
3029
|
409,
|
|
3020
3030
|
status
|
|
3021
3031
|
);
|
|
3022
3032
|
}
|
|
3023
|
-
const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction ===
|
|
3033
|
+
const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction === chunkLZHCIK7L_cjs.AgentPaymentNextAction.RetryOriginalX402Request || status.kind === "payment_intent" && status.status === "confirmed" && status.phase === chunkLZHCIK7L_cjs.AgentPaymentPhase.PaymentConfirmed && status.nextAction === chunkLZHCIK7L_cjs.AgentPaymentNextAction.None;
|
|
3024
3034
|
if (!readyForMerchantCompletion) {
|
|
3025
|
-
throw new
|
|
3035
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
|
|
3026
3036
|
}
|
|
3027
3037
|
if (!input.noFundingLeg && !status.txHash) {
|
|
3028
|
-
throw new
|
|
3038
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
3029
3039
|
`x402 payment ${status.paymentId} is ready for merchant completion but has no Haven transaction hash.`,
|
|
3030
3040
|
502,
|
|
3031
3041
|
status,
|
|
@@ -3034,7 +3044,7 @@ var MerchantCompletion = class {
|
|
|
3034
3044
|
}
|
|
3035
3045
|
const approvedResourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
|
|
3036
3046
|
if (approvedResourceUrl && approvedResourceUrl !== input.url) {
|
|
3037
|
-
throw new
|
|
3047
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
3038
3048
|
"x402 merchant completion does not match the approved resource URL.",
|
|
3039
3049
|
409,
|
|
3040
3050
|
{ status, url: input.url },
|
|
@@ -3078,7 +3088,7 @@ var MerchantCompletion = class {
|
|
|
3078
3088
|
* reads as funded and undelivered.
|
|
3079
3089
|
*/
|
|
3080
3090
|
async paidDeliveryInterrupted(err, url, receipt, paymentHeader, hasBody) {
|
|
3081
|
-
const scheme =
|
|
3091
|
+
const scheme = chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesFor(paymentHeader).length > 1 ? "eip3009" : "erc7710";
|
|
3082
3092
|
const status = err.redirectStatus ?? 0;
|
|
3083
3093
|
await this.recordRetryRejected({
|
|
3084
3094
|
rail: "x402",
|
|
@@ -3165,7 +3175,7 @@ var MerchantCompletion = class {
|
|
|
3165
3175
|
*/
|
|
3166
3176
|
async reportMerchantOutcome(input) {
|
|
3167
3177
|
if (!Number.isInteger(input.merchantStatus) || input.merchantStatus < 100 || input.merchantStatus > 599) {
|
|
3168
|
-
throw new
|
|
3178
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
3169
3179
|
`merchant_status must be an integer HTTP status from 100 to 599 (received ${input.merchantStatus}).`,
|
|
3170
3180
|
400,
|
|
3171
3181
|
void 0,
|
|
@@ -3174,7 +3184,7 @@ var MerchantCompletion = class {
|
|
|
3174
3184
|
}
|
|
3175
3185
|
const looksAccepted = input.merchantStatus >= 200 && input.merchantStatus < 300;
|
|
3176
3186
|
if (looksAccepted !== (input.outcome === "accepted")) {
|
|
3177
|
-
throw new
|
|
3187
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
3178
3188
|
`outcome "${input.outcome}" contradicts merchant_status ${input.merchantStatus}: report "accepted" only for a 2xx and "rejected" only for a non-2xx.`,
|
|
3179
3189
|
400,
|
|
3180
3190
|
void 0,
|
|
@@ -3183,14 +3193,14 @@ var MerchantCompletion = class {
|
|
|
3183
3193
|
}
|
|
3184
3194
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
3185
3195
|
if (status.rail !== "x402") {
|
|
3186
|
-
throw new
|
|
3196
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(
|
|
3187
3197
|
`Payment ${status.paymentId} is ${status.rail}, not x402 \u2014 there is no merchant retry to report.`,
|
|
3188
3198
|
409,
|
|
3189
3199
|
status
|
|
3190
3200
|
);
|
|
3191
3201
|
}
|
|
3192
3202
|
if (status.status !== "confirmed" || !status.txHash) {
|
|
3193
|
-
throw new
|
|
3203
|
+
throw new chunkLZHCIK7L_cjs.HavenPaymentStateError(
|
|
3194
3204
|
`Payment ${status.paymentId} has no confirmed Haven funding transaction to anchor a merchant report to (status ${status.status}). ${status.message}`,
|
|
3195
3205
|
paymentStateStatusCode(status.status, 409),
|
|
3196
3206
|
status
|
|
@@ -3198,7 +3208,7 @@ var MerchantCompletion = class {
|
|
|
3198
3208
|
}
|
|
3199
3209
|
const resourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
|
|
3200
3210
|
if (!resourceUrl) {
|
|
3201
|
-
throw new
|
|
3211
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
3202
3212
|
`Payment ${status.paymentId} has no recorded resource URL, so a merchant report cannot be stored.`,
|
|
3203
3213
|
409,
|
|
3204
3214
|
status,
|
|
@@ -3230,7 +3240,11 @@ var MerchantCompletion = class {
|
|
|
3230
3240
|
merchantStatus: input.merchantStatus,
|
|
3231
3241
|
// #3778: accepted outcomes only — a rejection delivered nothing, so
|
|
3232
3242
|
// there is no deliverable to point at.
|
|
3233
|
-
...input.deliveryReference ? { deliveryReference: input.deliveryReference } : {}
|
|
3243
|
+
...input.deliveryReference ? { deliveryReference: input.deliveryReference } : {},
|
|
3244
|
+
// #4534: the purchase correlation key — accepted outcomes only, for the
|
|
3245
|
+
// same reason: a rejected retry bought nothing to group.
|
|
3246
|
+
...input.purchaseGroupId ? { purchaseGroupId: input.purchaseGroupId } : {},
|
|
3247
|
+
...input.merchantResponse ? { merchantResponse: input.merchantResponse } : {}
|
|
3234
3248
|
});
|
|
3235
3249
|
return { paymentId: status.paymentId, outcome: "accepted", txHash, resourceUrl, recorded: "evidence" };
|
|
3236
3250
|
}
|
|
@@ -3271,8 +3285,8 @@ var MerchantCompletion = class {
|
|
|
3271
3285
|
await this.post("/machine-payments/evidence", body);
|
|
3272
3286
|
return { outcome: "confirmed" };
|
|
3273
3287
|
} catch (err) {
|
|
3274
|
-
const statusCode = err instanceof
|
|
3275
|
-
const noVerdict = statusCode === 408 || err instanceof
|
|
3288
|
+
const statusCode = err instanceof chunkLZHCIK7L_cjs.HavenApiError ? err.statusCode : void 0;
|
|
3289
|
+
const noVerdict = statusCode === 408 || err instanceof chunkLZHCIK7L_cjs.HavenApiError && err.failureCause?.kind === "no_answer";
|
|
3276
3290
|
if (statusCode !== EVIDENCE_RETRYABLE_STATUS && !noVerdict) {
|
|
3277
3291
|
const reason = refusalReasonFromBody(err);
|
|
3278
3292
|
const errorCode = refusalErrorCodeFromBody(err);
|
|
@@ -3329,7 +3343,7 @@ var MerchantCompletion = class {
|
|
|
3329
3343
|
*/
|
|
3330
3344
|
async reportSettlementEvidence(paymentId, settlementTxHash, options = {}) {
|
|
3331
3345
|
if (isZeroSettlementTxHash(settlementTxHash)) {
|
|
3332
|
-
throw new
|
|
3346
|
+
throw new chunkLZHCIK7L_cjs.HavenZeroSettlementHashError(paymentId);
|
|
3333
3347
|
}
|
|
3334
3348
|
return this.reportEvidence({
|
|
3335
3349
|
paymentId,
|
|
@@ -3371,19 +3385,19 @@ var MerchantCompletion = class {
|
|
|
3371
3385
|
function settlementProofFields(paymentHeader) {
|
|
3372
3386
|
if (!paymentHeader || !paymentHeader.trim()) return {};
|
|
3373
3387
|
return {
|
|
3374
|
-
paymentProofHeaderName:
|
|
3388
|
+
paymentProofHeaderName: chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesSent(paymentHeader),
|
|
3375
3389
|
paymentProofHeader: paymentHeader
|
|
3376
3390
|
};
|
|
3377
3391
|
}
|
|
3378
3392
|
function refusalReasonFromBody(err) {
|
|
3379
|
-
if (!(err instanceof
|
|
3393
|
+
if (!(err instanceof chunkLZHCIK7L_cjs.HavenApiError)) return void 0;
|
|
3380
3394
|
const body = err.body;
|
|
3381
3395
|
if (body === null || typeof body !== "object" || Array.isArray(body)) return void 0;
|
|
3382
3396
|
const reason = body.reason;
|
|
3383
3397
|
return typeof reason === "string" && reason.length > 0 ? reason : void 0;
|
|
3384
3398
|
}
|
|
3385
3399
|
function refusalErrorCodeFromBody(err) {
|
|
3386
|
-
if (!(err instanceof
|
|
3400
|
+
if (!(err instanceof chunkLZHCIK7L_cjs.HavenApiError)) return void 0;
|
|
3387
3401
|
const body = err.body;
|
|
3388
3402
|
if (body === null || typeof body !== "object" || Array.isArray(body)) return void 0;
|
|
3389
3403
|
const code = body.error_code;
|
|
@@ -3400,7 +3414,7 @@ function parseMerchantSettlement(header) {
|
|
|
3400
3414
|
}
|
|
3401
3415
|
function parseProtocolReceiptHeader(value) {
|
|
3402
3416
|
try {
|
|
3403
|
-
return
|
|
3417
|
+
return chunk4Z7PKLFD_cjs.decodeBase64Json(value);
|
|
3404
3418
|
} catch {
|
|
3405
3419
|
try {
|
|
3406
3420
|
return JSON.parse(value);
|
|
@@ -3436,7 +3450,7 @@ function x402TypedDataDigest(typedData) {
|
|
|
3436
3450
|
try {
|
|
3437
3451
|
return viem.hashTypedData(typedData);
|
|
3438
3452
|
} catch (err) {
|
|
3439
|
-
throw new
|
|
3453
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3440
3454
|
`The x402 funding intent carried a sign_data.typed_data that is not a valid EIP-712 payload (needs domain, types, primaryType, message), so its digest cannot be derived and no signer could accept it. Underlying error: ${err instanceof Error ? err.message : String(err)}`
|
|
3441
3455
|
);
|
|
3442
3456
|
}
|
|
@@ -3551,7 +3565,7 @@ var HavenClient = class {
|
|
|
3551
3565
|
this.x402Wallet = config.x402Wallet;
|
|
3552
3566
|
this.egressPolicy = config.merchantEgress;
|
|
3553
3567
|
this.merchantTransport = new McpMerchantTransport({ merchantTimeout: config.merchantTimeout, egress: config.merchantEgress });
|
|
3554
|
-
this.confirmationTimeout = config.confirmationTimeout ??
|
|
3568
|
+
this.confirmationTimeout = config.confirmationTimeout ?? chunkLZHCIK7L_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS;
|
|
3555
3569
|
this.pollingInterval = config.pollingInterval ?? DEFAULT_POLLING_INTERVAL;
|
|
3556
3570
|
this.chainRpcs = config.chainRpcs ?? {};
|
|
3557
3571
|
if (this.delegateKey) {
|
|
@@ -3632,7 +3646,7 @@ var HavenClient = class {
|
|
|
3632
3646
|
*/
|
|
3633
3647
|
async pay(request) {
|
|
3634
3648
|
if (!this.delegateKey) {
|
|
3635
|
-
throw new
|
|
3649
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3636
3650
|
"Cannot use pay() without a delegateKey. Use createIntent() + submitSignature() for manual signing."
|
|
3637
3651
|
);
|
|
3638
3652
|
}
|
|
@@ -3688,15 +3702,15 @@ var HavenClient = class {
|
|
|
3688
3702
|
* on-chain allowance — there is nothing to sign until the user approves.
|
|
3689
3703
|
*/
|
|
3690
3704
|
async createX402Intent(paymentRequired, options = {}) {
|
|
3691
|
-
const option =
|
|
3705
|
+
const option = chunk4Z7PKLFD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
3692
3706
|
if (!option) {
|
|
3693
3707
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
3694
3708
|
}
|
|
3695
3709
|
const fundingTo = options.delegateAddress ?? (await this.getAgent()).delegateAddress;
|
|
3696
3710
|
if (!fundingTo) {
|
|
3697
|
-
throw
|
|
3711
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("Authenticated agent has no delegate address registered.", 502);
|
|
3698
3712
|
}
|
|
3699
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
3713
|
+
const idempotencyKey = options.idempotencyKey ?? chunk4Z7PKLFD_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
3700
3714
|
const raw = await this.post("/x402", {
|
|
3701
3715
|
url: paymentRequired.resource.url,
|
|
3702
3716
|
payTo: fundingTo,
|
|
@@ -3707,7 +3721,7 @@ var HavenClient = class {
|
|
|
3707
3721
|
// of a silent reroute to the erc7710 settlement branch (the #1358
|
|
3708
3722
|
// review's open-budget misroute). Legacy-rail backends ignore the field.
|
|
3709
3723
|
settlementScheme: "eip3009",
|
|
3710
|
-
amount:
|
|
3724
|
+
amount: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option),
|
|
3711
3725
|
asset: option.asset,
|
|
3712
3726
|
network: option.network,
|
|
3713
3727
|
description: paymentRequired.resource.description,
|
|
@@ -3732,15 +3746,15 @@ var HavenClient = class {
|
|
|
3732
3746
|
throwPaymentStateError("x402 payment", raw);
|
|
3733
3747
|
}
|
|
3734
3748
|
if (!raw.sign_data?.hash) {
|
|
3735
|
-
throw
|
|
3749
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No sign_hash returned from x402/authorize", 500, raw);
|
|
3736
3750
|
}
|
|
3737
3751
|
if (raw.sign_data.signature_scheme !== void 0 && !raw.sign_data.typed_data) {
|
|
3738
|
-
throw new
|
|
3752
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3739
3753
|
`This account's x402 funding intent declares signature scheme '${raw.sign_data.signature_scheme}' but carried no typed_data to sign. Refusing to fall back to the bare hash \u2014 the account would reject that signature on-chain. This is a backend contract violation; report it rather than working around it.`
|
|
3740
3754
|
);
|
|
3741
3755
|
}
|
|
3742
3756
|
if (!raw.x402_expected_auth) {
|
|
3743
|
-
throw
|
|
3757
|
+
throw chunkLZHCIK7L_cjs.HavenApiError.deterministic("No x402 expected-context binding returned from x402/authorize", 500, raw);
|
|
3744
3758
|
}
|
|
3745
3759
|
return {
|
|
3746
3760
|
paymentId: raw.payment_id,
|
|
@@ -3751,7 +3765,7 @@ var HavenClient = class {
|
|
|
3751
3765
|
accepted: option,
|
|
3752
3766
|
resourceUrl: paymentRequired.resource.url,
|
|
3753
3767
|
merchantTo: raw.merchant_to ?? option.payTo,
|
|
3754
|
-
amountAtomic:
|
|
3768
|
+
amountAtomic: chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option),
|
|
3755
3769
|
asset: option.asset,
|
|
3756
3770
|
network: option.network,
|
|
3757
3771
|
expectedAuth: raw.x402_expected_auth,
|
|
@@ -3776,13 +3790,13 @@ var HavenClient = class {
|
|
|
3776
3790
|
*/
|
|
3777
3791
|
sign(hash) {
|
|
3778
3792
|
if (!this.delegateKey) {
|
|
3779
|
-
throw new
|
|
3793
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3780
3794
|
"Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
|
|
3781
3795
|
);
|
|
3782
3796
|
}
|
|
3783
3797
|
const signature = signHash(this.delegateKey, hash);
|
|
3784
3798
|
if (!verifySignature(hash, signature, this.delegateAddress)) {
|
|
3785
|
-
throw new
|
|
3799
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3786
3800
|
"Local signature verification failed \u2014 recovered address does not match delegate key."
|
|
3787
3801
|
);
|
|
3788
3802
|
}
|
|
@@ -3800,29 +3814,29 @@ var HavenClient = class {
|
|
|
3800
3814
|
*/
|
|
3801
3815
|
async signForData(signData, settlementExpectation, fundingExpectation) {
|
|
3802
3816
|
if (!this.delegateKey) {
|
|
3803
|
-
throw new
|
|
3817
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3804
3818
|
"Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
|
|
3805
3819
|
);
|
|
3806
3820
|
}
|
|
3807
3821
|
const scheme = signData.signature_scheme;
|
|
3808
3822
|
if (scheme === "eip191_userop") {
|
|
3809
|
-
throw new
|
|
3823
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3810
3824
|
"The session rail is retired \u2014 'eip191_userop' intents can no longer be signed. Re-onboard the account on the delegation rail."
|
|
3811
3825
|
);
|
|
3812
3826
|
}
|
|
3813
3827
|
if (scheme === "eip712_userop") {
|
|
3814
3828
|
if (!signData.typed_data) {
|
|
3815
|
-
throw new
|
|
3829
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3816
3830
|
"sign_data.signature_scheme is eip712_userop but typed_data is missing \u2014 refusing to sign the bare hash (the account would reject it)."
|
|
3817
3831
|
);
|
|
3818
3832
|
}
|
|
3819
|
-
|
|
3820
|
-
|
|
3833
|
+
chunkLZHCIK7L_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
|
|
3834
|
+
chunk4Z7PKLFD_cjs.assertBoundDirectPaymentUserOp(
|
|
3821
3835
|
signData.typed_data,
|
|
3822
3836
|
this.delegateAddress
|
|
3823
3837
|
);
|
|
3824
3838
|
if (fundingExpectation) {
|
|
3825
|
-
|
|
3839
|
+
chunk4Z7PKLFD_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
|
|
3826
3840
|
delegateAddress: this.delegateAddress,
|
|
3827
3841
|
asset: fundingExpectation.asset,
|
|
3828
3842
|
amount: fundingExpectation.amount
|
|
@@ -3832,24 +3846,24 @@ var HavenClient = class {
|
|
|
3832
3846
|
}
|
|
3833
3847
|
if (scheme === "eip712_delegation") {
|
|
3834
3848
|
if (!signData.typed_data) {
|
|
3835
|
-
throw new
|
|
3849
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3836
3850
|
"sign_data.signature_scheme is eip712_delegation but typed_data is missing \u2014 refusing to sign the bare hash (the settlement would be rejected on redemption)."
|
|
3837
3851
|
);
|
|
3838
3852
|
}
|
|
3839
3853
|
if (!settlementExpectation) {
|
|
3840
|
-
throw new
|
|
3854
|
+
throw new chunk4Z7PKLFD_cjs.HavenTypedDataRefusedError(
|
|
3841
3855
|
"Refusing to sign an x402 settlement child without an independent expectation of what it must pay (the merchant's 402). Pay erc7710 merchants through settleX402Erc7710(), which supplies it."
|
|
3842
3856
|
);
|
|
3843
3857
|
}
|
|
3844
|
-
|
|
3858
|
+
chunk4Z7PKLFD_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
|
|
3845
3859
|
return signSettlementDelegationTypedData(this.delegateKey, signData.typed_data);
|
|
3846
3860
|
}
|
|
3847
3861
|
if (scheme === void 0) {
|
|
3848
|
-
throw new
|
|
3862
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3849
3863
|
"sign_data.signature_scheme is required \u2014 the legacy AllowanceModule rail that signed the bare hash is retired (#2850). Refusing to guess a signing scheme."
|
|
3850
3864
|
);
|
|
3851
3865
|
}
|
|
3852
|
-
throw new
|
|
3866
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
3853
3867
|
`Unknown sign_data.signature_scheme '${scheme}' \u2014 refusing to guess a signing scheme. Update @haven_ai/sdk.`
|
|
3854
3868
|
);
|
|
3855
3869
|
}
|
|
@@ -4047,7 +4061,7 @@ var HavenClient = class {
|
|
|
4047
4061
|
*/
|
|
4048
4062
|
async getPaymentStatusWithPostPurchaseAllowance(paymentId) {
|
|
4049
4063
|
const status = await this.getPaymentStatus(paymentId);
|
|
4050
|
-
if (status.rail ===
|
|
4064
|
+
if (status.rail === chunkLZHCIK7L_cjs.AgentPaymentRail.X402 && status.phase === chunkLZHCIK7L_cjs.AgentPaymentPhase.PaymentConfirmed) {
|
|
4051
4065
|
const { allowance, warnings } = await this.getPostPurchaseAllowanceSummary(paymentId);
|
|
4052
4066
|
return { ...status, allowance, ...warnings.length > 0 ? { warnings } : {} };
|
|
4053
4067
|
}
|
|
@@ -4298,7 +4312,7 @@ var HavenClient = class {
|
|
|
4298
4312
|
}
|
|
4299
4313
|
await sleep(this.pollingInterval);
|
|
4300
4314
|
}
|
|
4301
|
-
throw new
|
|
4315
|
+
throw new chunkLZHCIK7L_cjs.HavenTimeoutError(paymentId);
|
|
4302
4316
|
}
|
|
4303
4317
|
// ── x402 Protocol Support ────────────────────────────────────────
|
|
4304
4318
|
/**
|
|
@@ -4312,24 +4326,24 @@ var HavenClient = class {
|
|
|
4312
4326
|
*/
|
|
4313
4327
|
async authorizeX402(paymentRequired, options = {}) {
|
|
4314
4328
|
if (!this.delegateKey) {
|
|
4315
|
-
throw new
|
|
4329
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
4316
4330
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
4317
4331
|
);
|
|
4318
4332
|
}
|
|
4319
4333
|
if (!this.delegateAddress) {
|
|
4320
|
-
throw new
|
|
4334
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
4321
4335
|
}
|
|
4322
|
-
const option =
|
|
4336
|
+
const option = chunk4Z7PKLFD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
4323
4337
|
if (!option) {
|
|
4324
4338
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
4325
4339
|
}
|
|
4326
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
4340
|
+
const idempotencyKey = options.idempotencyKey ?? chunk4Z7PKLFD_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
4327
4341
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, options.taskBudgetId, options.subBudgetId);
|
|
4328
4342
|
if (cached) return cached;
|
|
4329
4343
|
const inFlight = this.inFlightX402.get(idempotencyKey);
|
|
4330
4344
|
if (inFlight) {
|
|
4331
4345
|
if (!sameX402TaskBudget(this.inFlightX402TaskBudget.get(idempotencyKey), options.taskBudgetId) || !sameX402TaskBudget(this.inFlightX402SubBudget.get(idempotencyKey), options.subBudgetId)) {
|
|
4332
|
-
throw new
|
|
4346
|
+
throw new chunkLZHCIK7L_cjs.X402TaskBudgetMismatchError(
|
|
4333
4347
|
`The x402 idempotency key '${idempotencyKey}' has an in-flight payment created under a different authorizing budget (task '${this.inFlightX402TaskBudget.get(idempotencyKey) ?? "none"}' vs '${options.taskBudgetId ?? "none"}', sub '${this.inFlightX402SubBudget.get(idempotencyKey) ?? "none"}' vs '${options.subBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
|
|
4334
4348
|
idempotencyKey,
|
|
4335
4349
|
this.inFlightX402TaskBudget.get(idempotencyKey),
|
|
@@ -4384,16 +4398,16 @@ var HavenClient = class {
|
|
|
4384
4398
|
if (err instanceof MerchantEgressResponseCapError) throw err;
|
|
4385
4399
|
body = void 0;
|
|
4386
4400
|
}
|
|
4387
|
-
throw new
|
|
4401
|
+
throw new chunkLZHCIK7L_cjs.X402UnexpectedStatusError(
|
|
4388
4402
|
`Expected an x402 quote response with HTTP 402, got HTTP ${response.status}.`,
|
|
4389
4403
|
response.status || 400,
|
|
4390
4404
|
body
|
|
4391
4405
|
);
|
|
4392
4406
|
}
|
|
4393
4407
|
if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
|
|
4394
|
-
throw new
|
|
4408
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
|
|
4395
4409
|
}
|
|
4396
|
-
const paymentRequired = await
|
|
4410
|
+
const paymentRequired = await chunk4Z7PKLFD_cjs.parsePaymentRequiredResponse(response);
|
|
4397
4411
|
const mcpTransport = await this.merchantTransport.detect(url, paymentRequired, response);
|
|
4398
4412
|
return buildX402Quote(paymentRequired, request, options.idempotencyKey, mcpTransport);
|
|
4399
4413
|
}
|
|
@@ -4411,7 +4425,7 @@ var HavenClient = class {
|
|
|
4411
4425
|
const wallet = await this.merchantCompletion.resolveWalletForMerchantCall();
|
|
4412
4426
|
const sessionId = await this.merchantTransport.initialize(url, init, wallet);
|
|
4413
4427
|
if (!sessionId) {
|
|
4414
|
-
throw new
|
|
4428
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError(
|
|
4415
4429
|
"The merchant did not establish an MCP session before the x402 quote. No payment was created.",
|
|
4416
4430
|
502,
|
|
4417
4431
|
{ mcpSessionNotEstablished: true }
|
|
@@ -4485,18 +4499,18 @@ var HavenClient = class {
|
|
|
4485
4499
|
}
|
|
4486
4500
|
async resumeAuthorizedX402(input) {
|
|
4487
4501
|
if (!this.delegateKey) {
|
|
4488
|
-
throw new
|
|
4502
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError(
|
|
4489
4503
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
4490
4504
|
);
|
|
4491
4505
|
}
|
|
4492
4506
|
if (!this.delegateAddress) {
|
|
4493
|
-
throw new
|
|
4507
|
+
throw new chunkLZHCIK7L_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
4494
4508
|
}
|
|
4495
|
-
const option =
|
|
4509
|
+
const option = chunk4Z7PKLFD_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
|
|
4496
4510
|
if (!option) {
|
|
4497
4511
|
throw noCompatiblePaymentOptionError(input.paymentRequired.accepts);
|
|
4498
4512
|
}
|
|
4499
|
-
const idempotencyKey = input.idempotencyKey ??
|
|
4513
|
+
const idempotencyKey = input.idempotencyKey ?? chunk4Z7PKLFD_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
|
|
4500
4514
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, input.taskBudgetId);
|
|
4501
4515
|
if (cached) return cached;
|
|
4502
4516
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
@@ -4504,10 +4518,10 @@ var HavenClient = class {
|
|
|
4504
4518
|
const canFund = await this.fundingLeg.delegateCanFund(
|
|
4505
4519
|
status.chainId ?? chainIdFromNetwork(option.network),
|
|
4506
4520
|
option.asset,
|
|
4507
|
-
|
|
4521
|
+
chunk4Z7PKLFD_cjs.x402AuthorizationAmount(option)
|
|
4508
4522
|
);
|
|
4509
4523
|
if (canFund === false) {
|
|
4510
|
-
throw new
|
|
4524
|
+
throw new chunkLZHCIK7L_cjs.X402AlreadySettledError(
|
|
4511
4525
|
`x402 payment ${status.paymentId} has already settled \u2014 the delegate no longer holds the funds to authorize it again, so there is nothing left to resume.`,
|
|
4512
4526
|
this.fundingLeg.receiptFromStatus(input.paymentRequired, option, void 0, status),
|
|
4513
4527
|
"settled"
|
|
@@ -4528,13 +4542,13 @@ var HavenClient = class {
|
|
|
4528
4542
|
const url = input.url ?? input.request?.url;
|
|
4529
4543
|
if (!paymentRequired) {
|
|
4530
4544
|
if (!url) {
|
|
4531
|
-
throw new
|
|
4545
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError("x402 resume requires the original URL or a captured request snapshot.", 400);
|
|
4532
4546
|
}
|
|
4533
4547
|
const response = await this.merchantTransport.fetch(url, initialInit, this.merchantTransport.budgetFor("quote"), this.merchantTransport.capFor("quote"));
|
|
4534
4548
|
if (response.status !== 402) {
|
|
4535
|
-
throw new
|
|
4549
|
+
throw new chunkLZHCIK7L_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
|
|
4536
4550
|
}
|
|
4537
|
-
paymentRequired = await
|
|
4551
|
+
paymentRequired = await chunk4Z7PKLFD_cjs.parsePaymentRequiredResponse(response);
|
|
4538
4552
|
}
|
|
4539
4553
|
const receipt = await this.resumeAuthorizedX402({
|
|
4540
4554
|
paymentId: input.paymentId,
|
|
@@ -4587,7 +4601,7 @@ var HavenClient = class {
|
|
|
4587
4601
|
nativeChallenge = true;
|
|
4588
4602
|
} else {
|
|
4589
4603
|
try {
|
|
4590
|
-
paymentRequired = await
|
|
4604
|
+
paymentRequired = await chunk4Z7PKLFD_cjs.parsePaymentRequiredResponse(response);
|
|
4591
4605
|
} catch (err) {
|
|
4592
4606
|
if (err instanceof MerchantEgressResponseCapError) throw err;
|
|
4593
4607
|
return response;
|
|
@@ -4598,8 +4612,8 @@ var HavenClient = class {
|
|
|
4598
4612
|
if (mcpSessionId) requestInit = this.merchantTransport.withSessionHeaders(requestInit, mcpSessionId);
|
|
4599
4613
|
}
|
|
4600
4614
|
const request = snapshotX402Request(url, requestInit);
|
|
4601
|
-
const option =
|
|
4602
|
-
const idempotencyKey = options.idempotencyKey ?? (option ?
|
|
4615
|
+
const option = chunk4Z7PKLFD_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
4616
|
+
const idempotencyKey = options.idempotencyKey ?? (option ? chunk4Z7PKLFD_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
|
|
4603
4617
|
let receipt;
|
|
4604
4618
|
try {
|
|
4605
4619
|
receipt = await this.authorizeX402(paymentRequired, options);
|
|
@@ -4729,7 +4743,7 @@ var HavenClient = class {
|
|
|
4729
4743
|
txHash: evidenceTxHash,
|
|
4730
4744
|
resourceUrl: evidenceContext.resourceUrl,
|
|
4731
4745
|
merchantStatus: surfaced.status,
|
|
4732
|
-
paymentProofHeaderName:
|
|
4746
|
+
paymentProofHeaderName: chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
|
|
4733
4747
|
paymentProofHeader: input.paymentHeader,
|
|
4734
4748
|
protocolReceiptHeaderName: answer.protocolReceiptHeaderName,
|
|
4735
4749
|
protocolReceiptHeader: answer.protocolReceiptHeader,
|
|
@@ -4855,7 +4869,7 @@ var HavenClient = class {
|
|
|
4855
4869
|
try {
|
|
4856
4870
|
raw = await this.get(`/x402/by-idempotency-key/${encodeURIComponent(key)}`);
|
|
4857
4871
|
} catch (err) {
|
|
4858
|
-
if (err instanceof
|
|
4872
|
+
if (err instanceof chunkLZHCIK7L_cjs.HavenApiError && err.statusCode === 404) return null;
|
|
4859
4873
|
throw err;
|
|
4860
4874
|
}
|
|
4861
4875
|
return {
|
|
@@ -6047,7 +6061,7 @@ async function discoverMerchantMcpUrl(inputUrl, egress) {
|
|
|
6047
6061
|
} catch (err) {
|
|
6048
6062
|
if (err instanceof MerchantEgressRefusedError || err instanceof MerchantEgressResponseCapError) throw err;
|
|
6049
6063
|
if (isBodyPhaseTimeout(err)) {
|
|
6050
|
-
throw new
|
|
6064
|
+
throw new chunkLZHCIK7L_cjs.MerchantTimeoutError(`Merchant discovery document read timed out after ${timeoutMs}ms.`);
|
|
6051
6065
|
}
|
|
6052
6066
|
continue;
|
|
6053
6067
|
}
|
|
@@ -6066,507 +6080,507 @@ function sameUrl(a, b) {
|
|
|
6066
6080
|
|
|
6067
6081
|
Object.defineProperty(exports, "DEFAULT_NEXT_TOOL_BY_ACTION", {
|
|
6068
6082
|
enumerable: true,
|
|
6069
|
-
get: function () { return
|
|
6083
|
+
get: function () { return chunk4Z7PKLFD_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
|
|
6070
6084
|
});
|
|
6071
6085
|
Object.defineProperty(exports, "ERC7710_ASSET_TRANSFER_METHOD", {
|
|
6072
6086
|
enumerable: true,
|
|
6073
|
-
get: function () { return
|
|
6087
|
+
get: function () { return chunk4Z7PKLFD_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
|
|
6074
6088
|
});
|
|
6075
6089
|
Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
|
|
6076
6090
|
enumerable: true,
|
|
6077
|
-
get: function () { return
|
|
6091
|
+
get: function () { return chunk4Z7PKLFD_cjs.HAVEN_CLIENT_HEADER; }
|
|
6078
6092
|
});
|
|
6079
6093
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
6080
6094
|
enumerable: true,
|
|
6081
|
-
get: function () { return
|
|
6095
|
+
get: function () { return chunk4Z7PKLFD_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
6082
6096
|
});
|
|
6083
6097
|
Object.defineProperty(exports, "HavenTypedDataRefusedError", {
|
|
6084
6098
|
enumerable: true,
|
|
6085
|
-
get: function () { return
|
|
6099
|
+
get: function () { return chunk4Z7PKLFD_cjs.HavenTypedDataRefusedError; }
|
|
6086
6100
|
});
|
|
6087
6101
|
Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
|
|
6088
6102
|
enumerable: true,
|
|
6089
|
-
get: function () { return
|
|
6103
|
+
get: function () { return chunk4Z7PKLFD_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
|
|
6090
6104
|
});
|
|
6091
6105
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_NAMES", {
|
|
6092
6106
|
enumerable: true,
|
|
6093
|
-
get: function () { return
|
|
6107
|
+
get: function () { return chunk4Z7PKLFD_cjs.NEXT_TOOL_SERVER_NAMES; }
|
|
6094
6108
|
});
|
|
6095
6109
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_ROLES", {
|
|
6096
6110
|
enumerable: true,
|
|
6097
|
-
get: function () { return
|
|
6111
|
+
get: function () { return chunk4Z7PKLFD_cjs.NEXT_TOOL_SERVER_ROLES; }
|
|
6098
6112
|
});
|
|
6099
6113
|
Object.defineProperty(exports, "SDK_CLIENT_IDENTITY", {
|
|
6100
6114
|
enumerable: true,
|
|
6101
|
-
get: function () { return
|
|
6115
|
+
get: function () { return chunk4Z7PKLFD_cjs.SDK_CLIENT_IDENTITY; }
|
|
6102
6116
|
});
|
|
6103
6117
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
6104
6118
|
enumerable: true,
|
|
6105
|
-
get: function () { return
|
|
6119
|
+
get: function () { return chunk4Z7PKLFD_cjs.SDK_VERSION; }
|
|
6106
6120
|
});
|
|
6107
6121
|
Object.defineProperty(exports, "SWEEP_BASE_CHAIN_ID", {
|
|
6108
6122
|
enumerable: true,
|
|
6109
|
-
get: function () { return
|
|
6123
|
+
get: function () { return chunk4Z7PKLFD_cjs.SWEEP_BASE_CHAIN_ID; }
|
|
6110
6124
|
});
|
|
6111
6125
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_CHAIN_ID", {
|
|
6112
6126
|
enumerable: true,
|
|
6113
|
-
get: function () { return
|
|
6127
|
+
get: function () { return chunk4Z7PKLFD_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
|
|
6114
6128
|
});
|
|
6115
6129
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_USDC_ADDRESS", {
|
|
6116
6130
|
enumerable: true,
|
|
6117
|
-
get: function () { return
|
|
6131
|
+
get: function () { return chunk4Z7PKLFD_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
|
|
6118
6132
|
});
|
|
6119
6133
|
Object.defineProperty(exports, "SWEEP_BASE_USDC_ADDRESS", {
|
|
6120
6134
|
enumerable: true,
|
|
6121
|
-
get: function () { return
|
|
6135
|
+
get: function () { return chunk4Z7PKLFD_cjs.SWEEP_BASE_USDC_ADDRESS; }
|
|
6122
6136
|
});
|
|
6123
6137
|
Object.defineProperty(exports, "TRANSFER_WITH_AUTHORIZATION_TYPES", {
|
|
6124
6138
|
enumerable: true,
|
|
6125
|
-
get: function () { return
|
|
6139
|
+
get: function () { return chunk4Z7PKLFD_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
|
|
6126
6140
|
});
|
|
6127
6141
|
Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
|
|
6128
6142
|
enumerable: true,
|
|
6129
|
-
get: function () { return
|
|
6143
|
+
get: function () { return chunk4Z7PKLFD_cjs.TYPED_DATA_NOT_ALLOWED; }
|
|
6130
6144
|
});
|
|
6131
6145
|
Object.defineProperty(exports, "X402PaymentHeaderValidationError", {
|
|
6132
6146
|
enumerable: true,
|
|
6133
|
-
get: function () { return
|
|
6147
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402PaymentHeaderValidationError; }
|
|
6134
6148
|
});
|
|
6135
6149
|
Object.defineProperty(exports, "X402_LEGACY_PAYMENT_HEADER_NAME", {
|
|
6136
6150
|
enumerable: true,
|
|
6137
|
-
get: function () { return
|
|
6151
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
|
|
6138
6152
|
});
|
|
6139
6153
|
Object.defineProperty(exports, "X402_MAX_AUTHORIZATION_WINDOW_SECONDS", {
|
|
6140
6154
|
enumerable: true,
|
|
6141
|
-
get: function () { return
|
|
6155
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
|
|
6142
6156
|
});
|
|
6143
6157
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAME", {
|
|
6144
6158
|
enumerable: true,
|
|
6145
|
-
get: function () { return
|
|
6159
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_HEADER_NAME; }
|
|
6146
6160
|
});
|
|
6147
6161
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAMES_SENT", {
|
|
6148
6162
|
enumerable: true,
|
|
6149
|
-
get: function () { return
|
|
6163
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
|
|
6150
6164
|
});
|
|
6151
6165
|
Object.defineProperty(exports, "X402_PAYMENT_NONCE_TAG", {
|
|
6152
6166
|
enumerable: true,
|
|
6153
|
-
get: function () { return
|
|
6167
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_NONCE_TAG; }
|
|
6154
6168
|
});
|
|
6155
6169
|
Object.defineProperty(exports, "X402_PAYMENT_REQUIRED_HEADER_NAME", {
|
|
6156
6170
|
enumerable: true,
|
|
6157
|
-
get: function () { return
|
|
6171
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
|
|
6158
6172
|
});
|
|
6159
6173
|
Object.defineProperty(exports, "X402_PAYMENT_RESPONSE_HEADER_NAME", {
|
|
6160
6174
|
enumerable: true,
|
|
6161
|
-
get: function () { return
|
|
6175
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
|
|
6162
6176
|
});
|
|
6163
6177
|
Object.defineProperty(exports, "X402_SETTLEMENT_FORWARD_MARGIN_SECONDS", {
|
|
6164
6178
|
enumerable: true,
|
|
6165
|
-
get: function () { return
|
|
6179
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
|
|
6166
6180
|
});
|
|
6167
6181
|
Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
|
|
6168
6182
|
enumerable: true,
|
|
6169
|
-
get: function () { return
|
|
6183
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertBoundDirectPaymentUserOp; }
|
|
6170
6184
|
});
|
|
6171
6185
|
Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
|
|
6172
6186
|
enumerable: true,
|
|
6173
|
-
get: function () { return
|
|
6187
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertOwnTaskBudgetCloseUserOp; }
|
|
6174
6188
|
});
|
|
6175
6189
|
Object.defineProperty(exports, "assertOwnTaskChild", {
|
|
6176
6190
|
enumerable: true,
|
|
6177
|
-
get: function () { return
|
|
6191
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertOwnTaskChild; }
|
|
6178
6192
|
});
|
|
6179
6193
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
6180
6194
|
enumerable: true,
|
|
6181
|
-
get: function () { return
|
|
6195
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildSweepAuthorizationMessage; }
|
|
6182
6196
|
});
|
|
6183
6197
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
6184
6198
|
enumerable: true,
|
|
6185
|
-
get: function () { return
|
|
6199
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildSweepTypedData; }
|
|
6186
6200
|
});
|
|
6187
6201
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
6188
6202
|
enumerable: true,
|
|
6189
|
-
get: function () { return
|
|
6203
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildX402ExpectedMessage; }
|
|
6190
6204
|
});
|
|
6191
6205
|
Object.defineProperty(exports, "compareNodeVersions", {
|
|
6192
6206
|
enumerable: true,
|
|
6193
|
-
get: function () { return
|
|
6207
|
+
get: function () { return chunk4Z7PKLFD_cjs.compareNodeVersions; }
|
|
6194
6208
|
});
|
|
6195
6209
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
6196
6210
|
enumerable: true,
|
|
6197
|
-
get: function () { return
|
|
6211
|
+
get: function () { return chunk4Z7PKLFD_cjs.createNextStepBuilder; }
|
|
6198
6212
|
});
|
|
6199
6213
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
6200
6214
|
enumerable: true,
|
|
6201
|
-
get: function () { return
|
|
6215
|
+
get: function () { return chunk4Z7PKLFD_cjs.decodeBase64Json; }
|
|
6202
6216
|
});
|
|
6203
6217
|
Object.defineProperty(exports, "decodeBase64Utf8", {
|
|
6204
6218
|
enumerable: true,
|
|
6205
|
-
get: function () { return
|
|
6219
|
+
get: function () { return chunk4Z7PKLFD_cjs.decodeBase64Utf8; }
|
|
6206
6220
|
});
|
|
6207
6221
|
Object.defineProperty(exports, "defaultNextToolFor", {
|
|
6208
6222
|
enumerable: true,
|
|
6209
|
-
get: function () { return
|
|
6223
|
+
get: function () { return chunk4Z7PKLFD_cjs.defaultNextToolFor; }
|
|
6210
6224
|
});
|
|
6211
6225
|
Object.defineProperty(exports, "deriveX402PaymentNonce", {
|
|
6212
6226
|
enumerable: true,
|
|
6213
|
-
get: function () { return
|
|
6227
|
+
get: function () { return chunk4Z7PKLFD_cjs.deriveX402PaymentNonce; }
|
|
6214
6228
|
});
|
|
6215
6229
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
6216
6230
|
enumerable: true,
|
|
6217
|
-
get: function () { return
|
|
6231
|
+
get: function () { return chunk4Z7PKLFD_cjs.encodeBase64Json; }
|
|
6218
6232
|
});
|
|
6219
6233
|
Object.defineProperty(exports, "encodeBase64Utf8", {
|
|
6220
6234
|
enumerable: true,
|
|
6221
|
-
get: function () { return
|
|
6235
|
+
get: function () { return chunk4Z7PKLFD_cjs.encodeBase64Utf8; }
|
|
6222
6236
|
});
|
|
6223
6237
|
Object.defineProperty(exports, "encodePaymentProof", {
|
|
6224
6238
|
enumerable: true,
|
|
6225
|
-
get: function () { return
|
|
6239
|
+
get: function () { return chunk4Z7PKLFD_cjs.encodePaymentProof; }
|
|
6226
6240
|
});
|
|
6227
6241
|
Object.defineProperty(exports, "hashDelegation", {
|
|
6228
6242
|
enumerable: true,
|
|
6229
|
-
get: function () { return
|
|
6243
|
+
get: function () { return chunk4Z7PKLFD_cjs.hashDelegation; }
|
|
6230
6244
|
});
|
|
6231
6245
|
Object.defineProperty(exports, "havenClientIdentity", {
|
|
6232
6246
|
enumerable: true,
|
|
6233
|
-
get: function () { return
|
|
6247
|
+
get: function () { return chunk4Z7PKLFD_cjs.havenClientIdentity; }
|
|
6234
6248
|
});
|
|
6235
6249
|
Object.defineProperty(exports, "isErc7710Option", {
|
|
6236
6250
|
enumerable: true,
|
|
6237
|
-
get: function () { return
|
|
6251
|
+
get: function () { return chunk4Z7PKLFD_cjs.isErc7710Option; }
|
|
6238
6252
|
});
|
|
6239
6253
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
6240
6254
|
enumerable: true,
|
|
6241
|
-
get: function () { return
|
|
6255
|
+
get: function () { return chunk4Z7PKLFD_cjs.isSupportedNodeVersion; }
|
|
6242
6256
|
});
|
|
6243
6257
|
Object.defineProperty(exports, "isSweepableChain", {
|
|
6244
6258
|
enumerable: true,
|
|
6245
|
-
get: function () { return
|
|
6259
|
+
get: function () { return chunk4Z7PKLFD_cjs.isSweepableChain; }
|
|
6246
6260
|
});
|
|
6247
6261
|
Object.defineProperty(exports, "isTaskChildTypedData", {
|
|
6248
6262
|
enumerable: true,
|
|
6249
|
-
get: function () { return
|
|
6263
|
+
get: function () { return chunk4Z7PKLFD_cjs.isTaskChildTypedData; }
|
|
6250
6264
|
});
|
|
6251
6265
|
Object.defineProperty(exports, "normalizePaymentRequired", {
|
|
6252
6266
|
enumerable: true,
|
|
6253
|
-
get: function () { return
|
|
6267
|
+
get: function () { return chunk4Z7PKLFD_cjs.normalizePaymentRequired; }
|
|
6254
6268
|
});
|
|
6255
6269
|
Object.defineProperty(exports, "parseNextTool", {
|
|
6256
6270
|
enumerable: true,
|
|
6257
|
-
get: function () { return
|
|
6271
|
+
get: function () { return chunk4Z7PKLFD_cjs.parseNextTool; }
|
|
6258
6272
|
});
|
|
6259
6273
|
Object.defineProperty(exports, "parsePaymentRequired", {
|
|
6260
6274
|
enumerable: true,
|
|
6261
|
-
get: function () { return
|
|
6275
|
+
get: function () { return chunk4Z7PKLFD_cjs.parsePaymentRequired; }
|
|
6262
6276
|
});
|
|
6263
6277
|
Object.defineProperty(exports, "parsePaymentRequiredResponse", {
|
|
6264
6278
|
enumerable: true,
|
|
6265
|
-
get: function () { return
|
|
6279
|
+
get: function () { return chunk4Z7PKLFD_cjs.parsePaymentRequiredResponse; }
|
|
6266
6280
|
});
|
|
6267
6281
|
Object.defineProperty(exports, "readClientUpdate", {
|
|
6268
6282
|
enumerable: true,
|
|
6269
|
-
get: function () { return
|
|
6283
|
+
get: function () { return chunk4Z7PKLFD_cjs.readClientUpdate; }
|
|
6270
6284
|
});
|
|
6271
6285
|
Object.defineProperty(exports, "renderNextTool", {
|
|
6272
6286
|
enumerable: true,
|
|
6273
|
-
get: function () { return
|
|
6287
|
+
get: function () { return chunk4Z7PKLFD_cjs.renderNextTool; }
|
|
6274
6288
|
});
|
|
6275
6289
|
Object.defineProperty(exports, "resolveTokenBySymbol", {
|
|
6276
6290
|
enumerable: true,
|
|
6277
|
-
get: function () { return
|
|
6291
|
+
get: function () { return chunk4Z7PKLFD_cjs.resolveTokenBySymbol; }
|
|
6278
6292
|
});
|
|
6279
6293
|
Object.defineProperty(exports, "resolveTokenFromAddress", {
|
|
6280
6294
|
enumerable: true,
|
|
6281
|
-
get: function () { return
|
|
6295
|
+
get: function () { return chunk4Z7PKLFD_cjs.resolveTokenFromAddress; }
|
|
6282
6296
|
});
|
|
6283
6297
|
Object.defineProperty(exports, "selectErc7710PaymentOption", {
|
|
6284
6298
|
enumerable: true,
|
|
6285
|
-
get: function () { return
|
|
6299
|
+
get: function () { return chunk4Z7PKLFD_cjs.selectErc7710PaymentOption; }
|
|
6286
6300
|
});
|
|
6287
6301
|
Object.defineProperty(exports, "selectPaymentOption", {
|
|
6288
6302
|
enumerable: true,
|
|
6289
|
-
get: function () { return
|
|
6303
|
+
get: function () { return chunk4Z7PKLFD_cjs.selectPaymentOption; }
|
|
6290
6304
|
});
|
|
6291
6305
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
6292
6306
|
enumerable: true,
|
|
6293
|
-
get: function () { return
|
|
6307
|
+
get: function () { return chunk4Z7PKLFD_cjs.selectStandardPaymentOption; }
|
|
6294
6308
|
});
|
|
6295
6309
|
Object.defineProperty(exports, "selectX402SettlementScheme", {
|
|
6296
6310
|
enumerable: true,
|
|
6297
|
-
get: function () { return
|
|
6311
|
+
get: function () { return chunk4Z7PKLFD_cjs.selectX402SettlementScheme; }
|
|
6298
6312
|
});
|
|
6299
6313
|
Object.defineProperty(exports, "sweepUsdcAddress", {
|
|
6300
6314
|
enumerable: true,
|
|
6301
|
-
get: function () { return
|
|
6315
|
+
get: function () { return chunk4Z7PKLFD_cjs.sweepUsdcAddress; }
|
|
6302
6316
|
});
|
|
6303
6317
|
Object.defineProperty(exports, "sweepUsdcDomain", {
|
|
6304
6318
|
enumerable: true,
|
|
6305
|
-
get: function () { return
|
|
6319
|
+
get: function () { return chunk4Z7PKLFD_cjs.sweepUsdcDomain; }
|
|
6306
6320
|
});
|
|
6307
6321
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
6308
6322
|
enumerable: true,
|
|
6309
|
-
get: function () { return
|
|
6323
|
+
get: function () { return chunk4Z7PKLFD_cjs.toStandardPaymentRequirements; }
|
|
6310
6324
|
});
|
|
6311
6325
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
6312
6326
|
enumerable: true,
|
|
6313
|
-
get: function () { return
|
|
6327
|
+
get: function () { return chunk4Z7PKLFD_cjs.unsupportedNodeVersionMessage; }
|
|
6314
6328
|
});
|
|
6315
6329
|
Object.defineProperty(exports, "validateStandardX402PaymentHeader", {
|
|
6316
6330
|
enumerable: true,
|
|
6317
|
-
get: function () { return
|
|
6331
|
+
get: function () { return chunk4Z7PKLFD_cjs.validateStandardX402PaymentHeader; }
|
|
6318
6332
|
});
|
|
6319
6333
|
Object.defineProperty(exports, "x402AssetTransferMethod", {
|
|
6320
6334
|
enumerable: true,
|
|
6321
|
-
get: function () { return
|
|
6335
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402AssetTransferMethod; }
|
|
6322
6336
|
});
|
|
6323
6337
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
6324
6338
|
enumerable: true,
|
|
6325
|
-
get: function () { return
|
|
6339
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402AuthorizationAmount; }
|
|
6326
6340
|
});
|
|
6327
6341
|
Object.defineProperty(exports, "x402FacilitatorAddresses", {
|
|
6328
6342
|
enumerable: true,
|
|
6329
|
-
get: function () { return
|
|
6343
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402FacilitatorAddresses; }
|
|
6330
6344
|
});
|
|
6331
6345
|
Object.defineProperty(exports, "x402PaymentHeaderNamesFor", {
|
|
6332
6346
|
enumerable: true,
|
|
6333
|
-
get: function () { return
|
|
6347
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesFor; }
|
|
6334
6348
|
});
|
|
6335
6349
|
Object.defineProperty(exports, "x402RetryHeadersFor", {
|
|
6336
6350
|
enumerable: true,
|
|
6337
|
-
get: function () { return
|
|
6351
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402RetryHeadersFor; }
|
|
6338
6352
|
});
|
|
6339
6353
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
6340
6354
|
enumerable: true,
|
|
6341
|
-
get: function () { return
|
|
6355
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402V2PaymentEnvelope; }
|
|
6342
6356
|
});
|
|
6343
6357
|
Object.defineProperty(exports, "RECEIPT_VERSION", {
|
|
6344
6358
|
enumerable: true,
|
|
6345
|
-
get: function () { return
|
|
6359
|
+
get: function () { return chunkZ5MTKU6O_cjs.RECEIPT_VERSION; }
|
|
6346
6360
|
});
|
|
6347
6361
|
Object.defineProperty(exports, "verifyPaymentReceipt", {
|
|
6348
6362
|
enumerable: true,
|
|
6349
|
-
get: function () { return
|
|
6363
|
+
get: function () { return chunkZ5MTKU6O_cjs.verifyPaymentReceipt; }
|
|
6350
6364
|
});
|
|
6351
6365
|
Object.defineProperty(exports, "AGENT_PAYMENT_FAILURE_CODE_VALUES", {
|
|
6352
6366
|
enumerable: true,
|
|
6353
|
-
get: function () { return
|
|
6367
|
+
get: function () { return chunkLZHCIK7L_cjs.AGENT_PAYMENT_FAILURE_CODE_VALUES; }
|
|
6354
6368
|
});
|
|
6355
6369
|
Object.defineProperty(exports, "AGENT_PAYMENT_NEXT_ACTION_VALUES", {
|
|
6356
6370
|
enumerable: true,
|
|
6357
|
-
get: function () { return
|
|
6371
|
+
get: function () { return chunkLZHCIK7L_cjs.AGENT_PAYMENT_NEXT_ACTION_VALUES; }
|
|
6358
6372
|
});
|
|
6359
6373
|
Object.defineProperty(exports, "AGENT_PAYMENT_PHASE_VALUES", {
|
|
6360
6374
|
enumerable: true,
|
|
6361
|
-
get: function () { return
|
|
6375
|
+
get: function () { return chunkLZHCIK7L_cjs.AGENT_PAYMENT_PHASE_VALUES; }
|
|
6362
6376
|
});
|
|
6363
6377
|
Object.defineProperty(exports, "AGENT_PAYMENT_RAIL_VALUES", {
|
|
6364
6378
|
enumerable: true,
|
|
6365
|
-
get: function () { return
|
|
6379
|
+
get: function () { return chunkLZHCIK7L_cjs.AGENT_PAYMENT_RAIL_VALUES; }
|
|
6366
6380
|
});
|
|
6367
6381
|
Object.defineProperty(exports, "AgentPaymentFailureCode", {
|
|
6368
6382
|
enumerable: true,
|
|
6369
|
-
get: function () { return
|
|
6383
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentFailureCode; }
|
|
6370
6384
|
});
|
|
6371
6385
|
Object.defineProperty(exports, "AgentPaymentFailureCodeDescriptions", {
|
|
6372
6386
|
enumerable: true,
|
|
6373
|
-
get: function () { return
|
|
6387
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentFailureCodeDescriptions; }
|
|
6374
6388
|
});
|
|
6375
6389
|
Object.defineProperty(exports, "AgentPaymentFailureCodeSchema", {
|
|
6376
6390
|
enumerable: true,
|
|
6377
|
-
get: function () { return
|
|
6391
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentFailureCodeSchema; }
|
|
6378
6392
|
});
|
|
6379
6393
|
Object.defineProperty(exports, "AgentPaymentNextAction", {
|
|
6380
6394
|
enumerable: true,
|
|
6381
|
-
get: function () { return
|
|
6395
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentNextAction; }
|
|
6382
6396
|
});
|
|
6383
6397
|
Object.defineProperty(exports, "AgentPaymentNextActionDescriptions", {
|
|
6384
6398
|
enumerable: true,
|
|
6385
|
-
get: function () { return
|
|
6399
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentNextActionDescriptions; }
|
|
6386
6400
|
});
|
|
6387
6401
|
Object.defineProperty(exports, "AgentPaymentNextActionSchema", {
|
|
6388
6402
|
enumerable: true,
|
|
6389
|
-
get: function () { return
|
|
6403
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentNextActionSchema; }
|
|
6390
6404
|
});
|
|
6391
6405
|
Object.defineProperty(exports, "AgentPaymentPhase", {
|
|
6392
6406
|
enumerable: true,
|
|
6393
|
-
get: function () { return
|
|
6407
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentPhase; }
|
|
6394
6408
|
});
|
|
6395
6409
|
Object.defineProperty(exports, "AgentPaymentPhaseDescriptions", {
|
|
6396
6410
|
enumerable: true,
|
|
6397
|
-
get: function () { return
|
|
6411
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentPhaseDescriptions; }
|
|
6398
6412
|
});
|
|
6399
6413
|
Object.defineProperty(exports, "AgentPaymentPhaseSchema", {
|
|
6400
6414
|
enumerable: true,
|
|
6401
|
-
get: function () { return
|
|
6415
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentPhaseSchema; }
|
|
6402
6416
|
});
|
|
6403
6417
|
Object.defineProperty(exports, "AgentPaymentRail", {
|
|
6404
6418
|
enumerable: true,
|
|
6405
|
-
get: function () { return
|
|
6419
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentRail; }
|
|
6406
6420
|
});
|
|
6407
6421
|
Object.defineProperty(exports, "AgentPaymentRailDescriptions", {
|
|
6408
6422
|
enumerable: true,
|
|
6409
|
-
get: function () { return
|
|
6423
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentRailDescriptions; }
|
|
6410
6424
|
});
|
|
6411
6425
|
Object.defineProperty(exports, "AgentPaymentRailSchema", {
|
|
6412
6426
|
enumerable: true,
|
|
6413
|
-
get: function () { return
|
|
6427
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentRailSchema; }
|
|
6414
6428
|
});
|
|
6415
6429
|
Object.defineProperty(exports, "AgentPaymentWarningCode", {
|
|
6416
6430
|
enumerable: true,
|
|
6417
|
-
get: function () { return
|
|
6431
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentWarningCode; }
|
|
6418
6432
|
});
|
|
6419
6433
|
Object.defineProperty(exports, "CONNECTOR_PACKAGE_NAME", {
|
|
6420
6434
|
enumerable: true,
|
|
6421
|
-
get: function () { return
|
|
6435
|
+
get: function () { return chunkLZHCIK7L_cjs.CONNECTOR_PACKAGE_NAME; }
|
|
6422
6436
|
});
|
|
6423
6437
|
Object.defineProperty(exports, "DEFAULT_CONFIRMATION_TIMEOUT_MS", {
|
|
6424
6438
|
enumerable: true,
|
|
6425
|
-
get: function () { return
|
|
6439
|
+
get: function () { return chunkLZHCIK7L_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS; }
|
|
6426
6440
|
});
|
|
6427
6441
|
Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
|
|
6428
6442
|
enumerable: true,
|
|
6429
|
-
get: function () { return
|
|
6443
|
+
get: function () { return chunkLZHCIK7L_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
|
|
6430
6444
|
});
|
|
6431
6445
|
Object.defineProperty(exports, "ENTRY_POINT_V07", {
|
|
6432
6446
|
enumerable: true,
|
|
6433
|
-
get: function () { return
|
|
6447
|
+
get: function () { return chunkLZHCIK7L_cjs.ENTRY_POINT_V07; }
|
|
6434
6448
|
});
|
|
6435
6449
|
Object.defineProperty(exports, "FundingConfirmationUnknownError", {
|
|
6436
6450
|
enumerable: true,
|
|
6437
|
-
get: function () { return
|
|
6451
|
+
get: function () { return chunkLZHCIK7L_cjs.FundingConfirmationUnknownError; }
|
|
6438
6452
|
});
|
|
6439
6453
|
Object.defineProperty(exports, "FundingRevertedError", {
|
|
6440
6454
|
enumerable: true,
|
|
6441
|
-
get: function () { return
|
|
6455
|
+
get: function () { return chunkLZHCIK7L_cjs.FundingRevertedError; }
|
|
6442
6456
|
});
|
|
6443
6457
|
Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
|
|
6444
6458
|
enumerable: true,
|
|
6445
|
-
get: function () { return
|
|
6459
|
+
get: function () { return chunkLZHCIK7L_cjs.HAVEN_CONNECTOR_CHANNEL; }
|
|
6446
6460
|
});
|
|
6447
6461
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_NAME", {
|
|
6448
6462
|
enumerable: true,
|
|
6449
|
-
get: function () { return
|
|
6463
|
+
get: function () { return chunkLZHCIK7L_cjs.HYBRID_DELEGATOR_DOMAIN_NAME; }
|
|
6450
6464
|
});
|
|
6451
6465
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_VERSION", {
|
|
6452
6466
|
enumerable: true,
|
|
6453
|
-
get: function () { return
|
|
6467
|
+
get: function () { return chunkLZHCIK7L_cjs.HYBRID_DELEGATOR_DOMAIN_VERSION; }
|
|
6454
6468
|
});
|
|
6455
6469
|
Object.defineProperty(exports, "HavenApiError", {
|
|
6456
6470
|
enumerable: true,
|
|
6457
|
-
get: function () { return
|
|
6471
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenApiError; }
|
|
6458
6472
|
});
|
|
6459
6473
|
Object.defineProperty(exports, "HavenError", {
|
|
6460
6474
|
enumerable: true,
|
|
6461
|
-
get: function () { return
|
|
6475
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenError; }
|
|
6462
6476
|
});
|
|
6463
6477
|
Object.defineProperty(exports, "HavenPaymentStateError", {
|
|
6464
6478
|
enumerable: true,
|
|
6465
|
-
get: function () { return
|
|
6479
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenPaymentStateError; }
|
|
6466
6480
|
});
|
|
6467
6481
|
Object.defineProperty(exports, "HavenSigningError", {
|
|
6468
6482
|
enumerable: true,
|
|
6469
|
-
get: function () { return
|
|
6483
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenSigningError; }
|
|
6470
6484
|
});
|
|
6471
6485
|
Object.defineProperty(exports, "HavenTimeoutError", {
|
|
6472
6486
|
enumerable: true,
|
|
6473
|
-
get: function () { return
|
|
6487
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenTimeoutError; }
|
|
6474
6488
|
});
|
|
6475
6489
|
Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
|
|
6476
6490
|
enumerable: true,
|
|
6477
|
-
get: function () { return
|
|
6491
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenUnsupportedSignerVersionError; }
|
|
6478
6492
|
});
|
|
6479
6493
|
Object.defineProperty(exports, "HavenUserOpBindingError", {
|
|
6480
6494
|
enumerable: true,
|
|
6481
|
-
get: function () { return
|
|
6495
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenUserOpBindingError; }
|
|
6482
6496
|
});
|
|
6483
6497
|
Object.defineProperty(exports, "HavenZeroSettlementHashError", {
|
|
6484
6498
|
enumerable: true,
|
|
6485
|
-
get: function () { return
|
|
6499
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenZeroSettlementHashError; }
|
|
6486
6500
|
});
|
|
6487
6501
|
Object.defineProperty(exports, "MerchantTimeoutError", {
|
|
6488
6502
|
enumerable: true,
|
|
6489
|
-
get: function () { return
|
|
6503
|
+
get: function () { return chunkLZHCIK7L_cjs.MerchantTimeoutError; }
|
|
6490
6504
|
});
|
|
6491
6505
|
Object.defineProperty(exports, "PACKED_USER_OPERATION_FIELDS", {
|
|
6492
6506
|
enumerable: true,
|
|
6493
|
-
get: function () { return
|
|
6507
|
+
get: function () { return chunkLZHCIK7L_cjs.PACKED_USER_OPERATION_FIELDS; }
|
|
6494
6508
|
});
|
|
6495
6509
|
Object.defineProperty(exports, "ROOT_AUTHORITY", {
|
|
6496
6510
|
enumerable: true,
|
|
6497
|
-
get: function () { return
|
|
6511
|
+
get: function () { return chunkLZHCIK7L_cjs.ROOT_AUTHORITY; }
|
|
6498
6512
|
});
|
|
6499
6513
|
Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
|
|
6500
6514
|
enumerable: true,
|
|
6501
|
-
get: function () { return
|
|
6515
|
+
get: function () { return chunkLZHCIK7L_cjs.SIGNER_UPDATE_FALLBACK; }
|
|
6502
6516
|
});
|
|
6503
6517
|
Object.defineProperty(exports, "SignerRefusalCode", {
|
|
6504
6518
|
enumerable: true,
|
|
6505
|
-
get: function () { return
|
|
6519
|
+
get: function () { return chunkLZHCIK7L_cjs.SignerRefusalCode; }
|
|
6506
6520
|
});
|
|
6507
6521
|
Object.defineProperty(exports, "TASK_SIGN_CONTEXT_VERSION", {
|
|
6508
6522
|
enumerable: true,
|
|
6509
|
-
get: function () { return
|
|
6523
|
+
get: function () { return chunkLZHCIK7L_cjs.TASK_SIGN_CONTEXT_VERSION; }
|
|
6510
6524
|
});
|
|
6511
6525
|
Object.defineProperty(exports, "X402AlreadySettledError", {
|
|
6512
6526
|
enumerable: true,
|
|
6513
|
-
get: function () { return
|
|
6527
|
+
get: function () { return chunkLZHCIK7L_cjs.X402AlreadySettledError; }
|
|
6514
6528
|
});
|
|
6515
6529
|
Object.defineProperty(exports, "X402Erc7710AlreadySettledError", {
|
|
6516
6530
|
enumerable: true,
|
|
6517
|
-
get: function () { return
|
|
6531
|
+
get: function () { return chunkLZHCIK7L_cjs.X402Erc7710AlreadySettledError; }
|
|
6518
6532
|
});
|
|
6519
6533
|
Object.defineProperty(exports, "X402TaskBudgetMismatchError", {
|
|
6520
6534
|
enumerable: true,
|
|
6521
|
-
get: function () { return
|
|
6535
|
+
get: function () { return chunkLZHCIK7L_cjs.X402TaskBudgetMismatchError; }
|
|
6522
6536
|
});
|
|
6523
6537
|
Object.defineProperty(exports, "X402UnexpectedStatusError", {
|
|
6524
6538
|
enumerable: true,
|
|
6525
|
-
get: function () { return
|
|
6539
|
+
get: function () { return chunkLZHCIK7L_cjs.X402UnexpectedStatusError; }
|
|
6526
6540
|
});
|
|
6527
6541
|
Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
|
|
6528
6542
|
enumerable: true,
|
|
6529
|
-
get: function () { return
|
|
6543
|
+
get: function () { return chunkLZHCIK7L_cjs.assertUserOpTypedDataBinding; }
|
|
6530
6544
|
});
|
|
6531
6545
|
Object.defineProperty(exports, "connectorRerunCommand", {
|
|
6532
6546
|
enumerable: true,
|
|
6533
|
-
get: function () { return
|
|
6547
|
+
get: function () { return chunkLZHCIK7L_cjs.connectorRerunCommand; }
|
|
6534
6548
|
});
|
|
6535
6549
|
Object.defineProperty(exports, "connectorSpec", {
|
|
6536
6550
|
enumerable: true,
|
|
6537
|
-
get: function () { return
|
|
6551
|
+
get: function () { return chunkLZHCIK7L_cjs.connectorSpec; }
|
|
6538
6552
|
});
|
|
6539
6553
|
Object.defineProperty(exports, "connectorUpgradeCommand", {
|
|
6540
6554
|
enumerable: true,
|
|
6541
|
-
get: function () { return
|
|
6555
|
+
get: function () { return chunkLZHCIK7L_cjs.connectorUpgradeCommand; }
|
|
6542
6556
|
});
|
|
6543
6557
|
Object.defineProperty(exports, "deriveDelegateAccountAddress", {
|
|
6544
6558
|
enumerable: true,
|
|
6545
|
-
get: function () { return
|
|
6559
|
+
get: function () { return chunkLZHCIK7L_cjs.deriveDelegateAccountAddress; }
|
|
6546
6560
|
});
|
|
6547
6561
|
Object.defineProperty(exports, "isConnectorChannel", {
|
|
6548
6562
|
enumerable: true,
|
|
6549
|
-
get: function () { return
|
|
6563
|
+
get: function () { return chunkLZHCIK7L_cjs.isConnectorChannel; }
|
|
6550
6564
|
});
|
|
6551
6565
|
Object.defineProperty(exports, "isPackedUserOperationTypedData", {
|
|
6552
6566
|
enumerable: true,
|
|
6553
|
-
get: function () { return
|
|
6567
|
+
get: function () { return chunkLZHCIK7L_cjs.isPackedUserOperationTypedData; }
|
|
6554
6568
|
});
|
|
6555
6569
|
Object.defineProperty(exports, "packedUserOperationHash", {
|
|
6556
6570
|
enumerable: true,
|
|
6557
|
-
get: function () { return
|
|
6571
|
+
get: function () { return chunkLZHCIK7L_cjs.packedUserOperationHash; }
|
|
6558
6572
|
});
|
|
6559
6573
|
Object.defineProperty(exports, "resolveConnectorChannel", {
|
|
6560
6574
|
enumerable: true,
|
|
6561
|
-
get: function () { return
|
|
6575
|
+
get: function () { return chunkLZHCIK7L_cjs.resolveConnectorChannel; }
|
|
6562
6576
|
});
|
|
6563
6577
|
Object.defineProperty(exports, "signerUpdateFallback", {
|
|
6564
6578
|
enumerable: true,
|
|
6565
|
-
get: function () { return
|
|
6579
|
+
get: function () { return chunkLZHCIK7L_cjs.signerUpdateFallback; }
|
|
6566
6580
|
});
|
|
6567
6581
|
Object.defineProperty(exports, "verifySettlementChild", {
|
|
6568
6582
|
enumerable: true,
|
|
6569
|
-
get: function () { return
|
|
6583
|
+
get: function () { return chunkLZHCIK7L_cjs.verifySettlementChild; }
|
|
6570
6584
|
});
|
|
6571
6585
|
exports.AGENT_APPROVAL_RELAY_JSON_SENTENCE = AGENT_APPROVAL_RELAY_JSON_SENTENCE;
|
|
6572
6586
|
exports.AGENT_APPROVAL_RELAY_PROSE_SENTENCE = AGENT_APPROVAL_RELAY_PROSE_SENTENCE;
|