-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Front/back]: Swap history #18
Comments
QVariantMap
application::get_recent_swaps()
{
QVariantMap out;
const auto& swaps = get_mm2().get_swaps();
for (auto&& swap: swaps.swaps)
{
nlohmann::json j2 = {{"maker_coin", swap.maker_coin},
{"taker_coin", swap.taker_coin},
{"maker_amount", swap.maker_amount},
{"taker_amount", swap.taker_amount},
{"type", swap.type},
{"events", swap.events},
{"my_info", swap.my_info}};
auto out_swap = QJsonDocument::fromJson(QString::fromStdString(j2.dump()).toUtf8());
out.insert(QString::fromStdString(swap.uuid), QVariant(out_swap));
}
return out;
} |
For the swap history, you just have to go through the event object, depending on the current event display information in the history. For example if I have the |
to check if a swap was successfull, i iterate through all events and check if any of them is of type |
@cipig Thank's for this specification, really precious 🙏 |
I hope cipig clarification will help you @naezith In the idea if you have at least one event that is in error the final status will probably not be success, so if you have |
Implemented ! |
QVariantMap jsonmodel:
The text was updated successfully, but these errors were encountered: