@ethereumjs/tx / AccessList2930Tx
Defined in: 2930/tx.ts:41
Typed transaction with optional access lists
new AccessList2930Tx(
txData
,opts
):AccessList2930Tx
Defined in: 2930/tx.ts:83
This constructor takes the values, validates them, assigns them and freezes the object.
It is not recommended to use this constructor directly. Instead use the static factory methods to assist in creating a Transaction object from varying data types.
TxOptions
= {}
AccessList2930Tx
readonly
accessList:AccessListBytes
Defined in: 2930/tx.ts:53
readonly
cache:TransactionCache
={}
Defined in: 2930/tx.ts:67
readonly
chainId:bigint
Defined in: 2930/tx.ts:54
readonly
common:Common
Defined in: 2930/tx.ts:63
readonly
data:Uint8Array
Defined in: 2930/tx.ts:51
readonly
gasLimit:bigint
Defined in: 2930/tx.ts:49
readonly
gasPrice:bigint
Defined in: 2930/tx.ts:47
readonly
nonce:bigint
Defined in: 2930/tx.ts:48
readonly
optional
r:bigint
Defined in: 2930/tx.ts:58
readonly
optional
s:bigint
Defined in: 2930/tx.ts:59
readonly
optional
to:Address
Defined in: 2930/tx.ts:52
readonly
txOptions:TxOptions
Defined in: 2930/tx.ts:65
TransactionInterface
.txOptions
type:
1
=TransactionType.AccessListEIP2930
Defined in: 2930/tx.ts:44
readonly
optional
v:bigint
Defined in: 2930/tx.ts:57
readonly
value:bigint
Defined in: 2930/tx.ts:50
addSignature(
v
,r
,s
):AccessList2930Tx
Defined in: 2930/tx.ts:273
bigint
bigint |
Uint8Array <ArrayBufferLike > |
bigint |
Uint8Array <ArrayBufferLike > |
AccessList2930Tx
TransactionInterface
.addSignature
errorStr():
string
Defined in: 2930/tx.ts:338
Return a compact error string representation of the object
string
getDataGas():
bigint
Defined in: 2930/tx.ts:151
The amount of gas paid for the data in this tx
bigint
TransactionInterface
.getDataGas
getEffectivePriorityFee(
baseFee?
):bigint
Defined in: 2930/tx.ts:144
bigint
bigint
getHashedMessageToSign():
Uint8Array
Defined in: 2930/tx.ts:245
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.
Uint8Array
TransactionInterface
.getHashedMessageToSign
getIntrinsicGas():
bigint
Defined in: 2930/tx.ts:168
The minimum gas limit which the tx to have to be valid. This covers costs as the standard fee (21000 gas), the data fee (paid for each calldata byte), the optional creation fee (if the transaction creates a contract), and if relevant the gas to be paid for access lists (EIP-2930) and authority lists (EIP-7702).
bigint
TransactionInterface
.getIntrinsicGas
getMessageToSign():
Uint8Array
Defined in: 2930/tx.ts:234
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.
const serializedMessage = tx.getMessageToSign() // use this for the HW wallet input
Uint8Array
TransactionInterface
.getMessageToSign
getMessageToVerifySignature():
Uint8Array
Defined in: 2930/tx.ts:262
Computes a sha3-256 hash which can be used to verify the signature
Uint8Array
TransactionInterface
.getMessageToVerifySignature
getSenderAddress():
Address
Defined in: 2930/tx.ts:323
Address
TransactionInterface
.getSenderAddress
getSenderPublicKey():
Uint8Array
Defined in: 2930/tx.ts:269
Returns the public key of the sender
Uint8Array
TransactionInterface
.getSenderPublicKey
getUpfrontCost():
bigint
Defined in: 2930/tx.ts:158
The up front amount that an account must have for this transaction to be valid
bigint
TransactionInterface
.getUpfrontCost
getValidationErrors():
string
[]
Defined in: 2930/tx.ts:311
string
[]
TransactionInterface
.getValidationErrors
hash():
Uint8Array
Defined in: 2930/tx.ts:255
Computes a sha3-256 hash of the serialized tx.
This method can only be used for signed txs (it throws otherwise). Use Transaction.getMessageToSign to get a tx hash for the purpose of signing.
Uint8Array
isSigned():
boolean
Defined in: 2930/tx.ts:331
boolean
isValid():
boolean
Defined in: 2930/tx.ts:315
boolean
raw():
AccessList2930TxValuesArray
Defined in: 2930/tx.ts:193
Returns a Uint8Array Array of the raw Bytes of the EIP-2930 transaction, in order.
Format: [chainId, nonce, gasPrice, gasLimit, to, value, data, accessList,
signatureYParity (v), signatureR (r), signatureS (s)]
Use AccessList2930Tx.serialize to add a transaction to a block with createBlockFromBytesArray.
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 AccessList2930Tx.getMessageToSign.
AccessList2930TxValuesArray
serialize():
Uint8Array
Defined in: 2930/tx.ts:219
Returns the serialized encoding of the EIP-2930 transaction.
Format: 0x01 || rlp([chainId, nonce, gasPrice, gasLimit, to, value, data, accessList,
signatureYParity (v), signatureR (r), signatureS (s)])
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.
Uint8Array
TransactionInterface
.serialize
sign(
privateKey
,extraEntropy
):AccessList2930Tx
Defined in: 2930/tx.ts:327
Uint8Array
boolean |
Uint8Array <ArrayBufferLike > |
AccessList2930Tx
supports(
capability
):boolean
Defined in: 2930/tx.ts:140
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.
number
boolean
toCreationAddress():
boolean
Defined in: 2930/tx.ts:176
If the tx’s to
is to the creation address
boolean
TransactionInterface
.toCreationAddress
toJSON():
JSONTx
Defined in: 2930/tx.ts:299
Returns an object with the JSON representation of the transaction
verifySignature():
boolean
Defined in: 2930/tx.ts:319
boolean