Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,14 @@ import kotlinx.serialization.json.*
/**
* The model that represents the data sent from a relay.
* It is a base class for all specific relay message types.
* Currently, there are two types of relay messages, represented by the tags EVENT and NOTICE.
* You can see their corresponding representations, RelayEventMessage and RelayNotice.
* Currently, there are six supported types of relay messages.
* You can see their corresponding representations in this file.
* @see RelayEventMessage
* @see RelayNotice
* @see RelayAuthMessage
* @see CountResponse
* @see EventStatus
* @see CloseMessage
*/
@Serializable(with = RelayMessage.RelayMessageSerializer::class)
sealed class RelayMessage(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ class RelayInfoTests {
@Test
fun generatedAndManualRelayInfoAreTheSame() = runTest {
val edenNostrLandInfo = Relay.Info(
description = "[✨ NFDB] nostr.land family of relays (fi-01 [tiger])",
name = "[✨ NFDB] nostr.land",
icon = "https://i.nostr.build/b3thno790aodH8lE.jpg",
description = "✨ the leading Nostr relay powered by NFDB\n\uD83C\uDF10 connected to fi-transitory-01",
name = "✨ nostr.land",
contact = "",
icon = "https://i.nostr.build/j6xguiCQRrdk6MsL.jpg",
pubkey = "52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd",
relaySoftware = "NFDB",
softwareVersion = "1.0.0",
softwareVersion = "2.0 γ5",
termsOfService = "https://nostr.land/terms",
supportedNips = intArrayOf(1, 2, 4, 8, 9, 10, 11, 13, 14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 27, 28, 30, 31, 32, 34, 35, 36, 37, 38, 39, 40, 42, 44, 46, 47, 48, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 65, 68, 69, 71, 72, 73, 75, 78, 84, 88, 89, 90, 92, 99),
supportedNips = intArrayOf(),
limits = RelayLimits(
maxMessageLength = 65535,
maxEventTagNumber = 2000,
Expand All @@ -54,11 +55,7 @@ class RelayInfoTests {
isPaymentRequired = true,
),
paymentUrl = "https://nostr.land",
paymentInfo = Payments(
subscriptionFees = arrayOf(
PaymentInfo(amount = 4000000, unit = "msats", durationInSeconds = 2592000)
)
)
paymentInfo = null
)

val obtainedAndParsedInfo = Relay.fetchInfoFor("wss://eden.nostr.land")
Expand Down
Loading