Skip to content

Dash2 - #993

Open
shocknet-justin wants to merge 35 commits into
masterfrom
dash2
Open

Dash2#993
shocknet-justin wants to merge 35 commits into
masterfrom
dash2

Conversation

@shocknet-justin

@shocknet-justin shocknet-justin commented Jul 13, 2026

Copy link
Copy Markdown
Member

Summary

Admin/dashboard API work for LightningPub (package 0.0.33, master merged).

  • New Admin RPCs (HTTP + Nostr): GetAssetsAndLiabilitiesV2, GetUsersAdminInfo, GetUserOperationsFromAdmin
  • A&L v2: per-provider filters, paginated op pages (has_more / cursors / offsets), clamped page limits; liquidity provider slowdowns set a timeout flag instead of failing the whole response
  • Users admin: paginated user info (balance, locked, app users); optional user_id on operations for admin-targeted queries (backward compatible)
  • Handlers in adminManager / serverMethods, plus batch DB ops / storage fixes
  • express-ws for regenerated Express codegen; TypeScript ~6

Tests

Four new specs cover the admin surface and the storage layer it depends on:

adminUsers.spec.ts (full network)

  • Lists users with balances, app-user links, and app ownership
  • Pagination (skip/take vs total)
  • Admin ops fetch after a real outgoing invoice payment (amount + service fee)
  • Banned users: normal ops path rejects; admin path still returns history

assetsAndLiabilities.spec.ts (full network)

  • users_balance matches funded users
  • LND provider tracked balances + payment/invoice pages
  • User payment appears as a tracked USER op with user_id
  • Payment page limit / has_more / next_index_offset
  • V1 endpoint still returns flat op arrays

batchAssetLookups.spec.ts (storage-only)

  • Batch owner lookups for payments, invoices, tx hashes, address txs, and root ops
  • Empty inputs → []; missing ids ignored; wrong op type → no match
  • Multi-user seeds assert correct owner mapping

storageOperators.spec.ts (storage-only)

  • DB wrapper operators: comparisons, Between/In/And/Like/ILike/IsNull, OR where-arrays
  • FindAndCount, Sum, increment/decrement, delete/remove, date round-trip, skip/take
  • In-transaction updates + failed-tx rollback

Coverage note: A&L tests exercise the LND path thoroughly; liquidity-provider timeout flagging is implemented but not asserted in these specs. Admin specs call managers directly (not HTTP/Nostr auth middleware).

Test plan

  • adminUsers.spec.ts — list, pagination, admin ops, banned-user bypass
  • assetsAndLiabilities.spec.ts — users balance, LND tracked ops, pagination, v1 compat
  • batchAssetLookups.spec.ts — batch owner lookups across payment/invoice/tx/root
  • storageOperators.spec.ts — query operators, aggregates, tx rollback

Comment thread src/services/main/adminManager.ts
Comment thread src/services/main/adminManager.ts
Comment thread src/services/main/adminManager.ts
Comment thread src/services/main/adminManager.ts
Comment thread src/services/main/adminManager.ts Outdated
Comment thread src/services/main/appUserManager.ts
@shocknet-justin

Copy link
Copy Markdown
Member Author

@BugBot review

Comment thread src/services/main/adminManager.ts Outdated
Comment thread src/services/main/liquidityProvider.ts Outdated
@socket-security

socket-security Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedexpress-ws@​5.0.210010010075100
Added@​types/​express-ws@​3.0.61001008680100

View full report

@shocknet-justin

Copy link
Copy Markdown
Member Author

@BugBot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3477bd3. Configure here.

Comment thread src/services/main/liquidityProvider.ts Outdated
boufni95 and others added 3 commits July 30, 2026 20:19
Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants