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
OZExternalWalletAdapterfor the duration of the running process.
Example:
See morelet address = try await manager.addFromSecret(secretKey: "SCZANGBA5YHT...")Declaration
Swift
public actor OZExternalSignerManager - Keypair signers (
-
Persistent
OZStorageAdapterbacked by the iOS / macOS Keychain Services API.Stores credential and session payloads as
kSecClassGenericPassworditems using the Security framework’sSecItem*primitives. Each entry is a UTF-8 JSON document keyed by a stable account name:cred_<credentialId>for individual stored credentials,credential_indexfor the JSON-encoded list of known credential IDs,session_currentfor the active session.
All items are written with
kSecAttrAccessibleAfterFirstUnlockso they survive app restarts but become inaccessible until the device is unlocked after a reboot.Thread safety is provided by Swift Concurrency
actorisolation, 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)See moreImportant
On iOS Simulator and unsigned macOS test binaries, Keychain access requires thekeychain-access-groupsentitlement to be configured.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
OZKeychainStorageAdapterfor persistent encrypted storage on Apple platforms (Keychain Services), orOZUserDefaultsStorageAdapterfor non-sensitive metadata.All
OZInMemoryStorageAdapterinstances 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)See moreImportant
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).Declaration
Swift
public final actor OZInMemoryStorageAdapter : OZStorageAdapterextension OZInMemoryStorageAdapter: Equatableextension OZInMemoryStorageAdapter: Hashable -
Persistent
OZStorageAdapterbacked by an isolatedUserDefaultssuite.Stores credential and session payloads as UTF-8 JSON strings under stable keys:
cred_<credentialId>for individual stored credentials,credential_indexfor the JSON-encoded list of known credential IDs,session_currentfor 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, soUserDefaultsprovides adequate isolation for typical use cases. Applications requiring stronger at-rest protection should useOZKeychainStorageAdapterinstead.Thread safety is provided by Swift Concurrency
actorisolation, which serializes all operations against the underlyingUserDefaultsinstance.Example:
let storage = try OZUserDefaultsStorageAdapter() try await storage.save(credential: credential) let loaded = try await storage.get(credentialId: credential.credentialId)See moreImportant
Not encrypted at rest.UserDefaultspersists 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 useOZKeychainStorageAdapterinstead.Declaration
Swift
public final actor OZUserDefaultsStorageAdapter : OZStorageAdapter
View on GitHub
Install in Dash
Actors Reference