damus

nostr ios client
git clone git://jb55.com/damus
Log | Files | Refs | README | LICENSE

ZapType.swift (439B)


      1 //
      2 //  ZapType.swift
      3 //  damus
      4 //
      5 //  Created by Daniel D’Aquino on 2023-11-24.
      6 //
      7 
      8 import Foundation
      9 
     10 enum ZapType: String, StringCodable {
     11     case pub
     12     case anon
     13     case priv
     14     case non_zap
     15     
     16     init?(from string: String) {
     17         guard let v = ZapType(rawValue: string) else {
     18             return nil
     19         }
     20         
     21         self = v
     22     }
     23     
     24     func to_string() -> String {
     25         return self.rawValue
     26     }
     27     
     28 }