From 809cad830e1c683a1dee0b1dcbf6778b04a0b041 Mon Sep 17 00:00:00 2001 From: Joel Carter Date: Tue, 26 Nov 2024 15:26:41 -0600 Subject: [PATCH] Update Readme --- .vscode/settings.json | 2 ++ README.md | 58 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 6 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index baeacf1..d663de3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,11 +1,13 @@ { "cSpell.words": [ "Alamofire", + "Arie", "boundwitness", "keccak", "Keychain", "Protobuf", "secp", + "Trouw", "unkeyed" ] } diff --git a/README.md b/README.md index 2d9fa20..1a0f5e2 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,9 @@ - [Description](#description) - [Instructions](#instructions) - [Add Package](#add-package) - - [Configure Api](#configure-api) + - [Configure API](#configure-api) + - [Configure Witnesses](#configure-witnesses) + - [Configure Panel](#configure-panel) - [Generate BoundWitness report](#generate-boundwitness-report) - [Maintainers](#maintainers) - [License](#license) @@ -31,25 +33,69 @@ Primary SDK for using the XYO Protocol 2.0 from Swift. Designed to work in both ```swift dependencies: [ -.package(url: "https://github.com/XYOracleNetwork/sdk-xyo-client-swift.git", .upToNextMajor(from: "2.0.3")), +.package(url: "https://github.com/XYOracleNetwork/app-ios-witness-demo-swiftui.git", .upToNextMajor(from: "3.0.0")), ], ``` -### Configure Api +### Configure API + +Setup which network you'd like to write to by configuring the Domain & Archivist Module Name + +```swift +let apiDomain = "https://beta.api.archivist.xyo.network" +let archive = "Archivist" +``` + +### Configure Witnesses + +Configure your desired witnesses (Basic, System Info, Location, etc.) + +```swift +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 ```swift -let panel = XyoPanel(archive: 'test', apiDomain: "https://api.archivist.xyo.network", witnesses: [XyoSystemInfoWitness()]) +let panel = XyoPanel( + account: self.panelAccount, + witnesses: [ + basicWitness, + systemInfoWitness, + locationWitness + ], + apiDomain: apiDomain, + apiModule: apiModule +) ``` ### Generate BoundWitness report +Call `.report()` to return the witnessed Payloads + +```swift +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) + ```swift -panel.report(nil, nil) +let result = await panel.reportQuery() +let bw = result.bw +let payloads = result.payloads +let errors = result.errors ``` ## Maintainers -- Arie Trouw +- [Arie Trouw](https://arietrouw.com/) +- [Joel Carter](https://joelbcarter.com) ## License