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.

Can a site import an RGB asset into the wallet?

Yes. On regtest, use importAsset() with a Photon registry contract id, ticker, or name after the user connects the site.

How do I read asset inventory?

Call getAssets() for the imported asset list and getAssetBalance() for one asset balance.

What is sendBtcFunding() for?

It is an approved BTC send helper for funding or collateral flows where your app supplies the destination address and satoshi amount.

What is payRgbInvoice() for?

It pays an RGB Lightning invoice through the wallet on regtest after the user approves the request.

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 };
}