@haven_ai/sdk 0.0.0-dev.202609281736.4aa027b → 0.0.0-dev.202609282003.b645eff
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -6
- package/dist/{base64-DDWvAiAE.d.cts → base64-Br8mJPgm.d.cts} +28 -2
- package/dist/{base64-DDWvAiAE.d.ts → base64-Br8mJPgm.d.ts} +28 -2
- package/dist/{chunk-PIE7TV5C.js → chunk-AFJ7XDDI.js} +4 -4
- package/dist/{chunk-PIE7TV5C.js.map → chunk-AFJ7XDDI.js.map} +1 -1
- package/dist/{chunk-M7BXKTBK.cjs → chunk-FXPB3NEJ.cjs} +21 -2
- package/dist/chunk-FXPB3NEJ.cjs.map +1 -0
- package/dist/{chunk-6ZVB7XDK.cjs → chunk-PZLGXWSP.cjs} +29 -29
- package/dist/{chunk-6ZVB7XDK.cjs.map → chunk-PZLGXWSP.cjs.map} +1 -1
- package/dist/{chunk-XH4WMOAM.js → chunk-Y2Q4DZVU.js} +21 -3
- package/dist/chunk-Y2Q4DZVU.js.map +1 -0
- package/dist/edge.cjs +65 -65
- package/dist/edge.d.cts +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +3 -3
- package/dist/index.cjs +307 -290
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -4
- package/dist/index.js.map +1 -1
- package/dist/test-support.cjs +18 -18
- package/dist/test-support.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-M7BXKTBK.cjs.map +0 -1
- package/dist/chunk-XH4WMOAM.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkPZLGXWSP_cjs = require('./chunk-PZLGXWSP.cjs');
|
|
4
|
+
var chunkFXPB3NEJ_cjs = require('./chunk-FXPB3NEJ.cjs');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
var ethers = require('ethers');
|
|
7
7
|
var async_hooks = require('async_hooks');
|
|
@@ -14,7 +14,7 @@ function signHash(privateKey, hash) {
|
|
|
14
14
|
const sig = signingKey.sign(hash);
|
|
15
15
|
return sig.serialized;
|
|
16
16
|
} catch (err) {
|
|
17
|
-
throw new
|
|
17
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
18
18
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
19
19
|
);
|
|
20
20
|
}
|
|
@@ -30,7 +30,7 @@ async function signTypedDataVerbatim(privateKey, typedData, label) {
|
|
|
30
30
|
typedData.message
|
|
31
31
|
);
|
|
32
32
|
} catch (err) {
|
|
33
|
-
throw new
|
|
33
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
34
34
|
`Failed to sign ${label}: ${err instanceof Error ? err.message : String(err)}`
|
|
35
35
|
);
|
|
36
36
|
}
|
|
@@ -45,7 +45,7 @@ function addressFromKey(privateKey) {
|
|
|
45
45
|
try {
|
|
46
46
|
return new ethers.ethers.Wallet(privateKey).address;
|
|
47
47
|
} catch (err) {
|
|
48
|
-
throw new
|
|
48
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
49
49
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
50
50
|
);
|
|
51
51
|
}
|
|
@@ -61,7 +61,7 @@ function verifySignature(hash, signature, expectedAddress) {
|
|
|
61
61
|
var DEFAULT_BASE_URL = "http://localhost:3001";
|
|
62
62
|
var DEFAULT_REQUEST_TIMEOUT = 3e4;
|
|
63
63
|
function withoutClientHeader(headers) {
|
|
64
|
-
const target =
|
|
64
|
+
const target = chunkPZLGXWSP_cjs.HAVEN_CLIENT_HEADER.toLowerCase();
|
|
65
65
|
return Object.fromEntries(Object.entries(headers).filter(([name]) => name.toLowerCase() !== target));
|
|
66
66
|
}
|
|
67
67
|
var HavenApiTransport = class {
|
|
@@ -77,7 +77,7 @@ var HavenApiTransport = class {
|
|
|
77
77
|
this.baseUrl = (config.baseUrl ?? DEFAULT_BASE_URL).replace(/\/+$/, "");
|
|
78
78
|
this.requestTimeout = config.requestTimeout ?? DEFAULT_REQUEST_TIMEOUT;
|
|
79
79
|
this.defaultHeaders = { ...config.defaultHeaders ?? {} };
|
|
80
|
-
this.clientIdentity = config.clientIdentity ??
|
|
80
|
+
this.clientIdentity = config.clientIdentity ?? chunkPZLGXWSP_cjs.SDK_CLIENT_IDENTITY;
|
|
81
81
|
}
|
|
82
82
|
/**
|
|
83
83
|
* The newest `client_update` the backend sent (#3303): inside a
|
|
@@ -90,7 +90,7 @@ var HavenApiTransport = class {
|
|
|
90
90
|
}
|
|
91
91
|
recordClientUpdate(data) {
|
|
92
92
|
if (data === null || typeof data !== "object" || Array.isArray(data)) return;
|
|
93
|
-
const hint =
|
|
93
|
+
const hint = chunkPZLGXWSP_cjs.readClientUpdate(data.client_update);
|
|
94
94
|
if (!hint) return;
|
|
95
95
|
this.lastClientUpdate = hint;
|
|
96
96
|
const store = this.requestContext.getStore();
|
|
@@ -123,7 +123,7 @@ var HavenApiTransport = class {
|
|
|
123
123
|
// JOIN `x-haven-client` and `X-Haven-Client` into one unparseable
|
|
124
124
|
// value), so neither `defaultHeaders` nor a dispatch context can
|
|
125
125
|
// misname the client; `clientIdentity` is the one way to set it.
|
|
126
|
-
[
|
|
126
|
+
[chunkPZLGXWSP_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
|
|
127
127
|
},
|
|
128
128
|
body: body ? JSON.stringify(body) : void 0,
|
|
129
129
|
signal: controller.signal
|
|
@@ -136,15 +136,15 @@ var HavenApiTransport = class {
|
|
|
136
136
|
const rawDetails = record.details ?? record.detail;
|
|
137
137
|
const detailsText = typeof rawDetails === "string" ? rawDetails : rawDetails != null ? JSON.stringify(rawDetails) : void 0;
|
|
138
138
|
const message = errorText && detailsText ? `${errorText}: ${detailsText}` : errorText ?? detailsText ?? "API request failed";
|
|
139
|
-
throw new
|
|
139
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(message, res.status, data);
|
|
140
140
|
}
|
|
141
141
|
return data;
|
|
142
142
|
} catch (err) {
|
|
143
|
-
if (err instanceof
|
|
143
|
+
if (err instanceof chunkFXPB3NEJ_cjs.HavenApiError) throw err;
|
|
144
144
|
if (err instanceof Error && err.name === "AbortError") {
|
|
145
|
-
throw new
|
|
145
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(`Request to ${path} timed out`, 408);
|
|
146
146
|
}
|
|
147
|
-
throw new
|
|
147
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
148
148
|
`Request to ${path} failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
149
149
|
0
|
|
150
150
|
);
|
|
@@ -298,29 +298,29 @@ function paymentStateStatusCode(status, fallback = 502) {
|
|
|
298
298
|
return PAYMENT_STATE_STATUS_CODES[status] ?? fallback;
|
|
299
299
|
}
|
|
300
300
|
function phaseForStatus(status) {
|
|
301
|
-
if (status === "pending_signature") return
|
|
302
|
-
if (status === "submitted") return
|
|
303
|
-
if (status === "confirmed") return
|
|
304
|
-
if (status === "pending" || status === "pending_approval") return
|
|
305
|
-
if (status === "approved") return
|
|
306
|
-
if (status === "proposed") return
|
|
307
|
-
if (status === "executed") return
|
|
308
|
-
if (status === "rejected") return
|
|
309
|
-
if (status === "expired") return
|
|
310
|
-
if (status === "failed") return
|
|
301
|
+
if (status === "pending_signature") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.AgentSignatureRequired;
|
|
302
|
+
if (status === "submitted") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.PaymentSubmitted;
|
|
303
|
+
if (status === "confirmed") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.PaymentConfirmed;
|
|
304
|
+
if (status === "pending" || status === "pending_approval") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.UserApprovalRequired;
|
|
305
|
+
if (status === "approved") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.UserExecutionRequired;
|
|
306
|
+
if (status === "proposed") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.WaitingForAdditionalApprovals;
|
|
307
|
+
if (status === "executed") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.FundingSent;
|
|
308
|
+
if (status === "rejected") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.Rejected;
|
|
309
|
+
if (status === "expired") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.Expired;
|
|
310
|
+
if (status === "failed") return chunkFXPB3NEJ_cjs.AgentPaymentPhase.Failed;
|
|
311
311
|
return null;
|
|
312
312
|
}
|
|
313
313
|
function nextActionForStatus(status) {
|
|
314
|
-
if (status === "pending_signature") return
|
|
315
|
-
if (status === "submitted") return
|
|
316
|
-
if (status === "confirmed") return
|
|
317
|
-
if (status === "pending" || status === "pending_approval") return
|
|
318
|
-
if (status === "approved") return
|
|
319
|
-
if (status === "proposed") return
|
|
320
|
-
if (status === "executed") return
|
|
321
|
-
if (status === "rejected") return
|
|
322
|
-
if (status === "expired") return
|
|
323
|
-
if (status === "failed") return
|
|
314
|
+
if (status === "pending_signature") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.SignAndSubmitPayment;
|
|
315
|
+
if (status === "submitted") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.CheckStatusLater;
|
|
316
|
+
if (status === "confirmed") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.None;
|
|
317
|
+
if (status === "pending" || status === "pending_approval") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
318
|
+
if (status === "approved") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
319
|
+
if (status === "proposed") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
320
|
+
if (status === "executed") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
321
|
+
if (status === "rejected") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
322
|
+
if (status === "expired") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.RequestAgainIfUserStillWantsIt;
|
|
323
|
+
if (status === "failed") return chunkFXPB3NEJ_cjs.AgentPaymentNextAction.StopAndTellUser;
|
|
324
324
|
return null;
|
|
325
325
|
}
|
|
326
326
|
function messageForState(label, status, paymentId, nextAction) {
|
|
@@ -394,17 +394,17 @@ function throwPaymentStateError(label, raw) {
|
|
|
394
394
|
const statusCode = paymentStateStatusCode(raw.status);
|
|
395
395
|
const state = paymentStateFromRaw(label, raw);
|
|
396
396
|
if (state) {
|
|
397
|
-
throw new
|
|
397
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(state.message, statusCode, state, raw);
|
|
398
398
|
}
|
|
399
399
|
if (raw.status === "pending_approval") {
|
|
400
|
-
throw new
|
|
400
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
401
401
|
`${label} exceeds the agent's on-chain budget and was declined; no approval is pending and none will arrive (payment_id: ${raw.payment_id}).`,
|
|
402
402
|
statusCode,
|
|
403
403
|
raw
|
|
404
404
|
);
|
|
405
405
|
}
|
|
406
406
|
if (raw.status === "expired") {
|
|
407
|
-
throw new
|
|
407
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
408
408
|
`${label} expired before it could be completed (payment_id: ${raw.payment_id}).`,
|
|
409
409
|
statusCode,
|
|
410
410
|
raw
|
|
@@ -412,7 +412,7 @@ function throwPaymentStateError(label, raw) {
|
|
|
412
412
|
}
|
|
413
413
|
const paymentId = raw.payment_id ? ` (payment_id: ${raw.payment_id})` : "";
|
|
414
414
|
const message = raw.error ?? `${label} ${raw.status}${paymentId}`;
|
|
415
|
-
throw new
|
|
415
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(message, statusCode, raw);
|
|
416
416
|
}
|
|
417
417
|
|
|
418
418
|
// src/x402-retry-target.ts
|
|
@@ -444,7 +444,7 @@ function isSecureX402RetryTarget(url) {
|
|
|
444
444
|
return RESERVED_SUFFIXES.some((suffix) => host.endsWith(suffix));
|
|
445
445
|
}
|
|
446
446
|
var INSECURE_RETRY_TARGET_CODE = "INSECURE_RETRY_TARGET";
|
|
447
|
-
var HavenInsecureRetryTargetError = class extends
|
|
447
|
+
var HavenInsecureRetryTargetError = class extends chunkFXPB3NEJ_cjs.HavenError {
|
|
448
448
|
constructor(url) {
|
|
449
449
|
super(
|
|
450
450
|
`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.`,
|
|
@@ -486,7 +486,7 @@ var McpMerchantTransport = class {
|
|
|
486
486
|
return await this.fetchImpl(url, { ...init, signal });
|
|
487
487
|
} catch (err) {
|
|
488
488
|
if (timeoutSignal.aborted) {
|
|
489
|
-
throw new
|
|
489
|
+
throw new chunkFXPB3NEJ_cjs.MerchantTimeoutError(`Merchant request timed out after ${timeoutMs}ms: ${url}`);
|
|
490
490
|
}
|
|
491
491
|
throw err;
|
|
492
492
|
}
|
|
@@ -623,8 +623,8 @@ var McpMerchantTransport = class {
|
|
|
623
623
|
async deliverPayment(url, init, paymentHeader) {
|
|
624
624
|
assertSecureX402RetryTarget(url);
|
|
625
625
|
const headers = new Headers(init?.headers);
|
|
626
|
-
const send =
|
|
627
|
-
for (const name of
|
|
626
|
+
const send = chunkPZLGXWSP_cjs.x402PaymentHeaderNamesFor(paymentHeader);
|
|
627
|
+
for (const name of chunkPZLGXWSP_cjs.X402_PAYMENT_HEADER_NAMES) {
|
|
628
628
|
if (send.includes(name)) headers.set(name, paymentHeader);
|
|
629
629
|
else headers.delete(name);
|
|
630
630
|
}
|
|
@@ -711,7 +711,7 @@ function mcpToolResultOf(value) {
|
|
|
711
711
|
function extractMcpPaymentRequired(toolResult) {
|
|
712
712
|
if (toolResult.isError !== true) return void 0;
|
|
713
713
|
if (isRecord(toolResult.structuredContent)) {
|
|
714
|
-
const parsed =
|
|
714
|
+
const parsed = chunkPZLGXWSP_cjs.normalizePaymentRequired(toolResult.structuredContent);
|
|
715
715
|
if (parsed) return parsed;
|
|
716
716
|
}
|
|
717
717
|
if (Array.isArray(toolResult.content)) {
|
|
@@ -723,7 +723,7 @@ function extractMcpPaymentRequired(toolResult) {
|
|
|
723
723
|
} catch {
|
|
724
724
|
continue;
|
|
725
725
|
}
|
|
726
|
-
const parsed =
|
|
726
|
+
const parsed = chunkPZLGXWSP_cjs.normalizePaymentRequired(candidate);
|
|
727
727
|
if (parsed) return parsed;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
@@ -747,7 +747,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
|
|
|
747
747
|
if (!request) return init;
|
|
748
748
|
let envelope;
|
|
749
749
|
try {
|
|
750
|
-
envelope =
|
|
750
|
+
envelope = chunkPZLGXWSP_cjs.decodeBase64Json(paymentHeader);
|
|
751
751
|
} catch {
|
|
752
752
|
return init;
|
|
753
753
|
}
|
|
@@ -763,7 +763,7 @@ function withMcpPaymentMeta(init, paymentHeader) {
|
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
765
|
function encodeMcpSettlementReceipt(settlement) {
|
|
766
|
-
return
|
|
766
|
+
return chunkPZLGXWSP_cjs.encodeBase64Json(settlement);
|
|
767
767
|
}
|
|
768
768
|
function parseJsonRpcToolsCall(body) {
|
|
769
769
|
if (typeof body !== "string") return void 0;
|
|
@@ -887,7 +887,7 @@ function deriveReadiness(status, allowances) {
|
|
|
887
887
|
return allowances.some((allowance) => safeBigInt(allowance.remainingAtomic) > 0n) ? "ready" : "needs_approval";
|
|
888
888
|
}
|
|
889
889
|
function formatRemainingDisplay(tokenAddress, tokenSymbol, remainingAtomic) {
|
|
890
|
-
const token =
|
|
890
|
+
const token = chunkPZLGXWSP_cjs.resolveTokenFromAddress(tokenAddress);
|
|
891
891
|
return token ? `${formatAtomicAmount(safeBigInt(remainingAtomic), token.decimals)} ${tokenSymbol}` : `${remainingAtomic} ${tokenSymbol} (atomic; unknown decimals)`;
|
|
892
892
|
}
|
|
893
893
|
function formatTokenAmount(atomic, decimals) {
|
|
@@ -919,7 +919,7 @@ function mapTaskBudget(raw) {
|
|
|
919
919
|
};
|
|
920
920
|
}
|
|
921
921
|
function summarizeTaskBudget(taskBudget) {
|
|
922
|
-
const token =
|
|
922
|
+
const token = chunkPZLGXWSP_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
|
|
923
923
|
const maxDisplay = token ? `${formatAtomicAmount(safeBigInt(taskBudget.maxAtomic), token.decimals)} ${token.symbol}` : `${taskBudget.maxAtomic} (atomic; unknown decimals)`;
|
|
924
924
|
return {
|
|
925
925
|
id: taskBudget.id,
|
|
@@ -1059,7 +1059,7 @@ var AccountReads = class {
|
|
|
1059
1059
|
payment: payment2,
|
|
1060
1060
|
allowance: null,
|
|
1061
1061
|
warnings: [{
|
|
1062
|
-
code:
|
|
1062
|
+
code: chunkFXPB3NEJ_cjs.AgentPaymentWarningCode.AllowanceCheckUnavailable,
|
|
1063
1063
|
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.`
|
|
1064
1064
|
}]
|
|
1065
1065
|
});
|
|
@@ -1085,7 +1085,7 @@ var AccountReads = class {
|
|
|
1085
1085
|
(allowance) => allowance.tokenAddress.toLowerCase() === tokenAddress.toLowerCase()
|
|
1086
1086
|
);
|
|
1087
1087
|
if (!match) return unavailable("no allowance/budget row matches the settled token", payment);
|
|
1088
|
-
const token =
|
|
1088
|
+
const token = chunkPZLGXWSP_cjs.resolveTokenFromAddress(match.tokenAddress);
|
|
1089
1089
|
const remainingDisplay = token ? `${formatAtomicAmount(safeBigInt(match.onchain.remaining), token.decimals)} ${match.tokenSymbol}` : void 0;
|
|
1090
1090
|
const rail = agentResult.value.executionRail;
|
|
1091
1091
|
return {
|
|
@@ -1160,7 +1160,7 @@ function isWaitTimeout(err) {
|
|
|
1160
1160
|
async function waitForSweepTx(tx) {
|
|
1161
1161
|
let receipt;
|
|
1162
1162
|
try {
|
|
1163
|
-
receipt = await tx.wait(1,
|
|
1163
|
+
receipt = await tx.wait(1, chunkFXPB3NEJ_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS);
|
|
1164
1164
|
} catch (err) {
|
|
1165
1165
|
if (!isWaitTimeout(err)) throw err;
|
|
1166
1166
|
return { txHash: tx.hash, confirmation: "unconfirmed" };
|
|
@@ -1174,16 +1174,16 @@ var DelegateSweepApi = class {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
options;
|
|
1176
1176
|
async sweepDelegate() {
|
|
1177
|
-
if (!this.options.delegateKey) throw new
|
|
1177
|
+
if (!this.options.delegateKey) throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateKey is required for sweepDelegate.");
|
|
1178
1178
|
const agent = await this.options.getAgent();
|
|
1179
|
-
if (!agent.delegateAddress) throw new
|
|
1179
|
+
if (!agent.delegateAddress) throw new chunkFXPB3NEJ_cjs.HavenApiError("Agent has no delegate address.", 422);
|
|
1180
1180
|
const rpcUrl = this.options.chainRpcs[agent.chainId];
|
|
1181
|
-
if (!rpcUrl) throw new
|
|
1181
|
+
if (!rpcUrl) throw new chunkFXPB3NEJ_cjs.HavenApiError(`chainRpcs[${agent.chainId}] must be configured to sweep the delegate wallet.`, 422);
|
|
1182
1182
|
const provider = createJsonRpcProvider(rpcUrl);
|
|
1183
1183
|
const wallet = createWallet(this.options.delegateKey, provider);
|
|
1184
1184
|
const transfers = [];
|
|
1185
|
-
if (
|
|
1186
|
-
const contract = createErc20Contract(
|
|
1185
|
+
if (chunkPZLGXWSP_cjs.isSweepableChain(agent.chainId)) {
|
|
1186
|
+
const contract = createErc20Contract(chunkPZLGXWSP_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
|
|
1187
1187
|
const balance2 = await contract.balanceOf(agent.delegateAddress);
|
|
1188
1188
|
if (balance2 > 0n) {
|
|
1189
1189
|
const tx = await contract.transfer(agent.accountAddress, balance2);
|
|
@@ -1271,7 +1271,7 @@ function snapshotRequestBody(body) {
|
|
|
1271
1271
|
if (body == null) return void 0;
|
|
1272
1272
|
if (typeof body === "string") return body;
|
|
1273
1273
|
if (body instanceof URLSearchParams) return body.toString();
|
|
1274
|
-
throw new
|
|
1274
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1275
1275
|
"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.",
|
|
1276
1276
|
400
|
|
1277
1277
|
);
|
|
@@ -1292,25 +1292,25 @@ function requestInitFromSnapshot(request) {
|
|
|
1292
1292
|
};
|
|
1293
1293
|
}
|
|
1294
1294
|
function noCompatiblePaymentOptionError(accepts) {
|
|
1295
|
-
const erc7710Only =
|
|
1295
|
+
const erc7710Only = chunkPZLGXWSP_cjs.selectErc7710PaymentOption(accepts) !== null;
|
|
1296
1296
|
const unsupportedOnly = !erc7710Only && accepts.some(
|
|
1297
|
-
(opt) => opt !== null && typeof opt === "object" && !
|
|
1297
|
+
(opt) => opt !== null && typeof opt === "object" && !chunkPZLGXWSP_cjs.isErc7710Option(opt) && (chunkPZLGXWSP_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
|
|
1298
1298
|
);
|
|
1299
|
-
return new
|
|
1299
|
+
return new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1300
1300
|
"No compatible payment option found in x402 requirements. Haven supports standard x402 exact payments on Base USDC." + (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." : ""),
|
|
1301
1301
|
400
|
|
1302
1302
|
);
|
|
1303
1303
|
}
|
|
1304
1304
|
function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport) {
|
|
1305
|
-
const standard =
|
|
1306
|
-
const option = standard ??
|
|
1305
|
+
const standard = chunkPZLGXWSP_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
1306
|
+
const option = standard ?? chunkPZLGXWSP_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
|
|
1307
1307
|
if (!option) {
|
|
1308
1308
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
1309
1309
|
}
|
|
1310
|
-
const token =
|
|
1310
|
+
const token = chunkPZLGXWSP_cjs.resolveTokenFromAddress(option.asset, option.network);
|
|
1311
1311
|
return {
|
|
1312
1312
|
rail: "x402",
|
|
1313
|
-
idempotencyKey: idempotencyKey ??
|
|
1313
|
+
idempotencyKey: idempotencyKey ?? chunkPZLGXWSP_cjs.buildX402IdempotencyKey(paymentRequired, option),
|
|
1314
1314
|
paymentRequired,
|
|
1315
1315
|
accepted: option,
|
|
1316
1316
|
acceptedScheme: standard ? "standard" : "erc7710",
|
|
@@ -1324,8 +1324,8 @@ function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport)
|
|
|
1324
1324
|
resourceUrlDiffersFromRequest: paymentRequired.resource.url !== request.url,
|
|
1325
1325
|
description: paymentRequired.resource.description ?? option.description ?? null,
|
|
1326
1326
|
mimeType: paymentRequired.resource.mimeType ?? option.mimeType ?? null,
|
|
1327
|
-
amountAtomic:
|
|
1328
|
-
amount: decimalFromUsdcAtomic(
|
|
1327
|
+
amountAtomic: chunkPZLGXWSP_cjs.x402AuthorizationAmount(option),
|
|
1328
|
+
amount: decimalFromUsdcAtomic(chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)),
|
|
1329
1329
|
token: token?.symbol ?? "USDC",
|
|
1330
1330
|
// #1351: null when the asset is unrecognised on this network — the
|
|
1331
1331
|
// `token` fallback above is a LABEL, not evidence of 6 decimals, and a
|
|
@@ -1364,7 +1364,7 @@ function buildX402Receipt(input) {
|
|
|
1364
1364
|
payTo: input.merchantTo ?? input.accepted.payTo
|
|
1365
1365
|
},
|
|
1366
1366
|
x402: {
|
|
1367
|
-
amount:
|
|
1367
|
+
amount: chunkPZLGXWSP_cjs.x402AuthorizationAmount(input.accepted),
|
|
1368
1368
|
token: input.token,
|
|
1369
1369
|
network: input.accepted.network,
|
|
1370
1370
|
asset: input.accepted.asset,
|
|
@@ -1373,7 +1373,7 @@ function buildX402Receipt(input) {
|
|
|
1373
1373
|
};
|
|
1374
1374
|
}
|
|
1375
1375
|
function buildX402ResumeState(input) {
|
|
1376
|
-
const token =
|
|
1376
|
+
const token = chunkPZLGXWSP_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
|
|
1377
1377
|
return {
|
|
1378
1378
|
rail: "x402",
|
|
1379
1379
|
paymentId: input.paymentId,
|
|
@@ -1384,8 +1384,8 @@ function buildX402ResumeState(input) {
|
|
|
1384
1384
|
request: input.request,
|
|
1385
1385
|
resourceUrl: input.paymentRequired.resource.url,
|
|
1386
1386
|
description: input.paymentRequired.resource.description ?? input.accepted.description ?? null,
|
|
1387
|
-
amountAtomic:
|
|
1388
|
-
amount: decimalFromUsdcAtomic(
|
|
1387
|
+
amountAtomic: chunkPZLGXWSP_cjs.x402AuthorizationAmount(input.accepted),
|
|
1388
|
+
amount: decimalFromUsdcAtomic(chunkPZLGXWSP_cjs.x402AuthorizationAmount(input.accepted)),
|
|
1389
1389
|
token: token?.symbol ?? "USDC",
|
|
1390
1390
|
asset: input.accepted.asset,
|
|
1391
1391
|
network: input.accepted.network,
|
|
@@ -1394,7 +1394,7 @@ function buildX402ResumeState(input) {
|
|
|
1394
1394
|
};
|
|
1395
1395
|
}
|
|
1396
1396
|
function attachX402ResumeState(err, paymentRequired, accepted, idempotencyKey, request) {
|
|
1397
|
-
if (!(err instanceof
|
|
1397
|
+
if (!(err instanceof chunkFXPB3NEJ_cjs.HavenPaymentStateError)) return;
|
|
1398
1398
|
if (err.state.rail !== "x402") return;
|
|
1399
1399
|
err.resumeState = buildX402ResumeState({
|
|
1400
1400
|
paymentId: err.state.paymentId,
|
|
@@ -1415,17 +1415,17 @@ function attachResumeState(err, input) {
|
|
|
1415
1415
|
}
|
|
1416
1416
|
function assertCanResumeX402(status, paymentRequired, option) {
|
|
1417
1417
|
if (status.rail !== "x402") {
|
|
1418
|
-
throw new
|
|
1418
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(
|
|
1419
1419
|
`Payment ${status.paymentId} is ${status.rail}, not x402.`,
|
|
1420
1420
|
409,
|
|
1421
1421
|
status
|
|
1422
1422
|
);
|
|
1423
1423
|
}
|
|
1424
|
-
if (status.nextAction !==
|
|
1425
|
-
throw new
|
|
1424
|
+
if (status.nextAction !== chunkFXPB3NEJ_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
|
|
1425
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
|
|
1426
1426
|
}
|
|
1427
1427
|
if (!status.txHash) {
|
|
1428
|
-
throw new
|
|
1428
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1429
1429
|
`x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
|
|
1430
1430
|
502,
|
|
1431
1431
|
status,
|
|
@@ -1433,7 +1433,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1433
1433
|
);
|
|
1434
1434
|
}
|
|
1435
1435
|
if (status.resourceUrl && status.resourceUrl !== paymentRequired.resource.url) {
|
|
1436
|
-
throw new
|
|
1436
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1437
1437
|
"x402 resume request does not match the approved resource URL.",
|
|
1438
1438
|
409,
|
|
1439
1439
|
{ status, paymentRequired },
|
|
@@ -1441,7 +1441,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1441
1441
|
);
|
|
1442
1442
|
}
|
|
1443
1443
|
if (status.merchantAddress && !sameAddress(status.merchantAddress, option.payTo)) {
|
|
1444
|
-
throw new
|
|
1444
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1445
1445
|
"x402 resume request does not match the approved merchant.",
|
|
1446
1446
|
409,
|
|
1447
1447
|
{ status, selectedPayment: option },
|
|
@@ -1450,7 +1450,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1450
1450
|
}
|
|
1451
1451
|
const optionChainId = chainIdFromNetwork(option.network);
|
|
1452
1452
|
if (status.chainId && optionChainId && status.chainId !== optionChainId) {
|
|
1453
|
-
throw new
|
|
1453
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1454
1454
|
"x402 resume request does not match the approved network.",
|
|
1455
1455
|
409,
|
|
1456
1456
|
{ status, selectedPayment: option },
|
|
@@ -1458,7 +1458,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1458
1458
|
);
|
|
1459
1459
|
}
|
|
1460
1460
|
if (status.token && status.token !== "USDC") {
|
|
1461
|
-
throw new
|
|
1461
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1462
1462
|
"x402 resume request does not match the approved token.",
|
|
1463
1463
|
409,
|
|
1464
1464
|
{ status, selectedPayment: option },
|
|
@@ -1466,9 +1466,9 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1466
1466
|
);
|
|
1467
1467
|
}
|
|
1468
1468
|
const approvedAmount = status.amount ? normalizeDecimal(status.amount) : "";
|
|
1469
|
-
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(
|
|
1469
|
+
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)));
|
|
1470
1470
|
if (approvedAmount && approvedAmount !== requestedAmount) {
|
|
1471
|
-
throw new
|
|
1471
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1472
1472
|
"x402 resume request does not match the approved amount.",
|
|
1473
1473
|
409,
|
|
1474
1474
|
{ status, selectedPayment: option },
|
|
@@ -1523,7 +1523,7 @@ var X402FundingLeg = class {
|
|
|
1523
1523
|
const cached = this.receiptCache.get(idempotencyKey);
|
|
1524
1524
|
if (!cached || cached.expiresAt <= Date.now()) return void 0;
|
|
1525
1525
|
if (!sameX402TaskBudget(cached.taskBudgetId, taskBudgetId)) {
|
|
1526
|
-
throw new
|
|
1526
|
+
throw new chunkFXPB3NEJ_cjs.X402TaskBudgetMismatchError(
|
|
1527
1527
|
`The x402 idempotency key '${idempotencyKey}' was already used under a different task budget ('${cached.taskBudgetId ?? "none"}' vs '${taskBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
|
|
1528
1528
|
idempotencyKey,
|
|
1529
1529
|
cached.taskBudgetId,
|
|
@@ -1544,7 +1544,7 @@ var X402FundingLeg = class {
|
|
|
1544
1544
|
url: paymentRequired.resource.url,
|
|
1545
1545
|
payTo: this.delegateAddress,
|
|
1546
1546
|
merchantPayTo: option.payTo,
|
|
1547
|
-
amount:
|
|
1547
|
+
amount: chunkPZLGXWSP_cjs.x402AuthorizationAmount(option),
|
|
1548
1548
|
asset: option.asset,
|
|
1549
1549
|
network: option.network,
|
|
1550
1550
|
description: paymentRequired.resource.description,
|
|
@@ -1558,17 +1558,17 @@ var X402FundingLeg = class {
|
|
|
1558
1558
|
...taskBudgetId ? { taskBudgetId } : {}
|
|
1559
1559
|
});
|
|
1560
1560
|
const state = paymentStateFromRaw("x402 payment", raw);
|
|
1561
|
-
const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction ===
|
|
1561
|
+
const executedReplay = raw.success && raw.tx_hash ? "idempotency-collision" : state?.nextAction === chunkFXPB3NEJ_cjs.AgentPaymentNextAction.RetryOriginalX402Request ? "approval-resume" : null;
|
|
1562
1562
|
if (executedReplay) {
|
|
1563
1563
|
const canFund = await this.delegateCanFund(
|
|
1564
1564
|
raw.chain_id ?? state?.chainId ?? chainIdFromNetwork(option.network),
|
|
1565
1565
|
option.asset,
|
|
1566
|
-
|
|
1566
|
+
chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)
|
|
1567
1567
|
);
|
|
1568
1568
|
const refuse = executedReplay === "idempotency-collision" ? canFund !== true : canFund === false;
|
|
1569
1569
|
if (refuse) {
|
|
1570
1570
|
const settledReceipt = state && executedReplay === "approval-resume" ? this.receiptFromStatus(paymentRequired, option, void 0, state) : this.receiptFromAuthorization(paymentRequired, option, void 0, raw);
|
|
1571
|
-
throw new
|
|
1571
|
+
throw new chunkFXPB3NEJ_cjs.X402AlreadySettledError(
|
|
1572
1572
|
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`.",
|
|
1573
1573
|
settledReceipt,
|
|
1574
1574
|
canFund === false ? "settled" : "unverifiable"
|
|
@@ -1581,18 +1581,18 @@ var X402FundingLeg = class {
|
|
|
1581
1581
|
this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId);
|
|
1582
1582
|
return receipt2;
|
|
1583
1583
|
}
|
|
1584
|
-
if (state?.nextAction ===
|
|
1584
|
+
if (state?.nextAction === chunkFXPB3NEJ_cjs.AgentPaymentNextAction.RetryOriginalX402Request) {
|
|
1585
1585
|
const receipt2 = this.receiptFromStatus(paymentRequired, option, paymentHeader, state);
|
|
1586
1586
|
this.cacheReceipt(idempotencyKey, paymentHeader, receipt2, taskBudgetId);
|
|
1587
1587
|
return receipt2;
|
|
1588
1588
|
}
|
|
1589
1589
|
this.assertSignableAuthorizationState("x402 payment", raw);
|
|
1590
1590
|
if (!raw.sign_data?.hash) {
|
|
1591
|
-
throw new
|
|
1591
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No sign_hash returned from x402/authorize", 500, raw);
|
|
1592
1592
|
}
|
|
1593
1593
|
const sig = await this.signForData(raw.sign_data, {
|
|
1594
1594
|
asset: option.asset,
|
|
1595
|
-
amount:
|
|
1595
|
+
amount: chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)
|
|
1596
1596
|
});
|
|
1597
1597
|
const execResult = await this.post(
|
|
1598
1598
|
`/payments/${raw.payment_id}/sign`,
|
|
@@ -1612,25 +1612,25 @@ var X402FundingLeg = class {
|
|
|
1612
1612
|
// ── Header minting ───────────────────────────────────────────────
|
|
1613
1613
|
async createPaymentHeader(paymentRequired, option) {
|
|
1614
1614
|
if (!this.delegateKey) {
|
|
1615
|
-
throw new
|
|
1615
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
|
|
1616
1616
|
}
|
|
1617
1617
|
const account = accounts.privateKeyToAccount(this.delegateKey);
|
|
1618
|
-
const requirements =
|
|
1618
|
+
const requirements = chunkPZLGXWSP_cjs.toStandardPaymentRequirements(paymentRequired, option);
|
|
1619
1619
|
const header = await schemes.exact.evm.createPaymentHeader(
|
|
1620
1620
|
account,
|
|
1621
1621
|
paymentRequired.x402Version,
|
|
1622
1622
|
requirements
|
|
1623
1623
|
);
|
|
1624
1624
|
if (paymentRequired.x402Version < 2) return header;
|
|
1625
|
-
const payment =
|
|
1626
|
-
return
|
|
1625
|
+
const payment = chunkPZLGXWSP_cjs.decodeBase64Json(header);
|
|
1626
|
+
return chunkPZLGXWSP_cjs.encodeBase64Json(chunkPZLGXWSP_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
|
|
1627
1627
|
}
|
|
1628
1628
|
// ── Receipt mapping ──────────────────────────────────────────────
|
|
1629
1629
|
receiptFromAuthorization(paymentRequired, option, paymentHeader, raw, execResult) {
|
|
1630
1630
|
const txHash = execResult?.tx_hash ?? raw.tx_hash ?? "";
|
|
1631
1631
|
const chainId = execResult?.chain_id ?? raw.chain_id ?? chainIdFromNetwork(option.network);
|
|
1632
1632
|
const token = execResult?.token ?? raw.token ?? "USDC";
|
|
1633
|
-
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(
|
|
1633
|
+
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkPZLGXWSP_cjs.x402AuthorizationAmount(option));
|
|
1634
1634
|
const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
|
|
1635
1635
|
const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
|
|
1636
1636
|
const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
|
|
@@ -1652,7 +1652,7 @@ var X402FundingLeg = class {
|
|
|
1652
1652
|
}
|
|
1653
1653
|
receiptFromStatus(paymentRequired, option, paymentHeader, status) {
|
|
1654
1654
|
if (!status.txHash) {
|
|
1655
|
-
throw new
|
|
1655
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1656
1656
|
`x402 payment ${status.paymentId} is ready to retry but has no Haven transaction hash.`,
|
|
1657
1657
|
502,
|
|
1658
1658
|
status,
|
|
@@ -1663,7 +1663,7 @@ var X402FundingLeg = class {
|
|
|
1663
1663
|
paymentId: status.paymentId,
|
|
1664
1664
|
txHash: status.txHash,
|
|
1665
1665
|
token: status.token || "USDC",
|
|
1666
|
-
amount: status.amount || decimalFromUsdcAtomic(
|
|
1666
|
+
amount: status.amount || decimalFromUsdcAtomic(chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)),
|
|
1667
1667
|
to: this.delegateAddress ?? "",
|
|
1668
1668
|
resourceUrl: paymentRequired.resource.url,
|
|
1669
1669
|
explorerUrl: explorerUrlOrEmpty(status.chainId, status.txHash),
|
|
@@ -1691,7 +1691,7 @@ var X402FundingLeg = class {
|
|
|
1691
1691
|
const provider = createJsonRpcProvider(rpcUrl);
|
|
1692
1692
|
const onChainReceipt = await provider.waitForTransaction(txHash, 1, timeoutMs);
|
|
1693
1693
|
if (!onChainReceipt || onChainReceipt.status !== 1) {
|
|
1694
|
-
throw new
|
|
1694
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1695
1695
|
"Funding tx did not confirm on-chain within the timeout window.",
|
|
1696
1696
|
500,
|
|
1697
1697
|
{ txHash, chainId }
|
|
@@ -1740,7 +1740,7 @@ var X402FundingLeg = class {
|
|
|
1740
1740
|
};
|
|
1741
1741
|
function getPaymentHeaderValidBefore(paymentHeader) {
|
|
1742
1742
|
try {
|
|
1743
|
-
const payment =
|
|
1743
|
+
const payment = chunkPZLGXWSP_cjs.decodeBase64Json(
|
|
1744
1744
|
paymentHeader
|
|
1745
1745
|
);
|
|
1746
1746
|
const payload = payment.payload;
|
|
@@ -1795,7 +1795,7 @@ var X402Erc7710 = class {
|
|
|
1795
1795
|
*/
|
|
1796
1796
|
async settle(paymentRequired, options = {}) {
|
|
1797
1797
|
if (!this.delegateKey) {
|
|
1798
|
-
throw new
|
|
1798
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
1799
1799
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
1800
1800
|
);
|
|
1801
1801
|
}
|
|
@@ -1820,21 +1820,21 @@ var X402Erc7710 = class {
|
|
|
1820
1820
|
async prepare(paymentRequired, options = {}) {
|
|
1821
1821
|
const delegationRail = options.delegationRail ?? (await this.getAgent()).executionRail === "delegation";
|
|
1822
1822
|
if (!delegationRail) {
|
|
1823
|
-
throw new
|
|
1823
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1824
1824
|
"erc7710 settlement requires a delegation-rail account; this one is not on it. Use authorizeX402() for the standard EIP-3009 path.",
|
|
1825
1825
|
400
|
|
1826
1826
|
);
|
|
1827
1827
|
}
|
|
1828
|
-
const selection =
|
|
1828
|
+
const selection = chunkPZLGXWSP_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
|
|
1829
1829
|
if (!selection || selection.scheme !== "erc7710") {
|
|
1830
|
-
throw new
|
|
1830
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1831
1831
|
"This merchant does not advertise an erc7710 settlement option (no accepts[] entry carries extra.assetTransferMethod: 'erc7710'). Use authorizeX402() for the standard EIP-3009 path.",
|
|
1832
1832
|
400
|
|
1833
1833
|
);
|
|
1834
1834
|
}
|
|
1835
1835
|
const option = selection.option;
|
|
1836
1836
|
const merchantPayTo = option.payTo;
|
|
1837
|
-
const amountAtomic =
|
|
1837
|
+
const amountAtomic = chunkPZLGXWSP_cjs.x402AuthorizationAmount(option);
|
|
1838
1838
|
const raw = await this.post("/x402", {
|
|
1839
1839
|
url: options.resourceUrl ?? paymentRequired.resource?.url,
|
|
1840
1840
|
// #2373: the full 402 challenge, persisted verbatim by the backend
|
|
@@ -1875,11 +1875,24 @@ var X402Erc7710 = class {
|
|
|
1875
1875
|
...options.taskBudgetId ? { taskBudgetId: options.taskBudgetId } : {}
|
|
1876
1876
|
});
|
|
1877
1877
|
if (!raw.payment_id) {
|
|
1878
|
-
throw new
|
|
1878
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No payment_id returned from x402/authorize", 500, raw);
|
|
1879
|
+
}
|
|
1880
|
+
if (raw.status === "confirmed" && raw.tx_hash) {
|
|
1881
|
+
const requestedUrl = options.resourceUrl ?? paymentRequired.resource?.url;
|
|
1882
|
+
const samePurchase = typeof raw.to === "string" && raw.to.toLowerCase() === merchantPayTo.toLowerCase() && raw.resource_url === requestedUrl;
|
|
1883
|
+
if (!samePurchase) {
|
|
1884
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1885
|
+
`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.`,
|
|
1886
|
+
409,
|
|
1887
|
+
raw,
|
|
1888
|
+
raw.payment_id
|
|
1889
|
+
);
|
|
1890
|
+
}
|
|
1891
|
+
throw new chunkFXPB3NEJ_cjs.X402Erc7710AlreadySettledError(raw.payment_id, raw.tx_hash, raw);
|
|
1879
1892
|
}
|
|
1880
1893
|
const signData = raw.sign_data;
|
|
1881
1894
|
if (signData?.signature_scheme !== "eip712_delegation" || !signData.typed_data) {
|
|
1882
|
-
throw new
|
|
1895
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1883
1896
|
`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.`,
|
|
1884
1897
|
500,
|
|
1885
1898
|
raw
|
|
@@ -1912,7 +1925,7 @@ var X402Erc7710 = class {
|
|
|
1912
1925
|
{ signature }
|
|
1913
1926
|
);
|
|
1914
1927
|
if (!settled.payment_header) {
|
|
1915
|
-
throw new
|
|
1928
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1916
1929
|
"x402 settle returned no payment_header \u2014 the merchant cannot be retried.",
|
|
1917
1930
|
500,
|
|
1918
1931
|
settled
|
|
@@ -1922,9 +1935,9 @@ var X402Erc7710 = class {
|
|
|
1922
1935
|
}
|
|
1923
1936
|
};
|
|
1924
1937
|
function settlementExpectationFromQuote(settlement) {
|
|
1925
|
-
const chainId =
|
|
1938
|
+
const chainId = chunkFXPB3NEJ_cjs.chainIdForNetwork(settlement.network);
|
|
1926
1939
|
if (chainId === void 0) {
|
|
1927
|
-
throw new
|
|
1940
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
1928
1941
|
`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.`
|
|
1929
1942
|
);
|
|
1930
1943
|
}
|
|
@@ -1974,7 +1987,7 @@ function x402ToolReceipt(receipt) {
|
|
|
1974
1987
|
};
|
|
1975
1988
|
}
|
|
1976
1989
|
function toolError(err) {
|
|
1977
|
-
if (err instanceof
|
|
1990
|
+
if (err instanceof chunkFXPB3NEJ_cjs.HavenPaymentStateError) {
|
|
1978
1991
|
return {
|
|
1979
1992
|
success: false,
|
|
1980
1993
|
payment_id: err.state.paymentId,
|
|
@@ -2019,7 +2032,7 @@ function toolError(err) {
|
|
|
2019
2032
|
error: err.message
|
|
2020
2033
|
};
|
|
2021
2034
|
}
|
|
2022
|
-
if (err instanceof
|
|
2035
|
+
if (err instanceof chunkFXPB3NEJ_cjs.HavenApiError) {
|
|
2023
2036
|
return {
|
|
2024
2037
|
success: false,
|
|
2025
2038
|
status_code: err.statusCode,
|
|
@@ -2056,10 +2069,10 @@ var MerchantCompletion = class {
|
|
|
2056
2069
|
}
|
|
2057
2070
|
async retryRequest(url, initialInit, paymentRequired, receipt) {
|
|
2058
2071
|
if (!receipt.accepted) {
|
|
2059
|
-
throw new
|
|
2072
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No accepted x402 option was recorded for payment retry", 500);
|
|
2060
2073
|
}
|
|
2061
2074
|
if (!receipt.paymentHeader) {
|
|
2062
|
-
throw new
|
|
2075
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No x402 payment header was returned for payment retry", 500);
|
|
2063
2076
|
}
|
|
2064
2077
|
const retryResponse = await this.merchantTransport.deliverPaymentRecoveringSession(
|
|
2065
2078
|
url,
|
|
@@ -2084,7 +2097,7 @@ var MerchantCompletion = class {
|
|
|
2084
2097
|
delegate_to: receipt.to
|
|
2085
2098
|
}
|
|
2086
2099
|
});
|
|
2087
|
-
throw new
|
|
2100
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2088
2101
|
"x402 retry failed after Haven funded the delegate wallet; reconciliation may be required.",
|
|
2089
2102
|
inBandRejection ? X402_RETRY_REJECTED_STATUS : merchant.merchant_status,
|
|
2090
2103
|
{
|
|
@@ -2117,7 +2130,7 @@ var MerchantCompletion = class {
|
|
|
2117
2130
|
merchantStatus: retryResponse.status,
|
|
2118
2131
|
challengePayload: paymentRequired,
|
|
2119
2132
|
selectedPayment: receipt.accepted,
|
|
2120
|
-
paymentProofHeaderName:
|
|
2133
|
+
paymentProofHeaderName: chunkPZLGXWSP_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
|
|
2121
2134
|
paymentProofHeader: receipt.paymentHeader,
|
|
2122
2135
|
protocolReceiptHeaderName,
|
|
2123
2136
|
protocolReceiptHeader
|
|
@@ -2158,18 +2171,18 @@ var MerchantCompletion = class {
|
|
|
2158
2171
|
async resolveCompletionContext(input) {
|
|
2159
2172
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
2160
2173
|
if (status.rail !== "x402") {
|
|
2161
|
-
throw new
|
|
2174
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(
|
|
2162
2175
|
`Payment ${status.paymentId} is ${status.rail}, not x402.`,
|
|
2163
2176
|
409,
|
|
2164
2177
|
status
|
|
2165
2178
|
);
|
|
2166
2179
|
}
|
|
2167
|
-
const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction ===
|
|
2180
|
+
const readyForMerchantCompletion = input.noFundingLeg ? status.kind === "payment_intent" && status.status === "submitted" : status.nextAction === chunkFXPB3NEJ_cjs.AgentPaymentNextAction.RetryOriginalX402Request || status.kind === "payment_intent" && status.status === "confirmed" && status.phase === chunkFXPB3NEJ_cjs.AgentPaymentPhase.PaymentConfirmed && status.nextAction === chunkFXPB3NEJ_cjs.AgentPaymentNextAction.None;
|
|
2168
2181
|
if (!readyForMerchantCompletion) {
|
|
2169
|
-
throw new
|
|
2182
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(status.message, paymentStateStatusCode(status.status, 409), status);
|
|
2170
2183
|
}
|
|
2171
2184
|
if (!input.noFundingLeg && !status.txHash) {
|
|
2172
|
-
throw new
|
|
2185
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2173
2186
|
`x402 payment ${status.paymentId} is ready for merchant completion but has no Haven transaction hash.`,
|
|
2174
2187
|
502,
|
|
2175
2188
|
status,
|
|
@@ -2178,7 +2191,7 @@ var MerchantCompletion = class {
|
|
|
2178
2191
|
}
|
|
2179
2192
|
const approvedResourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
|
|
2180
2193
|
if (approvedResourceUrl && approvedResourceUrl !== input.url) {
|
|
2181
|
-
throw new
|
|
2194
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2182
2195
|
"x402 merchant completion does not match the approved resource URL.",
|
|
2183
2196
|
409,
|
|
2184
2197
|
{ status, url: input.url },
|
|
@@ -2264,7 +2277,7 @@ var MerchantCompletion = class {
|
|
|
2264
2277
|
*/
|
|
2265
2278
|
async reportMerchantOutcome(input) {
|
|
2266
2279
|
if (!Number.isInteger(input.merchantStatus) || input.merchantStatus < 100 || input.merchantStatus > 599) {
|
|
2267
|
-
throw new
|
|
2280
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2268
2281
|
`merchant_status must be an integer HTTP status from 100 to 599 (received ${input.merchantStatus}).`,
|
|
2269
2282
|
400,
|
|
2270
2283
|
void 0,
|
|
@@ -2273,7 +2286,7 @@ var MerchantCompletion = class {
|
|
|
2273
2286
|
}
|
|
2274
2287
|
const looksAccepted = input.merchantStatus >= 200 && input.merchantStatus < 300;
|
|
2275
2288
|
if (looksAccepted !== (input.outcome === "accepted")) {
|
|
2276
|
-
throw new
|
|
2289
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2277
2290
|
`outcome "${input.outcome}" contradicts merchant_status ${input.merchantStatus}: report "accepted" only for a 2xx and "rejected" only for a non-2xx.`,
|
|
2278
2291
|
400,
|
|
2279
2292
|
void 0,
|
|
@@ -2282,14 +2295,14 @@ var MerchantCompletion = class {
|
|
|
2282
2295
|
}
|
|
2283
2296
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
2284
2297
|
if (status.rail !== "x402") {
|
|
2285
|
-
throw new
|
|
2298
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(
|
|
2286
2299
|
`Payment ${status.paymentId} is ${status.rail}, not x402 \u2014 there is no merchant retry to report.`,
|
|
2287
2300
|
409,
|
|
2288
2301
|
status
|
|
2289
2302
|
);
|
|
2290
2303
|
}
|
|
2291
2304
|
if (status.status !== "confirmed" || !status.txHash) {
|
|
2292
|
-
throw new
|
|
2305
|
+
throw new chunkFXPB3NEJ_cjs.HavenPaymentStateError(
|
|
2293
2306
|
`Payment ${status.paymentId} has no confirmed Haven funding transaction to anchor a merchant report to (status ${status.status}). ${status.message}`,
|
|
2294
2307
|
paymentStateStatusCode(status.status, 409),
|
|
2295
2308
|
status
|
|
@@ -2297,7 +2310,7 @@ var MerchantCompletion = class {
|
|
|
2297
2310
|
}
|
|
2298
2311
|
const resourceUrl = status.resourceUrl ?? status.x402?.resourceUrl ?? null;
|
|
2299
2312
|
if (!resourceUrl) {
|
|
2300
|
-
throw new
|
|
2313
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
2301
2314
|
`Payment ${status.paymentId} has no recorded resource URL, so a merchant report cannot be stored.`,
|
|
2302
2315
|
409,
|
|
2303
2316
|
status,
|
|
@@ -2350,7 +2363,7 @@ var MerchantCompletion = class {
|
|
|
2350
2363
|
await this.post("/machine-payments/evidence", body);
|
|
2351
2364
|
return { outcome: "confirmed" };
|
|
2352
2365
|
} catch (err) {
|
|
2353
|
-
const statusCode = err instanceof
|
|
2366
|
+
const statusCode = err instanceof chunkFXPB3NEJ_cjs.HavenApiError ? err.statusCode : void 0;
|
|
2354
2367
|
const retryable = statusCode === EVIDENCE_RETRYABLE_STATUS;
|
|
2355
2368
|
if (!retryable) {
|
|
2356
2369
|
return { outcome: "refused", statusCode: statusCode ?? 0 };
|
|
@@ -2387,7 +2400,7 @@ var MerchantCompletion = class {
|
|
|
2387
2400
|
*/
|
|
2388
2401
|
async reportSettlementEvidence(paymentId, settlementTxHash) {
|
|
2389
2402
|
if (isZeroSettlementTxHash(settlementTxHash)) {
|
|
2390
|
-
throw new
|
|
2403
|
+
throw new chunkFXPB3NEJ_cjs.HavenZeroSettlementHashError(paymentId);
|
|
2391
2404
|
}
|
|
2392
2405
|
return this.reportEvidence({
|
|
2393
2406
|
paymentId,
|
|
@@ -2407,7 +2420,7 @@ function parseMerchantSettlement(header) {
|
|
|
2407
2420
|
}
|
|
2408
2421
|
function parseProtocolReceiptHeader(value) {
|
|
2409
2422
|
try {
|
|
2410
|
-
return
|
|
2423
|
+
return chunkPZLGXWSP_cjs.decodeBase64Json(value);
|
|
2411
2424
|
} catch {
|
|
2412
2425
|
try {
|
|
2413
2426
|
return JSON.parse(value);
|
|
@@ -2424,7 +2437,7 @@ function x402TypedDataDigest(typedData) {
|
|
|
2424
2437
|
try {
|
|
2425
2438
|
return viem.hashTypedData(typedData);
|
|
2426
2439
|
} catch (err) {
|
|
2427
|
-
throw new
|
|
2440
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2428
2441
|
`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)}`
|
|
2429
2442
|
);
|
|
2430
2443
|
}
|
|
@@ -2513,7 +2526,7 @@ var HavenClient = class {
|
|
|
2513
2526
|
});
|
|
2514
2527
|
this.x402Wallet = config.x402Wallet;
|
|
2515
2528
|
this.merchantTransport = new McpMerchantTransport({ merchantTimeout: config.merchantTimeout });
|
|
2516
|
-
this.confirmationTimeout = config.confirmationTimeout ??
|
|
2529
|
+
this.confirmationTimeout = config.confirmationTimeout ?? chunkFXPB3NEJ_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS;
|
|
2517
2530
|
this.pollingInterval = config.pollingInterval ?? DEFAULT_POLLING_INTERVAL;
|
|
2518
2531
|
this.chainRpcs = config.chainRpcs ?? {};
|
|
2519
2532
|
if (this.delegateKey) {
|
|
@@ -2582,7 +2595,7 @@ var HavenClient = class {
|
|
|
2582
2595
|
*/
|
|
2583
2596
|
async pay(request) {
|
|
2584
2597
|
if (!this.delegateKey) {
|
|
2585
|
-
throw new
|
|
2598
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2586
2599
|
"Cannot use pay() without a delegateKey. Use createIntent() + submitSignature() for manual signing."
|
|
2587
2600
|
);
|
|
2588
2601
|
}
|
|
@@ -2632,15 +2645,15 @@ var HavenClient = class {
|
|
|
2632
2645
|
* on-chain allowance — there is nothing to sign until the user approves.
|
|
2633
2646
|
*/
|
|
2634
2647
|
async createX402Intent(paymentRequired, options = {}) {
|
|
2635
|
-
const option =
|
|
2648
|
+
const option = chunkPZLGXWSP_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
2636
2649
|
if (!option) {
|
|
2637
2650
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
2638
2651
|
}
|
|
2639
2652
|
const fundingTo = options.delegateAddress ?? (await this.getAgent()).delegateAddress;
|
|
2640
2653
|
if (!fundingTo) {
|
|
2641
|
-
throw new
|
|
2654
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("Authenticated agent has no delegate address registered.", 502);
|
|
2642
2655
|
}
|
|
2643
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
2656
|
+
const idempotencyKey = options.idempotencyKey ?? chunkPZLGXWSP_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
2644
2657
|
const raw = await this.post("/x402", {
|
|
2645
2658
|
url: paymentRequired.resource.url,
|
|
2646
2659
|
payTo: fundingTo,
|
|
@@ -2651,7 +2664,7 @@ var HavenClient = class {
|
|
|
2651
2664
|
// of a silent reroute to the erc7710 settlement branch (the #1358
|
|
2652
2665
|
// review's open-budget misroute). Legacy-rail backends ignore the field.
|
|
2653
2666
|
settlementScheme: "eip3009",
|
|
2654
|
-
amount:
|
|
2667
|
+
amount: chunkPZLGXWSP_cjs.x402AuthorizationAmount(option),
|
|
2655
2668
|
asset: option.asset,
|
|
2656
2669
|
network: option.network,
|
|
2657
2670
|
description: paymentRequired.resource.description,
|
|
@@ -2673,15 +2686,15 @@ var HavenClient = class {
|
|
|
2673
2686
|
throwPaymentStateError("x402 payment", raw);
|
|
2674
2687
|
}
|
|
2675
2688
|
if (!raw.sign_data?.hash) {
|
|
2676
|
-
throw new
|
|
2689
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No sign_hash returned from x402/authorize", 500, raw);
|
|
2677
2690
|
}
|
|
2678
2691
|
if (raw.sign_data.signature_scheme !== void 0 && !raw.sign_data.typed_data) {
|
|
2679
|
-
throw new
|
|
2692
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2680
2693
|
`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.`
|
|
2681
2694
|
);
|
|
2682
2695
|
}
|
|
2683
2696
|
if (!raw.x402_expected_auth) {
|
|
2684
|
-
throw new
|
|
2697
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("No x402 expected-context binding returned from x402/authorize", 500, raw);
|
|
2685
2698
|
}
|
|
2686
2699
|
return {
|
|
2687
2700
|
paymentId: raw.payment_id,
|
|
@@ -2692,7 +2705,7 @@ var HavenClient = class {
|
|
|
2692
2705
|
accepted: option,
|
|
2693
2706
|
resourceUrl: paymentRequired.resource.url,
|
|
2694
2707
|
merchantTo: raw.merchant_to ?? option.payTo,
|
|
2695
|
-
amountAtomic:
|
|
2708
|
+
amountAtomic: chunkPZLGXWSP_cjs.x402AuthorizationAmount(option),
|
|
2696
2709
|
asset: option.asset,
|
|
2697
2710
|
network: option.network,
|
|
2698
2711
|
expectedAuth: raw.x402_expected_auth,
|
|
@@ -2717,13 +2730,13 @@ var HavenClient = class {
|
|
|
2717
2730
|
*/
|
|
2718
2731
|
sign(hash) {
|
|
2719
2732
|
if (!this.delegateKey) {
|
|
2720
|
-
throw new
|
|
2733
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2721
2734
|
"Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
|
|
2722
2735
|
);
|
|
2723
2736
|
}
|
|
2724
2737
|
const signature = signHash(this.delegateKey, hash);
|
|
2725
2738
|
if (!verifySignature(hash, signature, this.delegateAddress)) {
|
|
2726
|
-
throw new
|
|
2739
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2727
2740
|
"Local signature verification failed \u2014 recovered address does not match delegate key."
|
|
2728
2741
|
);
|
|
2729
2742
|
}
|
|
@@ -2741,29 +2754,29 @@ var HavenClient = class {
|
|
|
2741
2754
|
*/
|
|
2742
2755
|
async signForData(signData, settlementExpectation, fundingExpectation) {
|
|
2743
2756
|
if (!this.delegateKey) {
|
|
2744
|
-
throw new
|
|
2757
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2745
2758
|
"Cannot sign without a delegateKey. Pass the private key in HavenClient config, or sign externally."
|
|
2746
2759
|
);
|
|
2747
2760
|
}
|
|
2748
2761
|
const scheme = signData.signature_scheme;
|
|
2749
2762
|
if (scheme === "eip191_userop") {
|
|
2750
|
-
throw new
|
|
2763
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2751
2764
|
"The session rail is retired \u2014 'eip191_userop' intents can no longer be signed. Re-onboard the account on the delegation rail."
|
|
2752
2765
|
);
|
|
2753
2766
|
}
|
|
2754
2767
|
if (scheme === "eip712_userop") {
|
|
2755
2768
|
if (!signData.typed_data) {
|
|
2756
|
-
throw new
|
|
2769
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2757
2770
|
"sign_data.signature_scheme is eip712_userop but typed_data is missing \u2014 refusing to sign the bare hash (the account would reject it)."
|
|
2758
2771
|
);
|
|
2759
2772
|
}
|
|
2760
|
-
|
|
2761
|
-
|
|
2773
|
+
chunkFXPB3NEJ_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
|
|
2774
|
+
chunkPZLGXWSP_cjs.assertBoundDirectPaymentUserOp(
|
|
2762
2775
|
signData.typed_data,
|
|
2763
2776
|
this.delegateAddress
|
|
2764
2777
|
);
|
|
2765
2778
|
if (fundingExpectation) {
|
|
2766
|
-
|
|
2779
|
+
chunkPZLGXWSP_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
|
|
2767
2780
|
delegateAddress: this.delegateAddress,
|
|
2768
2781
|
asset: fundingExpectation.asset,
|
|
2769
2782
|
amount: fundingExpectation.amount
|
|
@@ -2773,24 +2786,24 @@ var HavenClient = class {
|
|
|
2773
2786
|
}
|
|
2774
2787
|
if (scheme === "eip712_delegation") {
|
|
2775
2788
|
if (!signData.typed_data) {
|
|
2776
|
-
throw new
|
|
2789
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2777
2790
|
"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)."
|
|
2778
2791
|
);
|
|
2779
2792
|
}
|
|
2780
2793
|
if (!settlementExpectation) {
|
|
2781
|
-
throw new
|
|
2794
|
+
throw new chunkPZLGXWSP_cjs.HavenTypedDataRefusedError(
|
|
2782
2795
|
"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."
|
|
2783
2796
|
);
|
|
2784
2797
|
}
|
|
2785
|
-
|
|
2798
|
+
chunkPZLGXWSP_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
|
|
2786
2799
|
return signSettlementDelegationTypedData(this.delegateKey, signData.typed_data);
|
|
2787
2800
|
}
|
|
2788
2801
|
if (scheme === void 0) {
|
|
2789
|
-
throw new
|
|
2802
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2790
2803
|
"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."
|
|
2791
2804
|
);
|
|
2792
2805
|
}
|
|
2793
|
-
throw new
|
|
2806
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
2794
2807
|
`Unknown sign_data.signature_scheme '${scheme}' \u2014 refusing to guess a signing scheme. Update @haven_ai/sdk.`
|
|
2795
2808
|
);
|
|
2796
2809
|
}
|
|
@@ -2974,7 +2987,7 @@ var HavenClient = class {
|
|
|
2974
2987
|
*/
|
|
2975
2988
|
async getPaymentStatusWithPostPurchaseAllowance(paymentId) {
|
|
2976
2989
|
const status = await this.getPaymentStatus(paymentId);
|
|
2977
|
-
if (status.rail ===
|
|
2990
|
+
if (status.rail === chunkFXPB3NEJ_cjs.AgentPaymentRail.X402 && status.phase === chunkFXPB3NEJ_cjs.AgentPaymentPhase.PaymentConfirmed) {
|
|
2978
2991
|
const { allowance, warnings } = await this.getPostPurchaseAllowanceSummary(paymentId);
|
|
2979
2992
|
return { ...status, allowance, ...warnings.length > 0 ? { warnings } : {} };
|
|
2980
2993
|
}
|
|
@@ -3172,7 +3185,7 @@ var HavenClient = class {
|
|
|
3172
3185
|
}
|
|
3173
3186
|
await sleep(this.pollingInterval);
|
|
3174
3187
|
}
|
|
3175
|
-
throw new
|
|
3188
|
+
throw new chunkFXPB3NEJ_cjs.HavenTimeoutError(paymentId);
|
|
3176
3189
|
}
|
|
3177
3190
|
// ── x402 Protocol Support ────────────────────────────────────────
|
|
3178
3191
|
/**
|
|
@@ -3186,24 +3199,24 @@ var HavenClient = class {
|
|
|
3186
3199
|
*/
|
|
3187
3200
|
async authorizeX402(paymentRequired, options = {}) {
|
|
3188
3201
|
if (!this.delegateKey) {
|
|
3189
|
-
throw new
|
|
3202
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
3190
3203
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
3191
3204
|
);
|
|
3192
3205
|
}
|
|
3193
3206
|
if (!this.delegateAddress) {
|
|
3194
|
-
throw new
|
|
3207
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
3195
3208
|
}
|
|
3196
|
-
const option =
|
|
3209
|
+
const option = chunkPZLGXWSP_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
3197
3210
|
if (!option) {
|
|
3198
3211
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
3199
3212
|
}
|
|
3200
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
3213
|
+
const idempotencyKey = options.idempotencyKey ?? chunkPZLGXWSP_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
3201
3214
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, options.taskBudgetId);
|
|
3202
3215
|
if (cached) return cached;
|
|
3203
3216
|
const inFlight = this.inFlightX402.get(idempotencyKey);
|
|
3204
3217
|
if (inFlight) {
|
|
3205
3218
|
if (!sameX402TaskBudget(this.inFlightX402TaskBudget.get(idempotencyKey), options.taskBudgetId)) {
|
|
3206
|
-
throw new
|
|
3219
|
+
throw new chunkFXPB3NEJ_cjs.X402TaskBudgetMismatchError(
|
|
3207
3220
|
`The x402 idempotency key '${idempotencyKey}' has an in-flight payment created under a different task budget ('${this.inFlightX402TaskBudget.get(idempotencyKey) ?? "none"}' vs '${options.taskBudgetId ?? "none"}'). Pass a new idempotencyKey to pay under this budget.`,
|
|
3208
3221
|
idempotencyKey,
|
|
3209
3222
|
this.inFlightX402TaskBudget.get(idempotencyKey),
|
|
@@ -3249,16 +3262,16 @@ var HavenClient = class {
|
|
|
3249
3262
|
} catch {
|
|
3250
3263
|
body = void 0;
|
|
3251
3264
|
}
|
|
3252
|
-
throw new
|
|
3265
|
+
throw new chunkFXPB3NEJ_cjs.X402UnexpectedStatusError(
|
|
3253
3266
|
`Expected an x402 quote response with HTTP 402, got HTTP ${response.status}.`,
|
|
3254
3267
|
response.status || 400,
|
|
3255
3268
|
body
|
|
3256
3269
|
);
|
|
3257
3270
|
}
|
|
3258
3271
|
if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
|
|
3259
|
-
throw new
|
|
3272
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
|
|
3260
3273
|
}
|
|
3261
|
-
const paymentRequired = await
|
|
3274
|
+
const paymentRequired = await chunkPZLGXWSP_cjs.parsePaymentRequiredResponse(response);
|
|
3262
3275
|
const mcpTransport = await this.merchantTransport.detect(url, paymentRequired, response);
|
|
3263
3276
|
return buildX402Quote(paymentRequired, request, options.idempotencyKey, mcpTransport);
|
|
3264
3277
|
}
|
|
@@ -3276,7 +3289,7 @@ var HavenClient = class {
|
|
|
3276
3289
|
const wallet = await this.merchantCompletion.resolveWalletForMerchantCall();
|
|
3277
3290
|
const sessionId = await this.merchantTransport.initialize(url, init, wallet);
|
|
3278
3291
|
if (!sessionId) {
|
|
3279
|
-
throw new
|
|
3292
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
3280
3293
|
"The merchant did not establish an MCP session before the x402 quote. No payment was created.",
|
|
3281
3294
|
502,
|
|
3282
3295
|
{ mcpSessionNotEstablished: true }
|
|
@@ -3350,18 +3363,18 @@ var HavenClient = class {
|
|
|
3350
3363
|
}
|
|
3351
3364
|
async resumeAuthorizedX402(input) {
|
|
3352
3365
|
if (!this.delegateKey) {
|
|
3353
|
-
throw new
|
|
3366
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError(
|
|
3354
3367
|
"delegateKey is required for x402 payments. Pass it in the HavenClient config."
|
|
3355
3368
|
);
|
|
3356
3369
|
}
|
|
3357
3370
|
if (!this.delegateAddress) {
|
|
3358
|
-
throw new
|
|
3371
|
+
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
3359
3372
|
}
|
|
3360
|
-
const option =
|
|
3373
|
+
const option = chunkPZLGXWSP_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
|
|
3361
3374
|
if (!option) {
|
|
3362
3375
|
throw noCompatiblePaymentOptionError(input.paymentRequired.accepts);
|
|
3363
3376
|
}
|
|
3364
|
-
const idempotencyKey = input.idempotencyKey ??
|
|
3377
|
+
const idempotencyKey = input.idempotencyKey ?? chunkPZLGXWSP_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
|
|
3365
3378
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, input.taskBudgetId);
|
|
3366
3379
|
if (cached) return cached;
|
|
3367
3380
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
@@ -3369,10 +3382,10 @@ var HavenClient = class {
|
|
|
3369
3382
|
const canFund = await this.fundingLeg.delegateCanFund(
|
|
3370
3383
|
status.chainId ?? chainIdFromNetwork(option.network),
|
|
3371
3384
|
option.asset,
|
|
3372
|
-
|
|
3385
|
+
chunkPZLGXWSP_cjs.x402AuthorizationAmount(option)
|
|
3373
3386
|
);
|
|
3374
3387
|
if (canFund === false) {
|
|
3375
|
-
throw new
|
|
3388
|
+
throw new chunkFXPB3NEJ_cjs.X402AlreadySettledError(
|
|
3376
3389
|
`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.`,
|
|
3377
3390
|
this.fundingLeg.receiptFromStatus(input.paymentRequired, option, void 0, status),
|
|
3378
3391
|
"settled"
|
|
@@ -3393,13 +3406,13 @@ var HavenClient = class {
|
|
|
3393
3406
|
const url = input.url ?? input.request?.url;
|
|
3394
3407
|
if (!paymentRequired) {
|
|
3395
3408
|
if (!url) {
|
|
3396
|
-
throw new
|
|
3409
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("x402 resume requires the original URL or a captured request snapshot.", 400);
|
|
3397
3410
|
}
|
|
3398
3411
|
const response = await this.merchantTransport.fetch(url, initialInit);
|
|
3399
3412
|
if (response.status !== 402) {
|
|
3400
|
-
throw new
|
|
3413
|
+
throw new chunkFXPB3NEJ_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
|
|
3401
3414
|
}
|
|
3402
|
-
paymentRequired = await
|
|
3415
|
+
paymentRequired = await chunkPZLGXWSP_cjs.parsePaymentRequiredResponse(response);
|
|
3403
3416
|
}
|
|
3404
3417
|
const receipt = await this.resumeAuthorizedX402({
|
|
3405
3418
|
paymentId: input.paymentId,
|
|
@@ -3452,7 +3465,7 @@ var HavenClient = class {
|
|
|
3452
3465
|
nativeChallenge = true;
|
|
3453
3466
|
} else {
|
|
3454
3467
|
try {
|
|
3455
|
-
paymentRequired = await
|
|
3468
|
+
paymentRequired = await chunkPZLGXWSP_cjs.parsePaymentRequiredResponse(response);
|
|
3456
3469
|
} catch {
|
|
3457
3470
|
return response;
|
|
3458
3471
|
}
|
|
@@ -3462,8 +3475,8 @@ var HavenClient = class {
|
|
|
3462
3475
|
if (mcpSessionId) requestInit = this.merchantTransport.withSessionHeaders(requestInit, mcpSessionId);
|
|
3463
3476
|
}
|
|
3464
3477
|
const request = snapshotX402Request(url, requestInit);
|
|
3465
|
-
const option =
|
|
3466
|
-
const idempotencyKey = options.idempotencyKey ?? (option ?
|
|
3478
|
+
const option = chunkPZLGXWSP_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
3479
|
+
const idempotencyKey = options.idempotencyKey ?? (option ? chunkPZLGXWSP_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
|
|
3467
3480
|
let receipt;
|
|
3468
3481
|
try {
|
|
3469
3482
|
receipt = await this.authorizeX402(paymentRequired, options);
|
|
@@ -3590,7 +3603,7 @@ var HavenClient = class {
|
|
|
3590
3603
|
txHash: evidenceTxHash,
|
|
3591
3604
|
resourceUrl: evidenceContext.resourceUrl,
|
|
3592
3605
|
merchantStatus: surfaced.status,
|
|
3593
|
-
paymentProofHeaderName:
|
|
3606
|
+
paymentProofHeaderName: chunkPZLGXWSP_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
|
|
3594
3607
|
paymentProofHeader: input.paymentHeader,
|
|
3595
3608
|
protocolReceiptHeaderName,
|
|
3596
3609
|
protocolReceiptHeader
|
|
@@ -4591,467 +4604,471 @@ function sameUrl(a, b) {
|
|
|
4591
4604
|
|
|
4592
4605
|
Object.defineProperty(exports, "DEFAULT_NEXT_TOOL_BY_ACTION", {
|
|
4593
4606
|
enumerable: true,
|
|
4594
|
-
get: function () { return
|
|
4607
|
+
get: function () { return chunkPZLGXWSP_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
|
|
4595
4608
|
});
|
|
4596
4609
|
Object.defineProperty(exports, "ERC7710_ASSET_TRANSFER_METHOD", {
|
|
4597
4610
|
enumerable: true,
|
|
4598
|
-
get: function () { return
|
|
4611
|
+
get: function () { return chunkPZLGXWSP_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
|
|
4599
4612
|
});
|
|
4600
4613
|
Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
|
|
4601
4614
|
enumerable: true,
|
|
4602
|
-
get: function () { return
|
|
4615
|
+
get: function () { return chunkPZLGXWSP_cjs.HAVEN_CLIENT_HEADER; }
|
|
4603
4616
|
});
|
|
4604
4617
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
4605
4618
|
enumerable: true,
|
|
4606
|
-
get: function () { return
|
|
4619
|
+
get: function () { return chunkPZLGXWSP_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
4607
4620
|
});
|
|
4608
4621
|
Object.defineProperty(exports, "HavenTypedDataRefusedError", {
|
|
4609
4622
|
enumerable: true,
|
|
4610
|
-
get: function () { return
|
|
4623
|
+
get: function () { return chunkPZLGXWSP_cjs.HavenTypedDataRefusedError; }
|
|
4611
4624
|
});
|
|
4612
4625
|
Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
|
|
4613
4626
|
enumerable: true,
|
|
4614
|
-
get: function () { return
|
|
4627
|
+
get: function () { return chunkPZLGXWSP_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
|
|
4615
4628
|
});
|
|
4616
4629
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_NAMES", {
|
|
4617
4630
|
enumerable: true,
|
|
4618
|
-
get: function () { return
|
|
4631
|
+
get: function () { return chunkPZLGXWSP_cjs.NEXT_TOOL_SERVER_NAMES; }
|
|
4619
4632
|
});
|
|
4620
4633
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_ROLES", {
|
|
4621
4634
|
enumerable: true,
|
|
4622
|
-
get: function () { return
|
|
4635
|
+
get: function () { return chunkPZLGXWSP_cjs.NEXT_TOOL_SERVER_ROLES; }
|
|
4623
4636
|
});
|
|
4624
4637
|
Object.defineProperty(exports, "SDK_CLIENT_IDENTITY", {
|
|
4625
4638
|
enumerable: true,
|
|
4626
|
-
get: function () { return
|
|
4639
|
+
get: function () { return chunkPZLGXWSP_cjs.SDK_CLIENT_IDENTITY; }
|
|
4627
4640
|
});
|
|
4628
4641
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
4629
4642
|
enumerable: true,
|
|
4630
|
-
get: function () { return
|
|
4643
|
+
get: function () { return chunkPZLGXWSP_cjs.SDK_VERSION; }
|
|
4631
4644
|
});
|
|
4632
4645
|
Object.defineProperty(exports, "SWEEP_BASE_CHAIN_ID", {
|
|
4633
4646
|
enumerable: true,
|
|
4634
|
-
get: function () { return
|
|
4647
|
+
get: function () { return chunkPZLGXWSP_cjs.SWEEP_BASE_CHAIN_ID; }
|
|
4635
4648
|
});
|
|
4636
4649
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_CHAIN_ID", {
|
|
4637
4650
|
enumerable: true,
|
|
4638
|
-
get: function () { return
|
|
4651
|
+
get: function () { return chunkPZLGXWSP_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
|
|
4639
4652
|
});
|
|
4640
4653
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_USDC_ADDRESS", {
|
|
4641
4654
|
enumerable: true,
|
|
4642
|
-
get: function () { return
|
|
4655
|
+
get: function () { return chunkPZLGXWSP_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
|
|
4643
4656
|
});
|
|
4644
4657
|
Object.defineProperty(exports, "SWEEP_BASE_USDC_ADDRESS", {
|
|
4645
4658
|
enumerable: true,
|
|
4646
|
-
get: function () { return
|
|
4659
|
+
get: function () { return chunkPZLGXWSP_cjs.SWEEP_BASE_USDC_ADDRESS; }
|
|
4647
4660
|
});
|
|
4648
4661
|
Object.defineProperty(exports, "TRANSFER_WITH_AUTHORIZATION_TYPES", {
|
|
4649
4662
|
enumerable: true,
|
|
4650
|
-
get: function () { return
|
|
4663
|
+
get: function () { return chunkPZLGXWSP_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
|
|
4651
4664
|
});
|
|
4652
4665
|
Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
|
|
4653
4666
|
enumerable: true,
|
|
4654
|
-
get: function () { return
|
|
4667
|
+
get: function () { return chunkPZLGXWSP_cjs.TYPED_DATA_NOT_ALLOWED; }
|
|
4655
4668
|
});
|
|
4656
4669
|
Object.defineProperty(exports, "X402PaymentHeaderValidationError", {
|
|
4657
4670
|
enumerable: true,
|
|
4658
|
-
get: function () { return
|
|
4671
|
+
get: function () { return chunkPZLGXWSP_cjs.X402PaymentHeaderValidationError; }
|
|
4659
4672
|
});
|
|
4660
4673
|
Object.defineProperty(exports, "X402_LEGACY_PAYMENT_HEADER_NAME", {
|
|
4661
4674
|
enumerable: true,
|
|
4662
|
-
get: function () { return
|
|
4675
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
|
|
4663
4676
|
});
|
|
4664
4677
|
Object.defineProperty(exports, "X402_MAX_AUTHORIZATION_WINDOW_SECONDS", {
|
|
4665
4678
|
enumerable: true,
|
|
4666
|
-
get: function () { return
|
|
4679
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
|
|
4667
4680
|
});
|
|
4668
4681
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAME", {
|
|
4669
4682
|
enumerable: true,
|
|
4670
|
-
get: function () { return
|
|
4683
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_PAYMENT_HEADER_NAME; }
|
|
4671
4684
|
});
|
|
4672
4685
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAMES_SENT", {
|
|
4673
4686
|
enumerable: true,
|
|
4674
|
-
get: function () { return
|
|
4687
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
|
|
4675
4688
|
});
|
|
4676
4689
|
Object.defineProperty(exports, "X402_PAYMENT_REQUIRED_HEADER_NAME", {
|
|
4677
4690
|
enumerable: true,
|
|
4678
|
-
get: function () { return
|
|
4691
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
|
|
4679
4692
|
});
|
|
4680
4693
|
Object.defineProperty(exports, "X402_PAYMENT_RESPONSE_HEADER_NAME", {
|
|
4681
4694
|
enumerable: true,
|
|
4682
|
-
get: function () { return
|
|
4695
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
|
|
4683
4696
|
});
|
|
4684
4697
|
Object.defineProperty(exports, "X402_SETTLEMENT_FORWARD_MARGIN_SECONDS", {
|
|
4685
4698
|
enumerable: true,
|
|
4686
|
-
get: function () { return
|
|
4699
|
+
get: function () { return chunkPZLGXWSP_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
|
|
4687
4700
|
});
|
|
4688
4701
|
Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
|
|
4689
4702
|
enumerable: true,
|
|
4690
|
-
get: function () { return
|
|
4703
|
+
get: function () { return chunkPZLGXWSP_cjs.assertBoundDirectPaymentUserOp; }
|
|
4691
4704
|
});
|
|
4692
4705
|
Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
|
|
4693
4706
|
enumerable: true,
|
|
4694
|
-
get: function () { return
|
|
4707
|
+
get: function () { return chunkPZLGXWSP_cjs.assertOwnTaskBudgetCloseUserOp; }
|
|
4695
4708
|
});
|
|
4696
4709
|
Object.defineProperty(exports, "assertOwnTaskChild", {
|
|
4697
4710
|
enumerable: true,
|
|
4698
|
-
get: function () { return
|
|
4711
|
+
get: function () { return chunkPZLGXWSP_cjs.assertOwnTaskChild; }
|
|
4699
4712
|
});
|
|
4700
4713
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
4701
4714
|
enumerable: true,
|
|
4702
|
-
get: function () { return
|
|
4715
|
+
get: function () { return chunkPZLGXWSP_cjs.buildSweepAuthorizationMessage; }
|
|
4703
4716
|
});
|
|
4704
4717
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
4705
4718
|
enumerable: true,
|
|
4706
|
-
get: function () { return
|
|
4719
|
+
get: function () { return chunkPZLGXWSP_cjs.buildSweepTypedData; }
|
|
4707
4720
|
});
|
|
4708
4721
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
4709
4722
|
enumerable: true,
|
|
4710
|
-
get: function () { return
|
|
4723
|
+
get: function () { return chunkPZLGXWSP_cjs.buildX402ExpectedMessage; }
|
|
4711
4724
|
});
|
|
4712
4725
|
Object.defineProperty(exports, "compareNodeVersions", {
|
|
4713
4726
|
enumerable: true,
|
|
4714
|
-
get: function () { return
|
|
4727
|
+
get: function () { return chunkPZLGXWSP_cjs.compareNodeVersions; }
|
|
4715
4728
|
});
|
|
4716
4729
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
4717
4730
|
enumerable: true,
|
|
4718
|
-
get: function () { return
|
|
4731
|
+
get: function () { return chunkPZLGXWSP_cjs.createNextStepBuilder; }
|
|
4719
4732
|
});
|
|
4720
4733
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
4721
4734
|
enumerable: true,
|
|
4722
|
-
get: function () { return
|
|
4735
|
+
get: function () { return chunkPZLGXWSP_cjs.decodeBase64Json; }
|
|
4723
4736
|
});
|
|
4724
4737
|
Object.defineProperty(exports, "decodeBase64Utf8", {
|
|
4725
4738
|
enumerable: true,
|
|
4726
|
-
get: function () { return
|
|
4739
|
+
get: function () { return chunkPZLGXWSP_cjs.decodeBase64Utf8; }
|
|
4727
4740
|
});
|
|
4728
4741
|
Object.defineProperty(exports, "defaultNextToolFor", {
|
|
4729
4742
|
enumerable: true,
|
|
4730
|
-
get: function () { return
|
|
4743
|
+
get: function () { return chunkPZLGXWSP_cjs.defaultNextToolFor; }
|
|
4731
4744
|
});
|
|
4732
4745
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
4733
4746
|
enumerable: true,
|
|
4734
|
-
get: function () { return
|
|
4747
|
+
get: function () { return chunkPZLGXWSP_cjs.encodeBase64Json; }
|
|
4735
4748
|
});
|
|
4736
4749
|
Object.defineProperty(exports, "encodeBase64Utf8", {
|
|
4737
4750
|
enumerable: true,
|
|
4738
|
-
get: function () { return
|
|
4751
|
+
get: function () { return chunkPZLGXWSP_cjs.encodeBase64Utf8; }
|
|
4739
4752
|
});
|
|
4740
4753
|
Object.defineProperty(exports, "encodePaymentProof", {
|
|
4741
4754
|
enumerable: true,
|
|
4742
|
-
get: function () { return
|
|
4755
|
+
get: function () { return chunkPZLGXWSP_cjs.encodePaymentProof; }
|
|
4743
4756
|
});
|
|
4744
4757
|
Object.defineProperty(exports, "hashDelegation", {
|
|
4745
4758
|
enumerable: true,
|
|
4746
|
-
get: function () { return
|
|
4759
|
+
get: function () { return chunkPZLGXWSP_cjs.hashDelegation; }
|
|
4747
4760
|
});
|
|
4748
4761
|
Object.defineProperty(exports, "havenClientIdentity", {
|
|
4749
4762
|
enumerable: true,
|
|
4750
|
-
get: function () { return
|
|
4763
|
+
get: function () { return chunkPZLGXWSP_cjs.havenClientIdentity; }
|
|
4751
4764
|
});
|
|
4752
4765
|
Object.defineProperty(exports, "isErc7710Option", {
|
|
4753
4766
|
enumerable: true,
|
|
4754
|
-
get: function () { return
|
|
4767
|
+
get: function () { return chunkPZLGXWSP_cjs.isErc7710Option; }
|
|
4755
4768
|
});
|
|
4756
4769
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
4757
4770
|
enumerable: true,
|
|
4758
|
-
get: function () { return
|
|
4771
|
+
get: function () { return chunkPZLGXWSP_cjs.isSupportedNodeVersion; }
|
|
4759
4772
|
});
|
|
4760
4773
|
Object.defineProperty(exports, "isSweepableChain", {
|
|
4761
4774
|
enumerable: true,
|
|
4762
|
-
get: function () { return
|
|
4775
|
+
get: function () { return chunkPZLGXWSP_cjs.isSweepableChain; }
|
|
4763
4776
|
});
|
|
4764
4777
|
Object.defineProperty(exports, "isTaskChildTypedData", {
|
|
4765
4778
|
enumerable: true,
|
|
4766
|
-
get: function () { return
|
|
4779
|
+
get: function () { return chunkPZLGXWSP_cjs.isTaskChildTypedData; }
|
|
4767
4780
|
});
|
|
4768
4781
|
Object.defineProperty(exports, "normalizePaymentRequired", {
|
|
4769
4782
|
enumerable: true,
|
|
4770
|
-
get: function () { return
|
|
4783
|
+
get: function () { return chunkPZLGXWSP_cjs.normalizePaymentRequired; }
|
|
4771
4784
|
});
|
|
4772
4785
|
Object.defineProperty(exports, "parseNextTool", {
|
|
4773
4786
|
enumerable: true,
|
|
4774
|
-
get: function () { return
|
|
4787
|
+
get: function () { return chunkPZLGXWSP_cjs.parseNextTool; }
|
|
4775
4788
|
});
|
|
4776
4789
|
Object.defineProperty(exports, "parsePaymentRequired", {
|
|
4777
4790
|
enumerable: true,
|
|
4778
|
-
get: function () { return
|
|
4791
|
+
get: function () { return chunkPZLGXWSP_cjs.parsePaymentRequired; }
|
|
4779
4792
|
});
|
|
4780
4793
|
Object.defineProperty(exports, "parsePaymentRequiredResponse", {
|
|
4781
4794
|
enumerable: true,
|
|
4782
|
-
get: function () { return
|
|
4795
|
+
get: function () { return chunkPZLGXWSP_cjs.parsePaymentRequiredResponse; }
|
|
4783
4796
|
});
|
|
4784
4797
|
Object.defineProperty(exports, "readClientUpdate", {
|
|
4785
4798
|
enumerable: true,
|
|
4786
|
-
get: function () { return
|
|
4799
|
+
get: function () { return chunkPZLGXWSP_cjs.readClientUpdate; }
|
|
4787
4800
|
});
|
|
4788
4801
|
Object.defineProperty(exports, "renderNextTool", {
|
|
4789
4802
|
enumerable: true,
|
|
4790
|
-
get: function () { return
|
|
4803
|
+
get: function () { return chunkPZLGXWSP_cjs.renderNextTool; }
|
|
4791
4804
|
});
|
|
4792
4805
|
Object.defineProperty(exports, "resolveTokenBySymbol", {
|
|
4793
4806
|
enumerable: true,
|
|
4794
|
-
get: function () { return
|
|
4807
|
+
get: function () { return chunkPZLGXWSP_cjs.resolveTokenBySymbol; }
|
|
4795
4808
|
});
|
|
4796
4809
|
Object.defineProperty(exports, "resolveTokenFromAddress", {
|
|
4797
4810
|
enumerable: true,
|
|
4798
|
-
get: function () { return
|
|
4811
|
+
get: function () { return chunkPZLGXWSP_cjs.resolveTokenFromAddress; }
|
|
4799
4812
|
});
|
|
4800
4813
|
Object.defineProperty(exports, "selectErc7710PaymentOption", {
|
|
4801
4814
|
enumerable: true,
|
|
4802
|
-
get: function () { return
|
|
4815
|
+
get: function () { return chunkPZLGXWSP_cjs.selectErc7710PaymentOption; }
|
|
4803
4816
|
});
|
|
4804
4817
|
Object.defineProperty(exports, "selectPaymentOption", {
|
|
4805
4818
|
enumerable: true,
|
|
4806
|
-
get: function () { return
|
|
4819
|
+
get: function () { return chunkPZLGXWSP_cjs.selectPaymentOption; }
|
|
4807
4820
|
});
|
|
4808
4821
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
4809
4822
|
enumerable: true,
|
|
4810
|
-
get: function () { return
|
|
4823
|
+
get: function () { return chunkPZLGXWSP_cjs.selectStandardPaymentOption; }
|
|
4811
4824
|
});
|
|
4812
4825
|
Object.defineProperty(exports, "selectX402SettlementScheme", {
|
|
4813
4826
|
enumerable: true,
|
|
4814
|
-
get: function () { return
|
|
4827
|
+
get: function () { return chunkPZLGXWSP_cjs.selectX402SettlementScheme; }
|
|
4815
4828
|
});
|
|
4816
4829
|
Object.defineProperty(exports, "sweepUsdcAddress", {
|
|
4817
4830
|
enumerable: true,
|
|
4818
|
-
get: function () { return
|
|
4831
|
+
get: function () { return chunkPZLGXWSP_cjs.sweepUsdcAddress; }
|
|
4819
4832
|
});
|
|
4820
4833
|
Object.defineProperty(exports, "sweepUsdcDomain", {
|
|
4821
4834
|
enumerable: true,
|
|
4822
|
-
get: function () { return
|
|
4835
|
+
get: function () { return chunkPZLGXWSP_cjs.sweepUsdcDomain; }
|
|
4823
4836
|
});
|
|
4824
4837
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
4825
4838
|
enumerable: true,
|
|
4826
|
-
get: function () { return
|
|
4839
|
+
get: function () { return chunkPZLGXWSP_cjs.toStandardPaymentRequirements; }
|
|
4827
4840
|
});
|
|
4828
4841
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
4829
4842
|
enumerable: true,
|
|
4830
|
-
get: function () { return
|
|
4843
|
+
get: function () { return chunkPZLGXWSP_cjs.unsupportedNodeVersionMessage; }
|
|
4831
4844
|
});
|
|
4832
4845
|
Object.defineProperty(exports, "validateStandardX402PaymentHeader", {
|
|
4833
4846
|
enumerable: true,
|
|
4834
|
-
get: function () { return
|
|
4847
|
+
get: function () { return chunkPZLGXWSP_cjs.validateStandardX402PaymentHeader; }
|
|
4835
4848
|
});
|
|
4836
4849
|
Object.defineProperty(exports, "x402AssetTransferMethod", {
|
|
4837
4850
|
enumerable: true,
|
|
4838
|
-
get: function () { return
|
|
4851
|
+
get: function () { return chunkPZLGXWSP_cjs.x402AssetTransferMethod; }
|
|
4839
4852
|
});
|
|
4840
4853
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
4841
4854
|
enumerable: true,
|
|
4842
|
-
get: function () { return
|
|
4855
|
+
get: function () { return chunkPZLGXWSP_cjs.x402AuthorizationAmount; }
|
|
4843
4856
|
});
|
|
4844
4857
|
Object.defineProperty(exports, "x402FacilitatorAddresses", {
|
|
4845
4858
|
enumerable: true,
|
|
4846
|
-
get: function () { return
|
|
4859
|
+
get: function () { return chunkPZLGXWSP_cjs.x402FacilitatorAddresses; }
|
|
4847
4860
|
});
|
|
4848
4861
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
4849
4862
|
enumerable: true,
|
|
4850
|
-
get: function () { return
|
|
4863
|
+
get: function () { return chunkPZLGXWSP_cjs.x402V2PaymentEnvelope; }
|
|
4851
4864
|
});
|
|
4852
4865
|
Object.defineProperty(exports, "AGENT_PAYMENT_FAILURE_CODE_VALUES", {
|
|
4853
4866
|
enumerable: true,
|
|
4854
|
-
get: function () { return
|
|
4867
|
+
get: function () { return chunkFXPB3NEJ_cjs.AGENT_PAYMENT_FAILURE_CODE_VALUES; }
|
|
4855
4868
|
});
|
|
4856
4869
|
Object.defineProperty(exports, "AGENT_PAYMENT_NEXT_ACTION_VALUES", {
|
|
4857
4870
|
enumerable: true,
|
|
4858
|
-
get: function () { return
|
|
4871
|
+
get: function () { return chunkFXPB3NEJ_cjs.AGENT_PAYMENT_NEXT_ACTION_VALUES; }
|
|
4859
4872
|
});
|
|
4860
4873
|
Object.defineProperty(exports, "AGENT_PAYMENT_PHASE_VALUES", {
|
|
4861
4874
|
enumerable: true,
|
|
4862
|
-
get: function () { return
|
|
4875
|
+
get: function () { return chunkFXPB3NEJ_cjs.AGENT_PAYMENT_PHASE_VALUES; }
|
|
4863
4876
|
});
|
|
4864
4877
|
Object.defineProperty(exports, "AGENT_PAYMENT_RAIL_VALUES", {
|
|
4865
4878
|
enumerable: true,
|
|
4866
|
-
get: function () { return
|
|
4879
|
+
get: function () { return chunkFXPB3NEJ_cjs.AGENT_PAYMENT_RAIL_VALUES; }
|
|
4867
4880
|
});
|
|
4868
4881
|
Object.defineProperty(exports, "AgentPaymentFailureCode", {
|
|
4869
4882
|
enumerable: true,
|
|
4870
|
-
get: function () { return
|
|
4883
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentFailureCode; }
|
|
4871
4884
|
});
|
|
4872
4885
|
Object.defineProperty(exports, "AgentPaymentFailureCodeDescriptions", {
|
|
4873
4886
|
enumerable: true,
|
|
4874
|
-
get: function () { return
|
|
4887
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentFailureCodeDescriptions; }
|
|
4875
4888
|
});
|
|
4876
4889
|
Object.defineProperty(exports, "AgentPaymentFailureCodeSchema", {
|
|
4877
4890
|
enumerable: true,
|
|
4878
|
-
get: function () { return
|
|
4891
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentFailureCodeSchema; }
|
|
4879
4892
|
});
|
|
4880
4893
|
Object.defineProperty(exports, "AgentPaymentNextAction", {
|
|
4881
4894
|
enumerable: true,
|
|
4882
|
-
get: function () { return
|
|
4895
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentNextAction; }
|
|
4883
4896
|
});
|
|
4884
4897
|
Object.defineProperty(exports, "AgentPaymentNextActionDescriptions", {
|
|
4885
4898
|
enumerable: true,
|
|
4886
|
-
get: function () { return
|
|
4899
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentNextActionDescriptions; }
|
|
4887
4900
|
});
|
|
4888
4901
|
Object.defineProperty(exports, "AgentPaymentNextActionSchema", {
|
|
4889
4902
|
enumerable: true,
|
|
4890
|
-
get: function () { return
|
|
4903
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentNextActionSchema; }
|
|
4891
4904
|
});
|
|
4892
4905
|
Object.defineProperty(exports, "AgentPaymentPhase", {
|
|
4893
4906
|
enumerable: true,
|
|
4894
|
-
get: function () { return
|
|
4907
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentPhase; }
|
|
4895
4908
|
});
|
|
4896
4909
|
Object.defineProperty(exports, "AgentPaymentPhaseDescriptions", {
|
|
4897
4910
|
enumerable: true,
|
|
4898
|
-
get: function () { return
|
|
4911
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentPhaseDescriptions; }
|
|
4899
4912
|
});
|
|
4900
4913
|
Object.defineProperty(exports, "AgentPaymentPhaseSchema", {
|
|
4901
4914
|
enumerable: true,
|
|
4902
|
-
get: function () { return
|
|
4915
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentPhaseSchema; }
|
|
4903
4916
|
});
|
|
4904
4917
|
Object.defineProperty(exports, "AgentPaymentRail", {
|
|
4905
4918
|
enumerable: true,
|
|
4906
|
-
get: function () { return
|
|
4919
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentRail; }
|
|
4907
4920
|
});
|
|
4908
4921
|
Object.defineProperty(exports, "AgentPaymentRailDescriptions", {
|
|
4909
4922
|
enumerable: true,
|
|
4910
|
-
get: function () { return
|
|
4923
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentRailDescriptions; }
|
|
4911
4924
|
});
|
|
4912
4925
|
Object.defineProperty(exports, "AgentPaymentRailSchema", {
|
|
4913
4926
|
enumerable: true,
|
|
4914
|
-
get: function () { return
|
|
4927
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentRailSchema; }
|
|
4915
4928
|
});
|
|
4916
4929
|
Object.defineProperty(exports, "AgentPaymentWarningCode", {
|
|
4917
4930
|
enumerable: true,
|
|
4918
|
-
get: function () { return
|
|
4931
|
+
get: function () { return chunkFXPB3NEJ_cjs.AgentPaymentWarningCode; }
|
|
4919
4932
|
});
|
|
4920
4933
|
Object.defineProperty(exports, "CONNECTOR_PACKAGE_NAME", {
|
|
4921
4934
|
enumerable: true,
|
|
4922
|
-
get: function () { return
|
|
4935
|
+
get: function () { return chunkFXPB3NEJ_cjs.CONNECTOR_PACKAGE_NAME; }
|
|
4923
4936
|
});
|
|
4924
4937
|
Object.defineProperty(exports, "DEFAULT_CONFIRMATION_TIMEOUT_MS", {
|
|
4925
4938
|
enumerable: true,
|
|
4926
|
-
get: function () { return
|
|
4939
|
+
get: function () { return chunkFXPB3NEJ_cjs.DEFAULT_CONFIRMATION_TIMEOUT_MS; }
|
|
4927
4940
|
});
|
|
4928
4941
|
Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
|
|
4929
4942
|
enumerable: true,
|
|
4930
|
-
get: function () { return
|
|
4943
|
+
get: function () { return chunkFXPB3NEJ_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
|
|
4931
4944
|
});
|
|
4932
4945
|
Object.defineProperty(exports, "ENTRY_POINT_V07", {
|
|
4933
4946
|
enumerable: true,
|
|
4934
|
-
get: function () { return
|
|
4947
|
+
get: function () { return chunkFXPB3NEJ_cjs.ENTRY_POINT_V07; }
|
|
4935
4948
|
});
|
|
4936
4949
|
Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
|
|
4937
4950
|
enumerable: true,
|
|
4938
|
-
get: function () { return
|
|
4951
|
+
get: function () { return chunkFXPB3NEJ_cjs.HAVEN_CONNECTOR_CHANNEL; }
|
|
4939
4952
|
});
|
|
4940
4953
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_NAME", {
|
|
4941
4954
|
enumerable: true,
|
|
4942
|
-
get: function () { return
|
|
4955
|
+
get: function () { return chunkFXPB3NEJ_cjs.HYBRID_DELEGATOR_DOMAIN_NAME; }
|
|
4943
4956
|
});
|
|
4944
4957
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_DOMAIN_VERSION", {
|
|
4945
4958
|
enumerable: true,
|
|
4946
|
-
get: function () { return
|
|
4959
|
+
get: function () { return chunkFXPB3NEJ_cjs.HYBRID_DELEGATOR_DOMAIN_VERSION; }
|
|
4947
4960
|
});
|
|
4948
4961
|
Object.defineProperty(exports, "HavenApiError", {
|
|
4949
4962
|
enumerable: true,
|
|
4950
|
-
get: function () { return
|
|
4963
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenApiError; }
|
|
4951
4964
|
});
|
|
4952
4965
|
Object.defineProperty(exports, "HavenError", {
|
|
4953
4966
|
enumerable: true,
|
|
4954
|
-
get: function () { return
|
|
4967
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenError; }
|
|
4955
4968
|
});
|
|
4956
4969
|
Object.defineProperty(exports, "HavenPaymentStateError", {
|
|
4957
4970
|
enumerable: true,
|
|
4958
|
-
get: function () { return
|
|
4971
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenPaymentStateError; }
|
|
4959
4972
|
});
|
|
4960
4973
|
Object.defineProperty(exports, "HavenSigningError", {
|
|
4961
4974
|
enumerable: true,
|
|
4962
|
-
get: function () { return
|
|
4975
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenSigningError; }
|
|
4963
4976
|
});
|
|
4964
4977
|
Object.defineProperty(exports, "HavenTimeoutError", {
|
|
4965
4978
|
enumerable: true,
|
|
4966
|
-
get: function () { return
|
|
4979
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenTimeoutError; }
|
|
4967
4980
|
});
|
|
4968
4981
|
Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
|
|
4969
4982
|
enumerable: true,
|
|
4970
|
-
get: function () { return
|
|
4983
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenUnsupportedSignerVersionError; }
|
|
4971
4984
|
});
|
|
4972
4985
|
Object.defineProperty(exports, "HavenUserOpBindingError", {
|
|
4973
4986
|
enumerable: true,
|
|
4974
|
-
get: function () { return
|
|
4987
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenUserOpBindingError; }
|
|
4975
4988
|
});
|
|
4976
4989
|
Object.defineProperty(exports, "HavenZeroSettlementHashError", {
|
|
4977
4990
|
enumerable: true,
|
|
4978
|
-
get: function () { return
|
|
4991
|
+
get: function () { return chunkFXPB3NEJ_cjs.HavenZeroSettlementHashError; }
|
|
4979
4992
|
});
|
|
4980
4993
|
Object.defineProperty(exports, "MerchantTimeoutError", {
|
|
4981
4994
|
enumerable: true,
|
|
4982
|
-
get: function () { return
|
|
4995
|
+
get: function () { return chunkFXPB3NEJ_cjs.MerchantTimeoutError; }
|
|
4983
4996
|
});
|
|
4984
4997
|
Object.defineProperty(exports, "PACKED_USER_OPERATION_FIELDS", {
|
|
4985
4998
|
enumerable: true,
|
|
4986
|
-
get: function () { return
|
|
4999
|
+
get: function () { return chunkFXPB3NEJ_cjs.PACKED_USER_OPERATION_FIELDS; }
|
|
4987
5000
|
});
|
|
4988
5001
|
Object.defineProperty(exports, "ROOT_AUTHORITY", {
|
|
4989
5002
|
enumerable: true,
|
|
4990
|
-
get: function () { return
|
|
5003
|
+
get: function () { return chunkFXPB3NEJ_cjs.ROOT_AUTHORITY; }
|
|
4991
5004
|
});
|
|
4992
5005
|
Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
|
|
4993
5006
|
enumerable: true,
|
|
4994
|
-
get: function () { return
|
|
5007
|
+
get: function () { return chunkFXPB3NEJ_cjs.SIGNER_UPDATE_FALLBACK; }
|
|
4995
5008
|
});
|
|
4996
5009
|
Object.defineProperty(exports, "SignerRefusalCode", {
|
|
4997
5010
|
enumerable: true,
|
|
4998
|
-
get: function () { return
|
|
5011
|
+
get: function () { return chunkFXPB3NEJ_cjs.SignerRefusalCode; }
|
|
4999
5012
|
});
|
|
5000
5013
|
Object.defineProperty(exports, "X402AlreadySettledError", {
|
|
5001
5014
|
enumerable: true,
|
|
5002
|
-
get: function () { return
|
|
5015
|
+
get: function () { return chunkFXPB3NEJ_cjs.X402AlreadySettledError; }
|
|
5016
|
+
});
|
|
5017
|
+
Object.defineProperty(exports, "X402Erc7710AlreadySettledError", {
|
|
5018
|
+
enumerable: true,
|
|
5019
|
+
get: function () { return chunkFXPB3NEJ_cjs.X402Erc7710AlreadySettledError; }
|
|
5003
5020
|
});
|
|
5004
5021
|
Object.defineProperty(exports, "X402TaskBudgetMismatchError", {
|
|
5005
5022
|
enumerable: true,
|
|
5006
|
-
get: function () { return
|
|
5023
|
+
get: function () { return chunkFXPB3NEJ_cjs.X402TaskBudgetMismatchError; }
|
|
5007
5024
|
});
|
|
5008
5025
|
Object.defineProperty(exports, "X402UnexpectedStatusError", {
|
|
5009
5026
|
enumerable: true,
|
|
5010
|
-
get: function () { return
|
|
5027
|
+
get: function () { return chunkFXPB3NEJ_cjs.X402UnexpectedStatusError; }
|
|
5011
5028
|
});
|
|
5012
5029
|
Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
|
|
5013
5030
|
enumerable: true,
|
|
5014
|
-
get: function () { return
|
|
5031
|
+
get: function () { return chunkFXPB3NEJ_cjs.assertUserOpTypedDataBinding; }
|
|
5015
5032
|
});
|
|
5016
5033
|
Object.defineProperty(exports, "connectorRerunCommand", {
|
|
5017
5034
|
enumerable: true,
|
|
5018
|
-
get: function () { return
|
|
5035
|
+
get: function () { return chunkFXPB3NEJ_cjs.connectorRerunCommand; }
|
|
5019
5036
|
});
|
|
5020
5037
|
Object.defineProperty(exports, "connectorSpec", {
|
|
5021
5038
|
enumerable: true,
|
|
5022
|
-
get: function () { return
|
|
5039
|
+
get: function () { return chunkFXPB3NEJ_cjs.connectorSpec; }
|
|
5023
5040
|
});
|
|
5024
5041
|
Object.defineProperty(exports, "connectorUpgradeCommand", {
|
|
5025
5042
|
enumerable: true,
|
|
5026
|
-
get: function () { return
|
|
5043
|
+
get: function () { return chunkFXPB3NEJ_cjs.connectorUpgradeCommand; }
|
|
5027
5044
|
});
|
|
5028
5045
|
Object.defineProperty(exports, "deriveDelegateAccountAddress", {
|
|
5029
5046
|
enumerable: true,
|
|
5030
|
-
get: function () { return
|
|
5047
|
+
get: function () { return chunkFXPB3NEJ_cjs.deriveDelegateAccountAddress; }
|
|
5031
5048
|
});
|
|
5032
5049
|
Object.defineProperty(exports, "isConnectorChannel", {
|
|
5033
5050
|
enumerable: true,
|
|
5034
|
-
get: function () { return
|
|
5051
|
+
get: function () { return chunkFXPB3NEJ_cjs.isConnectorChannel; }
|
|
5035
5052
|
});
|
|
5036
5053
|
Object.defineProperty(exports, "isPackedUserOperationTypedData", {
|
|
5037
5054
|
enumerable: true,
|
|
5038
|
-
get: function () { return
|
|
5055
|
+
get: function () { return chunkFXPB3NEJ_cjs.isPackedUserOperationTypedData; }
|
|
5039
5056
|
});
|
|
5040
5057
|
Object.defineProperty(exports, "packedUserOperationHash", {
|
|
5041
5058
|
enumerable: true,
|
|
5042
|
-
get: function () { return
|
|
5059
|
+
get: function () { return chunkFXPB3NEJ_cjs.packedUserOperationHash; }
|
|
5043
5060
|
});
|
|
5044
5061
|
Object.defineProperty(exports, "resolveConnectorChannel", {
|
|
5045
5062
|
enumerable: true,
|
|
5046
|
-
get: function () { return
|
|
5063
|
+
get: function () { return chunkFXPB3NEJ_cjs.resolveConnectorChannel; }
|
|
5047
5064
|
});
|
|
5048
5065
|
Object.defineProperty(exports, "signerUpdateFallback", {
|
|
5049
5066
|
enumerable: true,
|
|
5050
|
-
get: function () { return
|
|
5067
|
+
get: function () { return chunkFXPB3NEJ_cjs.signerUpdateFallback; }
|
|
5051
5068
|
});
|
|
5052
5069
|
Object.defineProperty(exports, "verifySettlementChild", {
|
|
5053
5070
|
enumerable: true,
|
|
5054
|
-
get: function () { return
|
|
5071
|
+
get: function () { return chunkFXPB3NEJ_cjs.verifySettlementChild; }
|
|
5055
5072
|
});
|
|
5056
5073
|
exports.AGENT_APPROVAL_RELAY_JSON_SENTENCE = AGENT_APPROVAL_RELAY_JSON_SENTENCE;
|
|
5057
5074
|
exports.AGENT_APPROVAL_RELAY_PROSE_SENTENCE = AGENT_APPROVAL_RELAY_PROSE_SENTENCE;
|