Skip to content

WithAutonomi/ant-swift

Repository files navigation

AntFfi — Swift bindings for the Autonomi network

In-process Swift bindings for Autonomi, generated from the ant-sdk FFI crate via UniFFI. Talks directly to the network — no daemon process required, suitable for iOS and macOS apps.

Installation

In your Package.swift:

dependencies: [
    .package(url: "https://github.com/WithAutonomi/ant-swift.git", from: "0.0.1"),
],
targets: [
    .target(
        name: "YourApp",
        dependencies: [
            .product(name: "AntFfi", package: "ant-swift"),
        ]
    ),
]

Or in Xcode: File → Add Packages… and paste the repository URL.

Platforms

Platform Architecture
iOS (device) arm64
iOS Simulator arm64 (Apple Silicon)
macOS arm64 (Apple Silicon)

Minimum deployment targets: iOS 16, macOS 13.

Usage

import AntFfi

// Connect to a local devnet.
let client = try await Client.connectLocal()

// Store and retrieve a chunk.
let payload = Data("hello".utf8)
let address = try await client.chunkPut(data: Array(payload))
let retrieved = try await client.chunkGet(addressHex: address.address)

For wallet-backed uploads:

let client = try await Client.connectWithWallet(
    peers: ["..."],
    privateKey: "...",
    rpcUrl: "https://...",
    paymentTokenAddress: "0x...",
    paymentVaultAddress: "0x..."
)
let result = try await client.dataPutPublic(data: Array(payload), paymentMode: "auto")

Versioning

Releases are cut in lockstep with ant-sdk: a tag vX.Y.Z in ant-sdk triggers a matching vX.Y.Z release here.

License

Dual-licensed under either MIT or Apache 2.0, at your option.

About

No description, website, or topics provided.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

0 stars

Watchers

0 watching

Forks

Packages

 
 
 

Contributors

Languages