import blake2b from 'blake2b'\r
import { ACCOUNT_KEY_LENGTH, ALPHABET, PREFIX, PREFIX_LEGACY } from './constants.js'\r
import { base32, bytes, hex } from './convert.js'\r
-import Ed25519 from './ed25519.js'\r
+import { keyPair, secretKeyLength } from './workers/nano25519.js'\r
import { Rpc } from './rpc.js'\r
import { Safe } from './safe.js'\r
\r
*/\r
static async fromPrivateKey (key: string, index?: number): Promise<Account> {\r
Account.#validateKey(key)\r
- const publicKey = Ed25519.getPublicKey(key)\r
- const account = await Account.fromPublicKey(publicKey, index)\r
+ const { publicKey } = keyPair.fromSecretKey(hex.toBytes(key))\r
+ const account = await Account.fromPublicKey(bytes.toHex(publicKey), index)\r
account.#prv = key.toUpperCase()\r
return account\r
}\r