Substrate.fromPrivateKey constructor

Substrate.fromPrivateKey(
  1. List<int> privateKey,
  2. SubstrateCoins coinType
)

Create a Substrate context from a private key and coin type.

Implementation

factory Substrate.fromPrivateKey(
    List<int> privateKey, SubstrateCoins coinType) {
  final prv = SubstratePrivateKey.fromBytes(
      privateKey, SubstrateConf.getCoin(coinType));
  return Substrate._(
    prv,
    SubstratePublicKey.fromBytes(
        prv.privKey.publicKey.compressed, SubstrateConf.getCoin(coinType)),
    SubstratePath(),
    SubstrateConf.getCoin(coinType),
  );
}