@haven_ai/sdk 0.11.0-alpha.0 → 0.13.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +37 -4
- package/dist/{base64-D4VZhgUg.d.ts → base64-C3mJNLYR.d.cts} +10 -2
- package/dist/{base64-DR4Gl8cD.d.cts → base64-CxzIc3KH.d.ts} +10 -2
- package/dist/{chunk-IKQIIMM6.cjs → chunk-4Z7PKLFD.cjs} +38 -37
- package/dist/chunk-4Z7PKLFD.cjs.map +1 -0
- package/dist/{chunk-34YJQFCM.js → chunk-CK6VRIPR.js} +3 -3
- package/dist/chunk-CK6VRIPR.js.map +1 -0
- package/dist/{chunk-ZDJ55LR7.js → chunk-CXQ42FOA.js} +7 -6
- package/dist/chunk-CXQ42FOA.js.map +1 -0
- package/dist/{chunk-MZKLAHBK.cjs → chunk-LZHCIK7L.cjs} +56 -4
- package/dist/chunk-LZHCIK7L.cjs.map +1 -0
- package/dist/{chunk-I7SL4A6X.js → chunk-MI7LVP56.js} +55 -5
- package/dist/chunk-MI7LVP56.js.map +1 -0
- package/dist/{chunk-DXBAN4SN.cjs → chunk-Z5MTKU6O.cjs} +4 -4
- package/dist/chunk-Z5MTKU6O.cjs.map +1 -0
- package/dist/edge.cjs +93 -93
- package/dist/edge.d.cts +11 -8
- package/dist/edge.d.ts +11 -8
- package/dist/edge.js +4 -4
- package/dist/index.cjs +456 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -15
- package/dist/index.d.ts +26 -15
- package/dist/index.js +140 -48
- package/dist/index.js.map +1 -1
- package/dist/{receipt-CbD8L0WL.d.ts → receipt-CTOPh2fm.d.ts} +5 -4
- package/dist/{receipt-_bWCELEH.d.cts → receipt-DwRqGjGb.d.cts} +5 -4
- package/dist/test-support.cjs +58 -21
- package/dist/test-support.cjs.map +1 -1
- package/dist/test-support.d.cts +47 -3
- package/dist/test-support.d.ts +47 -3
- package/dist/test-support.js +37 -3
- package/dist/test-support.js.map +1 -1
- package/dist/{types-DKmvjXK6.d.cts → types-3vUBmumz.d.cts} +163 -2
- package/dist/{types-DKmvjXK6.d.ts → types-3vUBmumz.d.ts} +163 -2
- package/package.json +2 -2
- package/dist/chunk-34YJQFCM.js.map +0 -1
- package/dist/chunk-DXBAN4SN.cjs.map +0 -1
- package/dist/chunk-I7SL4A6X.js.map +0 -1
- package/dist/chunk-IKQIIMM6.cjs.map +0 -1
- package/dist/chunk-MZKLAHBK.cjs.map +0 -1
- package/dist/chunk-ZDJ55LR7.js.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkLZHCIK7L_cjs = require('./chunk-LZHCIK7L.cjs');
|
|
4
4
|
var ethers = require('ethers');
|
|
5
5
|
var viem = require('viem');
|
|
6
6
|
|
|
@@ -18,7 +18,7 @@ function delegationDomainSeparator(chainId) {
|
|
|
18
18
|
viem.keccak256(viem.toBytes("DelegationManager")),
|
|
19
19
|
viem.keccak256(viem.toBytes("1")),
|
|
20
20
|
BigInt(chainId),
|
|
21
|
-
|
|
21
|
+
chunkLZHCIK7L_cjs.DELEGATION_MANAGER
|
|
22
22
|
]
|
|
23
23
|
)
|
|
24
24
|
);
|
|
@@ -102,5 +102,5 @@ function verifyPaymentReceipt(receipt, recover = defaultRecover) {
|
|
|
102
102
|
|
|
103
103
|
exports.RECEIPT_VERSION = RECEIPT_VERSION;
|
|
104
104
|
exports.verifyPaymentReceipt = verifyPaymentReceipt;
|
|
105
|
-
//# sourceMappingURL=chunk-
|
|
106
|
-
//# sourceMappingURL=chunk-
|
|
105
|
+
//# sourceMappingURL=chunk-Z5MTKU6O.cjs.map
|
|
106
|
+
//# sourceMappingURL=chunk-Z5MTKU6O.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/receipt.ts"],"names":["keccak256","toBytes","encodeAbiParameters","DELEGATION_MANAGER","concatHex","ethers"],"mappings":"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","file":"chunk-Z5MTKU6O.cjs","sourcesContent":["import { ethers } from 'ethers'\nimport { concatHex, encodeAbiParameters, keccak256, toBytes, type Hex } from 'viem'\nimport { DELEGATION_MANAGER } from './settlement-child.js'\nimport type { RawPaymentParties } from './types.js'\n\n/**\n * Verifiable payment receipts.\n *\n * A self-contained bundle for a settled Haven payment whose agent\n * authorisation can be checked offline. What `verifyPaymentReceipt` proves is\n * deliberately narrow: the `payment` block (amount, recipient) is\n * Haven-asserted and is NOT bound by the signature, and `verified: true` never\n * proves the payment settled on-chain — settlement stays an explorer check on\n * `onChain.txHash` / `settlementTxHash`.\n *\n * What `verified: true` means, per scheme:\n *\n * - erc7710 (`authorization.signatureScheme: 'eip712_delegation'`): the bundle\n * carries the settlement child's EIP-712 struct hash as `signHash`. The\n * verifier rebuilds the digest the delegate actually signed —\n * `keccak256(0x1901 ‖ domainSeparator(DelegationManager, chainId) ‖ signHash)`\n * — from the DelegationManager address the SDK pins and the bundle's\n * `onChain.chainId`, never from a value the receipt itself vouches for.\n * `verified: true` means the delegate key signed that settlement delegation\n * (`verifiedOver: 'delegation_digest'`).\n * - direct payments and the eip3009 funding leg\n * (`signatureScheme: 'eip712_userop'`) sign an ERC-4337 user operation the\n * bundle does not carry: they return `not_verifiable_offline` rather than a\n * false accusation.\n * - retired-rail bundles (no scheme) carry a raw-signed `signHash`; the\n * verifier recovers over it directly, then over the delegation digest when\n * the chain allows rebuilding it.\n *\n * Anything that is not a signed bundle — including a `haven_list_receipts`\n * history row, which carries no signature at all — returns\n * `not_a_signed_receipt`. Verification never throws.\n *\n * #3723: the response `GET /payments/{id}/receipt` returns —\n * `{ receipt, verification }` — is accepted AS-IS: when the top level carries\n * no `authorization`, the `.receipt` object inside is verified instead (one\n * level, no recursion). The wrapper's `verification` is never read — it is\n * Haven's own self-check, and trusting it would defeat an offline verifier.\n *\n * This lives in the SDK so agents and users can verify receipts client-side.\n */\nexport const RECEIPT_VERSION = 'haven-receipt-1'\n\nexport interface PaymentReceipt {\n version: typeof RECEIPT_VERSION\n paymentId: string\n payment: {\n token: string\n tokenAddress: string\n amount: string\n amountSek: string | null\n recipient: string\n /** The payer's smart-account address. */\n account: string\n /**\n * #2960: one party vocabulary for \"who paid\", additive alongside `account`\n * above (which is `parties.treasury_account` only). Optional: a server\n * from before #2960 emits neither. Ignored by `verifyPaymentReceipt`,\n * which reads only the bundle's `authorization` and `onChain.chainId`.\n */\n parties?: RawPaymentParties\n chainId: number\n settledAt: string | null\n resourceUrl: string | null\n /**\n * #3770: the paying agent's own evidence-only verdict on what the\n * merchant DELIVERED (`ok` / `unusable` / `partial`, plus a bounded\n * note). Additive and OPTIONAL: a server from before #3770 emits\n * neither, and `null` means the agent has not reported. Ignored by\n * `verifyPaymentReceipt`, which reads only the bundle's `authorization`\n * and `onChain.chainId` — the same rule `parties` follows. Evidence\n * only: it never changes what the\n * payment itself is, and `settled`/amounts are untouched by a report.\n */\n deliveryQuality?: {\n quality: 'ok' | 'unusable' | 'partial'\n note: string | null\n reportedAt: string | null\n } | null\n }\n /** The agent's cryptographic authorisation — what makes the receipt verifiable. */\n authorization: {\n delegate: string\n signHash: string\n signature: string | null\n /**\n * #3418: which digest the delegate signed — selects what offline\n * verification rebuilds. `'eip712_delegation'`: the settlement\n * delegation's EIP-712 digest (erc7710). `'eip712_userop'`: an ERC-4337\n * user-operation digest the bundle does not carry (direct payments, the\n * eip3009 funding leg) — not verifiable offline. Absent on retired-rail\n * bundles and on backends older than #3418, whose `signHash` was signed\n * raw. The value is only a selector: a lying one cannot make a forged\n * signature verify, because recovery must still return `delegate`.\n */\n signatureScheme?: 'eip712_delegation' | 'eip712_userop'\n }\n onChain: {\n txHash: string | null\n chainId: number\n }\n}\n\nexport type ReceiptVerification =\n | { verified: true; recoveredSigner: string; verifiedOver: 'sign_hash' | 'delegation_digest' }\n | {\n verified: false\n reason:\n /** #3418: the input is not a haven-receipt-1 bundle (a haven_list_receipts row, null, undefined, a non-object). */\n | 'not_a_signed_receipt'\n /** #3418: eip712_userop bundle; or a delegation bundle on a chain the SDK pins no DelegationManager for. */\n | 'not_verifiable_offline'\n | 'missing_signature'\n | 'bad_signature'\n | 'signer_mismatch'\n recoveredSigner?: string\n }\n\n/** Chains whose DelegationManager the SDK pins (same address on both — rails/delegation-contracts.ts). */\nconst DELEGATION_MANAGER_CHAIN_IDS: ReadonlySet<number> = new Set([8453, 84532])\n\nconst EIP712_DOMAIN_TYPEHASH = keccak256(\n toBytes('EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)'),\n)\n\n/**\n * The EIP-712 domain separator of the DelegationManager on `chainId`, rebuilt\n * from the manager's own constants (name/version, fixed in the contract) and\n * the address the SDK pins — never from a value the receipt vouches for.\n */\nfunction delegationDomainSeparator(chainId: number): Hex {\n return keccak256(\n encodeAbiParameters(\n [{ type: 'bytes32' }, { type: 'bytes32' }, { type: 'bytes32' }, { type: 'uint256' }, { type: 'address' }],\n [\n EIP712_DOMAIN_TYPEHASH,\n keccak256(toBytes('DelegationManager')),\n keccak256(toBytes('1')),\n BigInt(chainId),\n DELEGATION_MANAGER as Hex,\n ],\n ),\n )\n}\n\n/** The EIP-712 digest over a delegation struct hash (what the delegate signs). */\nfunction delegationDigest(structHash: string, chainId: number): Hex {\n return keccak256(concatHex(['0x1901', delegationDomainSeparator(chainId), structHash as Hex]))\n}\n\n/** Default ECDSA recovery (raw ecrecover over the hash, no message prefix). */\nfunction defaultRecover(hash: string, signature: string): string {\n return ethers.recoverAddress(hash, signature)\n}\n\nconst NOT_A_SIGNED_RECEIPT = { verified: false, reason: 'not_a_signed_receipt' } as const\n\ntype RecoverFn = (hash: string, signature: string) => string\n\ntype MatchResult =\n | { ok: true; recoveredSigner: string }\n | { ok: false; reason: 'bad_signature' | 'signer_mismatch'; recoveredSigner?: string }\n\n/** Recover over one candidate hash and compare the signer with the named delegate. */\nfunction match(delegate: string, hash: string, signature: string, recover: RecoverFn): MatchResult {\n let recovered: string\n try {\n recovered = recover(hash, signature)\n } catch {\n return { ok: false, reason: 'bad_signature' }\n }\n if (recovered.toLowerCase() !== delegate.toLowerCase()) {\n return { ok: false, reason: 'signer_mismatch', recoveredSigner: recovered }\n }\n return { ok: true, recoveredSigner: recovered }\n}\n\nfunction finish(result: MatchResult, verifiedOver: 'sign_hash' | 'delegation_digest'): ReceiptVerification {\n if (result.ok) {\n return { verified: true, recoveredSigner: result.recoveredSigner, verifiedOver }\n }\n return result.recoveredSigner !== undefined\n ? { verified: false, reason: result.reason, recoveredSigner: result.recoveredSigner }\n : { verified: false, reason: result.reason }\n}\n\n/**\n * Verify a receipt's agent authorisation offline: recover the signer and\n * confirm it is the agent delegate, over whichever digest the bundle's scheme\n * names (see the module doc for what that proves — and what it does not).\n * Never throws: anything that is not a signed receipt — a\n * `haven_list_receipts` history row, null, undefined, a non-object — returns\n * `not_a_signed_receipt`. The `{ receipt, verification }` wrapper the receipt\n * endpoint returns is accepted as-is: `.receipt` is verified, and the\n * wrapper's `verification` — Haven's own self-check — is never read. Pure —\n * `recover` is injectable but defaults to\n * standard ECDSA recovery, so this runs anywhere (no Haven backend).\n */\nexport function verifyPaymentReceipt(\n receipt: unknown,\n recover: RecoverFn = defaultRecover,\n): ReceiptVerification {\n // #3418 rule 1: a list row (or any non-bundle) has no authorization object\n // holding string delegate/signHash — answer, never throw.\n if (typeof receipt !== 'object' || receipt === null) return NOT_A_SIGNED_RECEIPT\n let source = receipt as {\n authorization?: unknown\n receipt?: unknown\n onChain?: { chainId?: unknown }\n }\n // #3723: accept the endpoint's response as-is. When the top level carries no\n // `authorization` and `.receipt` is a non-null object, verify the bundle\n // inside the `{ receipt, verification }` wrapper (GET\n // /payments/{id}/receipt, and HavenClient.getReceipt's re-wrap). ONE level\n // only — no recursion — and the wrapper's `verification` is NEVER read: it\n // is Haven's own self-check, and trusting it would defeat an offline\n // verifier. A list row wrapped or bare still answers not_a_signed_receipt.\n if (typeof source.authorization !== 'object' || source.authorization === null) {\n if (typeof source.receipt !== 'object' || source.receipt === null) {\n return NOT_A_SIGNED_RECEIPT\n }\n source = source.receipt as typeof source\n }\n if (typeof source.authorization !== 'object' || source.authorization === null) {\n return NOT_A_SIGNED_RECEIPT\n }\n const auth = source.authorization as {\n delegate?: unknown\n signHash?: unknown\n signature?: unknown\n signatureScheme?: unknown\n }\n const { delegate, signHash, signature, signatureScheme } = auth\n if (typeof delegate !== 'string' || delegate === '' || typeof signHash !== 'string' || signHash === '') {\n return NOT_A_SIGNED_RECEIPT\n }\n if (typeof signature !== 'string' || signature === '') {\n return { verified: false, reason: 'missing_signature' }\n }\n\n const chainId =\n typeof source.onChain?.chainId === 'number' ? source.onChain.chainId : undefined\n const digestVerifiable = chainId !== undefined && DELEGATION_MANAGER_CHAIN_IDS.has(chainId)\n\n // #3418 rule 4: a userop digest needs the full UserOperation, which the\n // bundle does not carry. Return not_verifiable_offline — never\n // signer_mismatch, which would accuse a genuine payment.\n if (signatureScheme === 'eip712_userop') {\n return { verified: false, reason: 'not_verifiable_offline' }\n }\n\n // #3418 rule 3: rebuild the delegation digest from the pinned manager and\n // the bundle's chain id, then recover over it.\n if (signatureScheme === 'eip712_delegation') {\n if (!digestVerifiable) {\n return { verified: false, reason: 'not_verifiable_offline' }\n }\n let digest: string\n try {\n digest = delegationDigest(signHash, chainId as number)\n } catch {\n return { verified: false, reason: 'bad_signature' }\n }\n return finish(match(delegate, digest, signature, recover), 'delegation_digest')\n }\n\n // #3418 rule 5: absent or unknown scheme — retired-rail history (signed raw\n // over signHash) or a backend older than this change. Raw recovery first,\n // then the delegation digest when the chain allows rebuilding it. This is\n // the one remaining ambiguous case, limited to old bundles.\n const raw = match(delegate, signHash, signature, recover)\n if (raw.ok) return finish(raw, 'sign_hash')\n if (digestVerifiable) {\n let digest: string\n try {\n digest = delegationDigest(signHash, chainId as number)\n } catch {\n return finish(raw, 'sign_hash')\n }\n const delegated = match(delegate, digest, signature, recover)\n if (delegated.ok) return finish(delegated, 'delegation_digest')\n }\n return finish(raw, 'sign_hash')\n}\n"]}
|
package/dist/edge.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunk4Z7PKLFD_cjs = require('./chunk-4Z7PKLFD.cjs');
|
|
4
|
+
var chunkLZHCIK7L_cjs = require('./chunk-LZHCIK7L.cjs');
|
|
5
5
|
|
|
6
6
|
// src/sub-budget-guards.ts
|
|
7
7
|
var ERC20_PERIOD_TRANSFER_ENFORCER = "0x474e3Ae7E169e940607cC624Da8A15Eb120139aB";
|
|
@@ -31,10 +31,10 @@ function findCaveat(caveats, enforcer) {
|
|
|
31
31
|
return caveats.find((c) => same(c.enforcer, enforcer));
|
|
32
32
|
}
|
|
33
33
|
function hashSubBudgetDelegation(delegation) {
|
|
34
|
-
return
|
|
34
|
+
return chunk4Z7PKLFD_cjs.hashDelegation(delegation);
|
|
35
35
|
}
|
|
36
36
|
function refuseSubBudgetChild(what, detail) {
|
|
37
|
-
throw new
|
|
37
|
+
throw new chunk4Z7PKLFD_cjs.HavenTypedDataRefusedError(
|
|
38
38
|
`Refusing to sign the sub-budget child: ${what}. ${detail} This signature opens a slice of the delegating agent budget for another agent, so it is verified locally against the expectation Haven declared, rather than trusted.`
|
|
39
39
|
);
|
|
40
40
|
}
|
|
@@ -43,10 +43,10 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
43
43
|
if (td?.primaryType !== "Delegation") {
|
|
44
44
|
refuseSubBudgetChild("it is not a Delegation payload", `primaryType was '${String(td?.primaryType)}'.`);
|
|
45
45
|
}
|
|
46
|
-
if (!same(td.domain?.verifyingContract,
|
|
46
|
+
if (!same(td.domain?.verifyingContract, chunkLZHCIK7L_cjs.DELEGATION_MANAGER)) {
|
|
47
47
|
refuseSubBudgetChild(
|
|
48
48
|
"the EIP-712 domain names an unknown DelegationManager",
|
|
49
|
-
`Expected ${
|
|
49
|
+
`Expected ${chunkLZHCIK7L_cjs.DELEGATION_MANAGER}, got ${td.domain?.verifyingContract}.`
|
|
50
50
|
);
|
|
51
51
|
}
|
|
52
52
|
if (td.domain?.name !== DELEGATION_DOMAIN_NAME || td.domain?.version !== DELEGATION_DOMAIN_VERSION) {
|
|
@@ -62,10 +62,10 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
62
62
|
);
|
|
63
63
|
}
|
|
64
64
|
const domainChain = Number(td.domain?.chainId);
|
|
65
|
-
if (!Number.isFinite(domainChain) || !
|
|
65
|
+
if (!Number.isFinite(domainChain) || !chunk4Z7PKLFD_cjs.DIRECT_PAYMENT_CHAIN_IDS.has(domainChain)) {
|
|
66
66
|
refuseSubBudgetChild(
|
|
67
67
|
"it is scoped to a chain the delegation rail has no pinned contracts for",
|
|
68
|
-
`Chains with pinned contracts: ${[...
|
|
68
|
+
`Chains with pinned contracts: ${[...chunk4Z7PKLFD_cjs.DIRECT_PAYMENT_CHAIN_IDS].join(", ")}; the child says ${String(td.domain?.chainId)}.`
|
|
69
69
|
);
|
|
70
70
|
}
|
|
71
71
|
if (domainChain !== expected.chainId) {
|
|
@@ -74,7 +74,7 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
74
74
|
`Expected chain ${expected.chainId}; the child says ${td.domain?.chainId}.`
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
|
-
const ownAccount =
|
|
77
|
+
const ownAccount = chunkLZHCIK7L_cjs.deriveDelegateAccountAddress(delegateAddress);
|
|
78
78
|
const delegator = td.message?.delegator;
|
|
79
79
|
if (typeof delegator !== "string" || !same(delegator, ownAccount)) {
|
|
80
80
|
refuseSubBudgetChild(
|
|
@@ -99,7 +99,7 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
99
99
|
if (typeof authority !== "string" || !/^0x[0-9a-fA-F]{64}$/.test(authority)) {
|
|
100
100
|
refuseSubBudgetChild("its authority is not a 32-byte delegation hash", `Got ${String(authority)}.`);
|
|
101
101
|
}
|
|
102
|
-
if (authority.toLowerCase() ===
|
|
102
|
+
if (authority.toLowerCase() === chunkLZHCIK7L_cjs.ROOT_AUTHORITY) {
|
|
103
103
|
refuseSubBudgetChild(
|
|
104
104
|
"it is a ROOT delegation, not a re-delegation of the delegating agent budget",
|
|
105
105
|
"A sub-budget always chains under the delegating agent budget delegation."
|
|
@@ -112,7 +112,7 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
112
112
|
);
|
|
113
113
|
}
|
|
114
114
|
const caveats = td.message?.caveats ?? [];
|
|
115
|
-
if (findCaveat(caveats,
|
|
115
|
+
if (findCaveat(caveats, chunkLZHCIK7L_cjs.CAVEAT_ENFORCERS.erc20TransferAmount)) {
|
|
116
116
|
refuseSubBudgetChild(
|
|
117
117
|
"it carries a hard-cap transfer-amount caveat (the task-budget shape)",
|
|
118
118
|
"A sub-budget is period-scoped: its amount caveat must be an ERC20PeriodTransferEnforcer caveat slicing the parent period meter, never a lifetime cap."
|
|
@@ -150,7 +150,7 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
150
150
|
`Expected ${expected.startDate}; the child says ${startDate}.`
|
|
151
151
|
);
|
|
152
152
|
}
|
|
153
|
-
const timestamp = findCaveat(caveats,
|
|
153
|
+
const timestamp = findCaveat(caveats, chunkLZHCIK7L_cjs.CAVEAT_ENFORCERS.timestamp);
|
|
154
154
|
if (!timestamp) {
|
|
155
155
|
refuseSubBudgetChild("it never expires", "A sub-budget child without a timestamp caveat is open-ended.");
|
|
156
156
|
}
|
|
@@ -165,7 +165,7 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
165
165
|
`Expected ${expected.expiresAt}; the child says ${beforeThreshold}.`
|
|
166
166
|
);
|
|
167
167
|
}
|
|
168
|
-
const calldata = findCaveat(caveats,
|
|
168
|
+
const calldata = findCaveat(caveats, chunkLZHCIK7L_cjs.CAVEAT_ENFORCERS.allowedCalldata);
|
|
169
169
|
if (expected.recipientAddress) {
|
|
170
170
|
if (!calldata) {
|
|
171
171
|
refuseSubBudgetChild(
|
|
@@ -199,324 +199,324 @@ function assertOwnSubBudgetChild(typedData, expected, delegateAddress, now = Dat
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
function assertOwnSubBudgetCloseUserOp(typedData, expected, delegateAddress) {
|
|
202
|
-
|
|
202
|
+
chunk4Z7PKLFD_cjs.assertOwnTaskBudgetCloseUserOp(typedData, expected, delegateAddress);
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
Object.defineProperty(exports, "CAVEAT_TYPEHASH", {
|
|
206
206
|
enumerable: true,
|
|
207
|
-
get: function () { return
|
|
207
|
+
get: function () { return chunk4Z7PKLFD_cjs.CAVEAT_TYPEHASH; }
|
|
208
208
|
});
|
|
209
209
|
Object.defineProperty(exports, "DELEGATION_TYPEHASH", {
|
|
210
210
|
enumerable: true,
|
|
211
|
-
get: function () { return
|
|
211
|
+
get: function () { return chunk4Z7PKLFD_cjs.DELEGATION_TYPEHASH; }
|
|
212
212
|
});
|
|
213
213
|
Object.defineProperty(exports, "DIRECT_PAYMENT_CHAIN_IDS", {
|
|
214
214
|
enumerable: true,
|
|
215
|
-
get: function () { return
|
|
215
|
+
get: function () { return chunk4Z7PKLFD_cjs.DIRECT_PAYMENT_CHAIN_IDS; }
|
|
216
216
|
});
|
|
217
217
|
Object.defineProperty(exports, "EXECUTE_ABI", {
|
|
218
218
|
enumerable: true,
|
|
219
|
-
get: function () { return
|
|
219
|
+
get: function () { return chunk4Z7PKLFD_cjs.EXECUTE_ABI; }
|
|
220
220
|
});
|
|
221
221
|
Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
|
|
222
222
|
enumerable: true,
|
|
223
|
-
get: function () { return
|
|
223
|
+
get: function () { return chunk4Z7PKLFD_cjs.HAVEN_CLIENT_HEADER; }
|
|
224
224
|
});
|
|
225
225
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
226
226
|
enumerable: true,
|
|
227
|
-
get: function () { return
|
|
227
|
+
get: function () { return chunk4Z7PKLFD_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
228
228
|
});
|
|
229
229
|
Object.defineProperty(exports, "HavenTypedDataRefusedError", {
|
|
230
230
|
enumerable: true,
|
|
231
|
-
get: function () { return
|
|
231
|
+
get: function () { return chunk4Z7PKLFD_cjs.HavenTypedDataRefusedError; }
|
|
232
232
|
});
|
|
233
233
|
Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
|
|
234
234
|
enumerable: true,
|
|
235
|
-
get: function () { return
|
|
235
|
+
get: function () { return chunk4Z7PKLFD_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
|
|
236
236
|
});
|
|
237
237
|
Object.defineProperty(exports, "TAX_DECLARATION_DOMAIN", {
|
|
238
238
|
enumerable: true,
|
|
239
|
-
get: function () { return
|
|
239
|
+
get: function () { return chunk4Z7PKLFD_cjs.TAX_DECLARATION_DOMAIN; }
|
|
240
240
|
});
|
|
241
241
|
Object.defineProperty(exports, "TAX_DECLARATION_PRIMARY_TYPE", {
|
|
242
242
|
enumerable: true,
|
|
243
|
-
get: function () { return
|
|
243
|
+
get: function () { return chunk4Z7PKLFD_cjs.TAX_DECLARATION_PRIMARY_TYPE; }
|
|
244
244
|
});
|
|
245
245
|
Object.defineProperty(exports, "TAX_DECLARATION_TYPES", {
|
|
246
246
|
enumerable: true,
|
|
247
|
-
get: function () { return
|
|
247
|
+
get: function () { return chunk4Z7PKLFD_cjs.TAX_DECLARATION_TYPES; }
|
|
248
248
|
});
|
|
249
249
|
Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
|
|
250
250
|
enumerable: true,
|
|
251
|
-
get: function () { return
|
|
251
|
+
get: function () { return chunk4Z7PKLFD_cjs.TYPED_DATA_NOT_ALLOWED; }
|
|
252
252
|
});
|
|
253
253
|
Object.defineProperty(exports, "TaxDeclarationRefusedError", {
|
|
254
254
|
enumerable: true,
|
|
255
|
-
get: function () { return
|
|
255
|
+
get: function () { return chunk4Z7PKLFD_cjs.TaxDeclarationRefusedError; }
|
|
256
256
|
});
|
|
257
257
|
Object.defineProperty(exports, "X402_PAYMENT_NONCE_TAG", {
|
|
258
258
|
enumerable: true,
|
|
259
|
-
get: function () { return
|
|
259
|
+
get: function () { return chunk4Z7PKLFD_cjs.X402_PAYMENT_NONCE_TAG; }
|
|
260
260
|
});
|
|
261
261
|
Object.defineProperty(exports, "X_TAX_DECLARATION_HEADER", {
|
|
262
262
|
enumerable: true,
|
|
263
|
-
get: function () { return
|
|
263
|
+
get: function () { return chunk4Z7PKLFD_cjs.X_TAX_DECLARATION_HEADER; }
|
|
264
264
|
});
|
|
265
265
|
Object.defineProperty(exports, "addressFromKey", {
|
|
266
266
|
enumerable: true,
|
|
267
|
-
get: function () { return
|
|
267
|
+
get: function () { return chunk4Z7PKLFD_cjs.addressFromKey; }
|
|
268
268
|
});
|
|
269
269
|
Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
|
|
270
270
|
enumerable: true,
|
|
271
|
-
get: function () { return
|
|
271
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertBoundDirectPaymentUserOp; }
|
|
272
272
|
});
|
|
273
273
|
Object.defineProperty(exports, "assertFundingLegPaysDelegate", {
|
|
274
274
|
enumerable: true,
|
|
275
|
-
get: function () { return
|
|
275
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertFundingLegPaysDelegate; }
|
|
276
276
|
});
|
|
277
277
|
Object.defineProperty(exports, "assertOwnSettlementChild", {
|
|
278
278
|
enumerable: true,
|
|
279
|
-
get: function () { return
|
|
279
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertOwnSettlementChild; }
|
|
280
280
|
});
|
|
281
281
|
Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
|
|
282
282
|
enumerable: true,
|
|
283
|
-
get: function () { return
|
|
283
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertOwnTaskBudgetCloseUserOp; }
|
|
284
284
|
});
|
|
285
285
|
Object.defineProperty(exports, "assertOwnTaskChild", {
|
|
286
286
|
enumerable: true,
|
|
287
|
-
get: function () { return
|
|
287
|
+
get: function () { return chunk4Z7PKLFD_cjs.assertOwnTaskChild; }
|
|
288
288
|
});
|
|
289
289
|
Object.defineProperty(exports, "buildSignedTaxDeclaration", {
|
|
290
290
|
enumerable: true,
|
|
291
|
-
get: function () { return
|
|
291
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildSignedTaxDeclaration; }
|
|
292
292
|
});
|
|
293
293
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
294
294
|
enumerable: true,
|
|
295
|
-
get: function () { return
|
|
295
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildSweepAuthorizationMessage; }
|
|
296
296
|
});
|
|
297
297
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
298
298
|
enumerable: true,
|
|
299
|
-
get: function () { return
|
|
299
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildSweepTypedData; }
|
|
300
300
|
});
|
|
301
301
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
302
302
|
enumerable: true,
|
|
303
|
-
get: function () { return
|
|
303
|
+
get: function () { return chunk4Z7PKLFD_cjs.buildX402ExpectedMessage; }
|
|
304
304
|
});
|
|
305
305
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
306
306
|
enumerable: true,
|
|
307
|
-
get: function () { return
|
|
307
|
+
get: function () { return chunk4Z7PKLFD_cjs.createNextStepBuilder; }
|
|
308
308
|
});
|
|
309
309
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
310
310
|
enumerable: true,
|
|
311
|
-
get: function () { return
|
|
311
|
+
get: function () { return chunk4Z7PKLFD_cjs.decodeBase64Json; }
|
|
312
312
|
});
|
|
313
313
|
Object.defineProperty(exports, "deriveX402PaymentNonce", {
|
|
314
314
|
enumerable: true,
|
|
315
|
-
get: function () { return
|
|
315
|
+
get: function () { return chunk4Z7PKLFD_cjs.deriveX402PaymentNonce; }
|
|
316
316
|
});
|
|
317
317
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
318
318
|
enumerable: true,
|
|
319
|
-
get: function () { return
|
|
319
|
+
get: function () { return chunk4Z7PKLFD_cjs.encodeBase64Json; }
|
|
320
320
|
});
|
|
321
321
|
Object.defineProperty(exports, "encodeTaxDeclarationHeader", {
|
|
322
322
|
enumerable: true,
|
|
323
|
-
get: function () { return
|
|
323
|
+
get: function () { return chunk4Z7PKLFD_cjs.encodeTaxDeclarationHeader; }
|
|
324
324
|
});
|
|
325
325
|
Object.defineProperty(exports, "hashDelegation", {
|
|
326
326
|
enumerable: true,
|
|
327
|
-
get: function () { return
|
|
327
|
+
get: function () { return chunk4Z7PKLFD_cjs.hashDelegation; }
|
|
328
328
|
});
|
|
329
329
|
Object.defineProperty(exports, "havenClientIdentity", {
|
|
330
330
|
enumerable: true,
|
|
331
|
-
get: function () { return
|
|
331
|
+
get: function () { return chunk4Z7PKLFD_cjs.havenClientIdentity; }
|
|
332
332
|
});
|
|
333
333
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
334
334
|
enumerable: true,
|
|
335
|
-
get: function () { return
|
|
335
|
+
get: function () { return chunk4Z7PKLFD_cjs.isSupportedNodeVersion; }
|
|
336
336
|
});
|
|
337
337
|
Object.defineProperty(exports, "isTaskChildTypedData", {
|
|
338
338
|
enumerable: true,
|
|
339
|
-
get: function () { return
|
|
339
|
+
get: function () { return chunk4Z7PKLFD_cjs.isTaskChildTypedData; }
|
|
340
340
|
});
|
|
341
341
|
Object.defineProperty(exports, "principalAttributionHash", {
|
|
342
342
|
enumerable: true,
|
|
343
|
-
get: function () { return
|
|
343
|
+
get: function () { return chunk4Z7PKLFD_cjs.principalAttributionHash; }
|
|
344
344
|
});
|
|
345
345
|
Object.defineProperty(exports, "readClientUpdate", {
|
|
346
346
|
enumerable: true,
|
|
347
|
-
get: function () { return
|
|
347
|
+
get: function () { return chunk4Z7PKLFD_cjs.readClientUpdate; }
|
|
348
348
|
});
|
|
349
349
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
350
350
|
enumerable: true,
|
|
351
|
-
get: function () { return
|
|
351
|
+
get: function () { return chunk4Z7PKLFD_cjs.selectStandardPaymentOption; }
|
|
352
352
|
});
|
|
353
353
|
Object.defineProperty(exports, "signHash", {
|
|
354
354
|
enumerable: true,
|
|
355
|
-
get: function () { return
|
|
355
|
+
get: function () { return chunk4Z7PKLFD_cjs.signHash; }
|
|
356
356
|
});
|
|
357
357
|
Object.defineProperty(exports, "taxPrincipalId", {
|
|
358
358
|
enumerable: true,
|
|
359
|
-
get: function () { return
|
|
359
|
+
get: function () { return chunk4Z7PKLFD_cjs.taxPrincipalId; }
|
|
360
360
|
});
|
|
361
361
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
362
362
|
enumerable: true,
|
|
363
|
-
get: function () { return
|
|
363
|
+
get: function () { return chunk4Z7PKLFD_cjs.toStandardPaymentRequirements; }
|
|
364
364
|
});
|
|
365
365
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
366
366
|
enumerable: true,
|
|
367
|
-
get: function () { return
|
|
367
|
+
get: function () { return chunk4Z7PKLFD_cjs.unsupportedNodeVersionMessage; }
|
|
368
368
|
});
|
|
369
369
|
Object.defineProperty(exports, "verifySignature", {
|
|
370
370
|
enumerable: true,
|
|
371
|
-
get: function () { return
|
|
371
|
+
get: function () { return chunk4Z7PKLFD_cjs.verifySignature; }
|
|
372
372
|
});
|
|
373
373
|
Object.defineProperty(exports, "verifyTaxDeclarationSignature", {
|
|
374
374
|
enumerable: true,
|
|
375
|
-
get: function () { return
|
|
375
|
+
get: function () { return chunk4Z7PKLFD_cjs.verifyTaxDeclarationSignature; }
|
|
376
376
|
});
|
|
377
377
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
378
378
|
enumerable: true,
|
|
379
|
-
get: function () { return
|
|
379
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402AuthorizationAmount; }
|
|
380
380
|
});
|
|
381
381
|
Object.defineProperty(exports, "x402PaymentHeaderNamesFor", {
|
|
382
382
|
enumerable: true,
|
|
383
|
-
get: function () { return
|
|
383
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402PaymentHeaderNamesFor; }
|
|
384
384
|
});
|
|
385
385
|
Object.defineProperty(exports, "x402RetryHeadersFor", {
|
|
386
386
|
enumerable: true,
|
|
387
|
-
get: function () { return
|
|
387
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402RetryHeadersFor; }
|
|
388
388
|
});
|
|
389
389
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
390
390
|
enumerable: true,
|
|
391
|
-
get: function () { return
|
|
391
|
+
get: function () { return chunk4Z7PKLFD_cjs.x402V2PaymentEnvelope; }
|
|
392
392
|
});
|
|
393
393
|
Object.defineProperty(exports, "AgentPaymentFailureCode", {
|
|
394
394
|
enumerable: true,
|
|
395
|
-
get: function () { return
|
|
395
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentFailureCode; }
|
|
396
396
|
});
|
|
397
397
|
Object.defineProperty(exports, "AgentPaymentNextAction", {
|
|
398
398
|
enumerable: true,
|
|
399
|
-
get: function () { return
|
|
399
|
+
get: function () { return chunkLZHCIK7L_cjs.AgentPaymentNextAction; }
|
|
400
400
|
});
|
|
401
401
|
Object.defineProperty(exports, "CAVEAT_ENFORCERS", {
|
|
402
402
|
enumerable: true,
|
|
403
|
-
get: function () { return
|
|
403
|
+
get: function () { return chunkLZHCIK7L_cjs.CAVEAT_ENFORCERS; }
|
|
404
404
|
});
|
|
405
405
|
Object.defineProperty(exports, "DELEGATION_MANAGER", {
|
|
406
406
|
enumerable: true,
|
|
407
|
-
get: function () { return
|
|
407
|
+
get: function () { return chunkLZHCIK7L_cjs.DELEGATION_MANAGER; }
|
|
408
408
|
});
|
|
409
409
|
Object.defineProperty(exports, "DELEGATION_TUPLE_COMPONENTS", {
|
|
410
410
|
enumerable: true,
|
|
411
|
-
get: function () { return
|
|
411
|
+
get: function () { return chunkLZHCIK7L_cjs.DELEGATION_TUPLE_COMPONENTS; }
|
|
412
412
|
});
|
|
413
413
|
Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
|
|
414
414
|
enumerable: true,
|
|
415
|
-
get: function () { return
|
|
415
|
+
get: function () { return chunkLZHCIK7L_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
|
|
416
416
|
});
|
|
417
417
|
Object.defineProperty(exports, "ENTRY_POINT_V07", {
|
|
418
418
|
enumerable: true,
|
|
419
|
-
get: function () { return
|
|
419
|
+
get: function () { return chunkLZHCIK7L_cjs.ENTRY_POINT_V07; }
|
|
420
420
|
});
|
|
421
421
|
Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
|
|
422
422
|
enumerable: true,
|
|
423
|
-
get: function () { return
|
|
423
|
+
get: function () { return chunkLZHCIK7L_cjs.HAVEN_CONNECTOR_CHANNEL; }
|
|
424
424
|
});
|
|
425
425
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_IMPLEMENTATION", {
|
|
426
426
|
enumerable: true,
|
|
427
|
-
get: function () { return
|
|
427
|
+
get: function () { return chunkLZHCIK7L_cjs.HYBRID_DELEGATOR_IMPLEMENTATION; }
|
|
428
428
|
});
|
|
429
429
|
Object.defineProperty(exports, "HavenApiError", {
|
|
430
430
|
enumerable: true,
|
|
431
|
-
get: function () { return
|
|
431
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenApiError; }
|
|
432
432
|
});
|
|
433
433
|
Object.defineProperty(exports, "HavenError", {
|
|
434
434
|
enumerable: true,
|
|
435
|
-
get: function () { return
|
|
435
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenError; }
|
|
436
436
|
});
|
|
437
437
|
Object.defineProperty(exports, "HavenSigningError", {
|
|
438
438
|
enumerable: true,
|
|
439
|
-
get: function () { return
|
|
439
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenSigningError; }
|
|
440
440
|
});
|
|
441
441
|
Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
|
|
442
442
|
enumerable: true,
|
|
443
|
-
get: function () { return
|
|
443
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenUnsupportedSignerVersionError; }
|
|
444
444
|
});
|
|
445
445
|
Object.defineProperty(exports, "HavenUserOpBindingError", {
|
|
446
446
|
enumerable: true,
|
|
447
|
-
get: function () { return
|
|
447
|
+
get: function () { return chunkLZHCIK7L_cjs.HavenUserOpBindingError; }
|
|
448
448
|
});
|
|
449
449
|
Object.defineProperty(exports, "MAX_SETTLEMENT_WINDOW_SECONDS", {
|
|
450
450
|
enumerable: true,
|
|
451
|
-
get: function () { return
|
|
451
|
+
get: function () { return chunkLZHCIK7L_cjs.MAX_SETTLEMENT_WINDOW_SECONDS; }
|
|
452
452
|
});
|
|
453
453
|
Object.defineProperty(exports, "REDEEM_DELEGATIONS_ABI", {
|
|
454
454
|
enumerable: true,
|
|
455
|
-
get: function () { return
|
|
455
|
+
get: function () { return chunkLZHCIK7L_cjs.REDEEM_DELEGATIONS_ABI; }
|
|
456
456
|
});
|
|
457
457
|
Object.defineProperty(exports, "ROOT_AUTHORITY", {
|
|
458
458
|
enumerable: true,
|
|
459
|
-
get: function () { return
|
|
459
|
+
get: function () { return chunkLZHCIK7L_cjs.ROOT_AUTHORITY; }
|
|
460
460
|
});
|
|
461
461
|
Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
|
|
462
462
|
enumerable: true,
|
|
463
|
-
get: function () { return
|
|
463
|
+
get: function () { return chunkLZHCIK7L_cjs.SIGNER_UPDATE_FALLBACK; }
|
|
464
464
|
});
|
|
465
465
|
Object.defineProperty(exports, "SIMPLE_FACTORY_ADDRESS", {
|
|
466
466
|
enumerable: true,
|
|
467
|
-
get: function () { return
|
|
467
|
+
get: function () { return chunkLZHCIK7L_cjs.SIMPLE_FACTORY_ADDRESS; }
|
|
468
468
|
});
|
|
469
469
|
Object.defineProperty(exports, "SINGLE_DEFAULT_MODE", {
|
|
470
470
|
enumerable: true,
|
|
471
|
-
get: function () { return
|
|
471
|
+
get: function () { return chunkLZHCIK7L_cjs.SINGLE_DEFAULT_MODE; }
|
|
472
472
|
});
|
|
473
473
|
Object.defineProperty(exports, "SignerRefusalCode", {
|
|
474
474
|
enumerable: true,
|
|
475
|
-
get: function () { return
|
|
475
|
+
get: function () { return chunkLZHCIK7L_cjs.SignerRefusalCode; }
|
|
476
476
|
});
|
|
477
477
|
Object.defineProperty(exports, "TASK_SIGN_CONTEXT_VERSION", {
|
|
478
478
|
enumerable: true,
|
|
479
|
-
get: function () { return
|
|
479
|
+
get: function () { return chunkLZHCIK7L_cjs.TASK_SIGN_CONTEXT_VERSION; }
|
|
480
480
|
});
|
|
481
481
|
Object.defineProperty(exports, "assertRedeemsOwnBudgetDelegation", {
|
|
482
482
|
enumerable: true,
|
|
483
|
-
get: function () { return
|
|
483
|
+
get: function () { return chunkLZHCIK7L_cjs.assertRedeemsOwnBudgetDelegation; }
|
|
484
484
|
});
|
|
485
485
|
Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
|
|
486
486
|
enumerable: true,
|
|
487
|
-
get: function () { return
|
|
487
|
+
get: function () { return chunkLZHCIK7L_cjs.assertUserOpTypedDataBinding; }
|
|
488
488
|
});
|
|
489
489
|
Object.defineProperty(exports, "chainIdForNetwork", {
|
|
490
490
|
enumerable: true,
|
|
491
|
-
get: function () { return
|
|
491
|
+
get: function () { return chunkLZHCIK7L_cjs.chainIdForNetwork; }
|
|
492
492
|
});
|
|
493
493
|
Object.defineProperty(exports, "connectorRerunCommand", {
|
|
494
494
|
enumerable: true,
|
|
495
|
-
get: function () { return
|
|
495
|
+
get: function () { return chunkLZHCIK7L_cjs.connectorRerunCommand; }
|
|
496
496
|
});
|
|
497
497
|
Object.defineProperty(exports, "connectorUpgradeCommand", {
|
|
498
498
|
enumerable: true,
|
|
499
|
-
get: function () { return
|
|
499
|
+
get: function () { return chunkLZHCIK7L_cjs.connectorUpgradeCommand; }
|
|
500
500
|
});
|
|
501
501
|
Object.defineProperty(exports, "deriveDelegateAccountAddress", {
|
|
502
502
|
enumerable: true,
|
|
503
|
-
get: function () { return
|
|
503
|
+
get: function () { return chunkLZHCIK7L_cjs.deriveDelegateAccountAddress; }
|
|
504
504
|
});
|
|
505
505
|
Object.defineProperty(exports, "isPackedUserOperationTypedData", {
|
|
506
506
|
enumerable: true,
|
|
507
|
-
get: function () { return
|
|
507
|
+
get: function () { return chunkLZHCIK7L_cjs.isPackedUserOperationTypedData; }
|
|
508
508
|
});
|
|
509
509
|
Object.defineProperty(exports, "isSettlementChildTypedData", {
|
|
510
510
|
enumerable: true,
|
|
511
|
-
get: function () { return
|
|
511
|
+
get: function () { return chunkLZHCIK7L_cjs.isSettlementChildTypedData; }
|
|
512
512
|
});
|
|
513
513
|
Object.defineProperty(exports, "packedUserOperationHash", {
|
|
514
514
|
enumerable: true,
|
|
515
|
-
get: function () { return
|
|
515
|
+
get: function () { return chunkLZHCIK7L_cjs.packedUserOperationHash; }
|
|
516
516
|
});
|
|
517
517
|
Object.defineProperty(exports, "verifySettlementChild", {
|
|
518
518
|
enumerable: true,
|
|
519
|
-
get: function () { return
|
|
519
|
+
get: function () { return chunkLZHCIK7L_cjs.verifySettlementChild; }
|
|
520
520
|
});
|
|
521
521
|
exports.ERC20_PERIOD_TRANSFER_ENFORCER = ERC20_PERIOD_TRANSFER_ENFORCER;
|
|
522
522
|
exports.assertOwnSubBudgetChild = assertOwnSubBudgetChild;
|
package/dist/edge.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { V as AgentPaymentFailureCode, Z as AgentPaymentNextAction,
|
|
3
|
-
import { aW as DelegationForHashing } from './base64-
|
|
4
|
-
export { aX as CAVEAT_ENFORCERS, aY as CAVEAT_TYPEHASH, aZ as DELEGATION_MANAGER, a_ as DELEGATION_TYPEHASH, a$ as DIRECT_PAYMENT_CHAIN_IDS, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, b0 as EXECUTE_ABI, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, b1 as HYBRID_DELEGATOR_IMPLEMENTATION, H as HavenClientUpdate, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, b2 as MAX_SETTLEMENT_WINDOW_SECONDS, M as MAX_TASK_BUDGET_TTL_SECONDS, m as NextStep, o as NextStepHandoff, q as NextStepTarget, R as ROOT_AUTHORITY, b3 as SIMPLE_FACTORY_ADDRESS, z as SettlementChildExpectation, b4 as SettlementChildTypedData, a as SweepAuthorization, B as SweepExpectedAuth, T as TASK_SIGN_CONTEXT_VERSION, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, a0 as X402_PAYMENT_NONCE_TAG, a4 as assertBoundDirectPaymentUserOp, b5 as assertFundingLegPaysDelegate, b6 as assertOwnSettlementChild, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, b7 as chainIdForNetwork, ac as connectorRerunCommand, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, ao as hashDelegation, ap as havenClientIdentity, as as isPackedUserOperationTypedData, b8 as isSettlementChildTypedData, at as isSupportedNodeVersion, av as isTaskChildTypedData, ax as packedUserOperationHash, aB as readClientUpdate, aI as selectStandardPaymentOption, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aP as verifySettlementChild, aR as x402AuthorizationAmount, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-
|
|
1
|
+
import { aq as HavenSigningError } from './types-3vUBmumz.cjs';
|
|
2
|
+
export { V as AgentPaymentFailureCode, Z as AgentPaymentNextAction, al as HavenApiError, I as HavenError, as as HavenUnsupportedSignerVersionError, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aN as X402ExpectedAuth, aP as X402PaymentOption, X as X402PaymentRequired } from './types-3vUBmumz.cjs';
|
|
3
|
+
import { aW as DelegationForHashing } from './base64-C3mJNLYR.cjs';
|
|
4
|
+
export { aX as CAVEAT_ENFORCERS, aY as CAVEAT_TYPEHASH, aZ as DELEGATION_MANAGER, a_ as DELEGATION_TYPEHASH, a$ as DIRECT_PAYMENT_CHAIN_IDS, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, b0 as EXECUTE_ABI, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, b1 as HYBRID_DELEGATOR_IMPLEMENTATION, H as HavenClientUpdate, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, b2 as MAX_SETTLEMENT_WINDOW_SECONDS, M as MAX_TASK_BUDGET_TTL_SECONDS, m as NextStep, o as NextStepHandoff, q as NextStepTarget, R as ROOT_AUTHORITY, b3 as SIMPLE_FACTORY_ADDRESS, z as SettlementChildExpectation, b4 as SettlementChildTypedData, a as SweepAuthorization, B as SweepExpectedAuth, T as TASK_SIGN_CONTEXT_VERSION, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, a0 as X402_PAYMENT_NONCE_TAG, a4 as assertBoundDirectPaymentUserOp, b5 as assertFundingLegPaysDelegate, b6 as assertOwnSettlementChild, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, b7 as chainIdForNetwork, ac as connectorRerunCommand, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, ao as hashDelegation, ap as havenClientIdentity, as as isPackedUserOperationTypedData, b8 as isSettlementChildTypedData, at as isSupportedNodeVersion, av as isTaskChildTypedData, ax as packedUserOperationHash, aB as readClientUpdate, aI as selectStandardPaymentOption, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aP as verifySettlementChild, aR as x402AuthorizationAmount, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-C3mJNLYR.cjs';
|
|
5
5
|
import { Hex, Address } from 'viem';
|
|
6
6
|
import 'x402/types';
|
|
7
7
|
|
|
@@ -298,10 +298,13 @@ declare const REDEEM_DELEGATIONS_ABI: readonly [{
|
|
|
298
298
|
declare const SINGLE_DEFAULT_MODE: Hex;
|
|
299
299
|
/**
|
|
300
300
|
* Verify `redeemCalldata` (the bytes passed to `execute()`, selector already
|
|
301
|
-
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of
|
|
302
|
-
*
|
|
303
|
-
* someone else
|
|
304
|
-
* delegated to itself
|
|
301
|
+
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of
|
|
302
|
+
* Haven's three shapes: a single delegation redeemed by `ownAccount` and
|
|
303
|
+
* granted by someone else; (#3329) that grant behind one task-budget child
|
|
304
|
+
* `ownAccount` delegated to itself — the two-link [task child, budget]
|
|
305
|
+
* chain; or (#3330) a sub-budget grant redeemed under its parent's
|
|
306
|
+
* self-narrowing — the three-link [sub grant, parent child, budget] chain.
|
|
307
|
+
* In `SingleDefault` mode, with no encoding slack
|
|
305
308
|
* anywhere. Throws
|
|
306
309
|
* `HavenSigningError` (never returns) on any disagreement.
|
|
307
310
|
*/
|
package/dist/edge.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { V as AgentPaymentFailureCode, Z as AgentPaymentNextAction,
|
|
3
|
-
import { aW as DelegationForHashing } from './base64-
|
|
4
|
-
export { aX as CAVEAT_ENFORCERS, aY as CAVEAT_TYPEHASH, aZ as DELEGATION_MANAGER, a_ as DELEGATION_TYPEHASH, a$ as DIRECT_PAYMENT_CHAIN_IDS, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, b0 as EXECUTE_ABI, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, b1 as HYBRID_DELEGATOR_IMPLEMENTATION, H as HavenClientUpdate, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, b2 as MAX_SETTLEMENT_WINDOW_SECONDS, M as MAX_TASK_BUDGET_TTL_SECONDS, m as NextStep, o as NextStepHandoff, q as NextStepTarget, R as ROOT_AUTHORITY, b3 as SIMPLE_FACTORY_ADDRESS, z as SettlementChildExpectation, b4 as SettlementChildTypedData, a as SweepAuthorization, B as SweepExpectedAuth, T as TASK_SIGN_CONTEXT_VERSION, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, a0 as X402_PAYMENT_NONCE_TAG, a4 as assertBoundDirectPaymentUserOp, b5 as assertFundingLegPaysDelegate, b6 as assertOwnSettlementChild, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, b7 as chainIdForNetwork, ac as connectorRerunCommand, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, ao as hashDelegation, ap as havenClientIdentity, as as isPackedUserOperationTypedData, b8 as isSettlementChildTypedData, at as isSupportedNodeVersion, av as isTaskChildTypedData, ax as packedUserOperationHash, aB as readClientUpdate, aI as selectStandardPaymentOption, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aP as verifySettlementChild, aR as x402AuthorizationAmount, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-
|
|
1
|
+
import { aq as HavenSigningError } from './types-3vUBmumz.js';
|
|
2
|
+
export { V as AgentPaymentFailureCode, Z as AgentPaymentNextAction, al as HavenApiError, I as HavenError, as as HavenUnsupportedSignerVersionError, aH as SIGNER_UPDATE_FALLBACK, aI as SignerRefusalCode, aN as X402ExpectedAuth, aP as X402PaymentOption, X as X402PaymentRequired } from './types-3vUBmumz.js';
|
|
3
|
+
import { aW as DelegationForHashing } from './base64-CxzIc3KH.js';
|
|
4
|
+
export { aX as CAVEAT_ENFORCERS, aY as CAVEAT_TYPEHASH, aZ as DELEGATION_MANAGER, a_ as DELEGATION_TYPEHASH, a$ as DIRECT_PAYMENT_CHAIN_IDS, c as DIRECT_SIGN_CONTEXT_VERSION, E as ENTRY_POINT_V07, b0 as EXECUTE_ABI, e as HAVEN_CLIENT_HEADER, f as HAVEN_CONNECTOR_CHANNEL, g as HAVEN_MINIMUM_NODE_VERSION, b1 as HYBRID_DELEGATOR_IMPLEMENTATION, H as HavenClientUpdate, j as HavenTypedDataRefusedError, k as HavenUserOpBindingError, b2 as MAX_SETTLEMENT_WINDOW_SECONDS, M as MAX_TASK_BUDGET_TTL_SECONDS, m as NextStep, o as NextStepHandoff, q as NextStepTarget, R as ROOT_AUTHORITY, b3 as SIMPLE_FACTORY_ADDRESS, z as SettlementChildExpectation, b4 as SettlementChildTypedData, a as SweepAuthorization, B as SweepExpectedAuth, T as TASK_SIGN_CONTEXT_VERSION, K as TYPED_DATA_NOT_ALLOWED, L as TaskBudgetCloseExpectation, O as TaskChildExpectation, Q as TaskChildTypedData, a0 as X402_PAYMENT_NONCE_TAG, a4 as assertBoundDirectPaymentUserOp, b5 as assertFundingLegPaysDelegate, b6 as assertOwnSettlementChild, a5 as assertOwnTaskBudgetCloseUserOp, a6 as assertOwnTaskChild, a7 as assertUserOpTypedDataBinding, a8 as buildSweepAuthorizationMessage, a9 as buildSweepTypedData, aa as buildX402ExpectedMessage, b7 as chainIdForNetwork, ac as connectorRerunCommand, ae as connectorUpgradeCommand, af as createNextStepBuilder, ag as decodeBase64Json, aj as deriveDelegateAccountAddress, ak as deriveX402PaymentNonce, al as encodeBase64Json, ao as hashDelegation, ap as havenClientIdentity, as as isPackedUserOperationTypedData, b8 as isSettlementChildTypedData, at as isSupportedNodeVersion, av as isTaskChildTypedData, ax as packedUserOperationHash, aB as readClientUpdate, aI as selectStandardPaymentOption, aM as toStandardPaymentRequirements, aN as unsupportedNodeVersionMessage, aP as verifySettlementChild, aR as x402AuthorizationAmount, aT as x402PaymentHeaderNamesFor, aU as x402RetryHeadersFor, aV as x402V2PaymentEnvelope } from './base64-CxzIc3KH.js';
|
|
5
5
|
import { Hex, Address } from 'viem';
|
|
6
6
|
import 'x402/types';
|
|
7
7
|
|
|
@@ -298,10 +298,13 @@ declare const REDEEM_DELEGATIONS_ABI: readonly [{
|
|
|
298
298
|
declare const SINGLE_DEFAULT_MODE: Hex;
|
|
299
299
|
/**
|
|
300
300
|
* Verify `redeemCalldata` (the bytes passed to `execute()`, selector already
|
|
301
|
-
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of
|
|
302
|
-
*
|
|
303
|
-
* someone else
|
|
304
|
-
* delegated to itself
|
|
301
|
+
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of
|
|
302
|
+
* Haven's three shapes: a single delegation redeemed by `ownAccount` and
|
|
303
|
+
* granted by someone else; (#3329) that grant behind one task-budget child
|
|
304
|
+
* `ownAccount` delegated to itself — the two-link [task child, budget]
|
|
305
|
+
* chain; or (#3330) a sub-budget grant redeemed under its parent's
|
|
306
|
+
* self-narrowing — the three-link [sub grant, parent child, budget] chain.
|
|
307
|
+
* In `SingleDefault` mode, with no encoding slack
|
|
305
308
|
* anywhere. Throws
|
|
306
309
|
* `HavenSigningError` (never returns) on any disagreement.
|
|
307
310
|
*/
|