@@ -112,17 +112,17 @@ std::vector<uint8_t> Ark::Crypto::Transactions::Transaction::toBytes(
112112 std::begin (senderKeyBytes),
113113 std::end (senderKeyBytes));
114114
115- const auto skipRecipientId =
115+ const auto skiprecipient =
116116 type == defaults::TransactionTypes::SecondSignatureRegistration
117117 || type ==defaults::TransactionTypes::MultiSignatureRegistration;
118118
119- if (!this ->recipientId .empty () && !skipRecipientId ) {
120- std::vector<std::uint8_t > recipientIdBytes = Address::bytesFromBase58Check (
121- this ->recipientId .c_str ());
119+ if (!this ->recipient .empty () && !skiprecipient ) {
120+ std::vector<std::uint8_t > recipientBytes = Address::bytesFromBase58Check (
121+ this ->recipient .c_str ());
122122 bytes.insert (
123123 std::end (bytes),
124- std::begin (recipientIdBytes ),
125- std::end (recipientIdBytes ));
124+ std::begin (recipientBytes ),
125+ std::end (recipientBytes ));
126126 } else {
127127 std::vector<uint8_t > filler (21 , 0 );
128128 bytes.insert (
@@ -301,7 +301,7 @@ std::map<std::string, std::string> Ark::Crypto::Transactions::Transaction::toArr
301301 { " fee" , fee },
302302 { " id" , this ->id },
303303 { " network" , network },
304- { " recipientId " , this ->recipientId },
304+ { " recipient " , this ->recipient },
305305 { " secondSignature" , this ->secondSignature },
306306 { " senderPublicKey" , this ->senderPublicKey },
307307 { " signature" , this ->signature },
@@ -323,7 +323,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
323323 DynamicJsonDocument doc (docCapacity);
324324
325325 // Amount
326- doc[" amount" ] = strtoull (txArray[" amount" ].c_str (), nullptr , 10 );
326+ // >= Core v.2.5 'amount' json is string-type
327+ doc[" amount" ] = txArray[" amount" ];
327328
328329 // Asset
329330 if (this ->type == 0 ) {
@@ -365,7 +366,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
365366 };
366367
367368 // Fee
368- doc[" fee" ] = strtoull (txArray[" fee" ].c_str (), nullptr , 10 );
369+ // >= Core v.2.5 'amount' json is string-type
370+ doc[" fee" ] = txArray[" fee" ];
369371
370372 // Id
371373 doc[" id" ] = txArray[" id" ];
@@ -375,8 +377,8 @@ std::string Ark::Crypto::Transactions::Transaction::toJson() {
375377 doc[" network" ] = atoi (txArray[" network" ].c_str ());
376378 };
377379
378- // RecipientId
379- doc[" recipientId " ] = txArray[" recipientId " ];
380+ // Recipient
381+ doc[" recipient " ] = txArray[" recipient " ];
380382
381383 // SecondSignature
382384 if (std::strlen (txArray[" secondSignature" ].c_str ()) > 0 ) {
0 commit comments