BaseSubstrateSigner.fromSubstrate constructor

BaseSubstrateSigner.fromSubstrate(
  1. Substrate substrate
)

Implementation

factory BaseSubstrateSigner.fromSubstrate(Substrate substrate) {
  switch (substrate.coinConf.type) {
    case EllipticCurveTypes.ed25519:
      return SubstrateED25519Signer.fromKeyBytes(substrate.priveKey.raw);
    case EllipticCurveTypes.secp256k1:
      return SubstrateEcdsaSigner.fromKeyBytes(substrate.priveKey.raw);
    default:
      return SubstrateSr25519Signer.fromKeyBytes(substrate.priveKey.raw);
  }
}