mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-11 08:05:16 -08:00
Webhooks for New Accounts (#79)
This commit is contained in:
committed by
Lee *!* Clagett
parent
524e26e1a4
commit
aa171b77c3
@@ -29,6 +29,7 @@
|
||||
#include <cstring>
|
||||
#include <memory>
|
||||
|
||||
#include "db/string.h"
|
||||
#include "wire.h"
|
||||
#include "wire/crypto.h"
|
||||
#include "wire/json/write.h"
|
||||
@@ -215,7 +216,7 @@ namespace db
|
||||
|
||||
namespace
|
||||
{
|
||||
constexpr const char* map_webhook_type[] = {"tx-confirmation"};
|
||||
constexpr const char* map_webhook_type[] = {"tx-confirmation", "new-account"};
|
||||
|
||||
template<typename F, typename T>
|
||||
void map_webhook_key(F& format, T& self)
|
||||
@@ -292,6 +293,15 @@ namespace db
|
||||
);
|
||||
}
|
||||
|
||||
void write_bytes(wire::writer& dest, const webhook_new_account& self)
|
||||
{
|
||||
wire::object(dest,
|
||||
wire::field<0>("event_id", std::cref(self.value.first.event_id)),
|
||||
wire::field<1>("token", std::cref(self.value.second.token)),
|
||||
wire::field<2>("address", address_string(self.account))
|
||||
);
|
||||
}
|
||||
|
||||
bool operator<(const webhook_dupsort& left, const webhook_dupsort& right) noexcept
|
||||
{
|
||||
return left.payment_id == right.payment_id ?
|
||||
|
||||
Reference in New Issue
Block a user