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:28
Parameters:
| Name | Type | Default value |
|---|---|---|
Default value value |
AnyNumber | new BN(0) |
Returns: AccountIndex
Methods
eq
▸ eq(other?: any): boolean
Overrides AbstractInt.eq
Defined in AccountIndex.ts:87
description: Compares the value of the input to see if there is a match
Parameters:
| Name | Type |
|---|---|
Optional other |
any |
Returns: boolean
toHex
▸ toHex(): string
Overrides AbstractInt.toHex
Defined in codec/UInt.ts:36
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:100
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:107
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Overrides AbstractInt.toU8a
Defined in codec/UInt.ts:48
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) |
Returns: Uint8Array
<Static> calcLength
▸ calcLength(_value: BN | number): number
Defined in AccountIndex.ts:47
Parameters:
| Name | Type | |
|---|---|---|
| _value | BN |
number |
Returns: number
<Static> decodeAccountIndex
▸ decodeAccountIndex(value: AnyNumber): BN | Uint8Array | number | string
Defined in AccountIndex.ts:35
Parameters:
| Name | Type |
|---|---|
| value | AnyNumber |
Returns: BN | Uint8Array | number | string
<Static> readLength
▸ readLength(input: Uint8Array): [number, number]
Defined in AccountIndex.ts:61
Parameters:
| Name | Type |
|---|---|
| input | Uint8Array |
Returns: [number, number]
<Static> writeLength
▸ writeLength(input: Uint8Array): Uint8Array
Defined in AccountIndex.ts:75
Parameters:
| Name | Type |
|---|---|
| input | Uint8Array |
Returns: Uint8Array