@haven_ai/sdk 0.0.0-dev.202610071600.91b951e → 0.0.0-dev.202610071649.8f72409
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-DROcY1sr.d.cts → base64--zoZF1mR.d.cts} +2 -2
- package/dist/{base64-DoaNCjbb.d.ts → base64-BQ7J9Cbl.d.ts} +2 -2
- package/dist/{chunk-R4FLGDXR.cjs → chunk-75KCQJXK.cjs} +35 -35
- package/dist/{chunk-R4FLGDXR.cjs.map → chunk-75KCQJXK.cjs.map} +1 -1
- package/dist/{chunk-QJD7PL4N.cjs → chunk-EVUZ7KPF.cjs} +2 -2
- package/dist/chunk-EVUZ7KPF.cjs.map +1 -0
- package/dist/{chunk-CYBOUN2G.js → chunk-GLTO7CLZ.js} +3 -3
- package/dist/{chunk-CYBOUN2G.js.map → chunk-GLTO7CLZ.js.map} +1 -1
- package/dist/{chunk-5NRXR64X.js → chunk-LQMFHLFL.js} +4 -4
- package/dist/{chunk-5NRXR64X.js.map → chunk-LQMFHLFL.js.map} +1 -1
- package/dist/{chunk-XURERYBU.cjs → chunk-LRC5ESLQ.cjs} +4 -4
- package/dist/{chunk-XURERYBU.cjs.map → chunk-LRC5ESLQ.cjs.map} +1 -1
- package/dist/{chunk-GK5TO7Y2.js → chunk-ZIDXGZKV.js} +2 -2
- package/dist/chunk-ZIDXGZKV.js.map +1 -0
- package/dist/edge.cjs +91 -91
- package/dist/edge.d.cts +4 -4
- package/dist/edge.d.ts +4 -4
- package/dist/edge.js +4 -4
- package/dist/index.cjs +349 -327
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +13 -13
- package/dist/index.d.ts +13 -13
- package/dist/index.js +43 -21
- package/dist/index.js.map +1 -1
- package/dist/{receipt-flXRwUku.d.ts → receipt-BqPO7FvT.d.ts} +1 -1
- package/dist/{receipt-CE9Jtqcu.d.cts → receipt-JEQAaD79.d.cts} +1 -1
- package/dist/test-support.cjs +21 -21
- package/dist/test-support.d.cts +2 -2
- package/dist/test-support.d.ts +2 -2
- package/dist/test-support.js +2 -2
- package/dist/{types-1YWyDt5d.d.cts → types-BhUoRyhc.d.cts} +28 -3
- package/dist/{types-1YWyDt5d.d.ts → types-BhUoRyhc.d.ts} +28 -3
- package/package.json +1 -1
- package/dist/chunk-GK5TO7Y2.js.map +0 -1
- package/dist/chunk-QJD7PL4N.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as AgentNextStep, W as AgentPaymentNextAction, ay as X402PaymentOption, ax as X402ExpectedContext, X as X402PaymentRequired, G as HavenError, ag as HavenSigningError } from './types-
|
|
1
|
+
import { M as AgentNextStep, W as AgentPaymentNextAction, ay as X402PaymentOption, ax as X402ExpectedContext, X as X402PaymentRequired, G as HavenError, ag as HavenSigningError } from './types-BhUoRyhc.cjs';
|
|
2
2
|
import { PaymentRequirements } from 'x402/types';
|
|
3
3
|
import { Hex, Address } from 'viem';
|
|
4
4
|
|
|
@@ -200,7 +200,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
200
200
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
201
201
|
* it with the package version on every release — never hand-edit it.
|
|
202
202
|
*/
|
|
203
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
203
|
+
declare const SDK_VERSION = "0.0.0-dev.202610071649.8f72409";
|
|
204
204
|
/** The request header every published Haven client sends. */
|
|
205
205
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
206
206
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as AgentNextStep, W as AgentPaymentNextAction, ay as X402PaymentOption, ax as X402ExpectedContext, X as X402PaymentRequired, G as HavenError, ag as HavenSigningError } from './types-
|
|
1
|
+
import { M as AgentNextStep, W as AgentPaymentNextAction, ay as X402PaymentOption, ax as X402ExpectedContext, X as X402PaymentRequired, G as HavenError, ag as HavenSigningError } from './types-BhUoRyhc.js';
|
|
2
2
|
import { PaymentRequirements } from 'x402/types';
|
|
3
3
|
import { Hex, Address } from 'viem';
|
|
4
4
|
|
|
@@ -200,7 +200,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
200
200
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
201
201
|
* it with the package version on every release — never hand-edit it.
|
|
202
202
|
*/
|
|
203
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
203
|
+
declare const SDK_VERSION = "0.0.0-dev.202610071649.8f72409";
|
|
204
204
|
/** The request header every published Haven client sends. */
|
|
205
205
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
206
206
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkEVUZ7KPF_cjs = require('./chunk-EVUZ7KPF.cjs');
|
|
4
4
|
var viem = require('viem');
|
|
5
5
|
var crypto = require('crypto');
|
|
6
6
|
var secp256k1 = require('@noble/curves/secp256k1');
|
|
7
7
|
var accounts = require('viem/accounts');
|
|
8
8
|
|
|
9
9
|
var TYPED_DATA_NOT_ALLOWED = "TYPED_DATA_NOT_ALLOWED";
|
|
10
|
-
var HavenTypedDataRefusedError = class extends
|
|
10
|
+
var HavenTypedDataRefusedError = class extends chunkEVUZ7KPF_cjs.HavenSigningError {
|
|
11
11
|
constructor(message) {
|
|
12
12
|
super(message);
|
|
13
13
|
this.code = TYPED_DATA_NOT_ALLOWED;
|
|
@@ -48,7 +48,7 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
|
|
|
48
48
|
`This signer only signs direct payments on chains the delegation rail has pinned contracts for (${[...DIRECT_PAYMENT_CHAIN_IDS].join(", ")}); this typed data names chain ${String(domain.chainId)}. Refusing.`
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
|
-
const ownAccount =
|
|
51
|
+
const ownAccount = chunkEVUZ7KPF_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
52
52
|
const sender = typeof message.sender === "string" ? message.sender : "";
|
|
53
53
|
if (sender.toLowerCase() !== ownAccount.toLowerCase()) {
|
|
54
54
|
throw new HavenTypedDataRefusedError(
|
|
@@ -78,9 +78,9 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
|
|
|
78
78
|
"This UserOperation's execute() call does not re-encode to the exact callData bytes (trailing or non-canonical bytes). Refusing."
|
|
79
79
|
);
|
|
80
80
|
}
|
|
81
|
-
if (decoded.target.toLowerCase() !==
|
|
81
|
+
if (decoded.target.toLowerCase() !== chunkEVUZ7KPF_cjs.DELEGATION_MANAGER.toLowerCase()) {
|
|
82
82
|
throw new HavenTypedDataRefusedError(
|
|
83
|
-
`This UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${
|
|
83
|
+
`This UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkEVUZ7KPF_cjs.DELEGATION_MANAGER}). A direct payment only ever redeems the agent's own budget delegation \u2014 refusing what looks like a self-call (e.g. transferOwnership, updateSigners, upgradeToAndCall) or a call to an unrelated contract.`
|
|
84
84
|
);
|
|
85
85
|
}
|
|
86
86
|
if (decoded.value !== 0n) {
|
|
@@ -89,20 +89,20 @@ function assertBoundDirectPaymentUserOp(typedData, delegateAddress) {
|
|
|
89
89
|
);
|
|
90
90
|
}
|
|
91
91
|
try {
|
|
92
|
-
|
|
92
|
+
chunkEVUZ7KPF_cjs.assertRedeemsOwnBudgetDelegation(decoded.callData, ownAccount);
|
|
93
93
|
} catch (err) {
|
|
94
94
|
throw new HavenTypedDataRefusedError(err instanceof Error ? err.message : String(err));
|
|
95
95
|
}
|
|
96
96
|
}
|
|
97
97
|
function assertOwnSettlementChild(typedData, expectation, delegateAddress) {
|
|
98
98
|
try {
|
|
99
|
-
|
|
99
|
+
chunkEVUZ7KPF_cjs.verifySettlementChild(typedData, {
|
|
100
100
|
...expectation,
|
|
101
|
-
delegatorAccount:
|
|
101
|
+
delegatorAccount: chunkEVUZ7KPF_cjs.deriveDelegateAccountAddress(delegateAddress)
|
|
102
102
|
});
|
|
103
103
|
} catch (err) {
|
|
104
104
|
if (err instanceof HavenTypedDataRefusedError) throw err;
|
|
105
|
-
if (err instanceof
|
|
105
|
+
if (err instanceof chunkEVUZ7KPF_cjs.HavenSigningError) throw new HavenTypedDataRefusedError(err.message);
|
|
106
106
|
throw new HavenTypedDataRefusedError(
|
|
107
107
|
`Refusing to sign the x402 settlement child: it is malformed (${err instanceof Error ? err.message : String(err)}).`
|
|
108
108
|
);
|
|
@@ -131,7 +131,7 @@ function assertFundingLegPaysDelegate(typedData, expected) {
|
|
|
131
131
|
try {
|
|
132
132
|
const { args: executeArgs } = viem.decodeFunctionData({ abi: EXECUTE_ABI, data: message.callData });
|
|
133
133
|
const inner = executeArgs[0].callData;
|
|
134
|
-
const { args } = viem.decodeFunctionData({ abi:
|
|
134
|
+
const { args } = viem.decodeFunctionData({ abi: chunkEVUZ7KPF_cjs.REDEEM_DELEGATIONS_ABI, data: inner });
|
|
135
135
|
const executions = args[2];
|
|
136
136
|
executionCallData = executions[0];
|
|
137
137
|
} catch {
|
|
@@ -250,7 +250,7 @@ var TRANSFER_WITH_AUTHORIZATION_TYPES = {
|
|
|
250
250
|
function sweepUsdcAddress(chainId) {
|
|
251
251
|
const address = USDC_ADDRESS_BY_CHAIN[chainId];
|
|
252
252
|
if (!address) {
|
|
253
|
-
throw new
|
|
253
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
254
254
|
`Sweep is not supported on chain ${chainId}. Supported: ${SWEEPABLE_CHAIN_IDS.join(", ")}.`
|
|
255
255
|
);
|
|
256
256
|
}
|
|
@@ -259,7 +259,7 @@ function sweepUsdcAddress(chainId) {
|
|
|
259
259
|
function sweepUsdcDomain(chainId) {
|
|
260
260
|
const domain = USDC_EIP712_DOMAIN_BY_CHAIN[chainId];
|
|
261
261
|
if (!domain) {
|
|
262
|
-
throw new
|
|
262
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
263
263
|
`Sweep is not supported on chain ${chainId}. Supported: ${SWEEPABLE_CHAIN_IDS.join(", ")}.`
|
|
264
264
|
);
|
|
265
265
|
}
|
|
@@ -272,12 +272,12 @@ function buildSweepTypedData(auth) {
|
|
|
272
272
|
const domain = sweepUsdcDomain(auth.chainId);
|
|
273
273
|
const expectedToken = sweepUsdcAddress(auth.chainId);
|
|
274
274
|
if (!sameAddress(auth.token, expectedToken)) {
|
|
275
|
-
throw new
|
|
275
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
276
276
|
`Sweep token ${auth.token} is not the canonical USDC contract for chain ${auth.chainId}.`
|
|
277
277
|
);
|
|
278
278
|
}
|
|
279
279
|
if (!/^0x[0-9a-fA-F]{64}$/.test(auth.nonce)) {
|
|
280
|
-
throw new
|
|
280
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError("Sweep nonce must be a 0x-prefixed 32-byte hex string.");
|
|
281
281
|
}
|
|
282
282
|
return {
|
|
283
283
|
domain,
|
|
@@ -782,7 +782,7 @@ function stableStringify2(value) {
|
|
|
782
782
|
}
|
|
783
783
|
|
|
784
784
|
// src/client-identity.ts
|
|
785
|
-
var SDK_VERSION = "0.0.0-dev.
|
|
785
|
+
var SDK_VERSION = "0.0.0-dev.202610071649.8f72409";
|
|
786
786
|
var HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
787
787
|
function havenClientIdentity(pkg, version) {
|
|
788
788
|
return `${pkg}/${version}`;
|
|
@@ -815,7 +815,7 @@ function addressFromKey(privateKey) {
|
|
|
815
815
|
try {
|
|
816
816
|
return accounts.privateKeyToAddress(`0x${hexBytes(privateKey, 32, "private key")}`);
|
|
817
817
|
} catch (err) {
|
|
818
|
-
throw new
|
|
818
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
819
819
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
820
820
|
);
|
|
821
821
|
}
|
|
@@ -829,7 +829,7 @@ function signHash(privateKey, hash) {
|
|
|
829
829
|
yParity: recovery
|
|
830
830
|
});
|
|
831
831
|
} catch (err) {
|
|
832
|
-
throw new
|
|
832
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
833
833
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
834
834
|
);
|
|
835
835
|
}
|
|
@@ -865,7 +865,7 @@ var TAX_DECLARATION_TYPES = {
|
|
|
865
865
|
var X_TAX_DECLARATION_HEADER = "X-Tax-Declaration";
|
|
866
866
|
function validateContent(content) {
|
|
867
867
|
if (typeof content !== "object" || content === null || Array.isArray(content)) {
|
|
868
|
-
throw new
|
|
868
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError("Tax declaration content must be an object.");
|
|
869
869
|
}
|
|
870
870
|
const record = content;
|
|
871
871
|
for (const field of ["principalId", "principalAttributionHash"]) {
|
|
@@ -918,7 +918,7 @@ function taxPrincipalId(network, delegateAddress) {
|
|
|
918
918
|
if (network.startsWith("eip155:")) {
|
|
919
919
|
return `did:pkh:${network}:${delegateAddress}`;
|
|
920
920
|
}
|
|
921
|
-
const chainId =
|
|
921
|
+
const chainId = chunkEVUZ7KPF_cjs.chainIdForNetwork(network);
|
|
922
922
|
if (chainId === void 0) {
|
|
923
923
|
throw new TaxDeclarationRefusedError(
|
|
924
924
|
`The accepted payment option's network '${network}' is not a CAIP-2 eip155 chain this SDK can name; refusing to build a tax principal without the settlement network.`
|
|
@@ -963,12 +963,12 @@ function addressFromKeyForTax(delegateKey) {
|
|
|
963
963
|
try {
|
|
964
964
|
return addressFromKey(delegateKey);
|
|
965
965
|
} catch (err) {
|
|
966
|
-
throw new
|
|
966
|
+
throw new chunkEVUZ7KPF_cjs.HavenSigningError(
|
|
967
967
|
`Invalid delegate key for tax declaration signing: ${err instanceof Error ? err.message : String(err)}`
|
|
968
968
|
);
|
|
969
969
|
}
|
|
970
970
|
}
|
|
971
|
-
var TaxDeclarationRefusedError = class extends
|
|
971
|
+
var TaxDeclarationRefusedError = class extends chunkEVUZ7KPF_cjs.HavenSigningError {
|
|
972
972
|
code = "TAX_DECLARATION_REFUSED";
|
|
973
973
|
constructor(message) {
|
|
974
974
|
super(message);
|
|
@@ -1120,10 +1120,10 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1120
1120
|
if (td?.primaryType !== "Delegation") {
|
|
1121
1121
|
refuseTaskChild("it is not a Delegation payload", `primaryType was '${String(td?.primaryType)}'.`);
|
|
1122
1122
|
}
|
|
1123
|
-
if (!same(td.domain?.verifyingContract,
|
|
1123
|
+
if (!same(td.domain?.verifyingContract, chunkEVUZ7KPF_cjs.DELEGATION_MANAGER)) {
|
|
1124
1124
|
refuseTaskChild(
|
|
1125
1125
|
"the EIP-712 domain names an unknown DelegationManager",
|
|
1126
|
-
`Expected ${
|
|
1126
|
+
`Expected ${chunkEVUZ7KPF_cjs.DELEGATION_MANAGER}, got ${td.domain?.verifyingContract}.`
|
|
1127
1127
|
);
|
|
1128
1128
|
}
|
|
1129
1129
|
if (td.domain?.name !== DELEGATION_DOMAIN_NAME || td.domain?.version !== DELEGATION_DOMAIN_VERSION) {
|
|
@@ -1151,7 +1151,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1151
1151
|
`Expected chain ${expected.chainId}; the child says ${td.domain?.chainId}.`
|
|
1152
1152
|
);
|
|
1153
1153
|
}
|
|
1154
|
-
const ownAccount =
|
|
1154
|
+
const ownAccount = chunkEVUZ7KPF_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
1155
1155
|
const delegator = td.message?.delegator;
|
|
1156
1156
|
if (typeof delegator !== "string" || !same(delegator, ownAccount)) {
|
|
1157
1157
|
refuseTaskChild(
|
|
@@ -1170,7 +1170,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1170
1170
|
if (typeof authority !== "string" || !/^0x[0-9a-fA-F]{64}$/.test(authority)) {
|
|
1171
1171
|
refuseTaskChild("its authority is not a 32-byte delegation hash", `Got ${String(authority)}.`);
|
|
1172
1172
|
}
|
|
1173
|
-
if (authority.toLowerCase() ===
|
|
1173
|
+
if (authority.toLowerCase() === chunkEVUZ7KPF_cjs.ROOT_AUTHORITY) {
|
|
1174
1174
|
refuseTaskChild(
|
|
1175
1175
|
"it is a ROOT delegation, not a re-delegation of the agent budget",
|
|
1176
1176
|
"A task budget always chains under the agent budget delegation."
|
|
@@ -1183,7 +1183,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1183
1183
|
);
|
|
1184
1184
|
}
|
|
1185
1185
|
const caveats = td.message?.caveats ?? [];
|
|
1186
|
-
const transfer = findCaveat(caveats,
|
|
1186
|
+
const transfer = findCaveat(caveats, chunkEVUZ7KPF_cjs.CAVEAT_ENFORCERS.erc20TransferAmount);
|
|
1187
1187
|
if (!transfer) {
|
|
1188
1188
|
refuseTaskChild(
|
|
1189
1189
|
"it has no ERC-20 transfer-amount caveat",
|
|
@@ -1201,7 +1201,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1201
1201
|
`Expected ${expected.maxAmountAtomic}; the child allows ${amount.toString()}.`
|
|
1202
1202
|
);
|
|
1203
1203
|
}
|
|
1204
|
-
const timestamp = findCaveat(caveats,
|
|
1204
|
+
const timestamp = findCaveat(caveats, chunkEVUZ7KPF_cjs.CAVEAT_ENFORCERS.timestamp);
|
|
1205
1205
|
if (!timestamp) {
|
|
1206
1206
|
refuseTaskChild("it never expires", "A task-budget child without a timestamp caveat is open-ended.");
|
|
1207
1207
|
}
|
|
@@ -1222,7 +1222,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1222
1222
|
`Expected ${expected.expiresAt}; the child says ${beforeThreshold}.`
|
|
1223
1223
|
);
|
|
1224
1224
|
}
|
|
1225
|
-
const calldata = findCaveat(caveats,
|
|
1225
|
+
const calldata = findCaveat(caveats, chunkEVUZ7KPF_cjs.CAVEAT_ENFORCERS.allowedCalldata);
|
|
1226
1226
|
if (expected.recipientAddress) {
|
|
1227
1227
|
if (!calldata) {
|
|
1228
1228
|
refuseTaskChild(
|
|
@@ -1259,7 +1259,7 @@ var DISABLE_DELEGATION_ABI = [
|
|
|
1259
1259
|
{
|
|
1260
1260
|
type: "function",
|
|
1261
1261
|
name: "disableDelegation",
|
|
1262
|
-
inputs: [{ name: "delegation", type: "tuple", components:
|
|
1262
|
+
inputs: [{ name: "delegation", type: "tuple", components: chunkEVUZ7KPF_cjs.DELEGATION_TUPLE_COMPONENTS }],
|
|
1263
1263
|
outputs: [],
|
|
1264
1264
|
stateMutability: "nonpayable"
|
|
1265
1265
|
}
|
|
@@ -1278,7 +1278,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1278
1278
|
`This signer only signs a task-budget close on chains the delegation rail has pinned contracts for (${[...DIRECT_PAYMENT_CHAIN_IDS].join(", ")}); this typed data names chain ${String(domain.chainId)}. Refusing.`
|
|
1279
1279
|
);
|
|
1280
1280
|
}
|
|
1281
|
-
const ownAccount =
|
|
1281
|
+
const ownAccount = chunkEVUZ7KPF_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
1282
1282
|
const sender = typeof message.sender === "string" ? message.sender : "";
|
|
1283
1283
|
if (sender.toLowerCase() !== ownAccount.toLowerCase()) {
|
|
1284
1284
|
throw new HavenTypedDataRefusedError(
|
|
@@ -1301,9 +1301,9 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1301
1301
|
"This close UserOperation's execute() call does not re-encode to the exact callData bytes (trailing or non-canonical bytes). Refusing."
|
|
1302
1302
|
);
|
|
1303
1303
|
}
|
|
1304
|
-
if (decoded.target.toLowerCase() !==
|
|
1304
|
+
if (decoded.target.toLowerCase() !== chunkEVUZ7KPF_cjs.DELEGATION_MANAGER.toLowerCase()) {
|
|
1305
1305
|
throw new HavenTypedDataRefusedError(
|
|
1306
|
-
`This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${
|
|
1306
|
+
`This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkEVUZ7KPF_cjs.DELEGATION_MANAGER}). Refusing what looks like a self-call or a call to an unrelated contract.`
|
|
1307
1307
|
);
|
|
1308
1308
|
}
|
|
1309
1309
|
if (decoded.value !== 0n) {
|
|
@@ -1340,7 +1340,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1340
1340
|
`This close UserOperation disables a delegation granted to ${delegation.delegate}, not this signer's own account (${ownAccount}) \u2014 a task-budget child is always self-delegated. Refusing.`
|
|
1341
1341
|
);
|
|
1342
1342
|
}
|
|
1343
|
-
if (delegation.authority.toLowerCase() ===
|
|
1343
|
+
if (delegation.authority.toLowerCase() === chunkEVUZ7KPF_cjs.ROOT_AUTHORITY) {
|
|
1344
1344
|
throw new HavenTypedDataRefusedError(
|
|
1345
1345
|
"This close UserOperation disables a ROOT delegation, not a re-delegation of the agent budget. A task-budget child always chains under the agent budget delegation. Refusing."
|
|
1346
1346
|
);
|
|
@@ -1471,5 +1471,5 @@ exports.x402PaymentHeaderNamesFor = x402PaymentHeaderNamesFor;
|
|
|
1471
1471
|
exports.x402PaymentHeaderNamesSent = x402PaymentHeaderNamesSent;
|
|
1472
1472
|
exports.x402RetryHeadersFor = x402RetryHeadersFor;
|
|
1473
1473
|
exports.x402V2PaymentEnvelope = x402V2PaymentEnvelope;
|
|
1474
|
-
//# sourceMappingURL=chunk-
|
|
1475
|
-
//# sourceMappingURL=chunk-
|
|
1474
|
+
//# sourceMappingURL=chunk-75KCQJXK.cjs.map
|
|
1475
|
+
//# sourceMappingURL=chunk-75KCQJXK.cjs.map
|