Electrum’s JSON-RPC service watches dedicated addresses, confirms transactions, and triggers token minting when funds clear.
Run the Electrum daemon (`electrum daemon start`) and expose its JSON-RPC over localhost or a protected socket.
Use electrum-rpc createnewaddress per order. Store the address + order ID in MariaDB.
Poll getaddresshistory or subscribe with WebSockets. Confirm when status.confirmations ≥ 1.
Call generate_vpn_token.sh with metadata (`plan`, `txid`, address). Mark the order fulfilled and email the token display value.
| Method | Purpose |
|---|---|
| createnewaddress | Derive unique deposit address (per order). |
| getaddressbalance | Check confirmed vs unconfirmed sat balance. |
| getaddresshistory | Fetch TX history + confirmation counts. |
| gettransaction <txid> | Retrieve raw TX and metadata for logging. |
Electrum CLI binaries live under pay/electrum/electrum. Use ./electrum daemon start to spin up on localhost.
Until automation goes live, capture BTC remittance manually.