@metamask/smart-accounts-kit 1.5.0 → 1.6.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 (90) hide show
  1. package/CHANGELOG.md +47 -25
  2. package/dist/actions/index.cjs +5 -6
  3. package/dist/actions/index.cjs.map +1 -1
  4. package/dist/actions/index.d.cts +3 -3
  5. package/dist/actions/index.d.ts +3 -3
  6. package/dist/actions/index.mjs +4 -5
  7. package/dist/{caveats-DQ6HoAHe.d.ts → caveats-B2OssjV4.d.ts} +1 -2
  8. package/dist/{caveats-CaSt_VHs.d.cts → caveats-gqMBZKkI.d.cts} +1 -2
  9. package/dist/{chunk-SOFB2MXG.cjs → chunk-2OS36DVV.cjs} +8 -1
  10. package/dist/chunk-2OS36DVV.cjs.map +1 -0
  11. package/dist/{chunk-XEOE25DE.cjs → chunk-2ZOWIAP3.cjs} +98 -68
  12. package/dist/chunk-2ZOWIAP3.cjs.map +1 -0
  13. package/dist/{chunk-BGOSYTKV.mjs → chunk-AZYTTGON.mjs} +38 -8
  14. package/dist/chunk-AZYTTGON.mjs.map +1 -0
  15. package/dist/{chunk-SCS3CFRE.cjs → chunk-DCI2AN4N.cjs} +15 -17
  16. package/dist/chunk-DCI2AN4N.cjs.map +1 -0
  17. package/dist/{chunk-DN4O5VOP.cjs → chunk-EPU4O7FY.cjs} +158 -151
  18. package/dist/chunk-EPU4O7FY.cjs.map +1 -0
  19. package/dist/{chunk-QCULIK3O.mjs → chunk-GMGJRC3D.mjs} +8 -1
  20. package/dist/chunk-GMGJRC3D.mjs.map +1 -0
  21. package/dist/chunk-IMO6XNDJ.mjs +14 -0
  22. package/dist/chunk-IMO6XNDJ.mjs.map +1 -0
  23. package/dist/chunk-IQT6XFDT.cjs +14 -0
  24. package/dist/chunk-IQT6XFDT.cjs.map +1 -0
  25. package/dist/{chunk-FH6HZCHI.cjs → chunk-JKVSTPEC.cjs} +200 -18
  26. package/dist/chunk-JKVSTPEC.cjs.map +1 -0
  27. package/dist/{chunk-N66VAWMO.mjs → chunk-K7GTZGKJ.mjs} +2 -2
  28. package/dist/{chunk-TBHT26BV.mjs → chunk-L3EZCIY6.mjs} +67 -60
  29. package/dist/chunk-L3EZCIY6.mjs.map +1 -0
  30. package/dist/{chunk-7FYDQNJ3.cjs → chunk-PQPAEHJZ.cjs} +12 -12
  31. package/dist/{chunk-7FYDQNJ3.cjs.map → chunk-PQPAEHJZ.cjs.map} +1 -1
  32. package/dist/{chunk-MV2KHN75.mjs → chunk-TNGQTVSY.mjs} +163 -35
  33. package/dist/chunk-TNGQTVSY.mjs.map +1 -0
  34. package/dist/{chunk-YXHUT56Z.mjs → chunk-UJQ3JN3U.mjs} +4 -6
  35. package/dist/{chunk-YXHUT56Z.mjs.map → chunk-UJQ3JN3U.mjs.map} +1 -1
  36. package/dist/{chunk-IBZSNB7D.cjs → chunk-W6HPAK4M.cjs} +202 -74
  37. package/dist/chunk-W6HPAK4M.cjs.map +1 -0
  38. package/dist/{chunk-W7O2UQL5.mjs → chunk-YVU66KSH.mjs} +188 -6
  39. package/dist/chunk-YVU66KSH.mjs.map +1 -0
  40. package/dist/contracts/index.cjs +5 -6
  41. package/dist/contracts/index.cjs.map +1 -1
  42. package/dist/contracts/index.d.cts +4 -4
  43. package/dist/contracts/index.d.ts +4 -4
  44. package/dist/contracts/index.mjs +4 -5
  45. package/dist/{delegation-DbPGWKfP.d.ts → decodeRevertReason-CmmCpmZ_.d.cts} +11 -3
  46. package/dist/{delegation-BKkEyxZY.d.cts → decodeRevertReason-dOTpJx2h.d.ts} +11 -3
  47. package/dist/experimental/index.cjs +364 -9
  48. package/dist/experimental/index.cjs.map +1 -1
  49. package/dist/experimental/index.d.cts +39 -3
  50. package/dist/experimental/index.d.ts +39 -3
  51. package/dist/experimental/index.mjs +357 -2
  52. package/dist/experimental/index.mjs.map +1 -1
  53. package/dist/index-B1Cmezvh.d.cts +61 -0
  54. package/dist/{index-DXdlz7t4.d.ts → index-BkgdU4LI.d.ts} +99 -93
  55. package/dist/{index-G78z6nwi.d.ts → index-DUJmm8Wz.d.ts} +13 -5
  56. package/dist/{index-yU3olCJV.d.cts → index-Dv4jPzhe.d.cts} +99 -93
  57. package/dist/index-LqiEgBjV.d.ts +61 -0
  58. package/dist/{index-DfDAuvr5.d.cts → index-X7Qn3JTg.d.cts} +13 -5
  59. package/dist/index.cjs +22 -24
  60. package/dist/index.cjs.map +1 -1
  61. package/dist/index.d.cts +8 -8
  62. package/dist/index.d.ts +8 -8
  63. package/dist/index.mjs +9 -11
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/{resolveCaveats-DiqGB-T5.d.cts → resolveCaveats-A9xC29l8.d.cts} +160 -62
  66. package/dist/{resolveCaveats-s2snaFEo.d.ts → resolveCaveats-A9xC29l8.d.ts} +160 -62
  67. package/dist/utils/index.cjs +13 -6
  68. package/dist/utils/index.cjs.map +1 -1
  69. package/dist/utils/index.d.cts +8 -5
  70. package/dist/utils/index.d.ts +8 -5
  71. package/dist/utils/index.mjs +16 -9
  72. package/package.json +7 -6
  73. package/dist/chunk-4QXIOE7F.mjs +0 -79
  74. package/dist/chunk-4QXIOE7F.mjs.map +0 -1
  75. package/dist/chunk-BGOSYTKV.mjs.map +0 -1
  76. package/dist/chunk-DN4O5VOP.cjs.map +0 -1
  77. package/dist/chunk-FH6HZCHI.cjs.map +0 -1
  78. package/dist/chunk-IBZSNB7D.cjs.map +0 -1
  79. package/dist/chunk-MOHCTPYQ.cjs +0 -79
  80. package/dist/chunk-MOHCTPYQ.cjs.map +0 -1
  81. package/dist/chunk-MV2KHN75.mjs.map +0 -1
  82. package/dist/chunk-QCULIK3O.mjs.map +0 -1
  83. package/dist/chunk-SCS3CFRE.cjs.map +0 -1
  84. package/dist/chunk-SOFB2MXG.cjs.map +0 -1
  85. package/dist/chunk-TBHT26BV.mjs.map +0 -1
  86. package/dist/chunk-W7O2UQL5.mjs.map +0 -1
  87. package/dist/chunk-XEOE25DE.cjs.map +0 -1
  88. package/dist/types-BWaH4KH1.d.cts +0 -155
  89. package/dist/types-BWaH4KH1.d.ts +0 -155
  90. /package/dist/{chunk-N66VAWMO.mjs.map → chunk-K7GTZGKJ.mjs.map} +0 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.6.0]
11
+
12
+ ### Added
13
+
14
+ - Experimental `createx402DelegationProvider` added to @metamask/smart-accounts-kit/experimental ([#248](https://github.com/metamask/smart-accounts-kit/pull/248), [#251](https://github.com/metamask/smart-accounts-kit/pull/251))
15
+ - New `generateSalt` function added to @metamask/smart-accounts-kit/utils ([#248](https://github.com/metamask/smart-accounts-kit/pull/248))
16
+ - ERC-7715 `token-approval-revocation` permission type ([#226](https://github.com/metamask/smart-accounts-kit/pull/226), [#237](https://github.com/metamask/smart-accounts-kit/pull/237))
17
+ - `CaveatBuilder` for `ApprovalRevocationEnforcer`, deployment address added to `SmartAccountsEnvironment` ([#226](https://github.com/metamask/smart-accounts-kit/pull/226), [#237](https://github.com/metamask/smart-accounts-kit/pull/237))
18
+ - Helper for decoding revert reasons from delegated execution errors while preserving the original error output ([#245](https://github.com/metamask/smart-accounts-kit/pull/245))
19
+
20
+ ### Changed
21
+
22
+ - Bumped @metamask/delegation-abis from `^1.0.0` to `^1.1.0` ([#234](https://github.com/metamask/smart-accounts-kit/pull/234))
23
+ - Bumped @metamask/delegation-core from `^2.1.0` to `^2.2.1` ([#234](https://github.com/metamask/smart-accounts-kit/pull/234), [#240](https://github.com/metamask/smart-accounts-kit/pull/240))
24
+ - Bumped @metamask/delegation-deployments from `^1.3.0` to `^1.4.0` ([#234](https://github.com/metamask/smart-accounts-kit/pull/234))
25
+ - Bumped @metamask/7715-permission-types from `^0.6.0` to `^0.7.1` ([#234](https://github.com/metamask/smart-accounts-kit/pull/234), [#240](https://github.com/metamask/smart-accounts-kit/pull/240))
26
+
27
+ ### Deprecated
28
+
29
+ - Deprecated `erc20-token-revocation` in favor of `token-approval-revocation` ([#226](https://github.com/metamask/smart-accounts-kit/pull/226))
30
+
10
31
  ## [1.5.0]
11
32
 
12
33
  ### Added
@@ -15,13 +36,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
15
36
 
16
37
  ### Changed
17
38
 
18
- - Bumped @metamask/delegation-core from ^2.0.0 to ^2.1.0 ([#231](https://github.com/MetaMask/smart-accounts-kit/pull/231))
39
+ - Bumped @metamask/delegation-core from ^2.0.0 to ^2.1.0 ([#231](https://github.com/metamask/smart-accounts-kit/pull/231))
19
40
 
20
41
  ## [1.4.0]
21
42
 
22
43
  ### Added
23
44
 
24
- - Add optional `payee` execution rule to `PermissionRequestParameter` for allowance-type permissions ([#219](https://github.com/MetaMask/smart-accounts-kit/pull/219))
45
+ - Add optional `payee` execution rule to `PermissionRequestParameter` for allowance-type permissions ([#219](https://github.com/metamask/smart-accounts-kit/pull/219))
25
46
  - Add new erc-7715 simple allowance types: ([#214](https://github.com/metamask/smart-accounts-kit/pull/214))
26
47
 
27
48
  ## [1.3.0]
@@ -36,7 +57,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
36
57
  ### Added
37
58
 
38
59
  - `decodeCaveat` util function ([#191](https://github.com/metamask/smart-accounts-kit/pull/191))
39
- - Chain deployment for Katana mainnet and Katana Bokuto ([#203](https://github.com/MetaMask/smart-accounts-kit/pull/203))
60
+ - Chain deployment for Katana mainnet and Katana Bokuto ([#203](https://github.com/metamask/smart-accounts-kit/pull/203))
40
61
  - Anonymous usage statistics to help improve the SDK ([#185](https://github.com/metamask/smart-accounts-kit/pull/185))
41
62
  - Opt out by setting environment variables `CI` or `DO_NOT_TRACK`, or `navigator.doNotTrack` or `window.doNotTrack` to either '1', 'true', or 'yes'
42
63
 
@@ -61,43 +82,43 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
61
82
 
62
83
  ### Added
63
84
 
64
- - Add `encodeDelegation` and `decodeDelegation` utilities for encoding and decoding single delegations. ([#153](https://github.com/MetaMask/smart-accounts-kit/pull/153))
65
- - Add DelegationManager validation for EIP-7710 actions (#150) ([#150](https://github.com/metamask/smart-accounts-kit/pull/150))
85
+ - Add `encodeDelegation` and `decodeDelegation` utilities for encoding and decoding single delegations. ([#153](https://github.com/metamask/smart-accounts-kit/pull/153))
86
+ - Add DelegationManager validation for EIP-7710 actions ([#150](https://github.com/metamask/smart-accounts-kit/pull/150))
66
87
  - Support for Tempo Mainnet and Tempo Moderato Testnet ([#177](https://github.com/metamask/smart-accounts-kit/pull/177))
67
88
 
68
89
  ### Changed
69
90
 
70
- - Introduce `PermissionContext` to represent a delegation chain (ABI-encoded `Hex` or decoded `Delegation[]`). ([#140](https://github.com/MetaMask/smart-accounts-kit/pull/140))
91
+ - Introduce `PermissionContext` to represent a delegation chain (ABI-encoded `Hex` or decoded `Delegation[]`). ([#140](https://github.com/metamask/smart-accounts-kit/pull/140))
71
92
  - **Breaking**: Replace usages of raw `Hex` _or_ `Delegation[]` with `PermissionContext`, and rename `permissionsContext` to `permissionContext` (note the singular "permission") where applicable:
72
93
  - `SendTransactionWithDelegation`: `permissionsContext: Hex` → `permissionContext: PermissionContext`
73
94
  - `SendUserOperationWithDelegation`: within `calls: DelegatedCall`, `permissionsContext: Hex` → `permissionContext: PermissionContext`
74
95
  - `redeemDelegations`: parameter `Delegation[]` → `PermissionContext`
75
96
  - `encodeDelegations` and `decodeDelegations` now accept `PermissionContext` (if the input is already the expected type, the input is returned)
76
97
  - `encode`, `execute`, and `simulate` functions for `DelegationManager.redeemDelegations` from `@metamask/smart-accounts-kit/contracts`: parameter `delegations: Delegation[]` → `delegations: PermissionContext`
77
- - **Breaking**: ERC-7715 actions now return developer-friendly types: `chainId` as number, token amounts as `bigint`. ([#172](https://github.com/MetaMask/smart-accounts-kit/pull/172))
78
- - **Breaking**: Rename `getDelegationHashOffchain` to `hashDelegation` for improved clarity. ([#162](https://github.com/MetaMask/smart-accounts-kit/pull/162))
79
- - **Breaking**: EIP-7715 permission requests nest `isAdjustmentAllowed` inside each permission object per specification. ([#159](https://github.com/MetaMask/smart-accounts-kit/pull/159))
80
- - **Breaking**: `sendUserOperationWithDelegation` now accepts `dependencies` instead of deprecated `accountMetadata`. ([#157](https://github.com/MetaMask/smart-accounts-kit/pull/157))
81
- - **Breaking**: Validate that the provided `DelegationManager` address matches the known contract address for the chain in EIP-7710 actions. ([#156](https://github.com/MetaMask/smart-accounts-kit/pull/156))
82
- - **Breaking**: Default `delegation.salt` and `caveat.args` to `0x00` instead of invalid `0x`. ([#138](https://github.com/MetaMask/smart-accounts-kit/pull/138))
83
- - Allow scope type to be specified either as `ScopeType` enum, or string literal. ([#133](https://github.com/MetaMask/smart-accounts-kit/pull/133))
84
- - Allow caveat type to be specified either as `CaveatType` enum, or string literal. ([#179](https://github.com/MetaMask/smart-accounts-kit/pull/179))
98
+ - **Breaking**: ERC-7715 actions now return developer-friendly types: `chainId` as number, token amounts as `bigint`. ([#172](https://github.com/metamask/smart-accounts-kit/pull/172))
99
+ - **Breaking**: Rename `getDelegationHashOffchain` to `hashDelegation` for improved clarity. ([#162](https://github.com/metamask/smart-accounts-kit/pull/162))
100
+ - **Breaking**: EIP-7715 permission requests nest `isAdjustmentAllowed` inside each permission object per specification. ([#159](https://github.com/metamask/smart-accounts-kit/pull/159))
101
+ - **Breaking**: `sendUserOperationWithDelegation` now accepts `dependencies` instead of deprecated `accountMetadata`. ([#157](https://github.com/metamask/smart-accounts-kit/pull/157))
102
+ - **Breaking**: Validate that the provided `DelegationManager` address matches the known contract address for the chain in EIP-7710 actions. ([#156](https://github.com/metamask/smart-accounts-kit/pull/156))
103
+ - **Breaking**: Default `delegation.salt` and `caveat.args` to `0x00` instead of invalid `0x`. ([#138](https://github.com/metamask/smart-accounts-kit/pull/138))
104
+ - Allow scope type to be specified either as `ScopeType` enum, or string literal. ([#133](https://github.com/metamask/smart-accounts-kit/pull/133))
105
+ - Allow caveat type to be specified either as `CaveatType` enum, or string literal. ([#179](https://github.com/metamask/smart-accounts-kit/pull/179))
85
106
 
86
107
  ### Removed
87
108
 
88
- - **Breaking**: `encodePermissionContexts` and `decodePermissionContexts` utilities; use `encodeDelegations` and `decodeDelegations` directly. ([#148](https://github.com/MetaMask/smart-accounts-kit/pull/148))
89
- - **Breaking**: `redeemDelegations` helper and `Redemption` type; use `redeemDelegations` encoding / execution utilities directly. ([#160](https://github.com/MetaMask/smart-accounts-kit/pull/160))
109
+ - **Breaking**: `encodePermissionContexts` and `decodePermissionContexts` utilities; use `encodeDelegations` and `decodeDelegations` directly. ([#148](https://github.com/metamask/smart-accounts-kit/pull/148))
110
+ - **Breaking**: `redeemDelegations` helper and `Redemption` type; use `redeemDelegations` encoding / execution utilities directly. ([#160](https://github.com/metamask/smart-accounts-kit/pull/160))
90
111
 
91
112
  ### Fixed
92
113
 
93
- - Fix delegation storage to throw a proper `Error` instance so stack traces are correct across environments. ([#171](https://github.com/MetaMask/smart-accounts-kit/pull/171))
94
- - Fix `signDelegation` to correctly await the signer and return the signed signature. ([#168](https://github.com/MetaMask/smart-accounts-kit/pull/168))
114
+ - Fix delegation storage to throw a proper `Error` instance so stack traces are correct across environments. ([#171](https://github.com/metamask/smart-accounts-kit/pull/171))
115
+ - Fix `signDelegation` to correctly await the signer and return the signed signature. ([#168](https://github.com/metamask/smart-accounts-kit/pull/168))
95
116
 
96
117
  ## [0.4.0-beta.1]
97
118
 
98
119
  ### Added
99
120
 
100
- - Exports 2 new types: `PermissionRequestParameter` and `Erc7715Client` ([#134](https://github.com/MetaMask/smart-accounts-kit/pull/134))
121
+ - Exports 2 new types: `PermissionRequestParameter` and `Erc7715Client` ([#134](https://github.com/metamask/smart-accounts-kit/pull/134))
101
122
 
102
123
  ### Fixed
103
124
 
@@ -119,26 +140,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
119
140
 
120
141
  ### Fixed
121
142
 
122
- - **Breaking** `function-call` scope no longer allows native token value, unless explicitly configured ([#118](https://github.com/MetaMask/smart-accounts-kit/pull/118))
123
- - Add `typesVersions` to `package.json` so that subpath exports can be resolved for packages using `moduleResolution: node` ([#112](https://github.com/MetaMask/smart-accounts-kit/pull/112))
143
+ - **Breaking** `function-call` scope no longer allows native token value, unless explicitly configured ([#118](https://github.com/metamask/smart-accounts-kit/pull/118))
144
+ - Add `typesVersions` to `package.json` so that subpath exports can be resolved for packages using `moduleResolution: node` ([#112](https://github.com/metamask/smart-accounts-kit/pull/112))
124
145
 
125
146
  ## [0.2.0]
126
147
 
127
148
  ### Added
128
149
 
129
- - New permission type `erc20-token-revocation` to ERC-7715 actions ([#110](https://github.com/MetaMask/smart-accounts-kit/pull/110))
150
+ - New permission type `erc20-token-revocation` to ERC-7715 actions ([#110](https://github.com/metamask/smart-accounts-kit/pull/110))
130
151
 
131
152
  ### Fixed
132
153
 
133
- - Throw meaningful errors in validation of ERC-7715 request parameters ([#107](https://github.com/MetaMask/smart-accounts-kit/pull/107), [#103](https://github.com/MetaMask/smart-accounts-kit/pull/103))
154
+ - Throw meaningful errors in validation of ERC-7715 request parameters ([#107](https://github.com/metamask/smart-accounts-kit/pull/107), [#103](https://github.com/metamask/smart-accounts-kit/pull/103))
134
155
 
135
156
  ## [0.1.0]
136
157
 
137
158
  ### Changed
138
159
 
139
- - Promote readable permissions actions (`requestExecutionPermissions`, `sendTransactionWithDelegation`, and `sendUserOperationWithDelegation`) from experimental ([#91](https://github.com/MetaMask/smart-accounts-kit/pull/91))
160
+ - Promote readable permissions actions (`requestExecutionPermissions`, `sendTransactionWithDelegation`, and `sendUserOperationWithDelegation`) from experimental ([#91](https://github.com/metamask/smart-accounts-kit/pull/91))
140
161
 
141
- [Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.5.0...HEAD
162
+ [Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.6.0...HEAD
163
+ [1.6.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.5.0...@metamask/smart-accounts-kit@1.6.0
142
164
  [1.5.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.4.0...@metamask/smart-accounts-kit@1.5.0
143
165
  [1.4.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.3.0...@metamask/smart-accounts-kit@1.4.0
144
166
  [1.3.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.2.0...@metamask/smart-accounts-kit@1.3.0
@@ -18,11 +18,10 @@
18
18
 
19
19
 
20
20
 
21
- var _chunkXEOE25DEcjs = require('../chunk-XEOE25DE.cjs');
22
- require('../chunk-7FYDQNJ3.cjs');
23
- require('../chunk-SOFB2MXG.cjs');
24
- require('../chunk-MOHCTPYQ.cjs');
25
- require('../chunk-IBZSNB7D.cjs');
21
+ var _chunk2ZOWIAP3cjs = require('../chunk-2ZOWIAP3.cjs');
22
+ require('../chunk-PQPAEHJZ.cjs');
23
+ require('../chunk-2OS36DVV.cjs');
24
+ require('../chunk-W6HPAK4M.cjs');
26
25
 
27
26
 
28
27
 
@@ -43,5 +42,5 @@ require('../chunk-IBZSNB7D.cjs');
43
42
 
44
43
 
45
44
 
46
- exports.caveatEnforcerActions = _chunkXEOE25DEcjs.caveatEnforcerActions; exports.erc7710BundlerActions = _chunkXEOE25DEcjs.erc7710BundlerActions; exports.erc7710WalletActions = _chunkXEOE25DEcjs.erc7710WalletActions; exports.erc7715ProviderActions = _chunkXEOE25DEcjs.erc7715ProviderActions; exports.getErc20PeriodTransferEnforcerAvailableAmount = _chunkXEOE25DEcjs.getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = _chunkXEOE25DEcjs.getErc20StreamingEnforcerAvailableAmount; exports.getGrantedExecutionPermissions = _chunkXEOE25DEcjs.erc7715GetGrantedExecutionPermissionsAction; exports.getMultiTokenPeriodEnforcerAvailableAmount = _chunkXEOE25DEcjs.getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = _chunkXEOE25DEcjs.getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = _chunkXEOE25DEcjs.getNativeTokenStreamingEnforcerAvailableAmount; exports.getSupportedExecutionPermissions = _chunkXEOE25DEcjs.erc7715GetSupportedExecutionPermissionsAction; exports.isValid7702Implementation = _chunkXEOE25DEcjs.isValid7702Implementation; exports.redelegatePermissionContextAction = _chunkXEOE25DEcjs.redelegatePermissionContextAction; exports.redelegatePermissionContextOpenAction = _chunkXEOE25DEcjs.redelegatePermissionContextOpenAction; exports.requestExecutionPermissions = _chunkXEOE25DEcjs.erc7715RequestExecutionPermissionsAction; exports.signDelegation = _chunkXEOE25DEcjs.signDelegation; exports.signDelegationActions = _chunkXEOE25DEcjs.signDelegationActions; exports.signUserOperation = _chunkXEOE25DEcjs.signUserOperation; exports.signUserOperationActions = _chunkXEOE25DEcjs.signUserOperationActions;
45
+ exports.caveatEnforcerActions = _chunk2ZOWIAP3cjs.caveatEnforcerActions; exports.erc7710BundlerActions = _chunk2ZOWIAP3cjs.erc7710BundlerActions; exports.erc7710WalletActions = _chunk2ZOWIAP3cjs.erc7710WalletActions; exports.erc7715ProviderActions = _chunk2ZOWIAP3cjs.erc7715ProviderActions; exports.getErc20PeriodTransferEnforcerAvailableAmount = _chunk2ZOWIAP3cjs.getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = _chunk2ZOWIAP3cjs.getErc20StreamingEnforcerAvailableAmount; exports.getGrantedExecutionPermissions = _chunk2ZOWIAP3cjs.erc7715GetGrantedExecutionPermissionsAction; exports.getMultiTokenPeriodEnforcerAvailableAmount = _chunk2ZOWIAP3cjs.getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = _chunk2ZOWIAP3cjs.getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = _chunk2ZOWIAP3cjs.getNativeTokenStreamingEnforcerAvailableAmount; exports.getSupportedExecutionPermissions = _chunk2ZOWIAP3cjs.erc7715GetSupportedExecutionPermissionsAction; exports.isValid7702Implementation = _chunk2ZOWIAP3cjs.isValid7702Implementation; exports.redelegatePermissionContextAction = _chunk2ZOWIAP3cjs.redelegatePermissionContextAction; exports.redelegatePermissionContextOpenAction = _chunk2ZOWIAP3cjs.redelegatePermissionContextOpenAction; exports.requestExecutionPermissions = _chunk2ZOWIAP3cjs.erc7715RequestExecutionPermissionsAction; exports.signDelegation = _chunk2ZOWIAP3cjs.signDelegation; exports.signDelegationActions = _chunk2ZOWIAP3cjs.signDelegationActions; exports.signUserOperation = _chunk2ZOWIAP3cjs.signUserOperation; exports.signUserOperationActions = _chunk2ZOWIAP3cjs.signUserOperationActions;
47
46
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/actions/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,muDAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/actions/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/actions/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,muDAAC","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/actions/index.cjs"}
@@ -1,10 +1,10 @@
1
- export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7710WalletClient, f as Erc7715Client, G as GetGrantedExecutionPermissionsResult, g as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, h as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, j as NativeTokenPeriodicPermission, k as NativeTokenStreamPermission, P as PeriodTransferResult, l as PermissionRequestParameter, m as PermissionTypes, R as RedelegatePermissionContextOpenParameters, n as RedelegatePermissionContextParameters, o as RedelegatePermissionContextReturnType, p as RequestExecutionPermissionsParameters, q as RequestExecutionPermissionsReturnType, r as RpcGetGrantedExecutionPermissionsResult, s as RpcGetSupportedExecutionPermissionsResult, t as RpcSupportedPermissionInfo, S as SignDelegationParameters, u as SignDelegationReturnType, v as SignUserOperationParameters, w as SignUserOperationReturnType, x as StreamingResult, y as SupportedPermissionInfo, c as caveatEnforcerActions, z as erc7710BundlerActions, A as erc7710WalletActions, B as erc7715ProviderActions, F as getErc20PeriodTransferEnforcerAvailableAmount, H as getErc20StreamingEnforcerAvailableAmount, I as getGrantedExecutionPermissions, J as getMultiTokenPeriodEnforcerAvailableAmount, K as getNativeTokenPeriodTransferEnforcerAvailableAmount, L as getNativeTokenStreamingEnforcerAvailableAmount, O as getSupportedExecutionPermissions, Q as isValid7702Implementation, T as redelegatePermissionContextAction, U as redelegatePermissionContextOpenAction, V as requestExecutionPermissions, W as signDelegation, X as signDelegationActions, Y as signUserOperation, Z as signUserOperationActions } from '../index-DfDAuvr5.cjs';
1
+ export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7710WalletClient, f as Erc7715Client, G as GetGrantedExecutionPermissionsResult, g as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, h as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, j as NativeTokenPeriodicPermission, k as NativeTokenStreamPermission, P as PeriodTransferResult, l as PermissionRequestParameter, m as PermissionTypes, R as RedelegatePermissionContextOpenParameters, n as RedelegatePermissionContextParameters, o as RedelegatePermissionContextReturnType, p as RequestExecutionPermissionsParameters, q as RequestExecutionPermissionsReturnType, r as RpcGetGrantedExecutionPermissionsResult, s as RpcGetSupportedExecutionPermissionsResult, t as RpcSupportedPermissionInfo, S as SignDelegationParameters, u as SignDelegationReturnType, v as SignUserOperationParameters, w as SignUserOperationReturnType, x as StreamingResult, y as SupportedPermissionInfo, T as TokenApprovalRevocationPermission, c as caveatEnforcerActions, z as erc7710BundlerActions, A as erc7710WalletActions, B as erc7715ProviderActions, F as getErc20PeriodTransferEnforcerAvailableAmount, H as getErc20StreamingEnforcerAvailableAmount, I as getGrantedExecutionPermissions, J as getMultiTokenPeriodEnforcerAvailableAmount, K as getNativeTokenPeriodTransferEnforcerAvailableAmount, L as getNativeTokenStreamingEnforcerAvailableAmount, O as getSupportedExecutionPermissions, Q as isValid7702Implementation, U as redelegatePermissionContextAction, V as redelegatePermissionContextOpenAction, W as requestExecutionPermissions, X as signDelegation, Y as signDelegationActions, Z as signUserOperation, _ as signUserOperationActions } from '../index-X7Qn3JTg.cjs';
2
2
  import 'viem';
3
3
  export { Rule } from '@metamask/7715-permission-types';
4
- import '../types-BWaH4KH1.cjs';
4
+ import '../resolveCaveats-A9xC29l8.cjs';
5
5
  import '@metamask/delegation-abis';
6
6
  import 'viem/account-abstraction';
7
7
  import 'viem/chains';
8
- import '../resolveCaveats-DiqGB-T5.cjs';
9
8
  import '@metamask/delegation-core';
9
+ import '../index-B1Cmezvh.cjs';
10
10
  import '../userOp-DKgjzz7B.cjs';
@@ -1,10 +1,10 @@
1
- export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7710WalletClient, f as Erc7715Client, G as GetGrantedExecutionPermissionsResult, g as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, h as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, j as NativeTokenPeriodicPermission, k as NativeTokenStreamPermission, P as PeriodTransferResult, l as PermissionRequestParameter, m as PermissionTypes, R as RedelegatePermissionContextOpenParameters, n as RedelegatePermissionContextParameters, o as RedelegatePermissionContextReturnType, p as RequestExecutionPermissionsParameters, q as RequestExecutionPermissionsReturnType, r as RpcGetGrantedExecutionPermissionsResult, s as RpcGetSupportedExecutionPermissionsResult, t as RpcSupportedPermissionInfo, S as SignDelegationParameters, u as SignDelegationReturnType, v as SignUserOperationParameters, w as SignUserOperationReturnType, x as StreamingResult, y as SupportedPermissionInfo, c as caveatEnforcerActions, z as erc7710BundlerActions, A as erc7710WalletActions, B as erc7715ProviderActions, F as getErc20PeriodTransferEnforcerAvailableAmount, H as getErc20StreamingEnforcerAvailableAmount, I as getGrantedExecutionPermissions, J as getMultiTokenPeriodEnforcerAvailableAmount, K as getNativeTokenPeriodTransferEnforcerAvailableAmount, L as getNativeTokenStreamingEnforcerAvailableAmount, O as getSupportedExecutionPermissions, Q as isValid7702Implementation, T as redelegatePermissionContextAction, U as redelegatePermissionContextOpenAction, V as requestExecutionPermissions, W as signDelegation, X as signDelegationActions, Y as signUserOperation, Z as signUserOperationActions } from '../index-G78z6nwi.js';
1
+ export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7710WalletClient, f as Erc7715Client, G as GetGrantedExecutionPermissionsResult, g as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, h as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, j as NativeTokenPeriodicPermission, k as NativeTokenStreamPermission, P as PeriodTransferResult, l as PermissionRequestParameter, m as PermissionTypes, R as RedelegatePermissionContextOpenParameters, n as RedelegatePermissionContextParameters, o as RedelegatePermissionContextReturnType, p as RequestExecutionPermissionsParameters, q as RequestExecutionPermissionsReturnType, r as RpcGetGrantedExecutionPermissionsResult, s as RpcGetSupportedExecutionPermissionsResult, t as RpcSupportedPermissionInfo, S as SignDelegationParameters, u as SignDelegationReturnType, v as SignUserOperationParameters, w as SignUserOperationReturnType, x as StreamingResult, y as SupportedPermissionInfo, T as TokenApprovalRevocationPermission, c as caveatEnforcerActions, z as erc7710BundlerActions, A as erc7710WalletActions, B as erc7715ProviderActions, F as getErc20PeriodTransferEnforcerAvailableAmount, H as getErc20StreamingEnforcerAvailableAmount, I as getGrantedExecutionPermissions, J as getMultiTokenPeriodEnforcerAvailableAmount, K as getNativeTokenPeriodTransferEnforcerAvailableAmount, L as getNativeTokenStreamingEnforcerAvailableAmount, O as getSupportedExecutionPermissions, Q as isValid7702Implementation, U as redelegatePermissionContextAction, V as redelegatePermissionContextOpenAction, W as requestExecutionPermissions, X as signDelegation, Y as signDelegationActions, Z as signUserOperation, _ as signUserOperationActions } from '../index-DUJmm8Wz.js';
2
2
  import 'viem';
3
3
  export { Rule } from '@metamask/7715-permission-types';
4
- import '../types-BWaH4KH1.js';
4
+ import '../resolveCaveats-A9xC29l8.js';
5
5
  import '@metamask/delegation-abis';
6
6
  import 'viem/account-abstraction';
7
7
  import 'viem/chains';
8
- import '../resolveCaveats-s2snaFEo.js';
9
8
  import '@metamask/delegation-core';
9
+ import '../index-LqiEgBjV.js';
10
10
  import '../userOp-DKgjzz7B.js';
@@ -18,11 +18,10 @@ import {
18
18
  signDelegationActions,
19
19
  signUserOperation,
20
20
  signUserOperationActions
21
- } from "../chunk-BGOSYTKV.mjs";
22
- import "../chunk-N66VAWMO.mjs";
23
- import "../chunk-QCULIK3O.mjs";
24
- import "../chunk-4QXIOE7F.mjs";
25
- import "../chunk-MV2KHN75.mjs";
21
+ } from "../chunk-AZYTTGON.mjs";
22
+ import "../chunk-K7GTZGKJ.mjs";
23
+ import "../chunk-GMGJRC3D.mjs";
24
+ import "../chunk-TNGQTVSY.mjs";
26
25
  export {
27
26
  caveatEnforcerActions,
28
27
  erc7710BundlerActions,
@@ -1,6 +1,5 @@
1
1
  import { WalletClient, PublicClient, Chain, Hex } from 'viem';
2
- import { S as SmartAccountsEnvironment, C as Caveat } from './types-BWaH4KH1.js';
3
- import { l as CoreCaveatConfiguration } from './resolveCaveats-s2snaFEo.js';
2
+ import { S as SmartAccountsEnvironment, C as Caveat, z as CoreCaveatConfiguration } from './resolveCaveats-A9xC29l8.js';
4
3
 
5
4
  type SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';
6
5
  declare const PREFERRED_VERSION: SupportedVersion;
@@ -1,6 +1,5 @@
1
1
  import { WalletClient, PublicClient, Chain, Hex } from 'viem';
2
- import { S as SmartAccountsEnvironment, C as Caveat } from './types-BWaH4KH1.cjs';
3
- import { l as CoreCaveatConfiguration } from './resolveCaveats-DiqGB-T5.cjs';
2
+ import { S as SmartAccountsEnvironment, C as Caveat, z as CoreCaveatConfiguration } from './resolveCaveats-A9xC29l8.cjs';
4
3
 
5
4
  type SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';
6
5
  declare const PREFERRED_VERSION: SupportedVersion;
@@ -36,6 +36,7 @@
36
36
 
37
37
 
38
38
 
39
+
39
40
 
40
41
 
41
42
  var _delegationabis = require('@metamask/delegation-abis');
@@ -76,6 +77,7 @@ var _delegationabis = require('@metamask/delegation-abis');
76
77
 
77
78
 
78
79
 
80
+
79
81
 
80
82
 
81
83
  var _bytecode = require('@metamask/delegation-abis/bytecode');
@@ -141,6 +143,7 @@ function getSmartAccountsEnvironmentV1(contracts) {
141
143
  AllowedCalldataEnforcer: contracts.AllowedCalldataEnforcer,
142
144
  AllowedMethodsEnforcer: contracts.AllowedMethodsEnforcer,
143
145
  AllowedTargetsEnforcer: contracts.AllowedTargetsEnforcer,
146
+ ApprovalRevocationEnforcer: contracts.ApprovalRevocationEnforcer,
144
147
  ArgsEqualityCheckEnforcer: contracts.ArgsEqualityCheckEnforcer,
145
148
  BlockNumberEnforcer: contracts.BlockNumberEnforcer,
146
149
  DeployedEnforcer: contracts.DeployedEnforcer,
@@ -210,6 +213,10 @@ async function deploySmartAccountsEnvironment(walletClient, publicClient, chain,
210
213
  abi: _delegationabis.AllowedMethodsEnforcer,
211
214
  bytecode: _bytecode.AllowedMethodsEnforcer
212
215
  },
216
+ ApprovalRevocationEnforcer: {
217
+ abi: _delegationabis.ApprovalRevocationEnforcer,
218
+ bytecode: _bytecode.ApprovalRevocationEnforcer
219
+ },
213
220
  ArgsEqualityCheckEnforcer: {
214
221
  abi: _delegationabis.ArgsEqualityCheckEnforcer,
215
222
  bytecode: _bytecode.ArgsEqualityCheckEnforcer
@@ -447,4 +454,4 @@ var signUserOperation = async ({
447
454
 
448
455
 
449
456
  exports.PREFERRED_VERSION = PREFERRED_VERSION; exports.overrideDeployedEnvironment = overrideDeployedEnvironment; exports.getSmartAccountsEnvironment = getSmartAccountsEnvironment; exports.deploySmartAccountsEnvironment = deploySmartAccountsEnvironment; exports.SIGNABLE_USER_OP_TYPED_DATA = SIGNABLE_USER_OP_TYPED_DATA; exports.prepareSignUserOperationTypedData = prepareSignUserOperationTypedData; exports.signUserOperation = signUserOperation;
450
- //# sourceMappingURL=chunk-SOFB2MXG.cjs.map
457
+ //# sourceMappingURL=chunk-2OS36DVV.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-2OS36DVV.cjs","../src/smartAccountsEnvironment.ts","../src/write.ts","../src/userOp.ts"],"names":["SimpleFactory"],"mappings":"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","file":"/home/runner/work/smart-accounts-kit/smart-accounts-kit/packages/smart-accounts-kit/dist/chunk-2OS36DVV.cjs","sourcesContent":[null,"import {\n EntryPoint,\n SimpleFactory,\n DelegationManager,\n MultiSigDeleGator,\n HybridDeleGator,\n EIP7702StatelessDeleGator,\n SCL_RIP7212,\n AllowedTargetsEnforcer,\n AllowedMethodsEnforcer,\n ApprovalRevocationEnforcer,\n DeployedEnforcer,\n TimestampEnforcer,\n NonceEnforcer,\n AllowedCalldataEnforcer,\n BlockNumberEnforcer,\n LimitedCallsEnforcer,\n ERC20BalanceChangeEnforcer,\n ERC20StreamingEnforcer,\n IdEnforcer,\n ERC20TransferAmountEnforcer,\n ValueLteEnforcer,\n NativeTokenTransferAmountEnforcer,\n NativeBalanceChangeEnforcer,\n NativeTokenStreamingEnforcer,\n NativeTokenPaymentEnforcer,\n RedeemerEnforcer,\n ArgsEqualityCheckEnforcer,\n ERC721BalanceChangeEnforcer,\n ERC721TransferEnforcer,\n ERC1155BalanceChangeEnforcer,\n OwnershipTransferEnforcer,\n SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer,\n NativeTokenPeriodTransferEnforcer,\n ExactCalldataBatchEnforcer,\n ExactCalldataEnforcer,\n ExactExecutionEnforcer,\n ExactExecutionBatchEnforcer,\n MultiTokenPeriodEnforcer,\n} from '@metamask/delegation-abis';\nimport {\n EntryPoint as EntryPointBytecode,\n SimpleFactory as SimpleFactoryBytecode,\n DelegationManager as DelegationManagerBytecode,\n MultiSigDeleGator as MultiSigDeleGatorBytecode,\n HybridDeleGator as HybridDeleGatorBytecode,\n EIP7702StatelessDeleGator as EIP7702StatelessDeleGatorBytecode,\n SCL_RIP7212 as SCLRIP7212Bytecode,\n AllowedTargetsEnforcer as AllowedTargetsEnforcerBytecode,\n AllowedMethodsEnforcer as AllowedMethodsEnforcerBytecode,\n ApprovalRevocationEnforcer as ApprovalRevocationEnforcerBytecode,\n DeployedEnforcer as DeployedEnforcerBytecode,\n TimestampEnforcer as TimestampEnforcerBytecode,\n NonceEnforcer as NonceEnforcerBytecode,\n AllowedCalldataEnforcer as AllowedCalldataEnforcerBytecode,\n BlockNumberEnforcer as BlockNumberEnforcerBytecode,\n LimitedCallsEnforcer as LimitedCallsEnforcerBytecode,\n ERC20BalanceChangeEnforcer as ERC20BalanceChangeEnforcerBytecode,\n ERC20StreamingEnforcer as ERC20StreamingEnforcerBytecode,\n IdEnforcer as IdEnforcerBytecode,\n ERC20TransferAmountEnforcer as ERC20TransferAmountEnforcerBytecode,\n ValueLteEnforcer as ValueLteEnforcerBytecode,\n NativeTokenTransferAmountEnforcer as NativeTokenTransferAmountEnforcerBytecode,\n NativeBalanceChangeEnforcer as NativeBalanceChangeEnforcerBytecode,\n NativeTokenStreamingEnforcer as NativeTokenStreamingEnforcerBytecode,\n NativeTokenPaymentEnforcer as NativeTokenPaymentEnforcerBytecode,\n RedeemerEnforcer as RedeemerEnforcerBytecode,\n ArgsEqualityCheckEnforcer as ArgsEqualityCheckEnforcerBytecode,\n ERC721BalanceChangeEnforcer as ERC721BalanceChangeEnforcerBytecode,\n ERC721TransferEnforcer as ERC721TransferEnforcerBytecode,\n ERC1155BalanceChangeEnforcer as ERC1155BalanceChangeEnforcerBytecode,\n OwnershipTransferEnforcer as OwnershipTransferEnforcerBytecode,\n SpecificActionERC20TransferBatchEnforcer as SpecificActionERC20TransferBatchEnforcerBytecode,\n ERC20PeriodTransferEnforcer as ERC20PeriodTransferEnforcerBytecode,\n NativeTokenPeriodTransferEnforcer as NativeTokenPeriodTransferEnforcerBytecode,\n ExactCalldataBatchEnforcer as ExactCalldataBatchEnforcerBytecode,\n ExactCalldataEnforcer as ExactCalldataEnforcerBytecode,\n ExactExecutionEnforcer as ExactExecutionEnforcerBytecode,\n ExactExecutionBatchEnforcer as ExactExecutionBatchEnforcerBytecode,\n MultiTokenPeriodEnforcer as MultiTokenPeriodEnforcerBytecode,\n} from '@metamask/delegation-abis/bytecode';\nimport { DELEGATOR_CONTRACTS } from '@metamask/delegation-deployments';\nimport type { Chain, Hex, PublicClient, WalletClient } from 'viem';\n\nimport type { ContractMetaData, SmartAccountsEnvironment } from './types';\nimport { deployContract } from './write';\n\ntype SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';\nexport const PREFERRED_VERSION: SupportedVersion = '1.3.0';\n\nconst contractOverrideMap: Map<string, SmartAccountsEnvironment> = new Map();\n\nconst getContractOverrideKey = (chainId: number, version: SupportedVersion) =>\n `${version}:${chainId}`;\n\n/**\n * Overrides the default environment for a specific chain and version.\n *\n * @param chainId - The chain ID to override.\n * @param version - The version of the environment to override.\n * @param environment - The environment to use as override.\n */\nexport function overrideDeployedEnvironment(\n chainId: number,\n version: SupportedVersion,\n environment: SmartAccountsEnvironment,\n) {\n contractOverrideMap.set(\n getContractOverrideKey(chainId, version),\n environment,\n );\n}\n\n/**\n * Gets the SmartAccountsEnvironment for the specified chain and version.\n *\n * @param chainId - The chain ID to get the environment for.\n * @param version - The version of the environment to get.\n * @returns The SmartAccountsEnvironment.\n */\nexport function getSmartAccountsEnvironment(\n chainId: number,\n version: SupportedVersion = PREFERRED_VERSION,\n): SmartAccountsEnvironment {\n const overrideKey = getContractOverrideKey(chainId, version);\n\n const overriddenContracts = contractOverrideMap.get(overrideKey);\n if (overriddenContracts) {\n return overriddenContracts;\n }\n\n const contracts = DELEGATOR_CONTRACTS[version]?.[chainId];\n if (!contracts) {\n throw new Error(\n `No contracts found for version ${version} chain ${chainId}`,\n );\n }\n return getSmartAccountsEnvironmentV1(contracts);\n}\n\n/**\n * Creates a SmartAccountsEnvironment from contract addresses.\n *\n * @param contracts - The contract addresses to create the environment from.\n * @returns The created SmartAccountsEnvironment.\n */\nexport function getSmartAccountsEnvironmentV1(contracts: {\n [contract: string]: Hex;\n}) {\n return {\n DelegationManager: contracts.DelegationManager,\n EntryPoint: contracts.EntryPoint,\n SimpleFactory: contracts.SimpleFactory,\n implementations: {\n MultiSigDeleGatorImpl: contracts.MultiSigDeleGatorImpl,\n HybridDeleGatorImpl: contracts.HybridDeleGatorImpl,\n EIP7702StatelessDeleGatorImpl: contracts.EIP7702StatelessDeleGatorImpl,\n },\n caveatEnforcers: {\n AllowedCalldataEnforcer: contracts.AllowedCalldataEnforcer,\n AllowedMethodsEnforcer: contracts.AllowedMethodsEnforcer,\n AllowedTargetsEnforcer: contracts.AllowedTargetsEnforcer,\n ApprovalRevocationEnforcer: contracts.ApprovalRevocationEnforcer,\n ArgsEqualityCheckEnforcer: contracts.ArgsEqualityCheckEnforcer,\n BlockNumberEnforcer: contracts.BlockNumberEnforcer,\n DeployedEnforcer: contracts.DeployedEnforcer,\n ERC20BalanceChangeEnforcer: contracts.ERC20BalanceChangeEnforcer,\n ERC20TransferAmountEnforcer: contracts.ERC20TransferAmountEnforcer,\n ERC20StreamingEnforcer: contracts.ERC20StreamingEnforcer,\n ERC721BalanceChangeEnforcer: contracts.ERC721BalanceChangeEnforcer,\n ERC721TransferEnforcer: contracts.ERC721TransferEnforcer,\n ERC1155BalanceChangeEnforcer: contracts.ERC1155BalanceChangeEnforcer,\n IdEnforcer: contracts.IdEnforcer,\n LimitedCallsEnforcer: contracts.LimitedCallsEnforcer,\n NonceEnforcer: contracts.NonceEnforcer,\n TimestampEnforcer: contracts.TimestampEnforcer,\n ValueLteEnforcer: contracts.ValueLteEnforcer,\n NativeTokenTransferAmountEnforcer:\n contracts.NativeTokenTransferAmountEnforcer,\n NativeBalanceChangeEnforcer: contracts.NativeBalanceChangeEnforcer,\n NativeTokenStreamingEnforcer: contracts.NativeTokenStreamingEnforcer,\n NativeTokenPaymentEnforcer: contracts.NativeTokenPaymentEnforcer,\n OwnershipTransferEnforcer: contracts.OwnershipTransferEnforcer,\n RedeemerEnforcer: contracts.RedeemerEnforcer,\n SpecificActionERC20TransferBatchEnforcer:\n contracts.SpecificActionERC20TransferBatchEnforcer,\n ERC20PeriodTransferEnforcer: contracts.ERC20PeriodTransferEnforcer,\n NativeTokenPeriodTransferEnforcer:\n contracts.NativeTokenPeriodTransferEnforcer,\n ExactCalldataBatchEnforcer: contracts.ExactCalldataBatchEnforcer,\n ExactCalldataEnforcer: contracts.ExactCalldataEnforcer,\n ExactExecutionEnforcer: contracts.ExactExecutionEnforcer,\n ExactExecutionBatchEnforcer: contracts.ExactExecutionBatchEnforcer,\n MultiTokenPeriodEnforcer: contracts.MultiTokenPeriodEnforcer,\n },\n } as SmartAccountsEnvironment;\n}\n\nexport type DeployedContract = {\n name: string;\n address: string;\n};\n\n/**\n * Deploys the contracts needed for the Delegation Framework and MetaMask SCA to be functional as well as all Caveat Enforcers.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for deployment.\n * @param chain - The chain to deploy to.\n * @param deployedContracts - Optional map of already deployed contracts.\n * @returns A promise that resolves to the SmartAccountsEnvironment.\n */\nexport async function deploySmartAccountsEnvironment(\n walletClient: WalletClient,\n publicClient: PublicClient,\n chain: Chain,\n deployedContracts: { [contract: string]: Hex } = {},\n) {\n const deployContractCurried = async (\n name: string,\n contract: ContractMetaData,\n params: any[] = [],\n ) => {\n const existingAddress = deployedContracts[name];\n if (existingAddress) {\n return {\n address: existingAddress,\n name,\n };\n }\n\n const deployedContract = await deployContract(\n walletClient,\n publicClient,\n chain,\n contract,\n params,\n );\n\n const newDeployedContracts = { ...deployedContracts };\n newDeployedContracts[name] = deployedContract.address;\n Object.assign(deployedContracts, newDeployedContracts);\n\n return { ...deployedContract, name };\n };\n\n // Deploy v1.3.0 DeleGator contracts\n // - deploy standalone contracts\n const standaloneContracts = {\n SimpleFactory: {\n abi: SimpleFactory,\n bytecode: SimpleFactoryBytecode,\n },\n AllowedCalldataEnforcer: {\n abi: AllowedCalldataEnforcer,\n bytecode: AllowedCalldataEnforcerBytecode,\n },\n AllowedTargetsEnforcer: {\n abi: AllowedTargetsEnforcer,\n bytecode: AllowedTargetsEnforcerBytecode,\n },\n AllowedMethodsEnforcer: {\n abi: AllowedMethodsEnforcer,\n bytecode: AllowedMethodsEnforcerBytecode,\n },\n ApprovalRevocationEnforcer: {\n abi: ApprovalRevocationEnforcer,\n bytecode: ApprovalRevocationEnforcerBytecode,\n },\n ArgsEqualityCheckEnforcer: {\n abi: ArgsEqualityCheckEnforcer,\n bytecode: ArgsEqualityCheckEnforcerBytecode,\n },\n DeployedEnforcer: {\n abi: DeployedEnforcer,\n bytecode: DeployedEnforcerBytecode,\n },\n TimestampEnforcer: {\n abi: TimestampEnforcer,\n bytecode: TimestampEnforcerBytecode,\n },\n BlockNumberEnforcer: {\n abi: BlockNumberEnforcer,\n bytecode: BlockNumberEnforcerBytecode,\n },\n LimitedCallsEnforcer: {\n abi: LimitedCallsEnforcer,\n bytecode: LimitedCallsEnforcerBytecode,\n },\n ERC20BalanceChangeEnforcer: {\n abi: ERC20BalanceChangeEnforcer,\n bytecode: ERC20BalanceChangeEnforcerBytecode,\n },\n ERC20TransferAmountEnforcer: {\n abi: ERC20TransferAmountEnforcer,\n bytecode: ERC20TransferAmountEnforcerBytecode,\n },\n ERC20StreamingEnforcer: {\n abi: ERC20StreamingEnforcer,\n bytecode: ERC20StreamingEnforcerBytecode,\n },\n ERC721BalanceChangeEnforcer: {\n abi: ERC721BalanceChangeEnforcer,\n bytecode: ERC721BalanceChangeEnforcerBytecode,\n },\n ERC721TransferEnforcer: {\n abi: ERC721TransferEnforcer,\n bytecode: ERC721TransferEnforcerBytecode,\n },\n ERC1155BalanceChangeEnforcer: {\n abi: ERC1155BalanceChangeEnforcer,\n bytecode: ERC1155BalanceChangeEnforcerBytecode,\n },\n IdEnforcer: { abi: IdEnforcer, bytecode: IdEnforcerBytecode },\n NonceEnforcer: {\n abi: NonceEnforcer,\n bytecode: NonceEnforcerBytecode,\n },\n ValueLteEnforcer: {\n abi: ValueLteEnforcer,\n bytecode: ValueLteEnforcerBytecode,\n },\n NativeTokenTransferAmountEnforcer: {\n abi: NativeTokenTransferAmountEnforcer,\n bytecode: NativeTokenTransferAmountEnforcerBytecode,\n },\n NativeBalanceChangeEnforcer: {\n abi: NativeBalanceChangeEnforcer,\n bytecode: NativeBalanceChangeEnforcerBytecode,\n },\n NativeTokenStreamingEnforcer: {\n abi: NativeTokenStreamingEnforcer,\n bytecode: NativeTokenStreamingEnforcerBytecode,\n },\n OwnershipTransferEnforcer: {\n abi: OwnershipTransferEnforcer,\n bytecode: OwnershipTransferEnforcerBytecode,\n },\n RedeemerEnforcer: {\n abi: RedeemerEnforcer,\n bytecode: RedeemerEnforcerBytecode,\n },\n SpecificActionERC20TransferBatchEnforcer: {\n abi: SpecificActionERC20TransferBatchEnforcer,\n bytecode: SpecificActionERC20TransferBatchEnforcerBytecode,\n },\n ERC20PeriodTransferEnforcer: {\n abi: ERC20PeriodTransferEnforcer,\n bytecode: ERC20PeriodTransferEnforcerBytecode,\n },\n NativeTokenPeriodTransferEnforcer: {\n abi: NativeTokenPeriodTransferEnforcer,\n bytecode: NativeTokenPeriodTransferEnforcerBytecode,\n },\n ExactCalldataBatchEnforcer: {\n abi: ExactCalldataBatchEnforcer,\n bytecode: ExactCalldataBatchEnforcerBytecode,\n },\n ExactCalldataEnforcer: {\n abi: ExactCalldataEnforcer,\n bytecode: ExactCalldataEnforcerBytecode,\n },\n ExactExecutionEnforcer: {\n abi: ExactExecutionEnforcer,\n bytecode: ExactExecutionEnforcerBytecode,\n },\n ExactExecutionBatchEnforcer: {\n abi: ExactExecutionBatchEnforcer,\n bytecode: ExactExecutionBatchEnforcerBytecode,\n },\n MultiTokenPeriodEnforcer: {\n abi: MultiTokenPeriodEnforcer,\n bytecode: MultiTokenPeriodEnforcerBytecode,\n },\n };\n for (const [name, contract] of Object.entries(standaloneContracts)) {\n await deployContractCurried(name, contract);\n }\n\n // - deploy dependencies\n const delegationManager = await deployContractCurried(\n 'DelegationManager',\n { abi: DelegationManager, bytecode: DelegationManagerBytecode },\n [walletClient.account?.address],\n );\n\n // - NativeTokenPaymentEnforcer DelegationManager and ArgsEqualityCheckEnforcer as constructor args\n await deployContractCurried(\n 'NativeTokenPaymentEnforcer',\n {\n abi: NativeTokenPaymentEnforcer,\n bytecode: NativeTokenPaymentEnforcerBytecode,\n },\n [delegationManager.address, deployedContracts.ArgsEqualityCheckEnforcer],\n );\n\n const entryPoint = await deployContractCurried('EntryPoint', {\n abi: EntryPoint,\n bytecode: EntryPointBytecode,\n });\n\n // This is a hack to work around the SCL_RIP7212 being deployed as a library.\n // Forge handles this gracefully, but in the tests we need to manually link\n // the library.\n // We don't use the curried function here because we don't need it added to\n // the environment.\n const { address: sclRIP7212 } = await deployContract(\n walletClient,\n publicClient,\n chain,\n { abi: SCL_RIP7212, bytecode: SCLRIP7212Bytecode },\n [],\n );\n\n // replace linked library address in bytecode https://docs.soliditylang.org/en/latest/using-the-compiler.html#library-linking\n const hybridDeleGatorWithLinkedLibrary = {\n abi: HybridDeleGator,\n bytecode: HybridDeleGatorBytecode.replace(\n /__\\$b8f96b288d4d0429e38b8ed50fd423070f\\$__/gu,\n sclRIP7212.slice(2),\n ) as Hex,\n };\n\n // - deploy DeleGator implementations\n await deployContractCurried(\n 'HybridDeleGatorImpl',\n hybridDeleGatorWithLinkedLibrary,\n [delegationManager.address, entryPoint.address],\n );\n\n await deployContractCurried(\n 'MultiSigDeleGatorImpl',\n {\n abi: MultiSigDeleGator,\n bytecode: MultiSigDeleGatorBytecode,\n },\n [delegationManager.address, entryPoint.address],\n );\n\n await deployContractCurried(\n 'EIP7702StatelessDeleGatorImpl',\n {\n abi: EIP7702StatelessDeleGator,\n bytecode: EIP7702StatelessDeleGatorBytecode,\n },\n [delegationManager.address, entryPoint.address],\n );\n\n // Format deployments\n return getSmartAccountsEnvironmentV1(deployedContracts);\n}\n","import { SimpleFactory } from '@metamask/delegation-abis';\nimport type { Address, Chain, Hex, PublicClient, WalletClient } from 'viem';\n\nimport type { ContractMetaData } from './types';\n\n/**\n * Deploys a contract using the SimpleFactory contract.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for simulation.\n * @param simpleFactoryAddress - The address of the SimpleFactory contract.\n * @param creationCode - The creation code for the contract to deploy.\n * @param salt - The salt to use for deterministic deployment.\n * @returns The transaction hash of the deployment.\n */\nexport const deployWithSimpleFactory = async (\n walletClient: WalletClient,\n publicClient: PublicClient,\n simpleFactoryAddress: Address,\n creationCode: Hex,\n salt: Hex,\n) => {\n const { request } = await publicClient.simulateContract({\n account: walletClient.account,\n address: simpleFactoryAddress,\n abi: SimpleFactory,\n functionName: 'deploy',\n args: [creationCode, salt],\n });\n return await walletClient.writeContract(request);\n};\n\n/**\n * Deploys a contract to the blockchain.\n *\n * @param walletClient - The wallet client to use for deployment.\n * @param publicClient - The public client to use for transaction receipt.\n * @param chain - The chain to deploy on.\n * @param contractMetadata - The metadata of the contract to deploy.\n * @param contractMetadata.bytecode - The bytecode of the contract to deploy.\n * @param contractMetadata.abi - The ABI of the contract to deploy.\n * @param args - The constructor arguments for the contract.\n * @returns An object containing the deployed contract address, transaction hash, and receipt.\n */\nexport async function deployContract(\n walletClient: WalletClient,\n publicClient: PublicClient,\n chain: Chain,\n { bytecode, abi }: ContractMetaData,\n args: any[] = [],\n) {\n if (!walletClient.account) {\n throw new Error('Wallet client account is required');\n }\n\n const hash = await walletClient.deployContract({\n abi,\n bytecode,\n args,\n account: walletClient.account,\n chain,\n });\n\n const receipt = await publicClient.waitForTransactionReceipt({\n hash,\n });\n\n if (!receipt.contractAddress) {\n throw new Error('No contract address in receipt');\n }\n\n return { address: receipt.contractAddress, hash, receipt };\n}\n","import { concat, encodeAbiParameters, keccak256, pad, toHex } from 'viem';\nimport type { Address, Hex, TypedData } from 'viem';\nimport { toPackedUserOperation } from 'viem/account-abstraction';\nimport { signTypedData } from 'viem/accounts';\n\nimport type { OptionalUserOpProps, PackedUserOperationStruct } from './types';\n\n// v7 off-chain user operation, hexlified incoming data from rpc call\nexport type UserOperationV07Hexlify = {\n sender: Hex;\n nonce: Hex;\n factory?: Hex;\n factoryData?: Hex;\n callData: Hex;\n callGasLimit: Hex;\n\n verificationGasLimit: Hex;\n preVerificationGas: Hex;\n maxFeePerGas: Hex;\n maxPriorityFeePerGas: Hex;\n\n paymaster?: Hex;\n paymasterVerificationGasLimit?: Hex;\n paymasterPostOpGasLimit?: Hex;\n paymasterData?: Hex;\n\n signature: Hex;\n};\n\n// v7 off-chain user operation with BigInt fields\nexport type UserOperationV07 = {\n sender: Hex;\n nonce: bigint;\n factory?: Hex;\n factoryData?: Hex;\n callData: Hex;\n\n callGasLimit: bigint;\n verificationGasLimit: bigint;\n preVerificationGas: bigint;\n maxFeePerGas: bigint;\n maxPriorityFeePerGas: bigint;\n\n paymaster?: Hex;\n paymasterVerificationGasLimit?: bigint;\n paymasterPostOpGasLimit?: bigint;\n paymasterData?: Hex;\n\n signature: Hex;\n};\n\n/**\n * Creates a raw user operation data structure.\n *\n * @param sender - The smart account taking some action.\n * @param nonce - A nonce, ideally fetched from the Entry Point.\n * @param callData - Calldata to invoke on some contract.\n * @param signature - The signature for the user operation.\n * @param options - Optional properties for the user operation.\n * @returns The created raw user operation data structure.\n */\nexport const createRawUserOp = (\n sender: Hex,\n nonce: bigint,\n callData: Hex,\n signature: Hex = '0x',\n options?: OptionalUserOpProps,\n): UserOperationV07 => ({\n sender,\n nonce,\n callData,\n factory: options?.factory,\n factoryData: options?.factoryData,\n callGasLimit: options?.callGasLimit ?? 0n,\n verificationGasLimit: options?.verificationGasLimit ?? 0n,\n preVerificationGas: options?.preVerificationGas ?? 0n,\n maxFeePerGas: options?.maxFeePerGas ?? 0n,\n maxPriorityFeePerGas: options?.maxPriorityFeePerGas ?? 0n,\n paymaster: options?.paymaster,\n paymasterVerificationGasLimit: options?.paymasterVerificationGasLimit,\n paymasterPostOpGasLimit: options?.paymasterPostOpGasLimit,\n paymasterData: options?.paymasterData,\n signature,\n});\n\n// //////////////////////////////////////////////////////////////////////////////////////\n\n// TODO: These userOp functions are duplicated in ./apps/ew-client/src/utils/userOpBuilder.ts. We should move them to a shared location along with test(./apps/ew-client/test/UserOpBuilder.test.ts) to avoid duplication\n/**\n * Generates a salt value for address derivation.\n *\n * @param salt - Optional salt value.\n * @returns The chosen salt value.\n */\nexport const getSalt = (salt?: Hex): Hex => {\n return salt ?? '0x0';\n};\n\nexport const getPaymasterAndData = (userOp: UserOperationV07): Hex => {\n let paymasterAndData: Hex;\n if (userOp.paymaster) {\n paymasterAndData = concat([\n userOp.paymaster,\n pad(toHex(userOp.paymasterVerificationGasLimit ?? 0n), {\n size: 16,\n }),\n pad(toHex(userOp.paymasterPostOpGasLimit ?? 0n), {\n size: 16,\n }),\n userOp.paymasterData ?? '0x',\n ]);\n } else {\n paymasterAndData = '0x';\n }\n\n return paymasterAndData;\n};\n\nexport const getInitCode = (userOp: UserOperationV07): Hex => {\n return userOp.factory\n ? concat([userOp.factory, userOp.factoryData ?? ('0x' as Hex)])\n : '0x';\n};\n\nexport const getAccountGasLimits = (userOp: UserOperationV07): Hex => {\n return concat([\n pad(toHex(userOp.verificationGasLimit), {\n size: 16,\n }),\n pad(toHex(userOp.callGasLimit), { size: 16 }),\n ]);\n};\n\nexport const getGasFees = (userOp: UserOperationV07): Hex => {\n return concat([\n pad(toHex(userOp.maxPriorityFeePerGas), {\n size: 16,\n }),\n pad(toHex(userOp.maxFeePerGas), { size: 16 }),\n ]);\n};\n\n/**\n * Packs a user operation into a `PackedUserOperationStruct` object.\n *\n * @param userOp - The user operation to pack.\n * @returns The packed user operation.\n */\nexport const packUserOp = (\n userOp: UserOperationV07,\n): PackedUserOperationStruct => {\n const packedOp = {\n sender: userOp.sender,\n nonce: BigInt(userOp.nonce),\n initCode: getInitCode(userOp),\n callData: userOp.callData,\n accountGasLimits: getAccountGasLimits(userOp),\n preVerificationGas: BigInt(userOp.preVerificationGas),\n gasFees: getGasFees(userOp),\n paymasterAndData: getPaymasterAndData(userOp),\n signature: userOp.signature,\n };\n\n return packedOp;\n};\n\n/**\n * Calculates the user operation hash for a given packed user operation.\n *\n * @param packedOp - The packed user operation.\n * @param entryPoint - The entry point address.\n * @param chainId - The chain ID.\n * @returns The user operation hash.\n */\nexport const createUserOpHashV07 = (\n packedOp: PackedUserOperationStruct,\n entryPoint: Hex,\n chainId: bigint,\n) => {\n const hash = keccak256(\n encodeAbiParameters(\n [\n {\n name: 'sender',\n type: 'address',\n },\n {\n name: 'nonce',\n type: 'uint256',\n },\n {\n name: 'initCodeHash',\n type: 'bytes32',\n },\n {\n name: 'callDataHash',\n type: 'bytes32',\n },\n {\n name: 'accountGasLimits',\n type: 'bytes32',\n },\n {\n name: 'preVerificationGas',\n type: 'uint256',\n },\n {\n name: 'gasFees',\n type: 'bytes32',\n },\n {\n name: 'paymasterAndDataHash',\n type: 'bytes32',\n },\n ],\n [\n packedOp.sender,\n packedOp.nonce,\n keccak256(packedOp.initCode),\n keccak256(packedOp.callData),\n packedOp.accountGasLimits,\n packedOp.preVerificationGas,\n packedOp.gasFees,\n keccak256(packedOp.paymasterAndData),\n ],\n ),\n );\n\n return keccak256(\n encodeAbiParameters(\n [\n {\n name: 'userOpHash',\n type: 'bytes32',\n },\n {\n name: 'entryPointAddress',\n type: 'address',\n },\n {\n name: 'chainId',\n type: 'uint256',\n },\n ],\n [hash, entryPoint, chainId],\n ),\n );\n};\n\nexport const SIGNABLE_USER_OP_TYPED_DATA: TypedData = {\n PackedUserOperation: [\n { name: 'sender', type: 'address' },\n { name: 'nonce', type: 'uint256' },\n { name: 'initCode', type: 'bytes' },\n { name: 'callData', type: 'bytes' },\n { name: 'accountGasLimits', type: 'bytes32' },\n { name: 'preVerificationGas', type: 'uint256' },\n { name: 'gasFees', type: 'bytes32' },\n { name: 'paymasterAndData', type: 'bytes' },\n { name: 'entryPoint', type: 'address' },\n ],\n} as const;\n\n/**\n * Prepares typed data for user operation signing.\n * This is an internal helper function that's not exposed in the public API.\n *\n * @param params - The parameters for preparing the typed data.\n * @param params.userOperation - The user operation to prepare for signing.\n * @param params.entryPoint - The entry point contract address.\n * @param params.entryPoint.address - The address of the entry point contract.\n * @param params.chainId - The chain ID that the entry point is deployed on.\n * @param params.name - The name of the domain of the implementation contract.\n * @param params.version - The version of the domain of the implementation contract.\n * @param params.address - The address of the smart account.\n * @returns The prepared typed data for signing.\n */\nexport const prepareSignUserOperationTypedData = ({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n}: {\n userOperation: Omit<UserOperationV07, 'signature'>;\n entryPoint: { address: Address };\n chainId: number;\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n address: Address;\n version?: string;\n}) => {\n const packedUserOp = toPackedUserOperation({\n ...userOperation,\n signature: '0x',\n });\n\n return {\n domain: {\n chainId,\n name,\n version,\n verifyingContract: address,\n },\n types: SIGNABLE_USER_OP_TYPED_DATA,\n primaryType: 'PackedUserOperation' as const,\n message: { ...packedUserOp, entryPoint: entryPoint.address },\n };\n};\n\n/**\n * Signs a user operation using a private key.\n *\n * @param params - The parameters for signing the user operation.\n * @param params.privateKey - The private key to use for signing.\n * @param params.userOperation - The user operation to sign.\n * @param params.entryPoint - The entry point contract address.\n * @param params.chainId - The chain ID that the entry point is deployed on.\n * @param params.name - The name of the domain of the implementation contract.\n * @param params.version - The version of the domain of the implementation contract.\n * @param params.address - The address of the smart account.\n * @param params.entryPoint.address - The address of the entry point contract.\n * @returns The signature of the user operation.\n */\nexport const signUserOperation = async ({\n privateKey,\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version = '1',\n}: {\n privateKey: Hex;\n userOperation: Omit<UserOperationV07, 'signature'>;\n entryPoint: { address: Address };\n chainId: number;\n address: Address;\n name: 'HybridDeleGator' | 'MultiSigDeleGator';\n version?: string;\n}) => {\n const typedData = prepareSignUserOperationTypedData({\n userOperation,\n entryPoint,\n chainId,\n name,\n address,\n version,\n });\n\n return signTypedData({\n privateKey,\n ...typedData,\n });\n};\n"]}