thirdweb 5.105.21 → 5.105.23

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 (145) hide show
  1. package/dist/cjs/extensions/erc1155/read/getOwnedNFTs.js +1 -0
  2. package/dist/cjs/extensions/erc1155/read/getOwnedNFTs.js.map +1 -1
  3. package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js +1 -0
  4. package/dist/cjs/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
  5. package/dist/cjs/insight/get-nfts.js +3 -3
  6. package/dist/cjs/insight/get-nfts.js.map +1 -1
  7. package/dist/cjs/insight/get-tokens.js +3 -2
  8. package/dist/cjs/insight/get-tokens.js.map +1 -1
  9. package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js +7 -33
  10. package/dist/cjs/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
  11. package/dist/cjs/transaction/actions/estimate-gas.js +3 -24
  12. package/dist/cjs/transaction/actions/estimate-gas.js.map +1 -1
  13. package/dist/cjs/utils/web/isMobile.js +0 -2
  14. package/dist/cjs/utils/web/isMobile.js.map +1 -1
  15. package/dist/cjs/version.js +1 -1
  16. package/dist/cjs/wallets/coinbase/coinbase-web.js +56 -0
  17. package/dist/cjs/wallets/coinbase/coinbase-web.js.map +1 -1
  18. package/dist/cjs/wallets/create-wallet.js +21 -4
  19. package/dist/cjs/wallets/create-wallet.js.map +1 -1
  20. package/dist/cjs/wallets/eip5792/get-calls-status.js +40 -63
  21. package/dist/cjs/wallets/eip5792/get-calls-status.js.map +1 -1
  22. package/dist/cjs/wallets/eip5792/get-capabilities.js +14 -49
  23. package/dist/cjs/wallets/eip5792/get-capabilities.js.map +1 -1
  24. package/dist/cjs/wallets/eip5792/send-calls.js +34 -48
  25. package/dist/cjs/wallets/eip5792/send-calls.js.map +1 -1
  26. package/dist/cjs/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.js +1 -5
  27. package/dist/cjs/wallets/in-app/core/eip5792/in-app-wallet-calls.js.map +1 -0
  28. package/dist/cjs/wallets/in-app/core/eip7702/minimal-account.js +650 -5
  29. package/dist/cjs/wallets/in-app/core/eip7702/minimal-account.js.map +1 -1
  30. package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js +32 -1
  31. package/dist/cjs/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
  32. package/dist/cjs/wallets/injected/index.js +55 -0
  33. package/dist/cjs/wallets/injected/index.js.map +1 -1
  34. package/dist/cjs/wallets/smart/index.js +61 -0
  35. package/dist/cjs/wallets/smart/index.js.map +1 -1
  36. package/dist/cjs/wallets/wallet-connect/controller.js +27 -25
  37. package/dist/cjs/wallets/wallet-connect/controller.js.map +1 -1
  38. package/dist/esm/extensions/erc1155/read/getOwnedNFTs.js +1 -0
  39. package/dist/esm/extensions/erc1155/read/getOwnedNFTs.js.map +1 -1
  40. package/dist/esm/extensions/erc721/read/getOwnedNFTs.js +1 -0
  41. package/dist/esm/extensions/erc721/read/getOwnedNFTs.js.map +1 -1
  42. package/dist/esm/insight/get-nfts.js +3 -3
  43. package/dist/esm/insight/get-nfts.js.map +1 -1
  44. package/dist/esm/insight/get-tokens.js +3 -2
  45. package/dist/esm/insight/get-tokens.js.map +1 -1
  46. package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js +8 -34
  47. package/dist/esm/react/web/wallets/shared/WalletConnectConnection.js.map +1 -1
  48. package/dist/esm/transaction/actions/estimate-gas.js +3 -24
  49. package/dist/esm/transaction/actions/estimate-gas.js.map +1 -1
  50. package/dist/esm/utils/web/isMobile.js +2 -2
  51. package/dist/esm/utils/web/isMobile.js.map +1 -1
  52. package/dist/esm/version.js +1 -1
  53. package/dist/esm/wallets/coinbase/coinbase-web.js +56 -0
  54. package/dist/esm/wallets/coinbase/coinbase-web.js.map +1 -1
  55. package/dist/esm/wallets/create-wallet.js +21 -4
  56. package/dist/esm/wallets/create-wallet.js.map +1 -1
  57. package/dist/esm/wallets/eip5792/get-calls-status.js +39 -63
  58. package/dist/esm/wallets/eip5792/get-calls-status.js.map +1 -1
  59. package/dist/esm/wallets/eip5792/get-capabilities.js +13 -49
  60. package/dist/esm/wallets/eip5792/get-capabilities.js.map +1 -1
  61. package/dist/esm/wallets/eip5792/send-calls.js +33 -48
  62. package/dist/esm/wallets/eip5792/send-calls.js.map +1 -1
  63. package/dist/esm/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.js +1 -5
  64. package/dist/esm/wallets/in-app/core/eip5792/in-app-wallet-calls.js.map +1 -0
  65. package/dist/esm/wallets/in-app/core/eip7702/minimal-account.js +650 -5
  66. package/dist/esm/wallets/in-app/core/eip7702/minimal-account.js.map +1 -1
  67. package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js +32 -1
  68. package/dist/esm/wallets/in-app/core/wallet/enclave-wallet.js.map +1 -1
  69. package/dist/esm/wallets/injected/index.js +56 -1
  70. package/dist/esm/wallets/injected/index.js.map +1 -1
  71. package/dist/esm/wallets/smart/index.js +61 -0
  72. package/dist/esm/wallets/smart/index.js.map +1 -1
  73. package/dist/esm/wallets/wallet-connect/controller.js +27 -25
  74. package/dist/esm/wallets/wallet-connect/controller.js.map +1 -1
  75. package/dist/types/bridge/Webhook.d.ts +2 -2
  76. package/dist/types/insight/get-nfts.d.ts +1 -0
  77. package/dist/types/insight/get-nfts.d.ts.map +1 -1
  78. package/dist/types/insight/get-tokens.d.ts +1 -0
  79. package/dist/types/insight/get-tokens.d.ts.map +1 -1
  80. package/dist/types/react/core/hooks/wallets/useWaitForCallsReceipt.d.ts +1 -1
  81. package/dist/types/react/core/utils/storage.d.ts +1 -1
  82. package/dist/types/react/web/utils/storage.d.ts +1 -1
  83. package/dist/types/react/web/wallets/shared/WalletConnectConnection.d.ts.map +1 -1
  84. package/dist/types/transaction/actions/estimate-gas.d.ts.map +1 -1
  85. package/dist/types/utils/web/isMobile.d.ts +0 -8
  86. package/dist/types/utils/web/isMobile.d.ts.map +1 -1
  87. package/dist/types/version.d.ts +1 -1
  88. package/dist/types/wallets/coinbase/coinbase-web.d.ts.map +1 -1
  89. package/dist/types/wallets/create-wallet.d.ts.map +1 -1
  90. package/dist/types/wallets/eip5792/get-calls-status.d.ts +2 -1
  91. package/dist/types/wallets/eip5792/get-calls-status.d.ts.map +1 -1
  92. package/dist/types/wallets/eip5792/get-capabilities.d.ts +1 -0
  93. package/dist/types/wallets/eip5792/get-capabilities.d.ts.map +1 -1
  94. package/dist/types/wallets/eip5792/send-calls.d.ts +6 -1
  95. package/dist/types/wallets/eip5792/send-calls.d.ts.map +1 -1
  96. package/dist/types/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.d.ts +3 -2
  97. package/dist/types/wallets/in-app/core/eip5792/in-app-wallet-calls.d.ts.map +1 -0
  98. package/dist/types/wallets/in-app/core/eip7702/minimal-account.d.ts.map +1 -1
  99. package/dist/types/wallets/in-app/core/wallet/enclave-wallet.d.ts.map +1 -1
  100. package/dist/types/wallets/injected/index.d.ts.map +1 -1
  101. package/dist/types/wallets/interfaces/wallet.d.ts +22 -0
  102. package/dist/types/wallets/interfaces/wallet.d.ts.map +1 -1
  103. package/dist/types/wallets/smart/index.d.ts.map +1 -1
  104. package/dist/types/wallets/wallet-connect/controller.d.ts.map +1 -1
  105. package/package.json +3 -3
  106. package/src/extensions/erc1155/read/getOwnedNFTs.ts +1 -0
  107. package/src/extensions/erc721/read/getOwnedNFTs.ts +1 -0
  108. package/src/insight/get-nfts.ts +4 -3
  109. package/src/insight/get-tokens.ts +4 -2
  110. package/src/react/web/wallets/shared/WalletConnectConnection.tsx +11 -46
  111. package/src/transaction/actions/estimate-gas.ts +14 -42
  112. package/src/utils/web/isMobile.ts +2 -2
  113. package/src/version.ts +1 -1
  114. package/src/wallets/coinbase/coinbase-web.ts +66 -0
  115. package/src/wallets/create-wallet.ts +53 -31
  116. package/src/wallets/eip5792/get-calls-status.test.ts +156 -146
  117. package/src/wallets/eip5792/get-calls-status.ts +44 -73
  118. package/src/wallets/eip5792/get-capabilities.test.ts +216 -205
  119. package/src/wallets/eip5792/get-capabilities.ts +23 -64
  120. package/src/wallets/eip5792/send-calls.test.ts +183 -189
  121. package/src/wallets/eip5792/send-calls.ts +53 -71
  122. package/src/wallets/in-app/core/{eip5972 → eip5792}/in-app-wallet-calls.ts +4 -8
  123. package/src/wallets/in-app/core/eip7702/minimal-account.ts +666 -5
  124. package/src/wallets/in-app/core/wallet/enclave-wallet.ts +36 -1
  125. package/src/wallets/injected/index.ts +63 -0
  126. package/src/wallets/interfaces/wallet.ts +31 -0
  127. package/src/wallets/smart/index.ts +69 -1
  128. package/src/wallets/wallet-connect/controller.ts +28 -25
  129. package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-calls.js.map +0 -1
  130. package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js +0 -41
  131. package/dist/cjs/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js.map +0 -1
  132. package/dist/cjs/wallets/smart/lib/smart-wallet-capabilities.js +0 -30
  133. package/dist/cjs/wallets/smart/lib/smart-wallet-capabilities.js.map +0 -1
  134. package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-calls.js.map +0 -1
  135. package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js +0 -38
  136. package/dist/esm/wallets/in-app/core/eip5972/in-app-wallet-capabilities.js.map +0 -1
  137. package/dist/esm/wallets/smart/lib/smart-wallet-capabilities.js +0 -27
  138. package/dist/esm/wallets/smart/lib/smart-wallet-capabilities.js.map +0 -1
  139. package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-calls.d.ts.map +0 -1
  140. package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-capabilities.d.ts +0 -20
  141. package/dist/types/wallets/in-app/core/eip5972/in-app-wallet-capabilities.d.ts.map +0 -1
  142. package/dist/types/wallets/smart/lib/smart-wallet-capabilities.d.ts +0 -20
  143. package/dist/types/wallets/smart/lib/smart-wallet-capabilities.d.ts.map +0 -1
  144. package/src/wallets/in-app/core/eip5972/in-app-wallet-capabilities.ts +0 -47
  145. package/src/wallets/smart/lib/smart-wallet-capabilities.ts +0 -32
@@ -2,6 +2,7 @@ import { getCachedChain } from "../../../../chains/utils.js";
2
2
  import { getBytecode } from "../../../../contract/actions/get-bytecode.js";
3
3
  import { getContract, } from "../../../../contract/contract.js";
4
4
  import { execute } from "../../../../extensions/erc7702/__generated__/MinimalAccount/write/execute.js";
5
+ import { getRpcClient } from "../../../../rpc/rpc.js";
5
6
  import { toSerializableTransaction } from "../../../../transaction/actions/to-serializable-transaction.js";
6
7
  import { getAddress } from "../../../../utils/address.js";
7
8
  import { randomBytesHex } from "../../../../utils/random.js";
@@ -19,15 +20,21 @@ export const create7702MinimalAccount = (args) => {
19
20
  address: adminAccount.address,
20
21
  chain,
21
22
  client,
23
+ abi: MinimalAccountAbi,
22
24
  });
23
25
  // check if account has been delegated already
24
26
  let authorization;
25
27
  const isMinimalAccount = await is7702MinimalAccount(eoaContract);
26
28
  if (!isMinimalAccount) {
27
29
  // if not, sign authorization
28
- const nonce = firstTx.nonce
29
- ? BigInt(firstTx.nonce) + (sponsorGas ? 0n : 1n)
30
- : 0n; // TODO (7702): get remote nonce if not provided, should be in the tx though
30
+ let nonce = firstTx.nonce
31
+ ? BigInt(firstTx.nonce)
32
+ : BigInt(await getNonce({
33
+ client,
34
+ address: adminAccount.address,
35
+ chain: getCachedChain(firstTx.chainId),
36
+ }));
37
+ nonce += sponsorGas ? 0n : 1n;
31
38
  const auth = await adminAccount.signAuthorization?.({
32
39
  address: MINIMAL_ACCOUNT_IMPLEMENTATION_ADDRESS,
33
40
  chainId: firstTx.chainId,
@@ -121,10 +128,54 @@ export const create7702MinimalAccount = (args) => {
121
128
  },
122
129
  signMessage: ({ message, originalMessage, chainId, }) => adminAccount.signMessage({ chainId, message, originalMessage }),
123
130
  signTypedData: (_typedData) => adminAccount.signTypedData(_typedData),
131
+ sendCalls: async (options) => {
132
+ const { inAppWalletSendCalls } = await import("../eip5792/in-app-wallet-calls.js");
133
+ const firstCall = options.calls[0];
134
+ if (!firstCall) {
135
+ throw new Error("No calls to send");
136
+ }
137
+ const client = firstCall.client;
138
+ const chain = firstCall.chain || options.chain;
139
+ const id = await inAppWalletSendCalls({
140
+ account: minimalAccount,
141
+ calls: options.calls,
142
+ });
143
+ return { chain, client, id };
144
+ },
145
+ getCallsStatus: async (options) => {
146
+ const { inAppWalletGetCallsStatus } = await import("../eip5792/in-app-wallet-calls.js");
147
+ return inAppWalletGetCallsStatus(options);
148
+ },
149
+ getCapabilities: async (options) => {
150
+ return {
151
+ [options.chainId ?? 1]: {
152
+ atomic: {
153
+ status: "supported",
154
+ },
155
+ paymasterService: {
156
+ supported: sponsorGas ?? false,
157
+ },
158
+ },
159
+ };
160
+ },
124
161
  };
125
162
  return minimalAccount;
126
163
  };
127
- async function is7702MinimalAccount(eoaContract) {
164
+ async function getNonce(args) {
165
+ const { client, address, chain } = args;
166
+ const rpcRequest = getRpcClient({
167
+ chain,
168
+ client,
169
+ });
170
+ const nonce = await import("../../../../rpc/actions/eth_getTransactionCount.js").then(({ eth_getTransactionCount }) => eth_getTransactionCount(rpcRequest, {
171
+ address,
172
+ blockTag: "pending",
173
+ }));
174
+ return nonce;
175
+ }
176
+ async function is7702MinimalAccount(
177
+ // biome-ignore lint/suspicious/noExplicitAny: TODO properly type tw contract
178
+ eoaContract) {
128
179
  const code = await getBytecode(eoaContract);
129
180
  const isDelegated = code.length > 0 && code.startsWith("0xef0100");
130
181
  const target = `0x${code.slice(8, 48)}`;
@@ -133,7 +184,7 @@ async function is7702MinimalAccount(eoaContract) {
133
184
  MINIMAL_ACCOUNT_IMPLEMENTATION_ADDRESS.toLowerCase());
134
185
  }
135
186
  async function waitForTransactionHash(args) {
136
- const timeout = args.timeoutMs || 120000; // 2mins
187
+ const timeout = args.timeoutMs || 300000; // 5mins
137
188
  const interval = args.intervalMs || 1000; // 1s
138
189
  const endtime = Date.now() + timeout;
139
190
  while (Date.now() < endtime) {
@@ -148,4 +199,598 @@ async function waitForTransactionHash(args) {
148
199
  }
149
200
  throw new Error(`Timeout waiting for transaction to be mined on chain ${args.options.chain.id} with transactionId: ${args.transactionId}`);
150
201
  }
202
+ const MinimalAccountAbi = [
203
+ { type: "receive", stateMutability: "payable" },
204
+ {
205
+ type: "function",
206
+ name: "createSessionWithSig",
207
+ inputs: [
208
+ {
209
+ name: "sessionSpec",
210
+ type: "tuple",
211
+ internalType: "struct SessionLib.SessionSpec",
212
+ components: [
213
+ { name: "signer", type: "address", internalType: "address" },
214
+ { name: "isWildcard", type: "bool", internalType: "bool" },
215
+ { name: "expiresAt", type: "uint256", internalType: "uint256" },
216
+ {
217
+ name: "callPolicies",
218
+ type: "tuple[]",
219
+ internalType: "struct SessionLib.CallSpec[]",
220
+ components: [
221
+ { name: "target", type: "address", internalType: "address" },
222
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
223
+ {
224
+ name: "maxValuePerUse",
225
+ type: "uint256",
226
+ internalType: "uint256",
227
+ },
228
+ {
229
+ name: "valueLimit",
230
+ type: "tuple",
231
+ internalType: "struct SessionLib.UsageLimit",
232
+ components: [
233
+ {
234
+ name: "limitType",
235
+ type: "uint8",
236
+ internalType: "enum SessionLib.LimitType",
237
+ },
238
+ { name: "limit", type: "uint256", internalType: "uint256" },
239
+ { name: "period", type: "uint256", internalType: "uint256" },
240
+ ],
241
+ },
242
+ {
243
+ name: "constraints",
244
+ type: "tuple[]",
245
+ internalType: "struct SessionLib.Constraint[]",
246
+ components: [
247
+ {
248
+ name: "condition",
249
+ type: "uint8",
250
+ internalType: "enum SessionLib.Condition",
251
+ },
252
+ { name: "index", type: "uint64", internalType: "uint64" },
253
+ {
254
+ name: "refValue",
255
+ type: "bytes32",
256
+ internalType: "bytes32",
257
+ },
258
+ {
259
+ name: "limit",
260
+ type: "tuple",
261
+ internalType: "struct SessionLib.UsageLimit",
262
+ components: [
263
+ {
264
+ name: "limitType",
265
+ type: "uint8",
266
+ internalType: "enum SessionLib.LimitType",
267
+ },
268
+ {
269
+ name: "limit",
270
+ type: "uint256",
271
+ internalType: "uint256",
272
+ },
273
+ {
274
+ name: "period",
275
+ type: "uint256",
276
+ internalType: "uint256",
277
+ },
278
+ ],
279
+ },
280
+ ],
281
+ },
282
+ ],
283
+ },
284
+ {
285
+ name: "transferPolicies",
286
+ type: "tuple[]",
287
+ internalType: "struct SessionLib.TransferSpec[]",
288
+ components: [
289
+ { name: "target", type: "address", internalType: "address" },
290
+ {
291
+ name: "maxValuePerUse",
292
+ type: "uint256",
293
+ internalType: "uint256",
294
+ },
295
+ {
296
+ name: "valueLimit",
297
+ type: "tuple",
298
+ internalType: "struct SessionLib.UsageLimit",
299
+ components: [
300
+ {
301
+ name: "limitType",
302
+ type: "uint8",
303
+ internalType: "enum SessionLib.LimitType",
304
+ },
305
+ { name: "limit", type: "uint256", internalType: "uint256" },
306
+ { name: "period", type: "uint256", internalType: "uint256" },
307
+ ],
308
+ },
309
+ ],
310
+ },
311
+ { name: "uid", type: "bytes32", internalType: "bytes32" },
312
+ ],
313
+ },
314
+ { name: "signature", type: "bytes", internalType: "bytes" },
315
+ ],
316
+ outputs: [],
317
+ stateMutability: "nonpayable",
318
+ },
319
+ {
320
+ type: "function",
321
+ name: "eip712Domain",
322
+ inputs: [],
323
+ outputs: [
324
+ { name: "fields", type: "bytes1", internalType: "bytes1" },
325
+ { name: "name", type: "string", internalType: "string" },
326
+ { name: "version", type: "string", internalType: "string" },
327
+ { name: "chainId", type: "uint256", internalType: "uint256" },
328
+ { name: "verifyingContract", type: "address", internalType: "address" },
329
+ { name: "salt", type: "bytes32", internalType: "bytes32" },
330
+ { name: "extensions", type: "uint256[]", internalType: "uint256[]" },
331
+ ],
332
+ stateMutability: "view",
333
+ },
334
+ {
335
+ type: "function",
336
+ name: "execute",
337
+ inputs: [
338
+ {
339
+ name: "calls",
340
+ type: "tuple[]",
341
+ internalType: "struct Call[]",
342
+ components: [
343
+ { name: "target", type: "address", internalType: "address" },
344
+ { name: "value", type: "uint256", internalType: "uint256" },
345
+ { name: "data", type: "bytes", internalType: "bytes" },
346
+ ],
347
+ },
348
+ ],
349
+ outputs: [],
350
+ stateMutability: "payable",
351
+ },
352
+ {
353
+ type: "function",
354
+ name: "executeWithSig",
355
+ inputs: [
356
+ {
357
+ name: "wrappedCalls",
358
+ type: "tuple",
359
+ internalType: "struct WrappedCalls",
360
+ components: [
361
+ {
362
+ name: "calls",
363
+ type: "tuple[]",
364
+ internalType: "struct Call[]",
365
+ components: [
366
+ { name: "target", type: "address", internalType: "address" },
367
+ { name: "value", type: "uint256", internalType: "uint256" },
368
+ { name: "data", type: "bytes", internalType: "bytes" },
369
+ ],
370
+ },
371
+ { name: "uid", type: "bytes32", internalType: "bytes32" },
372
+ ],
373
+ },
374
+ { name: "signature", type: "bytes", internalType: "bytes" },
375
+ ],
376
+ outputs: [],
377
+ stateMutability: "payable",
378
+ },
379
+ {
380
+ type: "function",
381
+ name: "getCallPoliciesForSigner",
382
+ inputs: [{ name: "signer", type: "address", internalType: "address" }],
383
+ outputs: [
384
+ {
385
+ name: "",
386
+ type: "tuple[]",
387
+ internalType: "struct SessionLib.CallSpec[]",
388
+ components: [
389
+ { name: "target", type: "address", internalType: "address" },
390
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
391
+ { name: "maxValuePerUse", type: "uint256", internalType: "uint256" },
392
+ {
393
+ name: "valueLimit",
394
+ type: "tuple",
395
+ internalType: "struct SessionLib.UsageLimit",
396
+ components: [
397
+ {
398
+ name: "limitType",
399
+ type: "uint8",
400
+ internalType: "enum SessionLib.LimitType",
401
+ },
402
+ { name: "limit", type: "uint256", internalType: "uint256" },
403
+ { name: "period", type: "uint256", internalType: "uint256" },
404
+ ],
405
+ },
406
+ {
407
+ name: "constraints",
408
+ type: "tuple[]",
409
+ internalType: "struct SessionLib.Constraint[]",
410
+ components: [
411
+ {
412
+ name: "condition",
413
+ type: "uint8",
414
+ internalType: "enum SessionLib.Condition",
415
+ },
416
+ { name: "index", type: "uint64", internalType: "uint64" },
417
+ { name: "refValue", type: "bytes32", internalType: "bytes32" },
418
+ {
419
+ name: "limit",
420
+ type: "tuple",
421
+ internalType: "struct SessionLib.UsageLimit",
422
+ components: [
423
+ {
424
+ name: "limitType",
425
+ type: "uint8",
426
+ internalType: "enum SessionLib.LimitType",
427
+ },
428
+ { name: "limit", type: "uint256", internalType: "uint256" },
429
+ { name: "period", type: "uint256", internalType: "uint256" },
430
+ ],
431
+ },
432
+ ],
433
+ },
434
+ ],
435
+ },
436
+ ],
437
+ stateMutability: "view",
438
+ },
439
+ {
440
+ type: "function",
441
+ name: "getSessionExpirationForSigner",
442
+ inputs: [{ name: "signer", type: "address", internalType: "address" }],
443
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
444
+ stateMutability: "view",
445
+ },
446
+ {
447
+ type: "function",
448
+ name: "getSessionStateForSigner",
449
+ inputs: [{ name: "signer", type: "address", internalType: "address" }],
450
+ outputs: [
451
+ {
452
+ name: "",
453
+ type: "tuple",
454
+ internalType: "struct SessionLib.SessionState",
455
+ components: [
456
+ {
457
+ name: "transferValue",
458
+ type: "tuple[]",
459
+ internalType: "struct SessionLib.LimitState[]",
460
+ components: [
461
+ { name: "remaining", type: "uint256", internalType: "uint256" },
462
+ { name: "target", type: "address", internalType: "address" },
463
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
464
+ { name: "index", type: "uint256", internalType: "uint256" },
465
+ ],
466
+ },
467
+ {
468
+ name: "callValue",
469
+ type: "tuple[]",
470
+ internalType: "struct SessionLib.LimitState[]",
471
+ components: [
472
+ { name: "remaining", type: "uint256", internalType: "uint256" },
473
+ { name: "target", type: "address", internalType: "address" },
474
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
475
+ { name: "index", type: "uint256", internalType: "uint256" },
476
+ ],
477
+ },
478
+ {
479
+ name: "callParams",
480
+ type: "tuple[]",
481
+ internalType: "struct SessionLib.LimitState[]",
482
+ components: [
483
+ { name: "remaining", type: "uint256", internalType: "uint256" },
484
+ { name: "target", type: "address", internalType: "address" },
485
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
486
+ { name: "index", type: "uint256", internalType: "uint256" },
487
+ ],
488
+ },
489
+ ],
490
+ },
491
+ ],
492
+ stateMutability: "view",
493
+ },
494
+ {
495
+ type: "function",
496
+ name: "getTransferPoliciesForSigner",
497
+ inputs: [{ name: "signer", type: "address", internalType: "address" }],
498
+ outputs: [
499
+ {
500
+ name: "",
501
+ type: "tuple[]",
502
+ internalType: "struct SessionLib.TransferSpec[]",
503
+ components: [
504
+ { name: "target", type: "address", internalType: "address" },
505
+ { name: "maxValuePerUse", type: "uint256", internalType: "uint256" },
506
+ {
507
+ name: "valueLimit",
508
+ type: "tuple",
509
+ internalType: "struct SessionLib.UsageLimit",
510
+ components: [
511
+ {
512
+ name: "limitType",
513
+ type: "uint8",
514
+ internalType: "enum SessionLib.LimitType",
515
+ },
516
+ { name: "limit", type: "uint256", internalType: "uint256" },
517
+ { name: "period", type: "uint256", internalType: "uint256" },
518
+ ],
519
+ },
520
+ ],
521
+ },
522
+ ],
523
+ stateMutability: "view",
524
+ },
525
+ {
526
+ type: "function",
527
+ name: "isWildcardSigner",
528
+ inputs: [{ name: "signer", type: "address", internalType: "address" }],
529
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
530
+ stateMutability: "view",
531
+ },
532
+ {
533
+ type: "function",
534
+ name: "onERC1155BatchReceived",
535
+ inputs: [
536
+ { name: "", type: "address", internalType: "address" },
537
+ { name: "", type: "address", internalType: "address" },
538
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
539
+ { name: "", type: "uint256[]", internalType: "uint256[]" },
540
+ { name: "", type: "bytes", internalType: "bytes" },
541
+ ],
542
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
543
+ stateMutability: "nonpayable",
544
+ },
545
+ {
546
+ type: "function",
547
+ name: "onERC1155Received",
548
+ inputs: [
549
+ { name: "", type: "address", internalType: "address" },
550
+ { name: "", type: "address", internalType: "address" },
551
+ { name: "", type: "uint256", internalType: "uint256" },
552
+ { name: "", type: "uint256", internalType: "uint256" },
553
+ { name: "", type: "bytes", internalType: "bytes" },
554
+ ],
555
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
556
+ stateMutability: "nonpayable",
557
+ },
558
+ {
559
+ type: "function",
560
+ name: "onERC721Received",
561
+ inputs: [
562
+ { name: "", type: "address", internalType: "address" },
563
+ { name: "", type: "address", internalType: "address" },
564
+ { name: "", type: "uint256", internalType: "uint256" },
565
+ { name: "", type: "bytes", internalType: "bytes" },
566
+ ],
567
+ outputs: [{ name: "", type: "bytes4", internalType: "bytes4" }],
568
+ stateMutability: "nonpayable",
569
+ },
570
+ {
571
+ type: "function",
572
+ name: "supportsInterface",
573
+ inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
574
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
575
+ stateMutability: "view",
576
+ },
577
+ {
578
+ type: "event",
579
+ name: "Executed",
580
+ inputs: [
581
+ { name: "to", type: "address", indexed: true, internalType: "address" },
582
+ {
583
+ name: "value",
584
+ type: "uint256",
585
+ indexed: false,
586
+ internalType: "uint256",
587
+ },
588
+ { name: "data", type: "bytes", indexed: false, internalType: "bytes" },
589
+ ],
590
+ anonymous: false,
591
+ },
592
+ {
593
+ type: "event",
594
+ name: "SessionCreated",
595
+ inputs: [
596
+ {
597
+ name: "signer",
598
+ type: "address",
599
+ indexed: true,
600
+ internalType: "address",
601
+ },
602
+ {
603
+ name: "sessionSpec",
604
+ type: "tuple",
605
+ indexed: false,
606
+ internalType: "struct SessionLib.SessionSpec",
607
+ components: [
608
+ { name: "signer", type: "address", internalType: "address" },
609
+ { name: "isWildcard", type: "bool", internalType: "bool" },
610
+ { name: "expiresAt", type: "uint256", internalType: "uint256" },
611
+ {
612
+ name: "callPolicies",
613
+ type: "tuple[]",
614
+ internalType: "struct SessionLib.CallSpec[]",
615
+ components: [
616
+ { name: "target", type: "address", internalType: "address" },
617
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
618
+ {
619
+ name: "maxValuePerUse",
620
+ type: "uint256",
621
+ internalType: "uint256",
622
+ },
623
+ {
624
+ name: "valueLimit",
625
+ type: "tuple",
626
+ internalType: "struct SessionLib.UsageLimit",
627
+ components: [
628
+ {
629
+ name: "limitType",
630
+ type: "uint8",
631
+ internalType: "enum SessionLib.LimitType",
632
+ },
633
+ { name: "limit", type: "uint256", internalType: "uint256" },
634
+ { name: "period", type: "uint256", internalType: "uint256" },
635
+ ],
636
+ },
637
+ {
638
+ name: "constraints",
639
+ type: "tuple[]",
640
+ internalType: "struct SessionLib.Constraint[]",
641
+ components: [
642
+ {
643
+ name: "condition",
644
+ type: "uint8",
645
+ internalType: "enum SessionLib.Condition",
646
+ },
647
+ { name: "index", type: "uint64", internalType: "uint64" },
648
+ {
649
+ name: "refValue",
650
+ type: "bytes32",
651
+ internalType: "bytes32",
652
+ },
653
+ {
654
+ name: "limit",
655
+ type: "tuple",
656
+ internalType: "struct SessionLib.UsageLimit",
657
+ components: [
658
+ {
659
+ name: "limitType",
660
+ type: "uint8",
661
+ internalType: "enum SessionLib.LimitType",
662
+ },
663
+ {
664
+ name: "limit",
665
+ type: "uint256",
666
+ internalType: "uint256",
667
+ },
668
+ {
669
+ name: "period",
670
+ type: "uint256",
671
+ internalType: "uint256",
672
+ },
673
+ ],
674
+ },
675
+ ],
676
+ },
677
+ ],
678
+ },
679
+ {
680
+ name: "transferPolicies",
681
+ type: "tuple[]",
682
+ internalType: "struct SessionLib.TransferSpec[]",
683
+ components: [
684
+ { name: "target", type: "address", internalType: "address" },
685
+ {
686
+ name: "maxValuePerUse",
687
+ type: "uint256",
688
+ internalType: "uint256",
689
+ },
690
+ {
691
+ name: "valueLimit",
692
+ type: "tuple",
693
+ internalType: "struct SessionLib.UsageLimit",
694
+ components: [
695
+ {
696
+ name: "limitType",
697
+ type: "uint8",
698
+ internalType: "enum SessionLib.LimitType",
699
+ },
700
+ { name: "limit", type: "uint256", internalType: "uint256" },
701
+ { name: "period", type: "uint256", internalType: "uint256" },
702
+ ],
703
+ },
704
+ ],
705
+ },
706
+ { name: "uid", type: "bytes32", internalType: "bytes32" },
707
+ ],
708
+ },
709
+ ],
710
+ anonymous: false,
711
+ },
712
+ {
713
+ type: "event",
714
+ name: "ValueReceived",
715
+ inputs: [
716
+ { name: "from", type: "address", indexed: true, internalType: "address" },
717
+ {
718
+ name: "value",
719
+ type: "uint256",
720
+ indexed: false,
721
+ internalType: "uint256",
722
+ },
723
+ ],
724
+ anonymous: false,
725
+ },
726
+ {
727
+ type: "error",
728
+ name: "AllowanceExceeded",
729
+ inputs: [
730
+ { name: "allowanceUsage", type: "uint256", internalType: "uint256" },
731
+ { name: "limit", type: "uint256", internalType: "uint256" },
732
+ { name: "period", type: "uint64", internalType: "uint64" },
733
+ ],
734
+ },
735
+ {
736
+ type: "error",
737
+ name: "CallPolicyViolated",
738
+ inputs: [
739
+ { name: "target", type: "address", internalType: "address" },
740
+ { name: "selector", type: "bytes4", internalType: "bytes4" },
741
+ ],
742
+ },
743
+ { type: "error", name: "CallReverted", inputs: [] },
744
+ {
745
+ type: "error",
746
+ name: "ConditionFailed",
747
+ inputs: [
748
+ { name: "param", type: "bytes32", internalType: "bytes32" },
749
+ { name: "refValue", type: "bytes32", internalType: "bytes32" },
750
+ { name: "condition", type: "uint8", internalType: "uint8" },
751
+ ],
752
+ },
753
+ {
754
+ type: "error",
755
+ name: "InvalidDataLength",
756
+ inputs: [
757
+ { name: "actualLength", type: "uint256", internalType: "uint256" },
758
+ { name: "expectedLength", type: "uint256", internalType: "uint256" },
759
+ ],
760
+ },
761
+ {
762
+ type: "error",
763
+ name: "InvalidSignature",
764
+ inputs: [
765
+ { name: "msgSender", type: "address", internalType: "address" },
766
+ { name: "thisAddress", type: "address", internalType: "address" },
767
+ ],
768
+ },
769
+ {
770
+ type: "error",
771
+ name: "LifetimeUsageExceeded",
772
+ inputs: [
773
+ { name: "lifetimeUsage", type: "uint256", internalType: "uint256" },
774
+ { name: "limit", type: "uint256", internalType: "uint256" },
775
+ ],
776
+ },
777
+ {
778
+ type: "error",
779
+ name: "MaxValueExceeded",
780
+ inputs: [
781
+ { name: "value", type: "uint256", internalType: "uint256" },
782
+ { name: "maxValuePerUse", type: "uint256", internalType: "uint256" },
783
+ ],
784
+ },
785
+ { type: "error", name: "NoCallsToExecute", inputs: [] },
786
+ { type: "error", name: "SessionExpired", inputs: [] },
787
+ { type: "error", name: "SessionExpiresTooSoon", inputs: [] },
788
+ { type: "error", name: "SessionZeroSigner", inputs: [] },
789
+ {
790
+ type: "error",
791
+ name: "TransferPolicyViolated",
792
+ inputs: [{ name: "target", type: "address", internalType: "address" }],
793
+ },
794
+ { type: "error", name: "UIDAlreadyProcessed", inputs: [] },
795
+ ];
151
796
  //# sourceMappingURL=minimal-account.js.map