Skip to content
LogoLogo

Embedded Wallet State

The embedded wallet goes through several states during initialization. It's crucial to wait for the proper state before using the signer.

Embedded States

StateValueDescription
NONE0Initial SDK state
UNAUTHENTICATED1Before user authentication
EMBEDDED_SIGNER_NOT_CONFIGURED2Before wallet configuration
CREATING_ACCOUNT3Creating new account for chainID
READY4Wallet ready for use

Checking Embedded State

Usage

OFSDK.shared.embeddedStatePublisher.sink { state in
    switch state {
    case .ready:
        print(">>> Embedded wallet is ready")
    default:
        print(">>> Embedded wallet state: \(String(describing: state))")
    }
}