StakeInfo

Composite 704 v393

pallet_subtensor::rpc_info::stake_info::StakeInfo

About This Type

Structured type: StakeInfo.

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

#NameType
0hotkeyAccountId
1coldkeyAccountId
2netuidCompact<u16>
3stakeCompact<u64>
4lockedCompact<u64>
5emissionCompact<u64>
6tao_emissionCompact<u64>
7drainCompact<u64>
8is_registeredbool

SCALE Encoding

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

Examples

Struct with 9 fields = hotkey: AccountId, coldkey: AccountId, netuid: Compact<u16>, stake: Compact<u64>, locked: Compact<u64>, emission: Compact<u64>, tao_emission: Compact<u64>, drain: Compact<u64>, is_registered: bool
0x<field0><field1><field2><field3><field4><field5><field6><field7><field8>
field 0 hotkey: AccountId
field 1 coldkey: AccountId
field 2 netuid: Compact<u16>
field 3 stake: Compact<u64>
field 4 locked: Compact<u64>
field 5 emission: Compact<u64>
field 6 tao_emission: Compact<u64>
field 7 drain: Compact<u64>
field 8 is_registered: bool

Code Examples

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

const registry = new TypeRegistry();

// Encode StakeInfo
const value = registry.createType("StakeInfo", {
  hotkey: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  coldkey: "5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY",
  netuid: 0,
  stake: 0,
  locked: 0,
  emission: 0,
  tao_emission: 0,
  drain: 0,
  is_registered: true
});
console.log("Hex:", value.toHex());

Type Parameters

AccountId = AccountId

Referenced By (2)

Type Information

Type ID
704
Kind
Composite
Path
pallet_subtensor::rpc_info::stake_info::StakeInfo
Runtime
v393