Format with prettier. Use screen mode for invitation import - dialog mode is broken.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user