@haven_ai/sdk 0.5.0-alpha.1 → 0.6.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 +2 -1
- package/dist/{base64-BUMXmruY.d.cts → base64-cD9kR4JL.d.cts} +243 -16
- package/dist/{base64-BUMXmruY.d.ts → base64-cD9kR4JL.d.ts} +243 -16
- package/dist/{chunk-KQ7JXKTV.js → chunk-3WSEX3GW.js} +315 -6
- package/dist/chunk-3WSEX3GW.js.map +1 -0
- package/dist/{chunk-GLNG2GF7.js → chunk-63GPTEEY.js} +42 -6
- package/dist/chunk-63GPTEEY.js.map +1 -0
- package/dist/{chunk-QSSVOPWA.cjs → chunk-CK4NLLMO.cjs} +333 -17
- package/dist/chunk-CK4NLLMO.cjs.map +1 -0
- package/dist/{chunk-JKUIE45B.cjs → chunk-S42QSWJY.cjs} +42 -6
- package/dist/chunk-S42QSWJY.cjs.map +1 -0
- package/dist/edge.cjs +85 -57
- package/dist/edge.d.cts +24 -4
- package/dist/edge.d.ts +24 -4
- package/dist/edge.js +3 -3
- package/dist/index.cjs +485 -294
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +47 -3
- package/dist/index.d.ts +47 -3
- package/dist/index.js +192 -21
- package/dist/index.js.map +1 -1
- package/dist/test-support.cjs +18 -18
- package/dist/test-support.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-GLNG2GF7.js.map +0 -1
- package/dist/chunk-JKUIE45B.cjs.map +0 -1
- package/dist/chunk-KQ7JXKTV.js.map +0 -1
- package/dist/chunk-QSSVOPWA.cjs.map +0 -1
package/dist/edge.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkCK4NLLMO_cjs = require('./chunk-CK4NLLMO.cjs');
|
|
4
|
+
var chunkS42QSWJY_cjs = require('./chunk-S42QSWJY.cjs');
|
|
5
5
|
var secp256k1 = require('@noble/curves/secp256k1');
|
|
6
6
|
var accounts = require('viem/accounts');
|
|
7
7
|
var viem = require('viem');
|
|
@@ -17,7 +17,7 @@ function addressFromKey(privateKey) {
|
|
|
17
17
|
try {
|
|
18
18
|
return accounts.privateKeyToAddress(`0x${hexBytes(privateKey, 32, "private key")}`);
|
|
19
19
|
} catch (err) {
|
|
20
|
-
throw new
|
|
20
|
+
throw new chunkS42QSWJY_cjs.HavenSigningError(
|
|
21
21
|
`Invalid private key: ${err instanceof Error ? err.message : String(err)}`
|
|
22
22
|
);
|
|
23
23
|
}
|
|
@@ -31,7 +31,7 @@ function signHash(privateKey, hash) {
|
|
|
31
31
|
yParity: recovery
|
|
32
32
|
});
|
|
33
33
|
} catch (err) {
|
|
34
|
-
throw new
|
|
34
|
+
throw new chunkS42QSWJY_cjs.HavenSigningError(
|
|
35
35
|
`Failed to sign hash: ${err instanceof Error ? err.message : String(err)}`
|
|
36
36
|
);
|
|
37
37
|
}
|
|
@@ -52,217 +52,245 @@ function verifySignature(hash, signature, expectedAddress) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
Object.defineProperty(exports, "CAVEAT_TYPEHASH", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
get: function () { return chunkCK4NLLMO_cjs.CAVEAT_TYPEHASH; }
|
|
58
|
+
});
|
|
59
|
+
Object.defineProperty(exports, "DELEGATION_TYPEHASH", {
|
|
60
|
+
enumerable: true,
|
|
61
|
+
get: function () { return chunkCK4NLLMO_cjs.DELEGATION_TYPEHASH; }
|
|
62
|
+
});
|
|
55
63
|
Object.defineProperty(exports, "DIRECT_PAYMENT_CHAIN_IDS", {
|
|
56
64
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkCK4NLLMO_cjs.DIRECT_PAYMENT_CHAIN_IDS; }
|
|
58
66
|
});
|
|
59
67
|
Object.defineProperty(exports, "EXECUTE_ABI", {
|
|
60
68
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkCK4NLLMO_cjs.EXECUTE_ABI; }
|
|
62
70
|
});
|
|
63
71
|
Object.defineProperty(exports, "HAVEN_CLIENT_HEADER", {
|
|
64
72
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkCK4NLLMO_cjs.HAVEN_CLIENT_HEADER; }
|
|
66
74
|
});
|
|
67
75
|
Object.defineProperty(exports, "HAVEN_MINIMUM_NODE_VERSION", {
|
|
68
76
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkCK4NLLMO_cjs.HAVEN_MINIMUM_NODE_VERSION; }
|
|
70
78
|
});
|
|
71
79
|
Object.defineProperty(exports, "HavenTypedDataRefusedError", {
|
|
72
80
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkCK4NLLMO_cjs.HavenTypedDataRefusedError; }
|
|
82
|
+
});
|
|
83
|
+
Object.defineProperty(exports, "MAX_TASK_BUDGET_TTL_SECONDS", {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: function () { return chunkCK4NLLMO_cjs.MAX_TASK_BUDGET_TTL_SECONDS; }
|
|
74
86
|
});
|
|
75
87
|
Object.defineProperty(exports, "TYPED_DATA_NOT_ALLOWED", {
|
|
76
88
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkCK4NLLMO_cjs.TYPED_DATA_NOT_ALLOWED; }
|
|
78
90
|
});
|
|
79
91
|
Object.defineProperty(exports, "assertBoundDirectPaymentUserOp", {
|
|
80
92
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkCK4NLLMO_cjs.assertBoundDirectPaymentUserOp; }
|
|
82
94
|
});
|
|
83
95
|
Object.defineProperty(exports, "assertFundingLegPaysDelegate", {
|
|
84
96
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkCK4NLLMO_cjs.assertFundingLegPaysDelegate; }
|
|
86
98
|
});
|
|
87
99
|
Object.defineProperty(exports, "assertOwnSettlementChild", {
|
|
88
100
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkCK4NLLMO_cjs.assertOwnSettlementChild; }
|
|
102
|
+
});
|
|
103
|
+
Object.defineProperty(exports, "assertOwnTaskBudgetCloseUserOp", {
|
|
104
|
+
enumerable: true,
|
|
105
|
+
get: function () { return chunkCK4NLLMO_cjs.assertOwnTaskBudgetCloseUserOp; }
|
|
106
|
+
});
|
|
107
|
+
Object.defineProperty(exports, "assertOwnTaskChild", {
|
|
108
|
+
enumerable: true,
|
|
109
|
+
get: function () { return chunkCK4NLLMO_cjs.assertOwnTaskChild; }
|
|
90
110
|
});
|
|
91
111
|
Object.defineProperty(exports, "buildSweepAuthorizationMessage", {
|
|
92
112
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkCK4NLLMO_cjs.buildSweepAuthorizationMessage; }
|
|
94
114
|
});
|
|
95
115
|
Object.defineProperty(exports, "buildSweepTypedData", {
|
|
96
116
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkCK4NLLMO_cjs.buildSweepTypedData; }
|
|
98
118
|
});
|
|
99
119
|
Object.defineProperty(exports, "buildX402ExpectedMessage", {
|
|
100
120
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkCK4NLLMO_cjs.buildX402ExpectedMessage; }
|
|
102
122
|
});
|
|
103
123
|
Object.defineProperty(exports, "createNextStepBuilder", {
|
|
104
124
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkCK4NLLMO_cjs.createNextStepBuilder; }
|
|
106
126
|
});
|
|
107
127
|
Object.defineProperty(exports, "decodeBase64Json", {
|
|
108
128
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkCK4NLLMO_cjs.decodeBase64Json; }
|
|
110
130
|
});
|
|
111
131
|
Object.defineProperty(exports, "encodeBase64Json", {
|
|
112
132
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkCK4NLLMO_cjs.encodeBase64Json; }
|
|
134
|
+
});
|
|
135
|
+
Object.defineProperty(exports, "hashDelegation", {
|
|
136
|
+
enumerable: true,
|
|
137
|
+
get: function () { return chunkCK4NLLMO_cjs.hashDelegation; }
|
|
114
138
|
});
|
|
115
139
|
Object.defineProperty(exports, "havenClientIdentity", {
|
|
116
140
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkCK4NLLMO_cjs.havenClientIdentity; }
|
|
118
142
|
});
|
|
119
143
|
Object.defineProperty(exports, "isSupportedNodeVersion", {
|
|
120
144
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
145
|
+
get: function () { return chunkCK4NLLMO_cjs.isSupportedNodeVersion; }
|
|
146
|
+
});
|
|
147
|
+
Object.defineProperty(exports, "isTaskChildTypedData", {
|
|
148
|
+
enumerable: true,
|
|
149
|
+
get: function () { return chunkCK4NLLMO_cjs.isTaskChildTypedData; }
|
|
122
150
|
});
|
|
123
151
|
Object.defineProperty(exports, "readClientUpdate", {
|
|
124
152
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
153
|
+
get: function () { return chunkCK4NLLMO_cjs.readClientUpdate; }
|
|
126
154
|
});
|
|
127
155
|
Object.defineProperty(exports, "selectStandardPaymentOption", {
|
|
128
156
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
157
|
+
get: function () { return chunkCK4NLLMO_cjs.selectStandardPaymentOption; }
|
|
130
158
|
});
|
|
131
159
|
Object.defineProperty(exports, "toStandardPaymentRequirements", {
|
|
132
160
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
161
|
+
get: function () { return chunkCK4NLLMO_cjs.toStandardPaymentRequirements; }
|
|
134
162
|
});
|
|
135
163
|
Object.defineProperty(exports, "unsupportedNodeVersionMessage", {
|
|
136
164
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
165
|
+
get: function () { return chunkCK4NLLMO_cjs.unsupportedNodeVersionMessage; }
|
|
138
166
|
});
|
|
139
167
|
Object.defineProperty(exports, "x402AuthorizationAmount", {
|
|
140
168
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
169
|
+
get: function () { return chunkCK4NLLMO_cjs.x402AuthorizationAmount; }
|
|
142
170
|
});
|
|
143
171
|
Object.defineProperty(exports, "x402V2PaymentEnvelope", {
|
|
144
172
|
enumerable: true,
|
|
145
|
-
get: function () { return
|
|
173
|
+
get: function () { return chunkCK4NLLMO_cjs.x402V2PaymentEnvelope; }
|
|
146
174
|
});
|
|
147
175
|
Object.defineProperty(exports, "AgentPaymentFailureCode", {
|
|
148
176
|
enumerable: true,
|
|
149
|
-
get: function () { return
|
|
177
|
+
get: function () { return chunkS42QSWJY_cjs.AgentPaymentFailureCode; }
|
|
150
178
|
});
|
|
151
179
|
Object.defineProperty(exports, "AgentPaymentNextAction", {
|
|
152
180
|
enumerable: true,
|
|
153
|
-
get: function () { return
|
|
181
|
+
get: function () { return chunkS42QSWJY_cjs.AgentPaymentNextAction; }
|
|
154
182
|
});
|
|
155
183
|
Object.defineProperty(exports, "CAVEAT_ENFORCERS", {
|
|
156
184
|
enumerable: true,
|
|
157
|
-
get: function () { return
|
|
185
|
+
get: function () { return chunkS42QSWJY_cjs.CAVEAT_ENFORCERS; }
|
|
158
186
|
});
|
|
159
187
|
Object.defineProperty(exports, "DELEGATION_MANAGER", {
|
|
160
188
|
enumerable: true,
|
|
161
|
-
get: function () { return
|
|
189
|
+
get: function () { return chunkS42QSWJY_cjs.DELEGATION_MANAGER; }
|
|
162
190
|
});
|
|
163
191
|
Object.defineProperty(exports, "DELEGATION_TUPLE_COMPONENTS", {
|
|
164
192
|
enumerable: true,
|
|
165
|
-
get: function () { return
|
|
193
|
+
get: function () { return chunkS42QSWJY_cjs.DELEGATION_TUPLE_COMPONENTS; }
|
|
166
194
|
});
|
|
167
195
|
Object.defineProperty(exports, "DIRECT_SIGN_CONTEXT_VERSION", {
|
|
168
196
|
enumerable: true,
|
|
169
|
-
get: function () { return
|
|
197
|
+
get: function () { return chunkS42QSWJY_cjs.DIRECT_SIGN_CONTEXT_VERSION; }
|
|
170
198
|
});
|
|
171
199
|
Object.defineProperty(exports, "ENTRY_POINT_V07", {
|
|
172
200
|
enumerable: true,
|
|
173
|
-
get: function () { return
|
|
201
|
+
get: function () { return chunkS42QSWJY_cjs.ENTRY_POINT_V07; }
|
|
174
202
|
});
|
|
175
203
|
Object.defineProperty(exports, "HAVEN_CONNECTOR_CHANNEL", {
|
|
176
204
|
enumerable: true,
|
|
177
|
-
get: function () { return
|
|
205
|
+
get: function () { return chunkS42QSWJY_cjs.HAVEN_CONNECTOR_CHANNEL; }
|
|
178
206
|
});
|
|
179
207
|
Object.defineProperty(exports, "HYBRID_DELEGATOR_IMPLEMENTATION", {
|
|
180
208
|
enumerable: true,
|
|
181
|
-
get: function () { return
|
|
209
|
+
get: function () { return chunkS42QSWJY_cjs.HYBRID_DELEGATOR_IMPLEMENTATION; }
|
|
182
210
|
});
|
|
183
211
|
Object.defineProperty(exports, "HavenApiError", {
|
|
184
212
|
enumerable: true,
|
|
185
|
-
get: function () { return
|
|
213
|
+
get: function () { return chunkS42QSWJY_cjs.HavenApiError; }
|
|
186
214
|
});
|
|
187
215
|
Object.defineProperty(exports, "HavenError", {
|
|
188
216
|
enumerable: true,
|
|
189
|
-
get: function () { return
|
|
217
|
+
get: function () { return chunkS42QSWJY_cjs.HavenError; }
|
|
190
218
|
});
|
|
191
219
|
Object.defineProperty(exports, "HavenSigningError", {
|
|
192
220
|
enumerable: true,
|
|
193
|
-
get: function () { return
|
|
221
|
+
get: function () { return chunkS42QSWJY_cjs.HavenSigningError; }
|
|
194
222
|
});
|
|
195
223
|
Object.defineProperty(exports, "HavenUnsupportedSignerVersionError", {
|
|
196
224
|
enumerable: true,
|
|
197
|
-
get: function () { return
|
|
225
|
+
get: function () { return chunkS42QSWJY_cjs.HavenUnsupportedSignerVersionError; }
|
|
198
226
|
});
|
|
199
227
|
Object.defineProperty(exports, "HavenUserOpBindingError", {
|
|
200
228
|
enumerable: true,
|
|
201
|
-
get: function () { return
|
|
229
|
+
get: function () { return chunkS42QSWJY_cjs.HavenUserOpBindingError; }
|
|
202
230
|
});
|
|
203
231
|
Object.defineProperty(exports, "MAX_SETTLEMENT_WINDOW_SECONDS", {
|
|
204
232
|
enumerable: true,
|
|
205
|
-
get: function () { return
|
|
233
|
+
get: function () { return chunkS42QSWJY_cjs.MAX_SETTLEMENT_WINDOW_SECONDS; }
|
|
206
234
|
});
|
|
207
235
|
Object.defineProperty(exports, "REDEEM_DELEGATIONS_ABI", {
|
|
208
236
|
enumerable: true,
|
|
209
|
-
get: function () { return
|
|
237
|
+
get: function () { return chunkS42QSWJY_cjs.REDEEM_DELEGATIONS_ABI; }
|
|
210
238
|
});
|
|
211
239
|
Object.defineProperty(exports, "ROOT_AUTHORITY", {
|
|
212
240
|
enumerable: true,
|
|
213
|
-
get: function () { return
|
|
241
|
+
get: function () { return chunkS42QSWJY_cjs.ROOT_AUTHORITY; }
|
|
214
242
|
});
|
|
215
243
|
Object.defineProperty(exports, "SIGNER_UPDATE_FALLBACK", {
|
|
216
244
|
enumerable: true,
|
|
217
|
-
get: function () { return
|
|
245
|
+
get: function () { return chunkS42QSWJY_cjs.SIGNER_UPDATE_FALLBACK; }
|
|
218
246
|
});
|
|
219
247
|
Object.defineProperty(exports, "SIMPLE_FACTORY_ADDRESS", {
|
|
220
248
|
enumerable: true,
|
|
221
|
-
get: function () { return
|
|
249
|
+
get: function () { return chunkS42QSWJY_cjs.SIMPLE_FACTORY_ADDRESS; }
|
|
222
250
|
});
|
|
223
251
|
Object.defineProperty(exports, "SINGLE_DEFAULT_MODE", {
|
|
224
252
|
enumerable: true,
|
|
225
|
-
get: function () { return
|
|
253
|
+
get: function () { return chunkS42QSWJY_cjs.SINGLE_DEFAULT_MODE; }
|
|
226
254
|
});
|
|
227
255
|
Object.defineProperty(exports, "SignerRefusalCode", {
|
|
228
256
|
enumerable: true,
|
|
229
|
-
get: function () { return
|
|
257
|
+
get: function () { return chunkS42QSWJY_cjs.SignerRefusalCode; }
|
|
230
258
|
});
|
|
231
259
|
Object.defineProperty(exports, "assertRedeemsOwnBudgetDelegation", {
|
|
232
260
|
enumerable: true,
|
|
233
|
-
get: function () { return
|
|
261
|
+
get: function () { return chunkS42QSWJY_cjs.assertRedeemsOwnBudgetDelegation; }
|
|
234
262
|
});
|
|
235
263
|
Object.defineProperty(exports, "assertUserOpTypedDataBinding", {
|
|
236
264
|
enumerable: true,
|
|
237
|
-
get: function () { return
|
|
265
|
+
get: function () { return chunkS42QSWJY_cjs.assertUserOpTypedDataBinding; }
|
|
238
266
|
});
|
|
239
267
|
Object.defineProperty(exports, "chainIdForNetwork", {
|
|
240
268
|
enumerable: true,
|
|
241
|
-
get: function () { return
|
|
269
|
+
get: function () { return chunkS42QSWJY_cjs.chainIdForNetwork; }
|
|
242
270
|
});
|
|
243
271
|
Object.defineProperty(exports, "connectorRerunCommand", {
|
|
244
272
|
enumerable: true,
|
|
245
|
-
get: function () { return
|
|
273
|
+
get: function () { return chunkS42QSWJY_cjs.connectorRerunCommand; }
|
|
246
274
|
});
|
|
247
275
|
Object.defineProperty(exports, "deriveDelegateAccountAddress", {
|
|
248
276
|
enumerable: true,
|
|
249
|
-
get: function () { return
|
|
277
|
+
get: function () { return chunkS42QSWJY_cjs.deriveDelegateAccountAddress; }
|
|
250
278
|
});
|
|
251
279
|
Object.defineProperty(exports, "isPackedUserOperationTypedData", {
|
|
252
280
|
enumerable: true,
|
|
253
|
-
get: function () { return
|
|
281
|
+
get: function () { return chunkS42QSWJY_cjs.isPackedUserOperationTypedData; }
|
|
254
282
|
});
|
|
255
283
|
Object.defineProperty(exports, "isSettlementChildTypedData", {
|
|
256
284
|
enumerable: true,
|
|
257
|
-
get: function () { return
|
|
285
|
+
get: function () { return chunkS42QSWJY_cjs.isSettlementChildTypedData; }
|
|
258
286
|
});
|
|
259
287
|
Object.defineProperty(exports, "packedUserOperationHash", {
|
|
260
288
|
enumerable: true,
|
|
261
|
-
get: function () { return
|
|
289
|
+
get: function () { return chunkS42QSWJY_cjs.packedUserOperationHash; }
|
|
262
290
|
});
|
|
263
291
|
Object.defineProperty(exports, "verifySettlementChild", {
|
|
264
292
|
enumerable: true,
|
|
265
|
-
get: function () { return
|
|
293
|
+
get: function () { return chunkS42QSWJY_cjs.verifySettlementChild; }
|
|
266
294
|
});
|
|
267
295
|
exports.addressFromKey = addressFromKey;
|
|
268
296
|
exports.signHash = signHash;
|
package/dist/edge.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { U as AgentPaymentFailureCode, Y as AgentPaymentNextAction, cb as CAVEAT_ENFORCERS, cc as CAVEAT_TYPEHASH, cd as DELEGATION_MANAGER, ce as DELEGATION_TYPEHASH, cf as DIRECT_PAYMENT_CHAIN_IDS, ac as DIRECT_SIGN_CONTEXT_VERSION, cg as DelegationForHashing, ad as ENTRY_POINT_V07, ch as EXECUTE_ABI, af as HAVEN_CLIENT_HEADER, ag as HAVEN_CONNECTOR_CHANNEL, ah as HAVEN_MINIMUM_NODE_VERSION, ci as HYBRID_DELEGATOR_IMPLEMENTATION, an as HavenApiError, a as HavenClientUpdate, I as HavenError, ar as HavenSigningError, at as HavenTypedDataRefusedError, au as HavenUnsupportedSignerVersionError, av as HavenUserOpBindingError, cj as MAX_SETTLEMENT_WINDOW_SECONDS, ax as MAX_TASK_BUDGET_TTL_SECONDS, aC as NextStep, aE as NextStepHandoff, aG as NextStepTarget, aO as ROOT_AUTHORITY, aR as SIGNER_UPDATE_FALLBACK, ck as SIMPLE_FACTORY_ADDRESS, aW as SettlementChildExpectation, cl as SettlementChildTypedData, aX as SignerRefusalCode, j as SweepAuthorization, a$ as SweepExpectedAuth, b4 as TYPED_DATA_NOT_ALLOWED, b5 as TaskBudgetCloseExpectation, b6 as TaskChildExpectation, b7 as TaskChildTypedData, ba as X402ExpectedAuth, be as X402PaymentOption, X as X402PaymentRequired, bp as assertBoundDirectPaymentUserOp, cm as assertFundingLegPaysDelegate, cn as assertOwnSettlementChild, bq as assertOwnTaskBudgetCloseUserOp, br as assertOwnTaskChild, bs as assertUserOpTypedDataBinding, bt as buildSweepAuthorizationMessage, bu as buildSweepTypedData, bv as buildX402ExpectedMessage, co as chainIdForNetwork, bx as connectorRerunCommand, bz as createNextStepBuilder, bA as decodeBase64Json, bD as deriveDelegateAccountAddress, bE as encodeBase64Json, bH as hashDelegation, bI as havenClientIdentity, bL as isPackedUserOperationTypedData, cp as isSettlementChildTypedData, bM as isSupportedNodeVersion, bO as isTaskChildTypedData, bQ as packedUserOperationHash, bU as readClientUpdate, b_ as selectStandardPaymentOption, c3 as toStandardPaymentRequirements, c4 as unsupportedNodeVersionMessage, c6 as verifySettlementChild, c8 as x402AuthorizationAmount, ca as x402V2PaymentEnvelope } from './base64-cD9kR4JL.cjs';
|
|
2
2
|
import { Hex, Address } from 'viem';
|
|
3
3
|
import 'x402/types';
|
|
4
4
|
|
|
@@ -36,6 +36,24 @@ declare function verifySignature(hash: string, signature: string, expectedAddres
|
|
|
36
36
|
* `@metamask/delegation-abis`' `IDelegationManager` ABI (a devDependency
|
|
37
37
|
* only, in `@haven_ai/signer`'s `package.json`) and pinned against the kit's
|
|
38
38
|
* own encoder by `packages/signer/src/redemption-guard.pins.test.ts`.
|
|
39
|
+
*
|
|
40
|
+
* TASK BUDGETS (#3329) widen the accepted chain from exactly one link to ONE
|
|
41
|
+
* OR TWO: `[budget]` (unchanged) or `[task child, budget]` — leaf first, as
|
|
42
|
+
* everywhere else in this file. The two-link case is safe by the SAME
|
|
43
|
+
* reasoning as the one-link case, extended one hop: the task child's own
|
|
44
|
+
* `delegate` AND `delegator` are this signer's OWN account (a
|
|
45
|
+
* SELF-delegation — `assertOwnTaskChild` in `task-budget-guards.ts` is what
|
|
46
|
+
* proves its caveats narrow, never widen, the budget it chains under), and
|
|
47
|
+
* the budget link underneath it keeps the existing (3)/(4) shape: delegate ==
|
|
48
|
+
* own account, delegator != own account (a real grant from elsewhere). A
|
|
49
|
+
* chain redeemed this way can therefore only ever be AS OR MORE restrictive
|
|
50
|
+
* than redeeming the budget directly — the task child ADDS caveats (amount,
|
|
51
|
+
* recipient, expiry); it can never remove one, because
|
|
52
|
+
* `DelegationManager.redeemDelegations` ANDs every caveat of every link in
|
|
53
|
+
* the chain (the same AND-only property `settlement-child.ts`'s header
|
|
54
|
+
* documents). Any OTHER two-link chain — a leaf delegated by a third party, a
|
|
55
|
+
* leaf whose delegate is not this signer's own account, a chain longer than
|
|
56
|
+
* two — is refused exactly as before.
|
|
39
57
|
*/
|
|
40
58
|
|
|
41
59
|
/** `Delegation` — `(address delegate, address delegator, bytes32 authority, Caveat[] caveats, uint256 salt, bytes signature)`. */
|
|
@@ -95,9 +113,11 @@ declare const REDEEM_DELEGATIONS_ABI: readonly [{
|
|
|
95
113
|
declare const SINGLE_DEFAULT_MODE: Hex;
|
|
96
114
|
/**
|
|
97
115
|
* Verify `redeemCalldata` (the bytes passed to `execute()`, selector already
|
|
98
|
-
* confirmed to be `redeemDelegations` by the caller) is EXACTLY Haven's
|
|
99
|
-
*
|
|
100
|
-
*
|
|
116
|
+
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of Haven's
|
|
117
|
+
* two shapes: a single delegation redeemed by `ownAccount` and granted by
|
|
118
|
+
* someone else, or (#3329) that grant behind one task-budget child `ownAccount`
|
|
119
|
+
* delegated to itself; in `SingleDefault` mode, with no encoding slack
|
|
120
|
+
* anywhere. Throws
|
|
101
121
|
* `HavenSigningError` (never returns) on any disagreement.
|
|
102
122
|
*/
|
|
103
123
|
declare function assertRedeemsOwnBudgetDelegation(redeemCalldata: Hex, ownAccount: Address): void;
|
package/dist/edge.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { U as AgentPaymentFailureCode, Y as AgentPaymentNextAction, cb as CAVEAT_ENFORCERS, cc as CAVEAT_TYPEHASH, cd as DELEGATION_MANAGER, ce as DELEGATION_TYPEHASH, cf as DIRECT_PAYMENT_CHAIN_IDS, ac as DIRECT_SIGN_CONTEXT_VERSION, cg as DelegationForHashing, ad as ENTRY_POINT_V07, ch as EXECUTE_ABI, af as HAVEN_CLIENT_HEADER, ag as HAVEN_CONNECTOR_CHANNEL, ah as HAVEN_MINIMUM_NODE_VERSION, ci as HYBRID_DELEGATOR_IMPLEMENTATION, an as HavenApiError, a as HavenClientUpdate, I as HavenError, ar as HavenSigningError, at as HavenTypedDataRefusedError, au as HavenUnsupportedSignerVersionError, av as HavenUserOpBindingError, cj as MAX_SETTLEMENT_WINDOW_SECONDS, ax as MAX_TASK_BUDGET_TTL_SECONDS, aC as NextStep, aE as NextStepHandoff, aG as NextStepTarget, aO as ROOT_AUTHORITY, aR as SIGNER_UPDATE_FALLBACK, ck as SIMPLE_FACTORY_ADDRESS, aW as SettlementChildExpectation, cl as SettlementChildTypedData, aX as SignerRefusalCode, j as SweepAuthorization, a$ as SweepExpectedAuth, b4 as TYPED_DATA_NOT_ALLOWED, b5 as TaskBudgetCloseExpectation, b6 as TaskChildExpectation, b7 as TaskChildTypedData, ba as X402ExpectedAuth, be as X402PaymentOption, X as X402PaymentRequired, bp as assertBoundDirectPaymentUserOp, cm as assertFundingLegPaysDelegate, cn as assertOwnSettlementChild, bq as assertOwnTaskBudgetCloseUserOp, br as assertOwnTaskChild, bs as assertUserOpTypedDataBinding, bt as buildSweepAuthorizationMessage, bu as buildSweepTypedData, bv as buildX402ExpectedMessage, co as chainIdForNetwork, bx as connectorRerunCommand, bz as createNextStepBuilder, bA as decodeBase64Json, bD as deriveDelegateAccountAddress, bE as encodeBase64Json, bH as hashDelegation, bI as havenClientIdentity, bL as isPackedUserOperationTypedData, cp as isSettlementChildTypedData, bM as isSupportedNodeVersion, bO as isTaskChildTypedData, bQ as packedUserOperationHash, bU as readClientUpdate, b_ as selectStandardPaymentOption, c3 as toStandardPaymentRequirements, c4 as unsupportedNodeVersionMessage, c6 as verifySettlementChild, c8 as x402AuthorizationAmount, ca as x402V2PaymentEnvelope } from './base64-cD9kR4JL.js';
|
|
2
2
|
import { Hex, Address } from 'viem';
|
|
3
3
|
import 'x402/types';
|
|
4
4
|
|
|
@@ -36,6 +36,24 @@ declare function verifySignature(hash: string, signature: string, expectedAddres
|
|
|
36
36
|
* `@metamask/delegation-abis`' `IDelegationManager` ABI (a devDependency
|
|
37
37
|
* only, in `@haven_ai/signer`'s `package.json`) and pinned against the kit's
|
|
38
38
|
* own encoder by `packages/signer/src/redemption-guard.pins.test.ts`.
|
|
39
|
+
*
|
|
40
|
+
* TASK BUDGETS (#3329) widen the accepted chain from exactly one link to ONE
|
|
41
|
+
* OR TWO: `[budget]` (unchanged) or `[task child, budget]` — leaf first, as
|
|
42
|
+
* everywhere else in this file. The two-link case is safe by the SAME
|
|
43
|
+
* reasoning as the one-link case, extended one hop: the task child's own
|
|
44
|
+
* `delegate` AND `delegator` are this signer's OWN account (a
|
|
45
|
+
* SELF-delegation — `assertOwnTaskChild` in `task-budget-guards.ts` is what
|
|
46
|
+
* proves its caveats narrow, never widen, the budget it chains under), and
|
|
47
|
+
* the budget link underneath it keeps the existing (3)/(4) shape: delegate ==
|
|
48
|
+
* own account, delegator != own account (a real grant from elsewhere). A
|
|
49
|
+
* chain redeemed this way can therefore only ever be AS OR MORE restrictive
|
|
50
|
+
* than redeeming the budget directly — the task child ADDS caveats (amount,
|
|
51
|
+
* recipient, expiry); it can never remove one, because
|
|
52
|
+
* `DelegationManager.redeemDelegations` ANDs every caveat of every link in
|
|
53
|
+
* the chain (the same AND-only property `settlement-child.ts`'s header
|
|
54
|
+
* documents). Any OTHER two-link chain — a leaf delegated by a third party, a
|
|
55
|
+
* leaf whose delegate is not this signer's own account, a chain longer than
|
|
56
|
+
* two — is refused exactly as before.
|
|
39
57
|
*/
|
|
40
58
|
|
|
41
59
|
/** `Delegation` — `(address delegate, address delegator, bytes32 authority, Caveat[] caveats, uint256 salt, bytes signature)`. */
|
|
@@ -95,9 +113,11 @@ declare const REDEEM_DELEGATIONS_ABI: readonly [{
|
|
|
95
113
|
declare const SINGLE_DEFAULT_MODE: Hex;
|
|
96
114
|
/**
|
|
97
115
|
* Verify `redeemCalldata` (the bytes passed to `execute()`, selector already
|
|
98
|
-
* confirmed to be `redeemDelegations` by the caller) is EXACTLY Haven's
|
|
99
|
-
*
|
|
100
|
-
*
|
|
116
|
+
* confirmed to be `redeemDelegations` by the caller) is EXACTLY one of Haven's
|
|
117
|
+
* two shapes: a single delegation redeemed by `ownAccount` and granted by
|
|
118
|
+
* someone else, or (#3329) that grant behind one task-budget child `ownAccount`
|
|
119
|
+
* delegated to itself; in `SingleDefault` mode, with no encoding slack
|
|
120
|
+
* anywhere. Throws
|
|
101
121
|
* `HavenSigningError` (never returns) on any disagreement.
|
|
102
122
|
*/
|
|
103
123
|
declare function assertRedeemsOwnBudgetDelegation(redeemCalldata: Hex, ownAccount: Address): void;
|
package/dist/edge.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { DIRECT_PAYMENT_CHAIN_IDS, EXECUTE_ABI, HAVEN_CLIENT_HEADER, HAVEN_MINIMUM_NODE_VERSION, HavenTypedDataRefusedError, TYPED_DATA_NOT_ALLOWED, assertBoundDirectPaymentUserOp, assertFundingLegPaysDelegate, assertOwnSettlementChild, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, createNextStepBuilder, decodeBase64Json, encodeBase64Json, havenClientIdentity, isSupportedNodeVersion, readClientUpdate, selectStandardPaymentOption, toStandardPaymentRequirements, unsupportedNodeVersionMessage, x402AuthorizationAmount, x402V2PaymentEnvelope } from './chunk-
|
|
2
|
-
import { HavenSigningError } from './chunk-
|
|
3
|
-
export { AgentPaymentFailureCode, AgentPaymentNextAction, CAVEAT_ENFORCERS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenSigningError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, MAX_SETTLEMENT_WINDOW_SECONDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, deriveDelegateAccountAddress, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, verifySettlementChild } from './chunk-
|
|
1
|
+
export { CAVEAT_TYPEHASH, DELEGATION_TYPEHASH, DIRECT_PAYMENT_CHAIN_IDS, EXECUTE_ABI, HAVEN_CLIENT_HEADER, HAVEN_MINIMUM_NODE_VERSION, HavenTypedDataRefusedError, MAX_TASK_BUDGET_TTL_SECONDS, TYPED_DATA_NOT_ALLOWED, assertBoundDirectPaymentUserOp, assertFundingLegPaysDelegate, assertOwnSettlementChild, assertOwnTaskBudgetCloseUserOp, assertOwnTaskChild, buildSweepAuthorizationMessage, buildSweepTypedData, buildX402ExpectedMessage, createNextStepBuilder, decodeBase64Json, encodeBase64Json, hashDelegation, havenClientIdentity, isSupportedNodeVersion, isTaskChildTypedData, readClientUpdate, selectStandardPaymentOption, toStandardPaymentRequirements, unsupportedNodeVersionMessage, x402AuthorizationAmount, x402V2PaymentEnvelope } from './chunk-3WSEX3GW.js';
|
|
2
|
+
import { HavenSigningError } from './chunk-63GPTEEY.js';
|
|
3
|
+
export { AgentPaymentFailureCode, AgentPaymentNextAction, CAVEAT_ENFORCERS, DELEGATION_MANAGER, DELEGATION_TUPLE_COMPONENTS, DIRECT_SIGN_CONTEXT_VERSION, ENTRY_POINT_V07, HAVEN_CONNECTOR_CHANNEL, HYBRID_DELEGATOR_IMPLEMENTATION, HavenApiError, HavenError, HavenSigningError, HavenUnsupportedSignerVersionError, HavenUserOpBindingError, MAX_SETTLEMENT_WINDOW_SECONDS, REDEEM_DELEGATIONS_ABI, ROOT_AUTHORITY, SIGNER_UPDATE_FALLBACK, SIMPLE_FACTORY_ADDRESS, SINGLE_DEFAULT_MODE, SignerRefusalCode, assertRedeemsOwnBudgetDelegation, assertUserOpTypedDataBinding, chainIdForNetwork, connectorRerunCommand, deriveDelegateAccountAddress, isPackedUserOperationTypedData, isSettlementChildTypedData, packedUserOperationHash, verifySettlementChild } from './chunk-63GPTEEY.js';
|
|
4
4
|
import { secp256k1 } from '@noble/curves/secp256k1';
|
|
5
5
|
import { privateKeyToAddress, publicKeyToAddress } from 'viem/accounts';
|
|
6
6
|
import { serializeSignature } from 'viem';
|