@morpho-org/bundler-sdk-viem 3.0.0-next.10 → 3.0.0-next.12

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.
@@ -96,19 +96,19 @@ export var BundlerAction;
96
96
  return BundlerAction.morphoSetAuthorizationWithSig(chainId, authorization, signature, skipRevert);
97
97
  }
98
98
  case "morphoSupply": {
99
- const [market, assets, shares, slippageAmount, onBehalf, onMorphoSupply,] = args;
100
- return BundlerAction.morphoSupply(chainId, market, assets, shares, slippageAmount, onBehalf, onMorphoSupply.flatMap(BundlerAction.encode.bind(null, chainId)));
99
+ const [market, assets, shares, slippageAmount, onBehalf, onMorphoSupply, skipRevert,] = args;
100
+ return BundlerAction.morphoSupply(chainId, market, assets, shares, slippageAmount, onBehalf, onMorphoSupply.flatMap(BundlerAction.encode.bind(null, chainId)), skipRevert);
101
101
  }
102
102
  case "morphoSupplyCollateral": {
103
- const [market, amount, onBehalf, onMorphoSupplyCollateral] = args;
104
- return BundlerAction.morphoSupplyCollateral(chainId, market, amount, onBehalf, onMorphoSupplyCollateral.flatMap(BundlerAction.encode.bind(null, chainId)));
103
+ const [market, amount, onBehalf, onMorphoSupplyCollateral, skipRevert] = args;
104
+ return BundlerAction.morphoSupplyCollateral(chainId, market, amount, onBehalf, onMorphoSupplyCollateral.flatMap(BundlerAction.encode.bind(null, chainId)), skipRevert);
105
105
  }
106
106
  case "morphoBorrow": {
107
107
  return BundlerAction.morphoBorrow(chainId, ...args);
108
108
  }
109
109
  case "morphoRepay": {
110
- const [market, assets, shares, slippageAmount, onBehalf, onMorphoRepay,] = args;
111
- return BundlerAction.morphoRepay(chainId, market, assets, shares, slippageAmount, onBehalf, onMorphoRepay.flatMap(BundlerAction.encode.bind(null, chainId)));
110
+ const [market, assets, shares, slippageAmount, onBehalf, onMorphoRepay, skipRevert,] = args;
111
+ return BundlerAction.morphoRepay(chainId, market, assets, shares, slippageAmount, onBehalf, onMorphoRepay.flatMap(BundlerAction.encode.bind(null, chainId)), skipRevert);
112
112
  }
113
113
  case "morphoWithdraw": {
114
114
  return BundlerAction.morphoWithdraw(chainId, ...args);
@@ -203,8 +203,9 @@ export var BundlerAction;
203
203
  * @param owner The owner of native tokens.
204
204
  * @param recipient The address to send native tokens to.
205
205
  * @param amount The amount of native tokens to send (in wei).
206
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
206
207
  */
207
- function nativeTransfer(chainId, owner, recipient, amount) {
208
+ function nativeTransfer(chainId, owner, recipient, amount, skipRevert = false) {
208
209
  const { bundler3: { bundler3, generalAdapter1 }, } = getChainAddresses(chainId);
209
210
  if (recipient === bundler3)
210
211
  return [];
@@ -227,7 +228,7 @@ export var BundlerAction;
227
228
  to: recipient,
228
229
  data: "0x",
229
230
  value: amount,
230
- skipRevert: false,
231
+ skipRevert,
231
232
  callbackHash: zeroHash,
232
233
  },
233
234
  ];
@@ -239,8 +240,10 @@ export var BundlerAction;
239
240
  * @param asset The address of the ERC20 token to transfer.
240
241
  * @param recipient The address to send tokens to.
241
242
  * @param amount The amount of tokens to send.
243
+ * @param adapter The address of the adapter to use. Defaults to the chain's bundler3 general adapter.
244
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
242
245
  */
243
- function erc20Transfer(chainId, asset, recipient, amount, adapter) {
246
+ function erc20Transfer(chainId, asset, recipient, amount, adapter, skipRevert = false) {
244
247
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
245
248
  adapter ??= generalAdapter1;
246
249
  return [
@@ -252,7 +255,7 @@ export var BundlerAction;
252
255
  args: [asset, recipient, amount],
253
256
  }),
254
257
  value: 0n,
255
- skipRevert: false,
258
+ skipRevert,
256
259
  callbackHash: zeroHash,
257
260
  },
258
261
  ];
@@ -264,8 +267,9 @@ export var BundlerAction;
264
267
  * @param asset The address of the ERC20 token to transfer.
265
268
  * @param amount The amount of tokens to send.
266
269
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
270
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
267
271
  */
268
- function erc20TransferFrom(chainId, asset, amount, recipient) {
272
+ function erc20TransferFrom(chainId, asset, amount, recipient, skipRevert = false) {
269
273
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
270
274
  recipient ??= generalAdapter1;
271
275
  return [
@@ -277,7 +281,7 @@ export var BundlerAction;
277
281
  args: [asset, recipient, amount],
278
282
  }),
279
283
  value: 0n,
280
- skipRevert: false,
284
+ skipRevert,
281
285
  callbackHash: zeroHash,
282
286
  },
283
287
  ];
@@ -293,7 +297,7 @@ export var BundlerAction;
293
297
  * @param deadline The timestamp until which the signature is valid.
294
298
  * @param signature The Ethers signature to permit the tokens.
295
299
  * @param spender The address allowed to spend the tokens.
296
- * @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
300
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert. Defaults to true.
297
301
  */
298
302
  function permit(chainId, owner, asset, amount, deadline, signature, spender, skipRevert = true) {
299
303
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
@@ -323,7 +327,7 @@ export var BundlerAction;
323
327
  * @param allowed The amount of DAI to permit.
324
328
  * @param signature The Ethers signature to permit the tokens.
325
329
  * @param spender The address allowed to spend the tokens.
326
- * @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
330
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert.
327
331
  */
328
332
  function permitDai(chainId, owner, nonce, expiry, allowed, signature, spender, skipRevert = true) {
329
333
  const { dai, bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
@@ -372,7 +376,7 @@ export var BundlerAction;
372
376
  * @param owner The owner of ERC20 tokens.
373
377
  * @param permitSingle The permit details to submit to Permit2.
374
378
  * @param signature The Ethers signature to permit the tokens.
375
- * @param skipRevert Whether to allow the permit to revert without making the whole multicall revert.
379
+ * @param skipRevert Whether to allow the permit to revert without making the whole bundle revert. Defaults to true.
376
380
  */
377
381
  function approve2(chainId, owner, permitSingle, signature, skipRevert = true) {
378
382
  const { permit2 } = getChainAddresses(chainId);
@@ -400,8 +404,9 @@ export var BundlerAction;
400
404
  * @param owner The owner of ERC20 tokens.
401
405
  * @param amount The amount of tokens to send.
402
406
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
407
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
403
408
  */
404
- function transferFrom2(chainId, asset, owner, amount, recipient) {
409
+ function transferFrom2(chainId, asset, owner, amount, recipient, skipRevert = false) {
405
410
  const { permit2, bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
406
411
  if (permit2 == null)
407
412
  throw new BundlerErrors.UnexpectedAction("transferFrom2", chainId);
@@ -416,7 +421,7 @@ export var BundlerAction;
416
421
  args: [owner, recipient, amount, asset],
417
422
  }),
418
423
  value: 0n,
419
- skipRevert: false,
424
+ skipRevert,
420
425
  callbackHash: zeroHash,
421
426
  },
422
427
  ];
@@ -429,8 +434,9 @@ export var BundlerAction;
429
434
  * @param wrapper The address of the ERC20 wrapper token.
430
435
  * @param underlying The address of the underlying ERC20 token.
431
436
  * @param amount The amount of tokens to send.
437
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
432
438
  */
433
- function erc20WrapperDepositFor(chainId, wrapper, underlying, amount) {
439
+ function erc20WrapperDepositFor(chainId, wrapper, underlying, amount, skipRevert = false) {
434
440
  const { bundler3: { generalAdapter1, erc20WrapperAdapter }, } = getChainAddresses(chainId);
435
441
  if (erc20WrapperAdapter == null)
436
442
  throw new BundlerErrors.UnexpectedAction("erc20WrapperDepositFor", chainId);
@@ -443,7 +449,7 @@ export var BundlerAction;
443
449
  args: [underlying, erc20WrapperAdapter, maxUint256],
444
450
  }),
445
451
  value: 0n,
446
- skipRevert: false,
452
+ skipRevert,
447
453
  callbackHash: zeroHash,
448
454
  },
449
455
  {
@@ -454,7 +460,7 @@ export var BundlerAction;
454
460
  args: [wrapper, amount],
455
461
  }),
456
462
  value: 0n,
457
- skipRevert: false,
463
+ skipRevert,
458
464
  callbackHash: zeroHash,
459
465
  },
460
466
  {
@@ -465,7 +471,7 @@ export var BundlerAction;
465
471
  args: [underlying, generalAdapter1, maxUint256],
466
472
  }),
467
473
  value: 0n,
468
- skipRevert: false,
474
+ skipRevert,
469
475
  callbackHash: zeroHash,
470
476
  },
471
477
  ];
@@ -477,8 +483,9 @@ export var BundlerAction;
477
483
  * @param wrapper The address of the ERC20 wrapper token.
478
484
  * @param account The address to send the underlying ERC20 tokens.
479
485
  * @param amount The amount of tokens to send.
486
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
480
487
  */
481
- function erc20WrapperWithdrawTo(chainId, wrapper, receiver, amount) {
488
+ function erc20WrapperWithdrawTo(chainId, wrapper, receiver, amount, skipRevert = false) {
482
489
  const { bundler3: { generalAdapter1, erc20WrapperAdapter }, } = getChainAddresses(chainId);
483
490
  if (erc20WrapperAdapter == null)
484
491
  throw new BundlerErrors.UnexpectedAction("erc20WrapperWithdrawTo", chainId);
@@ -491,7 +498,7 @@ export var BundlerAction;
491
498
  args: [wrapper, erc20WrapperAdapter, maxUint256],
492
499
  }),
493
500
  value: 0n,
494
- skipRevert: false,
501
+ skipRevert,
495
502
  callbackHash: zeroHash,
496
503
  },
497
504
  {
@@ -502,7 +509,7 @@ export var BundlerAction;
502
509
  args: [wrapper, receiver, amount],
503
510
  }),
504
511
  value: 0n,
505
- skipRevert: false,
512
+ skipRevert,
506
513
  callbackHash: zeroHash,
507
514
  },
508
515
  {
@@ -513,7 +520,7 @@ export var BundlerAction;
513
520
  args: [wrapper, generalAdapter1, maxUint256],
514
521
  }),
515
522
  value: 0n,
516
- skipRevert: false,
523
+ skipRevert,
517
524
  callbackHash: zeroHash,
518
525
  },
519
526
  ];
@@ -527,8 +534,9 @@ export var BundlerAction;
527
534
  * @param shares The amount of shares to mint.
528
535
  * @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
529
536
  * @param receiver The address to send the shares to.
537
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
530
538
  */
531
- function erc4626Mint(chainId, erc4626, shares, maxSharePrice, receiver) {
539
+ function erc4626Mint(chainId, erc4626, shares, maxSharePrice, receiver, skipRevert = false) {
532
540
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
533
541
  return [
534
542
  {
@@ -539,7 +547,7 @@ export var BundlerAction;
539
547
  args: [erc4626, shares, maxSharePrice, receiver],
540
548
  }),
541
549
  value: 0n,
542
- skipRevert: false,
550
+ skipRevert,
543
551
  callbackHash: zeroHash,
544
552
  },
545
553
  ];
@@ -552,8 +560,9 @@ export var BundlerAction;
552
560
  * @param assets The amount of assets to deposit.
553
561
  * @param maxSharePrice The maximum amount of assets to pay to get 1 share (scaled by RAY).
554
562
  * @param receiver The address to send the shares to.
563
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
555
564
  */
556
- function erc4626Deposit(chainId, erc4626, assets, maxSharePrice, receiver) {
565
+ function erc4626Deposit(chainId, erc4626, assets, maxSharePrice, receiver, skipRevert = false) {
557
566
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
558
567
  return [
559
568
  {
@@ -564,7 +573,7 @@ export var BundlerAction;
564
573
  args: [erc4626, assets, maxSharePrice, receiver],
565
574
  }),
566
575
  value: 0n,
567
- skipRevert: false,
576
+ skipRevert,
568
577
  callbackHash: zeroHash,
569
578
  },
570
579
  ];
@@ -578,8 +587,9 @@ export var BundlerAction;
578
587
  * @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
579
588
  * @param receiver The address to send the assets to.
580
589
  * @param owner The address on behalf of which the assets are withdrawn.
590
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
581
591
  */
582
- function erc4626Withdraw(chainId, erc4626, assets, minSharePrice, receiver, owner) {
592
+ function erc4626Withdraw(chainId, erc4626, assets, minSharePrice, receiver, owner, skipRevert = false) {
583
593
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
584
594
  return [
585
595
  {
@@ -590,7 +600,7 @@ export var BundlerAction;
590
600
  args: [erc4626, assets, minSharePrice, receiver, owner],
591
601
  }),
592
602
  value: 0n,
593
- skipRevert: false,
603
+ skipRevert,
594
604
  callbackHash: zeroHash,
595
605
  },
596
606
  ];
@@ -604,8 +614,9 @@ export var BundlerAction;
604
614
  * @param minSharePrice The minimum number of assets to receive per share (scaled by RAY).
605
615
  * @param receiver The address to send the assets to.
606
616
  * @param owner The address on behalf of which the assets are withdrawn.
617
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
607
618
  */
608
- function erc4626Redeem(chainId, erc4626, shares, minSharePrice, receiver, owner) {
619
+ function erc4626Redeem(chainId, erc4626, shares, minSharePrice, receiver, owner, skipRevert = false) {
609
620
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
610
621
  return [
611
622
  {
@@ -616,7 +627,7 @@ export var BundlerAction;
616
627
  args: [erc4626, shares, minSharePrice, receiver, owner],
617
628
  }),
618
629
  value: 0n,
619
- skipRevert: false,
630
+ skipRevert,
620
631
  callbackHash: zeroHash,
621
632
  },
622
633
  ];
@@ -628,7 +639,7 @@ export var BundlerAction;
628
639
  * @param chainId The chain id for which to encode the call.
629
640
  * @param authorization The authorization details to submit to Morpho Blue.
630
641
  * @param signature The Ethers signature to authorize the account.
631
- * @param skipRevert Whether to allow the authorization call to revert without making the whole multicall revert.
642
+ * @param skipRevert Whether to allow the authorization call to revert without making the whole bundle revert. Defaults to true.
632
643
  */
633
644
  function morphoSetAuthorizationWithSig(chainId, authorization, signature, skipRevert = true) {
634
645
  const { morpho } = getChainAddresses(chainId);
@@ -657,8 +668,9 @@ export var BundlerAction;
657
668
  * @param slippageAmount The maximum (resp. minimum) amount of assets (resp. supply shares) to supply (resp. mint) (protects the sender from unexpected slippage).
658
669
  * @param onBehalf The address to supply on behalf of.
659
670
  * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
671
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
660
672
  */
661
- function morphoSupply(chainId, market, assets, shares, slippageAmount, onBehalf, callbackCalls) {
673
+ function morphoSupply(chainId, market, assets, shares, slippageAmount, onBehalf, callbackCalls, skipRevert = false) {
662
674
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
663
675
  const reenter = callbackCalls.length > 0;
664
676
  const reenterData = reenter
@@ -673,7 +685,7 @@ export var BundlerAction;
673
685
  args: [market, assets, shares, slippageAmount, onBehalf, reenterData],
674
686
  }),
675
687
  value: 0n,
676
- skipRevert: false,
688
+ skipRevert,
677
689
  callbackHash: reenter ? keccak256(reenterData) : zeroHash,
678
690
  },
679
691
  ];
@@ -686,8 +698,9 @@ export var BundlerAction;
686
698
  * @param assets The amount of assets to supply.
687
699
  * @param onBehalf The address to supply on behalf of.
688
700
  * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupplyCollateral` callback.
701
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
689
702
  */
690
- function morphoSupplyCollateral(chainId, market, assets, onBehalf, callbackCalls) {
703
+ function morphoSupplyCollateral(chainId, market, assets, onBehalf, callbackCalls, skipRevert = false) {
691
704
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
692
705
  const reenter = callbackCalls.length > 0;
693
706
  const reenterData = reenter
@@ -702,7 +715,7 @@ export var BundlerAction;
702
715
  args: [market, assets, onBehalf, reenterData],
703
716
  }),
704
717
  value: 0n,
705
- skipRevert: false,
718
+ skipRevert,
706
719
  callbackHash: reenter ? keccak256(reenterData) : zeroHash,
707
720
  },
708
721
  ];
@@ -716,8 +729,9 @@ export var BundlerAction;
716
729
  * @param shares The amount of borrow shares to mint.
717
730
  * @param slippageAmount The minimum (resp. maximum) amount of assets (resp. borrow shares) to borrow (resp. mint) (protects the sender from unexpected slippage).
718
731
  * @param receiver The address to send borrowed tokens to.
732
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
719
733
  */
720
- function morphoBorrow(chainId, market, assets, shares, slippageAmount, receiver) {
734
+ function morphoBorrow(chainId, market, assets, shares, slippageAmount, receiver, skipRevert = false) {
721
735
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
722
736
  return [
723
737
  {
@@ -728,7 +742,7 @@ export var BundlerAction;
728
742
  args: [market, assets, shares, slippageAmount, receiver],
729
743
  }),
730
744
  value: 0n,
731
- skipRevert: false,
745
+ skipRevert,
732
746
  callbackHash: zeroHash,
733
747
  },
734
748
  ];
@@ -743,8 +757,9 @@ export var BundlerAction;
743
757
  * @param slippageAmount The maximum (resp. minimum) amount of assets (resp. borrow shares) to repay (resp. redeem) (protects the sender from unexpected slippage).
744
758
  * @param onBehalf The address to repay on behalf of.
745
759
  * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoSupply` callback.
760
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
746
761
  */
747
- function morphoRepay(chainId, market, assets, shares, slippageAmount, onBehalf, callbackCalls) {
762
+ function morphoRepay(chainId, market, assets, shares, slippageAmount, onBehalf, callbackCalls, skipRevert = false) {
748
763
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
749
764
  const reenter = callbackCalls.length > 0;
750
765
  const reenterData = reenter
@@ -759,7 +774,7 @@ export var BundlerAction;
759
774
  args: [market, assets, shares, slippageAmount, onBehalf, reenterData],
760
775
  }),
761
776
  value: 0n,
762
- skipRevert: false,
777
+ skipRevert,
763
778
  callbackHash: reenter ? keccak256(reenterData) : zeroHash,
764
779
  },
765
780
  ];
@@ -773,8 +788,9 @@ export var BundlerAction;
773
788
  * @param shares The amount of supply shares to redeem.
774
789
  * @param slippageAmount The minimum (resp. maximum) amount of assets (resp. supply shares) to withdraw (resp. redeem) (protects the sender from unexpected slippage).
775
790
  * @param receiver The address to send withdrawn tokens to.
791
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
776
792
  */
777
- function morphoWithdraw(chainId, market, assets, shares, slippageAmount, receiver) {
793
+ function morphoWithdraw(chainId, market, assets, shares, slippageAmount, receiver, skipRevert = false) {
778
794
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
779
795
  return [
780
796
  {
@@ -785,7 +801,7 @@ export var BundlerAction;
785
801
  args: [market, assets, shares, slippageAmount, receiver],
786
802
  }),
787
803
  value: 0n,
788
- skipRevert: false,
804
+ skipRevert,
789
805
  callbackHash: zeroHash,
790
806
  },
791
807
  ];
@@ -797,8 +813,9 @@ export var BundlerAction;
797
813
  * @param market The market params to withdraw from.
798
814
  * @param assets The amount of assets to withdraw.
799
815
  * @param receiver The address to send withdrawn tokens to.
816
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
800
817
  */
801
- function morphoWithdrawCollateral(chainId, market, assets, receiver) {
818
+ function morphoWithdrawCollateral(chainId, market, assets, receiver, skipRevert = false) {
802
819
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
803
820
  return [
804
821
  {
@@ -809,7 +826,7 @@ export var BundlerAction;
809
826
  args: [market, assets, receiver],
810
827
  }),
811
828
  value: 0n,
812
- skipRevert: false,
829
+ skipRevert,
813
830
  callbackHash: zeroHash,
814
831
  },
815
832
  ];
@@ -821,8 +838,9 @@ export var BundlerAction;
821
838
  * @param asset The address of the ERC20 token to flash loan.
822
839
  * @param amount The amount of tokens to flash loan.
823
840
  * @param callbackCalls The array of calls to execute inside Morpho Blue's `onMorphoFlashLoan` callback.
841
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
824
842
  */
825
- function morphoFlashLoan(chainId, asset, amount, callbackCalls) {
843
+ function morphoFlashLoan(chainId, asset, amount, callbackCalls, skipRevert = false) {
826
844
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
827
845
  const reenter = callbackCalls.length > 0;
828
846
  const reenterData = reenter
@@ -845,7 +863,7 @@ export var BundlerAction;
845
863
  ],
846
864
  }),
847
865
  value: 0n,
848
- skipRevert: false,
866
+ skipRevert,
849
867
  callbackHash: reenter ? keccak256(reenterData) : zeroHash,
850
868
  },
851
869
  ];
@@ -858,8 +876,9 @@ export var BundlerAction;
858
876
  * @param fee The vault public reallocation fee.
859
877
  * @param withdrawals The array of withdrawals to perform, before supplying everything to the supply market.
860
878
  * @param supplyMarketParams The market params to reallocate to.
879
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
861
880
  */
862
- function publicAllocatorReallocateTo(chainId, vault, fee, withdrawals, supplyMarketParams) {
881
+ function publicAllocatorReallocateTo(chainId, vault, fee, withdrawals, supplyMarketParams, skipRevert = false) {
863
882
  const { publicAllocator } = getChainAddresses(chainId);
864
883
  if (publicAllocator == null)
865
884
  throw new BundlerErrors.UnexpectedAction("reallocateTo", chainId);
@@ -872,7 +891,7 @@ export var BundlerAction;
872
891
  args: [vault, withdrawals, supplyMarketParams],
873
892
  }),
874
893
  value: fee,
875
- skipRevert: false,
894
+ skipRevert,
876
895
  callbackHash: zeroHash,
877
896
  },
878
897
  ];
@@ -887,7 +906,7 @@ export var BundlerAction;
887
906
  * @param reward The address of the reward token to claim.
888
907
  * @param amount The amount of rewards to claim.
889
908
  * @param proof The Merkle proof to claim the rewards.
890
- * @param skipRevert Whether to allow the claim to revert without making the whole multicall revert.
909
+ * @param skipRevert Whether to allow the claim to revert without making the whole bundle revert. Defaults to true.
891
910
  */
892
911
  function urdClaim(distributor, account, reward, amount, proof, skipRevert = true) {
893
912
  return [
@@ -911,8 +930,9 @@ export var BundlerAction;
911
930
  * @param chainId The chain id for which to encode the call.
912
931
  * @param amount The amount of native tokens to wrap (in wei).
913
932
  * @param recipient The address to send tokens to. Defaults to the chain's bundler3 general adapter.
933
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
914
934
  */
915
- function wrapNative(chainId, amount, recipient) {
935
+ function wrapNative(chainId, amount, recipient, skipRevert = false) {
916
936
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
917
937
  recipient ??= generalAdapter1;
918
938
  return [
@@ -924,7 +944,7 @@ export var BundlerAction;
924
944
  args: [amount, recipient],
925
945
  }),
926
946
  value: 0n,
927
- skipRevert: false,
947
+ skipRevert,
928
948
  callbackHash: zeroHash,
929
949
  },
930
950
  ];
@@ -935,8 +955,9 @@ export var BundlerAction;
935
955
  * @param chainId The chain id for which to encode the call.
936
956
  * @param amount The amount of native tokens to unwrap (in wei).
937
957
  * @param recipient The address to send tokens to. Defaults to the chain's bundler3 general adapter.
958
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
938
959
  */
939
- function unwrapNative(chainId, amount, recipient) {
960
+ function unwrapNative(chainId, amount, recipient, skipRevert = false) {
940
961
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
941
962
  recipient ??= generalAdapter1;
942
963
  return [
@@ -948,7 +969,7 @@ export var BundlerAction;
948
969
  args: [amount, recipient],
949
970
  }),
950
971
  value: 0n,
951
- skipRevert: false,
972
+ skipRevert,
952
973
  callbackHash: zeroHash,
953
974
  },
954
975
  ];
@@ -962,8 +983,9 @@ export var BundlerAction;
962
983
  * @param maxSharePrice The maximum amount of wei to pay for minting 1 share (scaled by RAY).
963
984
  * @param referral The referral address to use.
964
985
  * @param recipient The address to send stETH to. Defaults to the chain's bundler3 general adapter.
986
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
965
987
  */
966
- function stakeEth(chainId, amount, maxSharePrice, referral, recipient) {
988
+ function stakeEth(chainId, amount, maxSharePrice, referral, recipient, skipRevert = false) {
967
989
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
968
990
  recipient ??= generalAdapter1;
969
991
  return [
@@ -975,7 +997,7 @@ export var BundlerAction;
975
997
  args: [amount, maxSharePrice, referral, recipient],
976
998
  }),
977
999
  value: 0n,
978
- skipRevert: false,
1000
+ skipRevert,
979
1001
  callbackHash: zeroHash,
980
1002
  },
981
1003
  ];
@@ -987,8 +1009,9 @@ export var BundlerAction;
987
1009
  * @param chainId The chain id for which to encode the call.
988
1010
  * @param amount The amount of stETH to wrap (in wei).
989
1011
  * @param recipient The address to send wstETH to. Defaults to the chain's bundler3 general adapter.
1012
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
990
1013
  */
991
- function wrapStEth(chainId, amount, recipient) {
1014
+ function wrapStEth(chainId, amount, recipient, skipRevert = false) {
992
1015
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
993
1016
  recipient ??= generalAdapter1;
994
1017
  return [
@@ -1000,7 +1023,7 @@ export var BundlerAction;
1000
1023
  args: [amount, recipient],
1001
1024
  }),
1002
1025
  value: 0n,
1003
- skipRevert: false,
1026
+ skipRevert,
1004
1027
  callbackHash: zeroHash,
1005
1028
  },
1006
1029
  ];
@@ -1011,8 +1034,9 @@ export var BundlerAction;
1011
1034
  * @param chainId The chain id for which to encode the call.
1012
1035
  * @param amount The amount of wstETH to unwrap (in wei).
1013
1036
  * @param recipient The address to send stETH to. Defaults to the chain's bundler3 general adapter.
1037
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1014
1038
  */
1015
- function unwrapStEth(chainId, amount, recipient) {
1039
+ function unwrapStEth(chainId, amount, recipient, skipRevert = false) {
1016
1040
  const { bundler3: { generalAdapter1 }, } = getChainAddresses(chainId);
1017
1041
  recipient ??= generalAdapter1;
1018
1042
  return [
@@ -1024,7 +1048,7 @@ export var BundlerAction;
1024
1048
  args: [amount, recipient],
1025
1049
  }),
1026
1050
  value: 0n,
1027
- skipRevert: false,
1051
+ skipRevert,
1028
1052
  callbackHash: zeroHash,
1029
1053
  },
1030
1054
  ];
@@ -1038,8 +1062,9 @@ export var BundlerAction;
1038
1062
  * @param amount The amount of debt to repay.
1039
1063
  * @param onBehalf The address on behalf of which to repay.
1040
1064
  * @param rateMode The interest rate mode used by the debt to repay.
1065
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1041
1066
  */
1042
- function aaveV2Repay(chainId, asset, amount, onBehalf, rateMode = 1n) {
1067
+ function aaveV2Repay(chainId, asset, amount, onBehalf, rateMode = 1n, skipRevert = false) {
1043
1068
  const { bundler3: { aaveV2MigrationAdapter }, } = getChainAddresses(chainId);
1044
1069
  if (aaveV2MigrationAdapter == null)
1045
1070
  throw new BundlerErrors.UnexpectedAction("aaveV2Repay", chainId);
@@ -1052,7 +1077,7 @@ export var BundlerAction;
1052
1077
  args: [asset, amount, rateMode, onBehalf],
1053
1078
  }),
1054
1079
  value: 0n,
1055
- skipRevert: false,
1080
+ skipRevert,
1056
1081
  callbackHash: zeroHash,
1057
1082
  },
1058
1083
  ];
@@ -1064,8 +1089,9 @@ export var BundlerAction;
1064
1089
  * @param asset The asset to withdraw.
1065
1090
  * @param amount The amount of asset to withdraw.
1066
1091
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1092
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1067
1093
  */
1068
- function aaveV2Withdraw(chainId, asset, amount, recipient) {
1094
+ function aaveV2Withdraw(chainId, asset, amount, recipient, skipRevert = false) {
1069
1095
  const { bundler3: { aaveV2MigrationAdapter }, } = getChainAddresses(chainId);
1070
1096
  if (aaveV2MigrationAdapter == null)
1071
1097
  throw new BundlerErrors.UnexpectedAction("aaveV2Withdraw", chainId);
@@ -1079,7 +1105,7 @@ export var BundlerAction;
1079
1105
  args: [asset, amount, recipient],
1080
1106
  }),
1081
1107
  value: 0n,
1082
- skipRevert: false,
1108
+ skipRevert,
1083
1109
  callbackHash: zeroHash,
1084
1110
  },
1085
1111
  ];
@@ -1093,8 +1119,9 @@ export var BundlerAction;
1093
1119
  * @param amount The amount of debt to repay.
1094
1120
  * @param onBehalf The address on behalf of which to repay.
1095
1121
  * @param rateMode The interest rate mode used by the debt to repay.
1122
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1096
1123
  */
1097
- function aaveV3Repay(chainId, asset, amount, onBehalf, rateMode = 1n) {
1124
+ function aaveV3Repay(chainId, asset, amount, onBehalf, rateMode = 1n, skipRevert = false) {
1098
1125
  const { bundler3: { aaveV3CoreMigrationAdapter }, // TODO: choose between core & prime
1099
1126
  } = getChainAddresses(chainId);
1100
1127
  if (aaveV3CoreMigrationAdapter == null)
@@ -1108,7 +1135,7 @@ export var BundlerAction;
1108
1135
  args: [asset, amount, rateMode, onBehalf],
1109
1136
  }),
1110
1137
  value: 0n,
1111
- skipRevert: false,
1138
+ skipRevert,
1112
1139
  callbackHash: zeroHash,
1113
1140
  },
1114
1141
  ];
@@ -1120,8 +1147,9 @@ export var BundlerAction;
1120
1147
  * @param asset The asset to withdraw.
1121
1148
  * @param amount The amount of asset to withdraw.
1122
1149
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1150
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1123
1151
  */
1124
- function aaveV3Withdraw(chainId, asset, amount, recipient) {
1152
+ function aaveV3Withdraw(chainId, asset, amount, recipient, skipRevert = false) {
1125
1153
  const { bundler3: { aaveV3CoreMigrationAdapter }, // TODO: choose between core & prime
1126
1154
  } = getChainAddresses(chainId);
1127
1155
  if (aaveV3CoreMigrationAdapter == null)
@@ -1136,7 +1164,7 @@ export var BundlerAction;
1136
1164
  args: [asset, amount, recipient],
1137
1165
  }),
1138
1166
  value: 0n,
1139
- skipRevert: false,
1167
+ skipRevert,
1140
1168
  callbackHash: zeroHash,
1141
1169
  },
1142
1170
  ];
@@ -1149,8 +1177,9 @@ export var BundlerAction;
1149
1177
  * @param underlying The underlying debt asset to repay.
1150
1178
  * @param amount The amount of debt to repay.
1151
1179
  * @param onBehalf The address on behalf of which to repay.
1180
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1152
1181
  */
1153
- function aaveV3OptimizerRepay(chainId, underlying, amount, onBehalf) {
1182
+ function aaveV3OptimizerRepay(chainId, underlying, amount, onBehalf, skipRevert = false) {
1154
1183
  const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
1155
1184
  if (aaveV3OptimizerMigrationAdapter == null)
1156
1185
  throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerRepay", chainId);
@@ -1163,7 +1192,7 @@ export var BundlerAction;
1163
1192
  args: [underlying, amount, onBehalf],
1164
1193
  }),
1165
1194
  value: 0n,
1166
- skipRevert: false,
1195
+ skipRevert,
1167
1196
  callbackHash: zeroHash,
1168
1197
  },
1169
1198
  ];
@@ -1176,8 +1205,9 @@ export var BundlerAction;
1176
1205
  * @param amount The amount to withdraw.
1177
1206
  * @param maxIterations The maximum amount of iterations to use for the withdrawal.
1178
1207
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1208
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1179
1209
  */
1180
- function aaveV3OptimizerWithdraw(chainId, underlying, amount, maxIterations, recipient) {
1210
+ function aaveV3OptimizerWithdraw(chainId, underlying, amount, maxIterations, recipient, skipRevert = false) {
1181
1211
  const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
1182
1212
  if (aaveV3OptimizerMigrationAdapter == null)
1183
1213
  throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerWithdraw", chainId);
@@ -1191,7 +1221,7 @@ export var BundlerAction;
1191
1221
  args: [underlying, amount, maxIterations, recipient],
1192
1222
  }),
1193
1223
  value: 0n,
1194
- skipRevert: false,
1224
+ skipRevert,
1195
1225
  callbackHash: zeroHash,
1196
1226
  },
1197
1227
  ];
@@ -1203,8 +1233,9 @@ export var BundlerAction;
1203
1233
  * @param underlying The underlying asset to withdraw.
1204
1234
  * @param amount The amount to withdraw.
1205
1235
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1236
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1206
1237
  */
1207
- function aaveV3OptimizerWithdrawCollateral(chainId, underlying, amount, recipient) {
1238
+ function aaveV3OptimizerWithdrawCollateral(chainId, underlying, amount, recipient, skipRevert = false) {
1208
1239
  const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
1209
1240
  if (aaveV3OptimizerMigrationAdapter == null)
1210
1241
  throw new BundlerErrors.UnexpectedAction("aaveV3OptimizerWithdrawCollateral", chainId);
@@ -1218,7 +1249,7 @@ export var BundlerAction;
1218
1249
  args: [underlying, amount, recipient],
1219
1250
  }),
1220
1251
  value: 0n,
1221
- skipRevert: false,
1252
+ skipRevert,
1222
1253
  callbackHash: zeroHash,
1223
1254
  },
1224
1255
  ];
@@ -1233,7 +1264,7 @@ export var BundlerAction;
1233
1264
  * @param deadline The timestamp until which the signature is valid.
1234
1265
  * @param signature The Ethers signature to submit.
1235
1266
  * @param manager The address of the manager to approve. Defaults to the chain's bundler3 AaveV3OptimizerMigrationAdapter.
1236
- * @param skipRevert Whether to allow the signature to revert without making the whole multicall revert.
1267
+ * @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
1237
1268
  */
1238
1269
  function aaveV3OptimizerApproveManagerWithSig(chainId, aaveV3Optimizer, owner, isApproved, nonce, deadline, signature, manager, skipRevert = true) {
1239
1270
  const { bundler3: { aaveV3OptimizerMigrationAdapter }, } = getChainAddresses(chainId);
@@ -1294,8 +1325,9 @@ export var BundlerAction;
1294
1325
  * @param cToken The cToken on which to repay the debt.
1295
1326
  * @param amount The amount of debt to repay.
1296
1327
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1328
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1297
1329
  */
1298
- function compoundV2Repay(chainId, cToken, amount, isEth, onBehalf) {
1330
+ function compoundV2Repay(chainId, cToken, amount, isEth, onBehalf, skipRevert = false) {
1299
1331
  const { bundler3: { compoundV2MigrationAdapter }, } = getChainAddresses(chainId);
1300
1332
  if (compoundV2MigrationAdapter == null)
1301
1333
  throw new BundlerErrors.UnexpectedAction("compoundV2Repay", chainId);
@@ -1314,7 +1346,7 @@ export var BundlerAction;
1314
1346
  args: [cToken, amount, onBehalf],
1315
1347
  }),
1316
1348
  value: isEth ? amount : 0n,
1317
- skipRevert: false,
1349
+ skipRevert,
1318
1350
  callbackHash: zeroHash,
1319
1351
  },
1320
1352
  ];
@@ -1326,8 +1358,9 @@ export var BundlerAction;
1326
1358
  * @param cToken The cToken on which to withdraw.
1327
1359
  * @param amount The amount to withdraw.
1328
1360
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1361
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1329
1362
  */
1330
- function compoundV2Redeem(chainId, cToken, amount, isEth, recipient) {
1363
+ function compoundV2Redeem(chainId, cToken, amount, isEth, recipient, skipRevert = false) {
1331
1364
  const { bundler3: { compoundV2MigrationAdapter }, } = getChainAddresses(chainId);
1332
1365
  if (compoundV2MigrationAdapter == null)
1333
1366
  throw new BundlerErrors.UnexpectedAction("compoundV2Repay", chainId);
@@ -1347,7 +1380,7 @@ export var BundlerAction;
1347
1380
  args: [cToken, amount, recipient],
1348
1381
  }),
1349
1382
  value: 0n,
1350
- skipRevert: false,
1383
+ skipRevert,
1351
1384
  callbackHash: zeroHash,
1352
1385
  },
1353
1386
  ];
@@ -1360,8 +1393,9 @@ export var BundlerAction;
1360
1393
  * @param instance The CompoundV3 instance on which to repay the debt.
1361
1394
  * @param amount The amount of debt to repay.
1362
1395
  * @param onBehalf The address on behalf of which to repay.
1396
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1363
1397
  */
1364
- function compoundV3Repay(chainId, instance, amount, onBehalf) {
1398
+ function compoundV3Repay(chainId, instance, amount, onBehalf, skipRevert = false) {
1365
1399
  const { bundler3: { compoundV3MigrationAdapter }, } = getChainAddresses(chainId);
1366
1400
  if (compoundV3MigrationAdapter == null)
1367
1401
  throw new BundlerErrors.UnexpectedAction("compoundV3Repay", chainId);
@@ -1374,7 +1408,7 @@ export var BundlerAction;
1374
1408
  args: [instance, amount, onBehalf],
1375
1409
  }),
1376
1410
  value: 0n,
1377
- skipRevert: false,
1411
+ skipRevert,
1378
1412
  callbackHash: zeroHash,
1379
1413
  },
1380
1414
  ];
@@ -1387,8 +1421,9 @@ export var BundlerAction;
1387
1421
  * @param asset The asset to withdraw.
1388
1422
  * @param amount The amount to withdraw.
1389
1423
  * @param recipient The recipient of ERC20 tokens. Defaults to the chain's bundler3 general adapter.
1424
+ * @param skipRevert Whether to allow the transfer to revert without making the whole bundler revert. Defaults to false.
1390
1425
  */
1391
- function compoundV3WithdrawFrom(chainId, instance, asset, amount, recipient) {
1426
+ function compoundV3WithdrawFrom(chainId, instance, asset, amount, recipient, skipRevert = false) {
1392
1427
  const { bundler3: { compoundV3MigrationAdapter }, } = getChainAddresses(chainId);
1393
1428
  if (compoundV3MigrationAdapter == null)
1394
1429
  throw new BundlerErrors.UnexpectedAction("compoundV3WithdrawFrom", chainId);
@@ -1402,7 +1437,7 @@ export var BundlerAction;
1402
1437
  args: [instance, asset, amount, recipient],
1403
1438
  }),
1404
1439
  value: 0n,
1405
- skipRevert: false,
1440
+ skipRevert,
1406
1441
  callbackHash: zeroHash,
1407
1442
  },
1408
1443
  ];
@@ -1418,7 +1453,7 @@ export var BundlerAction;
1418
1453
  * @param expiry The timestamp until which the signature is valid.
1419
1454
  * @param signature The Ethers signature to submit.
1420
1455
  * @param manager The address of the manager to approve. Defaults to the chain's bundler3 CompoundV3MigrationAdapter.
1421
- * @param skipRevert Whether to allow the signature to revert without making the whole multicall revert.
1456
+ * @param skipRevert Whether to allow the signature to revert without making the whole bundle revert. Defaults to true.
1422
1457
  */
1423
1458
  function compoundV3AllowBySig(chainId, instance, owner, isAllowed, nonce, expiry, signature, manager, skipRevert = true) {
1424
1459
  const { bundler3: { compoundV3MigrationAdapter }, } = getChainAddresses(chainId);