What is PhotonBolt Wallet

Build browser apps that can detect, connect to, and request approvals from PhotonBolt Wallet.

PhotonBolt Wallet is a browser wallet with a dApp-facing provider injected as window.photon. It exposes a compact JavaScript API for wallet connection, account discovery, balance reads, transaction signing, transaction broadcast, and message signing.

This portal documents the API shape currently implemented in the PhotonBolt extension codebase.

Fast Integration

Detect the extension in a few lines, prompt the user to connect, then call the provider directly from your app.

Approval Driven

Signing and sending requests open an approval popup showing network, sender, fee, amount, total spend, and change details.

Simple Public Surface

The current public methods are connect, disconnect, getAccounts, getNetwork, getBalance, signTransaction, sendTransaction, and signMessage.

Provider Shape

PhotonBolt injects a provider into normal web pages under window.photon. Your app should never assume the provider exists. Always detect it first and handle the not-installed case cleanly.

JavaScript
function getPhoton() {
  if (typeof window === "undefined") return null;
  if (!window.photon || !window.photon.isPhoton) return null;
  return window.photon;
}

const photon = getPhoton();

if (!photon) {
  console.log("PhotonBolt Wallet is not installed.");
} else {
  console.log("PhotonBolt Wallet detected.");
}

API Summary

Method Returns Use It For
await photon.connect() { address, network, connected } Prompting the user to approve the current origin.
await photon.disconnect() { success: true } Disconnecting the current origin and clearing local dApp session state.
await photon.getAccounts() string[] Reading the approved wallet address list for the current origin.
await photon.getNetwork() "mainnet" | "testnet3" | "testnet4" | "regtest" Displaying or validating the active Bitcoin network.
await photon.getBalance() string Displaying the wallet's BTC balance.
await photon.signTransaction(tx) signedTxHex Getting a signed transaction without broadcasting it.
await photon.sendTransaction(tx) txid Preparing, approving, signing, and broadcasting a BTC transaction.
await photon.signMessage(message) signatureHex Requesting a deterministic message signature from the active account.

Events

accountsChanged

Fires when the active wallet address changes or the connection is removed for your origin.

networkChanged

Fires when the wallet network changes.

JavaScript
const photon = window.photon;

photon.on("accountsChanged", (accounts) => {
  console.log("accountsChanged", accounts);
});

photon.on("networkChanged", (network) => {
  console.log("networkChanged", network);
});