AccountData

Composite 5 v393

pallet_balances::types::AccountData

About This Type

Structured type: AccountData.

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 (4)

#NameType
0freeu64
1reservedu64
2frozenu64
3flagsExtraFlags

SCALE Encoding

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

Examples

Struct with 4 fields = free: u64, reserved: u64, frozen: u64, flags: ExtraFlags
0x<field0><field1><field2><field3>
field 0 free: u64
field 1 reserved: u64
field 2 frozen: u64
field 3 flags: ExtraFlags

Code Examples

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

const registry = new TypeRegistry();

// Encode AccountData
const value = registry.createType("AccountData", {
  free: 1_000_000_000n,
  reserved: 1_000_000_000n,
  frozen: 1_000_000_000n,
  flags: 0
});
console.log("Hex:", value.toHex());

Type Parameters

Balance = u64

Referenced By (1)

Type Information

Type ID
5
Kind
Composite
Path
pallet_balances::types::AccountData
Runtime
v393