@metamask/smart-accounts-kit 0.1.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 +17 -0
- package/LICENSE.APACHE2 +201 -0
- package/LICENSE.MIT0 +16 -0
- package/README.md +77 -0
- package/dist/actions/index.cjs +39 -0
- package/dist/actions/index.cjs.map +1 -0
- package/dist/actions/index.d.cts +8 -0
- package/dist/actions/index.d.ts +8 -0
- package/dist/actions/index.mjs +39 -0
- package/dist/actions/index.mjs.map +1 -0
- package/dist/chunk-2EIX7ZYT.cjs +1325 -0
- package/dist/chunk-2EIX7ZYT.cjs.map +1 -0
- package/dist/chunk-662KDAAG.cjs +831 -0
- package/dist/chunk-662KDAAG.cjs.map +1 -0
- package/dist/chunk-6RN5RBOR.mjs +1325 -0
- package/dist/chunk-6RN5RBOR.mjs.map +1 -0
- package/dist/chunk-7MRTROLV.mjs +274 -0
- package/dist/chunk-7MRTROLV.mjs.map +1 -0
- package/dist/chunk-BFDBNFIP.cjs +336 -0
- package/dist/chunk-BFDBNFIP.cjs.map +1 -0
- package/dist/chunk-CPLIK3VF.mjs +77 -0
- package/dist/chunk-CPLIK3VF.mjs.map +1 -0
- package/dist/chunk-D4ILRL6Z.cjs +299 -0
- package/dist/chunk-D4ILRL6Z.cjs.map +1 -0
- package/dist/chunk-HD4O6IVC.cjs +274 -0
- package/dist/chunk-HD4O6IVC.cjs.map +1 -0
- package/dist/chunk-HLCOMYYU.cjs +1472 -0
- package/dist/chunk-HLCOMYYU.cjs.map +1 -0
- package/dist/chunk-KUEXI4ME.mjs +299 -0
- package/dist/chunk-KUEXI4ME.mjs.map +1 -0
- package/dist/chunk-MVKT5CLQ.mjs +336 -0
- package/dist/chunk-MVKT5CLQ.mjs.map +1 -0
- package/dist/chunk-RB4SOJM3.mjs +729 -0
- package/dist/chunk-RB4SOJM3.mjs.map +1 -0
- package/dist/chunk-T6PSFUOZ.cjs +77 -0
- package/dist/chunk-T6PSFUOZ.cjs.map +1 -0
- package/dist/chunk-TEI2NRPU.mjs +831 -0
- package/dist/chunk-TEI2NRPU.mjs.map +1 -0
- package/dist/chunk-UUDQWENY.mjs +1472 -0
- package/dist/chunk-UUDQWENY.mjs.map +1 -0
- package/dist/chunk-WA2O2K3K.cjs +729 -0
- package/dist/chunk-WA2O2K3K.cjs.map +1 -0
- package/dist/contracts/index.cjs +57 -0
- package/dist/contracts/index.cjs.map +1 -0
- package/dist/contracts/index.d.cts +8 -0
- package/dist/contracts/index.d.ts +8 -0
- package/dist/contracts/index.mjs +57 -0
- package/dist/contracts/index.mjs.map +1 -0
- package/dist/delegation-7PtFix8Y.d.ts +376 -0
- package/dist/delegation-d52Owevd.d.cts +376 -0
- package/dist/experimental/index.cjs +143 -0
- package/dist/experimental/index.cjs.map +1 -0
- package/dist/experimental/index.d.cts +29 -0
- package/dist/experimental/index.d.ts +29 -0
- package/dist/experimental/index.mjs +143 -0
- package/dist/experimental/index.mjs.map +1 -0
- package/dist/index-0-B0YlEP.d.cts +21935 -0
- package/dist/index-18Alar1P.d.ts +1174 -0
- package/dist/index-CLkk7zr4.d.cts +1174 -0
- package/dist/index-D1WbhKCc.d.ts +21935 -0
- package/dist/index.cjs +424 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +56 -0
- package/dist/index.d.ts +56 -0
- package/dist/index.mjs +424 -0
- package/dist/index.mjs.map +1 -0
- package/dist/smartAccountsEnvironment-BOhrxEnt.d.ts +12 -0
- package/dist/smartAccountsEnvironment-SVknZ_3f.d.cts +12 -0
- package/dist/types-Bwksz_U6.d.cts +136 -0
- package/dist/types-Bwksz_U6.d.ts +136 -0
- package/dist/userOp-CFv4wNkl.d.cts +33 -0
- package/dist/userOp-CFv4wNkl.d.ts +33 -0
- package/dist/utils/index.cjs +60 -0
- package/dist/utils/index.cjs.map +1 -0
- package/dist/utils/index.d.cts +47 -0
- package/dist/utils/index.d.ts +47 -0
- package/dist/utils/index.mjs +60 -0
- package/dist/utils/index.mjs.map +1 -0
- package/package.json +151 -0
|
@@ -0,0 +1,831 @@
|
|
|
1
|
+
import {
|
|
2
|
+
encodeExecutionCalldata
|
|
3
|
+
} from "./chunk-CPLIK3VF.mjs";
|
|
4
|
+
import {
|
|
5
|
+
__export,
|
|
6
|
+
toDelegationStruct
|
|
7
|
+
} from "./chunk-UUDQWENY.mjs";
|
|
8
|
+
|
|
9
|
+
// src/DelegationFramework/utils.ts
|
|
10
|
+
import { ERC1967Proxy } from "@metamask/delegation-abis";
|
|
11
|
+
import { encodeDeployData } from "viem";
|
|
12
|
+
import { getCode } from "viem/actions";
|
|
13
|
+
|
|
14
|
+
// src/DelegationFramework/DeleGatorCore/read.ts
|
|
15
|
+
var read_exports = {};
|
|
16
|
+
__export(read_exports, {
|
|
17
|
+
getDelegationManager: () => read,
|
|
18
|
+
getDeposit: () => read2,
|
|
19
|
+
getEntryPoint: () => read3,
|
|
20
|
+
getNonce: () => read4,
|
|
21
|
+
getProxyImplementation: () => read5,
|
|
22
|
+
getProxyVersion: () => read6,
|
|
23
|
+
isValidSignature: () => read7
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
// src/DelegationFramework/DeleGatorCore/methods/getDelegationManager.ts
|
|
27
|
+
import { DeleGatorCore } from "@metamask/delegation-abis";
|
|
28
|
+
import { readContract } from "viem/actions";
|
|
29
|
+
var read = async ({
|
|
30
|
+
client,
|
|
31
|
+
contractAddress
|
|
32
|
+
}) => await readContract(client, {
|
|
33
|
+
address: contractAddress,
|
|
34
|
+
abi: DeleGatorCore.abi,
|
|
35
|
+
functionName: "delegationManager"
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
// src/DelegationFramework/DeleGatorCore/methods/getDeposit.ts
|
|
39
|
+
import { DeleGatorCore as DeleGatorCore2 } from "@metamask/delegation-abis";
|
|
40
|
+
import { readContract as readContract2 } from "viem/actions";
|
|
41
|
+
var read2 = async ({
|
|
42
|
+
client,
|
|
43
|
+
contractAddress
|
|
44
|
+
}) => await readContract2(client, {
|
|
45
|
+
address: contractAddress,
|
|
46
|
+
abi: DeleGatorCore2.abi,
|
|
47
|
+
functionName: "getDeposit"
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
// src/DelegationFramework/DeleGatorCore/methods/getEntryPoint.ts
|
|
51
|
+
import { DeleGatorCore as DeleGatorCore3 } from "@metamask/delegation-abis";
|
|
52
|
+
import { readContract as readContract3 } from "viem/actions";
|
|
53
|
+
var read3 = async ({
|
|
54
|
+
client,
|
|
55
|
+
contractAddress
|
|
56
|
+
}) => await readContract3(client, {
|
|
57
|
+
address: contractAddress,
|
|
58
|
+
abi: DeleGatorCore3.abi,
|
|
59
|
+
functionName: "entryPoint"
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
// src/DelegationFramework/DeleGatorCore/methods/getNonce.ts
|
|
63
|
+
import { DeleGatorCore as DeleGatorCore4 } from "@metamask/delegation-abis";
|
|
64
|
+
import { readContract as readContract4 } from "viem/actions";
|
|
65
|
+
var read4 = async ({
|
|
66
|
+
client,
|
|
67
|
+
contractAddress,
|
|
68
|
+
key
|
|
69
|
+
}) => await readContract4(client, {
|
|
70
|
+
address: contractAddress,
|
|
71
|
+
abi: DeleGatorCore4.abi,
|
|
72
|
+
functionName: "getNonce",
|
|
73
|
+
args: key ? [key] : void 0
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// src/DelegationFramework/DeleGatorCore/methods/getProxyImplementation.ts
|
|
77
|
+
import { DeleGatorCore as DeleGatorCore5 } from "@metamask/delegation-abis";
|
|
78
|
+
import { readContract as readContract5 } from "viem/actions";
|
|
79
|
+
var read5 = async ({
|
|
80
|
+
client,
|
|
81
|
+
contractAddress
|
|
82
|
+
}) => await readContract5(client, {
|
|
83
|
+
address: contractAddress,
|
|
84
|
+
abi: DeleGatorCore5.abi,
|
|
85
|
+
functionName: "getImplementation"
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// src/DelegationFramework/DeleGatorCore/methods/getProxyVersion.ts
|
|
89
|
+
import { DeleGatorCore as DeleGatorCore6 } from "@metamask/delegation-abis";
|
|
90
|
+
import { readContract as readContract6 } from "viem/actions";
|
|
91
|
+
var read6 = async ({
|
|
92
|
+
client,
|
|
93
|
+
contractAddress
|
|
94
|
+
}) => await readContract6(client, {
|
|
95
|
+
address: contractAddress,
|
|
96
|
+
abi: DeleGatorCore6.abi,
|
|
97
|
+
functionName: "getInitializedVersion"
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
// src/DelegationFramework/DeleGatorCore/methods/isValidSignature.ts
|
|
101
|
+
import { DeleGatorCore as DeleGatorCore7 } from "@metamask/delegation-abis";
|
|
102
|
+
import { encodeFunctionData } from "viem";
|
|
103
|
+
import { readContract as readContract7 } from "viem/actions";
|
|
104
|
+
var read7 = async ({
|
|
105
|
+
client,
|
|
106
|
+
contractAddress,
|
|
107
|
+
hash,
|
|
108
|
+
signature
|
|
109
|
+
}) => await readContract7(client, {
|
|
110
|
+
address: contractAddress,
|
|
111
|
+
abi: DeleGatorCore7.abi,
|
|
112
|
+
functionName: "isValidSignature",
|
|
113
|
+
args: [hash, signature]
|
|
114
|
+
});
|
|
115
|
+
var encode = ({
|
|
116
|
+
hash,
|
|
117
|
+
signature
|
|
118
|
+
}) => {
|
|
119
|
+
return encodeFunctionData({
|
|
120
|
+
abi: DeleGatorCore7.abi,
|
|
121
|
+
functionName: "isValidSignature",
|
|
122
|
+
args: [hash, signature]
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
// src/DelegationFramework/utils.ts
|
|
127
|
+
async function isContractDeployed({
|
|
128
|
+
client,
|
|
129
|
+
contractAddress
|
|
130
|
+
}) {
|
|
131
|
+
const code = await getCode(client, {
|
|
132
|
+
address: contractAddress
|
|
133
|
+
});
|
|
134
|
+
return Boolean(code) && code !== "0x";
|
|
135
|
+
}
|
|
136
|
+
async function isImplementationExpected({
|
|
137
|
+
client,
|
|
138
|
+
contractAddress,
|
|
139
|
+
expectedImplementationAddress
|
|
140
|
+
}) {
|
|
141
|
+
if (!await isContractDeployed({ client, contractAddress })) {
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
const implementationAddress = await read5({
|
|
145
|
+
client,
|
|
146
|
+
contractAddress
|
|
147
|
+
});
|
|
148
|
+
return implementationAddress === expectedImplementationAddress;
|
|
149
|
+
}
|
|
150
|
+
var encodeProxyCreationCode = ({
|
|
151
|
+
implementationAddress,
|
|
152
|
+
initcode
|
|
153
|
+
}) => encodeDeployData({
|
|
154
|
+
abi: ERC1967Proxy.abi,
|
|
155
|
+
args: [implementationAddress, initcode],
|
|
156
|
+
bytecode: ERC1967Proxy.bytecode
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
// src/DelegationFramework/HybridDeleGator/methods/initialize.ts
|
|
160
|
+
import { HybridDeleGator } from "@metamask/delegation-abis";
|
|
161
|
+
import { encodeFunctionData as encodeFunctionData2 } from "viem";
|
|
162
|
+
import { simulateContract, writeContract } from "viem/actions";
|
|
163
|
+
var simulate = async ({
|
|
164
|
+
client,
|
|
165
|
+
hybridDeleGatorAddress,
|
|
166
|
+
eoaOwner,
|
|
167
|
+
p256Owners
|
|
168
|
+
}) => {
|
|
169
|
+
return simulateContract(client, {
|
|
170
|
+
address: hybridDeleGatorAddress,
|
|
171
|
+
abi: HybridDeleGator.abi,
|
|
172
|
+
functionName: "initialize",
|
|
173
|
+
args: [
|
|
174
|
+
eoaOwner,
|
|
175
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
176
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
177
|
+
p256Owners.map((p256Owner) => p256Owner.y)
|
|
178
|
+
]
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
var encode2 = ({
|
|
182
|
+
eoaOwner,
|
|
183
|
+
p256Owners
|
|
184
|
+
}) => {
|
|
185
|
+
return encodeFunctionData2({
|
|
186
|
+
abi: HybridDeleGator.abi,
|
|
187
|
+
functionName: "initialize",
|
|
188
|
+
args: [
|
|
189
|
+
eoaOwner,
|
|
190
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
191
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
192
|
+
p256Owners.map((p256Owner) => p256Owner.y)
|
|
193
|
+
]
|
|
194
|
+
});
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/DelegationFramework/HybridDeleGator/encode.ts
|
|
198
|
+
var encode_exports = {};
|
|
199
|
+
__export(encode_exports, {
|
|
200
|
+
addKey: () => encode3,
|
|
201
|
+
initializeHybridDeleGator: () => encode2,
|
|
202
|
+
reinitializeHybridDeleGator: () => encode4,
|
|
203
|
+
removeKey: () => encode5,
|
|
204
|
+
updateSigners: () => encode6
|
|
205
|
+
});
|
|
206
|
+
|
|
207
|
+
// src/DelegationFramework/HybridDeleGator/methods/addKey.ts
|
|
208
|
+
import { HybridDeleGator as HybridDeleGator2 } from "@metamask/delegation-abis";
|
|
209
|
+
import { encodeFunctionData as encodeFunctionData3 } from "viem";
|
|
210
|
+
import { simulateContract as simulateContract2, writeContract as writeContract2 } from "viem/actions";
|
|
211
|
+
var simulate2 = async ({
|
|
212
|
+
client,
|
|
213
|
+
hybridDeleGatorAddress,
|
|
214
|
+
p256Owner
|
|
215
|
+
}) => {
|
|
216
|
+
return simulateContract2(client, {
|
|
217
|
+
address: hybridDeleGatorAddress,
|
|
218
|
+
abi: HybridDeleGator2.abi,
|
|
219
|
+
functionName: "addKey",
|
|
220
|
+
args: [p256Owner.keyId, p256Owner.x, p256Owner.y]
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
var encode3 = ({ p256Owner }) => {
|
|
224
|
+
return encodeFunctionData3({
|
|
225
|
+
abi: HybridDeleGator2.abi,
|
|
226
|
+
functionName: "addKey",
|
|
227
|
+
args: [p256Owner.keyId, p256Owner.x, p256Owner.y]
|
|
228
|
+
});
|
|
229
|
+
};
|
|
230
|
+
|
|
231
|
+
// src/DelegationFramework/HybridDeleGator/methods/reinitialize.ts
|
|
232
|
+
import { HybridDeleGator as HybridDeleGator3 } from "@metamask/delegation-abis";
|
|
233
|
+
import { encodeFunctionData as encodeFunctionData4 } from "viem";
|
|
234
|
+
import { simulateContract as simulateContract3, writeContract as writeContract3 } from "viem/actions";
|
|
235
|
+
var simulate3 = async ({
|
|
236
|
+
client,
|
|
237
|
+
hybridDeleGatorAddress,
|
|
238
|
+
version,
|
|
239
|
+
eoaOwner,
|
|
240
|
+
p256Owners,
|
|
241
|
+
removeExistingP256Owners
|
|
242
|
+
}) => {
|
|
243
|
+
return simulateContract3(client, {
|
|
244
|
+
address: hybridDeleGatorAddress,
|
|
245
|
+
abi: HybridDeleGator3.abi,
|
|
246
|
+
functionName: "reinitialize",
|
|
247
|
+
args: [
|
|
248
|
+
version,
|
|
249
|
+
eoaOwner,
|
|
250
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
251
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
252
|
+
p256Owners.map((p256Owner) => p256Owner.y),
|
|
253
|
+
removeExistingP256Owners
|
|
254
|
+
]
|
|
255
|
+
});
|
|
256
|
+
};
|
|
257
|
+
var encode4 = ({
|
|
258
|
+
version,
|
|
259
|
+
eoaOwner,
|
|
260
|
+
p256Owners,
|
|
261
|
+
removeExistingP256Owners
|
|
262
|
+
}) => {
|
|
263
|
+
return encodeFunctionData4({
|
|
264
|
+
abi: HybridDeleGator3.abi,
|
|
265
|
+
functionName: "reinitialize",
|
|
266
|
+
args: [
|
|
267
|
+
version,
|
|
268
|
+
eoaOwner,
|
|
269
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
270
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
271
|
+
p256Owners.map((p256Owner) => p256Owner.y),
|
|
272
|
+
removeExistingP256Owners
|
|
273
|
+
]
|
|
274
|
+
});
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
// src/DelegationFramework/HybridDeleGator/methods/removeKey.ts
|
|
278
|
+
import { HybridDeleGator as HybridDeleGator4 } from "@metamask/delegation-abis";
|
|
279
|
+
import { encodeFunctionData as encodeFunctionData5 } from "viem";
|
|
280
|
+
import { simulateContract as simulateContract4, writeContract as writeContract4 } from "viem/actions";
|
|
281
|
+
var simulate4 = async ({
|
|
282
|
+
client,
|
|
283
|
+
hybridDeleGatorAddress,
|
|
284
|
+
keyId
|
|
285
|
+
}) => {
|
|
286
|
+
return simulateContract4(client, {
|
|
287
|
+
address: hybridDeleGatorAddress,
|
|
288
|
+
abi: HybridDeleGator4.abi,
|
|
289
|
+
functionName: "removeKey",
|
|
290
|
+
args: [keyId]
|
|
291
|
+
});
|
|
292
|
+
};
|
|
293
|
+
var encode5 = ({ keyId }) => {
|
|
294
|
+
return encodeFunctionData5({
|
|
295
|
+
abi: HybridDeleGator4.abi,
|
|
296
|
+
functionName: "removeKey",
|
|
297
|
+
args: [keyId]
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
// src/DelegationFramework/HybridDeleGator/methods/updateSigners.ts
|
|
302
|
+
import { HybridDeleGator as HybridDeleGator5 } from "@metamask/delegation-abis";
|
|
303
|
+
import { encodeFunctionData as encodeFunctionData6 } from "viem";
|
|
304
|
+
import { simulateContract as simulateContract5, writeContract as writeContract5 } from "viem/actions";
|
|
305
|
+
var simulate5 = async ({
|
|
306
|
+
client,
|
|
307
|
+
hybridDeleGatorAddress,
|
|
308
|
+
eoaOwner,
|
|
309
|
+
p256Owners
|
|
310
|
+
}) => {
|
|
311
|
+
return simulateContract5(client, {
|
|
312
|
+
address: hybridDeleGatorAddress,
|
|
313
|
+
abi: HybridDeleGator5.abi,
|
|
314
|
+
functionName: "updateSigners",
|
|
315
|
+
args: [
|
|
316
|
+
eoaOwner,
|
|
317
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
318
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
319
|
+
p256Owners.map((p256Owner) => p256Owner.y)
|
|
320
|
+
]
|
|
321
|
+
});
|
|
322
|
+
};
|
|
323
|
+
var encode6 = ({
|
|
324
|
+
eoaOwner,
|
|
325
|
+
p256Owners
|
|
326
|
+
}) => {
|
|
327
|
+
return encodeFunctionData6({
|
|
328
|
+
abi: HybridDeleGator5.abi,
|
|
329
|
+
functionName: "updateSigners",
|
|
330
|
+
args: [
|
|
331
|
+
eoaOwner,
|
|
332
|
+
p256Owners.map((p256Owner) => p256Owner.keyId),
|
|
333
|
+
p256Owners.map((p256Owner) => p256Owner.x),
|
|
334
|
+
p256Owners.map((p256Owner) => p256Owner.y)
|
|
335
|
+
]
|
|
336
|
+
});
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/initialize.ts
|
|
340
|
+
import { MultiSigDeleGator } from "@metamask/delegation-abis";
|
|
341
|
+
import { encodeFunctionData as encodeFunctionData7 } from "viem";
|
|
342
|
+
import { simulateContract as simulateContract6, writeContract as writeContract6 } from "viem/actions";
|
|
343
|
+
var simulate6 = async ({
|
|
344
|
+
client,
|
|
345
|
+
multiSigDeleGatorAddress,
|
|
346
|
+
owners,
|
|
347
|
+
threshold
|
|
348
|
+
}) => {
|
|
349
|
+
return simulateContract6(client, {
|
|
350
|
+
address: multiSigDeleGatorAddress,
|
|
351
|
+
abi: MultiSigDeleGator.abi,
|
|
352
|
+
functionName: "initialize",
|
|
353
|
+
args: [owners, threshold]
|
|
354
|
+
});
|
|
355
|
+
};
|
|
356
|
+
var encode7 = ({ owners, threshold }) => {
|
|
357
|
+
return encodeFunctionData7({
|
|
358
|
+
abi: MultiSigDeleGator.abi,
|
|
359
|
+
functionName: "initialize",
|
|
360
|
+
args: [owners, threshold]
|
|
361
|
+
});
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
// src/DelegationFramework/MultiSigDeleGator/encode.ts
|
|
365
|
+
var encode_exports2 = {};
|
|
366
|
+
__export(encode_exports2, {
|
|
367
|
+
addSigner: () => encode8,
|
|
368
|
+
initializeMultiSigDeleGator: () => encode7,
|
|
369
|
+
reinitializeMultiSigDeleGator: () => encode9,
|
|
370
|
+
removeSigner: () => encode10,
|
|
371
|
+
replaceSigner: () => encode11,
|
|
372
|
+
updateMultiSigParameters: () => encode12,
|
|
373
|
+
updateThreshold: () => encode13
|
|
374
|
+
});
|
|
375
|
+
|
|
376
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/addSigner.ts
|
|
377
|
+
import { MultiSigDeleGator as MultiSigDeleGator2 } from "@metamask/delegation-abis";
|
|
378
|
+
import { encodeFunctionData as encodeFunctionData8 } from "viem";
|
|
379
|
+
import { simulateContract as simulateContract7, writeContract as writeContract7 } from "viem/actions";
|
|
380
|
+
var simulate7 = async ({
|
|
381
|
+
client,
|
|
382
|
+
multiSigDeleGatorAddress,
|
|
383
|
+
signer
|
|
384
|
+
}) => {
|
|
385
|
+
return simulateContract7(client, {
|
|
386
|
+
address: multiSigDeleGatorAddress,
|
|
387
|
+
abi: MultiSigDeleGator2.abi,
|
|
388
|
+
functionName: "addSigner",
|
|
389
|
+
args: [signer]
|
|
390
|
+
});
|
|
391
|
+
};
|
|
392
|
+
var encode8 = ({ signer }) => {
|
|
393
|
+
return encodeFunctionData8({
|
|
394
|
+
abi: MultiSigDeleGator2.abi,
|
|
395
|
+
functionName: "addSigner",
|
|
396
|
+
args: [signer]
|
|
397
|
+
});
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/reinitialize.ts
|
|
401
|
+
import { MultiSigDeleGator as MultiSigDeleGator3 } from "@metamask/delegation-abis";
|
|
402
|
+
import { encodeFunctionData as encodeFunctionData9 } from "viem";
|
|
403
|
+
import { simulateContract as simulateContract8, writeContract as writeContract8 } from "viem/actions";
|
|
404
|
+
var simulate8 = async ({
|
|
405
|
+
client,
|
|
406
|
+
multiSigDeleGatorAddress,
|
|
407
|
+
version,
|
|
408
|
+
owners,
|
|
409
|
+
threshold,
|
|
410
|
+
removeExistingOwners
|
|
411
|
+
}) => {
|
|
412
|
+
return simulateContract8(client, {
|
|
413
|
+
address: multiSigDeleGatorAddress,
|
|
414
|
+
abi: MultiSigDeleGator3.abi,
|
|
415
|
+
functionName: "reinitialize",
|
|
416
|
+
args: [version, owners, threshold, removeExistingOwners]
|
|
417
|
+
});
|
|
418
|
+
};
|
|
419
|
+
var encode9 = ({
|
|
420
|
+
version,
|
|
421
|
+
owners,
|
|
422
|
+
threshold,
|
|
423
|
+
removeExistingOwners
|
|
424
|
+
}) => {
|
|
425
|
+
return encodeFunctionData9({
|
|
426
|
+
abi: MultiSigDeleGator3.abi,
|
|
427
|
+
functionName: "reinitialize",
|
|
428
|
+
args: [version, owners, threshold, removeExistingOwners]
|
|
429
|
+
});
|
|
430
|
+
};
|
|
431
|
+
|
|
432
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/removeSigner.ts
|
|
433
|
+
import { MultiSigDeleGator as MultiSigDeleGator4 } from "@metamask/delegation-abis";
|
|
434
|
+
import { encodeFunctionData as encodeFunctionData10 } from "viem";
|
|
435
|
+
import { simulateContract as simulateContract9, writeContract as writeContract9 } from "viem/actions";
|
|
436
|
+
var simulate9 = async ({
|
|
437
|
+
client,
|
|
438
|
+
multiSigDeleGatorAddress,
|
|
439
|
+
signer
|
|
440
|
+
}) => {
|
|
441
|
+
return simulateContract9(client, {
|
|
442
|
+
address: multiSigDeleGatorAddress,
|
|
443
|
+
abi: MultiSigDeleGator4.abi,
|
|
444
|
+
functionName: "removeSigner",
|
|
445
|
+
args: [signer]
|
|
446
|
+
});
|
|
447
|
+
};
|
|
448
|
+
var encode10 = ({ signer }) => {
|
|
449
|
+
return encodeFunctionData10({
|
|
450
|
+
abi: MultiSigDeleGator4.abi,
|
|
451
|
+
functionName: "removeSigner",
|
|
452
|
+
args: [signer]
|
|
453
|
+
});
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/replaceSigner.ts
|
|
457
|
+
import { MultiSigDeleGator as MultiSigDeleGator5 } from "@metamask/delegation-abis";
|
|
458
|
+
import { encodeFunctionData as encodeFunctionData11 } from "viem";
|
|
459
|
+
import { simulateContract as simulateContract10, writeContract as writeContract10 } from "viem/actions";
|
|
460
|
+
var simulate10 = async ({
|
|
461
|
+
client,
|
|
462
|
+
multiSigDeleGatorAddress,
|
|
463
|
+
oldSigner,
|
|
464
|
+
newSigner
|
|
465
|
+
}) => {
|
|
466
|
+
return simulateContract10(client, {
|
|
467
|
+
address: multiSigDeleGatorAddress,
|
|
468
|
+
abi: MultiSigDeleGator5.abi,
|
|
469
|
+
functionName: "replaceSigner",
|
|
470
|
+
args: [oldSigner, newSigner]
|
|
471
|
+
});
|
|
472
|
+
};
|
|
473
|
+
var encode11 = ({
|
|
474
|
+
oldSigner,
|
|
475
|
+
newSigner
|
|
476
|
+
}) => {
|
|
477
|
+
return encodeFunctionData11({
|
|
478
|
+
abi: MultiSigDeleGator5.abi,
|
|
479
|
+
functionName: "replaceSigner",
|
|
480
|
+
args: [oldSigner, newSigner]
|
|
481
|
+
});
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/updateMultiSigParameters.ts
|
|
485
|
+
import { MultiSigDeleGator as MultiSigDeleGator6 } from "@metamask/delegation-abis";
|
|
486
|
+
import { encodeFunctionData as encodeFunctionData12 } from "viem";
|
|
487
|
+
import { simulateContract as simulateContract11, writeContract as writeContract11 } from "viem/actions";
|
|
488
|
+
var simulate11 = async ({
|
|
489
|
+
client,
|
|
490
|
+
multiSigDeleGatorAddress,
|
|
491
|
+
owners,
|
|
492
|
+
threshold,
|
|
493
|
+
removeExistingOwners
|
|
494
|
+
}) => {
|
|
495
|
+
return simulateContract11(client, {
|
|
496
|
+
address: multiSigDeleGatorAddress,
|
|
497
|
+
abi: MultiSigDeleGator6.abi,
|
|
498
|
+
functionName: "updateMultiSigParameters",
|
|
499
|
+
args: [owners, threshold, removeExistingOwners]
|
|
500
|
+
});
|
|
501
|
+
};
|
|
502
|
+
var encode12 = ({
|
|
503
|
+
owners,
|
|
504
|
+
threshold,
|
|
505
|
+
removeExistingOwners
|
|
506
|
+
}) => {
|
|
507
|
+
return encodeFunctionData12({
|
|
508
|
+
abi: MultiSigDeleGator6.abi,
|
|
509
|
+
functionName: "updateMultiSigParameters",
|
|
510
|
+
args: [owners, threshold, removeExistingOwners]
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
// src/DelegationFramework/MultiSigDeleGator/methods/updateThreshold.ts
|
|
515
|
+
import { MultiSigDeleGator as MultiSigDeleGator7 } from "@metamask/delegation-abis";
|
|
516
|
+
import { encodeFunctionData as encodeFunctionData13 } from "viem";
|
|
517
|
+
import { simulateContract as simulateContract12, writeContract as writeContract12 } from "viem/actions";
|
|
518
|
+
var simulate12 = async ({
|
|
519
|
+
client,
|
|
520
|
+
multiSigDeleGatorAddress,
|
|
521
|
+
threshold
|
|
522
|
+
}) => {
|
|
523
|
+
return simulateContract12(client, {
|
|
524
|
+
address: multiSigDeleGatorAddress,
|
|
525
|
+
abi: MultiSigDeleGator7.abi,
|
|
526
|
+
functionName: "updateThreshold",
|
|
527
|
+
args: [threshold]
|
|
528
|
+
});
|
|
529
|
+
};
|
|
530
|
+
var encode13 = ({ threshold }) => {
|
|
531
|
+
return encodeFunctionData13({
|
|
532
|
+
abi: MultiSigDeleGator7.abi,
|
|
533
|
+
functionName: "updateThreshold",
|
|
534
|
+
args: [threshold]
|
|
535
|
+
});
|
|
536
|
+
};
|
|
537
|
+
|
|
538
|
+
// src/DelegationFramework/SimpleFactory/methods/create2Deploy.ts
|
|
539
|
+
import { SimpleFactory } from "@metamask/delegation-abis";
|
|
540
|
+
import { encodeFunctionData as encodeFunctionData14 } from "viem";
|
|
541
|
+
import { simulateContract as simulateContract13, writeContract as writeContract13 } from "viem/actions";
|
|
542
|
+
var simulate13 = async ({
|
|
543
|
+
client,
|
|
544
|
+
factoryAddress,
|
|
545
|
+
creationCode,
|
|
546
|
+
salt
|
|
547
|
+
}) => {
|
|
548
|
+
return simulateContract13(client, {
|
|
549
|
+
address: factoryAddress,
|
|
550
|
+
abi: SimpleFactory.abi,
|
|
551
|
+
functionName: "deploy",
|
|
552
|
+
args: [creationCode, salt]
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
var encode14 = (creationCode, salt) => {
|
|
556
|
+
return encodeFunctionData14({
|
|
557
|
+
abi: SimpleFactory.abi,
|
|
558
|
+
functionName: "deploy",
|
|
559
|
+
args: [creationCode, salt]
|
|
560
|
+
});
|
|
561
|
+
};
|
|
562
|
+
var execute = async ({
|
|
563
|
+
client,
|
|
564
|
+
factoryAddress,
|
|
565
|
+
creationCode,
|
|
566
|
+
salt
|
|
567
|
+
}) => {
|
|
568
|
+
const { request } = await simulate13({
|
|
569
|
+
client,
|
|
570
|
+
factoryAddress,
|
|
571
|
+
creationCode,
|
|
572
|
+
salt
|
|
573
|
+
});
|
|
574
|
+
return writeContract13(client, request);
|
|
575
|
+
};
|
|
576
|
+
|
|
577
|
+
// src/DelegationFramework/SimpleFactory/encode.ts
|
|
578
|
+
var encode_exports3 = {};
|
|
579
|
+
__export(encode_exports3, {
|
|
580
|
+
create2Deploy: () => encode14
|
|
581
|
+
});
|
|
582
|
+
|
|
583
|
+
// src/DelegationFramework/DeleGatorCore/methods/execute.ts
|
|
584
|
+
import { DeleGatorCore as DeleGatorCore8 } from "@metamask/delegation-abis";
|
|
585
|
+
import { encodeFunctionData as encodeFunctionData15 } from "viem";
|
|
586
|
+
import { simulateContract as simulateContract14, writeContract as writeContract14 } from "viem/actions";
|
|
587
|
+
var simulate14 = async ({
|
|
588
|
+
client,
|
|
589
|
+
contractAddress,
|
|
590
|
+
execution
|
|
591
|
+
}) => {
|
|
592
|
+
return simulateContract14(client, {
|
|
593
|
+
address: contractAddress,
|
|
594
|
+
abi: DeleGatorCore8.abi,
|
|
595
|
+
functionName: "execute",
|
|
596
|
+
args: [execution]
|
|
597
|
+
});
|
|
598
|
+
};
|
|
599
|
+
var execute2 = async ({
|
|
600
|
+
client,
|
|
601
|
+
contractAddress,
|
|
602
|
+
execution
|
|
603
|
+
}) => {
|
|
604
|
+
const { request } = await simulate14({
|
|
605
|
+
client,
|
|
606
|
+
contractAddress,
|
|
607
|
+
execution
|
|
608
|
+
});
|
|
609
|
+
return writeContract14(client, request);
|
|
610
|
+
};
|
|
611
|
+
var encode15 = ({ execution }) => {
|
|
612
|
+
return encodeFunctionData15({
|
|
613
|
+
abi: DeleGatorCore8.abi,
|
|
614
|
+
functionName: "execute",
|
|
615
|
+
args: [execution]
|
|
616
|
+
});
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
// src/DelegationFramework/DeleGatorCore/methods/executeWithMode.ts
|
|
620
|
+
import { DeleGatorCore as DeleGatorCore9 } from "@metamask/delegation-abis";
|
|
621
|
+
import { encodeFunctionData as encodeFunctionData16 } from "viem";
|
|
622
|
+
import { simulateContract as simulateContract15, writeContract as writeContract15 } from "viem/actions";
|
|
623
|
+
var simulate15 = async ({
|
|
624
|
+
client,
|
|
625
|
+
contractAddress,
|
|
626
|
+
mode,
|
|
627
|
+
executions
|
|
628
|
+
}) => {
|
|
629
|
+
return simulateContract15(client, {
|
|
630
|
+
address: contractAddress,
|
|
631
|
+
abi: DeleGatorCore9.abi,
|
|
632
|
+
functionName: "execute",
|
|
633
|
+
args: [mode, encodeExecutionCalldata(executions)]
|
|
634
|
+
});
|
|
635
|
+
};
|
|
636
|
+
var execute3 = async ({
|
|
637
|
+
client,
|
|
638
|
+
contractAddress,
|
|
639
|
+
mode,
|
|
640
|
+
executions
|
|
641
|
+
}) => {
|
|
642
|
+
const { request } = await simulate15({
|
|
643
|
+
client,
|
|
644
|
+
contractAddress,
|
|
645
|
+
mode,
|
|
646
|
+
executions
|
|
647
|
+
});
|
|
648
|
+
return writeContract15(client, request);
|
|
649
|
+
};
|
|
650
|
+
var encode16 = ({
|
|
651
|
+
mode,
|
|
652
|
+
executions
|
|
653
|
+
}) => {
|
|
654
|
+
return encodeFunctionData16({
|
|
655
|
+
abi: DeleGatorCore9.abi,
|
|
656
|
+
functionName: "execute",
|
|
657
|
+
args: [mode, encodeExecutionCalldata(executions)]
|
|
658
|
+
});
|
|
659
|
+
};
|
|
660
|
+
|
|
661
|
+
// src/DelegationFramework/DeleGatorCore/encode.ts
|
|
662
|
+
var encode_exports4 = {};
|
|
663
|
+
__export(encode_exports4, {
|
|
664
|
+
disableDelegation: () => encode17,
|
|
665
|
+
enableDelegation: () => encode18,
|
|
666
|
+
execute: () => encode15,
|
|
667
|
+
executeWithMode: () => encode16,
|
|
668
|
+
isValidSignature: () => encode,
|
|
669
|
+
upgradeToAndCall: () => encode19
|
|
670
|
+
});
|
|
671
|
+
|
|
672
|
+
// src/DelegationFramework/DeleGatorCore/methods/disableDelegation.ts
|
|
673
|
+
import { DeleGatorCore as DeleGatorCore10 } from "@metamask/delegation-abis";
|
|
674
|
+
import { encodeFunctionData as encodeFunctionData17 } from "viem";
|
|
675
|
+
import { simulateContract as simulateContract16, writeContract as writeContract16 } from "viem/actions";
|
|
676
|
+
var simulate16 = async ({
|
|
677
|
+
client,
|
|
678
|
+
delegationManagerAddress,
|
|
679
|
+
delegation
|
|
680
|
+
}) => {
|
|
681
|
+
const abi = DeleGatorCore10.abi;
|
|
682
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
683
|
+
return simulateContract16(client, {
|
|
684
|
+
address: delegationManagerAddress,
|
|
685
|
+
abi,
|
|
686
|
+
functionName: "disableDelegation",
|
|
687
|
+
args: [delegationStruct]
|
|
688
|
+
});
|
|
689
|
+
};
|
|
690
|
+
var execute4 = async ({
|
|
691
|
+
client,
|
|
692
|
+
delegationManagerAddress,
|
|
693
|
+
delegation
|
|
694
|
+
}) => {
|
|
695
|
+
const { request } = await simulate16({
|
|
696
|
+
client,
|
|
697
|
+
delegationManagerAddress,
|
|
698
|
+
delegation
|
|
699
|
+
});
|
|
700
|
+
return writeContract16(client, request);
|
|
701
|
+
};
|
|
702
|
+
var encode17 = ({ delegation }) => {
|
|
703
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
704
|
+
return encodeFunctionData17({
|
|
705
|
+
abi: DeleGatorCore10.abi,
|
|
706
|
+
functionName: "disableDelegation",
|
|
707
|
+
args: [delegationStruct]
|
|
708
|
+
});
|
|
709
|
+
};
|
|
710
|
+
|
|
711
|
+
// src/DelegationFramework/DeleGatorCore/methods/enableDelegation.ts
|
|
712
|
+
import { DeleGatorCore as DeleGatorCore11 } from "@metamask/delegation-abis";
|
|
713
|
+
import { encodeFunctionData as encodeFunctionData18 } from "viem";
|
|
714
|
+
import { simulateContract as simulateContract17, writeContract as writeContract17 } from "viem/actions";
|
|
715
|
+
var simulate17 = async ({
|
|
716
|
+
client,
|
|
717
|
+
delegationManagerAddress,
|
|
718
|
+
delegation
|
|
719
|
+
}) => {
|
|
720
|
+
const abi = DeleGatorCore11.abi;
|
|
721
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
722
|
+
return simulateContract17(client, {
|
|
723
|
+
address: delegationManagerAddress,
|
|
724
|
+
abi,
|
|
725
|
+
functionName: "enableDelegation",
|
|
726
|
+
args: [delegationStruct]
|
|
727
|
+
});
|
|
728
|
+
};
|
|
729
|
+
var execute5 = async ({
|
|
730
|
+
client,
|
|
731
|
+
delegationManagerAddress,
|
|
732
|
+
delegation
|
|
733
|
+
}) => {
|
|
734
|
+
const { request } = await simulate17({
|
|
735
|
+
client,
|
|
736
|
+
delegationManagerAddress,
|
|
737
|
+
delegation
|
|
738
|
+
});
|
|
739
|
+
return writeContract17(client, request);
|
|
740
|
+
};
|
|
741
|
+
var encode18 = ({ delegation }) => {
|
|
742
|
+
const delegationStruct = toDelegationStruct(delegation);
|
|
743
|
+
return encodeFunctionData18({
|
|
744
|
+
abi: DeleGatorCore11.abi,
|
|
745
|
+
functionName: "enableDelegation",
|
|
746
|
+
args: [delegationStruct]
|
|
747
|
+
});
|
|
748
|
+
};
|
|
749
|
+
|
|
750
|
+
// src/DelegationFramework/DeleGatorCore/methods/upgradeToAndCall.ts
|
|
751
|
+
import { DeleGatorCore as DeleGatorCore12 } from "@metamask/delegation-abis";
|
|
752
|
+
import { encodeFunctionData as encodeFunctionData19 } from "viem";
|
|
753
|
+
import { simulateContract as simulateContract18, writeContract as writeContract18 } from "viem/actions";
|
|
754
|
+
var simulate18 = async ({
|
|
755
|
+
client,
|
|
756
|
+
contractAddress,
|
|
757
|
+
implementation,
|
|
758
|
+
data
|
|
759
|
+
}) => {
|
|
760
|
+
return simulateContract18(client, {
|
|
761
|
+
address: contractAddress,
|
|
762
|
+
abi: DeleGatorCore12.abi,
|
|
763
|
+
functionName: "upgradeToAndCall",
|
|
764
|
+
args: [implementation, data]
|
|
765
|
+
});
|
|
766
|
+
};
|
|
767
|
+
var execute6 = async ({
|
|
768
|
+
client,
|
|
769
|
+
contractAddress,
|
|
770
|
+
implementation,
|
|
771
|
+
data
|
|
772
|
+
}) => {
|
|
773
|
+
const { request } = await simulate18({
|
|
774
|
+
client,
|
|
775
|
+
contractAddress,
|
|
776
|
+
implementation,
|
|
777
|
+
data
|
|
778
|
+
});
|
|
779
|
+
return writeContract18(client, request);
|
|
780
|
+
};
|
|
781
|
+
var encode19 = ({
|
|
782
|
+
implementation,
|
|
783
|
+
data
|
|
784
|
+
}) => {
|
|
785
|
+
return encodeFunctionData19({
|
|
786
|
+
abi: DeleGatorCore12.abi,
|
|
787
|
+
functionName: "upgradeToAndCall",
|
|
788
|
+
args: [implementation, data]
|
|
789
|
+
});
|
|
790
|
+
};
|
|
791
|
+
|
|
792
|
+
export {
|
|
793
|
+
simulate2 as simulate,
|
|
794
|
+
simulate as simulate2,
|
|
795
|
+
encode2 as encode,
|
|
796
|
+
simulate3,
|
|
797
|
+
simulate4,
|
|
798
|
+
simulate5,
|
|
799
|
+
encode_exports,
|
|
800
|
+
simulate7 as simulate6,
|
|
801
|
+
simulate6 as simulate7,
|
|
802
|
+
encode7 as encode2,
|
|
803
|
+
simulate8,
|
|
804
|
+
simulate9,
|
|
805
|
+
simulate10,
|
|
806
|
+
simulate11,
|
|
807
|
+
simulate12,
|
|
808
|
+
encode_exports2,
|
|
809
|
+
simulate13,
|
|
810
|
+
encode14 as encode3,
|
|
811
|
+
execute,
|
|
812
|
+
encode_exports3,
|
|
813
|
+
read_exports,
|
|
814
|
+
isContractDeployed,
|
|
815
|
+
isImplementationExpected,
|
|
816
|
+
encodeProxyCreationCode,
|
|
817
|
+
simulate16 as simulate14,
|
|
818
|
+
execute4 as execute2,
|
|
819
|
+
simulate17 as simulate15,
|
|
820
|
+
execute5 as execute3,
|
|
821
|
+
simulate14 as simulate16,
|
|
822
|
+
execute2 as execute4,
|
|
823
|
+
encode15 as encode4,
|
|
824
|
+
simulate15 as simulate17,
|
|
825
|
+
execute3 as execute5,
|
|
826
|
+
encode16 as encode5,
|
|
827
|
+
simulate18,
|
|
828
|
+
execute6,
|
|
829
|
+
encode_exports4
|
|
830
|
+
};
|
|
831
|
+
//# sourceMappingURL=chunk-TEI2NRPU.mjs.map
|