move swift examples (#100)

* move swift examples

* swift workflow

* fixup

* rewirte gettingStarted

* add README for swift

* update fiat examples and addresss feedback
This commit is contained in:
Ruben
2023-11-16 14:06:30 +01:00
committed by ok300
parent ec8108abf2
commit b541595840
35 changed files with 561 additions and 209 deletions

View File

@@ -0,0 +1,32 @@
//
// LnurlAuth.swift
//
//
// Created by ruben on 14/11/2023.
//
import Foundation
import BreezSDK
func auth(sdk: BlockingBreezServices) {
// ANCHOR: lnurl-withdraw
// Endpoint can also be of the form:
// keyauth://domain.com/auth?key=val
let lnurlAuthUrl = "lnurl1dp68gurn8ghj7mr0vdskc6r0wd6z7mrww4excttvdankjm3lw3skw0tvdankjm3xdvcn6vtp8q6n2dfsx5mrjwtrxdjnqvtzv56rzcnyv3jrxv3sxqmkyenrvv6kve3exv6nqdtyv43nqcmzvdsnvdrzx33rsenxx5unqc3cxgeqgntfgu"
if let inputType = try? parseInput(s: lnurlAuthUrl) {
if case .lnUrlAuth(let `data`) = inputType {
let result = try? sdk.lnurlAuth(reqData: data)
switch result {
case .ok:
print("Successfully authenticated")
case .errorStatus(let error):
print("Failed to authenticate: \(error)")
case .none:
print("Failed to authenticate")
}
}
}
// ANCHOR_END: lnurl-withdraw
}