Compare commits
1 commit
a762a7ea40
...
6d9f5c3d99
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d9f5c3d99 |
1 changed files with 11 additions and 8 deletions
|
|
@ -73,19 +73,22 @@ export function useAvailabilityBroadcast(options: UseAvailabilityBroadcastOption
|
|||
model,
|
||||
})
|
||||
|
||||
// Signing goes through the bunker, so it can throw BunkerTimeoutError /
|
||||
// BunkerRejectedError — keep it INSIDE the try so a transient signer blip
|
||||
// is swallowed (the beacon re-publishes every interval) rather than
|
||||
// surfacing as an uncaught rejection. `publish()` is fire-and-forget.
|
||||
try {
|
||||
const event = await createSignedEvent(signer, {
|
||||
kind: 30078,
|
||||
created_at: Math.floor(Date.now() / 1000),
|
||||
tags: [['d', 'atm-availability']],
|
||||
content,
|
||||
})
|
||||
|
||||
try {
|
||||
await nostrClient.publish(event)
|
||||
lastSnapshot = snap
|
||||
console.log('[Availability] Published:', content)
|
||||
} catch (e) {
|
||||
console.warn('[Availability] Failed to publish:', e)
|
||||
console.warn('[Availability] Publish failed (sign or relay):', e)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue