Manage embedded wallet settings including password protection in Unity.
Password protection
Custom UI flow
If you are building a custom UI implementation, you must check the wallet recovery state and unlock the wallet programmatically before performing any wallet operations. If you skip this step, Dynamic’s default password modal will appear, which defeats the purpose of a custom UI integration.
The required flow for custom UI implementations is:
Check wallet state — Call GetWalletRecoveryState to determine if the wallet is password-encrypted and currently locked.
Unlock if needed — If the wallet is password-encrypted, collect the password in your own UI and call UnlockWallet.
Proceed with operations — Only after the wallet is unlocked should you perform signing, transactions, or other wallet operations.
public async void EnsureWalletUnlocked(string password){ // 1. Check if wallet is locked var state = await DynamicSDK.Instance.Wallets.Waas.GetWalletRecoveryState(_wallet); if (state.IsPasswordEncrypted) { // 2. Unlock with the user's password await DynamicSDK.Instance.Wallets.Waas.UnlockWallet(_wallet, password); } // 3. Wallet is now ready for operations}
Check wallet recovery state
var state = await DynamicSDK.Instance.Wallets.Waas.GetWalletRecoveryState(wallet);bool isPasswordProtected = state.IsPasswordEncrypted;