@tevm/voltaire / primitives/Transaction / Legacy
Legacy
Classes
TransactionLegacy
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:78 Factory function for creating Legacy Transaction instancesConstructors
Constructor
new TransactionLegacy(Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:78 Factory function for creating Legacy Transaction instancestx):TransactionLegacy
Parameters
tx
any
Returns
TransactionLegacy
Properties
getChainId()
getChainId: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:106 Extract chain ID from v value (EIP-155).this) =>bigint|null
Parameters
this
TransactionLegacyType
Returns
bigint | null
Chain ID if EIP-155, null if pre-EIP-155
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
getSender()
getSender: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:110 Get sender address from transaction signature (Legacy). Recovers the sender address from transaction signature components (r, s, v). Returns a BrandedAddress (20 bytes). Handles both EIP-155 (chainId in v) and pre-EIP-155 signatures. Assumes transaction uses branded types with validated signature components.this) =>AddressType
Parameters
this
TransactionLegacyType
Returns
AddressType
Sender address (20 bytes, branded)
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
If signature recovery failsExample
getSigningHash()
getSigningHash: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:108this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
hash()
hash: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:105this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
serialize()
serialize: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:104 Serialize legacy transaction to RLP encoded bytes.this) =>Uint8Array<ArrayBufferLike>
Parameters
this
TransactionLegacyType
Returns
Uint8Array<ArrayBufferLike>
RLP encoded transaction
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
verifySignature()
verifySignature: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:111this) =>boolean
Parameters
this
TransactionLegacyType
Returns
boolean
deserialize()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:94staticdeserialize: (bytes) =>TransactionLegacyPrototype
Parameters
bytes
Uint8Array
Returns
TransactionLegacyPrototype
prototype
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:103staticprototype:object
Methods
getChainId()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:97staticgetChainId(tx):bigint|null
Parameters
tx
any
Returns
bigint | null
getSender()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:99staticgetSender(tx):AddressType
Parameters
tx
any
Returns
AddressType
getSigningHash()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:98staticgetSigningHash(tx):Uint8Array<ArrayBufferLike>
Parameters
tx
any
Returns
Uint8Array<ArrayBufferLike>
hash()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:96statichash(tx):Uint8Array<ArrayBufferLike>
Parameters
tx
any
Returns
Uint8Array<ArrayBufferLike>
serialize()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:95staticserialize(tx):Uint8Array<ArrayBufferLike>
Parameters
tx
any
Returns
Uint8Array<ArrayBufferLike>
verifySignature()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:100staticverifySignature(tx):boolean
Parameters
tx
any
Returns
boolean
Interfaces
TransactionLegacyConstructor()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:19TransactionLegacyConstructor(Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:20tx):TransactionLegacyPrototype
Parameters
tx
data
Uint8Array
gasLimit
bigint
gasPrice
bigint
nonce
bigint
r
Uint8Array
s
Uint8Array
to
AddressType | null
v
bigint
value
bigint
Returns
TransactionLegacyPrototype
Properties
getChainId()
getChainId: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:35 Extract chain ID from v value (EIP-155).this) =>bigint|null
Parameters
this
TransactionLegacyType
Returns
bigint | null
Chain ID if EIP-155, null if pre-EIP-155
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
getSender()
getSender: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:37 Get sender address from transaction signature (Legacy). Recovers the sender address from transaction signature components (r, s, v). Returns a BrandedAddress (20 bytes). Handles both EIP-155 (chainId in v) and pre-EIP-155 signatures. Assumes transaction uses branded types with validated signature components.this) =>AddressType
Parameters
this
TransactionLegacyType
Returns
AddressType
Sender address (20 bytes, branded)
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
If signature recovery failsExample
getSigningHash()
getSigningHash: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:36this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
hash()
hash: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:34this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
prototype
prototype: TransactionLegacyPrototype
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:31
serialize()
serialize: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:33 Serialize legacy transaction to RLP encoded bytes.this) =>Uint8Array<ArrayBufferLike>
Parameters
this
TransactionLegacyType
Returns
Uint8Array<ArrayBufferLike>
RLP encoded transaction
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
verifySignature()
verifySignature: (Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:38this) =>boolean
Parameters
this
TransactionLegacyType
Returns
boolean
Methods
deserialize()
deserialize(Defined in: src/primitives/Transaction/Legacy/TransactionLegacyConstructor.ts:32bytes):TransactionLegacyPrototype
Parameters
bytes
Uint8Array
Returns
TransactionLegacyPrototype
Type Aliases
BrandedTransactionLegacy
BrandedTransactionLegacy = TransactionLegacyType
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:25
Deprecated
Use TransactionLegacyType insteadTransactionLegacyType
TransactionLegacyType = object
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:8
Branded Legacy Transaction type
Properties
[brand]
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:9readonly[brand]:"TransactionLegacy"
data
data: Uint8Array
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:16
gasLimit
gasLimit: bigint
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:13
gasPrice
gasPrice: bigint
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:12
nonce
nonce: bigint
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:11
r
r: Uint8Array
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:18
s
s: Uint8Array
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:19
to
to:Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:14AddressType|null
type
type: Legacy
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:10
v
v: bigint
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:17
value
value: bigint
Defined in: src/primitives/Transaction/Legacy/TransactionLegacyType.ts:15
Variables
getSigningHash()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:42constgetSigningHash: (this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
hash()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:43consthash: (this) =>Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
verifySignature()
Defined in: src/primitives/Transaction/Legacy/TransactionLegacy.js:44constverifySignature: (this) =>boolean
Parameters
this
TransactionLegacyType
Returns
boolean
Functions
deserialize()
deserialize(Defined in: src/primitives/Transaction/Legacy/deserialize.js:20 Deserialize RLP encoded legacy transaction.data):TransactionLegacyType
Parameters
data
Uint8Array<ArrayBufferLike>
RLP encoded transaction data
Returns
TransactionLegacyType
Deserialized legacy transaction
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
If data is invalid or not a valid legacy transactionExample
getChainId()
getChainId(Defined in: src/primitives/Transaction/Legacy/getChainId.js:15 Extract chain ID from v value (EIP-155).this):bigint|null
Parameters
this
TransactionLegacyType
Returns
bigint | null
Chain ID if EIP-155, null if pre-EIP-155
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
getSender()
getSender(Defined in: src/primitives/Transaction/Legacy/getSender.js:24 Get sender address from transaction signature (Legacy). Recovers the sender address from transaction signature components (r, s, v). Returns a BrandedAddress (20 bytes). Handles both EIP-155 (chainId in v) and pre-EIP-155 signatures. Assumes transaction uses branded types with validated signature components.this):AddressType
Parameters
this
TransactionLegacyType
Returns
AddressType
Sender address (20 bytes, branded)
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
If signature recovery failsExample
GetSigningHash()
GetSigningHash(Defined in: src/primitives/Transaction/Legacy/getSigningHash.js:31 Factory: Get signing hash for Legacy transaction. Computes the Keccak256 hash of the RLP-encoded transaction fields that need to be signed. Handles both EIP-155 (with chainId) and pre-EIP-155 formats. The transaction uses BrandedAddress fordeps): (this) =>Uint8Array
to field, assumed to be validated
(20 bytes or null). Returns a HashType (32 bytes).
Parameters
deps
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 hash function
rlpEncode
(data) => Uint8Array
RLP encode function
Returns
Function that computes signing hash(this):Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
Hash()
Hash(Defined in: src/primitives/Transaction/Legacy/hash.js:22 Factory: Compute transaction hash (keccak256 of serialized transaction).deps): (this) =>Uint8Array
Parameters
deps
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 hash function
Returns
Function that computes transaction hash(this):Uint8Array
Parameters
this
TransactionLegacyType
Returns
Uint8Array
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
serialize()
serialize(Defined in: src/primitives/Transaction/Legacy/serialize.js:18 Serialize legacy transaction to RLP encoded bytes.this):Uint8Array<ArrayBufferLike>
Parameters
this
TransactionLegacyType
Returns
Uint8Array<ArrayBufferLike>
RLP encoded transaction
See
https://voltaire.tevm.sh/primitives/transaction for Transaction documentationSince
0.0.0Throws
Never throwsExample
VerifySignature()
VerifySignature(Defined in: src/primitives/Transaction/Legacy/verifySignature.js:44 Factory: Verify transaction signature. Verifies that the transaction signature is valid. This checks that:deps): (this) =>boolean
- The signature components (r, s) are well-formed
- The v value is valid (for pre-EIP-155 or EIP-155 format)
- A public key can be recovered from the signature
Parameters
deps
Crypto dependencieskeccak256
(data) => Uint8Array
Keccak256 hash function
rlpEncode
(data) => Uint8Array
RLP encode function
secp256k1RecoverPublicKey
any
secp256k1 public key recovery
Returns
Function that verifies signature(this):boolean
Parameters
this
TransactionLegacyType
Returns
boolean

