Skip to main content

Reference / Modules / node-api / ValidAccountId

Class: ValidAccountId

node-api.ValidAccountId

Implements

Table of contents

Constructors

Properties

Accessors

Methods

Constructors

constructor

new ValidAccountId(accountId): ValidAccountId

Parameters

NameType
accountIdAnyAccountId

Returns

ValidAccountId

Defined in

Types.ts:289

Properties

anyAccountId

Private anyAccountId: AnyAccountId

Defined in

Types.ts:298

Accessors

address

get address(): string

Returns

string

Implementation of

AccountId.address

Defined in

Types.ts:300


type

get type(): AccountType

Returns

AccountType

Implementation of

AccountId.type

Defined in

Types.ts:304

Methods

equals

equals(other?): boolean

Parameters

NameType
other?null | AccountId

Returns

boolean

Defined in

Types.ts:320


getAddress

getAddress(prefix): string

Parameters

NameType
prefixnumber

Returns

string

Defined in

Types.ts:334


toKey

toKey(): string

Returns

string

Defined in

Types.ts:312


toOtherAccountId

toOtherAccountId(): OtherAccountId

Returns

OtherAccountId

Defined in

Types.ts:308


bech32

bech32(address): ValidAccountId

Parameters

NameType
addressstring

Returns

ValidAccountId

Defined in

Types.ts:346


computeAddress

computeAddress(prefix, address, type): string

Parameters

NameType
prefixnumber
addressstring
typeAccountType

Returns

string

Defined in

Types.ts:372


ethereum

ethereum(address): ValidAccountId

Parameters

NameType
addressstring

Returns

ValidAccountId

Defined in

Types.ts:342


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

NameTypeDescription
addressstringthe address.

Returns

undefined | ValidAccountId

a valid account or undefined.

Defined in

Types.ts:359


normalizeAddress

normalizeAddress(address, type): string

Parameters

NameType
addressstring
typeAccountType

Returns

string

Defined in

Types.ts:368


parseKey

parseKey(key): ValidAccountId

Parameters

NameType
keystring

Returns

ValidAccountId

Defined in

Types.ts:316


polkadot

polkadot(address): ValidAccountId

Parameters

NameType
addressstring

Returns

ValidAccountId

Defined in

Types.ts:338