Format with prettier. Use screen mode for invitation import - dialog mode is broken.

This commit is contained in:
2026-03-23 10:15:48 +00:00
parent 7fd89c5663
commit b475b23beb
47 changed files with 1718 additions and 1098 deletions

View File

@@ -1,4 +1,7 @@
import { fetchTransactionBlockHeight, initializeElectrumClient } from '@electrum-cash/protocol';
import {
fetchTransactionBlockHeight,
initializeElectrumClient,
} from "@electrum-cash/protocol";
export interface ElectrumServiceConfig {
host?: string;
@@ -15,13 +18,17 @@ export class ElectrumService {
private clientPromise?: ReturnType<typeof initializeElectrumClient>;
constructor(config: ElectrumServiceConfig = {}) {
this.host = config.host ?? process.env['ELECTRUM_HOST'] ?? 'bch.imaginary.cash';
this.applicationIdentifier = 'xo-cli';
this.host =
config.host ?? process.env["ELECTRUM_HOST"] ?? "bch.imaginary.cash";
this.applicationIdentifier = "xo-cli";
}
private async getClient() {
if (!this.clientPromise) {
this.clientPromise = initializeElectrumClient(this.applicationIdentifier, this.host);
this.clientPromise = initializeElectrumClient(
this.applicationIdentifier,
this.host,
);
}
return this.clientPromise;
@@ -38,7 +45,7 @@ export class ElectrumService {
// Electrum returns numbers for known transactions
// (e.g. >0 confirmed, 0/-1 unconfirmed variants).
return typeof height === 'number';
return typeof height === "number";
} catch {
return false;
}