export const ACCOUNT_KEY_HEX_LENGTH = 64
export const ADDRESS_GAP = 20
export const ALPHABET = '13456789abcdefghijkmnopqrstuwxyz'
-export const BIP39_ITERATIONS = 2048
export const BIP44_PURPOSE = 44
export const BIP44_COIN_NANO = 165
export const BURN_ADDRESS = 'nano_1111111111111111111111111111111111111111111111111111hifc8npp'
const ACCOUNT_KEY_HEX_LENGTH = ${ACCOUNT_KEY_HEX_LENGTH}
const ADDRESS_GAP = ${ADDRESS_GAP}
const ALPHABET = '${ALPHABET}'
- const BIP39_ITERATIONS = ${BIP39_ITERATIONS}
const BIP44_PURPOSE = ${BIP44_PURPOSE}
const BIP44_COIN_NANO = ${BIP44_COIN_NANO}
const BURN_ADDRESS = '${BURN_ADDRESS}'
//! SPDX-FileCopyrightText: 2025 Chris Duncan <chris@zoso.dev>\r
//! SPDX-License-Identifier: GPL-3.0-or-later\r
\r
-import { BIP39_ITERATIONS } from '../constants'\r
import { bytes, utf8 } from '../convert'\r
\r
/**\r
*/\r
export class Bip39 {\r
static #isInternal: boolean = false\r
+ static #ITERATIONS: 2048 = 2048\r
\r
/**\r
* SHA-256 hash of entropy that is appended to the entropy and subsequently\r
name: 'PBKDF2',\r
hash: 'SHA-512',\r
salt: utf8.toBytes(`mnemonic${salt.normalize('NFKD')}`),\r
- iterations: BIP39_ITERATIONS\r
+ iterations: Bip39.#ITERATIONS\r
}\r
const seed = await crypto.subtle.deriveBits(algorithm, phraseKey, 512)\r
this.#bip39Seed = new Uint8Array(seed)\r