Skip to content

Commit e857d95

Browse files
docs: fix inputs for BatchCallInvoker (#2684)
fix execute args
1 parent 68be3ba commit e857d95

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

site/pages/experimental/eip7702/contract-writes.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ const authorization = await walletClient.signAuthorization({
2626
})
2727

2828
// 3. Invoke the Contract's `execute` function to perform batch calls.
29-
const hash = await batchCallInvoker.write.execute([{
29+
const hash = await batchCallInvoker.write.execute([[{
3030
data: '0x',
3131
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
3232
value: parseEther('0.001'),
3333
}, {
3434
data: '0x',
3535
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
3636
value: parseEther('0.002'),
37-
}], {
37+
}]], {
3838
authorizationList: [authorization],
3939
// ↑ 4. Pass the Authorization as an option.
4040
})
@@ -335,15 +335,15 @@ const authorization = await walletClient.signAuthorization({
335335
contractAddress,
336336
})
337337

338-
const hash = await batchCallInvoker.write.execute([{ // [!code focus]
338+
const hash = await batchCallInvoker.write.execute([[{ // [!code focus]
339339
data: '0x', // [!code focus]
340340
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D', // [!code focus]
341341
value: parseEther('0.001'), // [!code focus]
342342
}, { // [!code focus]
343343
data: '0x', // [!code focus]
344344
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B', // [!code focus]
345345
value: parseEther('0.002'), // [!code focus]
346-
}], { // [!code focus]
346+
}]], { // [!code focus]
347347
authorizationList: [authorization], // [!code focus]
348348
}) // [!code focus]
349349
```
@@ -416,11 +416,11 @@ const hash = await walletClient.writeContract({
416416
address: walletClient.account.address,
417417
authorizationList: [authorization],
418418
functionName: 'execute',
419-
args: [{
419+
args: [[{
420420
data: '0x',
421421
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
422422
value: parseEther('0.001'),
423-
}],
423+
}]],
424424
})
425425
```
426426
:::
@@ -448,15 +448,15 @@ const authorization = await walletClient.signAuthorization({
448448

449449
const invoker = privateKeyToAccount('0x...') // [!code ++]
450450

451-
const hash = await batchCallInvoker.write.execute([{
451+
const hash = await batchCallInvoker.write.execute([[{
452452
data: '0x',
453453
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
454454
value: parseEther('0.001'),
455455
}, {
456456
data: '0x',
457457
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
458458
value: parseEther('0.002'),
459-
}], {
459+
}]], {
460460
account: invoker, // [!code ++]
461461
authorizationList: [authorization],
462462
})

site/pages/experimental/eip7702/sending-transactions.md

+39-33
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,19 @@ const hash = await walletClient.sendTransaction({
2525
abi,
2626
functionName: 'execute',
2727
args: [
28-
{
29-
data: '0x',
30-
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
31-
value: parseEther('0.001'),
32-
},
33-
{
34-
data: '0x',
35-
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
36-
value: parseEther('0.002'),
37-
},
38-
],
28+
[
29+
{
30+
data: '0x',
31+
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
32+
value: parseEther('0.001'),
33+
},
34+
{
35+
data: '0x',
36+
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
37+
value: parseEther('0.002'),
38+
},
39+
],
40+
]
3941
}),
4042
to: walletClient.account.address,
4143
})
@@ -261,17 +263,19 @@ const hash = await walletClient.sendTransaction({ // [!code focus]
261263
abi, // [!code focus]
262264
functionName: 'execute', // [!code focus]
263265
args: [ // [!code focus]
264-
{ // [!code focus]
265-
data: '0x', // [!code focus]
266-
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D', // [!code focus]
267-
value: parseEther('0.001'), // [!code focus]
268-
}, // [!code focus]
269-
{ // [!code focus]
270-
data: '0x', // [!code focus]
271-
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B', // [!code focus]
272-
value: parseEther('0.002'), // [!code focus]
273-
}, // [!code focus]
274-
], // [!code focus]
266+
[ // [!code focus]
267+
{ // [!code focus]
268+
data: '0x', // [!code focus]
269+
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D', // [!code focus]
270+
value: parseEther('0.001'), // [!code focus]
271+
}, // [!code focus]
272+
{ // [!code focus]
273+
data: '0x', // [!code focus]
274+
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B', // [!code focus]
275+
value: parseEther('0.002'), // [!code focus]
276+
}, // [!code focus]
277+
], // [!code focus]
278+
] // [!code focus]
275279
}), // [!code focus]
276280
to: walletClient.account.address, // [!code focus]
277281
}) // [!code focus]
@@ -351,17 +355,19 @@ const hash = await walletClient.sendTransaction({
351355
abi,
352356
functionName: 'execute',
353357
args: [
354-
{
355-
data: '0x',
356-
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
357-
value: parseEther('0.001'),
358-
},
359-
{
360-
data: '0x',
361-
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
362-
value: parseEther('0.002'),
363-
},
364-
],
358+
[
359+
{
360+
data: '0x',
361+
to: '0xcb98643b8786950F0461f3B0edf99D88F274574D',
362+
value: parseEther('0.001'),
363+
},
364+
{
365+
data: '0x',
366+
to: '0xd2135CfB216b74109775236E36d4b433F1DF507B',
367+
value: parseEther('0.002'),
368+
},
369+
],
370+
]
365371
}),
366372
to: walletClient.account.address,
367373
})

0 commit comments

Comments
 (0)