Skip to content

Latest commit

 

History

History
114 lines (83 loc) · 3.45 KB

README.md

File metadata and controls

114 lines (83 loc) · 3.45 KB

logo

app-ios-witness-demo-swiftui

main-build codacy-badge codeclimate-badge

The XYO Foundation provides this source code available in our efforts to advance the understanding of the XYO Protocol and its possible uses. We continue to maintain this software in the interest of developer education. Usage of this source code is not intended for production.

Table of Contents

Description

Demo iOS App for using the XYO Protocol 2.0 from Swift. Designed to work in both Mac OS and iOS.

Instructions

Add Package

dependencies: [
.package(url: "https://github.com/XYOracleNetwork/app-ios-witness-demo-swiftui.git", .upToNextMajor(from: "3.0.0")),
],

Configure API

Setup which network you'd like to write to by configuring the Domain & Archivist Module Name

let apiDomain = "https://beta.api.archivist.xyo.network"
let archive = "Archivist"

Configure Witnesses

Configure your desired witnesses (Basic, System Info, Location, etc.)

let basicWitness = BasicWitness {
    Payload("network.xyo.basic")
}
let systemInfoWitness = SystemInfoWitness(allowPathMonitor: true)
let locationWitness = LocationWitness()

Configure Panel

Use the Witnesses & Archivist config to create a Panel

let panel = XyoPanel(
    account: self.panelAccount,
    witnesses: [
        basicWitness,
        systemInfoWitness,
        locationWitness
    ],
    apiDomain: apiDomain,
    apiModule: apiModule
)

Generate BoundWitness report

Call .report() to return the witnessed Payloads

let payloads =  await panel.report()

or, for more detailed information, call .reportQuery() to return a ModuleQuery result containing the BoundWitness, Payloads, & any Errors (if present)

let result =  await panel.reportQuery()
let bw = result.bw
let payloads = result.payloads
let errors = result.errors

Maintainers

License

See the LICENSE file for license details

Credits

Made with 🔥 and ❄️ by XYO