bigblocks
Version:
Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React
15 lines • 910 B
JSON
{
"name": "bap-identity-hooks-usemasterkeyutils",
"type": "registry:hook",
"dependencies": [],
"devDependencies": [],
"registryDependencies": [],
"files": [
{
"path": "components/bap-identity/hooks/useMasterKeyUtils.ts",
"type": "registry:hook",
"content": "import { useBitcoinAuth } from \"../../../hooks/useBitcoinAuth.js\";\nimport type { AuthUserWithBAP } from \"../types/identity.js\";\n\nexport function useMasterKeyUtils() {\n\tconst { user } = useBitcoinAuth();\n\tconst bapUser = user as AuthUserWithBAP;\n\n\tconst hasMasterKey = !!bapUser?.masterKey || !!bapUser?.xprv;\n\tconst isType42 = !!bapUser?.masterKey;\n\tconst isLegacy = !!bapUser?.xprv;\n\n\treturn {\n\t\thasMasterKey,\n\t\tisType42,\n\t\tisLegacy,\n\t\tmasterKey: bapUser?.masterKey,\n\t\txprv: bapUser?.xprv,\n\t};\n}\n",
"target": "<%- config.aliases.hooks %>/usemasterkeyutils.ts"
}
]
}