Skip to content

Commit

Permalink
Update MetadataCoding.swift (nostr-sdk#171)
Browse files Browse the repository at this point in the history
Add a public init method to the structure, since auto-generated one is internal by default.

All public structs need to have public inits so that other users of the SDK can instantiate it.
  • Loading branch information
PavleKreator authored and RandyMcMillan committed Sep 1, 2024
1 parent 37d6ff6 commit 9ec9316
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Sources/NostrSDK/MetadataCoding.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ public struct Metadata {

/// The kind of the event, as an integer.
public var kind: UInt32?

public init(pubkey: String? = nil, relays: [String]? = nil, eventId: String? = nil, identifier: String? = nil, kind: UInt32? = nil) {
self.pubkey = pubkey
self.relays = relays
self.eventId = eventId
self.identifier = identifier
self.kind = kind
}
}

/// A protocol containing a set of functions for encoding and decoding identifiers.
Expand Down

0 comments on commit 9ec9316

Please sign in to comment.