Skip to content

XYOracleNetwork/sdk-xyo-client-swift

Repository files navigation

logo

sdk-xyo-client-swift

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

Primary SDK 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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •