Resources and FAQs

Resources and FAQs

Keep the developer-facing surface narrow: document the public provider, make network assumptions explicit, and show users clear next steps when the wallet rejects or is unavailable.

Resources

FAQ

How do I detect the wallet?

Check window.photon and verify window.photon.isPhoton === true.

When should I call connect()?

Call it only after a user action such as clicking “Connect Wallet” or starting a privileged flow.

What network strings can I expect?

mainnet, testnet3, testnet4, or regtest.

Does signTransaction() broadcast?

No. It returns signed transaction hex only. Use sendTransaction() to broadcast.

What does signMessage() return?

A deterministic hex signature for the active account. In the current implementation it is Photon-specific, not BIP-322.

Can I read balance without connecting?

No. Treat balance reads as permissioned data and request connection first.

Recommended Error Messages

Situation User-Facing Message
Wallet missing PhotonBolt Wallet is not installed in this browser.
Connection rejected Wallet connection was declined.
Wallet locked Unlock PhotonBolt Wallet and try again.
Network mismatch Switch PhotonBolt Wallet to the same network used by this app.
Invalid address The recipient address does not match the active network.

Small Helper

JavaScript
export async function requirePhotonSession() {
  if (!window.photon) {
    throw new Error("PhotonBolt Wallet is not installed.");
  }

  await window.photon.connect();

  const [address] = await window.photon.getAccounts();
  const network = await window.photon.getNetwork();

  return { address, network };
}