You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// myRPCClient.request('eth_sendRawTransaction', [rawTx]) // submits a transaction via RPC
229
237
}
230
238
231
239
voidmain()
240
+
232
241
```
233
242
234
243
Note that `versionedHashes` and `kzgCommitments` have a real length of 32 bytes, `blobs` have a real length of `4096` bytes and values are trimmed here for brevity.
235
244
236
245
Alternatively, you can pass a `blobsData` property with an array of strings corresponding to a set of blobs and the `fromTxData` constructor will derive the corresponding `blobs`, `versionedHashes`, `kzgCommitments`, and `kzgProofs` for you.
237
246
238
-
See the [Blob Transaction Tests](./test/eip4844.spec.ts) for examples of usage in instantiating, serializing, and deserializing these transactions.
247
+
#### Serialization
248
+
249
+
Blob transactions can be serialized in two ways.
250
+
1)`tx.serialize()` - the standard serialization returns an RLP-encoded `uint8Array` that conforms to the transaction as represented after it is included in a block
251
+
2)`tx.serializeNetworkWrapper()` - this serialization format includes the `blobs` in the encoded data and is the format specified for transactions that are being submitted to/gossipped around the mempool. If you are constructing a transaction to submit via JSON-RPC, use this format.
252
+
253
+
See the [Blob Transaction Tests](./test/eip4844.spec.ts) for additional examples of usage in instantiating, serializing, and deserializing these transactions.
239
254
240
255
### EOA Code Transaction (EIP-7702)
241
256
@@ -293,10 +308,11 @@ See this [example script](./examples/transactions.ts) or the following code exam
0 commit comments