OZStoredSession
public struct OZStoredSession : Sendable, Equatable, Hashable
A stored user session for silent reconnection.
Sessions enable users to reconnect to their smart account wallet without re-authentication, as long as the session has not expired.
Example:
let now = Int64(Date().timeIntervalSince1970 * 1000)
let session = OZStoredSession(
credentialId: "base64url-encoded-id",
contractId: "CBCD1234...",
connectedAt: now,
expiresAt: now + 7 * 24 * 60 * 60 * 1000
)
if !session.isExpired {
// Silently reconnect.
}
-
Undocumented
Declaration
Swift
public let credentialId: String -
Undocumented
Declaration
Swift
public let contractId: String -
Undocumented
Declaration
Swift
public let connectedAt: Int64 -
Undocumented
Declaration
Swift
public let expiresAt: Int64 -
Undocumented
Declaration
Swift
public init( credentialId: String, contractId: String, connectedAt: Int64, expiresAt: Int64 ) -
Whether the session has expired (the current wall-clock millisecond timestamp is at or past
expiresAt).Declaration
Swift
public var isExpired: Bool { get }
View on GitHub
Install in Dash