Actors

The following actors are available globally.

  • Manager for external (non-passkey) signers in multi-signature smart-account operations.

    Maintains two signer kinds:

    • Keypair signers (addFromSecret(secretKey:)): held in memory only; secret-key material is never persisted.
    • Wallet signers: surfaced from the live OZExternalWalletAdapter for the duration of the running process.

    Example:

    let address = try await manager.addFromSecret(secretKey: "SCZANGBA5YHT...")
    
    See more

    Declaration

    Swift

    public actor OZExternalSignerManager
  • Persistent OZStorageAdapter backed by the iOS / macOS Keychain Services API.

    Stores credential and session payloads as kSecClassGenericPassword items using the Security framework’s SecItem* primitives. Each entry is a UTF-8 JSON document keyed by a stable account name:

    • cred_<credentialId> for individual stored credentials,
    • credential_index for the JSON-encoded list of known credential IDs,
    • session_current for the active session.

    All items are written with kSecAttrAccessibleAfterFirstUnlock so they survive app restarts but become inaccessible until the device is unlocked after a reboot.

    Thread safety is provided by Swift Concurrency actor isolation, so all operations serialize even when invoked from multiple tasks.

    Example:

    let storage = OZKeychainStorageAdapter()
    try await storage.save(credential: credential)
    let loaded = try await storage.get(credentialId: credential.credentialId)
    

    Important

    On iOS Simulator and unsigned macOS test binaries, Keychain access requires the keychain-access-groups entitlement to be configured.
    See more

    Declaration

    Swift

    @available(iOS 13.0, macOS 10.15, *)
    public final actor OZKeychainStorageAdapter : OZStorageAdapter
  • In-memory storage adapter for credentials and sessions.

    Stores all data in memory and does not persist across application restarts. Thread-safe via Swift Concurrency actor isolation.

    Use OZKeychainStorageAdapter for persistent encrypted storage on Apple platforms (Keychain Services), or OZUserDefaultsStorageAdapter for non-sensitive metadata.

    All OZInMemoryStorageAdapter instances are considered equal because two freshly-created instances are functionally identical (both empty), so they are interchangeable as default values in configuration data structures.

    Example:

    let storage = OZInMemoryStorageAdapter()
    let credential = OZStoredCredential(...)
    try await storage.save(credential: credential)
    

    Important

    Not persistent and not secure. Data is held in process memory only, is lost on application termination, and is not encrypted at rest. Suitable for tests and ephemeral demos. Production applications must supply a persistent, encrypted storage adapter (for example a Keychain-backed implementation on Apple platforms).
    See more

    Declaration

    Swift

    public final actor OZInMemoryStorageAdapter : OZStorageAdapter
    extension OZInMemoryStorageAdapter: Equatable
    extension OZInMemoryStorageAdapter: Hashable
  • Persistent OZStorageAdapter backed by an isolated UserDefaults suite.

    Stores credential and session payloads as UTF-8 JSON strings under stable keys:

    • cred_<credentialId> for individual stored credentials,
    • credential_index for the JSON-encoded list of known credential IDs,
    • session_current for the active session.

    The adapter scopes every read and write to a UserDefaults(suiteName:) instance so multiple adapter instances configured with different suites do not interfere with one another. Stored credentials contain only public key material plus metadata, so UserDefaults provides adequate isolation for typical use cases. Applications requiring stronger at-rest protection should use OZKeychainStorageAdapter instead.

    Thread safety is provided by Swift Concurrency actor isolation, which serializes all operations against the underlying UserDefaults instance.

    Example:

    let storage = try OZUserDefaultsStorageAdapter()
    try await storage.save(credential: credential)
    let loaded = try await storage.get(credentialId: credential.credentialId)
    

    Important

    Not encrypted at rest. UserDefaults persists payloads to a plaintext property-list file in the application container; on a jailbroken device or via an unencrypted iTunes/Finder backup, the contents are recoverable. The credentials persisted by this adapter contain only public-key material and non-secret metadata; applications storing session data or anything sensitive should use OZKeychainStorageAdapter instead.
    See more

    Declaration

    Swift

    public final actor OZUserDefaultsStorageAdapter : OZStorageAdapter