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
| State | Value | Description |
|---|---|---|
| NONE | 0 | Initial SDK state |
| UNAUTHENTICATED | 1 | Before user authentication |
| EMBEDDED_SIGNER_NOT_CONFIGURED | 2 | Before wallet configuration |
| CREATING_ACCOUNT | 3 | Creating new account for chainID |
| READY | 4 | Wallet 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))")
}
}