transferCombine function
Future<CombineSignedTransactionResult>
transferCombine(
- Ed25519KeyIdentity identity,
- SignablePayload payloadsRes
Implementation
Future<CombineSignedTransactionResult> transferCombine(
Ed25519KeyIdentity identity,
rosetta.SignablePayload payloadsRes,
) async {
final signatures = [];
for (final p in payloadsRes.payloads) {
final hexBytes = blobToHex(await identity.sign(blobFromHex(p.hexBytes)));
final signedPayload = {
'signing_payload': p.toJson(),
'public_key': {
'hex_bytes': identity.getPublicKey().rawKey.toHex(),
'curve_type': 'edwards25519',
},
'signature_type': 'ed25519',
'hex_bytes': hexBytes,
};
signatures.add(signedPayload);
}
return combine(
rosetta.ConstructionCombineRequestPart.fromJson({
'signatures': signatures,
'unsigned_transaction': payloadsRes.unsignedTransaction,
}),
);
}