Troubleshooting Guide

Troubleshooting

Most integration failures fall into five buckets: provider missing, connection not approved, wallet locked, network mismatch, or invalid request payload.

Provider Missing

Symptom: window.photon is undefined.

Fix: confirm the extension is installed, enabled, and the page was refreshed after installation.

Wallet Connection Rejected

Symptom: connect() rejects with a user-facing approval error.

Fix: treat it as a normal decline path and let the user retry later.

Wallet Locked

Symptom: signing or sending fails even though the extension is installed.

Fix: ask the user to unlock the wallet UI first, then repeat the action.

Network Mismatch

Symptom: transaction requests fail with invalid address or wrong network errors.

Fix: read await photon.getNetwork() before creating the transaction request and validate the destination address for that network.

Quick Diagnostic Snippet

JavaScript
async function diagnosePhoton() {
  if (!window.photon) {
    return { installed: false };
  }

  try {
    const accounts = await window.photon.getAccounts();
    const network = await window.photon.getNetwork().catch(() => null);
    return {
      installed: true,
      connected: accounts.length > 0,
      accounts,
      network
    };
  } catch (error) {
    return {
      installed: true,
      error: error.message
    };
  }
}

Common Integration Mistakes

  1. Calling privileged methods before connect().
  2. Sending a mainnet address while the wallet is on testnet or regtest.
  3. Assuming signTransaction() returns metadata instead of signed hex.
  4. Assuming signMessage() is standardized to BIP-322 when it is currently Photon-specific.
  5. Hiding all wallet errors behind one generic “transaction failed” message.

Escalation Path

If your app still fails after basic checks, log the exact method name, the active network, the request payload shape without secrets, and the user-visible error string. That is the minimum useful bug report for diagnosing PhotonBolt Wallet integration issues.