build method Null safety

TransactionBuilder build(
  1. dynamic seed,
  2. int index,
  3. {String curve = "ed25519",
  4. String hashAlgo = "sha256"}
)

Implementation

TransactionBuilder build(seed, int index,
    {String curve = "ed25519", String hashAlgo = "sha256"}) {
  KeyPair keypair = crypto.deriveKeyPair(seed, index, curve: curve);
  KeyPair nextKeypair = crypto.deriveKeyPair(seed, index + 1, curve: curve);
  Uint8List address = crypto.hash(nextKeypair.publicKey, algo: hashAlgo);

  this.address = address;
  this.previousPublicKey = keypair.publicKey;
  this.timestamp = new DateTime.now().millisecondsSinceEpoch;
  this.previousSignature =
      crypto.sign(this.previousSignaturePayload(), keypair.privateKey);

  return this;
}