ndb: move to uint32 for kind and created_at

This commit is contained in:
William Casarin
2023-07-25 15:20:51 -07:00
parent 54d40f7ffd
commit e3c04465fc
14 changed files with 32 additions and 33 deletions

View File

@@ -63,8 +63,8 @@ class NostrEventOld: Codable, Identifiable, CustomStringConvertible, Equatable,
var flags: Int = 0
let pubkey: String
let created_at: Int64
let kind: Int
let created_at: UInt32
let kind: UInt32
// cached stuff
private var _event_refs: [EventRef]? = nil
@@ -665,8 +665,8 @@ func make_zap_request_event(keypair: FullKeypair, content: String, relays: [Rela
var kp = keypair
let now = Int64(Date().timeIntervalSince1970)
let now = UInt32(Date().timeIntervalSince1970)
var privzap_req: PrivateZapRequest?
var message = content

View File

@@ -12,8 +12,8 @@ struct NostrFilter: Codable, Equatable {
var kinds: [NostrKind]?
var referenced_ids: [String]?
var pubkeys: [String]?
var since: Int64?
var until: Int64?
var since: UInt32?
var until: UInt32?
var limit: UInt32?
var authors: [String]?
var hashtag: [String]?
@@ -32,7 +32,7 @@ struct NostrFilter: Codable, Equatable {
case limit
}
init(ids: [String]? = nil, kinds: [NostrKind]? = nil, referenced_ids: [String]? = nil, pubkeys: [String]? = nil, since: Int64? = nil, until: Int64? = nil, limit: UInt32? = nil, authors: [String]? = nil, hashtag: [String]? = nil) {
init(ids: [String]? = nil, kinds: [NostrKind]? = nil, referenced_ids: [String]? = nil, pubkeys: [String]? = nil, since: UInt32? = nil, until: UInt32? = nil, limit: UInt32? = nil, authors: [String]? = nil, hashtag: [String]? = nil) {
self.ids = ids
self.kinds = kinds
self.referenced_ids = referenced_ids

View File

@@ -8,7 +8,7 @@
import Foundation
enum NostrKind: Int, Codable {
enum NostrKind: UInt32, Codable {
case metadata = 0
case text = 1
case contacts = 3