*/
toBlake2bSeed (format: 'hex'): Promise<string>
}
+
/**
* Implementation derived from blake2b@2.1.4. Copyright 2017 Emil Bay
* <github@tixz.dk> (https://github.com/emilbayes/blake2b). See LICENSES/ISC.txt
}): Promise<any>
}
-export type SafeRecord = {
- label: string
- iv: ArrayBuffer
- salt: ArrayBuffer
- encrypted: ArrayBuffer
-}
-
type SweepResult = {
status: "success" | "error"
address: string
message: string
}
-
/**
* Converts a decimal amount of nano from one unit divider to another.
*
#private
static DB_NAME: string
/**
+ * Retrieves all encrypted wallets from the database.
+ *
+ * @returns Array of wallets with encrypted secrets and unencrypted metadata
+ */
+ static backup (): Promise<NamedData[]>
+ /**
* Creates a new HD wallet by using an entropy value generated using a
* cryptographically strong pseudorandom number generator.
*
*/
static create (type: 'BIP-44' | 'BLAKE2b', password: string, mnemonicSalt?: string): Promise<Wallet>
/**
- * Retrieves all encrypted wallets from the database.
- *
- * @returns Array of wallets with encrypted secrets and unencrypted metadata
- */
- static backup (): Promise<NamedData[]>
- /**
* Imports an existing HD wallet by using an entropy value generated using a
* cryptographically strong pseudorandom number generator.NamedD
*
* @returns {Promise<Wallet[]>} Restored locked Wallets
*/
static restore (): Promise<Wallet[]>
+ constructor (type: WalletType, id?: string)
+ /**
+ * @returns UUID of the wallet.
+ */
get id (): string
- get vault (): WorkerQueue
+ /**
+ * Method used to create wallet and derive accounts.
+ */
get type (): WalletType
- /** Set when calling `create()` and self-destructs after the first read. */
+ /**
+ * Set when calling `create()`. Self-destructs after the first read.
+ * @returns Mnemonic phrase used to derive the wallet seed.
+ */
get mnemonic (): string | undefined
- /** Set when calling `create()` and self-destructs after the first read. */
+ /**
+ * Set when calling `create()`. Self-destructs after the first read.
+ * @returns Seed used to derive accounts.
+ */
get seed (): string | undefined
- constructor (type: WalletType, id?: string)
/**
* Retrieves an account from a wallet using its child key derivation function.
* Defaults to the first account at index 0.
*/
destroy (): Promise<void>
/**
- * Locks the wallet and all currently derived accounts with a password that
- * will be needed to unlock it later.
- *
- * @returns True if successfully locked
+ * Clears the seed and mnemonic from the vault.
*/
- lock (): Promise<boolean>
+ lock (): void
/**
* Refreshes wallet account balances, frontiers, and representatives from the
* current state on the network.
* Unlocks the wallet using the same password as used prior to lock it.
*
* @param {string} password Used previously to lock the wallet
- * @returns True if successfully unlocked
*/
- unlock (password: string): Promise<boolean>
+ unlock (password: string): Promise<void>
/**
* Fetches the lowest-indexed unopened account from a wallet in sequential
* order. An account is unopened if it has no frontier block.
*
* Overrides the default wallet `lock()` method since as a hardware wallet it
* does not need to be encrypted by software.
- *
- * @returns True if successfully locked
*/
- lock (): Promise<boolean>
+ lock (): void
/**
* Sign a block with the Ledger device.
*
*
* @returns True if successfully unlocked
*/
- unlock (): Promise<boolean>
+ unlock (): Promise<void>
/**
* Update cache from raw block data. Suitable for offline use.
*
*/
version (): Promise<LedgerVersionResponse>
}
-
-/**
-* Processes a queue of tasks using Web Workers.
-*/
-export declare class WorkerQueue {
- #private
- static get instances (): WorkerQueue[]
- /**
- * Creates a Web Worker from a stringified script.
- *
- * @param {string} worker - Stringified worker class body
- */
- constructor (worker: string)
- prioritize<T extends Data> (data: NamedData): Promise<NamedData<T>>
- request<T extends Data> (data: NamedData): Promise<NamedData<T>>
- terminate (): void
-}