@metamask/smart-accounts-kit 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -1
- package/dist/actions/index.cjs +4 -4
- package/dist/actions/index.d.cts +1 -1
- package/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.mjs +3 -3
- package/dist/{caveats-CQbtzOKm.d.ts → caveats-BhjGBVHX.d.ts} +1 -1
- package/dist/{caveats-Cey0wm33.d.cts → caveats-CeHBbmt_.d.cts} +1 -1
- package/dist/{chunk-AJWMPR7X.cjs → chunk-6CEOFJY5.cjs} +122 -50
- package/dist/chunk-6CEOFJY5.cjs.map +1 -0
- package/dist/{chunk-AC2BQSYP.mjs → chunk-DVJX76J3.mjs} +2 -2
- package/dist/{chunk-Z4D7ZWVB.mjs → chunk-EEIIVBNV.mjs} +22 -18
- package/dist/chunk-EEIIVBNV.mjs.map +1 -0
- package/dist/{chunk-LQXOM3TA.mjs → chunk-FG2CQGSE.mjs} +3 -3
- package/dist/{chunk-26PADMXR.mjs → chunk-HQHXGWNJ.mjs} +4 -4
- package/dist/{chunk-3PBVHNYP.cjs → chunk-MVBU3LRV.cjs} +10 -10
- package/dist/{chunk-3PBVHNYP.cjs.map → chunk-MVBU3LRV.cjs.map} +1 -1
- package/dist/{chunk-FKI4OME5.mjs → chunk-R2WT54GZ.mjs} +78 -6
- package/dist/chunk-R2WT54GZ.mjs.map +1 -0
- package/dist/{chunk-57I2FJY7.cjs → chunk-RR2AMG4A.cjs} +102 -102
- package/dist/{chunk-57I2FJY7.cjs.map → chunk-RR2AMG4A.cjs.map} +1 -1
- package/dist/{chunk-DLCTHNAE.cjs → chunk-SO5JAXGD.cjs} +11 -11
- package/dist/{chunk-DLCTHNAE.cjs.map → chunk-SO5JAXGD.cjs.map} +1 -1
- package/dist/{chunk-SZOX7K2V.cjs → chunk-TMO23YRP.cjs} +19 -15
- package/dist/chunk-TMO23YRP.cjs.map +1 -0
- package/dist/{chunk-GZ7HHI2D.cjs → chunk-XZ7UMCG3.cjs} +12 -12
- package/dist/{chunk-GZ7HHI2D.cjs.map → chunk-XZ7UMCG3.cjs.map} +1 -1
- package/dist/{chunk-KBSFVKUB.mjs → chunk-ZGBFPD4O.mjs} +2 -2
- package/dist/contracts/index.cjs +5 -5
- package/dist/contracts/index.d.cts +2 -2
- package/dist/contracts/index.d.ts +2 -2
- package/dist/contracts/index.mjs +4 -4
- package/dist/{delegation-Bx4FEAIU.d.ts → delegation-CR99q1-n.d.ts} +2 -6
- package/dist/{delegation-KbWHzRxV.d.cts → delegation-DoVULGYE.d.cts} +2 -6
- package/dist/experimental/index.cjs +7 -7
- package/dist/experimental/index.mjs +1 -1
- package/dist/{index-BDC55AA9.d.cts → index-BToRQKyJ.d.cts} +23 -3
- package/dist/{index-DhG2lH80.d.ts → index-Cg-JakqA.d.ts} +23 -3
- package/dist/{index-D2THBlfm.d.ts → index-DRKgDSZW.d.ts} +1 -1
- package/dist/{index-DE87r5KY.d.cts → index-DzL9ccjU.d.cts} +1 -1
- package/dist/index.cjs +22 -20
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.mjs +9 -7
- package/dist/index.mjs.map +1 -1
- package/dist/utils/index.cjs +4 -4
- package/dist/utils/index.d.cts +2 -2
- package/dist/utils/index.d.ts +2 -2
- package/dist/utils/index.mjs +3 -3
- package/package.json +4 -4
- package/dist/chunk-AJWMPR7X.cjs.map +0 -1
- package/dist/chunk-FKI4OME5.mjs.map +0 -1
- package/dist/chunk-SZOX7K2V.cjs.map +0 -1
- package/dist/chunk-Z4D7ZWVB.mjs.map +0 -1
- /package/dist/{chunk-AC2BQSYP.mjs.map → chunk-DVJX76J3.mjs.map} +0 -0
- /package/dist/{chunk-LQXOM3TA.mjs.map → chunk-FG2CQGSE.mjs.map} +0 -0
- /package/dist/{chunk-26PADMXR.mjs.map → chunk-HQHXGWNJ.mjs.map} +0 -0
- /package/dist/{chunk-KBSFVKUB.mjs.map → chunk-ZGBFPD4O.mjs.map} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [1.4.0]
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- Add optional `payee` execution rule to `PermissionRequestParameter` for allowance-type permissions ([#219](https://github.com/MetaMask/smart-accounts-kit/pull/219))
|
|
15
|
+
- Add new erc-7715 simple allowance types: ([#214](https://github.com/metamask/smart-accounts-kit/pull/214))
|
|
16
|
+
|
|
10
17
|
## [1.3.0]
|
|
11
18
|
|
|
12
19
|
### Added
|
|
@@ -121,7 +128,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
121
128
|
|
|
122
129
|
- Promote readable permissions actions (`requestExecutionPermissions`, `sendTransactionWithDelegation`, and `sendUserOperationWithDelegation`) from experimental ([#91](https://github.com/MetaMask/smart-accounts-kit/pull/91))
|
|
123
130
|
|
|
124
|
-
[Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.
|
|
131
|
+
[Unreleased]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.4.0...HEAD
|
|
132
|
+
[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
|
|
125
133
|
[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
|
|
126
134
|
[1.2.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.1.0...@metamask/smart-accounts-kit@1.2.0
|
|
127
135
|
[1.1.0]: https://github.com/metamask/smart-accounts-kit/compare/@metamask/smart-accounts-kit@1.0.0...@metamask/smart-accounts-kit@1.1.0
|
package/dist/actions/index.cjs
CHANGED
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
|
|
19
|
-
var
|
|
20
|
-
require('../chunk-
|
|
19
|
+
var _chunk6CEOFJY5cjs = require('../chunk-6CEOFJY5.cjs');
|
|
20
|
+
require('../chunk-XZ7UMCG3.cjs');
|
|
21
21
|
require('../chunk-SOFB2MXG.cjs');
|
|
22
22
|
require('../chunk-MOHCTPYQ.cjs');
|
|
23
|
-
require('../chunk-
|
|
23
|
+
require('../chunk-TMO23YRP.cjs');
|
|
24
24
|
|
|
25
25
|
|
|
26
26
|
|
|
@@ -39,5 +39,5 @@ require('../chunk-SZOX7K2V.cjs');
|
|
|
39
39
|
|
|
40
40
|
|
|
41
41
|
|
|
42
|
-
exports.caveatEnforcerActions =
|
|
42
|
+
exports.caveatEnforcerActions = _chunk6CEOFJY5cjs.caveatEnforcerActions; exports.erc7710BundlerActions = _chunk6CEOFJY5cjs.erc7710BundlerActions; exports.erc7710WalletActions = _chunk6CEOFJY5cjs.erc7710WalletActions; exports.erc7715ProviderActions = _chunk6CEOFJY5cjs.erc7715ProviderActions; exports.getErc20PeriodTransferEnforcerAvailableAmount = _chunk6CEOFJY5cjs.getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = _chunk6CEOFJY5cjs.getErc20StreamingEnforcerAvailableAmount; exports.getGrantedExecutionPermissions = _chunk6CEOFJY5cjs.erc7715GetGrantedExecutionPermissionsAction; exports.getMultiTokenPeriodEnforcerAvailableAmount = _chunk6CEOFJY5cjs.getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = _chunk6CEOFJY5cjs.getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = _chunk6CEOFJY5cjs.getNativeTokenStreamingEnforcerAvailableAmount; exports.getSupportedExecutionPermissions = _chunk6CEOFJY5cjs.erc7715GetSupportedExecutionPermissionsAction; exports.isValid7702Implementation = _chunk6CEOFJY5cjs.isValid7702Implementation; exports.requestExecutionPermissions = _chunk6CEOFJY5cjs.erc7715RequestExecutionPermissionsAction; exports.signDelegation = _chunk6CEOFJY5cjs.signDelegation; exports.signDelegationActions = _chunk6CEOFJY5cjs.signDelegationActions; exports.signUserOperation = _chunk6CEOFJY5cjs.signUserOperation; exports.signUserOperationActions = _chunk6CEOFJY5cjs.signUserOperationActions;
|
|
43
43
|
//# sourceMappingURL=index.cjs.map
|
package/dist/actions/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CaveatEnforcerParams, D as DelegatedCall, E as
|
|
1
|
+
export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7715Client, G as GetGrantedExecutionPermissionsResult, f as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, g as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, h as NativeTokenPeriodicPermission, j as NativeTokenStreamPermission, P as PeriodTransferResult, k as PermissionRequestParameter, l as PermissionTypes, R as RequestExecutionPermissionsParameters, m as RequestExecutionPermissionsReturnType, n as RpcGetGrantedExecutionPermissionsResult, o as RpcGetSupportedExecutionPermissionsResult, p as RpcSupportedPermissionInfo, S as SignDelegationParameters, q as SignDelegationReturnType, r as SignUserOperationParameters, s as SignUserOperationReturnType, t as StreamingResult, u as SupportedPermissionInfo, c as caveatEnforcerActions, v as erc7710BundlerActions, w as erc7710WalletActions, x as erc7715ProviderActions, y as getErc20PeriodTransferEnforcerAvailableAmount, z as getErc20StreamingEnforcerAvailableAmount, A as getGrantedExecutionPermissions, B as getMultiTokenPeriodEnforcerAvailableAmount, F as getNativeTokenPeriodTransferEnforcerAvailableAmount, H as getNativeTokenStreamingEnforcerAvailableAmount, I as getSupportedExecutionPermissions, J as isValid7702Implementation, K as requestExecutionPermissions, L as signDelegation, O as signDelegationActions, Q as signUserOperation, T as signUserOperationActions } from '../index-BToRQKyJ.cjs';
|
|
2
2
|
import 'viem';
|
|
3
3
|
export { Rule } from '@metamask/7715-permission-types';
|
|
4
4
|
import 'viem/account-abstraction';
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { C as CaveatEnforcerParams, D as DelegatedCall, E as
|
|
1
|
+
export { C as CaveatEnforcerParams, D as DelegatedCall, E as Erc20TokenAllowancePermission, a as Erc20TokenPeriodicPermission, b as Erc20TokenRevocationPermission, d as Erc20TokenStreamPermission, e as Erc7715Client, G as GetGrantedExecutionPermissionsResult, f as GetSupportedExecutionPermissionsResult, M as MetaMaskExtensionClient, g as MetaMaskExtensionSchema, N as NativeTokenAllowancePermission, h as NativeTokenPeriodicPermission, j as NativeTokenStreamPermission, P as PeriodTransferResult, k as PermissionRequestParameter, l as PermissionTypes, R as RequestExecutionPermissionsParameters, m as RequestExecutionPermissionsReturnType, n as RpcGetGrantedExecutionPermissionsResult, o as RpcGetSupportedExecutionPermissionsResult, p as RpcSupportedPermissionInfo, S as SignDelegationParameters, q as SignDelegationReturnType, r as SignUserOperationParameters, s as SignUserOperationReturnType, t as StreamingResult, u as SupportedPermissionInfo, c as caveatEnforcerActions, v as erc7710BundlerActions, w as erc7710WalletActions, x as erc7715ProviderActions, y as getErc20PeriodTransferEnforcerAvailableAmount, z as getErc20StreamingEnforcerAvailableAmount, A as getGrantedExecutionPermissions, B as getMultiTokenPeriodEnforcerAvailableAmount, F as getNativeTokenPeriodTransferEnforcerAvailableAmount, H as getNativeTokenStreamingEnforcerAvailableAmount, I as getSupportedExecutionPermissions, J as isValid7702Implementation, K as requestExecutionPermissions, L as signDelegation, O as signDelegationActions, Q as signUserOperation, T as signUserOperationActions } from '../index-Cg-JakqA.js';
|
|
2
2
|
import 'viem';
|
|
3
3
|
export { Rule } from '@metamask/7715-permission-types';
|
|
4
4
|
import 'viem/account-abstraction';
|
package/dist/actions/index.mjs
CHANGED
|
@@ -16,11 +16,11 @@ import {
|
|
|
16
16
|
signDelegationActions,
|
|
17
17
|
signUserOperation,
|
|
18
18
|
signUserOperationActions
|
|
19
|
-
} from "../chunk-
|
|
20
|
-
import "../chunk-
|
|
19
|
+
} from "../chunk-R2WT54GZ.mjs";
|
|
20
|
+
import "../chunk-DVJX76J3.mjs";
|
|
21
21
|
import "../chunk-QCULIK3O.mjs";
|
|
22
22
|
import "../chunk-4QXIOE7F.mjs";
|
|
23
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-EEIIVBNV.mjs";
|
|
24
24
|
export {
|
|
25
25
|
caveatEnforcerActions,
|
|
26
26
|
erc7710BundlerActions,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletClient, PublicClient, Chain, Hex } from 'viem';
|
|
2
2
|
import { S as SmartAccountsEnvironment, C as Caveat } from './types-BWaH4KH1.js';
|
|
3
|
-
import { A as CoreCaveatConfiguration } from './delegation-
|
|
3
|
+
import { A as CoreCaveatConfiguration } from './delegation-CR99q1-n.js';
|
|
4
4
|
|
|
5
5
|
type SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';
|
|
6
6
|
declare const PREFERRED_VERSION: SupportedVersion;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { WalletClient, PublicClient, Chain, Hex } from 'viem';
|
|
2
2
|
import { S as SmartAccountsEnvironment, C as Caveat } from './types-BWaH4KH1.cjs';
|
|
3
|
-
import { A as CoreCaveatConfiguration } from './delegation-
|
|
3
|
+
import { A as CoreCaveatConfiguration } from './delegation-DoVULGYE.cjs';
|
|
4
4
|
|
|
5
5
|
type SupportedVersion = '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0';
|
|
6
6
|
declare const PREFERRED_VERSION: SupportedVersion;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkXZ7UMCG3cjs = require('./chunk-XZ7UMCG3.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
@@ -21,11 +21,11 @@ var _chunkMOHCTPYQcjs = require('./chunk-MOHCTPYQ.cjs');
|
|
|
21
21
|
|
|
22
22
|
|
|
23
23
|
|
|
24
|
-
var
|
|
24
|
+
var _chunkTMO23YRPcjs = require('./chunk-TMO23YRP.cjs');
|
|
25
25
|
|
|
26
26
|
// src/actions/index.ts
|
|
27
27
|
var actions_exports = {};
|
|
28
|
-
|
|
28
|
+
_chunkTMO23YRPcjs.__export.call(void 0, actions_exports, {
|
|
29
29
|
caveatEnforcerActions: () => caveatEnforcerActions,
|
|
30
30
|
erc7710BundlerActions: () => erc7710BundlerActions,
|
|
31
31
|
erc7710WalletActions: () => erc7710WalletActions,
|
|
@@ -49,7 +49,7 @@ _chunkSZOX7K2Vcjs.__export.call(void 0, actions_exports, {
|
|
|
49
49
|
var _delegationabis = require('@metamask/delegation-abis');
|
|
50
50
|
var _viem = require('viem');
|
|
51
51
|
async function sendTransactionWithDelegationAction(client, args) {
|
|
52
|
-
|
|
52
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendTransactionWithDelegationAction", {
|
|
53
53
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _ => _.chain, 'optionalAccess', _2 => _2.id]), () => ( null))
|
|
54
54
|
});
|
|
55
55
|
if (!args.to) {
|
|
@@ -78,7 +78,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
78
78
|
abi: _delegationabis.DelegationManager,
|
|
79
79
|
functionName: "redeemDelegations",
|
|
80
80
|
args: [
|
|
81
|
-
[
|
|
81
|
+
[_chunkTMO23YRPcjs.encodeDelegations.call(void 0, args.permissionContext)],
|
|
82
82
|
["0x0000000000000000000000000000000000000000000000000000000000000000" /* SingleDefault */],
|
|
83
83
|
_chunkMOHCTPYQcjs.encodeExecutionCalldatas.call(void 0, [executions])
|
|
84
84
|
]
|
|
@@ -97,7 +97,7 @@ async function sendTransactionWithDelegationAction(client, args) {
|
|
|
97
97
|
return hash;
|
|
98
98
|
}
|
|
99
99
|
async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
100
|
-
|
|
100
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0, "sendUserOperationWithDelegationAction", {
|
|
101
101
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _5 => _5.chain, 'optionalAccess', _6 => _6.id]), () => ( null)),
|
|
102
102
|
callCount: parameters.calls.length,
|
|
103
103
|
hasDependencies: parameters.dependencies !== void 0
|
|
@@ -152,7 +152,7 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
152
152
|
}
|
|
153
153
|
return {
|
|
154
154
|
...call,
|
|
155
|
-
permissionContext:
|
|
155
|
+
permissionContext: _chunkTMO23YRPcjs.encodeDelegations.call(void 0, permissionContext)
|
|
156
156
|
};
|
|
157
157
|
});
|
|
158
158
|
return client.sendUserOperation(
|
|
@@ -163,12 +163,12 @@ async function sendUserOperationWithDelegationAction(client, parameters) {
|
|
|
163
163
|
// src/actions/erc7715Mapping.ts
|
|
164
164
|
|
|
165
165
|
function permissionRequestToRpc(parameters) {
|
|
166
|
-
const { chainId, from, expiry, redeemer } = parameters;
|
|
166
|
+
const { chainId, from, expiry, redeemer, payee } = parameters;
|
|
167
167
|
const converter = getPermissionRequestToRpcConverter(
|
|
168
168
|
parameters.permission.type
|
|
169
169
|
);
|
|
170
170
|
const rules = [];
|
|
171
|
-
if (
|
|
171
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, expiry)) {
|
|
172
172
|
rules.push({
|
|
173
173
|
type: "expiry",
|
|
174
174
|
data: {
|
|
@@ -176,7 +176,7 @@ function permissionRequestToRpc(parameters) {
|
|
|
176
176
|
}
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
|
-
if (
|
|
179
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, redeemer)) {
|
|
180
180
|
if (redeemer.length === 0) {
|
|
181
181
|
throw new Error(
|
|
182
182
|
"Invalid redeemers: must specify at least one redeemer address"
|
|
@@ -194,6 +194,24 @@ function permissionRequestToRpc(parameters) {
|
|
|
194
194
|
data: { addresses }
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
|
+
if (_chunkTMO23YRPcjs.isDefined.call(void 0, payee)) {
|
|
198
|
+
if (payee.length === 0) {
|
|
199
|
+
throw new Error(
|
|
200
|
+
"Invalid payees: must specify at least one payee address"
|
|
201
|
+
);
|
|
202
|
+
}
|
|
203
|
+
const payeeAddresses = [];
|
|
204
|
+
for (const addr of payee) {
|
|
205
|
+
if (!_viem.isAddress.call(void 0, addr)) {
|
|
206
|
+
throw new Error("Invalid payees: must be a valid address");
|
|
207
|
+
}
|
|
208
|
+
payeeAddresses.push(_viem.getAddress.call(void 0, addr));
|
|
209
|
+
}
|
|
210
|
+
rules.push({
|
|
211
|
+
type: "payee",
|
|
212
|
+
data: { addresses: payeeAddresses }
|
|
213
|
+
});
|
|
214
|
+
}
|
|
197
215
|
const optionalFields = {
|
|
198
216
|
...from ? { from } : {}
|
|
199
217
|
};
|
|
@@ -219,10 +237,18 @@ function getPermissionRequestToRpcConverter(permissionType) {
|
|
|
219
237
|
return (permission) => nativeTokenPeriodicPermissionToRpc(
|
|
220
238
|
permission
|
|
221
239
|
);
|
|
240
|
+
case "native-token-allowance":
|
|
241
|
+
return (permission) => nativeTokenAllowancePermissionToRpc(
|
|
242
|
+
permission
|
|
243
|
+
);
|
|
222
244
|
case "erc20-token-periodic":
|
|
223
245
|
return (permission) => erc20TokenPeriodicPermissionToRpc(
|
|
224
246
|
permission
|
|
225
247
|
);
|
|
248
|
+
case "erc20-token-allowance":
|
|
249
|
+
return (permission) => erc20TokenAllowancePermissionToRpc(
|
|
250
|
+
permission
|
|
251
|
+
);
|
|
226
252
|
case "erc20-token-revocation":
|
|
227
253
|
return (permission) => erc20TokenRevocationPermissionToRpc(
|
|
228
254
|
permission
|
|
@@ -243,13 +269,13 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
243
269
|
isAdjustmentAllowed
|
|
244
270
|
} = permission;
|
|
245
271
|
const optionalFields = {
|
|
246
|
-
...
|
|
247
|
-
initialAmount:
|
|
272
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, initialAmount) && {
|
|
273
|
+
initialAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
248
274
|
},
|
|
249
|
-
...
|
|
250
|
-
maxAmount:
|
|
275
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, maxAmount) && {
|
|
276
|
+
maxAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
251
277
|
},
|
|
252
|
-
...
|
|
278
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
253
279
|
startTime: Number(startTime)
|
|
254
280
|
},
|
|
255
281
|
...justification ? { justification } : {}
|
|
@@ -257,7 +283,7 @@ function nativeTokenStreamPermissionToRpc(permission) {
|
|
|
257
283
|
return {
|
|
258
284
|
type: "native-token-stream",
|
|
259
285
|
data: {
|
|
260
|
-
amountPerSecond:
|
|
286
|
+
amountPerSecond: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
261
287
|
...optionalFields
|
|
262
288
|
},
|
|
263
289
|
isAdjustmentAllowed
|
|
@@ -276,13 +302,13 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
276
302
|
isAdjustmentAllowed
|
|
277
303
|
} = permission;
|
|
278
304
|
const optionalFields = {
|
|
279
|
-
...
|
|
280
|
-
initialAmount:
|
|
305
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, initialAmount) && {
|
|
306
|
+
initialAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, initialAmount, "initialAmount")
|
|
281
307
|
},
|
|
282
|
-
...
|
|
283
|
-
maxAmount:
|
|
308
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, maxAmount) && {
|
|
309
|
+
maxAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, maxAmount, "maxAmount")
|
|
284
310
|
},
|
|
285
|
-
...
|
|
311
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
286
312
|
startTime: Number(startTime)
|
|
287
313
|
},
|
|
288
314
|
...justification ? { justification } : {}
|
|
@@ -290,8 +316,8 @@ function erc20TokenStreamPermissionToRpc(permission) {
|
|
|
290
316
|
return {
|
|
291
317
|
type: "erc20-token-stream",
|
|
292
318
|
data: {
|
|
293
|
-
tokenAddress:
|
|
294
|
-
amountPerSecond:
|
|
319
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
320
|
+
amountPerSecond: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, amountPerSecond, "amountPerSecond"),
|
|
295
321
|
...optionalFields
|
|
296
322
|
},
|
|
297
323
|
isAdjustmentAllowed
|
|
@@ -303,7 +329,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
303
329
|
isAdjustmentAllowed
|
|
304
330
|
} = permission;
|
|
305
331
|
const optionalFields = {
|
|
306
|
-
...
|
|
332
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
307
333
|
startTime: Number(startTime)
|
|
308
334
|
},
|
|
309
335
|
...justification ? { justification } : {}
|
|
@@ -311,7 +337,7 @@ function nativeTokenPeriodicPermissionToRpc(permission) {
|
|
|
311
337
|
return {
|
|
312
338
|
type: "native-token-periodic",
|
|
313
339
|
data: {
|
|
314
|
-
periodAmount:
|
|
340
|
+
periodAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
315
341
|
periodDuration: Number(periodDuration),
|
|
316
342
|
...optionalFields
|
|
317
343
|
},
|
|
@@ -330,7 +356,7 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
330
356
|
isAdjustmentAllowed
|
|
331
357
|
} = permission;
|
|
332
358
|
const optionalFields = {
|
|
333
|
-
...
|
|
359
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
334
360
|
startTime: Number(startTime)
|
|
335
361
|
},
|
|
336
362
|
...justification ? { justification } : {}
|
|
@@ -338,14 +364,55 @@ function erc20TokenPeriodicPermissionToRpc(permission) {
|
|
|
338
364
|
return {
|
|
339
365
|
type: "erc20-token-periodic",
|
|
340
366
|
data: {
|
|
341
|
-
tokenAddress:
|
|
342
|
-
periodAmount:
|
|
367
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
368
|
+
periodAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, periodAmount, "periodAmount"),
|
|
343
369
|
periodDuration: Number(periodDuration),
|
|
344
370
|
...optionalFields
|
|
345
371
|
},
|
|
346
372
|
isAdjustmentAllowed
|
|
347
373
|
};
|
|
348
374
|
}
|
|
375
|
+
function nativeTokenAllowancePermissionToRpc(permission) {
|
|
376
|
+
const {
|
|
377
|
+
data: { allowanceAmount, startTime, justification },
|
|
378
|
+
isAdjustmentAllowed
|
|
379
|
+
} = permission;
|
|
380
|
+
const optionalFields = {
|
|
381
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
382
|
+
startTime: Number(startTime)
|
|
383
|
+
},
|
|
384
|
+
...justification ? { justification } : {}
|
|
385
|
+
};
|
|
386
|
+
return {
|
|
387
|
+
type: "native-token-allowance",
|
|
388
|
+
data: {
|
|
389
|
+
allowanceAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
390
|
+
...optionalFields
|
|
391
|
+
},
|
|
392
|
+
isAdjustmentAllowed
|
|
393
|
+
};
|
|
394
|
+
}
|
|
395
|
+
function erc20TokenAllowancePermissionToRpc(permission) {
|
|
396
|
+
const {
|
|
397
|
+
data: { tokenAddress, allowanceAmount, startTime, justification },
|
|
398
|
+
isAdjustmentAllowed
|
|
399
|
+
} = permission;
|
|
400
|
+
const optionalFields = {
|
|
401
|
+
..._chunkTMO23YRPcjs.isDefined.call(void 0, startTime) && {
|
|
402
|
+
startTime: Number(startTime)
|
|
403
|
+
},
|
|
404
|
+
...justification ? { justification } : {}
|
|
405
|
+
};
|
|
406
|
+
return {
|
|
407
|
+
type: "erc20-token-allowance",
|
|
408
|
+
data: {
|
|
409
|
+
tokenAddress: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, tokenAddress, "tokenAddress"),
|
|
410
|
+
allowanceAmount: _chunkTMO23YRPcjs.toHexOrThrow.call(void 0, allowanceAmount, "allowanceAmount"),
|
|
411
|
+
...optionalFields
|
|
412
|
+
},
|
|
413
|
+
isAdjustmentAllowed
|
|
414
|
+
};
|
|
415
|
+
}
|
|
349
416
|
function erc20TokenRevocationPermissionToRpc(permission) {
|
|
350
417
|
const {
|
|
351
418
|
data: { justification },
|
|
@@ -373,7 +440,7 @@ function normalizeRulesFromRpc(rules) {
|
|
|
373
440
|
return rules;
|
|
374
441
|
}
|
|
375
442
|
return rules.map((rule) => {
|
|
376
|
-
if (rule.type !== "redeemer") {
|
|
443
|
+
if (rule.type !== "redeemer" && rule.type !== "payee") {
|
|
377
444
|
return rule;
|
|
378
445
|
}
|
|
379
446
|
const rawAddresses = _optionalChain([rule, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.addresses]);
|
|
@@ -381,7 +448,7 @@ function normalizeRulesFromRpc(rules) {
|
|
|
381
448
|
return rule;
|
|
382
449
|
}
|
|
383
450
|
return {
|
|
384
|
-
type:
|
|
451
|
+
type: rule.type,
|
|
385
452
|
data: {
|
|
386
453
|
addresses: rawAddresses.map((addr) => _viem.getAddress.call(void 0, addr))
|
|
387
454
|
}
|
|
@@ -408,6 +475,11 @@ function permissionTypeFromRpc(permission) {
|
|
|
408
475
|
if ("maxAmount" in convertedData && convertedData.maxAmount) {
|
|
409
476
|
convertedData.maxAmount = BigInt(convertedData.maxAmount);
|
|
410
477
|
}
|
|
478
|
+
if ("allowanceAmount" in convertedData && convertedData.allowanceAmount) {
|
|
479
|
+
convertedData.allowanceAmount = BigInt(
|
|
480
|
+
convertedData.allowanceAmount
|
|
481
|
+
);
|
|
482
|
+
}
|
|
411
483
|
return {
|
|
412
484
|
...permission,
|
|
413
485
|
data: convertedData
|
|
@@ -426,7 +498,7 @@ function rpcSupportedPermissionsToDeveloper(result) {
|
|
|
426
498
|
|
|
427
499
|
// src/actions/erc7715GetGrantedExecutionPermissionsAction.ts
|
|
428
500
|
async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
429
|
-
|
|
501
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
430
502
|
"erc7715GetGrantedExecutionPermissionsAction",
|
|
431
503
|
{
|
|
432
504
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _11 => _11.chain, 'optionalAccess', _12 => _12.id]), () => ( null))
|
|
@@ -447,7 +519,7 @@ async function erc7715GetGrantedExecutionPermissionsAction(client) {
|
|
|
447
519
|
|
|
448
520
|
// src/actions/erc7715GetSupportedExecutionPermissionsAction.ts
|
|
449
521
|
async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
450
|
-
|
|
522
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
451
523
|
"erc7715GetSupportedExecutionPermissionsAction",
|
|
452
524
|
{
|
|
453
525
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _13 => _13.chain, 'optionalAccess', _14 => _14.id]), () => ( null))
|
|
@@ -468,7 +540,7 @@ async function erc7715GetSupportedExecutionPermissionsAction(client) {
|
|
|
468
540
|
|
|
469
541
|
// src/actions/erc7715RequestExecutionPermissionsAction.ts
|
|
470
542
|
async function erc7715RequestExecutionPermissionsAction(client, parameters) {
|
|
471
|
-
|
|
543
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
472
544
|
"erc7715RequestExecutionPermissionsAction",
|
|
473
545
|
{
|
|
474
546
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _15 => _15.chain, 'optionalAccess', _16 => _16.id]), () => ( null)),
|
|
@@ -529,7 +601,7 @@ function getEnforcerAddress({
|
|
|
529
601
|
return enforcerAddress;
|
|
530
602
|
}
|
|
531
603
|
async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
532
|
-
|
|
604
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
533
605
|
"getErc20PeriodTransferEnforcerAvailableAmount",
|
|
534
606
|
{
|
|
535
607
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _17 => _17.chain, 'optionalAccess', _18 => _18.id]), () => ( null))
|
|
@@ -541,13 +613,13 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
541
613
|
enforcerName,
|
|
542
614
|
environment
|
|
543
615
|
});
|
|
544
|
-
const delegationHash =
|
|
616
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
545
617
|
const { terms } = findMatchingCaveat({
|
|
546
618
|
delegation: params.delegation,
|
|
547
619
|
enforcerAddress,
|
|
548
620
|
enforcerName
|
|
549
621
|
});
|
|
550
|
-
return
|
|
622
|
+
return _chunkXZ7UMCG3cjs.read_exports.getAvailableAmount({
|
|
551
623
|
client,
|
|
552
624
|
contractAddress: enforcerAddress,
|
|
553
625
|
delegationHash,
|
|
@@ -556,7 +628,7 @@ async function getErc20PeriodTransferEnforcerAvailableAmount(client, environment
|
|
|
556
628
|
});
|
|
557
629
|
}
|
|
558
630
|
async function getErc20StreamingEnforcerAvailableAmount(client, environment, params) {
|
|
559
|
-
|
|
631
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
560
632
|
"getErc20StreamingEnforcerAvailableAmount",
|
|
561
633
|
{
|
|
562
634
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _19 => _19.chain, 'optionalAccess', _20 => _20.id]), () => ( null))
|
|
@@ -568,13 +640,13 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
568
640
|
enforcerName,
|
|
569
641
|
environment
|
|
570
642
|
});
|
|
571
|
-
const delegationHash =
|
|
643
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
572
644
|
const { terms } = findMatchingCaveat({
|
|
573
645
|
delegation: params.delegation,
|
|
574
646
|
enforcerAddress,
|
|
575
647
|
enforcerName
|
|
576
648
|
});
|
|
577
|
-
return
|
|
649
|
+
return _chunkXZ7UMCG3cjs.read_exports2.getAvailableAmount({
|
|
578
650
|
client,
|
|
579
651
|
contractAddress: enforcerAddress,
|
|
580
652
|
delegationManager,
|
|
@@ -583,7 +655,7 @@ async function getErc20StreamingEnforcerAvailableAmount(client, environment, par
|
|
|
583
655
|
});
|
|
584
656
|
}
|
|
585
657
|
async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, params) {
|
|
586
|
-
|
|
658
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
587
659
|
"getMultiTokenPeriodEnforcerAvailableAmount",
|
|
588
660
|
{
|
|
589
661
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _21 => _21.chain, 'optionalAccess', _22 => _22.id]), () => ( null))
|
|
@@ -595,13 +667,13 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
595
667
|
enforcerName,
|
|
596
668
|
environment
|
|
597
669
|
});
|
|
598
|
-
const delegationHash =
|
|
670
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
599
671
|
const { terms, args } = findMatchingCaveat({
|
|
600
672
|
delegation: params.delegation,
|
|
601
673
|
enforcerAddress,
|
|
602
674
|
enforcerName
|
|
603
675
|
});
|
|
604
|
-
return
|
|
676
|
+
return _chunkXZ7UMCG3cjs.read_exports3.getAvailableAmount({
|
|
605
677
|
client,
|
|
606
678
|
contractAddress: enforcerAddress,
|
|
607
679
|
delegationHash,
|
|
@@ -611,7 +683,7 @@ async function getMultiTokenPeriodEnforcerAvailableAmount(client, environment, p
|
|
|
611
683
|
});
|
|
612
684
|
}
|
|
613
685
|
async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, environment, params) {
|
|
614
|
-
|
|
686
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
615
687
|
"getNativeTokenPeriodTransferEnforcerAvailableAmount",
|
|
616
688
|
{
|
|
617
689
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _23 => _23.chain, 'optionalAccess', _24 => _24.id]), () => ( null))
|
|
@@ -623,13 +695,13 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
623
695
|
enforcerName,
|
|
624
696
|
environment
|
|
625
697
|
});
|
|
626
|
-
const delegationHash =
|
|
698
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
627
699
|
const { terms } = findMatchingCaveat({
|
|
628
700
|
delegation: params.delegation,
|
|
629
701
|
enforcerAddress,
|
|
630
702
|
enforcerName
|
|
631
703
|
});
|
|
632
|
-
return
|
|
704
|
+
return _chunkXZ7UMCG3cjs.read_exports4.getAvailableAmount({
|
|
633
705
|
client,
|
|
634
706
|
contractAddress: enforcerAddress,
|
|
635
707
|
delegationHash,
|
|
@@ -638,7 +710,7 @@ async function getNativeTokenPeriodTransferEnforcerAvailableAmount(client, envir
|
|
|
638
710
|
});
|
|
639
711
|
}
|
|
640
712
|
async function getNativeTokenStreamingEnforcerAvailableAmount(client, environment, params) {
|
|
641
|
-
|
|
713
|
+
_chunkTMO23YRPcjs.trackSmartAccountsKitFunctionCall.call(void 0,
|
|
642
714
|
"getNativeTokenStreamingEnforcerAvailableAmount",
|
|
643
715
|
{
|
|
644
716
|
chainId: _nullishCoalesce(_optionalChain([client, 'access', _25 => _25.chain, 'optionalAccess', _26 => _26.id]), () => ( null))
|
|
@@ -650,13 +722,13 @@ async function getNativeTokenStreamingEnforcerAvailableAmount(client, environmen
|
|
|
650
722
|
enforcerName,
|
|
651
723
|
environment
|
|
652
724
|
});
|
|
653
|
-
const delegationHash =
|
|
725
|
+
const delegationHash = _chunkTMO23YRPcjs.hashDelegation.call(void 0, params.delegation);
|
|
654
726
|
const { terms } = findMatchingCaveat({
|
|
655
727
|
delegation: params.delegation,
|
|
656
728
|
enforcerAddress,
|
|
657
729
|
enforcerName
|
|
658
730
|
});
|
|
659
|
-
return
|
|
731
|
+
return _chunkXZ7UMCG3cjs.read_exports5.getAvailableAmount({
|
|
660
732
|
client,
|
|
661
733
|
contractAddress: enforcerAddress,
|
|
662
734
|
delegationManager,
|
|
@@ -786,7 +858,7 @@ async function signDelegation(client, parameters) {
|
|
|
786
858
|
throw new (0, _viem.BaseError)("Account not found. Please provide an account.");
|
|
787
859
|
}
|
|
788
860
|
const account = _accounts.parseAccount.call(void 0, accountParam);
|
|
789
|
-
const typedData =
|
|
861
|
+
const typedData = _chunkTMO23YRPcjs.prepareSignDelegationTypedData.call(void 0, {
|
|
790
862
|
delegation,
|
|
791
863
|
delegationManager,
|
|
792
864
|
chainId,
|
|
@@ -907,4 +979,4 @@ var erc7710BundlerActions = () => (client) => ({
|
|
|
907
979
|
|
|
908
980
|
|
|
909
981
|
exports.isValid7702Implementation = isValid7702Implementation; exports.erc7715GetGrantedExecutionPermissionsAction = erc7715GetGrantedExecutionPermissionsAction; exports.erc7715GetSupportedExecutionPermissionsAction = erc7715GetSupportedExecutionPermissionsAction; exports.erc7715RequestExecutionPermissionsAction = erc7715RequestExecutionPermissionsAction; exports.getErc20PeriodTransferEnforcerAvailableAmount = getErc20PeriodTransferEnforcerAvailableAmount; exports.getErc20StreamingEnforcerAvailableAmount = getErc20StreamingEnforcerAvailableAmount; exports.getMultiTokenPeriodEnforcerAvailableAmount = getMultiTokenPeriodEnforcerAvailableAmount; exports.getNativeTokenPeriodTransferEnforcerAvailableAmount = getNativeTokenPeriodTransferEnforcerAvailableAmount; exports.getNativeTokenStreamingEnforcerAvailableAmount = getNativeTokenStreamingEnforcerAvailableAmount; exports.caveatEnforcerActions = caveatEnforcerActions; exports.signDelegation = signDelegation; exports.signDelegationActions = signDelegationActions; exports.signUserOperation = signUserOperation; exports.signUserOperationActions = signUserOperationActions; exports.erc7715ProviderActions = erc7715ProviderActions; exports.erc7710WalletActions = erc7710WalletActions; exports.erc7710BundlerActions = erc7710BundlerActions; exports.actions_exports = actions_exports;
|
|
910
|
-
//# sourceMappingURL=chunk-
|
|
982
|
+
//# sourceMappingURL=chunk-6CEOFJY5.cjs.map
|