#locked: boolean
#timeout: number
#timer: VaultTimer
- #type?: 'BIP-44' | 'BLAKE2b'
+ #type?: 'BIP-44' | 'BLAKE2b' | 'Exodus'
#seed?: ArrayBuffer
#mnemonic?: ArrayBuffer
#parentPort?: any
if (this.#seed == null) {
throw new Error('Wallet seed not found')
}
- if (this.#type !== 'BIP-44' && this.#type !== 'BLAKE2b') {
+ if (this.#type !== 'BIP-44' && this.#type !== 'BLAKE2b' && this.#type !== 'Exodus') {
throw new Error('Invalid wallet type')
}
if (typeof index !== 'number') {
// Algorithm used for wallet functions
#parseType (action: string, data: { [key: string]: unknown }) {
if (['create', 'load', 'unlock'].includes(action)) {
- if (data.type !== 'BIP-44' && data.type !== 'BLAKE2b' && data.type !== 'Ledger') {
+ if (data.type !== 'BIP-44' && data.type !== 'BLAKE2b' && data.type !== 'Exodus' && data.type !== 'Ledger') {
throw new TypeError(`Type is required to ${action} wallet`)
}
} else if (data.type !== undefined) {
import { _update } from './update'\r
import { _verify } from './verify'\r
\r
-export type WalletType = 'BIP-44' | 'BLAKE2b' | 'Ledger'\r
+export type WalletType = 'BIP-44' | 'BLAKE2b' | 'Exodus' | 'Ledger'\r
\r
/**\r
* Represents a wallet containing numerous Nano accounts derived from a single\r
* @param {string} seed - Used to derive child accounts\r
* @returns Wallet in a locked state\r
*/\r
- static async load (type: 'BIP-44' | 'BLAKE2b', password: string, seed: string): Promise<Wallet>\r
+ static async load (type: 'BIP-44' | 'BLAKE2b' | 'Exodus', password: string, seed: string): Promise<Wallet>\r
/**\r
* Imports an existing HD wallet by using an entropy value generated using a\r
* cryptographically strong pseudorandom number generator.\r
* @param {string} [mnemonicSalt] - Used to alter the seed derived from the mnemonic phrase\r
* @returns Wallet in a locked state\r
*/\r
- static async load (type: 'BIP-44' | 'BLAKE2b', password: string, mnemonicPhrase: string, mnemonicSalt?: string): Promise<Wallet>\r
+ static async load (type: 'BIP-44' | 'BLAKE2b' | 'Exodus', password: string, mnemonicPhrase: string, mnemonicSalt?: string): Promise<Wallet>\r
static async load (type: WalletType, password: string, secret: string, mnemonicSalt?: string): Promise<Wallet> {\r
this.#isInternal = true\r
const self = new this(type)\r
if (!(this.constructor as typeof Wallet).isInternal) {\r
throw new Error(`Wallet cannot be instantiated directly. Use 'await Wallet.create()' instead.`)\r
}\r
- if (type !== 'BIP-44' && type !== 'BLAKE2b' && type !== 'Ledger') {\r
+ if (type !== 'BIP-44' && type !== 'BLAKE2b' && type !== 'Exodus' && type !== 'Ledger') {\r
throw new TypeError('Invalid wallet type', { cause: type })\r
}\r
this.#id = id ?? this.#id\r
throw new Error('Failed to initialize Ledger wallet', { cause: 'Browser is unsupported' })
}
} else {
- if (wallet.type !== 'BIP-44' && wallet.type !== 'BLAKE2b') {
+ if (wallet.type !== 'BIP-44' && wallet.type !== 'BLAKE2b' && wallet.type !== 'Exodus') {
throw new TypeError('Invalid wallet type', { cause: wallet.type })
}
if (typeof password !== 'string') {