ImpersonatedTx
Typed transaction with a new gas fee market mechanism
- TransactionType: 2
- EIP: EIP-1559
Extends
Properties
_type
protected
readonly
_type:TransactionType
Inherited from
FeeMarketEIP1559Transaction
._type
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:14
accessList
readonly
accessList:AccessListBytes
Inherited from
FeeMarketEIP1559Transaction
.accessList
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:15
AccessListJSON
readonly
AccessListJSON:AccessList
Inherited from
FeeMarketEIP1559Transaction
.AccessListJSON
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:16
activeCapabilities
protected
activeCapabilities:number
[]
List of tx type defining EIPs, e.g. 1559 (fee market) and 2930 (access lists) for FeeMarketEIP1559Transaction objects
Inherited from
FeeMarketEIP1559Transaction
.activeCapabilities
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:31
cache
cache:
TransactionCache
Inherited from
FeeMarketEIP1559Transaction
.cache
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:24
chainId
readonly
chainId:bigint
Inherited from
FeeMarketEIP1559Transaction
.chainId
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:14
common
readonly
common:Common
Inherited from
FeeMarketEIP1559Transaction
.common
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:19
data
readonly
data:Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.data
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:19
gasLimit
readonly
gasLimit:bigint
Inherited from
FeeMarketEIP1559Transaction
.gasLimit
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:16
isImpersonated
isImpersonated:
true
Defined in
packages/tx/src/ImpersonatedTx.ts:4
maxFeePerGas
readonly
maxFeePerGas:bigint
Inherited from
FeeMarketEIP1559Transaction
.maxFeePerGas
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:18
maxPriorityFeePerGas
readonly
maxPriorityFeePerGas:bigint
Inherited from
FeeMarketEIP1559Transaction
.maxPriorityFeePerGas
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:17
nonce
readonly
nonce:bigint
Inherited from
FeeMarketEIP1559Transaction
.nonce
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:15
r?
readonly
optional
r:bigint
Inherited from
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:21
s?
readonly
optional
s:bigint
Inherited from
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:22
to?
readonly
optional
to:EthjsAddress
Inherited from
FeeMarketEIP1559Transaction
.to
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:17
txOptions
protected
readonly
txOptions:TxOptions
Inherited from
FeeMarketEIP1559Transaction
.txOptions
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:25
v?
readonly
optional
v:bigint
Inherited from
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:20
value
readonly
value:bigint
Inherited from
FeeMarketEIP1559Transaction
.value
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:18
Accessors
type
get
type():TransactionType
Returns the transaction type.
Note: legacy txs will return tx type 0
.
Returns
Inherited from
FeeMarketEIP1559Transaction
.type
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:47
Methods
_getSharedErrorPostfix()
protected
_getSharedErrorPostfix():string
Returns the shared error postfix part for _error() method tx type implementations.
Returns
string
Inherited from
FeeMarketEIP1559Transaction
._getSharedErrorPostfix
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:189
_validateCannotExceedMaxInteger()
protected
_validateCannotExceedMaxInteger(values
,bits
?,cannotEqual
?):void
Validates that an object with BigInt values cannot exceed the specified bit limit.
Parameters
• values
Object containing string keys and BigInt values
• bits?: number
Number of bits to check (64 or 256)
• cannotEqual?: boolean
Pass true if the number also cannot equal one less the maximum value
Returns
void
Inherited from
FeeMarketEIP1559Transaction
._validateCannotExceedMaxInteger
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:168
addSignature()
addSignature(
v
,r
,s
,convertV
?):FeeMarketEIP1559Transaction
Returns a new transaction with the same data fields as the current, but now signed
Parameters
• v: bigint
The v
value of the signature
• r: bigint
| Uint8Array
The r
value of the signature
• s: bigint
| Uint8Array
The s
value of the signature
• convertV?: boolean
Set this to true
if the raw output of ecsign
is used. If this is false
(default)
then the raw value passed for v
will be used for the signature. For legacy transactions,
if this is set to true
, it will also set the right v
value for the chain id.
Returns
Inherited from
FeeMarketEIP1559Transaction
.addSignature
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:127
errorStr()
errorStr():
string
Return a compact error string representation of the object
Returns
string
Inherited from
FeeMarketEIP1559Transaction
.errorStr
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:135
getBaseFee()
getBaseFee():
bigint
The minimum amount of gas the tx must have (DataFee + TxFee + Creation Fee)
Returns
bigint
Inherited from
FeeMarketEIP1559Transaction
.getBaseFee
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:78
getDataFee()
getDataFee():
bigint
The amount of gas paid for the data in this tx
Returns
bigint
Inherited from
FeeMarketEIP1559Transaction
.getDataFee
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:56
getEffectivePriorityFee()
getEffectivePriorityFee(
baseFee
):bigint
Returns the minimum of calculated priority fee (from maxFeePerGas and baseFee) and maxPriorityFeePerGas
Parameters
• baseFee: bigint
Base fee retrieved from block
Returns
bigint
Inherited from
FeeMarketEIP1559Transaction
.getEffectivePriorityFee
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:61
getHashedMessageToSign()
getHashedMessageToSign():
Uint8Array
Returns the hashed serialized unsigned tx, which can be used to sign the transaction (e.g. for sending to a hardware wallet).
Note: in contrast to the legacy tx the raw message format is already serialized and doesn’t need to be RLP encoded any more.
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.getHashedMessageToSign
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:111
getMessageToSign()
getMessageToSign():
Uint8Array
Returns the raw serialized unsigned tx, which can be used to sign the transaction (e.g. for sending to a hardware wallet).
Note: in contrast to the legacy tx the raw message format is already serialized and doesn’t need to be RLP encoded any more.
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.getMessageToSign
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:103
getMessageToVerifySignature()
getMessageToVerifySignature():
Uint8Array
Computes a sha3-256 hash which can be used to verify the signature
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.getMessageToVerifySignature
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:122
getSenderAddress()
getSenderAddress():
EthjsAddress
Returns the sender’s address
Returns
Inherited from
FeeMarketEIP1559Transaction
.getSenderAddress
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:124
getSenderPublicKey()
getSenderPublicKey():
Uint8Array
Returns the public key of the sender
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.getSenderPublicKey
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:126
getUpfrontCost()
getUpfrontCost(
baseFee
?):bigint
The up front amount that an account must have for this transaction to be valid
Parameters
• baseFee?: bigint
The base fee of the block (will be set to 0 if not provided)
Returns
bigint
Inherited from
FeeMarketEIP1559Transaction
.getUpfrontCost
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:66
getValidationErrors()
getValidationErrors():
string
[]
Validates the transaction signature and minimum gas requirements.
Returns
string
[]
an array of error strings
Inherited from
FeeMarketEIP1559Transaction
.getValidationErrors
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:69
hash()
hash():
Uint8Array
Computes a sha3-256 hash of the serialized tx.
This method can only be used for signed txs (it throws otherwise). Use FeeMarketEIP1559Transaction.getMessageToSign to get a tx hash for the purpose of signing.
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.hash
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:118
isSigned()
isSigned():
boolean
Returns
boolean
Inherited from
FeeMarketEIP1559Transaction
.isSigned
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:116
isValid()
isValid():
boolean
Validates the transaction signature and minimum gas requirements.
Returns
boolean
true if the transaction is valid, false otherwise
Inherited from
FeeMarketEIP1559Transaction
.isValid
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:74
raw()
raw():
FeeMarketEIP1559TxValuesArray
Returns a Uint8Array Array of the raw Bytes of the EIP-1559 transaction, in order.
Format: [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLimit, to, value, data, accessList, signatureYParity, signatureR, signatureS]
Use FeeMarketEIP1559Transaction.serialize to add a transaction to a block with Block.fromValuesArray.
For an unsigned tx this method uses the empty Bytes values for the
signature parameters v
, r
and s
for encoding. For an EIP-155 compliant
representation for external signing use FeeMarketEIP1559Transaction.getMessageToSign.
Returns
FeeMarketEIP1559TxValuesArray
Inherited from
FeeMarketEIP1559Transaction
.raw
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:80
serialize()
serialize():
Uint8Array
Returns the serialized encoding of the EIP-1559 transaction.
Format: 0x02 || rlp([chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gasLimit, to, value, data, accessList, signatureYParity, signatureR, signatureS])
Note that in contrast to the legacy tx serialization format this is not valid RLP any more due to the raw tx type preceding and concatenated to the RLP encoding of the values.
Returns
Uint8Array
Inherited from
FeeMarketEIP1559Transaction
.serialize
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:91
sign()
sign(
privateKey
):FeeMarketEIP1559Transaction
Signs a transaction.
Note that the signed tx is returned as a new object, use as follows:
Parameters
• privateKey: Uint8Array
Returns
Inherited from
FeeMarketEIP1559Transaction
.sign
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:138
supports()
supports(
capability
):boolean
Checks if a tx type defining capability is active on a tx, for example the EIP-1559 fee market mechanism or the EIP-2930 access list feature.
Note that this is different from the tx type itself, so EIP-2930 access lists can very well be active on an EIP-1559 tx for example.
This method can be useful for feature checks if the tx type is unknown (e.g. when instantiated with the tx factory).
See Capabilities
in the types
module for a reference
on all supported capabilities.
Parameters
• capability: Capability
Returns
boolean
Inherited from
FeeMarketEIP1559Transaction
.supports
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:64
toCreationAddress()
toCreationAddress():
boolean
If the tx’s to
is to the creation address
Returns
boolean
Inherited from
FeeMarketEIP1559Transaction
.toCreationAddress
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:96
toJSON()
toJSON():
JsonTx
Returns an object with the JSON representation of the transaction
Returns
Inherited from
FeeMarketEIP1559Transaction
.toJSON
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/eip1559Transaction.d.ts:131
verifySignature()
verifySignature():
boolean
Determines if the signature is valid
Returns
boolean
Inherited from
FeeMarketEIP1559Transaction
.verifySignature
Defined in
node_modules/.pnpm/@ethereumjs+tx@5.4.0/node_modules/@ethereumjs/tx/dist/esm/baseTransaction.d.ts:120