Feat/nip37 private storage relays#644
Conversation
📝 WalkthroughWalkthroughThis PR adds support for NIP-37 private storage relays in the NDK package. A new ChangesNIP-37 Private Storage Relays
Sequence DiagramsequenceDiagram
participant Caller
participant UserRelayLists
participant Cache
participant Network
participant Signer
Caller->>UserRelayLists: getPrivateStorageRelays(forceRefresh)
UserRelayLists->>Cache: load Nip37.kPrivateStorageRelays events
alt forceRefresh or no cached event
UserRelayLists->>Network: query latest kind 10013 event
Network-->>UserRelayLists: event or null
end
alt event found
UserRelayLists->>Cache: save latest event
UserRelayLists->>Signer: decryptNip44(eventContent)
Signer-->>UserRelayLists: decrypted JSON
UserRelayLists->>UserRelayLists: parse tags, extract relay URLs
UserRelayLists-->>Caller: List<String> relay URLs
else no event or decryption failed
UserRelayLists-->>Caller: null
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@doc/usecases/user-relay-lists.md`:
- Line 13: The document contains the nonstandard term "usecase" (e.g., the
sentence "NIP-37 private storage relays are exposed through the same usecase.");
update occurrences of the token "usecase" to the standard spelling "use case"
throughout the file (for example edit the sentence to "NIP-37 private storage
relays are exposed through the same use case").
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 00e20e89-514e-4f8d-96cb-f4dd69f67d34
📒 Files selected for processing (11)
doc/usecases/user-relay-lists.mdpackages/bc_ur/lib/ur.dartpackages/ndk/lib/domain_layer/entities/nip_37.dartpackages/ndk/lib/domain_layer/usecases/user_relay_lists/user_relay_lists.dartpackages/ndk/lib/entities.dartpackages/ndk/lib/ndk.dartpackages/ndk/test/usecases/user_relay_lists/user_relay_lists_test.dartpackages/ndk_flutter/lib/data_layer/repositories/signers/amber_event_signer.dartpackages/ndk_flutter/lib/widgets/login/nostr_connect_dialog_view.dartpackages/nip07_event_signer/lib/src/nip07_event_signer_stub.dartpackages/nip07_event_signer/lib/src/nip07_event_signer_web.dart
|
|
||
| ## Private storage relays | ||
|
|
||
| NIP-37 private storage relays are exposed through the same usecase. |
There was a problem hiding this comment.
Use standard spelling: “use case”.
Replace “usecase” with “use case” to match common terminology and improve documentation readability.
🧰 Tools
🪛 LanguageTool
[grammar] ~13-~13: Ensure spelling is correct
Context: ...age relays are exposed through the same usecase. The kind 10013 event is encrypted, s...
(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@doc/usecases/user-relay-lists.md` at line 13, The document contains the
nonstandard term "usecase" (e.g., the sentence "NIP-37 private storage relays
are exposed through the same usecase."); update occurrences of the token
"usecase" to the standard spelling "use case" throughout the file (for example
edit the sentence to "NIP-37 private storage relays are exposed through the same
use case").
This pr only add a high level api to get the private relays list
Summary by CodeRabbit
Release Notes
New Features
Documentation
Tests