Skip to content

Commit d8fb4cc

Browse files
authored
Merge pull request #46 from session-foundation/fix-count-instead-of-bool
fix: payment history is now a number instead of a bool
2 parents 12d1723 + 73e7741 commit d8fb4cc

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

include/pro/pro.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class ProWrapper : public Napi::ObjectWrap<ProWrapper> {
241241
// "requestVersion": number,
242242
// "masterPrivKeyHex": string,
243243
// "unixTsMs": number,
244-
// "withPaymentHistory": boolean,
244+
// "count": number,
245245
// }
246246

247247
assertInfoLength(info, 1);
@@ -255,12 +255,10 @@ class ProWrapper : public Napi::ObjectWrap<ProWrapper> {
255255

256256
assertIsNumber(first.Get("requestVersion"), "proStatusRequestBody.requestVersion");
257257
assertIsNumber(first.Get("unixTsMs"), "proStatusRequestBody.unixTsMs");
258-
assertIsBoolean(
259-
first.Get("withPaymentHistory"), "proStatusRequestBody.withPaymentHistory");
258+
assertIsNumber(first.Get("count"), "proStatusRequestBody.count");
260259
auto requestVersion = first.Get("requestVersion").As<Napi::Number>();
261260
auto unix_ts_ms = toCppSysMs(first.Get("unixTsMs"), "proStatusRequestBody.unixTsMs");
262-
auto withPaymentHistory = toCppBoolean(
263-
first.Get("withPaymentHistory"), "proStatusRequestBody.withPaymentHistory");
261+
auto count = toCppInteger(first.Get("count"), "proStatusRequestBody.count");
264262
assertIsString(first.Get("masterPrivKeyHex"), "proStatusRequestBody.masterPrivKeyHex");
265263

266264
auto master_privkey_js = first.Get("masterPrivKeyHex");
@@ -273,7 +271,7 @@ class ProWrapper : public Napi::ObjectWrap<ProWrapper> {
273271
static_cast<uint8_t>(requestVersion.Int32Value()),
274272
to_span(master_privkey_decoded),
275273
unix_ts_ms,
276-
withPaymentHistory);
274+
count);
277275

278276
return json;
279277
});

types/pro/pro.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ declare module 'libsession_util_nodejs' {
181181
args: WithMasterPrivKeyHex &
182182
WithRequestVersion &
183183
WithUnixTsMs & {
184-
withPaymentHistory: boolean;
184+
count: number;
185185
}
186186
) => string;
187187
};

0 commit comments

Comments
 (0)