Reference / Modules / node-api / ValidAccountId
Class: ValidAccountId
node-api.ValidAccountId
Implements
Table of contents
Constructors
Properties
Accessors
Methods
- equals
- getAddress
- toKey
- toOtherAccountId
- bech32
- computeAddress
- ethereum
- fromUnknown
- normalizeAddress
- parseKey
- polkadot
Constructors
constructor
• new ValidAccountId(accountId): ValidAccountId
Parameters
| Name | Type |
|---|---|
accountId | AnyAccountId |
Returns
Defined in
Properties
anyAccountId
• Private anyAccountId: AnyAccountId
Defined in
Accessors
address
• get address(): string
Returns
string
Implementation of
Defined in
type
• get type(): AccountType
Returns
Implementation of
Defined in
Methods
equals
▸ equals(other?): boolean
Parameters
| Name | Type |
|---|---|
other? | null | AccountId |
Returns
boolean
Defined in
getAddress
▸ getAddress(prefix): string
Parameters
| Name | Type |
|---|---|
prefix | number |
Returns
string
Defined in
toKey
▸ toKey(): string
Returns
string
Defined in
toOtherAccountId
▸ toOtherAccountId(): OtherAccountId
Returns
Defined in
bech32
▸ bech32(address): ValidAccountId
Parameters
| Name | Type |
|---|---|
address | string |
Returns
Defined in
computeAddress
▸ computeAddress(prefix, address, type): string
Parameters
| Name | Type |
|---|---|
prefix | number |
address | string |
type | AccountType |
Returns
string
Defined in
ethereum
▸ ethereum(address): ValidAccountId
Parameters
| Name | Type |
|---|---|
address | string |
Returns
Defined in
fromUnknown
▸ fromUnknown(address): undefined | ValidAccountId
Attempt to guess the account type from a given address, and instantiate the corresponding valid account. Warning: this method should NOT be used whenever caller site knows the account type. In this case use polkadot, ethereum, bech32 or :constructor
Parameters
| Name | Type | Description |
|---|---|---|
address | string | the address. |
Returns
undefined | ValidAccountId
a valid account or undefined.
Defined in
normalizeAddress
▸ normalizeAddress(address, type): string
Parameters
| Name | Type |
|---|---|
address | string |
type | AccountType |
Returns
string
Defined in
parseKey
▸ parseKey(key): ValidAccountId
Parameters
| Name | Type |
|---|---|
key | string |
Returns
Defined in
polkadot
▸ polkadot(address): ValidAccountId
Parameters
| Name | Type |
|---|---|
address | string |