Add nanostar_amount to StarTransaction.

This commit is contained in:
levlam 2024-12-01 11:52:45 +03:00
parent 9707d8486b
commit dfe62e6ccd

View File

@ -4383,12 +4383,16 @@ class Client::JsonStarTransaction final : public td::Jsonable {
auto star_count = transaction_->star_amount_->star_count_; auto star_count = transaction_->star_amount_->star_count_;
auto nanostar_count = transaction_->star_amount_->nanostar_count_; auto nanostar_count = transaction_->star_amount_->nanostar_count_;
if (star_count > 0 || nanostar_count > 0) { if (star_count > 0 || nanostar_count > 0) {
object("amount", star_count);
object("source", JsonStarTransactionType(transaction_->type_.get(), client_)); object("source", JsonStarTransactionType(transaction_->type_.get(), client_));
} else { } else {
object("amount", -star_count); star_count = -star_count;
nanostar_count = -nanostar_count;
object("receiver", JsonStarTransactionType(transaction_->type_.get(), client_)); object("receiver", JsonStarTransactionType(transaction_->type_.get(), client_));
} }
object("amount", star_count);
if (nanostar_count != 0) {
object("nanostar_amount", nanostar_count);
}
} }
private: private: