name: AccountIndex

description: A wrapper around an AccountIndex, which is a shortened, variable-length encoding for an Account. We extends from U32 to provide the number-like properties.

Hierarchy

↳ U32

↳ AccountIndex

Implements

Constructors

constructor

⊕ new AccountIndex(value?: AnyNumber): AccountIndex

Overrides U32.constructor

Defined in AccountIndex.ts:29

Parameters:

Name Type Default value
Default value value AnyNumber new BN(0)

Returns: AccountIndex


Methods

toBn

▸ toBn(): BN

Overrides AbstractInt.toBn

Defined in AccountIndex.ts:92

description: Returns the BN representation of the AccountIndex

Returns: BN


toHex

▸ toHex(): string

Implementation of Codec.toHex

Overrides UInt.toHex

Defined in AccountIndex.ts:99

description: Returns a hex string representation of the value

Returns: string


toJSON

▸ toJSON(): any

Implementation of Codec.toJSON

Overrides AbstractInt.toJSON

Defined in AccountIndex.ts:108

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

Returns: any


toString

▸ toString(): string

Implementation of Codec.toString

Overrides AbstractInt.toString

Defined in AccountIndex.ts:115

description: Returns the string representation of the value

Returns: string


toU8a

▸ toU8a(isBare?: undefined | false | true, isStorageKey?: undefined | false | true): Uint8Array

Implementation of Codec.toU8a

Overrides UInt.toU8a

Defined in AccountIndex.ts:126

description: Encodes the value as a Uint8Array as per the parity-codec specifications

Parameters:

Name Type Description
Optional isBare undefined false true true when the value has none of the type-specific prefixes (internal)
Optional isStorageKey undefined false true true when encoded as part of a key, taking case of specific logic

Returns: Uint8Array


<Static> calcLength

▸ calcLength(_value: BN | number): number

Defined in AccountIndex.ts:52

Parameters:

Name Type
_value BN number

Returns: number


<Static> decodeAccountIndex

▸ decodeAccountIndex(value: AnyNumber): BN | Uint8Array | number | string

Defined in AccountIndex.ts:36

Parameters:

Name Type
value AnyNumber

Returns: BN | Uint8Array | number | string


<Static> readLength

▸ readLength(input: Uint8Array): [number, number]

Defined in AccountIndex.ts:66

Parameters:

Name Type
input Uint8Array

Returns: [number, number]


<Static> writeLength

▸ writeLength(input: Uint8Array): Uint8Array

Defined in AccountIndex.ts:80

Parameters:

Name Type
input Uint8Array

Returns: Uint8Array


results matching ""

    No results matching ""