Install

Swift Package Manager:
// Package.swift
dependencies: [
    .package(url: "https://github.com/l1feai/orgs-sdk-swift", from: "0.9.0"),
],
Requires Swift 6.0 and strict concurrency.

Quick start

import OrgsSDK

@main
struct App {
    static func main() async throws {
        let orgs = OrgsClient(apiKey: ProcessInfo.processInfo.environment["ORGS_API_KEY"]!)

        // List entities
        let entities = try await orgs.entities.list()
        for entity in entities {
            print("\(entity.did): \(entity.name)")
        }

        // Create proposal
        let proposal = try await orgs.proposals.create(
            entity: "helios-research",
            kind: .spend(
                amountUsd: 12_500,
                recipient: "aws-bedrock",
                description: "Q2 compute reservation"
            )
        )
    }
}

Sendable types

All SDK types are Sendable. Safe to pass across concurrency contexts.

Error handling

do {
    try await orgs.treasury.disburse(...)
} catch OrgsError.insufficientFunds(let requested, let available) {
    print("Not enough: \(requested) > \(available)")
} catch {
    print("Other: \(error)")
}

Keychain integration

Keys are stored in the system Keychain via OSKeychain (macOS/iOS):
import OrgsKeys

let signer = try OrgsKeys.loadSigningKey(id: "founder-primary")
try await orgs.proposals.vote(id, choice: .approve, signer: signer)

iOS / macOS / visionOS

The SDK supports iOS 17+, macOS 14+, visionOS 1+. Network calls use URLSession with optional URLSessionDelegate for mTLS.

Full docs

github.com/l1feai/orgs-sdk-swift