name: Address
description: A wrapper around an AccountId and/or AccountIndex that is encoded with a prefix. Since we are dealing with underlying publicKeys (or shorter encoded addresses), we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address is encoded as [ <prefix-byte>, ...publicKey/...bytes ] as per spec
Hierarchy
Base<AccountId | AccountIndex>
↳ Address
Constructors
constructor
⊕ new Address(value?: AnyAddress): Address
Overrides Base.constructor
Defined in Address.ts:25
Parameters:
| Name | Type | Default value |
|---|---|---|
Default value value |
AnyAddress |
new Uint8Array() |
Returns: Address
Accessors
encodedLength
getencodedLength(): number
Defined in Address.ts:67
description: The length of the value when encoded as a Uint8Array
Returns: number
rawLength
getrawLength(): number
Defined in Address.ts:81
description: The length of the raw value, either AccountIndex or AccountId
Returns: number
Methods
eq
▸ eq(other?: any): boolean
Defined in Address.ts:90
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
Defined in Address.ts:97
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Defined in Address.ts:104
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Defined in Address.ts:111
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in Address.ts:119
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> decodeAddress
▸ decodeAddress(value: AnyAddress): AccountId | AccountIndex
Defined in Address.ts:32
Parameters:
| Name | Type |
|---|---|
| value | AnyAddress |
Returns: AccountId | AccountIndex