newFromMnemonicPhrase static method

Future<FuelWallet> newFromMnemonicPhrase({
  1. required String networkUrl,
  2. required String mnemonic,
})

Imports the wallet from the provided mnemonic phrase

Implementation

static Future<FuelWallet> newFromMnemonicPhrase({
  required String networkUrl,
  required String mnemonic,
}) async {
  final ISdkWallet sdkWallet;
  if (_isBeta3Url(networkUrl)) {
    final beta3Wallet = await fuels_beta3.FuelWallet.newFromMnemonicPhrase(
      networkUrl: networkUrl,
      mnemonic: mnemonic,
    );
    sdkWallet = FuelsBeta3SdkWallet(beta3Wallet);
  } else {
    final fuelsWallet = await fuels.FuelWallet.newFromMnemonicPhrase(
      networkUrl: networkUrl,
      mnemonic: mnemonic,
    );
    sdkWallet = FuelsSdkWallet(fuelsWallet);
  }
  return FuelWallet(sdkWallet);
}