Client options
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.
| Option | Type | Default | Description |
|---|---|---|---|
hostOrigin | string | string[] | none | Origin (or origins) of the host shell. When no transport is given, the client creates a PostMessageTransport for it. |
transport | ITransport | none | Your own transport. Takes precedence over hostOrigin. |
handshakeTimeoutMs | number | 3000 | Maximum wait for the CLIENT_READY handshake. |
pingTimeoutMs | number | 3000 | Default timeout for ping(). |
queryTimeoutMs | number | 15000 | Default timeout for wallet state queries. |
commandTimeoutMs | number | 15000 | Default timeout for device commands: setOrientation, unlockOrientation and triggerHaptic. |
signingTimeoutMs | number | 120000 | Default timeout for signTx, submitTx and signData. |
autoConnect | boolean | false | Start the handshake from the constructor. Failures are only logged in debug mode. |
isInIframe | () => boolean | built-in detection | Custom iframe detection, mainly for tests. |
debug | boolean | false | Log internal warnings (auto-connect failures, late responses, listener errors) through the logger. See Logging and debugging. |
logger | Logger | console | Destination 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:
| Method | Options type | Default timeout | Other fields |
|---|---|---|---|
getUsedAddresses(paginate?, options?), getUnusedAddresses(options?), getRewardAddresses(options?), getChangeAddress(options?) | AddressQueryOptions | queryTimeoutMs | format: 'bech32' (default) or 'hex' |
getUtxos(paginate?, options?), getCollateral(options?), getBalance(options?), getNetworkId(options?) | QueryOptions | queryTimeoutMs | none |
signTx(txCbor, options?) | SignTxOptions | signingTimeoutMs | partialSign (default false), mergeWitnesses (default false) |
submitTx(txCbor, options?), signData(address, payloadHex, options?) | SignOptions | signingTimeoutMs | none |
ping(options?) | QueryOptions | pingTimeoutMs | none |
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
- Transports for the origin and window options.
- Storage adapters for session storage.
