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'}) {
  final KeyPair keypair = crypto.deriveKeyPair(seed, index, curve: curve);
  final KeyPair nextKeypair =
      crypto.deriveKeyPair(seed, index + 1, curve: curve);
  final Uint8List address =
      crypto.hash(nextKeypair.publicKey, algo: hashAlgo);

  this.address = address;
  previousPublicKey = keypair.publicKey;
  previousSignature =
      crypto.sign(previousSignaturePayload(), keypair.privateKey);

  return this;
}