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