UNPKG

bigblocks

Version:

Complete Bitcoin UI component library - authentication, social, wallet, market, inscriptions, and blockchain interactions for React

22 lines (21 loc) 998 B
// Type guard functions for backup format detection export function isBapMasterBackupLegacy(backup) { return "xprv" in backup && "mnemonic" in backup; } export function isMasterBackupType42(backup) { return "rootPk" in backup && !("xprv" in backup); } // Error Types and Constants export var ErrorType; (function (ErrorType) { ErrorType["BACKEND_SETUP"] = "BACKEND_SETUP"; ErrorType["VALIDATION"] = "VALIDATION"; ErrorType["NETWORK"] = "NETWORK"; ErrorType["AUTHENTICATION"] = "AUTHENTICATION"; ErrorType["GENERAL"] = "GENERAL"; })(ErrorType || (ErrorType = {})); // Backend setup error constants export const BACKEND_ERRORS = { CONNECTION_FAILED: "Cannot connect to backend. Make sure your server is running and /api/auth/signin endpoint exists. See examples/backend-setup-guide.md for setup help.", ENDPOINT_NOT_FOUND: "Backend endpoint not found. You need to implement POST /api/auth/signin in your backend. See examples/backend-setup-guide.md for help.", };