LegacyTransaction
Composite 331 v393ethereum::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)
| # | Name | Type |
|---|---|---|
| 0 | nonce | U256 |
| 1 | gas_price | U256 |
| 2 | gas_limit | U256 |
| 3 | action | TransactionAction |
| 4 | value | U256 |
| 5 | input | Vec<u8> |
| 6 | signature | TransactionSignature |
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: U256field 1 gas_price: U256field 2 gas_limit: U256field 3 action: TransactionActionfield 4 value: U256field 5 input: Vec<u8>field 6 signature: TransactionSignatureCode 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