@hyperauth/sdk
Factory function
createClient
HyperAuthClient. Throws ClientStateError if the vault worker fails to start.
HyperAuthClient
All operations route through the vault worker. The enclave is never called directly.
Static factory
WasmPlugin adapter. Used for testing or custom plugin topologies.
Configuration
ClientConfig
ContractsConfig
defaultContracts
Pre-configured addresses for Base Sepolia (chain ID 84532):
Core methods
generate
GenerateOptions
Returns:
GenerateResult
ping
Returns:
PingResult
Cryptography methods
sign
Returns:
SignResult
deriveAddress
Returns:
DeriveAddressResult
mintUcan
Returns:
MintUcanResult
parseWebAuthn
ParseWebAuthnResult
Vault methods
load
Returns:
LoadOutput — shape mirrors @hyperauth/schemas.
lock
LockOutput — shape mirrors @hyperauth/schemas.
unlock
Returns:
UnlockOutput — shape mirrors @hyperauth/schemas.
status
StatusOutput — shape mirrors @hyperauth/schemas. Includes locked: boolean.
isLocked
status().locked.
query
Returns:
QueryOutput
Account
exportVault
PluginCallError on failure.
VaultExportOptions
importVault
VaultImportOptions
VaultImportOutput — shape mirrors @hyperauth/schemas. Includes success, did, accounts, credentials.
ERC-4337 methods
createRegistration
PluginCallError on failure.
CreateRegistrationInput
RegistrationResult
signUserOp
PluginCallError on failure.
Returns:
SignUserOpResult
execute
Resource
ExecOutput<T>
submitPayment
PluginCallError on failure.
PaymentParams
Returns:
PaymentResult
registerPaymentHandler
PaymentHandlerOptions
Returns:
PaymentHandlerRegistration
Indexer methods
These are module-level functions, not methods onHyperAuthClient.
computeAliasHash
keccak256(hexEncode(utf8Bytes(alias))). Matches the Go enclave convention.
lookupAlias
IndexerAlias
lookupDid
IndexerDid
lookupAccount
IndexerAccount
fetchStats
IndexerStats
fetchHealth
IndexerHealth
indexerUrl for all indexer functions: '/api/indexer'.
Passkey helpers
createPasskey
WebAuthnError if the authenticator returns a different algorithm.
CreatePasskeyOptions
Returns:
CreatePasskeyResult
authenticatePasskey
WebAuthnError if unsupported or cancelled.
DeviceCapabilities
Device sync methods
syncInit
PluginCallError on failure.
Returns:
SyncInitResult — shape mirrors @hyperauth/schemas. Includes success, session_id, public_key, error?.
syncRespond
PluginCallError on failure.
Returns: SyncRespondResult — shape mirrors @hyperauth/schemas.
syncComplete
PluginCallError on failure.
Returns: SyncCompleteResult — shape mirrors @hyperauth/schemas.
UCAN delegation methods
delegate
PluginCallError on failure.
DelegationOptions
createInvocation
PluginCallError on failure.
InvocationOptions
Persistence methods
These methods require theVaultWorkerCore bridge (available when using createClient).
getBootStatus
hasPersistedVault
true if a persisted vault state is available for restore.
snapshotVault
{ error } if no core bridge is available.
persistNow
{ success: false, error } if no core bridge is available.
hasCorebridge
true when the client was created with createClient and has access to the vault worker core bridge.
Auto-lock methods
setAutoLockCallback
setAutoLockTimeout
0 disables auto-lock.
Lifecycle methods
reset
close
Wallet pipeline functions
Module-level functions for ERC-4337 UserOperation handling.sendUserOp
eth_sendUserOperation. Returns the userOpHash.
Default bundlerUrl: '/api/bundler'.
getUserOpReceipt
null if not yet confirmed.
UserOpReceipt
waitForReceipt
NetworkError on timeout.
getSupportedEntryPoints
estimateUserOpGas
eth_estimateUserOperationGas.
sponsorUserOp
pm_sponsorUserOperation. Returns the UserOperation with paymaster fields populated.
getSmartAccountAddress
vaultUrl: '/api'.
getAccountState
AccountState
computeUserOpHash
Hex utilities
Error classes
All errors extendHyperAuthError extends Error.
Shared types
EncryptedShares
UserOp
ERC-4337 v0.7 packed UserOperation. Shape mirrors @hyperauth/schemas.