Appearance
Documentation / expo / needsRecovery
Function: needsRecovery()
needsRecovery(s)
needsRecovery(
s
):s is EmbeddedWalletNeedsRecoveryState
A type predicate to narrow the Embedded Wallet state to the Needs Recovery state.
Parameters
• s: EmbeddedWalletState
Returns
s is EmbeddedWalletNeedsRecoveryState
Example
ts
import {useEmbeddedWallet, useEmbeddedSolanaWalet, isConnected} from '@privy-io/expo';
const wallet = useEmbeddedWallet();
/// OR
const wallet = useEmbeddedSolanaWallet();
{needsRecovery(wallet) && (
<button onClick={() => wallet.recovery('<user-passcode>')}>Recover Wallet</button>
)}
needsRecovery(s)
needsRecovery(
s
):s is EmbeddedSolanaWalletNeedsRecoveryState
A type predicate to narrow the Embedded Wallet state to the Needs Recovery state.
Parameters
• s: EmbeddedSolanaWalletState
Returns
s is EmbeddedSolanaWalletNeedsRecoveryState
Example
ts
import {useEmbeddedWallet, useEmbeddedSolanaWalet, isConnected} from '@privy-io/expo';
const wallet = useEmbeddedWallet();
/// OR
const wallet = useEmbeddedSolanaWallet();
{needsRecovery(wallet) && (
<button onClick={() => wallet.recovery('<user-passcode>')}>Recover Wallet</button>
)}