Docs Help

FAQ

Short answers to common questions about the HydraOne SDK.

Does the SDK work outside the HydraOne App Center?

Not on its own. The wallet lives in the host shell, so an app opened in a normal tab has nothing to connect to and init() rejects with ERR_NOT_IN_IFRAME. To run an app elsewhere, embed it in a page that uses @hydraone-sdk/host.

Do I need a backend?

Only to verify CIP-8 signatures from signData; the SDK never verifies them, so do that on your own server. Wallet queries, signing and submitting need no backend of yours.

Does the SDK build transactions?

No. It asks the wallet to sign (signTx), submit (submitTx) and sign data (signData). Build transactions with a Cardano transaction library and pass the CBOR hex to the SDK.

Why does getBalance() return a list instead of a number?

The balance holds ADA and native assets. Use useWallet().balanceADA / useWalletBridgeClient().balanceADA (or balanceLovelace as a bigint), which read the lovelace for you, or read the entry whose unit is lovelace.

Why are amounts bigint?

Lovelace values can exceed Number.MAX_SAFE_INTEGER once native assets and large balances are involved. The wallet hooks read the balance as a bigint so no precision is lost.

Is it safe to use in production with hostOrigin: '*'?

No, and the transport refuses '*' unless the environment is known to be development or test. Set the exact host origin.

Can I use it with server-side rendering?

Yes. Nothing touches window at import time. Create clients and call init() on the client only (inside useEffect, onMounted or a .client plugin). The React provider and Vue composables already do this.

In Vue and Nuxt with server rendering, register the createHydraOne plugin so every request gets its own client. See Vue and Nuxt.

Does it work with CommonJS?

Yes. The package ships ESM and CommonJS builds with matching types.

How big is it?

The root entry is about 23 KB gzipped, and each subpath is a separate entry. Run pnpm run size in the repository to see the current numbers.

Why are addresses bech32 now?

Since 0.2.0, address queries (getUsedAddresses, getUnusedAddresses, getRewardAddresses, getChangeAddress) return bech32 (addr1..., stake1...) by default. Pass { format: 'hex' } to get the raw CIP-30 hex, or convert with addressToHex and addressToBech32.

Where is the API reference?

See API reference for every public export. For the full TypeDoc output, run pnpm run docs:api; it is written to packages/core/docs/api/.

Can more than one host embed my app?

Yes. Pass an array to hostOrigin, for example ['https://alpha.hydraone.app', 'https://staging.hydraone.app']. Messages are accepted from any listed origin, and replies are only ever sent to a listed origin. See Transports.

How do I report a bug or a vulnerability?

Bugs: open a GitHub issue. Vulnerabilities: use private reporting as described in SECURITY.md.

Next steps