OctetSdk
The handle returned by Octet.start(...). Holds the predicate surface (loc) and a snapshot of license state (licenseStatus).
Shape
- Swift (iOS)
- Kotlin (Android)
public final class OctetSdk: @unchecked Sendable {
public let loc: OctetLoc
public internal(set) var licenseStatus: LicenseStatus?
}
class OctetSdk {
val loc: OctetLoc
var licenseStatus: LicenseStatus?
internal set
}
licenseStatus is optional in the type. Callers that obtained sdk via Octet.start(...) always see a non-nil value, since start attaches it before returning.
loc. The predicate surface.
OctetSdk.loc is the only way to issue a predicate query. See Predicates for isWithin, isOutside, contains.
licenseStatus. Current license snapshot.
Read synchronously at any time. See License Types for the field shape.
- Swift (iOS)
- Kotlin (Android)
if let status = sdk.licenseStatus {
print("\(status.state): \(status.daysUntilHardStop ?? -1) days left")
}
sdk.licenseStatus?.let { status ->
println("${status.state}: ${status.daysUntilHardStop ?: -1} days left")
}
Lifecycle notes
- The SDK does not expose a
stop()orshutdown()at v1. The proof pipeline runs for the lifetime of the process. The system shuts it down with the process. - Calling
Octet.start(...)a second time within the same process is not supported in v1. Hold the firstOctetSdkfor as long as you need predicates. OctetSdkisSendable(Swift) and thread-safe to use from any coroutine context (Kotlin). The predicates serialize internally.
See also
Octet.start(...). How to obtain anOctetSdk.- Predicates. The methods on
sdk.loc. OctetVerdict. What predicates return.