Docs Reference

Client options

Every option of WalletBridgeClient, with defaults and per-call timeout overrides.

Pass these to new WalletBridgeClient(options) (type WalletBridgeClientOptions). Every option is optional, but you must pass transport or hostOrigin: without either, the constructor throws a HydraBridgeError with code ERR_INVALID_OPTIONS.

The React provider takes these options through its options prop (plus its own hostOrigin and autoConnect props), and the Vue composable and plugin accept them directly. See React and Next.js and Vue and Nuxt.

OptionTypeDefaultDescription
hostOriginstring | string[]noneOrigin (or origins) of the host shell. When no transport is given, the client creates a PostMessageTransport for it.
transportITransportnoneYour own transport. Takes precedence over hostOrigin.
handshakeTimeoutMsnumber3000Maximum wait for the CLIENT_READY handshake.
pingTimeoutMsnumber3000Default timeout for ping().
queryTimeoutMsnumber15000Default timeout for wallet state queries.
commandTimeoutMsnumber15000Default timeout for device commands: setOrientation, unlockOrientation and triggerHaptic.
signingTimeoutMsnumber120000Default timeout for signTx, submitTx and signData.
autoConnectbooleanfalseStart the handshake from the constructor. Failures are only logged in debug mode.
isInIframe() => booleanbuilt-in detectionCustom iframe detection, mainly for tests.
debugbooleanfalseLog internal warnings (auto-connect failures, late responses, listener errors) through the logger. See Logging and debugging.
loggerLoggerconsoleDestination for debug output. Any object with warn and error methods.

client.destroy() also calls destroy() on the transport, whether the client created it from hostOrigin or you passed it in. Do not destroy a client while something else (such as a HostStorageRelayAdapter) still uses its transport.

Per-call options

Each call can override its default timeout with timeoutMs:

MethodOptions typeDefault timeoutOther fields
getUsedAddresses(paginate?, options?), getUnusedAddresses(options?), getRewardAddresses(options?), getChangeAddress(options?)AddressQueryOptionsqueryTimeoutMsformat: 'bech32' (default) or 'hex'
getUtxos(paginate?, options?), getCollateral(options?), getBalance(options?), getNetworkId(options?)QueryOptionsqueryTimeoutMsnone
signTx(txCbor, options?)SignTxOptionssigningTimeoutMspartialSign (default false), mergeWitnesses (default false)
submitTx(txCbor, options?), signData(address, payloadHex, options?)SignOptionssigningTimeoutMsnone
ping(options?)QueryOptionspingTimeoutMsnone

signTx also accepts a boolean as its second argument for partialSign, followed by an options object: signTx(txCbor, true, { timeoutMs }).

The default timeouts are also exported as TIERED_TIMEOUTS (HANDSHAKE, PING, QUERY, SIGNING). The default address format is exported as DEFAULT_ADDRESS_FORMAT.

Build-time constants

SDK_VERSION is exported from the root entry and always equals the version in package.json.

See also