Class NostrRelayConfig.NostrRelayConfigBuilder
java.lang.Object
xyz.tcheeric.cashu.voucher.nostr.config.NostrRelayConfig.NostrRelayConfigBuilder
- Enclosing class:
NostrRelayConfig
Builder that owns the relay list, so relays can be added one at a time or chosen from a
preset. Until one of those is called the list is
null, and the Cashu relays apply.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAppends a relay URL to the relays chosen so far.Sets multiple relay URLs at once, replacing any chosen before.Uses Cashu-specific relays.Uses well-known public relays.
-
Constructor Details
-
NostrRelayConfigBuilder
public NostrRelayConfigBuilder()
-
-
Method Details
-
relayUrl
Appends a relay URL to the relays chosen so far. On a freshbuilder()nothing is chosen yet, so the first call replaces the default relays; aftertoBuilder()or a preset it adds to that list.- Parameters:
relayUrl- the WebSocket URL of the relay (must start with wss:// or ws://)- Returns:
- this builder for chaining
- Throws:
IllegalArgumentException- if URL is invalid
-
relayUrls
Sets multiple relay URLs at once, replacing any chosen before.nullleaves the current choice unchanged.- Parameters:
relayUrls- list of relay URLs- Returns:
- this builder for chaining
- Throws:
IllegalArgumentException- if any URL is invalid
-
useWellKnownRelays
Uses well-known public relays.- Returns:
- this builder for chaining
-
useCashuRelays
Uses Cashu-specific relays.- Returns:
- this builder for chaining
-