account

Stored account management.

A number of account records can be stored into a platform-specific storage. One of them can be marked as current, which will cause it to be used as a default account for methods that need one.

In Node.js, you can manage stored accounts using the Dasha CLI.

Table of contents

Interfaces

Functions

deleteAccount

deleteAccount(name: string, options?: { quiet?: boolean }): Promise<void>

Delete a stored account.

Parameters:

NameTypeDescription
namestring-
options?object-
options.quiet?booleanif true, does not throw if no account was found

Returns: Promise<void>


getAccount

getAccount(name: string): Promise<Account>

Get an account by its name. Throws if no account was found.

Parameters:

NameType
namestring

Returns: Promise<Account>


getCurrentAccountName

getCurrentAccountName(): Promise<string | undefined>

Get the name of a stored account that is marked as current, or undefined if no one is.

Returns: Promise<string | undefined>


listAccounts

listAccounts(): Promise<{ [name: string]: Account; }>

List all stored accounts.

Returns: Promise<{ [name: string]: Account; }>

a dictionary object storing accounts by their name


renameAccount

renameAccount(oldName: string, newName: string, options?: { overwrite?: boolean }): Promise<void>

Rename a stored account.

Parameters:

NameTypeDescription
oldNamestring-
newNamestring-
options?object-
options.overwrite?booleanif true, does not throw if the new name is taken.

Returns: Promise<void>


setAccount

setAccount(name: string, account: Account, options?: { overwrite?: boolean }): Promise<void>

Store an account under a name.

Parameters:

NameTypeDescription
namestring-
accountAccount-
options?object-
options.overwrite?booleanif true, does not throw if the name is taken

Returns: Promise<void>


setCurrentAccountName

setCurrentAccountName(name: string | undefined): Promise<void>

Mark a stored account as current. Pass undefined to unset a current account altogether.

Parameters:

NameType
namestring | undefined

Returns: Promise<void>

Found a mistake? Email us, and we'll send you a free t-shirt!

Enroll in beta

Request invite to our private Beta program for developers to join the waitlist. No spam, we promise.