newFromMnemonicPhraseAndIndex static method

Future<FuelWallet> newFromMnemonicPhraseAndIndex({
  1. required String networkUrl,
  2. required String mnemonic,
  3. required int index,
})

Derives the wallet from the provided mnemonic and index. Constructs the derivation path from the provided index and the conformed Fuel's template "m/44'/1179993420'/$index'/0/0" and imports the wallet using this path

Implementation

static Future<FuelWallet> newFromMnemonicPhraseAndIndex({
  required String networkUrl,
  required String mnemonic,
  required int index,
}) async {
  if (index < 0) {
    throw Exception('Index should be positive');
  }
  final derivationPath = "m/44'/1179993420'/$index'/0/0";
  return await FuelWallet.newFromMnemonicPhraseAndPath(
      networkUrl: networkUrl,
      mnemonic: mnemonic,
      derivationPath: derivationPath);
}