@morpho-org/bundler-sdk-viem 3.0.0-next.16 → 3.0.0-next.18
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/lib/BundlerAction.d.ts +76 -78
- package/lib/BundlerAction.js +110 -99
- package/lib/actions.js +15 -9
- package/lib/errors.d.ts +4 -0
- package/lib/errors.js +6 -0
- package/lib/operations.js +14 -11
- package/lib/types/actions.d.ts +15 -25
- package/package.json +5 -5
package/lib/BundlerAction.js
CHANGED
|
@@ -40,7 +40,7 @@ export var BundlerAction;
|
|
|
40
40
|
return BundlerAction.nativeTransfer(chainId, ...args);
|
|
41
41
|
}
|
|
42
42
|
case "erc20Transfer": {
|
|
43
|
-
return BundlerAction.erc20Transfer(
|
|
43
|
+
return BundlerAction.erc20Transfer(...args);
|
|
44
44
|
}
|
|
45
45
|
case "erc20TransferFrom": {
|
|
46
46
|
return BundlerAction.erc20TransferFrom(chainId, ...args);
|
|
@@ -54,16 +54,16 @@ export var BundlerAction;
|
|
|
54
54
|
}
|
|
55
55
|
/* Permit */
|
|
56
56
|
case "permit": {
|
|
57
|
-
const [sender, asset, amount, deadline, signature,
|
|
57
|
+
const [sender, asset, amount, deadline, signature, skipRevert] = args;
|
|
58
58
|
if (signature == null)
|
|
59
59
|
throw new BundlerErrors.MissingSignature();
|
|
60
|
-
return BundlerAction.permit(chainId, sender, asset, amount, deadline, signature,
|
|
60
|
+
return BundlerAction.permit(chainId, sender, asset, amount, deadline, signature, skipRevert);
|
|
61
61
|
}
|
|
62
62
|
case "permitDai": {
|
|
63
|
-
const [sender, nonce, expiry, allowed, signature,
|
|
63
|
+
const [sender, nonce, expiry, allowed, signature, skipRevert] = args;
|
|
64
64
|
if (signature == null)
|
|
65
65
|
throw new BundlerErrors.MissingSignature();
|
|
66
|
-
return BundlerAction.permitDai(chainId, sender, nonce, expiry, allowed, signature,
|
|
66
|
+
return BundlerAction.permitDai(chainId, sender, nonce, expiry, allowed, signature, skipRevert);
|
|
67
67
|
}
|
|
68
68
|
/* Permit2 */
|
|
69
69
|
case "approve2": {
|
|
@@ -167,10 +167,10 @@ export var BundlerAction;
|
|
|
167
167
|
return BundlerAction.aaveV3OptimizerWithdrawCollateral(chainId, ...args);
|
|
168
168
|
}
|
|
169
169
|
case "aaveV3OptimizerApproveManagerWithSig": {
|
|
170
|
-
const [aaveV3Optimizer, owner, isApproved, nonce, deadline, signature,
|
|
170
|
+
const [aaveV3Optimizer, owner, isApproved, nonce, deadline, signature, skipRevert,] = args;
|
|
171
171
|
if (signature == null)
|
|
172
172
|
throw new BundlerErrors.MissingSignature();
|
|
173
|
-
return BundlerAction.aaveV3OptimizerApproveManagerWithSig(chainId, aaveV3Optimizer, owner, isApproved, nonce, deadline, signature,
|
|
173
|
+
return BundlerAction.aaveV3OptimizerApproveManagerWithSig(chainId, aaveV3Optimizer, owner, isApproved, nonce, deadline, signature, skipRevert);
|
|
174
174
|
}
|
|
175
175
|
/* CompoundV2 */
|
|
176
176
|
case "compoundV2Repay": {
|
|
@@ -187,10 +187,10 @@ export var BundlerAction;
|
|
|
187
187
|
return BundlerAction.compoundV3WithdrawFrom(chainId, ...args);
|
|
188
188
|
}
|
|
189
189
|
case "compoundV3AllowBySig": {
|
|
190
|
-
const [instance, owner, isAllowed, nonce, expiry, signature,
|
|
190
|
+
const [instance, owner, isAllowed, nonce, expiry, signature, skipRevert,] = args;
|
|
191
191
|
if (signature == null)
|
|
192
192
|
throw new BundlerErrors.MissingSignature();
|
|
193
|
-
return BundlerAction.compoundV3AllowBySig(chainId, instance, owner, isAllowed, nonce, expiry, signature,
|
|
193
|
+
return BundlerAction.compoundV3AllowBySig(chainId, instance, owner, isAllowed, nonce, expiry, signature, skipRevert);
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
throw Error(`unhandled action encoding: ${type}`);
|
|
@@ -198,7 +198,7 @@ export var BundlerAction;
|
|
|
198
198
|
BundlerAction.encode = encode;
|
|
199
199
|
/* ERC20 */
|
|
200
200
|
/**
|
|
201
|
-
* Encodes a call to the
|
|
201
|
+
* Encodes a call to the GeneralAdapter1 to transfer native tokens (ETH on ethereum, MATIC on polygon, etc).
|
|
202
202
|
* @param chainId The chain id for which to encode the call.
|
|
203
203
|
* @param owner The owner of native tokens.
|
|
204
204
|
* @param recipient The address to send native tokens to.
|
|
@@ -235,17 +235,15 @@ export var BundlerAction;
|
|
|
235
235
|
}
|
|
236
236
|
BundlerAction.nativeTransfer = nativeTransfer;
|
|
237
237
|
/**
|
|
238
|
-
* Encodes a call to the
|
|
238
|
+
* Encodes a call to the requested adapter to transfer ERC20 tokens.
|
|
239
239
|
* @param chainId The chain id for which to encode the call.
|
|
240
240
|
* @param asset The address of the ERC20 token to transfer.
|
|
241
241
|
* @param recipient The address to send tokens to.
|
|
242
242
|
* @param amount The amount of tokens to send.
|
|
243
|
-
* @param adapter The address of the adapter to use.
|
|
243
|
+
* @param adapter The address of the adapter to use.
|
|
244
244
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
245
245
|
*/
|
|
246
|
-
function erc20Transfer(
|
|
247
|
-
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
248
|
-
adapter ??= generalAdapter1;
|
|
246
|
+
function erc20Transfer(asset, recipient, amount, adapter, skipRevert = false) {
|
|
249
247
|
return [
|
|
250
248
|
{
|
|
251
249
|
to: adapter,
|
|
@@ -262,16 +260,15 @@ export var BundlerAction;
|
|
|
262
260
|
}
|
|
263
261
|
BundlerAction.erc20Transfer = erc20Transfer;
|
|
264
262
|
/**
|
|
265
|
-
* Encodes a call to the
|
|
263
|
+
* Encodes a call to the GeneralAdapter1 to transfer ERC20 tokens with `transferFrom`.
|
|
266
264
|
* @param chainId The chain id for which to encode the call.
|
|
267
265
|
* @param asset The address of the ERC20 token to transfer.
|
|
268
266
|
* @param amount The amount of tokens to send.
|
|
269
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
267
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
270
268
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
271
269
|
*/
|
|
272
270
|
function erc20TransferFrom(chainId, asset, amount, recipient, skipRevert = false) {
|
|
273
271
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
274
|
-
recipient ??= generalAdapter1;
|
|
275
272
|
return [
|
|
276
273
|
{
|
|
277
274
|
to: generalAdapter1,
|
|
@@ -289,27 +286,35 @@ export var BundlerAction;
|
|
|
289
286
|
BundlerAction.erc20TransferFrom = erc20TransferFrom;
|
|
290
287
|
/* Permit */
|
|
291
288
|
/**
|
|
292
|
-
* Encodes a call to the
|
|
289
|
+
* Encodes a call to the GeneralAdapter1 to permit an ERC20 token.
|
|
293
290
|
* @param chainId The chain id for which to encode the call.
|
|
294
291
|
* @param owner The address which owns the tokens.
|
|
295
292
|
* @param asset The address of the ERC20 token to permit.
|
|
296
293
|
* @param amount The amount of tokens to permit.
|
|
297
294
|
* @param deadline The timestamp until which the signature is valid.
|
|
298
295
|
* @param signature The Ethers signature to permit the tokens.
|
|
299
|
-
* @param spender The address allowed to spend the tokens.
|
|
300
296
|
* @param skipRevert Whether to allow the permit to revert without making the whole bundle revert. Defaults to true.
|
|
301
297
|
*/
|
|
302
|
-
function permit(chainId, owner, asset, amount, deadline, signature,
|
|
298
|
+
function permit(chainId, owner, asset, amount, deadline, signature, skipRevert = true) {
|
|
303
299
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
304
300
|
const { r, s, yParity } = parseSignature(signature);
|
|
305
|
-
spender ??= generalAdapter1;
|
|
306
301
|
return [
|
|
307
302
|
{
|
|
308
303
|
to: asset,
|
|
309
304
|
data: encodeFunctionData({
|
|
310
305
|
abi: erc2612Abi,
|
|
311
306
|
functionName: "permit",
|
|
312
|
-
args: [
|
|
307
|
+
args: [
|
|
308
|
+
owner,
|
|
309
|
+
// Never permit any other address than the GeneralAdapter1 otherwise
|
|
310
|
+
// there are no guarantees that the signature can't be used independently.
|
|
311
|
+
generalAdapter1,
|
|
312
|
+
amount,
|
|
313
|
+
deadline,
|
|
314
|
+
yParity + 27,
|
|
315
|
+
r,
|
|
316
|
+
s,
|
|
317
|
+
],
|
|
313
318
|
}),
|
|
314
319
|
value: 0n,
|
|
315
320
|
skipRevert,
|
|
@@ -319,21 +324,19 @@ export var BundlerAction;
|
|
|
319
324
|
}
|
|
320
325
|
BundlerAction.permit = permit;
|
|
321
326
|
/**
|
|
322
|
-
* Encodes a call to the
|
|
327
|
+
* Encodes a call to the GeneralAdapter1 to permit DAI.
|
|
323
328
|
* @param chainId The chain id for which to encode the call.
|
|
324
329
|
* @param owner The address which owns the tokens.
|
|
325
330
|
* @param nonce The permit nonce used.
|
|
326
331
|
* @param expiry The timestamp until which the signature is valid.
|
|
327
332
|
* @param allowed The amount of DAI to permit.
|
|
328
333
|
* @param signature The Ethers signature to permit the tokens.
|
|
329
|
-
* @param spender The address allowed to spend the tokens.
|
|
330
334
|
* @param skipRevert Whether to allow the permit to revert without making the whole bundle revert.
|
|
331
335
|
*/
|
|
332
|
-
function permitDai(chainId, owner, nonce, expiry, allowed, signature,
|
|
336
|
+
function permitDai(chainId, owner, nonce, expiry, allowed, signature, skipRevert = true) {
|
|
333
337
|
const { dai, bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
334
338
|
if (dai == null)
|
|
335
339
|
throw new BundlerErrors.UnexpectedAction("permitDai", chainId);
|
|
336
|
-
spender ??= generalAdapter1;
|
|
337
340
|
const { r, s, yParity } = parseSignature(signature);
|
|
338
341
|
return [
|
|
339
342
|
{
|
|
@@ -360,7 +363,18 @@ export var BundlerAction;
|
|
|
360
363
|
},
|
|
361
364
|
],
|
|
362
365
|
functionName: "permit",
|
|
363
|
-
args: [
|
|
366
|
+
args: [
|
|
367
|
+
owner,
|
|
368
|
+
// Never permit any other address than the GeneralAdapter1 otherwise
|
|
369
|
+
// there are no guarantees that the signature can't be used independently.
|
|
370
|
+
generalAdapter1,
|
|
371
|
+
nonce,
|
|
372
|
+
expiry,
|
|
373
|
+
allowed,
|
|
374
|
+
yParity + 27,
|
|
375
|
+
r,
|
|
376
|
+
s,
|
|
377
|
+
],
|
|
364
378
|
}),
|
|
365
379
|
value: 0n,
|
|
366
380
|
skipRevert,
|
|
@@ -371,7 +385,7 @@ export var BundlerAction;
|
|
|
371
385
|
BundlerAction.permitDai = permitDai;
|
|
372
386
|
/* Permit2 */
|
|
373
387
|
/**
|
|
374
|
-
* Encodes a call to the
|
|
388
|
+
* Encodes a call to permit the chain's GeneralAdapter1 ERC20 tokens via Permit2.
|
|
375
389
|
* @param chainId The chain id for which to encode the call.
|
|
376
390
|
* @param owner The owner of ERC20 tokens.
|
|
377
391
|
* @param permitSingle The permit details to submit to Permit2.
|
|
@@ -393,7 +407,7 @@ export var BundlerAction;
|
|
|
393
407
|
{
|
|
394
408
|
...permitSingle,
|
|
395
409
|
// Never permit any other address than the GeneralAdapter1 otherwise
|
|
396
|
-
// the signature can be
|
|
410
|
+
// there are no guarantees that the signature can't be used independently.
|
|
397
411
|
spender: generalAdapter1,
|
|
398
412
|
},
|
|
399
413
|
signature,
|
|
@@ -407,17 +421,16 @@ export var BundlerAction;
|
|
|
407
421
|
}
|
|
408
422
|
BundlerAction.approve2 = approve2;
|
|
409
423
|
/**
|
|
410
|
-
* Encodes a call to the
|
|
424
|
+
* Encodes a call to the GeneralAdapter1 to transfer ERC20 tokens via Permit2.
|
|
411
425
|
* @param chainId The chain id for which to encode the call.
|
|
412
426
|
* @param asset The address of the ERC20 token to transfer.
|
|
413
427
|
* @param owner The owner of ERC20 tokens.
|
|
414
428
|
* @param amount The amount of tokens to send.
|
|
415
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
429
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
416
430
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
417
431
|
*/
|
|
418
432
|
function transferFrom2(chainId, asset, amount, recipient, skipRevert = false) {
|
|
419
433
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
420
|
-
recipient ??= generalAdapter1;
|
|
421
434
|
return [
|
|
422
435
|
{
|
|
423
436
|
to: generalAdapter1,
|
|
@@ -435,7 +448,7 @@ export var BundlerAction;
|
|
|
435
448
|
BundlerAction.transferFrom2 = transferFrom2;
|
|
436
449
|
/* ERC20 Wrapper */
|
|
437
450
|
/**
|
|
438
|
-
* Encodes a call to the
|
|
451
|
+
* Encodes a call to the GeneralAdapter1 to wrap ERC20 tokens via the provided ERC20Wrapper.
|
|
439
452
|
* @param chainId The chain id for which to encode the call.
|
|
440
453
|
* @param wrapper The address of the ERC20 wrapper token.
|
|
441
454
|
* @param underlying The address of the underlying ERC20 token.
|
|
@@ -484,7 +497,7 @@ export var BundlerAction;
|
|
|
484
497
|
}
|
|
485
498
|
BundlerAction.erc20WrapperDepositFor = erc20WrapperDepositFor;
|
|
486
499
|
/**
|
|
487
|
-
* Encodes a call to the
|
|
500
|
+
* Encodes a call to the GeneralAdapter1 to unwrap ERC20 tokens from the provided ERC20Wrapper.
|
|
488
501
|
* @param chainId The chain id for which to encode the call.
|
|
489
502
|
* @param wrapper The address of the ERC20 wrapper token.
|
|
490
503
|
* @param account The address to send the underlying ERC20 tokens.
|
|
@@ -534,7 +547,7 @@ export var BundlerAction;
|
|
|
534
547
|
BundlerAction.erc20WrapperWithdrawTo = erc20WrapperWithdrawTo;
|
|
535
548
|
/* ERC4626 */
|
|
536
549
|
/**
|
|
537
|
-
* Encodes a call to the
|
|
550
|
+
* Encodes a call to the GeneralAdapter1 to mint shares of the provided ERC4626 vault.
|
|
538
551
|
* @param chainId The chain id for which to encode the call.
|
|
539
552
|
* @param erc4626 The address of the ERC4626 vault.
|
|
540
553
|
* @param shares The amount of shares to mint.
|
|
@@ -560,7 +573,7 @@ export var BundlerAction;
|
|
|
560
573
|
}
|
|
561
574
|
BundlerAction.erc4626Mint = erc4626Mint;
|
|
562
575
|
/**
|
|
563
|
-
* Encodes a call to the
|
|
576
|
+
* Encodes a call to the GeneralAdapter1 to deposit assets into the provided ERC4626 vault.
|
|
564
577
|
* @param chainId The chain id for which to encode the call.
|
|
565
578
|
* @param erc4626 The address of the ERC4626 vault.
|
|
566
579
|
* @param assets The amount of assets to deposit.
|
|
@@ -586,7 +599,7 @@ export var BundlerAction;
|
|
|
586
599
|
}
|
|
587
600
|
BundlerAction.erc4626Deposit = erc4626Deposit;
|
|
588
601
|
/**
|
|
589
|
-
* Encodes a call to the
|
|
602
|
+
* Encodes a call to the GeneralAdapter1 to withdraw assets from the provided ERC4626 vault.
|
|
590
603
|
* @param chainId The chain id for which to encode the call.
|
|
591
604
|
* @param erc4626 The address of the ERC4626 vault.
|
|
592
605
|
* @param assets The amount of assets to withdraw.
|
|
@@ -613,7 +626,7 @@ export var BundlerAction;
|
|
|
613
626
|
}
|
|
614
627
|
BundlerAction.erc4626Withdraw = erc4626Withdraw;
|
|
615
628
|
/**
|
|
616
|
-
* Encodes a call to the
|
|
629
|
+
* Encodes a call to the GeneralAdapter1 to redeem shares from the provided ERC4626 vault.
|
|
617
630
|
* @param chainId The chain id for which to encode the call.
|
|
618
631
|
* @param erc4626 The address of the ERC4626 vault.
|
|
619
632
|
* @param shares The amount of shares to redeem.
|
|
@@ -641,15 +654,17 @@ export var BundlerAction;
|
|
|
641
654
|
BundlerAction.erc4626Redeem = erc4626Redeem;
|
|
642
655
|
/* Morpho */
|
|
643
656
|
/**
|
|
644
|
-
* Encodes a call to
|
|
657
|
+
* Encodes a call to authorize an account on Morpho Blue.
|
|
645
658
|
* @param chainId The chain id for which to encode the call.
|
|
646
659
|
* @param authorization The authorization details to submit to Morpho Blue.
|
|
647
660
|
* @param signature The Ethers signature to authorize the account.
|
|
648
661
|
* @param skipRevert Whether to allow the authorization call to revert without making the whole bundle revert. Defaults to true.
|
|
649
662
|
*/
|
|
650
663
|
function morphoSetAuthorizationWithSig(chainId, authorization, signature, skipRevert = true) {
|
|
651
|
-
const { morpho } = getChainAddresses(chainId);
|
|
664
|
+
const { morpho, bundler3: { bundler3 }, } = getChainAddresses(chainId);
|
|
652
665
|
const { r, s, yParity } = parseSignature(signature);
|
|
666
|
+
if (authorization.authorized === bundler3)
|
|
667
|
+
throw new BundlerErrors.UnexpectedSignature(authorization.authorized);
|
|
653
668
|
return [
|
|
654
669
|
{
|
|
655
670
|
to: morpho,
|
|
@@ -666,7 +681,7 @@ export var BundlerAction;
|
|
|
666
681
|
}
|
|
667
682
|
BundlerAction.morphoSetAuthorizationWithSig = morphoSetAuthorizationWithSig;
|
|
668
683
|
/**
|
|
669
|
-
* Encodes a call to the
|
|
684
|
+
* Encodes a call to the GeneralAdapter1 to supply to a Morpho Blue market.
|
|
670
685
|
* @param chainId The chain id for which to encode the call.
|
|
671
686
|
* @param market The market params to supply to.
|
|
672
687
|
* @param assets The amount of assets to supply.
|
|
@@ -698,7 +713,7 @@ export var BundlerAction;
|
|
|
698
713
|
}
|
|
699
714
|
BundlerAction.morphoSupply = morphoSupply;
|
|
700
715
|
/**
|
|
701
|
-
* Encodes a call to the
|
|
716
|
+
* Encodes a call to the GeneralAdapter1 to supply collateral to a Morpho Blue market.
|
|
702
717
|
* @param chainId The chain id for which to encode the call.
|
|
703
718
|
* @param market The market params to supply to.
|
|
704
719
|
* @param assets The amount of assets to supply.
|
|
@@ -728,7 +743,7 @@ export var BundlerAction;
|
|
|
728
743
|
}
|
|
729
744
|
BundlerAction.morphoSupplyCollateral = morphoSupplyCollateral;
|
|
730
745
|
/**
|
|
731
|
-
* Encodes a call to the
|
|
746
|
+
* Encodes a call to the GeneralAdapter1 to borrow from a Morpho Blue market.
|
|
732
747
|
* @param chainId The chain id for which to encode the call.
|
|
733
748
|
* @param market The market params to borrow from.
|
|
734
749
|
* @param assets The amount of assets to borrow.
|
|
@@ -755,7 +770,7 @@ export var BundlerAction;
|
|
|
755
770
|
}
|
|
756
771
|
BundlerAction.morphoBorrow = morphoBorrow;
|
|
757
772
|
/**
|
|
758
|
-
* Encodes a call to the
|
|
773
|
+
* Encodes a call to the GeneralAdapter1 to repay to a Morpho Blue market.
|
|
759
774
|
* @param chainId The chain id for which to encode the call.
|
|
760
775
|
* @param market The market params to repay to.
|
|
761
776
|
* @param assets The amount of assets to repay.
|
|
@@ -787,7 +802,7 @@ export var BundlerAction;
|
|
|
787
802
|
}
|
|
788
803
|
BundlerAction.morphoRepay = morphoRepay;
|
|
789
804
|
/**
|
|
790
|
-
* Encodes a call to the
|
|
805
|
+
* Encodes a call to the GeneralAdapter1 to withdraw from a Morpho Blue market.
|
|
791
806
|
* @param chainId The chain id for which to encode the call.
|
|
792
807
|
* @param market The market params to withdraw from.
|
|
793
808
|
* @param assets The amount of assets to withdraw.
|
|
@@ -814,7 +829,7 @@ export var BundlerAction;
|
|
|
814
829
|
}
|
|
815
830
|
BundlerAction.morphoWithdraw = morphoWithdraw;
|
|
816
831
|
/**
|
|
817
|
-
* Encodes a call to the
|
|
832
|
+
* Encodes a call to the GeneralAdapter1 to withdraw collateral from a Morpho Blue market.
|
|
818
833
|
* @param chainId The chain id for which to encode the call.
|
|
819
834
|
* @param market The market params to withdraw from.
|
|
820
835
|
* @param assets The amount of assets to withdraw.
|
|
@@ -839,7 +854,7 @@ export var BundlerAction;
|
|
|
839
854
|
}
|
|
840
855
|
BundlerAction.morphoWithdrawCollateral = morphoWithdrawCollateral;
|
|
841
856
|
/**
|
|
842
|
-
* Encodes a call to the
|
|
857
|
+
* Encodes a call to the GeneralAdapter1 to flash loan from Morpho Blue.
|
|
843
858
|
* @param chainId The chain id for which to encode the call.
|
|
844
859
|
* @param asset The address of the ERC20 token to flash loan.
|
|
845
860
|
* @param amount The amount of tokens to flash loan.
|
|
@@ -876,7 +891,7 @@ export var BundlerAction;
|
|
|
876
891
|
}
|
|
877
892
|
BundlerAction.morphoFlashLoan = morphoFlashLoan;
|
|
878
893
|
/**
|
|
879
|
-
* Encodes a call to
|
|
894
|
+
* Encodes a call to trigger a public reallocation on the PublicAllocator.
|
|
880
895
|
* @param chainId The chain id for which to encode the call.
|
|
881
896
|
* @param vault The vault to reallocate.
|
|
882
897
|
* @param fee The vault public reallocation fee.
|
|
@@ -905,7 +920,7 @@ export var BundlerAction;
|
|
|
905
920
|
BundlerAction.publicAllocatorReallocateTo = publicAllocatorReallocateTo;
|
|
906
921
|
/* Universal Rewards Distributor */
|
|
907
922
|
/**
|
|
908
|
-
* Encodes a call to the
|
|
923
|
+
* Encodes a call to the Universal Rewards Distributor to claim rewards.
|
|
909
924
|
* @param chainId The chain id for which to encode the call.
|
|
910
925
|
* @param distributor The address of the distributor to claim rewards from.
|
|
911
926
|
* @param account The address to claim rewards for.
|
|
@@ -932,15 +947,14 @@ export var BundlerAction;
|
|
|
932
947
|
BundlerAction.urdClaim = urdClaim;
|
|
933
948
|
/* Wrapped Native */
|
|
934
949
|
/**
|
|
935
|
-
* Encodes a call to the
|
|
950
|
+
* Encodes a call to the GeneralAdapter1 to wrap native tokens (ETH to WETH on ethereum, MATIC to WMATIC on polygon, etc).
|
|
936
951
|
* @param chainId The chain id for which to encode the call.
|
|
937
952
|
* @param amount The amount of native tokens to wrap (in wei).
|
|
938
|
-
* @param recipient The address to send tokens to.
|
|
953
|
+
* @param recipient The address to send tokens to.
|
|
939
954
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
940
955
|
*/
|
|
941
956
|
function wrapNative(chainId, amount, recipient, skipRevert = false) {
|
|
942
957
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
943
|
-
recipient ??= generalAdapter1;
|
|
944
958
|
return [
|
|
945
959
|
{
|
|
946
960
|
to: generalAdapter1,
|
|
@@ -957,15 +971,14 @@ export var BundlerAction;
|
|
|
957
971
|
}
|
|
958
972
|
BundlerAction.wrapNative = wrapNative;
|
|
959
973
|
/**
|
|
960
|
-
* Encodes a call to the
|
|
974
|
+
* Encodes a call to the GeneralAdapter1 to unwrap native tokens (WETH to ETH on ethereum, WMATIC to MATIC on polygon, etc).
|
|
961
975
|
* @param chainId The chain id for which to encode the call.
|
|
962
976
|
* @param amount The amount of native tokens to unwrap (in wei).
|
|
963
|
-
* @param recipient The address to send tokens to.
|
|
977
|
+
* @param recipient The address to send tokens to.
|
|
964
978
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
965
979
|
*/
|
|
966
980
|
function unwrapNative(chainId, amount, recipient, skipRevert = false) {
|
|
967
981
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
968
|
-
recipient ??= generalAdapter1;
|
|
969
982
|
return [
|
|
970
983
|
{
|
|
971
984
|
to: generalAdapter1,
|
|
@@ -983,17 +996,16 @@ export var BundlerAction;
|
|
|
983
996
|
BundlerAction.unwrapNative = unwrapNative;
|
|
984
997
|
/* stETH */
|
|
985
998
|
/**
|
|
986
|
-
* Encodes a call to the
|
|
999
|
+
* Encodes a call to the GeneralAdapter1 to stake native tokens using Lido (ETH to stETH on ethereum).
|
|
987
1000
|
* @param chainId The chain id for which to encode the call.
|
|
988
1001
|
* @param amount The amount of native tokens to stake (in wei).
|
|
989
1002
|
* @param maxSharePrice The maximum amount of wei to pay for minting 1 share (scaled by RAY).
|
|
990
1003
|
* @param referral The referral address to use.
|
|
991
|
-
* @param recipient The address to send stETH to.
|
|
1004
|
+
* @param recipient The address to send stETH to.
|
|
992
1005
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
993
1006
|
*/
|
|
994
1007
|
function stakeEth(chainId, amount, maxSharePrice, referral, recipient, skipRevert = false) {
|
|
995
1008
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
996
|
-
recipient ??= generalAdapter1;
|
|
997
1009
|
return [
|
|
998
1010
|
{
|
|
999
1011
|
to: generalAdapter1,
|
|
@@ -1011,15 +1023,14 @@ export var BundlerAction;
|
|
|
1011
1023
|
BundlerAction.stakeEth = stakeEth;
|
|
1012
1024
|
/* Wrapped stETH */
|
|
1013
1025
|
/**
|
|
1014
|
-
* Encodes a call to the
|
|
1026
|
+
* Encodes a call to the GeneralAdapter1 to wrap stETH (stETH to wstETH on ethereum).
|
|
1015
1027
|
* @param chainId The chain id for which to encode the call.
|
|
1016
1028
|
* @param amount The amount of stETH to wrap (in wei).
|
|
1017
|
-
* @param recipient The address to send wstETH to.
|
|
1029
|
+
* @param recipient The address to send wstETH to.
|
|
1018
1030
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1019
1031
|
*/
|
|
1020
1032
|
function wrapStEth(chainId, amount, recipient, skipRevert = false) {
|
|
1021
1033
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
1022
|
-
recipient ??= generalAdapter1;
|
|
1023
1034
|
return [
|
|
1024
1035
|
{
|
|
1025
1036
|
to: generalAdapter1,
|
|
@@ -1036,15 +1047,14 @@ export var BundlerAction;
|
|
|
1036
1047
|
}
|
|
1037
1048
|
BundlerAction.wrapStEth = wrapStEth;
|
|
1038
1049
|
/**
|
|
1039
|
-
* Encodes a call to the
|
|
1050
|
+
* Encodes a call to the GeneralAdapter1 to unwrap wstETH (wstETH to stETH on ethereum).
|
|
1040
1051
|
* @param chainId The chain id for which to encode the call.
|
|
1041
1052
|
* @param amount The amount of wstETH to unwrap (in wei).
|
|
1042
|
-
* @param recipient The address to send stETH to.
|
|
1053
|
+
* @param recipient The address to send stETH to.
|
|
1043
1054
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1044
1055
|
*/
|
|
1045
1056
|
function unwrapStEth(chainId, amount, recipient, skipRevert = false) {
|
|
1046
1057
|
const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
|
|
1047
|
-
recipient ??= generalAdapter1;
|
|
1048
1058
|
return [
|
|
1049
1059
|
{
|
|
1050
1060
|
to: generalAdapter1,
|
|
@@ -1062,7 +1072,7 @@ export var BundlerAction;
|
|
|
1062
1072
|
BundlerAction.unwrapStEth = unwrapStEth;
|
|
1063
1073
|
/* AaveV2 */
|
|
1064
1074
|
/**
|
|
1065
|
-
* Encodes a call to the
|
|
1075
|
+
* Encodes a call to the AaveV2MigrationAdapter to repay a debt on AaveV2.
|
|
1066
1076
|
* @param chainId The chain id for which to encode the call.
|
|
1067
1077
|
* @param asset The debt asset to repay.
|
|
1068
1078
|
* @param amount The amount of debt to repay.
|
|
@@ -1090,18 +1100,17 @@ export var BundlerAction;
|
|
|
1090
1100
|
}
|
|
1091
1101
|
BundlerAction.aaveV2Repay = aaveV2Repay;
|
|
1092
1102
|
/**
|
|
1093
|
-
* Encodes a call to the
|
|
1103
|
+
* Encodes a call to the AaveV2MigrationAdapter to withdraw from AaveV2.
|
|
1094
1104
|
* @param chainId The chain id for which to encode the call.
|
|
1095
1105
|
* @param asset The asset to withdraw.
|
|
1096
1106
|
* @param amount The amount of asset to withdraw.
|
|
1097
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1107
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1098
1108
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1099
1109
|
*/
|
|
1100
1110
|
function aaveV2Withdraw(chainId, asset, amount, recipient, skipRevert = false) {
|
|
1101
1111
|
const { bundler3: { aaveV2MigrationAdapter }, } = getChainAddresses(chainId);
|
|
1102
1112
|
if (aaveV2MigrationAdapter == null)
|
|
1103
1113
|
throw new BundlerErrors.UnexpectedAction("aaveV2Withdraw", chainId);
|
|
1104
|
-
recipient ??= aaveV2MigrationAdapter;
|
|
1105
1114
|
return [
|
|
1106
1115
|
{
|
|
1107
1116
|
to: aaveV2MigrationAdapter,
|
|
@@ -1119,7 +1128,7 @@ export var BundlerAction;
|
|
|
1119
1128
|
BundlerAction.aaveV2Withdraw = aaveV2Withdraw;
|
|
1120
1129
|
/* AaveV3 */
|
|
1121
1130
|
/**
|
|
1122
|
-
* Encodes a call to the
|
|
1131
|
+
* Encodes a call to the AaveV3CoreMigrationAdapter to repay a debt on AaveV3.
|
|
1123
1132
|
* @param chainId The chain id for which to encode the call.
|
|
1124
1133
|
* @param asset The debt asset to repay.
|
|
1125
1134
|
* @param amount The amount of debt to repay.
|
|
@@ -1148,11 +1157,11 @@ export var BundlerAction;
|
|
|
1148
1157
|
}
|
|
1149
1158
|
BundlerAction.aaveV3Repay = aaveV3Repay;
|
|
1150
1159
|
/**
|
|
1151
|
-
* Encodes a call to the
|
|
1160
|
+
* Encodes a call to the AaveV3CoreMigrationAdapter to withdrawn from AaveV3.
|
|
1152
1161
|
* @param chainId The chain id for which to encode the call.
|
|
1153
1162
|
* @param asset The asset to withdraw.
|
|
1154
1163
|
* @param amount The amount of asset to withdraw.
|
|
1155
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1164
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1156
1165
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1157
1166
|
*/
|
|
1158
1167
|
function aaveV3Withdraw(chainId, asset, amount, recipient, skipRevert = false) {
|
|
@@ -1160,7 +1169,6 @@ export var BundlerAction;
|
|
|
1160
1169
|
} = getChainAddresses(chainId);
|
|
1161
1170
|
if (aaveV3CoreMigrationAdapter == null)
|
|
1162
1171
|
throw new BundlerErrors.UnexpectedAction("aaveV3Withdraw", chainId);
|
|
1163
|
-
recipient ??= aaveV3CoreMigrationAdapter;
|
|
1164
1172
|
return [
|
|
1165
1173
|
{
|
|
1166
1174
|
to: aaveV3CoreMigrationAdapter,
|
|
@@ -1178,7 +1186,7 @@ export var BundlerAction;
|
|
|
1178
1186
|
BundlerAction.aaveV3Withdraw = aaveV3Withdraw;
|
|
1179
1187
|
/* AaveV3 Optimizer */
|
|
1180
1188
|
/**
|
|
1181
|
-
* Encodes a call to the
|
|
1189
|
+
* Encodes a call to the AaveV3OptimizerMigrationAdapter to repay a debt on Morpho's AaveV3Optimizer.
|
|
1182
1190
|
* @param chainId The chain id for which to encode the call.
|
|
1183
1191
|
* @param underlying The underlying debt asset to repay.
|
|
1184
1192
|
* @param amount The amount of debt to repay.
|
|
@@ -1205,19 +1213,18 @@ export var BundlerAction;
|
|
|
1205
1213
|
}
|
|
1206
1214
|
BundlerAction.aaveV3OptimizerRepay = aaveV3OptimizerRepay;
|
|
1207
1215
|
/**
|
|
1208
|
-
* Encodes a call to the
|
|
1216
|
+
* Encodes a call to the AaveV3OptimizerMigrationAdapter to withdraw from Morpho's AaveV3Optimizer.
|
|
1209
1217
|
* @param chainId The chain id for which to encode the call.
|
|
1210
1218
|
* @param underlying The underlying asset to withdraw.
|
|
1211
1219
|
* @param amount The amount to withdraw.
|
|
1212
1220
|
* @param maxIterations The maximum amount of iterations to use for the withdrawal.
|
|
1213
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1221
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1214
1222
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1215
1223
|
*/
|
|
1216
1224
|
function aaveV3OptimizerWithdraw(chainId, underlying, amount, maxIterations, recipient, skipRevert = false) {
|
|
1217
1225
|
const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
|
|
1218
1226
|
if (aaveV3OptimizerMigrationAdapter == null)
|
|
1219
1227
|
throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerWithdraw", chainId);
|
|
1220
|
-
recipient ??= aaveV3OptimizerMigrationAdapter;
|
|
1221
1228
|
return [
|
|
1222
1229
|
{
|
|
1223
1230
|
to: aaveV3OptimizerMigrationAdapter,
|
|
@@ -1234,18 +1241,17 @@ export var BundlerAction;
|
|
|
1234
1241
|
}
|
|
1235
1242
|
BundlerAction.aaveV3OptimizerWithdraw = aaveV3OptimizerWithdraw;
|
|
1236
1243
|
/**
|
|
1237
|
-
* Encodes a call to the
|
|
1244
|
+
* Encodes a call to the AaveV3OptimizerMigrationAdapter to withdraw collateral from Morpho's AaveV3Optimizer.
|
|
1238
1245
|
* @param chainId The chain id for which to encode the call.
|
|
1239
1246
|
* @param underlying The underlying asset to withdraw.
|
|
1240
1247
|
* @param amount The amount to withdraw.
|
|
1241
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1248
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1242
1249
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1243
1250
|
*/
|
|
1244
1251
|
function aaveV3OptimizerWithdrawCollateral(chainId, underlying, amount, recipient, skipRevert = false) {
|
|
1245
1252
|
const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
|
|
1246
1253
|
if (aaveV3OptimizerMigrationAdapter == null)
|
|
1247
1254
|
throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerWithdrawCollateral", chainId);
|
|
1248
|
-
recipient ??= aaveV3OptimizerMigrationAdapter;
|
|
1249
1255
|
return [
|
|
1250
1256
|
{
|
|
1251
1257
|
to: aaveV3OptimizerMigrationAdapter,
|
|
@@ -1262,21 +1268,20 @@ export var BundlerAction;
|
|
|
1262
1268
|
}
|
|
1263
1269
|
BundlerAction.aaveV3OptimizerWithdrawCollateral = aaveV3OptimizerWithdrawCollateral;
|
|
1264
1270
|
/**
|
|
1265
|
-
* Encodes a call to the
|
|
1271
|
+
* Encodes a call to the AaveV3 optimizer to approve the chain's AaveV3OptimizerMigrationAdapter.
|
|
1272
|
+
* as the sender's manager on Morpho's AaveV3Optimizer.
|
|
1266
1273
|
* @param chainId The chain id for which to encode the call.
|
|
1267
1274
|
* @param owner The owner of the AaveV3Optimizer position.
|
|
1268
1275
|
* @param isApproved Whether the manager is approved.
|
|
1269
1276
|
* @param nonce The nonce used to sign.
|
|
1270
1277
|
* @param deadline The timestamp until which the signature is valid.
|
|
1271
1278
|
* @param signature The Ethers signature to submit.
|
|
1272
|
-
* @param manager The address of the manager to approve. Defaults to the chain's bundler3 AaveV3OptimizerMigrationAdapter.
|
|
1273
1279
|
* @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
|
|
1274
1280
|
*/
|
|
1275
|
-
function aaveV3OptimizerApproveManagerWithSig(chainId, aaveV3Optimizer, owner, isApproved, nonce, deadline, signature,
|
|
1281
|
+
function aaveV3OptimizerApproveManagerWithSig(chainId, aaveV3Optimizer, owner, isApproved, nonce, deadline, signature, skipRevert = true) {
|
|
1276
1282
|
const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
|
|
1277
1283
|
if (aaveV3OptimizerMigrationAdapter == null)
|
|
1278
1284
|
throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerApproveManagerWithSig", chainId);
|
|
1279
|
-
manager ??= aaveV3OptimizerMigrationAdapter;
|
|
1280
1285
|
const { r, s, yParity } = parseSignature(signature);
|
|
1281
1286
|
return [
|
|
1282
1287
|
{
|
|
@@ -1310,7 +1315,7 @@ export var BundlerAction;
|
|
|
1310
1315
|
functionName: "approveManagerWithSig",
|
|
1311
1316
|
args: [
|
|
1312
1317
|
owner,
|
|
1313
|
-
|
|
1318
|
+
aaveV3OptimizerMigrationAdapter,
|
|
1314
1319
|
isApproved,
|
|
1315
1320
|
nonce,
|
|
1316
1321
|
deadline,
|
|
@@ -1326,11 +1331,11 @@ export var BundlerAction;
|
|
|
1326
1331
|
BundlerAction.aaveV3OptimizerApproveManagerWithSig = aaveV3OptimizerApproveManagerWithSig;
|
|
1327
1332
|
/* CompoundV2 */
|
|
1328
1333
|
/**
|
|
1329
|
-
* Encodes a call to the
|
|
1334
|
+
* Encodes a call to the CompoundV2MigrationAdapter to repay a debt on CompoundV2.
|
|
1330
1335
|
* @param chainId The chain id for which to encode the call.
|
|
1331
1336
|
* @param cToken The cToken on which to repay the debt.
|
|
1332
1337
|
* @param amount The amount of debt to repay.
|
|
1333
|
-
* @param
|
|
1338
|
+
* @param onBehalf The account on behalf of which to repay.
|
|
1334
1339
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1335
1340
|
*/
|
|
1336
1341
|
function compoundV2Repay(chainId, cToken, amount, isEth, onBehalf, skipRevert = false) {
|
|
@@ -1359,18 +1364,17 @@ export var BundlerAction;
|
|
|
1359
1364
|
}
|
|
1360
1365
|
BundlerAction.compoundV2Repay = compoundV2Repay;
|
|
1361
1366
|
/**
|
|
1362
|
-
* Encodes a call to the
|
|
1367
|
+
* Encodes a call to the CompoundV2MigrationAdapter to withdraw collateral from CompoundV2.
|
|
1363
1368
|
* @param chainId The chain id for which to encode the call.
|
|
1364
1369
|
* @param cToken The cToken on which to withdraw.
|
|
1365
1370
|
* @param amount The amount to withdraw.
|
|
1366
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1371
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1367
1372
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1368
1373
|
*/
|
|
1369
1374
|
function compoundV2Redeem(chainId, cToken, amount, isEth, recipient, skipRevert = false) {
|
|
1370
1375
|
const { bundler3: { compoundV2MigrationAdapter }, } = getChainAddresses(chainId);
|
|
1371
1376
|
if (compoundV2MigrationAdapter == null)
|
|
1372
1377
|
throw new BundlerErrors.UnexpectedAction("compoundV2Repay", chainId);
|
|
1373
|
-
recipient ??= compoundV2MigrationAdapter;
|
|
1374
1378
|
return [
|
|
1375
1379
|
{
|
|
1376
1380
|
to: compoundV2MigrationAdapter,
|
|
@@ -1394,7 +1398,7 @@ export var BundlerAction;
|
|
|
1394
1398
|
BundlerAction.compoundV2Redeem = compoundV2Redeem;
|
|
1395
1399
|
/* CompoundV3 */
|
|
1396
1400
|
/**
|
|
1397
|
-
* Encodes a call to the
|
|
1401
|
+
* Encodes a call to the CompoundV3MigrationAdapter to repay a debt on CompoundV3.
|
|
1398
1402
|
* @param chainId The chain id for which to encode the call.
|
|
1399
1403
|
* @param instance The CompoundV3 instance on which to repay the debt.
|
|
1400
1404
|
* @param amount The amount of debt to repay.
|
|
@@ -1421,19 +1425,18 @@ export var BundlerAction;
|
|
|
1421
1425
|
}
|
|
1422
1426
|
BundlerAction.compoundV3Repay = compoundV3Repay;
|
|
1423
1427
|
/**
|
|
1424
|
-
* Encodes a call to the
|
|
1428
|
+
* Encodes a call to the CompoundV3MigrationAdapter to withdraw collateral from CompoundV3.
|
|
1425
1429
|
* @param chainId The chain id for which to encode the call.
|
|
1426
1430
|
* @param instance The CompoundV3 instance on which to withdraw.
|
|
1427
1431
|
* @param asset The asset to withdraw.
|
|
1428
1432
|
* @param amount The amount to withdraw.
|
|
1429
|
-
* @param recipient The recipient of ERC20 tokens.
|
|
1433
|
+
* @param recipient The recipient of ERC20 tokens.
|
|
1430
1434
|
* @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
|
|
1431
1435
|
*/
|
|
1432
1436
|
function compoundV3WithdrawFrom(chainId, instance, asset, amount, recipient, skipRevert = false) {
|
|
1433
1437
|
const { bundler3: { compoundV3MigrationAdapter }, } = getChainAddresses(chainId);
|
|
1434
1438
|
if (compoundV3MigrationAdapter == null)
|
|
1435
1439
|
throw new BundlerErrors.UnexpectedAction("compoundV3WithdrawFrom", chainId);
|
|
1436
|
-
recipient ??= compoundV3MigrationAdapter;
|
|
1437
1440
|
return [
|
|
1438
1441
|
{
|
|
1439
1442
|
to: compoundV3MigrationAdapter,
|
|
@@ -1450,7 +1453,8 @@ export var BundlerAction;
|
|
|
1450
1453
|
}
|
|
1451
1454
|
BundlerAction.compoundV3WithdrawFrom = compoundV3WithdrawFrom;
|
|
1452
1455
|
/**
|
|
1453
|
-
* Encodes a call to the
|
|
1456
|
+
* Encodes a call to the CompoundV3 instance to allow the chain's CompoundV3MigrationAdapter.
|
|
1457
|
+
* to act on the sender's position on CompoundV3.
|
|
1454
1458
|
* @param chainId The chain id for which to encode the call.
|
|
1455
1459
|
* @param instance The CompoundV3 instance on which to submit the signature.
|
|
1456
1460
|
* @param owner The owner of the CompoundV3 position.
|
|
@@ -1458,15 +1462,13 @@ export var BundlerAction;
|
|
|
1458
1462
|
* @param nonce The nonce used to sign.
|
|
1459
1463
|
* @param expiry The timestamp until which the signature is valid.
|
|
1460
1464
|
* @param signature The Ethers signature to submit.
|
|
1461
|
-
* @param manager The address of the manager to approve. Defaults to the chain's bundler3 CompoundV3MigrationAdapter.
|
|
1462
1465
|
* @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
|
|
1463
1466
|
*/
|
|
1464
|
-
function compoundV3AllowBySig(chainId, instance, owner, isAllowed, nonce, expiry, signature,
|
|
1467
|
+
function compoundV3AllowBySig(chainId, instance, owner, isAllowed, nonce, expiry, signature, skipRevert = true) {
|
|
1465
1468
|
const { bundler3: { compoundV3MigrationAdapter }, } = getChainAddresses(chainId);
|
|
1466
1469
|
if (compoundV3MigrationAdapter == null)
|
|
1467
1470
|
throw new BundlerErrors.UnexpectedAction("compoundV3AllowBySig", chainId);
|
|
1468
1471
|
const { r, s, yParity } = parseSignature(signature);
|
|
1469
|
-
manager ??= compoundV3MigrationAdapter;
|
|
1470
1472
|
return [
|
|
1471
1473
|
{
|
|
1472
1474
|
to: instance,
|
|
@@ -1490,7 +1492,16 @@ export var BundlerAction;
|
|
|
1490
1492
|
},
|
|
1491
1493
|
],
|
|
1492
1494
|
functionName: "allowBySig",
|
|
1493
|
-
args: [
|
|
1495
|
+
args: [
|
|
1496
|
+
owner,
|
|
1497
|
+
compoundV3MigrationAdapter,
|
|
1498
|
+
isAllowed,
|
|
1499
|
+
nonce,
|
|
1500
|
+
expiry,
|
|
1501
|
+
yParity + 27,
|
|
1502
|
+
r,
|
|
1503
|
+
s,
|
|
1504
|
+
],
|
|
1494
1505
|
}),
|
|
1495
1506
|
value: 0n,
|
|
1496
1507
|
skipRevert,
|