@safe-global/protocol-kit 6.1.2 → 7.0.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.
Files changed (71) hide show
  1. package/dist/cjs/src/index.cjs +1466 -200
  2. package/dist/cjs/test-utils/index.cjs +577 -72
  3. package/dist/esm/src/index.mjs +1428 -143
  4. package/dist/esm/test-utils/index.mjs +559 -35
  5. package/dist/src/Safe.d.ts +125 -3
  6. package/dist/src/Safe.d.ts.map +1 -1
  7. package/dist/src/SafeProvider.d.ts.map +1 -1
  8. package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts +1 -0
  9. package/dist/src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.d.ts.map +1 -1
  10. package/dist/src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.d.ts +33 -0
  11. package/dist/src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.d.ts.map +1 -0
  12. package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts +1 -0
  13. package/dist/src/contracts/CreateCall/CreateCallBaseContract.d.ts.map +1 -1
  14. package/dist/src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.d.ts +38 -0
  15. package/dist/src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.d.ts.map +1 -0
  16. package/dist/src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.d.ts +36 -0
  17. package/dist/src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.d.ts.map +1 -0
  18. package/dist/src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.d.ts +86 -0
  19. package/dist/src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.d.ts.map +1 -0
  20. package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts +1 -0
  21. package/dist/src/contracts/MultiSend/MultiSendBaseContract.d.ts.map +1 -1
  22. package/dist/src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.d.ts +26 -0
  23. package/dist/src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.d.ts.map +1 -0
  24. package/dist/src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.d.ts +26 -0
  25. package/dist/src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.d.ts.map +1 -0
  26. package/dist/src/contracts/Safe/SafeBaseContract.d.ts +1 -0
  27. package/dist/src/contracts/Safe/SafeBaseContract.d.ts.map +1 -1
  28. package/dist/src/contracts/Safe/v1.4.1/SafeContract_v1_4_1.d.ts +1 -1
  29. package/dist/src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.d.ts +156 -0
  30. package/dist/src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.d.ts.map +1 -0
  31. package/dist/src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.d.ts +60 -0
  32. package/dist/src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.d.ts.map +1 -0
  33. package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts +1 -0
  34. package/dist/src/contracts/SignMessageLib/SignMessageLibBaseContract.d.ts.map +1 -1
  35. package/dist/src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.d.ts +34 -0
  36. package/dist/src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.d.ts.map +1 -0
  37. package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts +1 -0
  38. package/dist/src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.d.ts.map +1 -1
  39. package/dist/src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.d.ts +31 -0
  40. package/dist/src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.d.ts.map +1 -0
  41. package/dist/src/contracts/config.d.ts +1 -1
  42. package/dist/src/contracts/config.d.ts.map +1 -1
  43. package/dist/src/contracts/contractInstances.d.ts +18 -8
  44. package/dist/src/contracts/contractInstances.d.ts.map +1 -1
  45. package/dist/src/contracts/index.d.ts +2 -1
  46. package/dist/src/contracts/index.d.ts.map +1 -1
  47. package/dist/src/contracts/safeDeploymentContracts.d.ts +2 -1
  48. package/dist/src/contracts/safeDeploymentContracts.d.ts.map +1 -1
  49. package/dist/src/contracts/utils.d.ts.map +1 -1
  50. package/dist/src/index.d.ts +3 -2
  51. package/dist/src/index.d.ts.map +1 -1
  52. package/dist/src/managers/fallbackHandlerManager.d.ts +1 -0
  53. package/dist/src/managers/fallbackHandlerManager.d.ts.map +1 -1
  54. package/dist/src/managers/moduleManager.d.ts +7 -0
  55. package/dist/src/managers/moduleManager.d.ts.map +1 -1
  56. package/dist/src/types/contracts.d.ts +22 -8
  57. package/dist/src/types/contracts.d.ts.map +1 -1
  58. package/dist/src/types/passkeys.d.ts +13 -2
  59. package/dist/src/types/passkeys.d.ts.map +1 -1
  60. package/dist/src/utils/eip-3770/config.d.ts.map +1 -1
  61. package/dist/src/utils/passkeys/PasskeyClient.d.ts +1 -1
  62. package/dist/src/utils/passkeys/PasskeyClient.d.ts.map +1 -1
  63. package/dist/src/utils/passkeys/extractPasskeyData.d.ts +8 -11
  64. package/dist/src/utils/passkeys/extractPasskeyData.d.ts.map +1 -1
  65. package/dist/src/utils/passkeys/isSharedSigner.d.ts +1 -1
  66. package/dist/src/utils/passkeys/isSharedSigner.d.ts.map +1 -1
  67. package/dist/src/utils/safeVersions.d.ts +8 -5
  68. package/dist/src/utils/safeVersions.d.ts.map +1 -1
  69. package/dist/test-utils/passkeys.d.ts +2 -2
  70. package/dist/test-utils/passkeys.d.ts.map +1 -1
  71. package/package.json +7 -5
@@ -33,6 +33,7 @@ import { waitForTransactionReceipt } from "viem/actions";
33
33
  import {
34
34
  getCompatibilityFallbackHandlerDeployments,
35
35
  getCreateCallDeployments,
36
+ getExtensibleFallbackHandlerDeployments,
36
37
  getMultiSendCallOnlyDeployments,
37
38
  getMultiSendDeployments,
38
39
  getProxyFactoryDeployments,
@@ -45,8 +46,22 @@ import {
45
46
  getSafeWebAuthnSignerFactoryDeployment,
46
47
  getSafeWebAuthnShareSignerDeployment
47
48
  } from "@safe-global/safe-modules-deployments";
48
- var DEFAULT_SAFE_VERSION = "1.3.0";
49
+ var DEFAULT_SAFE_VERSION = "1.4.1";
49
50
  var safeDeploymentsVersions = {
51
+ "1.5.0": {
52
+ safeSingletonVersion: "1.5.0",
53
+ safeSingletonL2Version: "1.5.0",
54
+ safeProxyFactoryVersion: "1.5.0",
55
+ compatibilityFallbackHandler: "1.5.0",
56
+ extensibleFallbackHandler: "1.5.0",
57
+ multiSendVersion: "1.5.0",
58
+ multiSendCallOnlyVersion: "1.5.0",
59
+ signMessageLibVersion: "1.5.0",
60
+ createCallVersion: "1.5.0",
61
+ simulateTxAccessorVersion: "1.5.0",
62
+ safeWebAuthnSignerFactoryVersion: "0.2.1",
63
+ safeWebAuthnSharedSignerVersion: "0.2.1"
64
+ },
50
65
  "1.4.1": {
51
66
  safeSingletonVersion: "1.4.1",
52
67
  safeSingletonL2Version: "1.4.1",
@@ -119,6 +134,7 @@ var contractFunctions = {
119
134
  safeSingletonL2Version: getSafeL2SingletonDeployments,
120
135
  safeProxyFactoryVersion: getProxyFactoryDeployments,
121
136
  compatibilityFallbackHandler: getCompatibilityFallbackHandlerDeployments,
137
+ extensibleFallbackHandler: getExtensibleFallbackHandlerDeployments,
122
138
  multiSendVersion: getMultiSendDeployments,
123
139
  multiSendCallOnlyVersion: getMultiSendCallOnlyDeployments,
124
140
  signMessageLibVersion: getSignMessageLibDeployments,
@@ -268,7 +284,7 @@ var networks = [
268
284
  { chainId: 255n, shortName: "kroma" },
269
285
  { chainId: 274n, shortName: "lachain" },
270
286
  { chainId: 280n, shortName: "zksync-goerli" },
271
- { chainId: 282n, shortName: "zkTCRO" },
287
+ { chainId: 282n, shortName: "deprecated-zkTCRO" },
272
288
  { chainId: 288n, shortName: "boba" },
273
289
  { chainId: 291n, shortName: "orderly" },
274
290
  { chainId: 295n, shortName: "hedera-mainnet" },
@@ -301,6 +317,8 @@ var networks = [
301
317
  { chainId: 690n, shortName: "redstone" },
302
318
  { chainId: 698n, shortName: "Matchain" },
303
319
  { chainId: 747n, shortName: "flow-mainnet" },
320
+ { chainId: 756n, shortName: "capx-testnet" },
321
+ { chainId: 757n, shortName: "capx" },
304
322
  { chainId: 787n, shortName: "aca" },
305
323
  { chainId: 841n, shortName: "tara" },
306
324
  { chainId: 842n, shortName: "taratest" },
@@ -346,6 +364,7 @@ var networks = [
346
364
  { chainId: 1559n, shortName: "tenet" },
347
365
  { chainId: 1625n, shortName: "gravity" },
348
366
  { chainId: 1663n, shortName: "Gobi" },
367
+ { chainId: 1672n, shortName: "pharos" },
349
368
  { chainId: 1729n, shortName: "reya" },
350
369
  { chainId: 1740n, shortName: "metall2-testnet" },
351
370
  { chainId: 1750n, shortName: "metall2" },
@@ -383,9 +402,12 @@ var networks = [
383
402
  { chainId: 2442n, shortName: "zkevm-testnet-cardona" },
384
403
  { chainId: 2522n, shortName: "fraxtal-testnet" },
385
404
  { chainId: 2741n, shortName: "abstract" },
405
+ { chainId: 2787n, shortName: "creator-chain-mainnet" },
386
406
  { chainId: 2810n, shortName: "hmorph" },
387
407
  { chainId: 2818n, shortName: "morph" },
408
+ { chainId: 2910n, shortName: "morph-hoodi-testnet" },
388
409
  { chainId: 3068n, shortName: "bfc" },
410
+ { chainId: 3111n, shortName: "alpha" },
389
411
  { chainId: 3338n, shortName: "PEAQ" },
390
412
  { chainId: 3501n, shortName: "JFIN" },
391
413
  { chainId: 3636n, shortName: "BTNXt" },
@@ -404,6 +426,7 @@ var networks = [
404
426
  { chainId: 4337n, shortName: "beam" },
405
427
  { chainId: 4460n, shortName: "orderlyl2" },
406
428
  { chainId: 4488n, shortName: "HYDRA" },
429
+ { chainId: 4509n, shortName: "SC" },
407
430
  { chainId: 4653n, shortName: "gold" },
408
431
  { chainId: 4661n, shortName: "appchaintestnet" },
409
432
  { chainId: 4689n, shortName: "iotex-mainnet" },
@@ -439,13 +462,17 @@ var networks = [
439
462
  { chainId: 7070n, shortName: "planq" },
440
463
  { chainId: 7171n, shortName: "bitrock" },
441
464
  { chainId: 7200n, shortName: "xsat" },
465
+ { chainId: 7208n, shortName: "nxra-mainnet" },
442
466
  { chainId: 7332n, shortName: "EON" },
467
+ { chainId: 7336n, shortName: "pruvtestnet" },
468
+ { chainId: 7337n, shortName: "pruvmainnet" },
443
469
  { chainId: 7341n, shortName: "shyft" },
444
470
  { chainId: 7560n, shortName: "cyeth" },
445
471
  { chainId: 7700n, shortName: "canto" },
446
472
  { chainId: 7771n, shortName: "tbitrock" },
447
473
  { chainId: 7897n, shortName: "arena-z" },
448
474
  { chainId: 8008n, shortName: "polynomial" },
475
+ { chainId: 8150n, shortName: "alpen" },
449
476
  { chainId: 8192n, shortName: "tqf" },
450
477
  { chainId: 8194n, shortName: "ttqf" },
451
478
  { chainId: 8217n, shortName: "kaia-mainnet" },
@@ -454,6 +481,7 @@ var networks = [
454
481
  { chainId: 8408n, shortName: "zentest" },
455
482
  { chainId: 8453n, shortName: "base" },
456
483
  { chainId: 8700n, shortName: "ACN" },
484
+ { chainId: 8765n, shortName: "ward" },
457
485
  { chainId: 8801n, shortName: "okto-testnet" },
458
486
  { chainId: 8822n, shortName: "iotaevm" },
459
487
  { chainId: 8844n, shortName: "THYDRA" },
@@ -479,6 +507,7 @@ var networks = [
479
507
  { chainId: 11111n, shortName: "WAGMI" },
480
508
  { chainId: 11124n, shortName: "abstract-sepolia" },
481
509
  { chainId: 11235n, shortName: "islm" },
510
+ { chainId: 11417n, shortName: "anq-testnet" },
482
511
  { chainId: 11437n, shortName: "shyftt" },
483
512
  { chainId: 11501n, shortName: "bevm" },
484
513
  { chainId: 11503n, shortName: "bevm-test" },
@@ -490,6 +519,7 @@ var networks = [
490
519
  { chainId: 12553n, shortName: "rss3" },
491
520
  { chainId: 13337n, shortName: "beam-testnet" },
492
521
  { chainId: 13371n, shortName: "imx" },
522
+ { chainId: 13441n, shortName: "bridgeless" },
493
523
  { chainId: 13473n, shortName: "imx-testnet" },
494
524
  { chainId: 13505n, shortName: "gravitysep" },
495
525
  { chainId: 13746n, shortName: "g7t" },
@@ -512,6 +542,7 @@ var networks = [
512
542
  { chainId: 28802n, shortName: "tcent" },
513
543
  { chainId: 28882n, shortName: "BobaSepolia" },
514
544
  { chainId: 28979n, shortName: "kimbonet-testnet" },
545
+ { chainId: 30303n, shortName: "Ethiq" },
515
546
  { chainId: 31611n, shortName: "mezo" },
516
547
  { chainId: 32323n, shortName: "basedai" },
517
548
  { chainId: 32380n, shortName: "paix" },
@@ -525,6 +556,7 @@ var networks = [
525
556
  { chainId: 35441n, shortName: "q" },
526
557
  { chainId: 35443n, shortName: "q-testnet" },
527
558
  { chainId: 36888n, shortName: "abcore" },
559
+ { chainId: 36900n, shortName: "adi" },
528
560
  { chainId: 37111n, shortName: "lens-sepolia" },
529
561
  { chainId: 41455n, shortName: "aleph-zero" },
530
562
  { chainId: 41923n, shortName: "edu-chain" },
@@ -532,6 +564,7 @@ var networks = [
532
564
  { chainId: 42170n, shortName: "arb-nova" },
533
565
  { chainId: 42220n, shortName: "celo" },
534
566
  { chainId: 42421n, shortName: "rwa" },
567
+ { chainId: 42431n, shortName: "tempo-moderato" },
535
568
  { chainId: 42793n, shortName: "etlk" },
536
569
  { chainId: 43111n, shortName: "hemi" },
537
570
  { chainId: 43113n, shortName: "fuji" },
@@ -549,6 +582,7 @@ var networks = [
549
582
  { chainId: 49321n, shortName: "Stork" },
550
583
  { chainId: 50104n, shortName: "sophon" },
551
584
  { chainId: 50312n, shortName: "SomniaTestnet" },
585
+ { chainId: 52924n, shortName: "lazai" },
552
586
  { chainId: 53302n, shortName: "seedsep" },
553
587
  { chainId: 53456n, shortName: "birdlayer" },
554
588
  { chainId: 53457n, shortName: "dodochain" },
@@ -583,6 +617,8 @@ var networks = [
583
617
  { chainId: 84532n, shortName: "basesep" },
584
618
  { chainId: 88811n, shortName: "unit0-mainnet" },
585
619
  { chainId: 88817n, shortName: "unit0-testnet" },
620
+ { chainId: 88882n, shortName: "chzspicy" },
621
+ { chainId: 88888n, shortName: "chiliz" },
586
622
  { chainId: 90001n, shortName: "dhobyghaut" },
587
623
  { chainId: 91342n, shortName: "giwasepolia" },
588
624
  { chainId: 97435n, shortName: "sling" },
@@ -591,6 +627,7 @@ var networks = [
591
627
  { chainId: 98866n, shortName: "plume-mainnet" },
592
628
  { chainId: 98867n, shortName: "plume-testnet" },
593
629
  { chainId: 98985n, shortName: "superposition-testnet" },
630
+ { chainId: 102030n, shortName: "ctc" },
594
631
  { chainId: 103454n, shortName: "masatest" },
595
632
  { chainId: 105105n, shortName: "stratis" },
596
633
  { chainId: 111188n, shortName: "re-al" },
@@ -599,6 +636,7 @@ var networks = [
599
636
  { chainId: 167000n, shortName: "tko-mainnet" },
600
637
  { chainId: 167008n, shortName: "tko-katla" },
601
638
  { chainId: 167009n, shortName: "tko-hekla" },
639
+ { chainId: 167013n, shortName: "tko-hoodi" },
602
640
  { chainId: 175188n, shortName: "lpy" },
603
641
  { chainId: 181228n, shortName: "hpp-sepolia" },
604
642
  { chainId: 190415n, shortName: "hpp-mainnet" },
@@ -609,16 +647,19 @@ var networks = [
609
647
  { chainId: 205205n, shortName: "auroria" },
610
648
  { chainId: 210425n, shortName: "platon" },
611
649
  { chainId: 222888n, shortName: "mocat" },
650
+ { chainId: 278701n, shortName: "creator-chain-testnet" },
612
651
  { chainId: 314159n, shortName: "filecoin-calibration" },
613
652
  { chainId: 325000n, shortName: "CampV2" },
614
653
  { chainId: 328527n, shortName: "nal" },
615
654
  { chainId: 333999n, shortName: "olympus" },
655
+ { chainId: 369369n, shortName: "den-mainnet" },
616
656
  { chainId: 381931n, shortName: "metal" },
617
657
  { chainId: 421611n, shortName: "arb-rinkeby" },
618
658
  { chainId: 421613n, shortName: "arb-goerli" },
619
659
  { chainId: 421614n, shortName: "arb-sep" },
620
660
  { chainId: 444444n, shortName: "syndr" },
621
661
  { chainId: 490000n, shortName: "ATN" },
662
+ { chainId: 511111n, shortName: "alpha-testnet" },
622
663
  { chainId: 534351n, shortName: "scr-sepolia" },
623
664
  { chainId: 534352n, shortName: "scr" },
624
665
  { chainId: 534353n, shortName: "scr-alpha" },
@@ -642,6 +683,7 @@ var networks = [
642
683
  { chainId: 808813n, shortName: "bob-sepolia" },
643
684
  { chainId: 810180n, shortName: "zklink-nova" },
644
685
  { chainId: 839999n, shortName: "txsat" },
686
+ { chainId: 853211n, shortName: "haqq-testethiq" },
645
687
  { chainId: 978657n, shortName: "treasure-ruby" },
646
688
  { chainId: 984122n, shortName: "forma" },
647
689
  { chainId: 1000101n, shortName: "xo" },
@@ -652,8 +694,10 @@ var networks = [
652
694
  { chainId: 2632500n, shortName: "coti" },
653
695
  { chainId: 3441006n, shortName: "mantaSepoliaTestnet" },
654
696
  { chainId: 4457845n, shortName: "zero-sepolia" },
697
+ { chainId: 5042002n, shortName: "arc-testnet" },
655
698
  { chainId: 5064014n, shortName: "ethereal" },
656
699
  { chainId: 6038361n, shortName: "azkyt" },
700
+ { chainId: 6281971n, shortName: "dogeos-chykyu" },
657
701
  { chainId: 6985385n, shortName: "hp" },
658
702
  { chainId: 7225878n, shortName: "saakuru" },
659
703
  { chainId: 7777777n, shortName: "zora" },
@@ -665,6 +709,7 @@ var networks = [
665
709
  { chainId: 12227332n, shortName: "neox-t4" },
666
710
  { chainId: 13374202n, shortName: "ethereal-testnet-0" },
667
711
  { chainId: 13863860n, shortName: "sis" },
712
+ { chainId: 20250407n, shortName: "platondev3" },
668
713
  { chainId: 21000000n, shortName: "corn" },
669
714
  { chainId: 52164803n, shortName: "fluence-testnet" },
670
715
  { chainId: 65100004n, shortName: "piccadilly-04" },
@@ -696,8 +741,10 @@ var networks = [
696
741
  { chainId: 1666700000n, shortName: "hmy-b-s0" },
697
742
  { chainId: 1952959480n, shortName: "lumiatestnet" },
698
743
  { chainId: 2030232745n, shortName: "lumia-beam-testnet" },
744
+ { chainId: 3735928814n, shortName: "edent" },
699
745
  { chainId: 11297108099n, shortName: "tpalm" },
700
746
  { chainId: 11297108109n, shortName: "palm" },
747
+ { chainId: 30143370385n, shortName: "BUB" },
701
748
  { chainId: 37714555429n, shortName: "xaitestnet" },
702
749
  { chainId: 88153591557n, shortName: "arb-blueberry" },
703
750
  { chainId: 123420000220n, shortName: "fluence-stage" },
@@ -1046,7 +1093,8 @@ var SAFE_FEATURES_BY_VERSION = {
1046
1093
  ["REQUIRED_TXGAS" /* REQUIRED_TXGAS */]: "<=1.2.0",
1047
1094
  ["SIMULATE_AND_REVERT" /* SIMULATE_AND_REVERT */]: ">=1.3.0",
1048
1095
  ["PASSKEY_SIGNER" /* PASSKEY_SIGNER */]: ">=1.3.0",
1049
- ["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0"
1096
+ ["SAFE_L2_CONTRACTS" /* SAFE_L2_CONTRACTS */]: ">=1.3.0",
1097
+ ["SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */]: ">=1.5.0"
1050
1098
  };
1051
1099
  var hasSafeFeature = (feature, version) => {
1052
1100
  if (!(feature in SAFE_FEATURES_BY_VERSION)) {
@@ -1511,6 +1559,58 @@ var CreateCallContract_v1_4_1 = class extends CreateCallBaseContract_default {
1511
1559
  };
1512
1560
  var CreateCallContract_v1_4_1_default = CreateCallContract_v1_4_1;
1513
1561
 
1562
+ // src/contracts/CreateCall/v1.5.0/CreateCallContract_v1_5_0.ts
1563
+ import {
1564
+ createCall_1_5_0_ContractArtifacts
1565
+ } from "@safe-global/types-kit";
1566
+ var CreateCallContract_v1_5_0 = class extends CreateCallBaseContract_default {
1567
+ /**
1568
+ * Constructs an instance of CreateCallContract_v1_5_0
1569
+ *
1570
+ * @param chainId - The chain ID where the contract resides.
1571
+ * @param safeProvider - An instance of SafeProvider.
1572
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CreateCall deployments based on the chainId and safeVersion.
1573
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
1574
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
1575
+ */
1576
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
1577
+ const safeVersion = "1.5.0";
1578
+ const defaultAbi = createCall_1_5_0_ContractArtifacts.abi;
1579
+ super(
1580
+ chainId,
1581
+ safeProvider,
1582
+ defaultAbi,
1583
+ safeVersion,
1584
+ customContractAddress,
1585
+ customContractAbi,
1586
+ deploymentType
1587
+ );
1588
+ /**
1589
+ * @param args - Array[value, deploymentData]
1590
+ * @param options - TransactionOptions
1591
+ * @returns Promise<TransactionResult>
1592
+ */
1593
+ this.performCreate = async (args, options) => {
1594
+ if (options && !options.gasLimit) {
1595
+ options.gasLimit = (await this.estimateGas("performCreate", args, options)).toString();
1596
+ }
1597
+ return toTxResult(this.runner, await this.write("performCreate", args, options), options);
1598
+ };
1599
+ /**
1600
+ * @param args - Array[value, deploymentData, salt]
1601
+ * @param options - TransactionOptions
1602
+ * @returns Promise<TransactionResult>
1603
+ */
1604
+ this.performCreate2 = async (args, options) => {
1605
+ if (options && !options.gasLimit) {
1606
+ options.gasLimit = (await this.estimateGas("performCreate2", [...args], { ...options })).toString();
1607
+ }
1608
+ return toTxResult(this.runner, await this.write("performCreate2", args, options), options);
1609
+ };
1610
+ }
1611
+ };
1612
+ var CreateCallContract_v1_5_0_default = CreateCallContract_v1_5_0;
1613
+
1514
1614
  // src/contracts/MultiSend/MultiSendBaseContract.ts
1515
1615
  var MultiSendBaseContract = class extends BaseContract_default {
1516
1616
  /**
@@ -1632,6 +1732,36 @@ var MultiSendContract_v1_4_1 = class extends MultiSendBaseContract_default {
1632
1732
  };
1633
1733
  var MultiSendContract_v1_4_1_default = MultiSendContract_v1_4_1;
1634
1734
 
1735
+ // src/contracts/MultiSend/v1.5.0/MultiSendContract_v1_5_0.ts
1736
+ import {
1737
+ multisend_1_5_0_ContractArtifacts
1738
+ } from "@safe-global/types-kit";
1739
+ var MultiSendContract_v1_5_0 = class extends MultiSendBaseContract_default {
1740
+ /**
1741
+ * Constructs an instance of MultiSendContract_v1_5_0
1742
+ *
1743
+ * @param chainId - The chain ID where the contract resides.
1744
+ * @param safeProvider - An instance of SafeProvider.
1745
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the MultiSend deployments based on the chainId and safeVersion.
1746
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
1747
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
1748
+ */
1749
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
1750
+ const safeVersion = "1.5.0";
1751
+ const defaultAbi = multisend_1_5_0_ContractArtifacts.abi;
1752
+ super(
1753
+ chainId,
1754
+ safeProvider,
1755
+ defaultAbi,
1756
+ safeVersion,
1757
+ customContractAddress,
1758
+ customContractAbi,
1759
+ deploymentType
1760
+ );
1761
+ }
1762
+ };
1763
+ var MultiSendContract_v1_5_0_default = MultiSendContract_v1_5_0;
1764
+
1635
1765
  // src/contracts/MultiSend/MultiSendCallOnlyBaseContract.ts
1636
1766
  var MultiSendCallOnlyBaseContract = class extends BaseContract_default {
1637
1767
  /**
@@ -1723,6 +1853,36 @@ var MultiSendCallOnlyContract_v1_4_1 = class extends MultiSendCallOnlyBaseContra
1723
1853
  };
1724
1854
  var MultiSendCallOnlyContract_v1_4_1_default = MultiSendCallOnlyContract_v1_4_1;
1725
1855
 
1856
+ // src/contracts/MultiSend/v1.5.0/MultiSendCallOnlyContract_v1_5_0.ts
1857
+ import {
1858
+ multiSendCallOnly_1_5_0_ContractArtifacts
1859
+ } from "@safe-global/types-kit";
1860
+ var MultiSendCallOnlyContract_v1_5_0 = class extends MultiSendCallOnlyBaseContract_default {
1861
+ /**
1862
+ * Constructs an instance of MultiSendCallOnlyContract_v1_5_0
1863
+ *
1864
+ * @param chainId - The chain ID where the contract resides.
1865
+ * @param safeProvider - An instance of SafeProvider.
1866
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the MultiSendCallOnly deployments based on the chainId and safeVersion.
1867
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
1868
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
1869
+ */
1870
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
1871
+ const safeVersion = "1.5.0";
1872
+ const defaultAbi = multiSendCallOnly_1_5_0_ContractArtifacts.abi;
1873
+ super(
1874
+ chainId,
1875
+ safeProvider,
1876
+ defaultAbi,
1877
+ safeVersion,
1878
+ customContractAddress,
1879
+ customContractAbi,
1880
+ deploymentType
1881
+ );
1882
+ }
1883
+ };
1884
+ var MultiSendCallOnlyContract_v1_5_0_default = MultiSendCallOnlyContract_v1_5_0;
1885
+
1726
1886
  // src/contracts/SignMessageLib/SignMessageLibBaseContract.ts
1727
1887
  var SignMessageLibBaseContract = class extends BaseContract_default {
1728
1888
  /**
@@ -1844,6 +2004,51 @@ var SignMessageLibContract_v1_4_1 = class extends SignMessageLibBaseContract_def
1844
2004
  };
1845
2005
  var SignMessageLibContract_v1_4_1_default = SignMessageLibContract_v1_4_1;
1846
2006
 
2007
+ // src/contracts/SignMessageLib/v1.5.0/SignMessageLibContract_v1_5_0.ts
2008
+ import {
2009
+ signMessageLib_1_5_0_ContractArtifacts
2010
+ } from "@safe-global/types-kit";
2011
+ var SignMessageLibContract_v1_5_0 = class extends SignMessageLibBaseContract_default {
2012
+ /**
2013
+ * Constructs an instance of SignMessageLibContract_v1_5_0
2014
+ *
2015
+ * @param chainId - The chain ID where the contract resides.
2016
+ * @param safeProvider - An instance of SafeProvider.
2017
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the SignMessageLib deployments based on the chainId and safeVersion.
2018
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
2019
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
2020
+ */
2021
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
2022
+ const safeVersion = "1.5.0";
2023
+ const defaultAbi = signMessageLib_1_5_0_ContractArtifacts.abi;
2024
+ super(
2025
+ chainId,
2026
+ safeProvider,
2027
+ defaultAbi,
2028
+ safeVersion,
2029
+ customContractAddress,
2030
+ customContractAbi,
2031
+ deploymentType
2032
+ );
2033
+ /**
2034
+ * @param args - Array[message]
2035
+ */
2036
+ this.getMessageHash = async (args) => {
2037
+ return [await this.read("getMessageHash", args)];
2038
+ };
2039
+ /**
2040
+ * @param args - Array[data]
2041
+ */
2042
+ this.signMessage = async (data, options) => {
2043
+ if (options && !options.gasLimit) {
2044
+ options.gasLimit = Number(await this.estimateGas("signMessage", data, { ...options }));
2045
+ }
2046
+ return toTxResult(this.runner, await this.write("signMessage", data, options), options);
2047
+ };
2048
+ }
2049
+ };
2050
+ var SignMessageLibContract_v1_5_0_default = SignMessageLibContract_v1_5_0;
2051
+
1847
2052
  // src/contracts/Safe/v1.0.0/SafeContract_v1_0_0.ts
1848
2053
  import { simulateContract } from "viem/actions";
1849
2054
 
@@ -3049,7 +3254,7 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
3049
3254
  return [await this.read("getOwners")];
3050
3255
  };
3051
3256
  /**
3052
- * Reads `length` bytes of storage in the currents contract
3257
+ * Reads `length` bytes of storage in the current contract
3053
3258
  * @param args - Array[offset, length]
3054
3259
  * @returns Array[storage]
3055
3260
  */
@@ -3232,135 +3437,459 @@ var SafeContract_v1_4_1 = class extends SafeBaseContract_default {
3232
3437
  };
3233
3438
  var SafeContract_v1_4_1_default = SafeContract_v1_4_1;
3234
3439
 
3235
- // src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts
3236
- var SafeProxyFactoryBaseContract = class extends BaseContract_default {
3237
- /**
3238
- * @constructor
3239
- * Constructs an instance of SafeProxyFactoryBaseContract.
3240
- *
3241
- * @param chainId - The chain ID of the contract.
3242
- * @param safeProvider - An instance of SafeProvider.
3243
- * @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
3244
- * @param safeVersion - The version of the Safe contract.
3245
- * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3246
- * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
3247
- * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3248
- */
3249
- constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
3250
- const contractName3 = "safeProxyFactoryVersion";
3251
- super(
3252
- contractName3,
3253
- chainId,
3254
- safeProvider,
3255
- defaultAbi,
3256
- safeVersion,
3257
- customContractAddress,
3258
- customContractAbi,
3259
- deploymentType
3260
- );
3261
- this.contractName = contractName3;
3262
- }
3263
- };
3264
- var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
3265
-
3266
- // src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
3440
+ // src/contracts/Safe/v1.5.0/SafeContract_v1_5_0.ts
3441
+ import { readContract, simulateContract as simulateContract6 } from "viem/actions";
3267
3442
  import {
3268
- safeProxyFactory_1_0_0_ContractArtifacts
3443
+ safe_1_5_0_ContractArtifacts
3269
3444
  } from "@safe-global/types-kit";
3270
- var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
3445
+ var SafeContract_v1_5_0 = class extends SafeBaseContract_default {
3271
3446
  /**
3272
- * Constructs an instance of SafeProxyFactoryContract_v1_0_0
3447
+ * Constructs an instance of SafeContract_v1_5_0
3273
3448
  *
3274
3449
  * @param chainId - The chain ID where the contract resides.
3275
3450
  * @param safeProvider - An instance of SafeProvider.
3451
+ * @param isL1SafeSingleton - A flag indicating if the contract is a L1 Safe Singleton.
3276
3452
  * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3277
- * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
3453
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
3278
3454
  * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3279
3455
  */
3280
- constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
3281
- const safeVersion = "1.0.0";
3282
- const defaultAbi = safeProxyFactory_1_0_0_ContractArtifacts.abi;
3456
+ constructor(chainId, safeProvider, isL1SafeSingleton, customContractAddress, customContractAbi, deploymentType) {
3457
+ const safeVersion = "1.5.0";
3458
+ const defaultAbi = safe_1_5_0_ContractArtifacts.abi;
3283
3459
  super(
3284
3460
  chainId,
3285
3461
  safeProvider,
3286
3462
  defaultAbi,
3287
3463
  safeVersion,
3464
+ isL1SafeSingleton,
3288
3465
  customContractAddress,
3289
3466
  customContractAbi,
3290
3467
  deploymentType
3291
3468
  );
3292
3469
  /**
3293
- * Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
3294
- * @returns Array[creationCode]
3470
+ * @returns Array[safeContractVersion]
3295
3471
  */
3296
- this.proxyCreationCode = async () => {
3297
- return [await this.read("proxyCreationCode")];
3472
+ this.VERSION = async () => {
3473
+ return [await this.read("VERSION")];
3298
3474
  };
3299
3475
  /**
3300
- * Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
3301
- * @returns Array[runtimeCode]
3476
+ * @param args - Array[owner, txHash]
3477
+ * @returns Array[approvedHashes]
3302
3478
  */
3303
- this.proxyRuntimeCode = async () => {
3304
- return [await this.read("proxyRuntimeCode")];
3479
+ this.approvedHashes = async (args) => {
3480
+ return [await this.read("approvedHashes", args)];
3305
3481
  };
3306
3482
  /**
3307
- * Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
3308
- * @param args - Array[masterCopy, data]
3309
- * @returns Array[proxyAddress]
3483
+ * Checks whether the signature provided is valid for the provided data, hash and number of required signatures.
3484
+ * Will revert otherwise.
3485
+ * @param args - Array[dataHash, data, signatures, requiredSignatures]
3486
+ * @returns Empty array
3310
3487
  */
3311
- this.createProxy = async (args) => {
3312
- return [await this.write("createProxy", args)];
3488
+ this.checkNSignatures = async (args) => {
3489
+ await this.read("checkNSignatures", args);
3490
+ return [];
3313
3491
  };
3314
3492
  /**
3315
- * Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
3316
- * @param args - Array[masterCopy, initializer, saltNonce]
3317
- * @returns Array[proxyAddress]
3493
+ * New in v1.5.0: overload of checkNSignatures that accepts an explicit executor address.
3494
+ * Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
3495
+ * Will revert otherwise.
3496
+ * @param args - Array[executor, dataHash, signatures, requiredSignatures]
3497
+ * @returns Empty array
3318
3498
  */
3319
- this.createProxyWithNonce = async (args) => {
3320
- return [await this.write("createProxyWithNonce", args)];
3499
+ this.checkNSignaturesWithExecutor = async (args) => {
3500
+ await readContract(this.runner, {
3501
+ address: this.contractAddress,
3502
+ functionName: "checkNSignatures",
3503
+ abi: [
3504
+ {
3505
+ inputs: [
3506
+ { internalType: "address", name: "executor", type: "address" },
3507
+ { internalType: "bytes32", name: "dataHash", type: "bytes32" },
3508
+ { internalType: "bytes", name: "signatures", type: "bytes" },
3509
+ { internalType: "uint256", name: "requiredSignatures", type: "uint256" }
3510
+ ],
3511
+ name: "checkNSignatures",
3512
+ outputs: [],
3513
+ stateMutability: "view",
3514
+ type: "function"
3515
+ }
3516
+ ],
3517
+ args
3518
+ });
3519
+ return [];
3321
3520
  };
3322
- }
3323
- };
3324
- var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
3325
-
3326
- // src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
3327
- import {
3328
- safeProxyFactory_1_1_1_ContractArtifacts
3329
- } from "@safe-global/types-kit";
3330
- var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
3331
- /**
3332
- * Constructs an instance of SafeProxyFactoryContract_v1_1_1
3333
- *
3334
- * @param chainId - The chain ID where the contract resides.
3335
- * @param safeProvider - An instance of SafeProvider.
3336
- * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3337
- * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
3338
- * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3339
- */
3340
- constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
3341
- const safeVersion = "1.1.1";
3342
- const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
3343
- super(
3344
- chainId,
3345
- safeProvider,
3346
- defaultAbi,
3347
- safeVersion,
3348
- customContractAddress,
3349
- customContractAbi,
3350
- deploymentType
3351
- );
3352
3521
  /**
3353
- * Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
3354
- * @returns Array[creationCode]
3522
+ * Checks whether the signature provided is valid for the provided data and hash. Will revert otherwise.
3523
+ * @param args - Array[dataHash, data, signatures]
3524
+ * @returns Empty array
3355
3525
  */
3356
- this.proxyCreationCode = async () => {
3357
- return [await this.read("proxyCreationCode")];
3526
+ this.checkSignatures = async (args) => {
3527
+ await this.read("checkSignatures", args);
3528
+ return [];
3358
3529
  };
3359
3530
  /**
3360
- * Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
3361
- * @returns Array[runtimeCode]
3531
+ * New in v1.5.0: overload of checkSignatures that accepts an explicit executor address.
3532
+ * Allows modules to pass msg.sender explicitly rather than relying on the contract's own context.
3533
+ * Will revert otherwise.
3534
+ * @param args - Array[executor, dataHash, signatures]
3535
+ * @returns Empty array
3362
3536
  */
3363
- this.proxyRuntimeCode = async () => {
3537
+ this.checkSignaturesWithExecutor = async (args) => {
3538
+ await readContract(this.runner, {
3539
+ address: this.contractAddress,
3540
+ functionName: "checkSignatures",
3541
+ abi: [
3542
+ {
3543
+ inputs: [
3544
+ { internalType: "address", name: "executor", type: "address" },
3545
+ { internalType: "bytes32", name: "dataHash", type: "bytes32" },
3546
+ { internalType: "bytes", name: "signatures", type: "bytes" }
3547
+ ],
3548
+ name: "checkSignatures",
3549
+ outputs: [],
3550
+ stateMutability: "view",
3551
+ type: "function"
3552
+ }
3553
+ ],
3554
+ args
3555
+ });
3556
+ return [];
3557
+ };
3558
+ /**
3559
+ * @returns Array[domainSeparator]
3560
+ */
3561
+ this.domainSeparator = async () => {
3562
+ return [await this.read("domainSeparator")];
3563
+ };
3564
+ /**
3565
+ * Returns array of modules.
3566
+ * @param args - Array[start, pageSize]
3567
+ * @returns Array[Array[modules], next]
3568
+ */
3569
+ this.getModulesPaginated = async (args) => {
3570
+ const [array, next] = await this.read("getModulesPaginated", args);
3571
+ return [array, next];
3572
+ };
3573
+ /**
3574
+ * Returns the list of Safe owner accounts.
3575
+ * @returns Array[Array[owners]]
3576
+ */
3577
+ this.getOwners = async () => {
3578
+ return [await this.read("getOwners")];
3579
+ };
3580
+ /**
3581
+ * Reads `length` bytes of storage in the current contract
3582
+ * @param args - Array[offset, length]
3583
+ * @returns Array[storage]
3584
+ */
3585
+ this.getStorageAt = async (args) => {
3586
+ return [await this.read("getStorageAt", args)];
3587
+ };
3588
+ /**
3589
+ * Returns the Safe threshold.
3590
+ * @returns Array[threshold]
3591
+ */
3592
+ this.getThreshold = async () => {
3593
+ return [await this.read("getThreshold")];
3594
+ };
3595
+ /**
3596
+ * Returns hash to be signed by owners.
3597
+ * @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, _nonce]
3598
+ * @returns Array[transactionHash]
3599
+ */
3600
+ this.getTransactionHash = async (args) => {
3601
+ return [await this.read("getTransactionHash", args)];
3602
+ };
3603
+ /**
3604
+ * Checks if a specific Safe module is enabled for the current Safe.
3605
+ * @param args - Array[moduleAddress]
3606
+ * @returns Array[isEnabled]
3607
+ */
3608
+ this.isModuleEnabled = async (args) => {
3609
+ return [await this.read("isModuleEnabled", args)];
3610
+ };
3611
+ /**
3612
+ * Checks if a specific address is an owner of the current Safe.
3613
+ * @param args - Array[address]
3614
+ * @returns Array[isOwner]
3615
+ */
3616
+ this.isOwner = async (args) => {
3617
+ return [await this.read("isOwner", args)];
3618
+ };
3619
+ /**
3620
+ * Returns the Safe nonce.
3621
+ * @returns Array[nonce]
3622
+ */
3623
+ this.nonce = async () => {
3624
+ return [await this.read("nonce")];
3625
+ };
3626
+ /**
3627
+ * @param args - Array[messageHash]
3628
+ * @returns Array[signedMessages]
3629
+ */
3630
+ this.signedMessages = async (args) => {
3631
+ return [await this.read("signedMessages", args)];
3632
+ };
3633
+ }
3634
+ /**
3635
+ * Checks whether a given Safe transaction can be executed successfully with no errors.
3636
+ * @param safeTransaction - The Safe transaction to check.
3637
+ * @param options - Optional transaction options.
3638
+ * @returns True, if the given transactions is valid.
3639
+ */
3640
+ async isValidTransaction(safeTransaction, options = {}) {
3641
+ try {
3642
+ const gasLimit = options?.gasLimit || await this.estimateGas(
3643
+ "execTransaction",
3644
+ [
3645
+ safeTransaction.data.to,
3646
+ BigInt(safeTransaction.data.value),
3647
+ asHex(safeTransaction.data.data),
3648
+ safeTransaction.data.operation,
3649
+ BigInt(safeTransaction.data.safeTxGas),
3650
+ BigInt(safeTransaction.data.baseGas),
3651
+ BigInt(safeTransaction.data.gasPrice),
3652
+ safeTransaction.data.gasToken,
3653
+ safeTransaction.data.refundReceiver,
3654
+ asHex(safeTransaction.encodedSignatures())
3655
+ ],
3656
+ options
3657
+ );
3658
+ const converted = this.convertOptions({ ...options, gasLimit });
3659
+ const txResult = await simulateContract6(this.runner, {
3660
+ address: this.contractAddress,
3661
+ functionName: "execTransaction",
3662
+ abi: this.contractAbi,
3663
+ args: [
3664
+ safeTransaction.data.to,
3665
+ BigInt(safeTransaction.data.value),
3666
+ asHex(safeTransaction.data.data),
3667
+ safeTransaction.data.operation,
3668
+ BigInt(safeTransaction.data.safeTxGas),
3669
+ BigInt(safeTransaction.data.baseGas),
3670
+ BigInt(safeTransaction.data.gasPrice),
3671
+ safeTransaction.data.gasToken,
3672
+ safeTransaction.data.refundReceiver,
3673
+ asHex(safeTransaction.encodedSignatures())
3674
+ ],
3675
+ ...converted
3676
+ });
3677
+ return txResult.result;
3678
+ } catch (error) {
3679
+ return false;
3680
+ }
3681
+ }
3682
+ /**
3683
+ * Executes a transaction.
3684
+ * @param safeTransaction - The Safe transaction to execute.
3685
+ * @param options - Transaction options.
3686
+ * @returns Transaction result.
3687
+ */
3688
+ async execTransaction(safeTransaction, options) {
3689
+ const gasLimit = options?.gasLimit || await this.estimateGas(
3690
+ "execTransaction",
3691
+ [
3692
+ safeTransaction.data.to,
3693
+ BigInt(safeTransaction.data.value),
3694
+ asHex(safeTransaction.data.data),
3695
+ safeTransaction.data.operation,
3696
+ BigInt(safeTransaction.data.safeTxGas),
3697
+ BigInt(safeTransaction.data.baseGas),
3698
+ BigInt(safeTransaction.data.gasPrice),
3699
+ safeTransaction.data.gasToken,
3700
+ safeTransaction.data.refundReceiver,
3701
+ asHex(safeTransaction.encodedSignatures())
3702
+ ],
3703
+ options
3704
+ );
3705
+ const args = [
3706
+ safeTransaction.data.to,
3707
+ BigInt(safeTransaction.data.value),
3708
+ asHex(safeTransaction.data.data),
3709
+ safeTransaction.data.operation,
3710
+ BigInt(safeTransaction.data.safeTxGas),
3711
+ BigInt(safeTransaction.data.baseGas),
3712
+ BigInt(safeTransaction.data.gasPrice),
3713
+ safeTransaction.data.gasToken,
3714
+ safeTransaction.data.refundReceiver,
3715
+ asHex(safeTransaction.encodedSignatures())
3716
+ ];
3717
+ return toTxResult(
3718
+ this.runner,
3719
+ await this.write("execTransaction", args, { ...options, gasLimit }),
3720
+ options
3721
+ );
3722
+ }
3723
+ /**
3724
+ * Returns array of first 10 modules.
3725
+ * @returns Array[modules]
3726
+ */
3727
+ async getModules() {
3728
+ const [modules] = await this.getModulesPaginated([SENTINEL_ADDRESS, BigInt(10)]);
3729
+ return [modules.map((module) => module)];
3730
+ }
3731
+ /**
3732
+ * Marks a hash as approved. This can be used to validate a hash that is used by a signature.
3733
+ * @param hash - The hash that should be marked as approved for signatures that are verified by this contract.
3734
+ * @param options - Optional transaction options.
3735
+ * @returns Transaction result.
3736
+ */
3737
+ async approveHash(hash, options) {
3738
+ const gasLimit = options?.gasLimit || await this.estimateGas("approveHash", [asHash(hash)], options);
3739
+ return toTxResult(
3740
+ this.runner,
3741
+ await this.write("approveHash", [asHash(hash)], { ...options, gasLimit }),
3742
+ options
3743
+ );
3744
+ }
3745
+ /**
3746
+ * Returns the chain id of the Safe contract. (Custom method - not defined in the Safe Contract)
3747
+ * @returns Array[chainId]
3748
+ */
3749
+ async getChainId() {
3750
+ return [await Promise.resolve(this.chainId)];
3751
+ }
3752
+ /**
3753
+ * returns the nonce of the Safe contract.
3754
+ *
3755
+ * @returns {Promise<bigint>} A promise that resolves to the nonce of the Safe contract.
3756
+ */
3757
+ async getNonce() {
3758
+ const [nonce] = await this.nonce();
3759
+ return nonce;
3760
+ }
3761
+ };
3762
+ var SafeContract_v1_5_0_default = SafeContract_v1_5_0;
3763
+
3764
+ // src/contracts/SafeProxyFactory/SafeProxyFactoryBaseContract.ts
3765
+ var SafeProxyFactoryBaseContract = class extends BaseContract_default {
3766
+ /**
3767
+ * @constructor
3768
+ * Constructs an instance of SafeProxyFactoryBaseContract.
3769
+ *
3770
+ * @param chainId - The chain ID of the contract.
3771
+ * @param safeProvider - An instance of SafeProvider.
3772
+ * @param defaultAbi - The default ABI for the Safe contract. It should be compatible with the specific version of the contract.
3773
+ * @param safeVersion - The version of the Safe contract.
3774
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3775
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
3776
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3777
+ */
3778
+ constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
3779
+ const contractName3 = "safeProxyFactoryVersion";
3780
+ super(
3781
+ contractName3,
3782
+ chainId,
3783
+ safeProvider,
3784
+ defaultAbi,
3785
+ safeVersion,
3786
+ customContractAddress,
3787
+ customContractAbi,
3788
+ deploymentType
3789
+ );
3790
+ this.contractName = contractName3;
3791
+ }
3792
+ };
3793
+ var SafeProxyFactoryBaseContract_default = SafeProxyFactoryBaseContract;
3794
+
3795
+ // src/contracts/SafeProxyFactory/v1.0.0/SafeProxyFactoryContract_v1_0_0.ts
3796
+ import {
3797
+ safeProxyFactory_1_0_0_ContractArtifacts
3798
+ } from "@safe-global/types-kit";
3799
+ var SafeProxyFactoryContract_v1_0_0 = class extends SafeProxyFactoryBaseContract_default {
3800
+ /**
3801
+ * Constructs an instance of SafeProxyFactoryContract_v1_0_0
3802
+ *
3803
+ * @param chainId - The chain ID where the contract resides.
3804
+ * @param safeProvider - An instance of SafeProvider.
3805
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3806
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.0.0 is used.
3807
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3808
+ */
3809
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
3810
+ const safeVersion = "1.0.0";
3811
+ const defaultAbi = safeProxyFactory_1_0_0_ContractArtifacts.abi;
3812
+ super(
3813
+ chainId,
3814
+ safeProvider,
3815
+ defaultAbi,
3816
+ safeVersion,
3817
+ customContractAddress,
3818
+ customContractAbi,
3819
+ deploymentType
3820
+ );
3821
+ /**
3822
+ * Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
3823
+ * @returns Array[creationCode]
3824
+ */
3825
+ this.proxyCreationCode = async () => {
3826
+ return [await this.read("proxyCreationCode")];
3827
+ };
3828
+ /**
3829
+ * Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
3830
+ * @returns Array[runtimeCode]
3831
+ */
3832
+ this.proxyRuntimeCode = async () => {
3833
+ return [await this.read("proxyRuntimeCode")];
3834
+ };
3835
+ /**
3836
+ * Allows to create new proxy contact and execute a message call to the new proxy within one transaction.
3837
+ * @param args - Array[masterCopy, data]
3838
+ * @returns Array[proxyAddress]
3839
+ */
3840
+ this.createProxy = async (args) => {
3841
+ return [await this.write("createProxy", args)];
3842
+ };
3843
+ /**
3844
+ * Allows to create new proxy contract and execute a message call to the new proxy within one transaction.
3845
+ * @param args - Array[masterCopy, initializer, saltNonce]
3846
+ * @returns Array[proxyAddress]
3847
+ */
3848
+ this.createProxyWithNonce = async (args) => {
3849
+ return [await this.write("createProxyWithNonce", args)];
3850
+ };
3851
+ }
3852
+ };
3853
+ var SafeProxyFactoryContract_v1_0_0_default = SafeProxyFactoryContract_v1_0_0;
3854
+
3855
+ // src/contracts/SafeProxyFactory/v1.1.1/SafeProxyFactoryContract_v1_1_1.ts
3856
+ import {
3857
+ safeProxyFactory_1_1_1_ContractArtifacts
3858
+ } from "@safe-global/types-kit";
3859
+ var SafeProxyFactoryContract_v1_1_1 = class extends SafeProxyFactoryBaseContract_default {
3860
+ /**
3861
+ * Constructs an instance of SafeProxyFactoryContract_v1_1_1
3862
+ *
3863
+ * @param chainId - The chain ID where the contract resides.
3864
+ * @param safeProvider - An instance of SafeProvider.
3865
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
3866
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.1.1 is used.
3867
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
3868
+ */
3869
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
3870
+ const safeVersion = "1.1.1";
3871
+ const defaultAbi = safeProxyFactory_1_1_1_ContractArtifacts.abi;
3872
+ super(
3873
+ chainId,
3874
+ safeProvider,
3875
+ defaultAbi,
3876
+ safeVersion,
3877
+ customContractAddress,
3878
+ customContractAbi,
3879
+ deploymentType
3880
+ );
3881
+ /**
3882
+ * Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
3883
+ * @returns Array[creationCode]
3884
+ */
3885
+ this.proxyCreationCode = async () => {
3886
+ return [await this.read("proxyCreationCode")];
3887
+ };
3888
+ /**
3889
+ * Allows to retrieve the runtime code of a deployed Proxy. This can be used to check that the expected Proxy was deployed.
3890
+ * @returns Array[runtimeCode]
3891
+ */
3892
+ this.proxyRuntimeCode = async () => {
3364
3893
  return [await this.read("proxyRuntimeCode")];
3365
3894
  };
3366
3895
  /**
@@ -3544,6 +4073,82 @@ var SafeProxyFactoryContract_v1_4_1 = class extends SafeProxyFactoryBaseContract
3544
4073
  };
3545
4074
  var SafeProxyFactoryContract_v1_4_1_default = SafeProxyFactoryContract_v1_4_1;
3546
4075
 
4076
+ // src/contracts/SafeProxyFactory/v1.5.0/SafeProxyFactoryContract_v1_5_0.ts
4077
+ import {
4078
+ safeProxyFactory_1_5_0_ContractArtifacts
4079
+ } from "@safe-global/types-kit";
4080
+ var SafeProxyFactoryContract_v1_5_0 = class extends SafeProxyFactoryBaseContract_default {
4081
+ /**
4082
+ * Constructs an instance of SafeProxyFactoryContract_v1_5_0
4083
+ *
4084
+ * @param chainId - The chain ID where the contract resides.
4085
+ * @param safeProvider - An instance of SafeProvider.
4086
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
4087
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
4088
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
4089
+ */
4090
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
4091
+ const safeVersion = "1.5.0";
4092
+ const defaultAbi = safeProxyFactory_1_5_0_ContractArtifacts.abi;
4093
+ super(
4094
+ chainId,
4095
+ safeProvider,
4096
+ defaultAbi,
4097
+ safeVersion,
4098
+ customContractAddress,
4099
+ customContractAbi,
4100
+ deploymentType
4101
+ );
4102
+ /**
4103
+ * Returns the ID of the chain the contract is currently deployed on.
4104
+ * @returns Array[chainId]
4105
+ */
4106
+ this.getChainId = async () => {
4107
+ return [await this.read("getChainId")];
4108
+ };
4109
+ /**
4110
+ * Allows to retrieve the creation code used for the Proxy deployment. With this it is easily possible to calculate predicted address.
4111
+ * @returns Array[creationCode]
4112
+ */
4113
+ this.proxyCreationCode = async () => {
4114
+ return [await this.read("proxyCreationCode")];
4115
+ };
4116
+ /**
4117
+ * Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
4118
+ * @param args - Array[singleton, initializer, saltNonce]
4119
+ * @returns Array[proxy]
4120
+ */
4121
+ this.createChainSpecificProxyWithNonce = async (args) => {
4122
+ return [await this.write("createChainSpecificProxyWithNonce", args)];
4123
+ };
4124
+ /**
4125
+ * Deploys a new chain-specific proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
4126
+ * @param args - Array[singleton, initializer, saltNonce]
4127
+ * @returns Array[proxy]
4128
+ */
4129
+ this.createChainSpecificProxyWithNonceL2 = async (args) => {
4130
+ return [await this.write("createChainSpecificProxyWithNonceL2", args)];
4131
+ };
4132
+ /**
4133
+ * Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
4134
+ * @param args - Array[singleton, initializer, saltNonce]
4135
+ * @returns Array[proxy]
4136
+ */
4137
+ this.createProxyWithNonce = async (args) => {
4138
+ return [await this.write("createProxyWithNonce", args)];
4139
+ };
4140
+ /**
4141
+ * Deploys a new proxy with singleton and salt. Optionally executes an initializer call to a new proxy.
4142
+ * @param args - Array[singleton, initializer, saltNonce]
4143
+ * @returns Array[proxy]
4144
+ */
4145
+ this.createProxyWithNonceL2 = async (args) => {
4146
+ return [await this.write("createProxyWithNonceL2", args)];
4147
+ };
4148
+ }
4149
+ };
4150
+ var SafeProxyFactoryContract_v1_5_0_default = SafeProxyFactoryContract_v1_5_0;
4151
+
3547
4152
  // src/contracts/SimulateTxAccessor/SimulateTxAccessorBaseContract.ts
3548
4153
  var SimulateTxAccessorBaseContract = class extends BaseContract_default {
3549
4154
  /**
@@ -3651,6 +4256,44 @@ var SimulateTxAccessorContract_v1_4_1 = class extends SimulateTxAccessorBaseCont
3651
4256
  };
3652
4257
  var SimulateTxAccessorContract_v1_4_1_default = SimulateTxAccessorContract_v1_4_1;
3653
4258
 
4259
+ // src/contracts/SimulateTxAccessor/v1.5.0/SimulateTxAccessorContract_v1_5_0.ts
4260
+ import {
4261
+ simulateTxAccessor_1_5_0_ContractArtifacts
4262
+ } from "@safe-global/types-kit";
4263
+ var SimulateTxAccessorContract_v1_5_0 = class extends SimulateTxAccessorBaseContract_default {
4264
+ /**
4265
+ * Constructs an instance of SimulateTxAccessorContract_v1_5_0
4266
+ *
4267
+ * @param chainId - The chain ID where the contract resides.
4268
+ * @param safeProvider - An instance of SafeProvider.
4269
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the SimulateTxAccessor deployments based on the chainId and safeVersion.
4270
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
4271
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
4272
+ */
4273
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
4274
+ const safeVersion = "1.5.0";
4275
+ const defaultAbi = simulateTxAccessor_1_5_0_ContractArtifacts.abi;
4276
+ super(
4277
+ chainId,
4278
+ safeProvider,
4279
+ defaultAbi,
4280
+ safeVersion,
4281
+ customContractAddress,
4282
+ customContractAbi,
4283
+ deploymentType
4284
+ );
4285
+ /**
4286
+ * @param args - Array[to, value, data, operation]
4287
+ * @returns Array[estimate, success, returnData]
4288
+ */
4289
+ this.simulate = async (args) => {
4290
+ const [estimate, success, returnData] = await this.write("simulate", args);
4291
+ return [BigInt(estimate), !!success, asHex(returnData)];
4292
+ };
4293
+ }
4294
+ };
4295
+ var SimulateTxAccessorContract_v1_5_0_default = SimulateTxAccessorContract_v1_5_0;
4296
+
3654
4297
  // src/contracts/CompatibilityFallbackHandler/CompatibilityFallbackHandlerBaseContract.ts
3655
4298
  var CompatibilityFallbackHandlerBaseContract = class extends BaseContract_default {
3656
4299
  /**
@@ -3740,7 +4383,228 @@ var CompatibilityFallbackHandlerContract_v1_4_1 = class extends CompatibilityFal
3740
4383
  );
3741
4384
  }
3742
4385
  };
3743
- var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
4386
+ var CompatibilityFallbackHandlerContract_v1_4_1_default = CompatibilityFallbackHandlerContract_v1_4_1;
4387
+
4388
+ // src/contracts/CompatibilityFallbackHandler/v1.5.0/CompatibilityFallbackHandlerContract_v1_5_0.ts
4389
+ import {
4390
+ compatibilityFallbackHandler_1_5_0_ContractArtifacts
4391
+ } from "@safe-global/types-kit";
4392
+ var CompatibilityFallbackHandlerContract_v1_5_0 = class extends CompatibilityFallbackHandlerBaseContract_default {
4393
+ /**
4394
+ * Constructs an instance of CompatibilityFallbackHandlerContract_v1_5_0
4395
+ *
4396
+ * @param chainId - The chain ID where the contract resides.
4397
+ * @param safeProvider - An instance of SafeProvider.
4398
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the CompatibilityFallbackHandler deployments based on the chainId and safeVersion.
4399
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
4400
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
4401
+ */
4402
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
4403
+ const safeVersion = "1.5.0";
4404
+ const defaultAbi = compatibilityFallbackHandler_1_5_0_ContractArtifacts.abi;
4405
+ super(
4406
+ chainId,
4407
+ safeProvider,
4408
+ defaultAbi,
4409
+ safeVersion,
4410
+ customContractAddress,
4411
+ customContractAbi,
4412
+ deploymentType
4413
+ );
4414
+ /**
4415
+ * New in v1.5.0: encodeTransactionData was moved from the Safe contract to CompatibilityFallbackHandler
4416
+ * to preserve backwards compatibility for existing integrations.
4417
+ * @param args - Array[to, value, data, operation, safeTxGas, baseGas, gasPrice, gasToken, refundReceiver, nonce]
4418
+ * @returns Array[encodedData]
4419
+ */
4420
+ this.encodeTransactionData = async (args) => {
4421
+ return [await this.read("encodeTransactionData", args)];
4422
+ };
4423
+ }
4424
+ };
4425
+ var CompatibilityFallbackHandlerContract_v1_5_0_default = CompatibilityFallbackHandlerContract_v1_5_0;
4426
+
4427
+ // src/contracts/ExtensibleFallbackHandler/ExtensibleFallbackHandlerBaseContract.ts
4428
+ var ExtensibleFallbackHandlerBaseContract = class extends BaseContract_default {
4429
+ /**
4430
+ * @constructor
4431
+ * Constructs an instance of ExtensibleFallbackHandlerBaseContract.
4432
+ *
4433
+ * @param chainId - The chain ID of the contract.
4434
+ * @param safeProvider - An instance of SafeProvider.
4435
+ * @param defaultAbi - The default ABI for the ExtensibleFallbackHandler contract. It should be compatible with the specific version of the contract.
4436
+ * @param safeVersion - The version of the Safe contract.
4437
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the Safe deployments based on the chainId and safeVersion.
4438
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the ABI is derived from the Safe deployments or the defaultAbi is used.
4439
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
4440
+ */
4441
+ constructor(chainId, safeProvider, defaultAbi, safeVersion, customContractAddress, customContractAbi, deploymentType) {
4442
+ const contractName3 = "extensibleFallbackHandler";
4443
+ super(
4444
+ contractName3,
4445
+ chainId,
4446
+ safeProvider,
4447
+ defaultAbi,
4448
+ safeVersion,
4449
+ customContractAddress,
4450
+ customContractAbi,
4451
+ deploymentType
4452
+ );
4453
+ this.contractName = contractName3;
4454
+ }
4455
+ };
4456
+ var ExtensibleFallbackHandlerBaseContract_default = ExtensibleFallbackHandlerBaseContract;
4457
+
4458
+ // src/contracts/ExtensibleFallbackHandler/v1.5.0/ExtensibleFallbackHandlerContract_v1_5_0.ts
4459
+ import {
4460
+ extensibleFallbackHandler_1_5_0_ContractArtifacts
4461
+ } from "@safe-global/types-kit";
4462
+ var ExtensibleFallbackHandlerContract_v1_5_0 = class extends ExtensibleFallbackHandlerBaseContract_default {
4463
+ /**
4464
+ * Constructs an instance of ExtensibleFallbackHandlerContract_v1_5_0
4465
+ *
4466
+ * @param chainId - The chain ID where the contract resides.
4467
+ * @param safeProvider - An instance of SafeProvider.
4468
+ * @param customContractAddress - Optional custom address for the contract. If not provided, the address is derived from the ExtensibleFallbackHandler deployments based on the chainId and safeVersion.
4469
+ * @param customContractAbi - Optional custom ABI for the contract. If not provided, the default ABI for version 1.5.0 is used.
4470
+ * @param deploymentType - Optional deployment type for the contract. If not provided, the first deployment retrieved from the safe-deployments array will be used.
4471
+ */
4472
+ constructor(chainId, safeProvider, customContractAddress, customContractAbi, deploymentType) {
4473
+ const safeVersion = "1.5.0";
4474
+ const defaultAbi = extensibleFallbackHandler_1_5_0_ContractArtifacts.abi;
4475
+ super(
4476
+ chainId,
4477
+ safeProvider,
4478
+ defaultAbi,
4479
+ safeVersion,
4480
+ customContractAddress,
4481
+ customContractAbi,
4482
+ deploymentType
4483
+ );
4484
+ // Read methods
4485
+ /**
4486
+ * @param args - Array[safe, domainSeparator]
4487
+ * @returns Array[verifier]
4488
+ */
4489
+ this.domainVerifiers = async (args) => {
4490
+ return [await this.read("domainVerifiers", args)];
4491
+ };
4492
+ /**
4493
+ * @param args - Array[_hash, signature]
4494
+ * @returns Array[magic]
4495
+ */
4496
+ this.isValidSignature = async (args) => {
4497
+ return [await this.read("isValidSignature", args)];
4498
+ };
4499
+ /**
4500
+ * @param args - Array[safe, interfaceId]
4501
+ * @returns Array[isSupported]
4502
+ */
4503
+ this.safeInterfaces = async (args) => {
4504
+ return [await this.read("safeInterfaces", args)];
4505
+ };
4506
+ /**
4507
+ * @param args - Array[safe, selector]
4508
+ * @returns Array[handler]
4509
+ */
4510
+ this.safeMethods = async (args) => {
4511
+ return [await this.read("safeMethods", args)];
4512
+ };
4513
+ /**
4514
+ * @param args - Array[interfaceId]
4515
+ * @returns Array[isSupported]
4516
+ */
4517
+ this.supportsInterface = async (args) => {
4518
+ return [await this.read("supportsInterface", args)];
4519
+ };
4520
+ /**
4521
+ * @param args - Array[operator, from, tokenId, data]
4522
+ * @returns Array[bytes4]
4523
+ */
4524
+ this.onERC721Received = async (args) => {
4525
+ return [await this.read("onERC721Received", args)];
4526
+ };
4527
+ /**
4528
+ * @param args - Array[operator, from, id, value, data]
4529
+ * @returns Array[bytes4]
4530
+ */
4531
+ this.onERC1155Received = async (args) => {
4532
+ return [await this.read("onERC1155Received", args)];
4533
+ };
4534
+ /**
4535
+ * @param args - Array[operator, from, ids, values, data]
4536
+ * @returns Array[bytes4]
4537
+ */
4538
+ this.onERC1155BatchReceived = async (args) => {
4539
+ return [await this.read("onERC1155BatchReceived", args)];
4540
+ };
4541
+ // Write methods (must be called via Safe transactions since msg.sender = Safe address)
4542
+ /**
4543
+ * @param args - Array[_interfaceId, handlerWithSelectors]
4544
+ */
4545
+ this.addSupportedInterfaceBatch = async (args, options) => {
4546
+ if (options && !options.gasLimit) {
4547
+ options.gasLimit = Number(
4548
+ await this.estimateGas("addSupportedInterfaceBatch", args, { ...options })
4549
+ );
4550
+ }
4551
+ return toTxResult(
4552
+ this.runner,
4553
+ await this.write("addSupportedInterfaceBatch", args, options),
4554
+ options
4555
+ );
4556
+ };
4557
+ /**
4558
+ * @param args - Array[_interfaceId, selectors]
4559
+ */
4560
+ this.removeSupportedInterfaceBatch = async (args, options) => {
4561
+ if (options && !options.gasLimit) {
4562
+ options.gasLimit = Number(
4563
+ await this.estimateGas("removeSupportedInterfaceBatch", args, { ...options })
4564
+ );
4565
+ }
4566
+ return toTxResult(
4567
+ this.runner,
4568
+ await this.write("removeSupportedInterfaceBatch", args, options),
4569
+ options
4570
+ );
4571
+ };
4572
+ /**
4573
+ * @param args - Array[domainSeparator, newVerifier]
4574
+ */
4575
+ this.setDomainVerifier = async (args, options) => {
4576
+ if (options && !options.gasLimit) {
4577
+ options.gasLimit = Number(await this.estimateGas("setDomainVerifier", args, { ...options }));
4578
+ }
4579
+ return toTxResult(this.runner, await this.write("setDomainVerifier", args, options), options);
4580
+ };
4581
+ /**
4582
+ * @param args - Array[selector, newMethod]
4583
+ */
4584
+ this.setSafeMethod = async (args, options) => {
4585
+ if (options && !options.gasLimit) {
4586
+ options.gasLimit = Number(await this.estimateGas("setSafeMethod", args, { ...options }));
4587
+ }
4588
+ return toTxResult(this.runner, await this.write("setSafeMethod", args, options), options);
4589
+ };
4590
+ /**
4591
+ * @param args - Array[interfaceId, supported]
4592
+ */
4593
+ this.setSupportedInterface = async (args, options) => {
4594
+ if (options && !options.gasLimit) {
4595
+ options.gasLimit = Number(
4596
+ await this.estimateGas("setSupportedInterface", args, { ...options })
4597
+ );
4598
+ }
4599
+ return toTxResult(
4600
+ this.runner,
4601
+ await this.write("setSupportedInterface", args, options),
4602
+ options
4603
+ );
4604
+ };
4605
+ }
4606
+ };
4607
+ var ExtensibleFallbackHandlerContract_v1_5_0_default = ExtensibleFallbackHandlerContract_v1_5_0;
3744
4608
 
3745
4609
  // src/contracts/SafeWebAuthnSignerFactory/SafeWebAuthnSignerFactoryBaseContract.ts
3746
4610
  var SafeWebAuthnSignerFactoryBaseContract = class extends BaseContract_default {
@@ -3914,6 +4778,16 @@ async function getSafeContractInstance(safeVersion, safeProvider, contractAddres
3914
4778
  const chainId = await safeProvider.getChainId();
3915
4779
  let safeContractInstance;
3916
4780
  switch (safeVersion) {
4781
+ case "1.5.0":
4782
+ safeContractInstance = new SafeContract_v1_5_0_default(
4783
+ chainId,
4784
+ safeProvider,
4785
+ isL1SafeSingleton,
4786
+ contractAddress,
4787
+ customContractAbi,
4788
+ deploymentType
4789
+ );
4790
+ break;
3917
4791
  case "1.4.1":
3918
4792
  safeContractInstance = new SafeContract_v1_4_1_default(
3919
4793
  chainId,
@@ -3974,6 +4848,15 @@ async function getCompatibilityFallbackHandlerContractInstance(safeVersion, safe
3974
4848
  const chainId = await safeProvider.getChainId();
3975
4849
  let compatibilityFallbackHandlerInstance;
3976
4850
  switch (safeVersion) {
4851
+ case "1.5.0":
4852
+ compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_5_0_default(
4853
+ chainId,
4854
+ safeProvider,
4855
+ contractAddress,
4856
+ customContractAbi,
4857
+ deploymentType
4858
+ );
4859
+ break;
3977
4860
  case "1.4.1":
3978
4861
  compatibilityFallbackHandlerInstance = new CompatibilityFallbackHandlerContract_v1_4_1_default(
3979
4862
  chainId,
@@ -4004,6 +4887,15 @@ async function getMultiSendContractInstance(safeVersion, safeProvider, contractA
4004
4887
  const chainId = await safeProvider.getChainId();
4005
4888
  let multiSendContractInstance;
4006
4889
  switch (safeVersion) {
4890
+ case "1.5.0":
4891
+ multiSendContractInstance = new MultiSendContract_v1_5_0_default(
4892
+ chainId,
4893
+ safeProvider,
4894
+ contractAddress,
4895
+ customContractAbi,
4896
+ deploymentType
4897
+ );
4898
+ break;
4007
4899
  case "1.4.1":
4008
4900
  multiSendContractInstance = new MultiSendContract_v1_4_1_default(
4009
4901
  chainId,
@@ -4043,6 +4935,15 @@ async function getMultiSendCallOnlyContractInstance(safeVersion, safeProvider, c
4043
4935
  const chainId = await safeProvider.getChainId();
4044
4936
  let multiSendCallOnlyContractInstance;
4045
4937
  switch (safeVersion) {
4938
+ case "1.5.0":
4939
+ multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_5_0_default(
4940
+ chainId,
4941
+ safeProvider,
4942
+ contractAddress,
4943
+ customContractAbi,
4944
+ deploymentType
4945
+ );
4946
+ break;
4046
4947
  case "1.4.1":
4047
4948
  multiSendCallOnlyContractInstance = new MultiSendCallOnlyContract_v1_4_1_default(
4048
4949
  chainId,
@@ -4074,6 +4975,15 @@ async function getSafeProxyFactoryContractInstance(safeVersion, safeProvider, co
4074
4975
  const chainId = await safeProvider.getChainId();
4075
4976
  let safeProxyFactoryContractInstance;
4076
4977
  switch (safeVersion) {
4978
+ case "1.5.0":
4979
+ safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_5_0_default(
4980
+ chainId,
4981
+ safeProvider,
4982
+ contractAddress,
4983
+ customContractAbi,
4984
+ deploymentType
4985
+ );
4986
+ break;
4077
4987
  case "1.4.1":
4078
4988
  safeProxyFactoryContractInstance = new SafeProxyFactoryContract_v1_4_1_default(
4079
4989
  chainId,
@@ -4121,6 +5031,15 @@ async function getSignMessageLibContractInstance(safeVersion, safeProvider, cont
4121
5031
  const chainId = await safeProvider.getChainId();
4122
5032
  let signMessageLibContractInstance;
4123
5033
  switch (safeVersion) {
5034
+ case "1.5.0":
5035
+ signMessageLibContractInstance = new SignMessageLibContract_v1_5_0_default(
5036
+ chainId,
5037
+ safeProvider,
5038
+ contractAddress,
5039
+ customContractAbi,
5040
+ deploymentType
5041
+ );
5042
+ break;
4124
5043
  case "1.4.1":
4125
5044
  signMessageLibContractInstance = new SignMessageLibContract_v1_4_1_default(
4126
5045
  chainId,
@@ -4149,6 +5068,15 @@ async function getCreateCallContractInstance(safeVersion, safeProvider, contract
4149
5068
  const chainId = await safeProvider.getChainId();
4150
5069
  let createCallContractInstance;
4151
5070
  switch (safeVersion) {
5071
+ case "1.5.0":
5072
+ createCallContractInstance = new CreateCallContract_v1_5_0_default(
5073
+ chainId,
5074
+ safeProvider,
5075
+ contractAddress,
5076
+ customContractAbi,
5077
+ deploymentType
5078
+ );
5079
+ break;
4152
5080
  case "1.4.1":
4153
5081
  createCallContractInstance = new CreateCallContract_v1_4_1_default(
4154
5082
  chainId,
@@ -4180,6 +5108,15 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
4180
5108
  const chainId = await safeProvider.getChainId();
4181
5109
  let simulateTxAccessorContractInstance;
4182
5110
  switch (safeVersion) {
5111
+ case "1.5.0":
5112
+ simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_5_0_default(
5113
+ chainId,
5114
+ safeProvider,
5115
+ contractAddress,
5116
+ customContractAbi,
5117
+ deploymentType
5118
+ );
5119
+ break;
4183
5120
  case "1.4.1":
4184
5121
  simulateTxAccessorContractInstance = new SimulateTxAccessorContract_v1_4_1_default(
4185
5122
  chainId,
@@ -4207,6 +5144,7 @@ async function getSimulateTxAccessorContractInstance(safeVersion, safeProvider,
4207
5144
  async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
4208
5145
  const chainId = await safeProvider.getChainId();
4209
5146
  switch (safeVersion) {
5147
+ case "1.5.0":
4210
5148
  case "1.4.1":
4211
5149
  case "1.3.0":
4212
5150
  const safeWebAuthnSignerFactoryContractInstance = new SafeWebAuthnSignerFactoryContract_v0_2_1_default(
@@ -4226,6 +5164,7 @@ async function getSafeWebAuthnSignerFactoryContractInstance(safeVersion, safePro
4226
5164
  async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
4227
5165
  const chainId = await safeProvider.getChainId();
4228
5166
  switch (safeVersion) {
5167
+ case "1.5.0":
4229
5168
  case "1.4.1":
4230
5169
  case "1.3.0":
4231
5170
  const safeWebAuthnSharedSignerContractInstance = new SafeWebAuthnSharedSignerContract_v0_2_1_default(
@@ -4242,6 +5181,23 @@ async function getSafeWebAuthnSharedSignerContractInstance(safeVersion, safeProv
4242
5181
  throw new Error("Invalid Safe version");
4243
5182
  }
4244
5183
  }
5184
+ async function getExtensibleFallbackHandlerContractInstance(safeVersion, safeProvider, contractAddress, customContractAbi, deploymentType) {
5185
+ const chainId = await safeProvider.getChainId();
5186
+ switch (safeVersion) {
5187
+ case "1.5.0":
5188
+ const extensibleFallbackHandlerContractInstance = new ExtensibleFallbackHandlerContract_v1_5_0_default(
5189
+ chainId,
5190
+ safeProvider,
5191
+ contractAddress,
5192
+ customContractAbi,
5193
+ deploymentType
5194
+ );
5195
+ await extensibleFallbackHandlerContractInstance.init();
5196
+ return extensibleFallbackHandlerContractInstance;
5197
+ default:
5198
+ throw new Error("Invalid Safe version");
5199
+ }
5200
+ }
4245
5201
 
4246
5202
  // src/contracts/safeDeploymentContracts.ts
4247
5203
  async function getSafeContract({
@@ -4451,6 +5407,27 @@ async function getSafeWebAuthnSharedSignerContract({
4451
5407
  }
4452
5408
  return safeWebAuthnSharedSignerContract;
4453
5409
  }
5410
+ async function getExtensibleFallbackHandlerContract({
5411
+ safeProvider,
5412
+ safeVersion,
5413
+ customContracts,
5414
+ deploymentType
5415
+ }) {
5416
+ const extensibleFallbackHandlerContract = await getExtensibleFallbackHandlerContractInstance(
5417
+ safeVersion,
5418
+ safeProvider,
5419
+ customContracts?.extensibleFallbackHandlerAddress,
5420
+ customContracts?.extensibleFallbackHandlerAbi,
5421
+ deploymentType
5422
+ );
5423
+ const isContractDeployed = await safeProvider.isContractDeployed(
5424
+ extensibleFallbackHandlerContract.getAddress()
5425
+ );
5426
+ if (!isContractDeployed) {
5427
+ throw new Error("ExtensibleFallbackHandler contract is not deployed on the current network");
5428
+ }
5429
+ return extensibleFallbackHandlerContract;
5430
+ }
4454
5431
 
4455
5432
  // src/utils/transactions/gas.ts
4456
5433
  var CALL_DATA_ZERO_BYTE_GAS_COST = 4;
@@ -4958,7 +5935,7 @@ function hasDelegateCalls(transactions) {
4958
5935
 
4959
5936
  // src/utils/passkeys/extractPasskeyData.ts
4960
5937
  import { Buffer as Buffer2 } from "buffer";
4961
- import { getFCLP256VerifierDeployment } from "@safe-global/safe-modules-deployments";
5938
+ import { getDaimoP256VerifierDeployment } from "@safe-global/safe-modules-deployments";
4962
5939
  function base64ToUint8Array(base64) {
4963
5940
  const base64Fixed = base64.replace(/-/g, "+").replace(/_/g, "/");
4964
5941
  const binaryBuffer = Buffer2.from(base64Fixed, "base64");
@@ -5068,18 +6045,18 @@ async function extractPasskeyData(passkeyCredential) {
5068
6045
  coordinates
5069
6046
  };
5070
6047
  }
5071
- function getDefaultFCLP256VerifierAddress(chainId) {
5072
- const FCLP256VerifierDeployment = getFCLP256VerifierDeployment({
6048
+ function getP256VerifierAddress(chainId) {
6049
+ const deployment = getDaimoP256VerifierDeployment({
5073
6050
  version: "0.2.1",
5074
6051
  released: true,
5075
6052
  network: chainId
5076
6053
  });
5077
- if (!FCLP256VerifierDeployment) {
5078
- throw new Error(`Failed to load FCLP256Verifier deployment for chain ID ${chainId}`);
6054
+ if (!deployment) {
6055
+ throw new Error(`Failed to load DaimoP256Verifier deployment for chain ID ${chainId}`);
5079
6056
  }
5080
- const verifierAddress = FCLP256VerifierDeployment.networkAddresses[chainId];
6057
+ const verifierAddress = deployment.networkAddresses[chainId];
5081
6058
  if (!verifierAddress) {
5082
- throw new Error(`FCLP256Verifier address not found for chain ID ${chainId}`);
6059
+ throw new Error(`DaimoP256Verifier address not found for chain ID ${chainId}`);
5083
6060
  }
5084
6061
  return verifierAddress;
5085
6062
  }
@@ -5104,15 +6081,14 @@ import {
5104
6081
  } from "viem";
5105
6082
 
5106
6083
  // src/utils/passkeys/isSharedSigner.ts
5107
- async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners, chainId) {
6084
+ async function isSharedSigner(passkey, safeWebAuthnSharedSignerContract, safeAddress, owners) {
5108
6085
  const sharedSignerContractAddress = safeWebAuthnSharedSignerContract.contractAddress;
5109
6086
  if (safeAddress && owners.includes(sharedSignerContractAddress)) {
5110
6087
  const [sharedSignerSlot] = await safeWebAuthnSharedSignerContract.getConfiguration([
5111
6088
  asHex(safeAddress)
5112
6089
  ]);
5113
6090
  const { x, y, verifiers } = sharedSignerSlot;
5114
- const verifierAddress = passkey.customVerifierAddress || getDefaultFCLP256VerifierAddress(chainId);
5115
- const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(verifierAddress) === verifiers;
6091
+ const isSharedSigner2 = BigInt(passkey.coordinates.x) === x && BigInt(passkey.coordinates.y) === y && BigInt(passkey.verifierAddress) === verifiers;
5116
6092
  return isSharedSigner2;
5117
6093
  }
5118
6094
  return false;
@@ -5148,16 +6124,14 @@ var signTransaction = () => {
5148
6124
  var signTypedData = () => {
5149
6125
  throw new Error("Passkey Signers cannot sign signTypedData, they can only sign data.");
5150
6126
  };
5151
- var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners, chainId) => {
5152
- const { rawId, coordinates, customVerifierAddress } = passkey;
6127
+ var createPasskeyClient = async (passkey, safeWebAuthnSignerFactoryContract, safeWebAuthnSharedSignerContract, provider, safeAddress, owners) => {
6128
+ const { rawId, coordinates, verifierAddress } = passkey;
5153
6129
  const passkeyRawId = hexToBytes(asHex(rawId));
5154
- const verifierAddress = customVerifierAddress || getDefaultFCLP256VerifierAddress(chainId);
5155
6130
  const isPasskeySharedSigner = await isSharedSigner_default(
5156
6131
  passkey,
5157
6132
  safeWebAuthnSharedSignerContract,
5158
6133
  safeAddress,
5159
- owners,
5160
- chainId
6134
+ owners
5161
6135
  );
5162
6136
  let signerAddress;
5163
6137
  if (isPasskeySharedSigner) {
@@ -5320,7 +6294,7 @@ import {
5320
6294
  getTransaction,
5321
6295
  getTransactionCount,
5322
6296
  getStorageAt,
5323
- readContract
6297
+ readContract as readContract2
5324
6298
  } from "viem/actions";
5325
6299
 
5326
6300
  // src/utils/provider.ts
@@ -5385,8 +6359,7 @@ var SafeProvider = class _SafeProvider {
5385
6359
  safeWebAuthnSharedSignerContract,
5386
6360
  safeProvider.getExternalProvider(),
5387
6361
  safeAddress || "",
5388
- owners || [],
5389
- chainId.toString()
6362
+ owners || []
5390
6363
  );
5391
6364
  } else {
5392
6365
  passkeySigner = signer;
@@ -5551,7 +6524,7 @@ var SafeProvider = class _SafeProvider {
5551
6524
  return data ?? "0x";
5552
6525
  }
5553
6526
  async readContract(args) {
5554
- return readContract(this.#externalProvider, args);
6527
+ return readContract2(this.#externalProvider, args);
5555
6528
  }
5556
6529
  // TODO: fix anys
5557
6530
  encodeParameters(types, values) {
@@ -5834,7 +6807,7 @@ async function predictSafeAddress({
5834
6807
  const salt = keccak2562(concat2([initializerHash, encodedNonce]));
5835
6808
  const input = safeProvider.encodeParameters("address", [safeContract.getAddress()]);
5836
6809
  const from = safeProxyFactoryContract.getAddress();
5837
- const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId);
6810
+ const isZkSyncChain = [ZKSYNC_MAINNET, ZKSYNC_TESTNET, ZKSYNC_LENS].includes(chainId) && semverSatisfies6(safeVersion, "<=1.4.1");
5838
6811
  if (isZkSyncChain) {
5839
6812
  const proxyAddress2 = zkSyncCreate2Address(from, safeVersion, salt, asHex(input));
5840
6813
  return safeProvider.getChecksummedAddress(proxyAddress2);
@@ -6012,6 +6985,10 @@ var FallbackHandlerManager = class {
6012
6985
  }
6013
6986
  return this.#safeContract;
6014
6987
  }
6988
+ encodeSetFallbackHandler(safeContract, handler) {
6989
+ const encode = safeContract.encode;
6990
+ return encode("setFallbackHandler", [asHex(handler)]);
6991
+ }
6015
6992
  async getFallbackHandler() {
6016
6993
  const safeContract = await this.isFallbackHandlerCompatible();
6017
6994
  return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#slot);
@@ -6021,13 +6998,13 @@ var FallbackHandlerManager = class {
6021
6998
  this.validateFallbackHandlerAddress(fallbackHandlerAddress);
6022
6999
  const currentFallbackHandler = await this.getFallbackHandler();
6023
7000
  this.validateFallbackHandlerIsNotEnabled(currentFallbackHandler, fallbackHandlerAddress);
6024
- return safeContract.encode("setFallbackHandler", [asHex(fallbackHandlerAddress)]);
7001
+ return this.encodeSetFallbackHandler(safeContract, fallbackHandlerAddress);
6025
7002
  }
6026
7003
  async encodeDisableFallbackHandlerData() {
6027
7004
  const safeContract = await this.isFallbackHandlerCompatible();
6028
7005
  const currentFallbackHandler = await this.getFallbackHandler();
6029
7006
  this.validateFallbackHandlerIsEnabled(currentFallbackHandler);
6030
- return safeContract.encode("setFallbackHandler", [asHex(ZERO_ADDRESS)]);
7007
+ return this.encodeSetFallbackHandler(safeContract, ZERO_ADDRESS);
6031
7008
  }
6032
7009
  };
6033
7010
  var fallbackHandlerManager_default = FallbackHandlerManager;
@@ -6094,6 +7071,8 @@ var guardManager_default = GuardManager;
6094
7071
  var ModuleManager = class {
6095
7072
  #safeProvider;
6096
7073
  #safeContract;
7074
+ // keccak256("module_manager.module_guard.address")
7075
+ #moduleGuardSlot = "0xb104e0b93118902c651344349b610029d694cfdec91c589c91ebafbcd0289947";
6097
7076
  constructor(safeProvider, safeContract) {
6098
7077
  this.#safeProvider = safeProvider;
6099
7078
  this.#safeContract = safeContract;
@@ -6159,6 +7138,49 @@ var ModuleManager = class {
6159
7138
  const prevModuleAddress = moduleIndex === 0 ? SENTINEL_ADDRESS : modules[moduleIndex - 1];
6160
7139
  return this.#safeContract.encode("disableModule", [prevModuleAddress, moduleAddress]);
6161
7140
  }
7141
+ validateModuleGuardAddress(moduleGuardAddress) {
7142
+ const isValidAddress = this.#safeProvider.isAddress(moduleGuardAddress);
7143
+ if (!isValidAddress || isZeroAddress(moduleGuardAddress)) {
7144
+ throw new Error("Invalid module guard address provided");
7145
+ }
7146
+ }
7147
+ validateModuleGuardIsNotEnabled(currentModuleGuard, newModuleGuardAddress) {
7148
+ if (sameString(currentModuleGuard, newModuleGuardAddress)) {
7149
+ throw new Error("Module guard provided is already enabled");
7150
+ }
7151
+ }
7152
+ validateModuleGuardIsEnabled(moduleGuardAddress) {
7153
+ if (isZeroAddress(moduleGuardAddress)) {
7154
+ throw new Error("There is no module guard enabled yet");
7155
+ }
7156
+ }
7157
+ async isModuleGuardCompatible() {
7158
+ if (!this.#safeContract) {
7159
+ throw new Error("Safe is not deployed");
7160
+ }
7161
+ const safeVersion = this.#safeContract.safeVersion;
7162
+ if (!hasSafeFeature("SAFE_MODULE_GUARD" /* SAFE_MODULE_GUARD */, safeVersion)) {
7163
+ throw new Error("Current version of the Safe does not support module guard functionality");
7164
+ }
7165
+ return this.#safeContract;
7166
+ }
7167
+ async getModuleGuard() {
7168
+ const safeContract = await this.isModuleGuardCompatible();
7169
+ return this.#safeProvider.getStorageAt(safeContract.getAddress(), this.#moduleGuardSlot);
7170
+ }
7171
+ async encodeEnableModuleGuardData(moduleGuardAddress) {
7172
+ const safeContract = await this.isModuleGuardCompatible();
7173
+ this.validateModuleGuardAddress(moduleGuardAddress);
7174
+ const currentModuleGuard = await this.getModuleGuard();
7175
+ this.validateModuleGuardIsNotEnabled(currentModuleGuard, moduleGuardAddress);
7176
+ return safeContract.encode("setModuleGuard", [asHex(moduleGuardAddress)]);
7177
+ }
7178
+ async encodeDisableModuleGuardData() {
7179
+ const safeContract = await this.isModuleGuardCompatible();
7180
+ const currentModuleGuard = await this.getModuleGuard();
7181
+ this.validateModuleGuardIsEnabled(currentModuleGuard);
7182
+ return safeContract.encode("setModuleGuard", [asHex(ZERO_ADDRESS)]);
7183
+ }
6162
7184
  };
6163
7185
  var moduleManager_default = ModuleManager;
6164
7186
 
@@ -6345,9 +7367,10 @@ function generateOnChainIdentifier({
6345
7367
  var generateOnChainIdentifier_default = generateOnChainIdentifier;
6346
7368
 
6347
7369
  // src/utils/getProtocolKitVersion.ts
6348
- var getProtocolKitVersion = () => "6.1.2";
7370
+ var getProtocolKitVersion = () => "7.0.0";
6349
7371
 
6350
7372
  // src/Safe.ts
7373
+ var EQ_OR_GT_1_5_0 = ">=1.5.0";
6351
7374
  var EQ_OR_GT_1_4_1 = ">=1.4.1";
6352
7375
  var EQ_OR_GT_1_3_03 = ">=1.3.0";
6353
7376
  var Safe = class _Safe {
@@ -6383,31 +7406,27 @@ var Safe = class _Safe {
6383
7406
  this.isValidSignature = async (messageHash, signature = "0x") => {
6384
7407
  const safeAddress = await this.getAddress();
6385
7408
  const fallbackHandler = await this.#getFallbackHandlerContract();
7409
+ const safeVersion = this.getContractVersion();
6386
7410
  const signatureToCheck = signature && Array.isArray(signature) ? buildSignatureBytes(signature) : signature;
6387
7411
  const bytes32Tuple = [
6388
7412
  asHash(messageHash),
6389
7413
  asHex(signatureToCheck)
6390
7414
  ];
6391
7415
  const data = fallbackHandler.encode("isValidSignature", bytes32Tuple);
6392
- const bytesTuple = [
6393
- asHash(messageHash),
6394
- asHex(signatureToCheck)
6395
- ];
6396
- const bytesData = fallbackHandler.encode("isValidSignature", bytesTuple);
7416
+ const callParams = { from: safeAddress, to: safeAddress };
7417
+ const calls = [this.#safeProvider.call({ ...callParams, data })];
7418
+ if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
7419
+ const bytesTuple = [
7420
+ asHash(messageHash),
7421
+ asHex(signatureToCheck)
7422
+ ];
7423
+ const bytesData = fallbackHandler.encode("isValidSignature", bytesTuple);
7424
+ calls.push(this.#safeProvider.call({ ...callParams, data: bytesData }));
7425
+ }
6397
7426
  try {
6398
- const isValidSignatureResponse = await Promise.all([
6399
- this.#safeProvider.call({
6400
- from: safeAddress,
6401
- to: safeAddress,
6402
- data
6403
- }),
6404
- this.#safeProvider.call({
6405
- from: safeAddress,
6406
- to: safeAddress,
6407
- data: bytesData
6408
- })
6409
- ]);
6410
- return !!isValidSignatureResponse.length && (isValidSignatureResponse[0].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE || isValidSignatureResponse[1].slice(0, 10).toLowerCase() === this.#MAGIC_VALUE_BYTES);
7427
+ const responses = await Promise.all(calls);
7428
+ const magicValues = [this.#MAGIC_VALUE, this.#MAGIC_VALUE_BYTES];
7429
+ return responses.some((response, i) => response.slice(0, 10).toLowerCase() === magicValues[i]);
6411
7430
  } catch (error) {
6412
7431
  return false;
6413
7432
  }
@@ -6766,6 +7785,15 @@ var Safe = class _Safe {
6766
7785
  async isModuleEnabled(moduleAddress) {
6767
7786
  return this.#moduleManager.isModuleEnabled(moduleAddress);
6768
7787
  }
7788
+ /**
7789
+ * Returns the enabled Safe module guard or 0x address if no module guard is enabled.
7790
+ *
7791
+ * @returns The address of the enabled Safe module guard
7792
+ * @throws "Current version of the Safe does not support module guard functionality"
7793
+ */
7794
+ async getModuleGuard() {
7795
+ return this.#moduleManager.getModuleGuard();
7796
+ }
6769
7797
  /**
6770
7798
  * Checks if a specific address is an owner of the current Safe.
6771
7799
  *
@@ -6967,7 +7995,15 @@ var Safe = class _Safe {
6967
7995
  throw new Error("eth_sign is only supported by Safes >= v1.1.0");
6968
7996
  }
6969
7997
  let safeMessageHash;
6970
- if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_4_1)) {
7998
+ if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
7999
+ const parentSafeMessageHash = calculateSafeMessageHash(
8000
+ preimageSafeAddress,
8001
+ hashSafeMessage(message.data),
8002
+ safeVersion,
8003
+ chainId
8004
+ );
8005
+ safeMessageHash = await this.getSafeMessageHash(parentSafeMessageHash);
8006
+ } else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && preimageSafeAddress && semverSatisfies7(safeVersion, EQ_OR_GT_1_4_1)) {
6971
8007
  const messageHashData = preimageSafeMessageHash(
6972
8008
  preimageSafeAddress,
6973
8009
  hashSafeMessage(message.data),
@@ -7047,7 +8083,15 @@ var Safe = class _Safe {
7047
8083
  throw new Error("eth_sign is only supported by Safes >= v1.1.0");
7048
8084
  }
7049
8085
  let txHash;
7050
- if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_3_03) && preimageSafeAddress) {
8086
+ if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_5_0) && preimageSafeAddress) {
8087
+ const txHashData = calculateSafeTransactionHash(
8088
+ preimageSafeAddress,
8089
+ transaction.data,
8090
+ safeVersion2,
8091
+ chainId
8092
+ );
8093
+ txHash = await this.getSafeMessageHash(txHashData);
8094
+ } else if (signingMethod === SigningMethod2.SAFE_SIGNATURE && semverSatisfies7(safeVersion2, EQ_OR_GT_1_3_03) && preimageSafeAddress) {
7051
8095
  const txHashData = preimageSafeTransactionHash(
7052
8096
  preimageSafeAddress,
7053
8097
  safeTransaction.data,
@@ -7169,6 +8213,203 @@ var Safe = class _Safe {
7169
8213
  });
7170
8214
  return safeTransaction;
7171
8215
  }
8216
+ // ---------------------------------------------------------------------------
8217
+ // ExtensibleFallbackHandler helpers
8218
+ // ---------------------------------------------------------------------------
8219
+ /**
8220
+ * Returns an instance of the ExtensibleFallbackHandler contract for the current chain.
8221
+ * Used internally to compose read queries and Safe transactions against the EFH.
8222
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8223
+ */
8224
+ async #getExtensibleFallbackHandlerContract() {
8225
+ const safeVersion = this.getContractVersion();
8226
+ if (!semverSatisfies7(safeVersion, EQ_OR_GT_1_5_0)) {
8227
+ throw new Error("ExtensibleFallbackHandler is only available for Safe >= v1.5.0");
8228
+ }
8229
+ const chainId = await this.getChainId();
8230
+ const customContracts = this.#contractManager.contractNetworks?.[chainId.toString()];
8231
+ return getExtensibleFallbackHandlerContract({
8232
+ safeProvider: this.#safeProvider,
8233
+ safeVersion,
8234
+ customContracts
8235
+ });
8236
+ }
8237
+ // ----- Read helpers -----
8238
+ /**
8239
+ * Returns the bytes32-encoded handler registered for the given 4-byte selector on
8240
+ * the ExtensibleFallbackHandler for this Safe.
8241
+ * Only available for Safe >= v1.5.0.
8242
+ *
8243
+ * @param selector - The 4-byte function selector (e.g. '0xaabbccdd')
8244
+ * @returns The bytes32 handler entry, or the zero bytes32 if unregistered
8245
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8246
+ */
8247
+ async getSafeMethod(selector) {
8248
+ const safeAddress = await this.getAddress();
8249
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8250
+ const [method] = await efhContract.safeMethods([
8251
+ safeAddress,
8252
+ selector
8253
+ ]);
8254
+ return method;
8255
+ }
8256
+ /**
8257
+ * Returns the ISafeSignatureVerifier address registered for the given domain separator
8258
+ * on the ExtensibleFallbackHandler for this Safe.
8259
+ * Only available for Safe >= v1.5.0.
8260
+ *
8261
+ * @param domainSeparator - 32-byte domain separator
8262
+ * @returns The verifier address, or the zero address if unregistered
8263
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8264
+ */
8265
+ async getDomainVerifier(domainSeparator) {
8266
+ const safeAddress = await this.getAddress();
8267
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8268
+ const [verifier] = await efhContract.domainVerifiers([
8269
+ safeAddress,
8270
+ domainSeparator
8271
+ ]);
8272
+ return verifier;
8273
+ }
8274
+ /**
8275
+ * Returns whether the given ERC-165 interface ID is marked as supported for this Safe
8276
+ * on the ExtensibleFallbackHandler.
8277
+ * Only available for Safe >= v1.5.0.
8278
+ *
8279
+ * @param interfaceId - 4-byte ERC-165 interface ID
8280
+ * @returns true if supported, false otherwise
8281
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8282
+ */
8283
+ async isSafeInterfaceSupported(interfaceId) {
8284
+ const safeAddress = await this.getAddress();
8285
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8286
+ const [isSupported] = await efhContract.safeInterfaces([
8287
+ safeAddress,
8288
+ interfaceId
8289
+ ]);
8290
+ return isSupported;
8291
+ }
8292
+ // ----- Write transaction builders -----
8293
+ /**
8294
+ * Returns a Safe transaction that calls setSafeMethod on the ExtensibleFallbackHandler.
8295
+ * Because the EFH uses msg.sender as the Safe address, this must be executed through
8296
+ * the Safe itself.
8297
+ * Only available for Safe >= v1.5.0.
8298
+ *
8299
+ * @param selector - The 4-byte function selector to handle
8300
+ * @param newMethod - bytes32-packed handler address (address right-aligned, 12 leading zero bytes)
8301
+ * @param options - Optional Safe transaction properties
8302
+ * @returns The Safe transaction ready to be signed
8303
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8304
+ */
8305
+ async createSetSafeMethodTx(selector, newMethod, options) {
8306
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8307
+ const safeAddress = await this.getAddress();
8308
+ const data = efhContract.encode("setSafeMethod", [
8309
+ selector,
8310
+ newMethod
8311
+ ]);
8312
+ return this.createTransaction({
8313
+ transactions: [{ to: safeAddress, value: "0", data }],
8314
+ options
8315
+ });
8316
+ }
8317
+ /**
8318
+ * Returns a Safe transaction that calls setDomainVerifier on the ExtensibleFallbackHandler.
8319
+ * Registers an ISafeSignatureVerifier for EIP-712 domain-based signature validation.
8320
+ * Only available for Safe >= v1.5.0.
8321
+ *
8322
+ * @param domainSeparator - 32-byte EIP-712 domain separator
8323
+ * @param verifier - Address of the ISafeSignatureVerifier contract
8324
+ * @param options - Optional Safe transaction properties
8325
+ * @returns The Safe transaction ready to be signed
8326
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8327
+ */
8328
+ async createSetDomainVerifierTx(domainSeparator, verifier, options) {
8329
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8330
+ const safeAddress = await this.getAddress();
8331
+ const data = efhContract.encode("setDomainVerifier", [
8332
+ domainSeparator,
8333
+ verifier
8334
+ ]);
8335
+ return this.createTransaction({
8336
+ transactions: [{ to: safeAddress, value: "0", data }],
8337
+ options
8338
+ });
8339
+ }
8340
+ /**
8341
+ * Returns a Safe transaction that calls setSupportedInterface on the ExtensibleFallbackHandler.
8342
+ * Marks (or un-marks) an ERC-165 interface as supported for this Safe.
8343
+ * Only available for Safe >= v1.5.0.
8344
+ *
8345
+ * @param interfaceId - 4-byte ERC-165 interface ID
8346
+ * @param supported - true to add support, false to remove it
8347
+ * @param options - Optional Safe transaction properties
8348
+ * @returns The Safe transaction ready to be signed
8349
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8350
+ */
8351
+ async createSetSupportedInterfaceTx(interfaceId, supported, options) {
8352
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8353
+ const safeAddress = await this.getAddress();
8354
+ const data = efhContract.encode("setSupportedInterface", [
8355
+ interfaceId,
8356
+ supported
8357
+ ]);
8358
+ return this.createTransaction({
8359
+ transactions: [{ to: safeAddress, value: "0", data }],
8360
+ options
8361
+ });
8362
+ }
8363
+ /**
8364
+ * Returns a Safe transaction that calls addSupportedInterfaceBatch on the ExtensibleFallbackHandler.
8365
+ * Atomically registers an interface and multiple method handlers in a single call.
8366
+ * Only available for Safe >= v1.5.0.
8367
+ *
8368
+ * Each entry in handlerWithSelectors is a bytes32 value encoding both the handler address
8369
+ * and the 4-byte method selector: first 4 bytes = selector, next 8 bytes = zero padding,
8370
+ * last 20 bytes = handler address.
8371
+ *
8372
+ * @param interfaceId - 4-byte ERC-165 interface ID to mark as supported
8373
+ * @param handlerWithSelectors - Array of packed selector+handler bytes32 values
8374
+ * @param options - Optional Safe transaction properties
8375
+ * @returns The Safe transaction ready to be signed
8376
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8377
+ */
8378
+ async createAddSupportedInterfaceBatchTx(interfaceId, handlerWithSelectors, options) {
8379
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8380
+ const safeAddress = await this.getAddress();
8381
+ const data = efhContract.encode("addSupportedInterfaceBatch", [
8382
+ interfaceId,
8383
+ handlerWithSelectors
8384
+ ]);
8385
+ return this.createTransaction({
8386
+ transactions: [{ to: safeAddress, value: "0", data }],
8387
+ options
8388
+ });
8389
+ }
8390
+ /**
8391
+ * Returns a Safe transaction that calls removeSupportedInterfaceBatch on the ExtensibleFallbackHandler.
8392
+ * Atomically un-registers an interface and removes the given method handlers in a single call.
8393
+ * Only available for Safe >= v1.5.0.
8394
+ *
8395
+ * @param interfaceId - 4-byte ERC-165 interface ID to remove
8396
+ * @param selectors - Array of 4-byte function selectors to un-register
8397
+ * @param options - Optional Safe transaction properties
8398
+ * @returns The Safe transaction ready to be signed
8399
+ * @throws "ExtensibleFallbackHandler is only available for Safe >= v1.5.0"
8400
+ */
8401
+ async createRemoveSupportedInterfaceBatchTx(interfaceId, selectors, options) {
8402
+ const efhContract = await this.#getExtensibleFallbackHandlerContract();
8403
+ const safeAddress = await this.getAddress();
8404
+ const data = efhContract.encode("removeSupportedInterfaceBatch", [
8405
+ interfaceId,
8406
+ selectors
8407
+ ]);
8408
+ return this.createTransaction({
8409
+ transactions: [{ to: safeAddress, value: "0", data }],
8410
+ options
8411
+ });
8412
+ }
7172
8413
  /**
7173
8414
  * Returns the Safe transaction to enable a Safe guard.
7174
8415
  *
@@ -7211,6 +8452,48 @@ var Safe = class _Safe {
7211
8452
  });
7212
8453
  return safeTransaction;
7213
8454
  }
8455
+ /**
8456
+ * Returns the Safe transaction to enable a Safe module guard.
8457
+ *
8458
+ * @param moduleGuardAddress - The desired module guard address
8459
+ * @param options - The transaction optional properties
8460
+ * @returns The Safe transaction ready to be signed
8461
+ * @throws "Invalid module guard address provided"
8462
+ * @throws "Module guard provided is already enabled"
8463
+ * @throws "Current version of the Safe does not support module guard functionality"
8464
+ */
8465
+ async createEnableModuleGuardTx(moduleGuardAddress, options) {
8466
+ const safeTransactionData = {
8467
+ to: await this.getAddress(),
8468
+ value: "0",
8469
+ data: await this.#moduleManager.encodeEnableModuleGuardData(moduleGuardAddress)
8470
+ };
8471
+ const safeTransaction = await this.createTransaction({
8472
+ transactions: [safeTransactionData],
8473
+ options
8474
+ });
8475
+ return safeTransaction;
8476
+ }
8477
+ /**
8478
+ * Returns the Safe transaction to disable a Safe module guard.
8479
+ *
8480
+ * @param options - The transaction optional properties
8481
+ * @returns The Safe transaction ready to be signed
8482
+ * @throws "There is no module guard enabled yet"
8483
+ * @throws "Current version of the Safe does not support module guard functionality"
8484
+ */
8485
+ async createDisableModuleGuardTx(options) {
8486
+ const safeTransactionData = {
8487
+ to: await this.getAddress(),
8488
+ value: "0",
8489
+ data: await this.#moduleManager.encodeDisableModuleGuardData()
8490
+ };
8491
+ const safeTransaction = await this.createTransaction({
8492
+ transactions: [safeTransactionData],
8493
+ options
8494
+ });
8495
+ return safeTransaction;
8496
+ }
7214
8497
  /**
7215
8498
  * Returns the Safe transaction to enable a Safe module.
7216
8499
  *
@@ -7723,7 +9006,7 @@ var Safe = class _Safe {
7723
9006
  /**
7724
9007
  * This method creates a signer to be used with the init method
7725
9008
  * @param {Credential} credential - The credential to be used to create the signer. Can be generated in the web with navigator.credentials.create
7726
- * @returns {PasskeyArgType} - The signer to be used with the init method
9009
+ * @returns {ExtractedPasskeyData} - The extracted passkey data. Combine with a verifierAddress to build a PasskeyArgType.
7727
9010
  */
7728
9011
  this.createPasskeySigner = async (credential) => {
7729
9012
  return extractPasskeyData(credential);
@@ -7820,8 +9103,10 @@ export {
7820
9103
  getERC20Decimals,
7821
9104
  getEip712MessageTypes,
7822
9105
  getEip712TxTypes,
9106
+ getExtensibleFallbackHandlerContract,
7823
9107
  getMultiSendCallOnlyContract,
7824
9108
  getMultiSendContract,
9109
+ getP256VerifierAddress,
7825
9110
  getPasskeyOwnerAddress_default as getPasskeyOwnerAddress,
7826
9111
  getPredictedSafeAddressInitCode,
7827
9112
  getSafeAddressFromDeploymentTx,