Polkadot JS APIGlobals"generic/AccountId"AccountId

# Class: AccountId

name AccountId

description A wrapper around an AccountId/PublicKey representation. Since we are dealing with underlying PublicKeys (32 bytes in length), we extend from U8aFixed which is just a Uint8Array wrapper with a fixed length.

# Hierarchy

U8aFixed

AccountId

# Implements

# Indexable

  • [ index: number]: number

name AccountId

description A wrapper around an AccountId/PublicKey representation. Since we are dealing with underlying PublicKeys (32 bytes in length), we extend from U8aFixed which is just a Uint8Array wrapper with a fixed length.

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new AccountId(registry: Registry, value: AnyU8a): AccountId

Overrides U8aFixed.constructor

Defined in packages/types/src/generic/AccountId.ts:32

Parameters:

Name Type Default
registry Registry -
value AnyU8a new Uint8Array()

Returns: AccountId

# Properties

# Readonly registry

registry: Registry

Implementation of IU8a.registry

Inherited from Raw.registry

Defined in packages/types/src/codec/Raw.ts:30

# Accessors

# encodedLength

get encodedLength(): number

Inherited from Raw.encodedLength

Defined in packages/types/src/codec/Raw.ts:41

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Inherited from Raw.hash

Defined in packages/types/src/codec/Raw.ts:48

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Inherited from Raw.isEmpty

Defined in packages/types/src/codec/Raw.ts:55

description Returns true if the type wraps an empty/default all-0 value

Returns: boolean


# length

get length(): number

Inherited from Raw.length

Overrides IU8a.length

Defined in packages/types/src/codec/Raw.ts:62

description The length of the value

Returns: number

# Methods

# bitLength

bitLength(): number

Implementation of IU8a

Inherited from Raw.bitLength

Defined in packages/types/src/codec/Raw.ts:70

description Returns the number of bits in the value

Returns: number


# eq

eq(other?: unknown): boolean

Implementation of IU8a

Overrides Raw.eq

Defined in packages/types/src/generic/AccountId.ts:44

description Compares the value of the input to see if there is a match

Parameters:

Name Type
other? unknown

Returns: boolean


# subarray

subarray(begin: number, end?: undefined | number): Uint8Array

Inherited from Raw.subarray

Overrides IU8a.subarray

Defined in packages/types/src/codec/Raw.ts:91

description Create a new subarray from the actual buffer. This is needed for compat reasons since a new Uint8Array gets returned here

Parameters:

Name Type Description
begin number The position to start at
end? undefined | number The position to end at

Returns: Uint8Array


# toHex

toHex(): string

Inherited from Raw.toHex

Defined in packages/types/src/codec/Raw.ts:98

description Returns a hex string representation of the value

Returns: string


# toHuman

toHuman(): string

Overrides Raw.toHuman

Defined in packages/types/src/generic/AccountId.ts:51

description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Returns: string


# toJSON

toJSON(): string

Implementation of IU8a

Overrides Raw.toJSON

Defined in packages/types/src/generic/AccountId.ts:58

description Converts the Object to JSON, typically used for RPC transfers

Returns: string


# toRawType

toRawType(): string

Implementation of IU8a

Overrides U8aFixed.toRawType

Defined in packages/types/src/generic/AccountId.ts:72

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of IU8a

Overrides Raw.toString

Defined in packages/types/src/generic/AccountId.ts:65

description Returns the string representation of the value

Returns: string


# toU8a

toU8a(isBare?: undefined | false | true): Uint8Array

Inherited from Raw.toU8a

Defined in packages/types/src/codec/Raw.ts:135

description Encodes the value as a Uint8Array as per the SCALE specifications

Parameters:

Name Type Description
isBare? undefined | false | true true when the value has none of the type-specific prefixes (internal)

Returns: Uint8Array


# Static encode

encode(value: Uint8Array, ss58Format?: undefined | number): string

Defined in packages/types/src/generic/AccountId.ts:37

Parameters:

Name Type
value Uint8Array
ss58Format? undefined | number

Returns: string


# Static with

with(bitLength: BitLength, typeName?: undefined | string): ConstructorU8aFixed

Inherited from U8aFixed.with

Defined in packages/types/src/codec/U8aFixed.ts:49

Parameters:

Name Type
bitLength BitLength
typeName? undefined | string

Returns: ConstructorU8aFixed