mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2025-11-10 07:37:12 +01:00
Signs for just one auth event to register with the push notification service instead of the dozens of events, one per relay.
This commit is contained in:
@@ -56,5 +56,23 @@ class RelayAuthEvent(
|
||||
)
|
||||
signer.sign(createdAt, KIND, tags, content, onReady)
|
||||
}
|
||||
|
||||
fun create(
|
||||
relays: List<String>,
|
||||
challenge: String,
|
||||
signer: NostrSigner,
|
||||
createdAt: Long = TimeUtils.now(),
|
||||
onReady: (RelayAuthEvent) -> Unit,
|
||||
) {
|
||||
val content = ""
|
||||
val tags =
|
||||
relays
|
||||
.map {
|
||||
arrayOf("relay", it)
|
||||
}.plusElement(
|
||||
arrayOf("challenge", challenge),
|
||||
).toTypedArray()
|
||||
signer.sign(createdAt, KIND, tags, content, onReady)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user