ecTransferCombine function
Future<CombineSignedTransactionResult>
ecTransferCombine(
- Secp256k1KeyIdentity identity,
- SignablePayload payloadsRes
Implementation
Future<CombineSignedTransactionResult> ecTransferCombine(
Secp256k1KeyIdentity identity, rosetta.SignablePayload payloadsRes) async {
var signatures = [];
for (var p in payloadsRes.payloads) {
var hexBytes = blobToHex(await identity.sign(blobFromHex(p.hex_bytes)));
var signedPayload = {
"signing_payload": p.toJson(),
"public_key": {
"hex_bytes": identity.getPublicKey().rawKey.toHex(),
"curve_type": "secp256k1",
},
"signature_type": "ecdsa",
"hex_bytes": hexBytes,
};
signatures.add(signedPayload);
}
return combine(rosetta.ConstructionCombineRequestPart.fromMap({
"signatures": signatures,
"unsigned_transaction": payloadsRes.unsigned_transaction,
}));
}