Class NostrRelayConfig.NostrRelayConfigBuilder
java.lang.Object
xyz.tcheeric.cashu.voucher.nostr.config.NostrRelayConfig.NostrRelayConfigBuilder
- Enclosing class:
NostrRelayConfig
Custom builder to support adding relay URLs one at a time.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionAdds a single relay URL to the configuration.Sets multiple relay URLs at once.Uses Cashu-specific relays.Uses well-known public relays.
-
Constructor Details
-
NostrRelayConfigBuilder
public NostrRelayConfigBuilder()
-
-
Method Details
-
relayUrl
Adds a single relay URL to the configuration.- 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.- 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
-