@haven_ai/sdk 0.0.0-dev.202609291949.4e52d4b → 0.0.0-dev.202609302044.2340eeb
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 +5 -3
- package/dist/{base64-VVxgYQAD.d.cts → base64-DYd43iOS.d.cts} +14 -1
- package/dist/{base64-VVxgYQAD.d.ts → base64-DYd43iOS.d.ts} +14 -1
- package/dist/{chunk-J6SS36ZD.cjs → chunk-AEUE6UJM.cjs} +35 -35
- package/dist/{chunk-J6SS36ZD.cjs.map → chunk-AEUE6UJM.cjs.map} +1 -1
- package/dist/{chunk-5I6LGPWZ.js → chunk-ANJUPDH2.js} +2 -2
- package/dist/{chunk-5I6LGPWZ.js.map → chunk-ANJUPDH2.js.map} +1 -1
- package/dist/{chunk-S35ZUPXQ.js → chunk-C2K3VCVH.js} +4 -4
- package/dist/{chunk-S35ZUPXQ.js.map → chunk-C2K3VCVH.js.map} +1 -1
- package/dist/{chunk-SZHKBOCZ.cjs → chunk-FZB5XARP.cjs} +2 -2
- package/dist/{chunk-SZHKBOCZ.cjs.map → chunk-FZB5XARP.cjs.map} +1 -1
- package/dist/edge.cjs +89 -89
- package/dist/edge.d.cts +2 -2
- package/dist/edge.d.ts +2 -2
- package/dist/edge.js +4 -4
- package/dist/index.cjs +311 -306
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +10 -5
- 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/README.md
CHANGED
|
@@ -470,9 +470,11 @@ answers HTTP 410 at every agent-payment entry point.
|
|
|
470
470
|
If an agent requests a payment outside that policy, Haven **declines it before
|
|
471
471
|
any money moves** — during prepare, before anything is written and before the
|
|
472
472
|
agent is asked to sign. `POST /payments` answers `403` when no active delegation
|
|
473
|
-
authorizes that token and recipient,
|
|
474
|
-
|
|
475
|
-
|
|
473
|
+
authorizes that token and recipient, `403 delegation_budget_exceeded` when the
|
|
474
|
+
remaining period budget cannot cover the amount (#3503; the x402 authorize path
|
|
475
|
+
answers the same), and `502` when the on-chain caveat check rejects a
|
|
476
|
+
redemption anyway (a recipient outside a pin or an expired grant already gets
|
|
477
|
+
the first `403`, since no active delegation matches). In every case the SDK raises `HavenApiError` and no
|
|
476
478
|
`payment_id` exists to poll.
|
|
477
479
|
|
|
478
480
|
Surface that to the user as a decline, not a wait: **nothing will arrive later.**
|
|
@@ -1531,6 +1531,19 @@ interface PaymentStatusResult {
|
|
|
1531
1531
|
* row records its response); absent = unknown. See the raw field's doc.
|
|
1532
1532
|
*/
|
|
1533
1533
|
delivered?: boolean;
|
|
1534
|
+
/**
|
|
1535
|
+
* #3475 follow-up: which settlement branch this x402 payment runs (#946).
|
|
1536
|
+
* `null` on the legacy rail, on any x402 intent whose scheme metadata
|
|
1537
|
+
* predates #946, or any stored value outside this enum.
|
|
1538
|
+
*/
|
|
1539
|
+
settlementScheme?: 'eip3009' | 'erc7710' | null;
|
|
1540
|
+
/**
|
|
1541
|
+
* #3475 follow-up: `true` only when an eip3009 payment's merchant
|
|
1542
|
+
* settlement transaction is already recorded and on-chain-verified.
|
|
1543
|
+
* Absent — never `false` — when unknown or on erc7710, matching
|
|
1544
|
+
* `delivered`'s own honesty rule.
|
|
1545
|
+
*/
|
|
1546
|
+
merchantSettlementRecorded?: boolean;
|
|
1534
1547
|
/** Platform fee surfaced so it's never silently collected (#386). */
|
|
1535
1548
|
fee?: PaymentFee | null;
|
|
1536
1549
|
amountAtomic?: string | null;
|
|
@@ -2077,7 +2090,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2077
2090
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2078
2091
|
* it with the package version on every release — never hand-edit it.
|
|
2079
2092
|
*/
|
|
2080
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2093
|
+
declare const SDK_VERSION = "0.0.0-dev.202609302044.2340eeb";
|
|
2081
2094
|
/** The request header every published Haven client sends. */
|
|
2082
2095
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2083
2096
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -1531,6 +1531,19 @@ interface PaymentStatusResult {
|
|
|
1531
1531
|
* row records its response); absent = unknown. See the raw field's doc.
|
|
1532
1532
|
*/
|
|
1533
1533
|
delivered?: boolean;
|
|
1534
|
+
/**
|
|
1535
|
+
* #3475 follow-up: which settlement branch this x402 payment runs (#946).
|
|
1536
|
+
* `null` on the legacy rail, on any x402 intent whose scheme metadata
|
|
1537
|
+
* predates #946, or any stored value outside this enum.
|
|
1538
|
+
*/
|
|
1539
|
+
settlementScheme?: 'eip3009' | 'erc7710' | null;
|
|
1540
|
+
/**
|
|
1541
|
+
* #3475 follow-up: `true` only when an eip3009 payment's merchant
|
|
1542
|
+
* settlement transaction is already recorded and on-chain-verified.
|
|
1543
|
+
* Absent — never `false` — when unknown or on erc7710, matching
|
|
1544
|
+
* `delivered`'s own honesty rule.
|
|
1545
|
+
*/
|
|
1546
|
+
merchantSettlementRecorded?: boolean;
|
|
1534
1547
|
/** Platform fee surfaced so it's never silently collected (#386). */
|
|
1535
1548
|
fee?: PaymentFee | null;
|
|
1536
1549
|
amountAtomic?: string | null;
|
|
@@ -2077,7 +2090,7 @@ declare function buildSweepAuthorizationMessage(auth: SweepAuthorization): strin
|
|
|
2077
2090
|
* This SDK's own version. Owned by `scripts/release-bump.mjs`, which rewrites
|
|
2078
2091
|
* it with the package version on every release — never hand-edit it.
|
|
2079
2092
|
*/
|
|
2080
|
-
declare const SDK_VERSION = "0.0.0-dev.
|
|
2093
|
+
declare const SDK_VERSION = "0.0.0-dev.202609302044.2340eeb";
|
|
2081
2094
|
/** The request header every published Haven client sends. */
|
|
2082
2095
|
declare const HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
2083
2096
|
/** `<package>/<version>` — the value of {@link HAVEN_CLIENT_HEADER}. */
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkFZB5XARP_cjs = require('./chunk-FZB5XARP.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 chunkFZB5XARP_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 = chunkFZB5XARP_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() !== chunkFZB5XARP_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 (${chunkFZB5XARP_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
|
+
chunkFZB5XARP_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
|
+
chunkFZB5XARP_cjs.verifySettlementChild(typedData, {
|
|
100
100
|
...expectation,
|
|
101
|
-
delegatorAccount:
|
|
101
|
+
delegatorAccount: chunkFZB5XARP_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 chunkFZB5XARP_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: chunkFZB5XARP_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 chunkFZB5XARP_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 chunkFZB5XARP_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 chunkFZB5XARP_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 chunkFZB5XARP_cjs.HavenSigningError("Sweep nonce must be a 0x-prefixed 32-byte hex string.");
|
|
281
281
|
}
|
|
282
282
|
return {
|
|
283
283
|
domain,
|
|
@@ -787,7 +787,7 @@ function stableStringify2(value) {
|
|
|
787
787
|
}
|
|
788
788
|
|
|
789
789
|
// src/client-identity.ts
|
|
790
|
-
var SDK_VERSION = "0.0.0-dev.
|
|
790
|
+
var SDK_VERSION = "0.0.0-dev.202609302044.2340eeb";
|
|
791
791
|
var HAVEN_CLIENT_HEADER = "X-Haven-Client";
|
|
792
792
|
function havenClientIdentity(pkg, version) {
|
|
793
793
|
return `${pkg}/${version}`;
|
|
@@ -820,7 +820,7 @@ function addressFromKey(privateKey) {
|
|
|
820
820
|
try {
|
|
821
821
|
return accounts.privateKeyToAddress(`0x${hexBytes(privateKey, 32, "private key")}`);
|
|
822
822
|
} catch (err) {
|
|
823
|
-
throw new
|
|
823
|
+
throw new chunkFZB5XARP_cjs.HavenSigningError(
|
|
824
824
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
825
825
|
);
|
|
826
826
|
}
|
|
@@ -834,7 +834,7 @@ function signHash(privateKey, hash) {
|
|
|
834
834
|
yParity: recovery
|
|
835
835
|
});
|
|
836
836
|
} catch (err) {
|
|
837
|
-
throw new
|
|
837
|
+
throw new chunkFZB5XARP_cjs.HavenSigningError(
|
|
838
838
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
839
839
|
);
|
|
840
840
|
}
|
|
@@ -870,7 +870,7 @@ var TAX_DECLARATION_TYPES = {
|
|
|
870
870
|
var X_TAX_DECLARATION_HEADER = "X-Tax-Declaration";
|
|
871
871
|
function validateContent(content) {
|
|
872
872
|
if (typeof content !== "object" || content === null || Array.isArray(content)) {
|
|
873
|
-
throw new
|
|
873
|
+
throw new chunkFZB5XARP_cjs.HavenSigningError("Tax declaration content must be an object.");
|
|
874
874
|
}
|
|
875
875
|
const record = content;
|
|
876
876
|
for (const field of ["principalId", "principalAttributionHash"]) {
|
|
@@ -923,7 +923,7 @@ function taxPrincipalId(network, delegateAddress) {
|
|
|
923
923
|
if (network.startsWith("eip155:")) {
|
|
924
924
|
return `did:pkh:${network}:${delegateAddress}`;
|
|
925
925
|
}
|
|
926
|
-
const chainId =
|
|
926
|
+
const chainId = chunkFZB5XARP_cjs.chainIdForNetwork(network);
|
|
927
927
|
if (chainId === void 0) {
|
|
928
928
|
throw new TaxDeclarationRefusedError(
|
|
929
929
|
`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.`
|
|
@@ -968,12 +968,12 @@ function addressFromKeyForTax(delegateKey) {
|
|
|
968
968
|
try {
|
|
969
969
|
return addressFromKey(delegateKey);
|
|
970
970
|
} catch (err) {
|
|
971
|
-
throw new
|
|
971
|
+
throw new chunkFZB5XARP_cjs.HavenSigningError(
|
|
972
972
|
`Invalid delegate key for tax declaration signing: ${err instanceof Error ? err.message : String(err)}`
|
|
973
973
|
);
|
|
974
974
|
}
|
|
975
975
|
}
|
|
976
|
-
var TaxDeclarationRefusedError = class extends
|
|
976
|
+
var TaxDeclarationRefusedError = class extends chunkFZB5XARP_cjs.HavenSigningError {
|
|
977
977
|
code = "TAX_DECLARATION_REFUSED";
|
|
978
978
|
constructor(message) {
|
|
979
979
|
super(message);
|
|
@@ -1125,10 +1125,10 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1125
1125
|
if (td?.primaryType !== "Delegation") {
|
|
1126
1126
|
refuseTaskChild("it is not a Delegation payload", `primaryType was '${String(td?.primaryType)}'.`);
|
|
1127
1127
|
}
|
|
1128
|
-
if (!same(td.domain?.verifyingContract,
|
|
1128
|
+
if (!same(td.domain?.verifyingContract, chunkFZB5XARP_cjs.DELEGATION_MANAGER)) {
|
|
1129
1129
|
refuseTaskChild(
|
|
1130
1130
|
"the EIP-712 domain names an unknown DelegationManager",
|
|
1131
|
-
`Expected ${
|
|
1131
|
+
`Expected ${chunkFZB5XARP_cjs.DELEGATION_MANAGER}, got ${td.domain?.verifyingContract}.`
|
|
1132
1132
|
);
|
|
1133
1133
|
}
|
|
1134
1134
|
if (td.domain?.name !== DELEGATION_DOMAIN_NAME || td.domain?.version !== DELEGATION_DOMAIN_VERSION) {
|
|
@@ -1156,7 +1156,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1156
1156
|
`Expected chain ${expected.chainId}; the child says ${td.domain?.chainId}.`
|
|
1157
1157
|
);
|
|
1158
1158
|
}
|
|
1159
|
-
const ownAccount =
|
|
1159
|
+
const ownAccount = chunkFZB5XARP_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
1160
1160
|
const delegator = td.message?.delegator;
|
|
1161
1161
|
if (typeof delegator !== "string" || !same(delegator, ownAccount)) {
|
|
1162
1162
|
refuseTaskChild(
|
|
@@ -1175,7 +1175,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1175
1175
|
if (typeof authority !== "string" || !/^0x[0-9a-fA-F]{64}$/.test(authority)) {
|
|
1176
1176
|
refuseTaskChild("its authority is not a 32-byte delegation hash", `Got ${String(authority)}.`);
|
|
1177
1177
|
}
|
|
1178
|
-
if (authority.toLowerCase() ===
|
|
1178
|
+
if (authority.toLowerCase() === chunkFZB5XARP_cjs.ROOT_AUTHORITY) {
|
|
1179
1179
|
refuseTaskChild(
|
|
1180
1180
|
"it is a ROOT delegation, not a re-delegation of the agent budget",
|
|
1181
1181
|
"A task budget always chains under the agent budget delegation."
|
|
@@ -1188,7 +1188,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1188
1188
|
);
|
|
1189
1189
|
}
|
|
1190
1190
|
const caveats = td.message?.caveats ?? [];
|
|
1191
|
-
const transfer = findCaveat(caveats,
|
|
1191
|
+
const transfer = findCaveat(caveats, chunkFZB5XARP_cjs.CAVEAT_ENFORCERS.erc20TransferAmount);
|
|
1192
1192
|
if (!transfer) {
|
|
1193
1193
|
refuseTaskChild(
|
|
1194
1194
|
"it has no ERC-20 transfer-amount caveat",
|
|
@@ -1206,7 +1206,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1206
1206
|
`Expected ${expected.maxAmountAtomic}; the child allows ${amount.toString()}.`
|
|
1207
1207
|
);
|
|
1208
1208
|
}
|
|
1209
|
-
const timestamp = findCaveat(caveats,
|
|
1209
|
+
const timestamp = findCaveat(caveats, chunkFZB5XARP_cjs.CAVEAT_ENFORCERS.timestamp);
|
|
1210
1210
|
if (!timestamp) {
|
|
1211
1211
|
refuseTaskChild("it never expires", "A task-budget child without a timestamp caveat is open-ended.");
|
|
1212
1212
|
}
|
|
@@ -1227,7 +1227,7 @@ function assertOwnTaskChild(typedData, expected, delegateAddress, now = Date.now
|
|
|
1227
1227
|
`Expected ${expected.expiresAt}; the child says ${beforeThreshold}.`
|
|
1228
1228
|
);
|
|
1229
1229
|
}
|
|
1230
|
-
const calldata = findCaveat(caveats,
|
|
1230
|
+
const calldata = findCaveat(caveats, chunkFZB5XARP_cjs.CAVEAT_ENFORCERS.allowedCalldata);
|
|
1231
1231
|
if (expected.recipientAddress) {
|
|
1232
1232
|
if (!calldata) {
|
|
1233
1233
|
refuseTaskChild(
|
|
@@ -1264,7 +1264,7 @@ var DISABLE_DELEGATION_ABI = [
|
|
|
1264
1264
|
{
|
|
1265
1265
|
type: "function",
|
|
1266
1266
|
name: "disableDelegation",
|
|
1267
|
-
inputs: [{ name: "delegation", type: "tuple", components:
|
|
1267
|
+
inputs: [{ name: "delegation", type: "tuple", components: chunkFZB5XARP_cjs.DELEGATION_TUPLE_COMPONENTS }],
|
|
1268
1268
|
outputs: [],
|
|
1269
1269
|
stateMutability: "nonpayable"
|
|
1270
1270
|
}
|
|
@@ -1283,7 +1283,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1283
1283
|
`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.`
|
|
1284
1284
|
);
|
|
1285
1285
|
}
|
|
1286
|
-
const ownAccount =
|
|
1286
|
+
const ownAccount = chunkFZB5XARP_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
1287
1287
|
const sender = typeof message.sender === "string" ? message.sender : "";
|
|
1288
1288
|
if (sender.toLowerCase() !== ownAccount.toLowerCase()) {
|
|
1289
1289
|
throw new HavenTypedDataRefusedError(
|
|
@@ -1306,9 +1306,9 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1306
1306
|
"This close UserOperation's execute() call does not re-encode to the exact callData bytes (trailing or non-canonical bytes). Refusing."
|
|
1307
1307
|
);
|
|
1308
1308
|
}
|
|
1309
|
-
if (decoded.target.toLowerCase() !==
|
|
1309
|
+
if (decoded.target.toLowerCase() !== chunkFZB5XARP_cjs.DELEGATION_MANAGER.toLowerCase()) {
|
|
1310
1310
|
throw new HavenTypedDataRefusedError(
|
|
1311
|
-
`This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${
|
|
1311
|
+
`This close UserOperation's execute() calls ${decoded.target}, not the DelegationManager (${chunkFZB5XARP_cjs.DELEGATION_MANAGER}). Refusing what looks like a self-call or a call to an unrelated contract.`
|
|
1312
1312
|
);
|
|
1313
1313
|
}
|
|
1314
1314
|
if (decoded.value !== 0n) {
|
|
@@ -1345,7 +1345,7 @@ function assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
|
1345
1345
|
`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.`
|
|
1346
1346
|
);
|
|
1347
1347
|
}
|
|
1348
|
-
if (delegation.authority.toLowerCase() ===
|
|
1348
|
+
if (delegation.authority.toLowerCase() === chunkFZB5XARP_cjs.ROOT_AUTHORITY) {
|
|
1349
1349
|
throw new HavenTypedDataRefusedError(
|
|
1350
1350
|
"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."
|
|
1351
1351
|
);
|
|
@@ -1475,5 +1475,5 @@ exports.x402FacilitatorAddresses = x402FacilitatorAddresses;
|
|
|
1475
1475
|
exports.x402PaymentHeaderNamesFor = x402PaymentHeaderNamesFor;
|
|
1476
1476
|
exports.x402PaymentHeaderNamesSent = x402PaymentHeaderNamesSent;
|
|
1477
1477
|
exports.x402V2PaymentEnvelope = x402V2PaymentEnvelope;
|
|
1478
|
-
//# sourceMappingURL=chunk-
|
|
1479
|
-
//# sourceMappingURL=chunk-
|
|
1478
|
+
//# sourceMappingURL=chunk-AEUE6UJM.cjs.map
|
|
1479
|
+
//# sourceMappingURL=chunk-AEUE6UJM.cjs.map
|