fix: floating point created_at

This commit is contained in:
kieran 2024-09-22 16:00:10 +01:00
parent baed390beb
commit e1a5292c0a
No known key found for this signature in database
GPG Key ID: DE71CEB3925BE941

View File

@ -98,7 +98,7 @@ export class EventBuilder {
pubkey: this.#pubkey ?? "",
content: this.#content ?? "",
kind: this.#kind,
created_at: (this.#createdAt ?? unixNow()) - (this.#jitter ? jitter(this.#jitter) : 0),
created_at: (this.#createdAt ?? unixNow()) - (this.#jitter ? Math.floor(jitter(this.#jitter)) : 0),
tags: this.#tags.sort((a, b) => a[0].localeCompare(b[0])),
} as NostrEvent;
ev.id = EventExt.createId(ev);