We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ea9f88d commit 88dfdd0Copy full SHA for 88dfdd0
packages/tx/examples/EOACodeTx.ts
@@ -1,7 +1,6 @@
1
import { Common, Hardfork, Mainnet } from '@ethereumjs/common'
2
import { createEOACode7702Tx } from '@ethereumjs/tx'
3
-
4
-import type { PrefixedHexString } from '@ethereumjs/util'
+import { type PrefixedHexString, createAddressFromPrivateKey, randomBytes } from '@ethereumjs/util'
5
6
const ones32 = `0x${'01'.repeat(32)}` as PrefixedHexString
7
@@ -12,12 +11,13 @@ const tx = createEOACode7702Tx(
12
11
{
13
chainId: '0x2',
14
address: `0x${'20'.repeat(20)}`,
15
- nonce: ['0x1'],
+ nonce: '0x1',
16
yParity: '0x1',
17
r: ones32,
18
s: ones32,
19
},
20
],
+ to: createAddressFromPrivateKey(randomBytes(32)),
21
22
{ common },
23
)
0 commit comments