@haven_ai/sdk 0.0.0-dev.202609282003.b645eff → 0.0.0-dev.202609282018.d7956ad
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{base64-Br8mJPgm.d.cts → base64-BFXCO54F.d.cts} +1 -1
- package/dist/{base64-Br8mJPgm.d.ts → base64-BFXCO54F.d.ts} +1 -1
- package/dist/{chunk-AFJ7XDDI.js → chunk-LKWXAYWW.js} +3 -3
- package/dist/{chunk-AFJ7XDDI.js.map → chunk-LKWXAYWW.js.map} +1 -1
- package/dist/{chunk-PZLGXWSP.cjs → chunk-XLXOQZ3M.cjs} +3 -3
- package/dist/{chunk-PZLGXWSP.cjs.map → chunk-XLXOQZ3M.cjs.map} +1 -1
- package/dist/edge.cjs +31 -31
- package/dist/edge.d.cts +1 -1
- package/dist/edge.d.ts +1 -1
- package/dist/edge.js +1 -1
- package/dist/index.cjs +214 -143
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -18
- package/dist/index.d.ts +60 -18
- package/dist/index.js +93 -22
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkXLXOQZ3M_cjs = require('./chunk-XLXOQZ3M.cjs');
|
|
4
4
|
var chunkFXPB3NEJ_cjs = require('./chunk-FXPB3NEJ.cjs');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
var ethers = require('ethers');
|
|
@@ -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 = chunkXLXOQZ3M_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 ?? chunkXLXOQZ3M_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 = chunkXLXOQZ3M_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
|
+
[chunkXLXOQZ3M_cjs.HAVEN_CLIENT_HEADER]: this.clientIdentity
|
|
127
127
|
},
|
|
128
128
|
body: body ? JSON.stringify(body) : void 0,
|
|
129
129
|
signal: controller.signal
|
|
@@ -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 = chunkXLXOQZ3M_cjs.x402PaymentHeaderNamesFor(paymentHeader);
|
|
627
|
+
for (const name of chunkXLXOQZ3M_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 = chunkXLXOQZ3M_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 = chunkXLXOQZ3M_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 = chunkXLXOQZ3M_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 chunkXLXOQZ3M_cjs.encodeBase64Json(settlement);
|
|
767
767
|
}
|
|
768
768
|
function parseJsonRpcToolsCall(body) {
|
|
769
769
|
if (typeof body !== "string") return void 0;
|
|
@@ -849,22 +849,93 @@ function selectJsonRpcResult(messages) {
|
|
|
849
849
|
return messages.find((message) => "result" in message || "error" in message) ?? messages.at(-1);
|
|
850
850
|
}
|
|
851
851
|
var RECEIPT_VERSION = "haven-receipt-1";
|
|
852
|
+
var DELEGATION_MANAGER_CHAIN_IDS = /* @__PURE__ */ new Set([8453, 84532]);
|
|
853
|
+
var EIP712_DOMAIN_TYPEHASH = viem.keccak256(
|
|
854
|
+
viem.toBytes("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)")
|
|
855
|
+
);
|
|
856
|
+
function delegationDomainSeparator(chainId) {
|
|
857
|
+
return viem.keccak256(
|
|
858
|
+
viem.encodeAbiParameters(
|
|
859
|
+
[{ type: "bytes32" }, { type: "bytes32" }, { type: "bytes32" }, { type: "uint256" }, { type: "address" }],
|
|
860
|
+
[
|
|
861
|
+
EIP712_DOMAIN_TYPEHASH,
|
|
862
|
+
viem.keccak256(viem.toBytes("DelegationManager")),
|
|
863
|
+
viem.keccak256(viem.toBytes("1")),
|
|
864
|
+
BigInt(chainId),
|
|
865
|
+
chunkFXPB3NEJ_cjs.DELEGATION_MANAGER
|
|
866
|
+
]
|
|
867
|
+
)
|
|
868
|
+
);
|
|
869
|
+
}
|
|
870
|
+
function delegationDigest(structHash, chainId) {
|
|
871
|
+
return viem.keccak256(viem.concatHex(["0x1901", delegationDomainSeparator(chainId), structHash]));
|
|
872
|
+
}
|
|
852
873
|
function defaultRecover(hash, signature) {
|
|
853
874
|
return ethers.ethers.recoverAddress(hash, signature);
|
|
854
875
|
}
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
if (!signature) return { verified: false, reason: "missing_signature" };
|
|
876
|
+
var NOT_A_SIGNED_RECEIPT = { verified: false, reason: "not_a_signed_receipt" };
|
|
877
|
+
function match(delegate, hash, signature, recover) {
|
|
858
878
|
let recovered;
|
|
859
879
|
try {
|
|
860
|
-
recovered = recover(
|
|
880
|
+
recovered = recover(hash, signature);
|
|
861
881
|
} catch {
|
|
862
|
-
return {
|
|
882
|
+
return { ok: false, reason: "bad_signature" };
|
|
863
883
|
}
|
|
864
884
|
if (recovered.toLowerCase() !== delegate.toLowerCase()) {
|
|
865
|
-
return {
|
|
885
|
+
return { ok: false, reason: "signer_mismatch", recoveredSigner: recovered };
|
|
886
|
+
}
|
|
887
|
+
return { ok: true, recoveredSigner: recovered };
|
|
888
|
+
}
|
|
889
|
+
function finish(result, verifiedOver) {
|
|
890
|
+
if (result.ok) {
|
|
891
|
+
return { verified: true, recoveredSigner: result.recoveredSigner, verifiedOver };
|
|
892
|
+
}
|
|
893
|
+
return result.recoveredSigner !== void 0 ? { verified: false, reason: result.reason, recoveredSigner: result.recoveredSigner } : { verified: false, reason: result.reason };
|
|
894
|
+
}
|
|
895
|
+
function verifyPaymentReceipt(receipt, recover = defaultRecover) {
|
|
896
|
+
if (typeof receipt !== "object" || receipt === null) return NOT_A_SIGNED_RECEIPT;
|
|
897
|
+
const source = receipt;
|
|
898
|
+
if (typeof source.authorization !== "object" || source.authorization === null) {
|
|
899
|
+
return NOT_A_SIGNED_RECEIPT;
|
|
900
|
+
}
|
|
901
|
+
const auth = source.authorization;
|
|
902
|
+
const { delegate, signHash: signHash2, signature, signatureScheme } = auth;
|
|
903
|
+
if (typeof delegate !== "string" || delegate === "" || typeof signHash2 !== "string" || signHash2 === "") {
|
|
904
|
+
return NOT_A_SIGNED_RECEIPT;
|
|
905
|
+
}
|
|
906
|
+
if (typeof signature !== "string" || signature === "") {
|
|
907
|
+
return { verified: false, reason: "missing_signature" };
|
|
908
|
+
}
|
|
909
|
+
const chainId = typeof source.onChain?.chainId === "number" ? source.onChain.chainId : void 0;
|
|
910
|
+
const digestVerifiable = chainId !== void 0 && DELEGATION_MANAGER_CHAIN_IDS.has(chainId);
|
|
911
|
+
if (signatureScheme === "eip712_userop") {
|
|
912
|
+
return { verified: false, reason: "not_verifiable_offline" };
|
|
913
|
+
}
|
|
914
|
+
if (signatureScheme === "eip712_delegation") {
|
|
915
|
+
if (!digestVerifiable) {
|
|
916
|
+
return { verified: false, reason: "not_verifiable_offline" };
|
|
917
|
+
}
|
|
918
|
+
let digest;
|
|
919
|
+
try {
|
|
920
|
+
digest = delegationDigest(signHash2, chainId);
|
|
921
|
+
} catch {
|
|
922
|
+
return { verified: false, reason: "bad_signature" };
|
|
923
|
+
}
|
|
924
|
+
return finish(match(delegate, digest, signature, recover), "delegation_digest");
|
|
925
|
+
}
|
|
926
|
+
const raw = match(delegate, signHash2, signature, recover);
|
|
927
|
+
if (raw.ok) return finish(raw, "sign_hash");
|
|
928
|
+
if (digestVerifiable) {
|
|
929
|
+
let digest;
|
|
930
|
+
try {
|
|
931
|
+
digest = delegationDigest(signHash2, chainId);
|
|
932
|
+
} catch {
|
|
933
|
+
return finish(raw, "sign_hash");
|
|
934
|
+
}
|
|
935
|
+
const delegated = match(delegate, digest, signature, recover);
|
|
936
|
+
if (delegated.ok) return finish(delegated, "delegation_digest");
|
|
866
937
|
}
|
|
867
|
-
return
|
|
938
|
+
return finish(raw, "sign_hash");
|
|
868
939
|
}
|
|
869
940
|
|
|
870
941
|
// src/account-reads.ts
|
|
@@ -887,7 +958,7 @@ function deriveReadiness(status, allowances) {
|
|
|
887
958
|
return allowances.some((allowance) => safeBigInt(allowance.remainingAtomic) > 0n) ? "ready" : "needs_approval";
|
|
888
959
|
}
|
|
889
960
|
function formatRemainingDisplay(tokenAddress, tokenSymbol, remainingAtomic) {
|
|
890
|
-
const token =
|
|
961
|
+
const token = chunkXLXOQZ3M_cjs.resolveTokenFromAddress(tokenAddress);
|
|
891
962
|
return token ? `${formatAtomicAmount(safeBigInt(remainingAtomic), token.decimals)} ${tokenSymbol}` : `${remainingAtomic} ${tokenSymbol} (atomic; unknown decimals)`;
|
|
892
963
|
}
|
|
893
964
|
function formatTokenAmount(atomic, decimals) {
|
|
@@ -919,7 +990,7 @@ function mapTaskBudget(raw) {
|
|
|
919
990
|
};
|
|
920
991
|
}
|
|
921
992
|
function summarizeTaskBudget(taskBudget) {
|
|
922
|
-
const token =
|
|
993
|
+
const token = chunkXLXOQZ3M_cjs.resolveTokenFromAddress(taskBudget.tokenAddress);
|
|
923
994
|
const maxDisplay = token ? `${formatAtomicAmount(safeBigInt(taskBudget.maxAtomic), token.decimals)} ${token.symbol}` : `${taskBudget.maxAtomic} (atomic; unknown decimals)`;
|
|
924
995
|
return {
|
|
925
996
|
id: taskBudget.id,
|
|
@@ -1081,22 +1152,22 @@ var AccountReads = class {
|
|
|
1081
1152
|
try {
|
|
1082
1153
|
const tokenAddress = payment.asset ?? payment.x402?.asset ?? null;
|
|
1083
1154
|
if (!tokenAddress) return unavailable("the settled payment does not carry a resolvable token address", payment);
|
|
1084
|
-
const
|
|
1155
|
+
const match2 = allowanceResult.value.allowances.find(
|
|
1085
1156
|
(allowance) => allowance.tokenAddress.toLowerCase() === tokenAddress.toLowerCase()
|
|
1086
1157
|
);
|
|
1087
|
-
if (!
|
|
1088
|
-
const token =
|
|
1089
|
-
const remainingDisplay = token ? `${formatAtomicAmount(safeBigInt(
|
|
1158
|
+
if (!match2) return unavailable("no allowance/budget row matches the settled token", payment);
|
|
1159
|
+
const token = chunkXLXOQZ3M_cjs.resolveTokenFromAddress(match2.tokenAddress);
|
|
1160
|
+
const remainingDisplay = token ? `${formatAtomicAmount(safeBigInt(match2.onchain.remaining), token.decimals)} ${match2.tokenSymbol}` : void 0;
|
|
1090
1161
|
const rail = agentResult.value.executionRail;
|
|
1091
1162
|
return {
|
|
1092
1163
|
payment,
|
|
1093
1164
|
allowance: {
|
|
1094
1165
|
rail,
|
|
1095
|
-
remaining_atomic:
|
|
1166
|
+
remaining_atomic: match2.onchain.remaining,
|
|
1096
1167
|
...remainingDisplay ? { remaining_display: remainingDisplay } : {},
|
|
1097
|
-
token_symbol:
|
|
1098
|
-
token_address:
|
|
1099
|
-
reset_period:
|
|
1168
|
+
token_symbol: match2.tokenSymbol,
|
|
1169
|
+
token_address: match2.tokenAddress,
|
|
1170
|
+
reset_period: match2.resetPeriodMin,
|
|
1100
1171
|
source: rail === "delegation" ? "active_delegations" : "allowance_module"
|
|
1101
1172
|
},
|
|
1102
1173
|
warnings: []
|
|
@@ -1182,8 +1253,8 @@ var DelegateSweepApi = class {
|
|
|
1182
1253
|
const provider = createJsonRpcProvider(rpcUrl);
|
|
1183
1254
|
const wallet = createWallet(this.options.delegateKey, provider);
|
|
1184
1255
|
const transfers = [];
|
|
1185
|
-
if (
|
|
1186
|
-
const contract = createErc20Contract(
|
|
1256
|
+
if (chunkXLXOQZ3M_cjs.isSweepableChain(agent.chainId)) {
|
|
1257
|
+
const contract = createErc20Contract(chunkXLXOQZ3M_cjs.sweepUsdcAddress(agent.chainId), ["function balanceOf(address) view returns (uint256)", "function transfer(address to, uint256 amount) returns (bool)"], wallet);
|
|
1187
1258
|
const balance2 = await contract.balanceOf(agent.delegateAddress);
|
|
1188
1259
|
if (balance2 > 0n) {
|
|
1189
1260
|
const tx = await contract.transfer(agent.accountAddress, balance2);
|
|
@@ -1292,9 +1363,9 @@ function requestInitFromSnapshot(request) {
|
|
|
1292
1363
|
};
|
|
1293
1364
|
}
|
|
1294
1365
|
function noCompatiblePaymentOptionError(accepts) {
|
|
1295
|
-
const erc7710Only =
|
|
1366
|
+
const erc7710Only = chunkXLXOQZ3M_cjs.selectErc7710PaymentOption(accepts) !== null;
|
|
1296
1367
|
const unsupportedOnly = !erc7710Only && accepts.some(
|
|
1297
|
-
(opt) => opt !== null && typeof opt === "object" && !
|
|
1368
|
+
(opt) => opt !== null && typeof opt === "object" && !chunkXLXOQZ3M_cjs.isErc7710Option(opt) && (chunkXLXOQZ3M_cjs.x402AssetTransferMethod(opt) !== null || opt.extra?.paymentFlow !== void 0)
|
|
1298
1369
|
);
|
|
1299
1370
|
return new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1300
1371
|
"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." : ""),
|
|
@@ -1302,15 +1373,15 @@ function noCompatiblePaymentOptionError(accepts) {
|
|
|
1302
1373
|
);
|
|
1303
1374
|
}
|
|
1304
1375
|
function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport) {
|
|
1305
|
-
const standard =
|
|
1306
|
-
const option = standard ??
|
|
1376
|
+
const standard = chunkXLXOQZ3M_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
1377
|
+
const option = standard ?? chunkXLXOQZ3M_cjs.selectErc7710PaymentOption(paymentRequired.accepts);
|
|
1307
1378
|
if (!option) {
|
|
1308
1379
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
1309
1380
|
}
|
|
1310
|
-
const token =
|
|
1381
|
+
const token = chunkXLXOQZ3M_cjs.resolveTokenFromAddress(option.asset, option.network);
|
|
1311
1382
|
return {
|
|
1312
1383
|
rail: "x402",
|
|
1313
|
-
idempotencyKey: idempotencyKey ??
|
|
1384
|
+
idempotencyKey: idempotencyKey ?? chunkXLXOQZ3M_cjs.buildX402IdempotencyKey(paymentRequired, option),
|
|
1314
1385
|
paymentRequired,
|
|
1315
1386
|
accepted: option,
|
|
1316
1387
|
acceptedScheme: standard ? "standard" : "erc7710",
|
|
@@ -1324,8 +1395,8 @@ function buildX402Quote(paymentRequired, request, idempotencyKey, mcpTransport)
|
|
|
1324
1395
|
resourceUrlDiffersFromRequest: paymentRequired.resource.url !== request.url,
|
|
1325
1396
|
description: paymentRequired.resource.description ?? option.description ?? null,
|
|
1326
1397
|
mimeType: paymentRequired.resource.mimeType ?? option.mimeType ?? null,
|
|
1327
|
-
amountAtomic:
|
|
1328
|
-
amount: decimalFromUsdcAtomic(
|
|
1398
|
+
amountAtomic: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option),
|
|
1399
|
+
amount: decimalFromUsdcAtomic(chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)),
|
|
1329
1400
|
token: token?.symbol ?? "USDC",
|
|
1330
1401
|
// #1351: null when the asset is unrecognised on this network — the
|
|
1331
1402
|
// `token` fallback above is a LABEL, not evidence of 6 decimals, and a
|
|
@@ -1364,7 +1435,7 @@ function buildX402Receipt(input) {
|
|
|
1364
1435
|
payTo: input.merchantTo ?? input.accepted.payTo
|
|
1365
1436
|
},
|
|
1366
1437
|
x402: {
|
|
1367
|
-
amount:
|
|
1438
|
+
amount: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(input.accepted),
|
|
1368
1439
|
token: input.token,
|
|
1369
1440
|
network: input.accepted.network,
|
|
1370
1441
|
asset: input.accepted.asset,
|
|
@@ -1373,7 +1444,7 @@ function buildX402Receipt(input) {
|
|
|
1373
1444
|
};
|
|
1374
1445
|
}
|
|
1375
1446
|
function buildX402ResumeState(input) {
|
|
1376
|
-
const token =
|
|
1447
|
+
const token = chunkXLXOQZ3M_cjs.resolveTokenFromAddress(input.accepted.asset, input.accepted.network);
|
|
1377
1448
|
return {
|
|
1378
1449
|
rail: "x402",
|
|
1379
1450
|
paymentId: input.paymentId,
|
|
@@ -1384,8 +1455,8 @@ function buildX402ResumeState(input) {
|
|
|
1384
1455
|
request: input.request,
|
|
1385
1456
|
resourceUrl: input.paymentRequired.resource.url,
|
|
1386
1457
|
description: input.paymentRequired.resource.description ?? input.accepted.description ?? null,
|
|
1387
|
-
amountAtomic:
|
|
1388
|
-
amount: decimalFromUsdcAtomic(
|
|
1458
|
+
amountAtomic: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(input.accepted),
|
|
1459
|
+
amount: decimalFromUsdcAtomic(chunkXLXOQZ3M_cjs.x402AuthorizationAmount(input.accepted)),
|
|
1389
1460
|
token: token?.symbol ?? "USDC",
|
|
1390
1461
|
asset: input.accepted.asset,
|
|
1391
1462
|
network: input.accepted.network,
|
|
@@ -1466,7 +1537,7 @@ function assertCanResumeX402(status, paymentRequired, option) {
|
|
|
1466
1537
|
);
|
|
1467
1538
|
}
|
|
1468
1539
|
const approvedAmount = status.amount ? normalizeDecimal(status.amount) : "";
|
|
1469
|
-
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(
|
|
1540
|
+
const requestedAmount = normalizeDecimal(decimalFromUsdcAtomic(chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)));
|
|
1470
1541
|
if (approvedAmount && approvedAmount !== requestedAmount) {
|
|
1471
1542
|
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1472
1543
|
"x402 resume request does not match the approved amount.",
|
|
@@ -1544,7 +1615,7 @@ var X402FundingLeg = class {
|
|
|
1544
1615
|
url: paymentRequired.resource.url,
|
|
1545
1616
|
payTo: this.delegateAddress,
|
|
1546
1617
|
merchantPayTo: option.payTo,
|
|
1547
|
-
amount:
|
|
1618
|
+
amount: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option),
|
|
1548
1619
|
asset: option.asset,
|
|
1549
1620
|
network: option.network,
|
|
1550
1621
|
description: paymentRequired.resource.description,
|
|
@@ -1563,7 +1634,7 @@ var X402FundingLeg = class {
|
|
|
1563
1634
|
const canFund = await this.delegateCanFund(
|
|
1564
1635
|
raw.chain_id ?? state?.chainId ?? chainIdFromNetwork(option.network),
|
|
1565
1636
|
option.asset,
|
|
1566
|
-
|
|
1637
|
+
chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)
|
|
1567
1638
|
);
|
|
1568
1639
|
const refuse = executedReplay === "idempotency-collision" ? canFund !== true : canFund === false;
|
|
1569
1640
|
if (refuse) {
|
|
@@ -1592,7 +1663,7 @@ var X402FundingLeg = class {
|
|
|
1592
1663
|
}
|
|
1593
1664
|
const sig = await this.signForData(raw.sign_data, {
|
|
1594
1665
|
asset: option.asset,
|
|
1595
|
-
amount:
|
|
1666
|
+
amount: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)
|
|
1596
1667
|
});
|
|
1597
1668
|
const execResult = await this.post(
|
|
1598
1669
|
`/payments/${raw.payment_id}/sign`,
|
|
@@ -1615,22 +1686,22 @@ var X402FundingLeg = class {
|
|
|
1615
1686
|
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateKey is required to sign x402 payment headers.");
|
|
1616
1687
|
}
|
|
1617
1688
|
const account = accounts.privateKeyToAccount(this.delegateKey);
|
|
1618
|
-
const requirements =
|
|
1689
|
+
const requirements = chunkXLXOQZ3M_cjs.toStandardPaymentRequirements(paymentRequired, option);
|
|
1619
1690
|
const header = await schemes.exact.evm.createPaymentHeader(
|
|
1620
1691
|
account,
|
|
1621
1692
|
paymentRequired.x402Version,
|
|
1622
1693
|
requirements
|
|
1623
1694
|
);
|
|
1624
1695
|
if (paymentRequired.x402Version < 2) return header;
|
|
1625
|
-
const payment =
|
|
1626
|
-
return
|
|
1696
|
+
const payment = chunkXLXOQZ3M_cjs.decodeBase64Json(header);
|
|
1697
|
+
return chunkXLXOQZ3M_cjs.encodeBase64Json(chunkXLXOQZ3M_cjs.x402V2PaymentEnvelope(paymentRequired, option, payment.payload));
|
|
1627
1698
|
}
|
|
1628
1699
|
// ── Receipt mapping ──────────────────────────────────────────────
|
|
1629
1700
|
receiptFromAuthorization(paymentRequired, option, paymentHeader, raw, execResult) {
|
|
1630
1701
|
const txHash = execResult?.tx_hash ?? raw.tx_hash ?? "";
|
|
1631
1702
|
const chainId = execResult?.chain_id ?? raw.chain_id ?? chainIdFromNetwork(option.network);
|
|
1632
1703
|
const token = execResult?.token ?? raw.token ?? "USDC";
|
|
1633
|
-
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(
|
|
1704
|
+
const amount = execResult?.amount ?? raw.amount ?? decimalFromUsdcAtomic(chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option));
|
|
1634
1705
|
const to = execResult?.to ?? raw.to ?? this.delegateAddress ?? "";
|
|
1635
1706
|
const explorerUrl = execResult?.explorer_url ?? raw.explorer_url ?? explorerUrlOrEmpty(chainId, txHash);
|
|
1636
1707
|
const merchantTo = execResult?.merchant_to ?? raw.merchant_to ?? option.payTo;
|
|
@@ -1663,7 +1734,7 @@ var X402FundingLeg = class {
|
|
|
1663
1734
|
paymentId: status.paymentId,
|
|
1664
1735
|
txHash: status.txHash,
|
|
1665
1736
|
token: status.token || "USDC",
|
|
1666
|
-
amount: status.amount || decimalFromUsdcAtomic(
|
|
1737
|
+
amount: status.amount || decimalFromUsdcAtomic(chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)),
|
|
1667
1738
|
to: this.delegateAddress ?? "",
|
|
1668
1739
|
resourceUrl: paymentRequired.resource.url,
|
|
1669
1740
|
explorerUrl: explorerUrlOrEmpty(status.chainId, status.txHash),
|
|
@@ -1740,7 +1811,7 @@ var X402FundingLeg = class {
|
|
|
1740
1811
|
};
|
|
1741
1812
|
function getPaymentHeaderValidBefore(paymentHeader) {
|
|
1742
1813
|
try {
|
|
1743
|
-
const payment =
|
|
1814
|
+
const payment = chunkXLXOQZ3M_cjs.decodeBase64Json(
|
|
1744
1815
|
paymentHeader
|
|
1745
1816
|
);
|
|
1746
1817
|
const payload = payment.payload;
|
|
@@ -1825,7 +1896,7 @@ var X402Erc7710 = class {
|
|
|
1825
1896
|
400
|
|
1826
1897
|
);
|
|
1827
1898
|
}
|
|
1828
|
-
const selection =
|
|
1899
|
+
const selection = chunkXLXOQZ3M_cjs.selectX402SettlementScheme(paymentRequired.accepts, { delegationRail });
|
|
1829
1900
|
if (!selection || selection.scheme !== "erc7710") {
|
|
1830
1901
|
throw new chunkFXPB3NEJ_cjs.HavenApiError(
|
|
1831
1902
|
"This merchant does not advertise an erc7710 settlement option (no accepts[] entry carries extra.assetTransferMethod: 'erc7710'). Use authorizeX402() for the standard EIP-3009 path.",
|
|
@@ -1834,7 +1905,7 @@ var X402Erc7710 = class {
|
|
|
1834
1905
|
}
|
|
1835
1906
|
const option = selection.option;
|
|
1836
1907
|
const merchantPayTo = option.payTo;
|
|
1837
|
-
const amountAtomic =
|
|
1908
|
+
const amountAtomic = chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option);
|
|
1838
1909
|
const raw = await this.post("/x402", {
|
|
1839
1910
|
url: options.resourceUrl ?? paymentRequired.resource?.url,
|
|
1840
1911
|
// #2373: the full 402 challenge, persisted verbatim by the backend
|
|
@@ -2130,7 +2201,7 @@ var MerchantCompletion = class {
|
|
|
2130
2201
|
merchantStatus: retryResponse.status,
|
|
2131
2202
|
challengePayload: paymentRequired,
|
|
2132
2203
|
selectedPayment: receipt.accepted,
|
|
2133
|
-
paymentProofHeaderName:
|
|
2204
|
+
paymentProofHeaderName: chunkXLXOQZ3M_cjs.x402PaymentHeaderNamesSent(receipt.paymentHeader),
|
|
2134
2205
|
paymentProofHeader: receipt.paymentHeader,
|
|
2135
2206
|
protocolReceiptHeaderName,
|
|
2136
2207
|
protocolReceiptHeader
|
|
@@ -2420,7 +2491,7 @@ function parseMerchantSettlement(header) {
|
|
|
2420
2491
|
}
|
|
2421
2492
|
function parseProtocolReceiptHeader(value) {
|
|
2422
2493
|
try {
|
|
2423
|
-
return
|
|
2494
|
+
return chunkXLXOQZ3M_cjs.decodeBase64Json(value);
|
|
2424
2495
|
} catch {
|
|
2425
2496
|
try {
|
|
2426
2497
|
return JSON.parse(value);
|
|
@@ -2645,7 +2716,7 @@ var HavenClient = class {
|
|
|
2645
2716
|
* on-chain allowance — there is nothing to sign until the user approves.
|
|
2646
2717
|
*/
|
|
2647
2718
|
async createX402Intent(paymentRequired, options = {}) {
|
|
2648
|
-
const option =
|
|
2719
|
+
const option = chunkXLXOQZ3M_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
2649
2720
|
if (!option) {
|
|
2650
2721
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
2651
2722
|
}
|
|
@@ -2653,7 +2724,7 @@ var HavenClient = class {
|
|
|
2653
2724
|
if (!fundingTo) {
|
|
2654
2725
|
throw new chunkFXPB3NEJ_cjs.HavenApiError("Authenticated agent has no delegate address registered.", 502);
|
|
2655
2726
|
}
|
|
2656
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
2727
|
+
const idempotencyKey = options.idempotencyKey ?? chunkXLXOQZ3M_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
2657
2728
|
const raw = await this.post("/x402", {
|
|
2658
2729
|
url: paymentRequired.resource.url,
|
|
2659
2730
|
payTo: fundingTo,
|
|
@@ -2664,7 +2735,7 @@ var HavenClient = class {
|
|
|
2664
2735
|
// of a silent reroute to the erc7710 settlement branch (the #1358
|
|
2665
2736
|
// review's open-budget misroute). Legacy-rail backends ignore the field.
|
|
2666
2737
|
settlementScheme: "eip3009",
|
|
2667
|
-
amount:
|
|
2738
|
+
amount: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option),
|
|
2668
2739
|
asset: option.asset,
|
|
2669
2740
|
network: option.network,
|
|
2670
2741
|
description: paymentRequired.resource.description,
|
|
@@ -2705,7 +2776,7 @@ var HavenClient = class {
|
|
|
2705
2776
|
accepted: option,
|
|
2706
2777
|
resourceUrl: paymentRequired.resource.url,
|
|
2707
2778
|
merchantTo: raw.merchant_to ?? option.payTo,
|
|
2708
|
-
amountAtomic:
|
|
2779
|
+
amountAtomic: chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option),
|
|
2709
2780
|
asset: option.asset,
|
|
2710
2781
|
network: option.network,
|
|
2711
2782
|
expectedAuth: raw.x402_expected_auth,
|
|
@@ -2771,12 +2842,12 @@ var HavenClient = class {
|
|
|
2771
2842
|
);
|
|
2772
2843
|
}
|
|
2773
2844
|
chunkFXPB3NEJ_cjs.assertUserOpTypedDataBinding(signData.typed_data, signData.hash);
|
|
2774
|
-
|
|
2845
|
+
chunkXLXOQZ3M_cjs.assertBoundDirectPaymentUserOp(
|
|
2775
2846
|
signData.typed_data,
|
|
2776
2847
|
this.delegateAddress
|
|
2777
2848
|
);
|
|
2778
2849
|
if (fundingExpectation) {
|
|
2779
|
-
|
|
2850
|
+
chunkXLXOQZ3M_cjs.assertFundingLegPaysDelegate(signData.typed_data, {
|
|
2780
2851
|
delegateAddress: this.delegateAddress,
|
|
2781
2852
|
asset: fundingExpectation.asset,
|
|
2782
2853
|
amount: fundingExpectation.amount
|
|
@@ -2791,11 +2862,11 @@ var HavenClient = class {
|
|
|
2791
2862
|
);
|
|
2792
2863
|
}
|
|
2793
2864
|
if (!settlementExpectation) {
|
|
2794
|
-
throw new
|
|
2865
|
+
throw new chunkXLXOQZ3M_cjs.HavenTypedDataRefusedError(
|
|
2795
2866
|
"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."
|
|
2796
2867
|
);
|
|
2797
2868
|
}
|
|
2798
|
-
|
|
2869
|
+
chunkXLXOQZ3M_cjs.assertOwnSettlementChild(signData.typed_data, settlementExpectation, this.delegateAddress);
|
|
2799
2870
|
return signSettlementDelegationTypedData(this.delegateKey, signData.typed_data);
|
|
2800
2871
|
}
|
|
2801
2872
|
if (scheme === void 0) {
|
|
@@ -3206,11 +3277,11 @@ var HavenClient = class {
|
|
|
3206
3277
|
if (!this.delegateAddress) {
|
|
3207
3278
|
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
3208
3279
|
}
|
|
3209
|
-
const option =
|
|
3280
|
+
const option = chunkXLXOQZ3M_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
3210
3281
|
if (!option) {
|
|
3211
3282
|
throw noCompatiblePaymentOptionError(paymentRequired.accepts);
|
|
3212
3283
|
}
|
|
3213
|
-
const idempotencyKey = options.idempotencyKey ??
|
|
3284
|
+
const idempotencyKey = options.idempotencyKey ?? chunkXLXOQZ3M_cjs.buildX402IdempotencyKey(paymentRequired, option);
|
|
3214
3285
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, options.taskBudgetId);
|
|
3215
3286
|
if (cached) return cached;
|
|
3216
3287
|
const inFlight = this.inFlightX402.get(idempotencyKey);
|
|
@@ -3271,7 +3342,7 @@ var HavenClient = class {
|
|
|
3271
3342
|
if (response.headers.get("MACHINE-PAYMENT-CHALLENGE")) {
|
|
3272
3343
|
throw new chunkFXPB3NEJ_cjs.HavenApiError("quoteX402 only supports standard x402 Payment Required responses.", 400);
|
|
3273
3344
|
}
|
|
3274
|
-
const paymentRequired = await
|
|
3345
|
+
const paymentRequired = await chunkXLXOQZ3M_cjs.parsePaymentRequiredResponse(response);
|
|
3275
3346
|
const mcpTransport = await this.merchantTransport.detect(url, paymentRequired, response);
|
|
3276
3347
|
return buildX402Quote(paymentRequired, request, options.idempotencyKey, mcpTransport);
|
|
3277
3348
|
}
|
|
@@ -3370,11 +3441,11 @@ var HavenClient = class {
|
|
|
3370
3441
|
if (!this.delegateAddress) {
|
|
3371
3442
|
throw new chunkFXPB3NEJ_cjs.HavenSigningError("delegateAddress could not be derived from delegateKey.");
|
|
3372
3443
|
}
|
|
3373
|
-
const option =
|
|
3444
|
+
const option = chunkXLXOQZ3M_cjs.selectStandardPaymentOption(input.paymentRequired.accepts);
|
|
3374
3445
|
if (!option) {
|
|
3375
3446
|
throw noCompatiblePaymentOptionError(input.paymentRequired.accepts);
|
|
3376
3447
|
}
|
|
3377
|
-
const idempotencyKey = input.idempotencyKey ??
|
|
3448
|
+
const idempotencyKey = input.idempotencyKey ?? chunkXLXOQZ3M_cjs.buildX402IdempotencyKey(input.paymentRequired, option);
|
|
3378
3449
|
const cached = this.fundingLeg.cachedReceipt(idempotencyKey, input.taskBudgetId);
|
|
3379
3450
|
if (cached) return cached;
|
|
3380
3451
|
const status = await this.getPaymentStatus(input.paymentId);
|
|
@@ -3382,7 +3453,7 @@ var HavenClient = class {
|
|
|
3382
3453
|
const canFund = await this.fundingLeg.delegateCanFund(
|
|
3383
3454
|
status.chainId ?? chainIdFromNetwork(option.network),
|
|
3384
3455
|
option.asset,
|
|
3385
|
-
|
|
3456
|
+
chunkXLXOQZ3M_cjs.x402AuthorizationAmount(option)
|
|
3386
3457
|
);
|
|
3387
3458
|
if (canFund === false) {
|
|
3388
3459
|
throw new chunkFXPB3NEJ_cjs.X402AlreadySettledError(
|
|
@@ -3412,7 +3483,7 @@ var HavenClient = class {
|
|
|
3412
3483
|
if (response.status !== 402) {
|
|
3413
3484
|
throw new chunkFXPB3NEJ_cjs.HavenApiError("Expected the original x402 request to return HTTP 402 before resuming.", 400);
|
|
3414
3485
|
}
|
|
3415
|
-
paymentRequired = await
|
|
3486
|
+
paymentRequired = await chunkXLXOQZ3M_cjs.parsePaymentRequiredResponse(response);
|
|
3416
3487
|
}
|
|
3417
3488
|
const receipt = await this.resumeAuthorizedX402({
|
|
3418
3489
|
paymentId: input.paymentId,
|
|
@@ -3465,7 +3536,7 @@ var HavenClient = class {
|
|
|
3465
3536
|
nativeChallenge = true;
|
|
3466
3537
|
} else {
|
|
3467
3538
|
try {
|
|
3468
|
-
paymentRequired = await
|
|
3539
|
+
paymentRequired = await chunkXLXOQZ3M_cjs.parsePaymentRequiredResponse(response);
|
|
3469
3540
|
} catch {
|
|
3470
3541
|
return response;
|
|
3471
3542
|
}
|
|
@@ -3475,8 +3546,8 @@ var HavenClient = class {
|
|
|
3475
3546
|
if (mcpSessionId) requestInit = this.merchantTransport.withSessionHeaders(requestInit, mcpSessionId);
|
|
3476
3547
|
}
|
|
3477
3548
|
const request = snapshotX402Request(url, requestInit);
|
|
3478
|
-
const option =
|
|
3479
|
-
const idempotencyKey = options.idempotencyKey ?? (option ?
|
|
3549
|
+
const option = chunkXLXOQZ3M_cjs.selectStandardPaymentOption(paymentRequired.accepts);
|
|
3550
|
+
const idempotencyKey = options.idempotencyKey ?? (option ? chunkXLXOQZ3M_cjs.buildX402IdempotencyKey(paymentRequired, option) : void 0);
|
|
3480
3551
|
let receipt;
|
|
3481
3552
|
try {
|
|
3482
3553
|
receipt = await this.authorizeX402(paymentRequired, options);
|
|
@@ -3603,7 +3674,7 @@ var HavenClient = class {
|
|
|
3603
3674
|
txHash: evidenceTxHash,
|
|
3604
3675
|
resourceUrl: evidenceContext.resourceUrl,
|
|
3605
3676
|
merchantStatus: surfaced.status,
|
|
3606
|
-
paymentProofHeaderName:
|
|
3677
|
+
paymentProofHeaderName: chunkXLXOQZ3M_cjs.x402PaymentHeaderNamesSent(input.paymentHeader),
|
|
3607
3678
|
paymentProofHeader: input.paymentHeader,
|
|
3608
3679
|
protocolReceiptHeaderName,
|
|
3609
3680
|
protocolReceiptHeader
|
|
@@ -3855,9 +3926,9 @@ var toolDescriptions = {
|
|
|
3855
3926
|
nextActionGuidance: ""
|
|
3856
3927
|
},
|
|
3857
3928
|
verifyReceipt: {
|
|
3858
|
-
summary: "Verify a payment receipt offline \u2014 confirm the agent
|
|
3859
|
-
selectionGuidance: "
|
|
3860
|
-
behavior: "
|
|
3929
|
+
summary: "Verify a signed payment receipt offline \u2014 confirm the agent delegate signed its authorisation.",
|
|
3930
|
+
selectionGuidance: "Takes the signed bundle from GET /payments/{id}/receipt, not a haven_list_receipts row \u2014 a row carries no signature and returns not_a_signed_receipt. No network.",
|
|
3931
|
+
behavior: "Never throws. An erc7710 bundle verifies over the delegation digest the delegate signed; a direct or eip3009 bundle returns not_verifiable_offline. verified true means only that the delegate signed the hash named by verifiedOver \u2014 payment facts are Haven-asserted and settlement is not proven; check settlementTxHash on an explorer.",
|
|
3861
3932
|
nextActionGuidance: ""
|
|
3862
3933
|
},
|
|
3863
3934
|
payMcpTool: {
|
|
@@ -4604,263 +4675,263 @@ function sameUrl(a, b) {
|
|
|
4604
4675
|
|
|
4605
4676
|
Object.defineProperty(exports, "DEFAULT_NEXT_TOOL_BY_ACTION", {
|
|
4606
4677
|
enumerable: true,
|
|
4607
|
-
get: function () { return
|
|
4678
|
+
get: function () { return chunkXLXOQZ3M_cjs.DEFAULT_NEXT_TOOL_BY_ACTION; }
|
|
4608
4679
|
});
|
|
4609
4680
|
Object.defineProperty(exports, "ERC7710_ASSET_TRANSFER_METHOD", {
|
|
4610
4681
|
enumerable: true,
|
|
4611
|
-
get: function () { return
|
|
4682
|
+
get: function () { return chunkXLXOQZ3M_cjs.ERC7710_ASSET_TRANSFER_METHOD; }
|
|
4612
4683
|
});
|
|
4613
4684
|
Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
|
|
4614
4685
|
enumerable: true,
|
|
4615
|
-
get: function () { return
|
|
4686
|
+
get: function () { return chunkXLXOQZ3M_cjs.HAVEN_CLIENT_HEADER; }
|
|
4616
4687
|
});
|
|
4617
4688
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
4618
4689
|
enumerable: true,
|
|
4619
|
-
get: function () { return
|
|
4690
|
+
get: function () { return chunkXLXOQZ3M_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
4620
4691
|
});
|
|
4621
4692
|
Object.defineProperty(exports, "HavenTypedDataRefusedError", {
|
|
4622
4693
|
enumerable: true,
|
|
4623
|
-
get: function () { return
|
|
4694
|
+
get: function () { return chunkXLXOQZ3M_cjs.HavenTypedDataRefusedError; }
|
|
4624
4695
|
});
|
|
4625
4696
|
Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
|
|
4626
4697
|
enumerable: true,
|
|
4627
|
-
get: function () { return
|
|
4698
|
+
get: function () { return chunkXLXOQZ3M_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
|
|
4628
4699
|
});
|
|
4629
4700
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_NAMES", {
|
|
4630
4701
|
enumerable: true,
|
|
4631
|
-
get: function () { return
|
|
4702
|
+
get: function () { return chunkXLXOQZ3M_cjs.NEXT_TOOL_SERVER_NAMES; }
|
|
4632
4703
|
});
|
|
4633
4704
|
Object.defineProperty(exports, "NEXT_TOOL_SERVER_ROLES", {
|
|
4634
4705
|
enumerable: true,
|
|
4635
|
-
get: function () { return
|
|
4706
|
+
get: function () { return chunkXLXOQZ3M_cjs.NEXT_TOOL_SERVER_ROLES; }
|
|
4636
4707
|
});
|
|
4637
4708
|
Object.defineProperty(exports, "SDK_CLIENT_IDENTITY", {
|
|
4638
4709
|
enumerable: true,
|
|
4639
|
-
get: function () { return
|
|
4710
|
+
get: function () { return chunkXLXOQZ3M_cjs.SDK_CLIENT_IDENTITY; }
|
|
4640
4711
|
});
|
|
4641
4712
|
Object.defineProperty(exports, "SDK_VERSION", {
|
|
4642
4713
|
enumerable: true,
|
|
4643
|
-
get: function () { return
|
|
4714
|
+
get: function () { return chunkXLXOQZ3M_cjs.SDK_VERSION; }
|
|
4644
4715
|
});
|
|
4645
4716
|
Object.defineProperty(exports, "SWEEP_BASE_CHAIN_ID", {
|
|
4646
4717
|
enumerable: true,
|
|
4647
|
-
get: function () { return
|
|
4718
|
+
get: function () { return chunkXLXOQZ3M_cjs.SWEEP_BASE_CHAIN_ID; }
|
|
4648
4719
|
});
|
|
4649
4720
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_CHAIN_ID", {
|
|
4650
4721
|
enumerable: true,
|
|
4651
|
-
get: function () { return
|
|
4722
|
+
get: function () { return chunkXLXOQZ3M_cjs.SWEEP_BASE_SEPOLIA_CHAIN_ID; }
|
|
4652
4723
|
});
|
|
4653
4724
|
Object.defineProperty(exports, "SWEEP_BASE_SEPOLIA_USDC_ADDRESS", {
|
|
4654
4725
|
enumerable: true,
|
|
4655
|
-
get: function () { return
|
|
4726
|
+
get: function () { return chunkXLXOQZ3M_cjs.SWEEP_BASE_SEPOLIA_USDC_ADDRESS; }
|
|
4656
4727
|
});
|
|
4657
4728
|
Object.defineProperty(exports, "SWEEP_BASE_USDC_ADDRESS", {
|
|
4658
4729
|
enumerable: true,
|
|
4659
|
-
get: function () { return
|
|
4730
|
+
get: function () { return chunkXLXOQZ3M_cjs.SWEEP_BASE_USDC_ADDRESS; }
|
|
4660
4731
|
});
|
|
4661
4732
|
Object.defineProperty(exports, "TRANSFER_WITH_AUTHORIZATION_TYPES", {
|
|
4662
4733
|
enumerable: true,
|
|
4663
|
-
get: function () { return
|
|
4734
|
+
get: function () { return chunkXLXOQZ3M_cjs.TRANSFER_WITH_AUTHORIZATION_TYPES; }
|
|
4664
4735
|
});
|
|
4665
4736
|
Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
|
|
4666
4737
|
enumerable: true,
|
|
4667
|
-
get: function () { return
|
|
4738
|
+
get: function () { return chunkXLXOQZ3M_cjs.TYPED_DATA_NOT_ALLOWED; }
|
|
4668
4739
|
});
|
|
4669
4740
|
Object.defineProperty(exports, "X402PaymentHeaderValidationError", {
|
|
4670
4741
|
enumerable: true,
|
|
4671
|
-
get: function () { return
|
|
4742
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402PaymentHeaderValidationError; }
|
|
4672
4743
|
});
|
|
4673
4744
|
Object.defineProperty(exports, "X402_LEGACY_PAYMENT_HEADER_NAME", {
|
|
4674
4745
|
enumerable: true,
|
|
4675
|
-
get: function () { return
|
|
4746
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_LEGACY_PAYMENT_HEADER_NAME; }
|
|
4676
4747
|
});
|
|
4677
4748
|
Object.defineProperty(exports, "X402_MAX_AUTHORIZATION_WINDOW_SECONDS", {
|
|
4678
4749
|
enumerable: true,
|
|
4679
|
-
get: function () { return
|
|
4750
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_MAX_AUTHORIZATION_WINDOW_SECONDS; }
|
|
4680
4751
|
});
|
|
4681
4752
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAME", {
|
|
4682
4753
|
enumerable: true,
|
|
4683
|
-
get: function () { return
|
|
4754
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_PAYMENT_HEADER_NAME; }
|
|
4684
4755
|
});
|
|
4685
4756
|
Object.defineProperty(exports, "X402_PAYMENT_HEADER_NAMES_SENT", {
|
|
4686
4757
|
enumerable: true,
|
|
4687
|
-
get: function () { return
|
|
4758
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_PAYMENT_HEADER_NAMES_SENT; }
|
|
4688
4759
|
});
|
|
4689
4760
|
Object.defineProperty(exports, "X402_PAYMENT_REQUIRED_HEADER_NAME", {
|
|
4690
4761
|
enumerable: true,
|
|
4691
|
-
get: function () { return
|
|
4762
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_PAYMENT_REQUIRED_HEADER_NAME; }
|
|
4692
4763
|
});
|
|
4693
4764
|
Object.defineProperty(exports, "X402_PAYMENT_RESPONSE_HEADER_NAME", {
|
|
4694
4765
|
enumerable: true,
|
|
4695
|
-
get: function () { return
|
|
4766
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_PAYMENT_RESPONSE_HEADER_NAME; }
|
|
4696
4767
|
});
|
|
4697
4768
|
Object.defineProperty(exports, "X402_SETTLEMENT_FORWARD_MARGIN_SECONDS", {
|
|
4698
4769
|
enumerable: true,
|
|
4699
|
-
get: function () { return
|
|
4770
|
+
get: function () { return chunkXLXOQZ3M_cjs.X402_SETTLEMENT_FORWARD_MARGIN_SECONDS; }
|
|
4700
4771
|
});
|
|
4701
4772
|
Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
|
|
4702
4773
|
enumerable: true,
|
|
4703
|
-
get: function () { return
|
|
4774
|
+
get: function () { return chunkXLXOQZ3M_cjs.assertBoundDirectPaymentUserOp; }
|
|
4704
4775
|
});
|
|
4705
4776
|
Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
|
|
4706
4777
|
enumerable: true,
|
|
4707
|
-
get: function () { return
|
|
4778
|
+
get: function () { return chunkXLXOQZ3M_cjs.assertOwnTaskBudgetCloseUserOp; }
|
|
4708
4779
|
});
|
|
4709
4780
|
Object.defineProperty(exports, "assertOwnTaskChild", {
|
|
4710
4781
|
enumerable: true,
|
|
4711
|
-
get: function () { return
|
|
4782
|
+
get: function () { return chunkXLXOQZ3M_cjs.assertOwnTaskChild; }
|
|
4712
4783
|
});
|
|
4713
4784
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
4714
4785
|
enumerable: true,
|
|
4715
|
-
get: function () { return
|
|
4786
|
+
get: function () { return chunkXLXOQZ3M_cjs.buildSweepAuthorizationMessage; }
|
|
4716
4787
|
});
|
|
4717
4788
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
4718
4789
|
enumerable: true,
|
|
4719
|
-
get: function () { return
|
|
4790
|
+
get: function () { return chunkXLXOQZ3M_cjs.buildSweepTypedData; }
|
|
4720
4791
|
});
|
|
4721
4792
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
4722
4793
|
enumerable: true,
|
|
4723
|
-
get: function () { return
|
|
4794
|
+
get: function () { return chunkXLXOQZ3M_cjs.buildX402ExpectedMessage; }
|
|
4724
4795
|
});
|
|
4725
4796
|
Object.defineProperty(exports, "compareNodeVersions", {
|
|
4726
4797
|
enumerable: true,
|
|
4727
|
-
get: function () { return
|
|
4798
|
+
get: function () { return chunkXLXOQZ3M_cjs.compareNodeVersions; }
|
|
4728
4799
|
});
|
|
4729
4800
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
4730
4801
|
enumerable: true,
|
|
4731
|
-
get: function () { return
|
|
4802
|
+
get: function () { return chunkXLXOQZ3M_cjs.createNextStepBuilder; }
|
|
4732
4803
|
});
|
|
4733
4804
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
4734
4805
|
enumerable: true,
|
|
4735
|
-
get: function () { return
|
|
4806
|
+
get: function () { return chunkXLXOQZ3M_cjs.decodeBase64Json; }
|
|
4736
4807
|
});
|
|
4737
4808
|
Object.defineProperty(exports, "decodeBase64Utf8", {
|
|
4738
4809
|
enumerable: true,
|
|
4739
|
-
get: function () { return
|
|
4810
|
+
get: function () { return chunkXLXOQZ3M_cjs.decodeBase64Utf8; }
|
|
4740
4811
|
});
|
|
4741
4812
|
Object.defineProperty(exports, "defaultNextToolFor", {
|
|
4742
4813
|
enumerable: true,
|
|
4743
|
-
get: function () { return
|
|
4814
|
+
get: function () { return chunkXLXOQZ3M_cjs.defaultNextToolFor; }
|
|
4744
4815
|
});
|
|
4745
4816
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
4746
4817
|
enumerable: true,
|
|
4747
|
-
get: function () { return
|
|
4818
|
+
get: function () { return chunkXLXOQZ3M_cjs.encodeBase64Json; }
|
|
4748
4819
|
});
|
|
4749
4820
|
Object.defineProperty(exports, "encodeBase64Utf8", {
|
|
4750
4821
|
enumerable: true,
|
|
4751
|
-
get: function () { return
|
|
4822
|
+
get: function () { return chunkXLXOQZ3M_cjs.encodeBase64Utf8; }
|
|
4752
4823
|
});
|
|
4753
4824
|
Object.defineProperty(exports, "encodePaymentProof", {
|
|
4754
4825
|
enumerable: true,
|
|
4755
|
-
get: function () { return
|
|
4826
|
+
get: function () { return chunkXLXOQZ3M_cjs.encodePaymentProof; }
|
|
4756
4827
|
});
|
|
4757
4828
|
Object.defineProperty(exports, "hashDelegation", {
|
|
4758
4829
|
enumerable: true,
|
|
4759
|
-
get: function () { return
|
|
4830
|
+
get: function () { return chunkXLXOQZ3M_cjs.hashDelegation; }
|
|
4760
4831
|
});
|
|
4761
4832
|
Object.defineProperty(exports, "havenClientIdentity", {
|
|
4762
4833
|
enumerable: true,
|
|
4763
|
-
get: function () { return
|
|
4834
|
+
get: function () { return chunkXLXOQZ3M_cjs.havenClientIdentity; }
|
|
4764
4835
|
});
|
|
4765
4836
|
Object.defineProperty(exports, "isErc7710Option", {
|
|
4766
4837
|
enumerable: true,
|
|
4767
|
-
get: function () { return
|
|
4838
|
+
get: function () { return chunkXLXOQZ3M_cjs.isErc7710Option; }
|
|
4768
4839
|
});
|
|
4769
4840
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
4770
4841
|
enumerable: true,
|
|
4771
|
-
get: function () { return
|
|
4842
|
+
get: function () { return chunkXLXOQZ3M_cjs.isSupportedNodeVersion; }
|
|
4772
4843
|
});
|
|
4773
4844
|
Object.defineProperty(exports, "isSweepableChain", {
|
|
4774
4845
|
enumerable: true,
|
|
4775
|
-
get: function () { return
|
|
4846
|
+
get: function () { return chunkXLXOQZ3M_cjs.isSweepableChain; }
|
|
4776
4847
|
});
|
|
4777
4848
|
Object.defineProperty(exports, "isTaskChildTypedData", {
|
|
4778
4849
|
enumerable: true,
|
|
4779
|
-
get: function () { return
|
|
4850
|
+
get: function () { return chunkXLXOQZ3M_cjs.isTaskChildTypedData; }
|
|
4780
4851
|
});
|
|
4781
4852
|
Object.defineProperty(exports, "normalizePaymentRequired", {
|
|
4782
4853
|
enumerable: true,
|
|
4783
|
-
get: function () { return
|
|
4854
|
+
get: function () { return chunkXLXOQZ3M_cjs.normalizePaymentRequired; }
|
|
4784
4855
|
});
|
|
4785
4856
|
Object.defineProperty(exports, "parseNextTool", {
|
|
4786
4857
|
enumerable: true,
|
|
4787
|
-
get: function () { return
|
|
4858
|
+
get: function () { return chunkXLXOQZ3M_cjs.parseNextTool; }
|
|
4788
4859
|
});
|
|
4789
4860
|
Object.defineProperty(exports, "parsePaymentRequired", {
|
|
4790
4861
|
enumerable: true,
|
|
4791
|
-
get: function () { return
|
|
4862
|
+
get: function () { return chunkXLXOQZ3M_cjs.parsePaymentRequired; }
|
|
4792
4863
|
});
|
|
4793
4864
|
Object.defineProperty(exports, "parsePaymentRequiredResponse", {
|
|
4794
4865
|
enumerable: true,
|
|
4795
|
-
get: function () { return
|
|
4866
|
+
get: function () { return chunkXLXOQZ3M_cjs.parsePaymentRequiredResponse; }
|
|
4796
4867
|
});
|
|
4797
4868
|
Object.defineProperty(exports, "readClientUpdate", {
|
|
4798
4869
|
enumerable: true,
|
|
4799
|
-
get: function () { return
|
|
4870
|
+
get: function () { return chunkXLXOQZ3M_cjs.readClientUpdate; }
|
|
4800
4871
|
});
|
|
4801
4872
|
Object.defineProperty(exports, "renderNextTool", {
|
|
4802
4873
|
enumerable: true,
|
|
4803
|
-
get: function () { return
|
|
4874
|
+
get: function () { return chunkXLXOQZ3M_cjs.renderNextTool; }
|
|
4804
4875
|
});
|
|
4805
4876
|
Object.defineProperty(exports, "resolveTokenBySymbol", {
|
|
4806
4877
|
enumerable: true,
|
|
4807
|
-
get: function () { return
|
|
4878
|
+
get: function () { return chunkXLXOQZ3M_cjs.resolveTokenBySymbol; }
|
|
4808
4879
|
});
|
|
4809
4880
|
Object.defineProperty(exports, "resolveTokenFromAddress", {
|
|
4810
4881
|
enumerable: true,
|
|
4811
|
-
get: function () { return
|
|
4882
|
+
get: function () { return chunkXLXOQZ3M_cjs.resolveTokenFromAddress; }
|
|
4812
4883
|
});
|
|
4813
4884
|
Object.defineProperty(exports, "selectErc7710PaymentOption", {
|
|
4814
4885
|
enumerable: true,
|
|
4815
|
-
get: function () { return
|
|
4886
|
+
get: function () { return chunkXLXOQZ3M_cjs.selectErc7710PaymentOption; }
|
|
4816
4887
|
});
|
|
4817
4888
|
Object.defineProperty(exports, "selectPaymentOption", {
|
|
4818
4889
|
enumerable: true,
|
|
4819
|
-
get: function () { return
|
|
4890
|
+
get: function () { return chunkXLXOQZ3M_cjs.selectPaymentOption; }
|
|
4820
4891
|
});
|
|
4821
4892
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
4822
4893
|
enumerable: true,
|
|
4823
|
-
get: function () { return
|
|
4894
|
+
get: function () { return chunkXLXOQZ3M_cjs.selectStandardPaymentOption; }
|
|
4824
4895
|
});
|
|
4825
4896
|
Object.defineProperty(exports, "selectX402SettlementScheme", {
|
|
4826
4897
|
enumerable: true,
|
|
4827
|
-
get: function () { return
|
|
4898
|
+
get: function () { return chunkXLXOQZ3M_cjs.selectX402SettlementScheme; }
|
|
4828
4899
|
});
|
|
4829
4900
|
Object.defineProperty(exports, "sweepUsdcAddress", {
|
|
4830
4901
|
enumerable: true,
|
|
4831
|
-
get: function () { return
|
|
4902
|
+
get: function () { return chunkXLXOQZ3M_cjs.sweepUsdcAddress; }
|
|
4832
4903
|
});
|
|
4833
4904
|
Object.defineProperty(exports, "sweepUsdcDomain", {
|
|
4834
4905
|
enumerable: true,
|
|
4835
|
-
get: function () { return
|
|
4906
|
+
get: function () { return chunkXLXOQZ3M_cjs.sweepUsdcDomain; }
|
|
4836
4907
|
});
|
|
4837
4908
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
4838
4909
|
enumerable: true,
|
|
4839
|
-
get: function () { return
|
|
4910
|
+
get: function () { return chunkXLXOQZ3M_cjs.toStandardPaymentRequirements; }
|
|
4840
4911
|
});
|
|
4841
4912
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
4842
4913
|
enumerable: true,
|
|
4843
|
-
get: function () { return
|
|
4914
|
+
get: function () { return chunkXLXOQZ3M_cjs.unsupportedNodeVersionMessage; }
|
|
4844
4915
|
});
|
|
4845
4916
|
Object.defineProperty(exports, "validateStandardX402PaymentHeader", {
|
|
4846
4917
|
enumerable: true,
|
|
4847
|
-
get: function () { return
|
|
4918
|
+
get: function () { return chunkXLXOQZ3M_cjs.validateStandardX402PaymentHeader; }
|
|
4848
4919
|
});
|
|
4849
4920
|
Object.defineProperty(exports, "x402AssetTransferMethod", {
|
|
4850
4921
|
enumerable: true,
|
|
4851
|
-
get: function () { return
|
|
4922
|
+
get: function () { return chunkXLXOQZ3M_cjs.x402AssetTransferMethod; }
|
|
4852
4923
|
});
|
|
4853
4924
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
4854
4925
|
enumerable: true,
|
|
4855
|
-
get: function () { return
|
|
4926
|
+
get: function () { return chunkXLXOQZ3M_cjs.x402AuthorizationAmount; }
|
|
4856
4927
|
});
|
|
4857
4928
|
Object.defineProperty(exports, "x402FacilitatorAddresses", {
|
|
4858
4929
|
enumerable: true,
|
|
4859
|
-
get: function () { return
|
|
4930
|
+
get: function () { return chunkXLXOQZ3M_cjs.x402FacilitatorAddresses; }
|
|
4860
4931
|
});
|
|
4861
4932
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
4862
4933
|
enumerable: true,
|
|
4863
|
-
get: function () { return
|
|
4934
|
+
get: function () { return chunkXLXOQZ3M_cjs.x402V2PaymentEnvelope; }
|
|
4864
4935
|
});
|
|
4865
4936
|
Object.defineProperty(exports, "AGENT_PAYMENT_FAILURE_CODE_VALUES", {
|
|
4866
4937
|
enumerable: true,
|