LegacyTransaction

Composite 331 v393

ethereum::transaction::legacy::LegacyTransaction

About This Type

Structured type: LegacyTransaction.

A struct-like type where each field is encoded in declaration order.

Encoding: Fields encoded consecutively in declaration order, no field names or separators.

Fields (7)

#NameType
0nonceU256
1gas_priceU256
2gas_limitU256
3actionTransactionAction
4valueU256
5inputVec<u8>
6signatureTransactionSignature

SCALE Encoding

Rule
7 fields encoded consecutively in declaration order. No field names or delimiters.
Size
sum of field sizes

Examples

Struct with 7 fields = nonce: U256, gas_price: U256, gas_limit: U256, action: TransactionAction, value: U256, input: Vec<u8>, signature: TransactionSignature
0x<field0><field1><field2><field3><field4><field5><field6>
field 0 nonce: U256
field 1 gas_price: U256
field 2 gas_limit: U256
field 3 action: TransactionAction
field 4 value: U256
field 5 input: Vec<u8>
field 6 signature: TransactionSignature

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode LegacyTransaction
const value = registry.createType("LegacyTransaction", {
  nonce: 0,
  gas_price: 0,
  gas_limit: 0,
  action: 0,
  value: 0,
  input: 0,
  signature: 0
});
console.log("Hex:", value.toHex());

Referenced By (1)

Type Information

Type ID
331
Kind
Composite
Path
ethereum::transaction::legacy::LegacyTransaction
Runtime
v393