Skip to content

feat(sdk): in-app notification inbox types + API methods - #265

Open
trevormil wants to merge 4 commits into
mainfrom
feat/notification-inbox
Open

feat(sdk): in-app notification inbox types + API methods#265
trevormil wants to merge 4 commits into
mainfrom
feat/notification-inbox

Conversation

@trevormil

Copy link
Copy Markdown
Collaborator

Part 1 of 3 for the in-app notification inbox (SDK → indexer → frontend).

Adds

  • iNotificationDoc / NotificationDoc — a per-recipient inbox document (type, read, createdAt, collectionId, txHash, from, initiatedBy, denormalized display data) + NotificationType union.
  • Extended iNotificationPreferences with an in-app channel: inAppEnabled, inAppTransferActivity, inAppClaimActivity (the existing email/discord prefs are untouched).
  • Websocket message types (websockets.ts) for the per-user push channel.
  • BitBadgesAPI methods: getNotifications, getUnreadNotificationCount, markNotificationsRead, updateNotificationPreferences (+ routes in routes.ts, payload/response types in requests.ts).

Notes

  • Follows SDK conventions exactly: getNumberFieldNames() lists every number-typed field; no central doc union/registry exists in this SDK so nothing else to register; barrels are wildcard.
  • bun run build (tsc CJS + ESM + tsc-alias + madge circular-dep check) passes clean.

The indexer + frontend PRs depend on these types.

🤖 Generated with Claude Code

Trevor Miller and others added 4 commits June 16, 2026 19:44
Adds the SDK surface for a per-user in-app notification inbox:
- iNotificationDoc / NotificationDoc + NotificationType
- extend iNotificationPreferences with in-app channel + per-event flags
- notification websocket message types (websockets.ts)
- BitBadgesAPI methods: getNotifications, getUnreadNotificationCount,
  markNotificationsRead, updateNotificationPreferences (+ routes + request types)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add optional `activity?: iTransferActivityDoc<T>` to iNotificationDoc /
NotificationDoc. The constructor wraps it in a real TransferActivityDoc and
the generic convert() recurses into it, so the frontend can render transfer
notifications with the standard transfer-activity components without a refetch
(and it stays self-contained for realtime-pushed rows).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…bank_send

Restructure NotificationDoc into a standardized presentation envelope (title
[now required], message, link, collectionId, address) plus a type-specific
`payload` (iNotificationPayload) surfaced only in the drilldown. `type` is the
discriminator; add `bank_send`. Replaces the flat activity/data/txHash/from
fields. This is the extension point for new inbox event types.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
New NotificationType 'intent_satisfied' with an intentSatisfied payload
(approvalId, approverAddress/maker, filler, collectionId, coins, tokenIds,
legCount) for collapsing a multi-leg intent fill into one inbox event.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.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.

1 participant