Substrate.fromSeed constructor

Substrate.fromSeed(
  1. List<int> seedBytes,
  2. SubstrateCoins coinType
)

Create a Substrate context from a seed and coin type.

Implementation

factory Substrate.fromSeed(List<int> seedBytes, SubstrateCoins coinType) {
  final secretKey = _SubstrateUtils.getSecretKey(
    seedBytes,
    coinType.conf.type,
  );
  try {
    final privateKey = SubstratePrvKey.fromBytes(secretKey, coinType.conf);
    return Substrate._(
      privateKey,
      privateKey.publicKey,
      SubstratePath(),
      coinType.conf,
    );
  } finally {
    secretKey.zero();
  }
}