@@ -366,22 +366,22 @@ void Nip47::parseResponse(SignedNostrEvent *response, Nip47Response<ListTransact
366
366
NostrString resultType = doc[" result_type" ].as <NostrString>();
367
367
JsonObject data = doc[" result" ];
368
368
if (NostrString_equals (resultType, " list_transactions" )) {
369
- for (JsonPair kv : data[" transactions" ].as <JsonObject >()) {
369
+ for (JsonObject kv : data[" transactions" ].as <JsonArray >()) {
370
370
Transaction transaction;
371
- transaction.type = kv. value () [" type" ].as <NostrString>();
372
- transaction.invoice = kv. value () [" invoice" ].as <NostrString>();
373
- transaction.description = kv. value () [" description" ].as <NostrString>();
374
- transaction.descriptionHash = kv. value () [" description_hash" ].as <NostrString>();
375
- transaction.preimage = kv. value () [" preimage" ].as <NostrString>();
376
- transaction.paymentHash = kv. value () [" payment_hash" ].as <NostrString>();
377
- transaction.amount = kv. value () [" amount" ].as <unsigned long long >();
378
- transaction.feesPaid = kv. value () [" fees_paid" ].as <unsigned long long >();
379
- transaction.createdAt = kv. value () [" created_at" ].as <unsigned long long >();
380
- transaction.expiresAt = kv. value () [" expires_at" ].as <unsigned long long >();
381
- transaction.settledAt = kv. value () [" settled_at" ].as <unsigned long long >();
371
+ transaction.type = kv[" type" ].as <NostrString>();
372
+ transaction.invoice = kv[" invoice" ].as <NostrString>();
373
+ transaction.description = kv[" description" ].as <NostrString>();
374
+ transaction.descriptionHash = kv[" description_hash" ].as <NostrString>();
375
+ transaction.preimage = kv[" preimage" ].as <NostrString>();
376
+ transaction.paymentHash = kv[" payment_hash" ].as <NostrString>();
377
+ transaction.amount = kv[" amount" ].as <unsigned long long >();
378
+ transaction.feesPaid = kv[" fees_paid" ].as <unsigned long long >();
379
+ transaction.createdAt = kv[" created_at" ].as <unsigned long long >();
380
+ transaction.expiresAt = kv[" expires_at" ].as <unsigned long long >();
381
+ transaction.settledAt = kv[" settled_at" ].as <unsigned long long >();
382
382
JsonDocument metadataDoc;
383
383
JsonObject metadataObject = metadataDoc.as <JsonObject>();
384
- for (JsonPair kv : kv. value () [" metadata" ].as <JsonObject>()) {
384
+ for (JsonPair kv : kv[" metadata" ].as <JsonObject>()) {
385
385
metadataObject[kv.key ().c_str ()] = kv.value ().as <NostrString>();
386
386
}
387
387
transaction.metadata = metadataObject;
0 commit comments