@metamask/delegation-core 1.0.0 → 1.1.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/CHANGELOG.md +8 -1
- package/README.md +8 -8
- package/dist/index.cjs +525 -18
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +118 -62
- package/dist/index.d.ts +118 -62
- package/dist/index.mjs +529 -22
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -47,6 +47,52 @@ var normalizeAddressLowercase = (value, errorMessage) => {
|
|
|
47
47
|
var concatHex = (parts) => {
|
|
48
48
|
return `0x${parts.map(_utils.remove0x).join("")}`;
|
|
49
49
|
};
|
|
50
|
+
var extractBigInt = (value, offset, size) => {
|
|
51
|
+
const start = 2 + offset * 2;
|
|
52
|
+
const end = start + size * 2;
|
|
53
|
+
const slice = value.slice(start, end);
|
|
54
|
+
return BigInt(`0x${slice}`);
|
|
55
|
+
};
|
|
56
|
+
var extractNumber = (value, offset, size) => {
|
|
57
|
+
const bigIntValue = extractBigInt(value, offset, size);
|
|
58
|
+
if (bigIntValue > Number.MAX_SAFE_INTEGER) {
|
|
59
|
+
throw new Error("Number is too large");
|
|
60
|
+
}
|
|
61
|
+
return Number(bigIntValue);
|
|
62
|
+
};
|
|
63
|
+
var extractAddress = (value, offset) => {
|
|
64
|
+
const start = 2 + offset * 2;
|
|
65
|
+
const end = start + 40;
|
|
66
|
+
return `0x${value.slice(start, end)}`;
|
|
67
|
+
};
|
|
68
|
+
var extractHex = (value, offset, size) => {
|
|
69
|
+
const start = 2 + offset * 2;
|
|
70
|
+
const end = start + size * 2;
|
|
71
|
+
return `0x${value.slice(start, end)}`;
|
|
72
|
+
};
|
|
73
|
+
var extractRemainingHex = (value, offset) => {
|
|
74
|
+
const start = 2 + offset * 2;
|
|
75
|
+
return `0x${value.slice(start)}`;
|
|
76
|
+
};
|
|
77
|
+
function getByteLength(value) {
|
|
78
|
+
return (value.length - 2) / 2;
|
|
79
|
+
}
|
|
80
|
+
function assertHexByteExactLength(hexTerms, expectedBytes, errorMessage) {
|
|
81
|
+
if (getByteLength(hexTerms) !== expectedBytes) {
|
|
82
|
+
throw new Error(errorMessage);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
function assertHexByteLengthAtLeastOneMultipleOf(hexTerms, unitBytes, errorMessage) {
|
|
86
|
+
const byteLength = getByteLength(hexTerms);
|
|
87
|
+
if (byteLength === 0 || byteLength % unitBytes !== 0) {
|
|
88
|
+
throw new Error(errorMessage);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
function assertHexBytesMinLength(hexTerms, minBytes, errorMessage) {
|
|
92
|
+
if (getByteLength(hexTerms) < minBytes) {
|
|
93
|
+
throw new Error(errorMessage);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
50
96
|
|
|
51
97
|
// src/returns.ts
|
|
52
98
|
|
|
@@ -81,47 +127,64 @@ function createValueLteTerms(terms, options = defaultOptions) {
|
|
|
81
127
|
const hexValue = toHexString({ value: maxValue, size: 32 });
|
|
82
128
|
return prepareResult(hexValue, options);
|
|
83
129
|
}
|
|
130
|
+
function decodeValueLteTerms(terms) {
|
|
131
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
132
|
+
assertHexByteExactLength(
|
|
133
|
+
hexTerms,
|
|
134
|
+
32,
|
|
135
|
+
"Invalid ValueLte terms: must be exactly 32 bytes"
|
|
136
|
+
);
|
|
137
|
+
const maxValue = extractBigInt(hexTerms, 0, 32);
|
|
138
|
+
return { maxValue };
|
|
139
|
+
}
|
|
84
140
|
|
|
85
141
|
// src/caveats/timestamp.ts
|
|
86
142
|
var TIMESTAMP_UPPER_BOUND_SECONDS = 253402300799;
|
|
87
143
|
function createTimestampTerms(terms, encodingOptions = defaultOptions) {
|
|
88
|
-
const {
|
|
89
|
-
if (
|
|
90
|
-
throw new Error(
|
|
91
|
-
"Invalid timestampAfterThreshold: must be zero or positive"
|
|
92
|
-
);
|
|
144
|
+
const { afterThreshold, beforeThreshold } = terms;
|
|
145
|
+
if (afterThreshold < 0) {
|
|
146
|
+
throw new Error("Invalid afterThreshold: must be zero or positive");
|
|
93
147
|
}
|
|
94
|
-
if (
|
|
95
|
-
throw new Error(
|
|
96
|
-
"Invalid timestampBeforeThreshold: must be zero or positive"
|
|
97
|
-
);
|
|
148
|
+
if (beforeThreshold < 0) {
|
|
149
|
+
throw new Error("Invalid beforeThreshold: must be zero or positive");
|
|
98
150
|
}
|
|
99
|
-
if (
|
|
151
|
+
if (beforeThreshold > TIMESTAMP_UPPER_BOUND_SECONDS) {
|
|
100
152
|
throw new Error(
|
|
101
|
-
`Invalid
|
|
153
|
+
`Invalid beforeThreshold: must be less than or equal to ${TIMESTAMP_UPPER_BOUND_SECONDS}`
|
|
102
154
|
);
|
|
103
155
|
}
|
|
104
|
-
if (
|
|
156
|
+
if (afterThreshold > TIMESTAMP_UPPER_BOUND_SECONDS) {
|
|
105
157
|
throw new Error(
|
|
106
|
-
`Invalid
|
|
158
|
+
`Invalid afterThreshold: must be less than or equal to ${TIMESTAMP_UPPER_BOUND_SECONDS}`
|
|
107
159
|
);
|
|
108
160
|
}
|
|
109
|
-
if (
|
|
161
|
+
if (beforeThreshold !== 0 && afterThreshold >= beforeThreshold) {
|
|
110
162
|
throw new Error(
|
|
111
|
-
"Invalid thresholds:
|
|
163
|
+
"Invalid thresholds: beforeThreshold must be greater than afterThreshold when both are specified"
|
|
112
164
|
);
|
|
113
165
|
}
|
|
114
166
|
const afterThresholdHex = toHexString({
|
|
115
|
-
value:
|
|
167
|
+
value: afterThreshold,
|
|
116
168
|
size: 16
|
|
117
169
|
});
|
|
118
170
|
const beforeThresholdHex = toHexString({
|
|
119
|
-
value:
|
|
171
|
+
value: beforeThreshold,
|
|
120
172
|
size: 16
|
|
121
173
|
});
|
|
122
174
|
const hexValue = `0x${afterThresholdHex}${beforeThresholdHex}`;
|
|
123
175
|
return prepareResult(hexValue, encodingOptions);
|
|
124
176
|
}
|
|
177
|
+
function decodeTimestampTerms(terms) {
|
|
178
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
179
|
+
assertHexByteExactLength(
|
|
180
|
+
hexTerms,
|
|
181
|
+
32,
|
|
182
|
+
"Invalid Timestamp terms: must be exactly 32 bytes"
|
|
183
|
+
);
|
|
184
|
+
const afterThreshold = extractNumber(hexTerms, 0, 16);
|
|
185
|
+
const beforeThreshold = extractNumber(hexTerms, 16, 16);
|
|
186
|
+
return { afterThreshold, beforeThreshold };
|
|
187
|
+
}
|
|
125
188
|
|
|
126
189
|
// src/caveats/nativeTokenPeriodTransfer.ts
|
|
127
190
|
function createNativeTokenPeriodTransferTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -141,6 +204,18 @@ function createNativeTokenPeriodTransferTerms(terms, encodingOptions = defaultOp
|
|
|
141
204
|
const hexValue = `0x${periodAmountHex}${periodDurationHex}${startDateHex}`;
|
|
142
205
|
return prepareResult(hexValue, encodingOptions);
|
|
143
206
|
}
|
|
207
|
+
function decodeNativeTokenPeriodTransferTerms(terms) {
|
|
208
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
209
|
+
assertHexByteExactLength(
|
|
210
|
+
hexTerms,
|
|
211
|
+
96,
|
|
212
|
+
"Invalid NativeTokenPeriodTransfer terms: must be exactly 96 bytes"
|
|
213
|
+
);
|
|
214
|
+
const periodAmount = extractBigInt(hexTerms, 0, 32);
|
|
215
|
+
const periodDuration = extractNumber(hexTerms, 32, 32);
|
|
216
|
+
const startDate = extractNumber(hexTerms, 64, 32);
|
|
217
|
+
return { periodAmount, periodDuration, startDate };
|
|
218
|
+
}
|
|
144
219
|
|
|
145
220
|
// src/caveats/exactCalldata.ts
|
|
146
221
|
function createExactCalldataTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -153,6 +228,11 @@ function createExactCalldataTerms(terms, encodingOptions = defaultOptions) {
|
|
|
153
228
|
}
|
|
154
229
|
return prepareResult(calldata, encodingOptions);
|
|
155
230
|
}
|
|
231
|
+
function decodeExactCalldataTerms(terms, encodingOptions = defaultOptions) {
|
|
232
|
+
const calldataHex = bytesLikeToHex(terms);
|
|
233
|
+
const calldata = prepareResult(calldataHex, encodingOptions);
|
|
234
|
+
return { calldata };
|
|
235
|
+
}
|
|
156
236
|
|
|
157
237
|
// src/caveats/exactCalldataBatch.ts
|
|
158
238
|
var _abiutils = require('@metamask/abi-utils');
|
|
@@ -187,6 +267,18 @@ function createExactCalldataBatchTerms(terms, encodingOptions = defaultOptions)
|
|
|
187
267
|
const hexValue = _abiutils.encodeSingle.call(void 0, EXECUTION_ARRAY_ABI, encodableExecutions);
|
|
188
268
|
return prepareResult(hexValue, encodingOptions);
|
|
189
269
|
}
|
|
270
|
+
function decodeExactCalldataBatchTerms(terms, encodingOptions = defaultOptions) {
|
|
271
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
272
|
+
const decoded = _abiutils.decodeSingle.call(void 0, EXECUTION_ARRAY_ABI, hexTerms);
|
|
273
|
+
const executions = decoded.map(
|
|
274
|
+
([target, value, callData]) => ({
|
|
275
|
+
target: prepareResult(target, encodingOptions),
|
|
276
|
+
value,
|
|
277
|
+
callData: prepareResult(_utils.bytesToHex.call(void 0, callData), encodingOptions)
|
|
278
|
+
})
|
|
279
|
+
);
|
|
280
|
+
return { executions };
|
|
281
|
+
}
|
|
190
282
|
|
|
191
283
|
// src/caveats/exactExecution.ts
|
|
192
284
|
|
|
@@ -214,6 +306,24 @@ function createExactExecutionTerms(terms, encodingOptions = defaultOptions) {
|
|
|
214
306
|
const hexValue = concatHex([targetHex, valueHex, callDataHex]);
|
|
215
307
|
return prepareResult(hexValue, encodingOptions);
|
|
216
308
|
}
|
|
309
|
+
function decodeExactExecutionTerms(terms, encodingOptions = defaultOptions) {
|
|
310
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
311
|
+
assertHexBytesMinLength(
|
|
312
|
+
hexTerms,
|
|
313
|
+
52,
|
|
314
|
+
"Invalid ExactExecution terms: must be at least 52 bytes"
|
|
315
|
+
);
|
|
316
|
+
const targetHex = extractAddress(hexTerms, 0);
|
|
317
|
+
const value = extractBigInt(hexTerms, 20, 32);
|
|
318
|
+
const callDataHex = extractRemainingHex(hexTerms, 52);
|
|
319
|
+
return {
|
|
320
|
+
execution: {
|
|
321
|
+
target: prepareResult(targetHex, encodingOptions),
|
|
322
|
+
value,
|
|
323
|
+
callData: prepareResult(callDataHex, encodingOptions)
|
|
324
|
+
}
|
|
325
|
+
};
|
|
326
|
+
}
|
|
217
327
|
|
|
218
328
|
// src/caveats/exactExecutionBatch.ts
|
|
219
329
|
|
|
@@ -248,6 +358,18 @@ function createExactExecutionBatchTerms(terms, encodingOptions = defaultOptions)
|
|
|
248
358
|
const hexValue = _abiutils.encodeSingle.call(void 0, EXECUTION_ARRAY_ABI2, encodableExecutions);
|
|
249
359
|
return prepareResult(hexValue, encodingOptions);
|
|
250
360
|
}
|
|
361
|
+
function decodeExactExecutionBatchTerms(terms, encodingOptions = defaultOptions) {
|
|
362
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
363
|
+
const decoded = _abiutils.decodeSingle.call(void 0, EXECUTION_ARRAY_ABI2, hexTerms);
|
|
364
|
+
const executions = decoded.map(
|
|
365
|
+
([target, value, callData]) => ({
|
|
366
|
+
target: prepareResult(target, encodingOptions),
|
|
367
|
+
value,
|
|
368
|
+
callData: prepareResult(_utils.bytesToHex.call(void 0, callData), encodingOptions)
|
|
369
|
+
})
|
|
370
|
+
);
|
|
371
|
+
return { executions };
|
|
372
|
+
}
|
|
251
373
|
|
|
252
374
|
// src/caveats/nativeTokenStreaming.ts
|
|
253
375
|
var TIMESTAMP_UPPER_BOUND_SECONDS2 = 253402300799;
|
|
@@ -280,6 +402,19 @@ function createNativeTokenStreamingTerms(terms, encodingOptions = defaultOptions
|
|
|
280
402
|
const hexValue = `0x${initialAmountHex}${maxAmountHex}${amountPerSecondHex}${startTimeHex}`;
|
|
281
403
|
return prepareResult(hexValue, encodingOptions);
|
|
282
404
|
}
|
|
405
|
+
function decodeNativeTokenStreamingTerms(terms) {
|
|
406
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
407
|
+
assertHexByteExactLength(
|
|
408
|
+
hexTerms,
|
|
409
|
+
128,
|
|
410
|
+
"Invalid NativeTokenStreaming terms: must be exactly 128 bytes"
|
|
411
|
+
);
|
|
412
|
+
const initialAmount = extractBigInt(hexTerms, 0, 32);
|
|
413
|
+
const maxAmount = extractBigInt(hexTerms, 32, 32);
|
|
414
|
+
const amountPerSecond = extractBigInt(hexTerms, 64, 32);
|
|
415
|
+
const startTime = extractNumber(hexTerms, 96, 32);
|
|
416
|
+
return { initialAmount, maxAmount, amountPerSecond, startTime };
|
|
417
|
+
}
|
|
283
418
|
|
|
284
419
|
// src/caveats/nativeTokenTransferAmount.ts
|
|
285
420
|
function createNativeTokenTransferAmountTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -290,6 +425,16 @@ function createNativeTokenTransferAmountTerms(terms, encodingOptions = defaultOp
|
|
|
290
425
|
const hexValue = `0x${toHexString({ value: maxAmount, size: 32 })}`;
|
|
291
426
|
return prepareResult(hexValue, encodingOptions);
|
|
292
427
|
}
|
|
428
|
+
function decodeNativeTokenTransferAmountTerms(terms) {
|
|
429
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
430
|
+
assertHexByteExactLength(
|
|
431
|
+
hexTerms,
|
|
432
|
+
32,
|
|
433
|
+
"Invalid NativeTokenTransferAmount terms: must be exactly 32 bytes"
|
|
434
|
+
);
|
|
435
|
+
const maxAmount = extractBigInt(hexTerms, 0, 32);
|
|
436
|
+
return { maxAmount };
|
|
437
|
+
}
|
|
293
438
|
|
|
294
439
|
// src/caveats/nativeTokenPayment.ts
|
|
295
440
|
function createNativeTokenPaymentTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -305,6 +450,20 @@ function createNativeTokenPaymentTerms(terms, encodingOptions = defaultOptions)
|
|
|
305
450
|
const hexValue = concatHex([recipientHex, amountHex]);
|
|
306
451
|
return prepareResult(hexValue, encodingOptions);
|
|
307
452
|
}
|
|
453
|
+
function decodeNativeTokenPaymentTerms(terms, encodingOptions = defaultOptions) {
|
|
454
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
455
|
+
assertHexByteExactLength(
|
|
456
|
+
hexTerms,
|
|
457
|
+
52,
|
|
458
|
+
"Invalid NativeTokenPayment terms: must be exactly 52 bytes"
|
|
459
|
+
);
|
|
460
|
+
const recipientHex = extractAddress(hexTerms, 0);
|
|
461
|
+
const amount = extractBigInt(hexTerms, 20, 32);
|
|
462
|
+
return {
|
|
463
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
464
|
+
amount
|
|
465
|
+
};
|
|
466
|
+
}
|
|
308
467
|
|
|
309
468
|
// src/caveats/nativeBalanceChange.ts
|
|
310
469
|
function createNativeBalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -325,6 +484,22 @@ function createNativeBalanceChangeTerms(terms, encodingOptions = defaultOptions)
|
|
|
325
484
|
const hexValue = concatHex([changeTypeHex, recipientHex, balanceHex]);
|
|
326
485
|
return prepareResult(hexValue, encodingOptions);
|
|
327
486
|
}
|
|
487
|
+
function decodeNativeBalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
488
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
489
|
+
assertHexByteExactLength(
|
|
490
|
+
hexTerms,
|
|
491
|
+
53,
|
|
492
|
+
"Invalid NativeBalanceChange terms: must be exactly 53 bytes"
|
|
493
|
+
);
|
|
494
|
+
const changeType = extractNumber(hexTerms, 0, 1);
|
|
495
|
+
const recipientHex = extractAddress(hexTerms, 1);
|
|
496
|
+
const balance = extractBigInt(hexTerms, 21, 32);
|
|
497
|
+
return {
|
|
498
|
+
changeType,
|
|
499
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
500
|
+
balance
|
|
501
|
+
};
|
|
502
|
+
}
|
|
328
503
|
|
|
329
504
|
// src/caveats/erc20Streaming.ts
|
|
330
505
|
|
|
@@ -373,6 +548,26 @@ function createERC20StreamingTerms(terms, encodingOptions = defaultOptions) {
|
|
|
373
548
|
const hexValue = `${prefixedTokenAddressHex}${initialAmountHex}${maxAmountHex}${amountPerSecondHex}${startTimeHex}`;
|
|
374
549
|
return prepareResult(hexValue, encodingOptions);
|
|
375
550
|
}
|
|
551
|
+
function decodeERC20StreamingTerms(terms, encodingOptions = defaultOptions) {
|
|
552
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
553
|
+
assertHexByteExactLength(
|
|
554
|
+
hexTerms,
|
|
555
|
+
148,
|
|
556
|
+
"Invalid ERC20Streaming terms: must be exactly 148 bytes"
|
|
557
|
+
);
|
|
558
|
+
const tokenAddressHex = extractAddress(hexTerms, 0);
|
|
559
|
+
const initialAmount = extractBigInt(hexTerms, 20, 32);
|
|
560
|
+
const maxAmount = extractBigInt(hexTerms, 52, 32);
|
|
561
|
+
const amountPerSecond = extractBigInt(hexTerms, 84, 32);
|
|
562
|
+
const startTime = extractNumber(hexTerms, 116, 32);
|
|
563
|
+
return {
|
|
564
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
565
|
+
initialAmount,
|
|
566
|
+
maxAmount,
|
|
567
|
+
amountPerSecond,
|
|
568
|
+
startTime
|
|
569
|
+
};
|
|
570
|
+
}
|
|
376
571
|
|
|
377
572
|
// src/caveats/erc20TokenPeriodTransfer.ts
|
|
378
573
|
|
|
@@ -408,6 +603,24 @@ function createERC20TokenPeriodTransferTerms(terms, encodingOptions = defaultOpt
|
|
|
408
603
|
const hexValue = `${prefixedTokenAddressHex}${periodAmountHex}${periodDurationHex}${startDateHex}`;
|
|
409
604
|
return prepareResult(hexValue, encodingOptions);
|
|
410
605
|
}
|
|
606
|
+
function decodeERC20TokenPeriodTransferTerms(terms, encodingOptions = defaultOptions) {
|
|
607
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
608
|
+
assertHexByteExactLength(
|
|
609
|
+
hexTerms,
|
|
610
|
+
116,
|
|
611
|
+
"Invalid ERC20TokenPeriodTransfer terms: must be exactly 116 bytes"
|
|
612
|
+
);
|
|
613
|
+
const tokenAddressHex = extractAddress(hexTerms, 0);
|
|
614
|
+
const periodAmount = extractBigInt(hexTerms, 20, 32);
|
|
615
|
+
const periodDuration = extractNumber(hexTerms, 52, 32);
|
|
616
|
+
const startDate = extractNumber(hexTerms, 84, 32);
|
|
617
|
+
return {
|
|
618
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
619
|
+
periodAmount,
|
|
620
|
+
periodDuration,
|
|
621
|
+
startDate
|
|
622
|
+
};
|
|
623
|
+
}
|
|
411
624
|
|
|
412
625
|
// src/caveats/erc20TransferAmount.ts
|
|
413
626
|
function createERC20TransferAmountTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -423,6 +636,20 @@ function createERC20TransferAmountTerms(terms, encodingOptions = defaultOptions)
|
|
|
423
636
|
const hexValue = concatHex([tokenAddressHex, maxAmountHex]);
|
|
424
637
|
return prepareResult(hexValue, encodingOptions);
|
|
425
638
|
}
|
|
639
|
+
function decodeERC20TransferAmountTerms(terms, encodingOptions = defaultOptions) {
|
|
640
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
641
|
+
assertHexByteExactLength(
|
|
642
|
+
hexTerms,
|
|
643
|
+
52,
|
|
644
|
+
"Invalid ERC20TransferAmount terms: must be exactly 52 bytes"
|
|
645
|
+
);
|
|
646
|
+
const tokenAddressHex = extractAddress(hexTerms, 0);
|
|
647
|
+
const maxAmount = extractBigInt(hexTerms, 20, 32);
|
|
648
|
+
return {
|
|
649
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
650
|
+
maxAmount
|
|
651
|
+
};
|
|
652
|
+
}
|
|
426
653
|
|
|
427
654
|
// src/caveats/erc20BalanceChange.ts
|
|
428
655
|
function createERC20BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -457,6 +684,24 @@ function createERC20BalanceChangeTerms(terms, encodingOptions = defaultOptions)
|
|
|
457
684
|
]);
|
|
458
685
|
return prepareResult(hexValue, encodingOptions);
|
|
459
686
|
}
|
|
687
|
+
function decodeERC20BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
688
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
689
|
+
assertHexByteExactLength(
|
|
690
|
+
hexTerms,
|
|
691
|
+
73,
|
|
692
|
+
"Invalid ERC20BalanceChange terms: must be exactly 73 bytes"
|
|
693
|
+
);
|
|
694
|
+
const changeType = extractNumber(hexTerms, 0, 1);
|
|
695
|
+
const tokenAddressHex = extractAddress(hexTerms, 1);
|
|
696
|
+
const recipientHex = extractAddress(hexTerms, 21);
|
|
697
|
+
const balance = extractBigInt(hexTerms, 41, 32);
|
|
698
|
+
return {
|
|
699
|
+
changeType,
|
|
700
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
701
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
702
|
+
balance
|
|
703
|
+
};
|
|
704
|
+
}
|
|
460
705
|
|
|
461
706
|
// src/caveats/erc721BalanceChange.ts
|
|
462
707
|
function createERC721BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -491,6 +736,24 @@ function createERC721BalanceChangeTerms(terms, encodingOptions = defaultOptions)
|
|
|
491
736
|
]);
|
|
492
737
|
return prepareResult(hexValue, encodingOptions);
|
|
493
738
|
}
|
|
739
|
+
function decodeERC721BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
740
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
741
|
+
assertHexByteExactLength(
|
|
742
|
+
hexTerms,
|
|
743
|
+
73,
|
|
744
|
+
"Invalid ERC721BalanceChange terms: must be exactly 73 bytes"
|
|
745
|
+
);
|
|
746
|
+
const changeType = extractNumber(hexTerms, 0, 1);
|
|
747
|
+
const tokenAddressHex = extractAddress(hexTerms, 1);
|
|
748
|
+
const recipientHex = extractAddress(hexTerms, 21);
|
|
749
|
+
const amount = extractBigInt(hexTerms, 41, 32);
|
|
750
|
+
return {
|
|
751
|
+
changeType,
|
|
752
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
753
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
754
|
+
amount
|
|
755
|
+
};
|
|
756
|
+
}
|
|
494
757
|
|
|
495
758
|
// src/caveats/erc721Transfer.ts
|
|
496
759
|
function createERC721TransferTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -506,6 +769,20 @@ function createERC721TransferTerms(terms, encodingOptions = defaultOptions) {
|
|
|
506
769
|
const hexValue = concatHex([tokenAddressHex, tokenIdHex]);
|
|
507
770
|
return prepareResult(hexValue, encodingOptions);
|
|
508
771
|
}
|
|
772
|
+
function decodeERC721TransferTerms(terms, encodingOptions = defaultOptions) {
|
|
773
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
774
|
+
assertHexByteExactLength(
|
|
775
|
+
hexTerms,
|
|
776
|
+
52,
|
|
777
|
+
"Invalid ERC721Transfer terms: must be exactly 52 bytes"
|
|
778
|
+
);
|
|
779
|
+
const tokenAddressHex = extractAddress(hexTerms, 0);
|
|
780
|
+
const tokenId = extractBigInt(hexTerms, 20, 32);
|
|
781
|
+
return {
|
|
782
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
783
|
+
tokenId
|
|
784
|
+
};
|
|
785
|
+
}
|
|
509
786
|
|
|
510
787
|
// src/caveats/erc1155BalanceChange.ts
|
|
511
788
|
function createERC1155BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -546,6 +823,26 @@ function createERC1155BalanceChangeTerms(terms, encodingOptions = defaultOptions
|
|
|
546
823
|
]);
|
|
547
824
|
return prepareResult(hexValue, encodingOptions);
|
|
548
825
|
}
|
|
826
|
+
function decodeERC1155BalanceChangeTerms(terms, encodingOptions = defaultOptions) {
|
|
827
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
828
|
+
assertHexByteExactLength(
|
|
829
|
+
hexTerms,
|
|
830
|
+
105,
|
|
831
|
+
"Invalid ERC1155BalanceChange terms: must be exactly 105 bytes"
|
|
832
|
+
);
|
|
833
|
+
const changeType = extractNumber(hexTerms, 0, 1);
|
|
834
|
+
const tokenAddressHex = extractAddress(hexTerms, 1);
|
|
835
|
+
const recipientHex = extractAddress(hexTerms, 21);
|
|
836
|
+
const tokenId = extractBigInt(hexTerms, 41, 32);
|
|
837
|
+
const balance = extractBigInt(hexTerms, 73, 32);
|
|
838
|
+
return {
|
|
839
|
+
changeType,
|
|
840
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
841
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
842
|
+
tokenId,
|
|
843
|
+
balance
|
|
844
|
+
};
|
|
845
|
+
}
|
|
549
846
|
|
|
550
847
|
// src/caveats/nonce.ts
|
|
551
848
|
|
|
@@ -573,6 +870,16 @@ function createNonceTerms(terms, encodingOptions = defaultOptions) {
|
|
|
573
870
|
const hexValue = `0x${paddedNonce}`;
|
|
574
871
|
return prepareResult(hexValue, encodingOptions);
|
|
575
872
|
}
|
|
873
|
+
function decodeNonceTerms(terms, encodingOptions = defaultOptions) {
|
|
874
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
875
|
+
assertHexByteExactLength(
|
|
876
|
+
hexTerms,
|
|
877
|
+
32,
|
|
878
|
+
"Invalid Nonce terms: must be exactly 32 bytes"
|
|
879
|
+
);
|
|
880
|
+
const nonce = prepareResult(hexTerms, encodingOptions);
|
|
881
|
+
return { nonce };
|
|
882
|
+
}
|
|
576
883
|
|
|
577
884
|
// src/caveats/allowedCalldata.ts
|
|
578
885
|
|
|
@@ -596,6 +903,18 @@ function createAllowedCalldataTerms(terms, encodingOptions = defaultOptions) {
|
|
|
596
903
|
const indexHex = toHexString({ value: startIndex, size: 32 });
|
|
597
904
|
return prepareResult(`0x${indexHex}${unprefixedValue}`, encodingOptions);
|
|
598
905
|
}
|
|
906
|
+
function decodeAllowedCalldataTerms(terms, encodingOptions = defaultOptions) {
|
|
907
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
908
|
+
assertHexBytesMinLength(
|
|
909
|
+
hexTerms,
|
|
910
|
+
32,
|
|
911
|
+
"Invalid AllowedCalldata terms: must be at least 32 bytes"
|
|
912
|
+
);
|
|
913
|
+
const startIndex = extractNumber(hexTerms, 0, 32);
|
|
914
|
+
const valueHex = extractRemainingHex(hexTerms, 32);
|
|
915
|
+
const value = prepareResult(valueHex, encodingOptions);
|
|
916
|
+
return { startIndex, value };
|
|
917
|
+
}
|
|
599
918
|
|
|
600
919
|
// src/caveats/allowedMethods.ts
|
|
601
920
|
|
|
@@ -621,6 +940,22 @@ function createAllowedMethodsTerms(terms, encodingOptions = defaultOptions) {
|
|
|
621
940
|
const hexValue = concatHex(normalizedSelectors);
|
|
622
941
|
return prepareResult(hexValue, encodingOptions);
|
|
623
942
|
}
|
|
943
|
+
function decodeAllowedMethodsTerms(terms, encodingOptions = defaultOptions) {
|
|
944
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
945
|
+
const selectorSize = 4;
|
|
946
|
+
assertHexByteLengthAtLeastOneMultipleOf(
|
|
947
|
+
hexTerms,
|
|
948
|
+
selectorSize,
|
|
949
|
+
"Invalid selectors: must be a multiple of 4"
|
|
950
|
+
);
|
|
951
|
+
const selectorCount = getByteLength(hexTerms) / selectorSize;
|
|
952
|
+
const selectors = [];
|
|
953
|
+
for (let i = 0; i < selectorCount; i++) {
|
|
954
|
+
const selector = extractHex(hexTerms, i * selectorSize, selectorSize);
|
|
955
|
+
selectors.push(prepareResult(selector, encodingOptions));
|
|
956
|
+
}
|
|
957
|
+
return { selectors };
|
|
958
|
+
}
|
|
624
959
|
|
|
625
960
|
// src/caveats/allowedTargets.ts
|
|
626
961
|
function createAllowedTargetsTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -636,6 +971,22 @@ function createAllowedTargetsTerms(terms, encodingOptions = defaultOptions) {
|
|
|
636
971
|
const hexValue = concatHex(normalizedTargets);
|
|
637
972
|
return prepareResult(hexValue, encodingOptions);
|
|
638
973
|
}
|
|
974
|
+
function decodeAllowedTargetsTerms(terms, encodingOptions = defaultOptions) {
|
|
975
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
976
|
+
const addressSize = 20;
|
|
977
|
+
assertHexByteLengthAtLeastOneMultipleOf(
|
|
978
|
+
hexTerms,
|
|
979
|
+
addressSize,
|
|
980
|
+
"Invalid targets: must be a multiple of 20"
|
|
981
|
+
);
|
|
982
|
+
const addressCount = getByteLength(hexTerms) / addressSize;
|
|
983
|
+
const targets = [];
|
|
984
|
+
for (let i = 0; i < addressCount; i++) {
|
|
985
|
+
const target = extractAddress(hexTerms, i * addressSize);
|
|
986
|
+
targets.push(prepareResult(target, encodingOptions));
|
|
987
|
+
}
|
|
988
|
+
return { targets };
|
|
989
|
+
}
|
|
639
990
|
|
|
640
991
|
// src/caveats/argsEqualityCheck.ts
|
|
641
992
|
function createArgsEqualityCheckTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -649,6 +1000,11 @@ function createArgsEqualityCheckTerms(terms, encodingOptions = defaultOptions) {
|
|
|
649
1000
|
);
|
|
650
1001
|
return prepareResult(hexValue, encodingOptions);
|
|
651
1002
|
}
|
|
1003
|
+
function decodeArgsEqualityCheckTerms(terms, encodingOptions = defaultOptions) {
|
|
1004
|
+
const argsHex = bytesLikeToHex(terms);
|
|
1005
|
+
const args = prepareResult(argsHex, encodingOptions);
|
|
1006
|
+
return { args };
|
|
1007
|
+
}
|
|
652
1008
|
|
|
653
1009
|
// src/caveats/blockNumber.ts
|
|
654
1010
|
function createBlockNumberTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -671,6 +1027,17 @@ function createBlockNumberTerms(terms, encodingOptions = defaultOptions) {
|
|
|
671
1027
|
const hexValue = `0x${afterThresholdHex}${beforeThresholdHex}`;
|
|
672
1028
|
return prepareResult(hexValue, encodingOptions);
|
|
673
1029
|
}
|
|
1030
|
+
function decodeBlockNumberTerms(terms) {
|
|
1031
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1032
|
+
assertHexByteExactLength(
|
|
1033
|
+
hexTerms,
|
|
1034
|
+
32,
|
|
1035
|
+
"Invalid BlockNumber terms: must be exactly 32 bytes"
|
|
1036
|
+
);
|
|
1037
|
+
const afterThreshold = extractBigInt(hexTerms, 0, 16);
|
|
1038
|
+
const beforeThreshold = extractBigInt(hexTerms, 16, 16);
|
|
1039
|
+
return { afterThreshold, beforeThreshold };
|
|
1040
|
+
}
|
|
674
1041
|
|
|
675
1042
|
// src/caveats/deployed.ts
|
|
676
1043
|
|
|
@@ -696,6 +1063,22 @@ function createDeployedTerms(terms, encodingOptions = defaultOptions) {
|
|
|
696
1063
|
const hexValue = concatHex([contractAddressHex, paddedSalt, bytecodeHex]);
|
|
697
1064
|
return prepareResult(hexValue, encodingOptions);
|
|
698
1065
|
}
|
|
1066
|
+
function decodeDeployedTerms(terms, encodingOptions = defaultOptions) {
|
|
1067
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1068
|
+
assertHexBytesMinLength(
|
|
1069
|
+
hexTerms,
|
|
1070
|
+
52,
|
|
1071
|
+
"Invalid Deployed terms: must be at least 52 bytes"
|
|
1072
|
+
);
|
|
1073
|
+
const contractAddressHex = extractAddress(hexTerms, 0);
|
|
1074
|
+
const saltHex = extractHex(hexTerms, 20, 32);
|
|
1075
|
+
const bytecodeHex = extractRemainingHex(hexTerms, 52);
|
|
1076
|
+
return {
|
|
1077
|
+
contractAddress: prepareResult(contractAddressHex, encodingOptions),
|
|
1078
|
+
salt: prepareResult(saltHex, encodingOptions),
|
|
1079
|
+
bytecode: prepareResult(bytecodeHex, encodingOptions)
|
|
1080
|
+
};
|
|
1081
|
+
}
|
|
699
1082
|
|
|
700
1083
|
// src/caveats/id.ts
|
|
701
1084
|
var MAX_UINT256 = BigInt(`0x${"f".repeat(64)}`);
|
|
@@ -721,6 +1104,16 @@ function createIdTerms(terms, encodingOptions = defaultOptions) {
|
|
|
721
1104
|
const hexValue = `0x${toHexString({ value: idBigInt, size: 32 })}`;
|
|
722
1105
|
return prepareResult(hexValue, encodingOptions);
|
|
723
1106
|
}
|
|
1107
|
+
function decodeIdTerms(terms) {
|
|
1108
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1109
|
+
assertHexByteExactLength(
|
|
1110
|
+
hexTerms,
|
|
1111
|
+
32,
|
|
1112
|
+
"Invalid Id terms: must be exactly 32 bytes"
|
|
1113
|
+
);
|
|
1114
|
+
const id = extractBigInt(hexTerms, 0, 32);
|
|
1115
|
+
return { id };
|
|
1116
|
+
}
|
|
724
1117
|
|
|
725
1118
|
// src/caveats/limitedCalls.ts
|
|
726
1119
|
function createLimitedCallsTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -734,6 +1127,16 @@ function createLimitedCallsTerms(terms, encodingOptions = defaultOptions) {
|
|
|
734
1127
|
const hexValue = `0x${toHexString({ value: limit, size: 32 })}`;
|
|
735
1128
|
return prepareResult(hexValue, encodingOptions);
|
|
736
1129
|
}
|
|
1130
|
+
function decodeLimitedCallsTerms(terms) {
|
|
1131
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1132
|
+
assertHexByteExactLength(
|
|
1133
|
+
hexTerms,
|
|
1134
|
+
32,
|
|
1135
|
+
"Invalid LimitedCalls terms: must be exactly 32 bytes"
|
|
1136
|
+
);
|
|
1137
|
+
const limit = extractNumber(hexTerms, 0, 32);
|
|
1138
|
+
return { limit };
|
|
1139
|
+
}
|
|
737
1140
|
|
|
738
1141
|
// src/caveats/multiTokenPeriod.ts
|
|
739
1142
|
function createMultiTokenPeriodTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -768,6 +1171,31 @@ function createMultiTokenPeriodTerms(terms, encodingOptions = defaultOptions) {
|
|
|
768
1171
|
const hexValue = concatHex(hexParts);
|
|
769
1172
|
return prepareResult(hexValue, encodingOptions);
|
|
770
1173
|
}
|
|
1174
|
+
function decodeMultiTokenPeriodTerms(terms, encodingOptions = defaultOptions) {
|
|
1175
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1176
|
+
const configSize = 116;
|
|
1177
|
+
assertHexByteLengthAtLeastOneMultipleOf(
|
|
1178
|
+
hexTerms,
|
|
1179
|
+
configSize,
|
|
1180
|
+
"Invalid MultiTokenPeriod terms: must be a multiple of 116 bytes"
|
|
1181
|
+
);
|
|
1182
|
+
const configCount = getByteLength(hexTerms) / configSize;
|
|
1183
|
+
const tokenConfigs = [];
|
|
1184
|
+
for (let i = 0; i < configCount; i++) {
|
|
1185
|
+
const offset = i * configSize;
|
|
1186
|
+
const tokenHex = extractAddress(hexTerms, offset);
|
|
1187
|
+
const periodAmount = extractBigInt(hexTerms, offset + 20, 32);
|
|
1188
|
+
const periodDuration = extractNumber(hexTerms, offset + 52, 32);
|
|
1189
|
+
const startDate = extractNumber(hexTerms, offset + 84, 32);
|
|
1190
|
+
tokenConfigs.push({
|
|
1191
|
+
token: prepareResult(tokenHex, encodingOptions),
|
|
1192
|
+
periodAmount,
|
|
1193
|
+
periodDuration,
|
|
1194
|
+
startDate
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
return { tokenConfigs };
|
|
1198
|
+
}
|
|
771
1199
|
|
|
772
1200
|
// src/caveats/ownershipTransfer.ts
|
|
773
1201
|
function createOwnershipTransferTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -778,6 +1206,18 @@ function createOwnershipTransferTerms(terms, encodingOptions = defaultOptions) {
|
|
|
778
1206
|
);
|
|
779
1207
|
return prepareResult(contractAddressHex, encodingOptions);
|
|
780
1208
|
}
|
|
1209
|
+
function decodeOwnershipTransferTerms(terms, encodingOptions = defaultOptions) {
|
|
1210
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1211
|
+
assertHexByteExactLength(
|
|
1212
|
+
hexTerms,
|
|
1213
|
+
20,
|
|
1214
|
+
"Invalid OwnershipTransfer terms: must be exactly 20 bytes"
|
|
1215
|
+
);
|
|
1216
|
+
const contractAddressHex = extractAddress(hexTerms, 0);
|
|
1217
|
+
return {
|
|
1218
|
+
contractAddress: prepareResult(contractAddressHex, encodingOptions)
|
|
1219
|
+
};
|
|
1220
|
+
}
|
|
781
1221
|
|
|
782
1222
|
// src/caveats/redeemer.ts
|
|
783
1223
|
function createRedeemerTerms(terms, encodingOptions = defaultOptions) {
|
|
@@ -793,6 +1233,22 @@ function createRedeemerTerms(terms, encodingOptions = defaultOptions) {
|
|
|
793
1233
|
const hexValue = concatHex(normalizedRedeemers);
|
|
794
1234
|
return prepareResult(hexValue, encodingOptions);
|
|
795
1235
|
}
|
|
1236
|
+
function decodeRedeemerTerms(terms, encodingOptions = defaultOptions) {
|
|
1237
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1238
|
+
const addressSize = 20;
|
|
1239
|
+
assertHexByteLengthAtLeastOneMultipleOf(
|
|
1240
|
+
hexTerms,
|
|
1241
|
+
addressSize,
|
|
1242
|
+
"Invalid redeemers: must be a multiple of 20"
|
|
1243
|
+
);
|
|
1244
|
+
const addressCount = getByteLength(hexTerms) / addressSize;
|
|
1245
|
+
const redeemers = [];
|
|
1246
|
+
for (let i = 0; i < addressCount; i++) {
|
|
1247
|
+
const redeemer = extractAddress(hexTerms, i * addressSize);
|
|
1248
|
+
redeemers.push(prepareResult(redeemer, encodingOptions));
|
|
1249
|
+
}
|
|
1250
|
+
return { redeemers };
|
|
1251
|
+
}
|
|
796
1252
|
|
|
797
1253
|
// src/caveats/specificActionERC20TransferBatch.ts
|
|
798
1254
|
|
|
@@ -834,6 +1290,26 @@ function createSpecificActionERC20TransferBatchTerms(terms, encodingOptions = de
|
|
|
834
1290
|
]);
|
|
835
1291
|
return prepareResult(hexValue, encodingOptions);
|
|
836
1292
|
}
|
|
1293
|
+
function decodeSpecificActionERC20TransferBatchTerms(terms, encodingOptions = defaultOptions) {
|
|
1294
|
+
const hexTerms = bytesLikeToHex(terms);
|
|
1295
|
+
assertHexBytesMinLength(
|
|
1296
|
+
hexTerms,
|
|
1297
|
+
92,
|
|
1298
|
+
"Invalid SpecificActionERC20TransferBatch terms: must be at least 92 bytes"
|
|
1299
|
+
);
|
|
1300
|
+
const tokenAddressHex = extractAddress(hexTerms, 0);
|
|
1301
|
+
const recipientHex = extractAddress(hexTerms, 20);
|
|
1302
|
+
const amount = extractBigInt(hexTerms, 40, 32);
|
|
1303
|
+
const targetHex = extractAddress(hexTerms, 72);
|
|
1304
|
+
const calldataHex = extractRemainingHex(hexTerms, 92);
|
|
1305
|
+
return {
|
|
1306
|
+
tokenAddress: prepareResult(tokenAddressHex, encodingOptions),
|
|
1307
|
+
recipient: prepareResult(recipientHex, encodingOptions),
|
|
1308
|
+
amount,
|
|
1309
|
+
target: prepareResult(targetHex, encodingOptions),
|
|
1310
|
+
calldata: prepareResult(calldataHex, encodingOptions)
|
|
1311
|
+
};
|
|
1312
|
+
}
|
|
837
1313
|
|
|
838
1314
|
// src/delegation.ts
|
|
839
1315
|
|
|
@@ -1003,5 +1479,36 @@ function getCaveatHash(caveat) {
|
|
|
1003
1479
|
|
|
1004
1480
|
|
|
1005
1481
|
|
|
1006
|
-
|
|
1482
|
+
|
|
1483
|
+
|
|
1484
|
+
|
|
1485
|
+
|
|
1486
|
+
|
|
1487
|
+
|
|
1488
|
+
|
|
1489
|
+
|
|
1490
|
+
|
|
1491
|
+
|
|
1492
|
+
|
|
1493
|
+
|
|
1494
|
+
|
|
1495
|
+
|
|
1496
|
+
|
|
1497
|
+
|
|
1498
|
+
|
|
1499
|
+
|
|
1500
|
+
|
|
1501
|
+
|
|
1502
|
+
|
|
1503
|
+
|
|
1504
|
+
|
|
1505
|
+
|
|
1506
|
+
|
|
1507
|
+
|
|
1508
|
+
|
|
1509
|
+
|
|
1510
|
+
|
|
1511
|
+
|
|
1512
|
+
|
|
1513
|
+
exports.ANY_BENEFICIARY = ANY_BENEFICIARY; exports.CAVEAT_TYPEHASH = CAVEAT_TYPEHASH; exports.DELEGATION_TYPEHASH = DELEGATION_TYPEHASH; exports.ROOT_AUTHORITY = ROOT_AUTHORITY; exports.createAllowedCalldataTerms = createAllowedCalldataTerms; exports.createAllowedMethodsTerms = createAllowedMethodsTerms; exports.createAllowedTargetsTerms = createAllowedTargetsTerms; exports.createArgsEqualityCheckTerms = createArgsEqualityCheckTerms; exports.createBlockNumberTerms = createBlockNumberTerms; exports.createDeployedTerms = createDeployedTerms; exports.createERC1155BalanceChangeTerms = createERC1155BalanceChangeTerms; exports.createERC20BalanceChangeTerms = createERC20BalanceChangeTerms; exports.createERC20StreamingTerms = createERC20StreamingTerms; exports.createERC20TokenPeriodTransferTerms = createERC20TokenPeriodTransferTerms; exports.createERC20TransferAmountTerms = createERC20TransferAmountTerms; exports.createERC721BalanceChangeTerms = createERC721BalanceChangeTerms; exports.createERC721TransferTerms = createERC721TransferTerms; exports.createExactCalldataBatchTerms = createExactCalldataBatchTerms; exports.createExactCalldataTerms = createExactCalldataTerms; exports.createExactExecutionBatchTerms = createExactExecutionBatchTerms; exports.createExactExecutionTerms = createExactExecutionTerms; exports.createIdTerms = createIdTerms; exports.createLimitedCallsTerms = createLimitedCallsTerms; exports.createMultiTokenPeriodTerms = createMultiTokenPeriodTerms; exports.createNativeBalanceChangeTerms = createNativeBalanceChangeTerms; exports.createNativeTokenPaymentTerms = createNativeTokenPaymentTerms; exports.createNativeTokenPeriodTransferTerms = createNativeTokenPeriodTransferTerms; exports.createNativeTokenStreamingTerms = createNativeTokenStreamingTerms; exports.createNativeTokenTransferAmountTerms = createNativeTokenTransferAmountTerms; exports.createNonceTerms = createNonceTerms; exports.createOwnershipTransferTerms = createOwnershipTransferTerms; exports.createRedeemerTerms = createRedeemerTerms; exports.createSpecificActionERC20TransferBatchTerms = createSpecificActionERC20TransferBatchTerms; exports.createTimestampTerms = createTimestampTerms; exports.createValueLteTerms = createValueLteTerms; exports.decodeAllowedCalldataTerms = decodeAllowedCalldataTerms; exports.decodeAllowedMethodsTerms = decodeAllowedMethodsTerms; exports.decodeAllowedTargetsTerms = decodeAllowedTargetsTerms; exports.decodeArgsEqualityCheckTerms = decodeArgsEqualityCheckTerms; exports.decodeBlockNumberTerms = decodeBlockNumberTerms; exports.decodeDelegation = decodeDelegation; exports.decodeDelegations = decodeDelegations; exports.decodeDeployedTerms = decodeDeployedTerms; exports.decodeERC1155BalanceChangeTerms = decodeERC1155BalanceChangeTerms; exports.decodeERC20BalanceChangeTerms = decodeERC20BalanceChangeTerms; exports.decodeERC20StreamingTerms = decodeERC20StreamingTerms; exports.decodeERC20TokenPeriodTransferTerms = decodeERC20TokenPeriodTransferTerms; exports.decodeERC20TransferAmountTerms = decodeERC20TransferAmountTerms; exports.decodeERC721BalanceChangeTerms = decodeERC721BalanceChangeTerms; exports.decodeERC721TransferTerms = decodeERC721TransferTerms; exports.decodeExactCalldataBatchTerms = decodeExactCalldataBatchTerms; exports.decodeExactCalldataTerms = decodeExactCalldataTerms; exports.decodeExactExecutionBatchTerms = decodeExactExecutionBatchTerms; exports.decodeExactExecutionTerms = decodeExactExecutionTerms; exports.decodeIdTerms = decodeIdTerms; exports.decodeLimitedCallsTerms = decodeLimitedCallsTerms; exports.decodeMultiTokenPeriodTerms = decodeMultiTokenPeriodTerms; exports.decodeNativeBalanceChangeTerms = decodeNativeBalanceChangeTerms; exports.decodeNativeTokenPaymentTerms = decodeNativeTokenPaymentTerms; exports.decodeNativeTokenPeriodTransferTerms = decodeNativeTokenPeriodTransferTerms; exports.decodeNativeTokenStreamingTerms = decodeNativeTokenStreamingTerms; exports.decodeNativeTokenTransferAmountTerms = decodeNativeTokenTransferAmountTerms; exports.decodeNonceTerms = decodeNonceTerms; exports.decodeOwnershipTransferTerms = decodeOwnershipTransferTerms; exports.decodeRedeemerTerms = decodeRedeemerTerms; exports.decodeSpecificActionERC20TransferBatchTerms = decodeSpecificActionERC20TransferBatchTerms; exports.decodeTimestampTerms = decodeTimestampTerms; exports.decodeValueLteTerms = decodeValueLteTerms; exports.encodeDelegation = encodeDelegation; exports.encodeDelegations = encodeDelegations; exports.hashDelegation = hashDelegation;
|
|
1007
1514
|
//# sourceMappingURL=index.cjs.map
|