How to convert seed phrase to 12 words mnemonic?

I have found way to create new account using mnemonic phrase and then convert it to seed, like this

import { Mnemonic } from "@fuel-ts/mnemonic";
import { Wallet} from "fuels";

 const mn = Mnemonic.generate();
    const seed = Mnemonic.mnemonicToSeed(mn);
    const wallet = Wallet.fromPrivateKey(seed, NODE_URL);

Is there opposite way to convert seed to mnemonic phrase with setting how long phrase can be, for example 12 words long, same as in Fuel Wallet

It’s a one-way derivation, you cannot infer a mnemonic from a private key (seed). See How to get a mnemonic phrase from a secret key in Rust SDK?

1 Like