build method
Generate the transaction address, keys and signatures @param {String} seed Transaction chain seed (hexadecimal or binary buffer) @param {int} index Number of transaction on the chain @param {String} curve Elliptic curve to use for the key generation @param {String} hashAlgo Hash algorithm to use for the address generation
Implementation
Transaction build(
String seed,
int index, {
String? curve = 'ed25519',
String? hashAlgo = 'sha256',
}) {
final keypair = crypto.deriveKeyPair(seed, index, curve: curve!);
address = crypto.deriveAddress(
seed,
index + 1,
curve: curve,
hashAlgo: hashAlgo!,
);
previousPublicKey = uint8ListToHex(keypair.publicKey);
previousSignature = uint8ListToHex(
crypto.sign(previousSignaturePayload(), keypair.privateKey),
);
return this;
}