1
1
import Common from '@ethereumjs/common'
2
2
import { default as Transaction } from './legacyTransaction'
3
3
import { default as AccessListEIP2930Transaction } from './eip2930Transaction'
4
- import { TxOptions , Transaction , TxData } from './types'
4
+ import { TxOptions , TypedTransaction , TxData } from './types'
5
5
import { BN } from 'ethereumjs-util'
6
6
7
7
const DEFAULT_COMMON = new Common ( { chain : 'mainnet' } )
@@ -15,7 +15,7 @@ export default class TransactionFactory {
15
15
* @param txData - The transaction data. The `type` field will determine which transaction type is returned (if undefined, create a Transaction)
16
16
* @param txOptions - Options to pass on to the constructor of the transaction
17
17
*/
18
- public static fromTxData ( txData : TxData , txOptions : TxOptions = { } ) : Transaction {
18
+ public static fromTxData ( txData : TxData , txOptions : TxOptions = { } ) : TypedTransaction {
19
19
const common = txOptions . common ?? DEFAULT_COMMON
20
20
if ( txData . type === undefined ) {
21
21
// Assume Transaction
@@ -32,7 +32,7 @@ export default class TransactionFactory {
32
32
* @param rawData - The raw data buffer
33
33
* @param txOptions - The transaction options
34
34
*/
35
- public static fromRawData ( rawData : Buffer , txOptions : TxOptions = { } ) : Transaction {
35
+ public static fromRawData ( rawData : Buffer , txOptions : TxOptions = { } ) : TypedTransaction {
36
36
const common = txOptions . common ?? DEFAULT_COMMON
37
37
if ( rawData [ 0 ] <= 0x7f ) {
38
38
// It is an EIP-2718 Typed Transaction
0 commit comments