BigBlocks
BigBlocks Wallet
Use Touch ID to unlock your wallet
Passphrase
BigBlocks Wallet
Enter your passphrase to unlock your wallet
Installation
bunx shadcn@latest add https://registry.bigblocks.dev/r/unlock-wallet.jsonUsage
UnlockWallet presents a biometric or passphrase unlock screen depending on the platform. The onUnlock callback receives an optional passphrase (undefined for biometric) and should return { success, error? }.
import { UnlockWallet } from "@/components/blocks/unlock-wallet"
export function LockScreen() {
return (
<UnlockWallet
platform="macos"
appName="My Wallet"
onUnlock={async (passphrase) => {
if (passphrase) {
return verifyPassphrase(passphrase)
}
return attemptBiometric()
}}
onSuccess={() => console.log("Unlocked")}
onError={(err) => console.error(err)}
/>
)
}Props
UnlockWallet
| Prop | Type | Default | Description |
|---|---|---|---|
platform | "macos" | "other" | "other" | Platform determines which unlock methods are available |
appName | string | "Wallet" | Application name displayed in the unlock UI |
onUnlock | (passphrase?: string) => Promise<UnlockWalletResult> | -- | Callback to execute the unlock attempt |
onSuccess | () => void | -- | Called on successful unlock |
onError | (error: Error) => void | -- | Called on error |
className | string | -- | Additional CSS classes |
UnlockWalletResult
interface UnlockWalletResult {
success: boolean
error?: string
}