mirror of
https://github.com/everoddandeven/monerod-gui.git
synced 2025-01-03 09:29:36 +00:00
Unregister electronAPI events
Some checks are pending
MacOS Build / build (20) (push) Waiting to run
Ubuntu 22.04 - AppImage Build / build (20) (push) Waiting to run
Ubuntu 22.04 - x64 DEB Build / build (20) (push) Waiting to run
Ubuntu 24.04 - x64 DEB Build / build (20) (push) Waiting to run
Windows Build / build (20) (push) Waiting to run
Some checks are pending
MacOS Build / build (20) (push) Waiting to run
Ubuntu 22.04 - AppImage Build / build (20) (push) Waiting to run
Ubuntu 22.04 - x64 DEB Build / build (20) (push) Waiting to run
Ubuntu 24.04 - x64 DEB Build / build (20) (push) Waiting to run
Windows Build / build (20) (push) Waiting to run
This commit is contained in:
parent
cd15e0f0f9
commit
3d350409e0
11 changed files with 168 additions and 77 deletions
|
@ -1,6 +1,5 @@
|
|||
// preload.js
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
//const os = require('os');
|
||||
|
||||
contextBridge.exposeInMainWorld('electronAPI', {
|
||||
startMonerod: (args) => {
|
||||
|
@ -18,12 +17,14 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onMonitorMonerodError: (callback) => {
|
||||
ipcRenderer.on('on-monitor-monerod-error', callback);
|
||||
},
|
||||
unregisterOnMonitorMonerod: () => {
|
||||
ipcRenderer.removeAllListeners('on-monitor-monerod');
|
||||
},
|
||||
unregisterOnMonitorMonerodError: () => {
|
||||
ipcRenderer.removeAllListeners('on-monitor-monerod-error');
|
||||
},
|
||||
unsubscribeOnMonerodStarted: () => {
|
||||
const listeners = ipcRenderer.listeners('monerod-started');
|
||||
|
||||
listeners.forEach((listener) => {
|
||||
ipcRenderer.removeListener('monerod-started', listener);
|
||||
});
|
||||
ipcRenderer.removeAllListeners('monerod-started');
|
||||
},
|
||||
onMoneroStdout: (callback) => {
|
||||
ipcRenderer.on('monero-stdout', callback);
|
||||
|
@ -31,6 +32,9 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onMoneroClose: (callback) => {
|
||||
ipcRenderer.on('monero-close', callback);
|
||||
},
|
||||
unregisterOnMoneroStdout: () => {
|
||||
ipcRenderer.removeAllListeners('monero-stdout');
|
||||
},
|
||||
getMoneroVersion: (monerodPath) => {
|
||||
ipcRenderer.invoke('get-monero-version', monerodPath);
|
||||
},
|
||||
|
@ -40,6 +44,13 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onMoneroVersionError: (callback) => {
|
||||
ipcRenderer.on('monero-version-error', callback);
|
||||
},
|
||||
unregisterOnMoneroVersion: () => {
|
||||
ipcRenderer.removeAllListeners('on-monero-version');
|
||||
},
|
||||
unregisterOnMoneroVersionError: () => {
|
||||
ipcRenderer.removeAllListeners('unregister-on-monero-version-error');
|
||||
},
|
||||
|
||||
downloadMonerod: (downloadUrl, destination) => {
|
||||
ipcRenderer.invoke('download-monerod', downloadUrl, destination);
|
||||
},
|
||||
|
@ -70,12 +81,19 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onIsWifiConnectedResponse: (callback) => {
|
||||
ipcRenderer.on('is-wifi-connected-result', callback);
|
||||
},
|
||||
unregisterOnIsWifiConnectedResponse: () => {
|
||||
ipcRenderer.removeAllListeners('is-wifi-connected-result');
|
||||
},
|
||||
getOsType: () => {
|
||||
ipcRenderer.invoke('get-os-type');
|
||||
},
|
||||
gotOsType: (callback) => {
|
||||
ipcRenderer.on('got-os-type', callback);
|
||||
},
|
||||
unregisterGotOsType: () => {
|
||||
ipcRenderer.removeAllListeners('got-os-type');
|
||||
},
|
||||
|
||||
showNotification: (options) => {
|
||||
ipcRenderer.invoke('show-notification', options);
|
||||
},
|
||||
|
@ -92,9 +110,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
ipcRenderer.on('on-is-auto-launch-enabled', callback);
|
||||
},
|
||||
unregisterOnIsAutoLaunchEnabled: () => {
|
||||
const listeners = ipcRenderer.listeners('on-is-auto-launch-enabled');
|
||||
|
||||
listeners.forEach((listener) => ipcRenderer.removeListener('on-is-auto-launch-enabled', listener));
|
||||
ipcRenderer.removeAllListeners('on-is-auto-launch-enabled');
|
||||
},
|
||||
onEnableAutoLaunchError: (callback) => {
|
||||
ipcRenderer.on('on-enable-auto-launch-error', callback);
|
||||
|
@ -102,6 +118,12 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onEnableAutoLaunchSuccess: (callback) => {
|
||||
ipcRenderer.on('on-enable-auto-launch-success', callback);
|
||||
},
|
||||
unregisterOnEnableAutoLaunchError: () => {
|
||||
ipcRenderer.removeAllListeners('on-enable-auto-launch-error');
|
||||
},
|
||||
unregisterOnEnableAutoLaunchSuccess: () => {
|
||||
ipcRenderer.removeAllListeners('on-enable-auto-launch-success')
|
||||
},
|
||||
disableAutoLaunch: () => {
|
||||
ipcRenderer.invoke('disable-auto-launch');
|
||||
},
|
||||
|
@ -111,12 +133,21 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|||
onDisableAutoLaunchSuccess: (callback) => {
|
||||
ipcRenderer.on('on-disable-auto-launch-success', callback);
|
||||
},
|
||||
unregisterOnDisableAutoLaunchError: () => {
|
||||
ipcRenderer.removeAllListeners('on-disable-auto-launch-error');
|
||||
},
|
||||
unregisterOnDisableAutoLaunchSuccess: () => {
|
||||
ipcRenderer.removeAllListeners('on-disable-auto-launch-success')
|
||||
},
|
||||
isAppImage: () => {
|
||||
ipcRenderer.invoke('is-app-image');
|
||||
},
|
||||
onIsAppImage: (callback) => {
|
||||
ipcRenderer.on('on-is-app-image', callback);
|
||||
},
|
||||
unregisterOnIsAppImage: () => {
|
||||
ipcRenderer.removeAllListeners('on-is-app-image');
|
||||
},
|
||||
isAutoLaunched: () => {
|
||||
ipcRenderer.invoke('is-auto-launched');
|
||||
},
|
||||
|
|
|
@ -38,32 +38,13 @@ export class AppComponent {
|
|||
this.load().then().catch((error: any) => console.error(error));
|
||||
}
|
||||
|
||||
private async isAutoLaunched(): Promise<boolean> {
|
||||
try {
|
||||
const promise = new Promise<boolean>((resolve) => {
|
||||
window.electronAPI.onIsAutoLaunched((event: any, isAutoLaunched: boolean) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnIsAutoLaunched();
|
||||
resolve(isAutoLaunched);
|
||||
});
|
||||
});
|
||||
|
||||
window.electronAPI.isAutoLaunched();
|
||||
|
||||
return await promise;
|
||||
} catch(error: any) {
|
||||
console.error(error);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
private async load(): Promise<void> {
|
||||
this.loading = true;
|
||||
|
||||
try {
|
||||
this.daemonRunning = await this.daemonService.isRunning(true);
|
||||
|
||||
const isAutoLaunched = await this.isAutoLaunched();
|
||||
const isAutoLaunched = await this.electronService.isAutoLaunched();
|
||||
|
||||
if (isAutoLaunched) {
|
||||
await this.daemonService.startDaemon();
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import { EventEmitter, Injectable, NgZone } from '@angular/core';
|
||||
import { DaemonService } from './daemon.service';
|
||||
import { BlockCount, BlockHeader, Chain, Connection, CoreIsBusyError, DaemonInfo, MinerData, MiningStatus, NetStats, NetStatsHistory, PeerInfo, ProcessStats, PublicNode, SyncInfo, TimeUtils, TxBacklogEntry, TxPool } from '../../../../common';
|
||||
import { ElectronService } from '../electron/electron.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
@ -73,7 +74,7 @@ export class DaemonDataService {
|
|||
public readonly netStatsRefreshStart: EventEmitter<void> = new EventEmitter<void>();
|
||||
public readonly netStatsRefreshEnd: EventEmitter<void> = new EventEmitter<void>();
|
||||
|
||||
constructor(private daemonService: DaemonService, private ngZone: NgZone) {
|
||||
constructor(private daemonService: DaemonService, private electronService: ElectronService, private ngZone: NgZone) {
|
||||
|
||||
this.daemonService.onDaemonStatusChanged.subscribe((running: boolean) => {
|
||||
this.ngZone.run(() => {
|
||||
|
@ -352,7 +353,7 @@ export class DaemonDataService {
|
|||
const syncAlreadyDisabled = this.daemonService.settings.noSync;
|
||||
|
||||
if (!settings.noSync && !syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.daemonService.isWifiConnected();
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (wifiConnected) {
|
||||
console.log("Disabling sync ...");
|
||||
|
@ -361,7 +362,7 @@ export class DaemonDataService {
|
|||
}
|
||||
}
|
||||
else if (!settings.noSync && syncAlreadyDisabled && !settings.syncOnWifi) {
|
||||
const wifiConnected = await this.daemonService.isWifiConnected();
|
||||
const wifiConnected = await this.electronService.isWifiConnected();
|
||||
|
||||
if (!wifiConnected) {
|
||||
console.log("Enabling sync ...");
|
||||
|
|
|
@ -144,29 +144,6 @@ export class DaemonService {
|
|||
});
|
||||
}
|
||||
|
||||
public async isWifiConnected(): Promise<boolean> {
|
||||
try {
|
||||
return new Promise<boolean>((resolve, reject) => {
|
||||
try {
|
||||
window.electronAPI.onIsWifiConnectedResponse((event: any, connected: boolean) => {
|
||||
console.debug(event);
|
||||
resolve(connected);
|
||||
});
|
||||
|
||||
window.electronAPI.isWifiConnected();
|
||||
}
|
||||
catch(error: any) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
}
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public async disableSync(): Promise<void> {
|
||||
this.disablingSync = true;
|
||||
|
||||
|
@ -410,7 +387,7 @@ export class DaemonService {
|
|||
|
||||
this.settings = customSettings ? customSettings : await this.getSettings();
|
||||
|
||||
if (!this.settings.noSync && !this.settings.syncOnWifi && await this.isWifiConnected()) {
|
||||
if (!this.settings.noSync && !this.settings.syncOnWifi && await this.electronService.isWifiConnected()) {
|
||||
console.log("Disabling sync ...");
|
||||
|
||||
this.settings.noSync = true;
|
||||
|
@ -780,15 +757,22 @@ export class DaemonService {
|
|||
throw new Error("Daemon not configured");
|
||||
}
|
||||
|
||||
return new Promise<DaemonVersion>((resolve, reject) => {
|
||||
const promise = new Promise<DaemonVersion>((resolve, reject) => {
|
||||
window.electronAPI.onMoneroVersion((event: any, version: string) => {
|
||||
window.electronAPI.unregisterOnMoneroVersion();
|
||||
window.electronAPI.unregisterOnMoneroVersionError();
|
||||
resolve(DaemonVersion.parse(version));
|
||||
})
|
||||
window.electronAPI.onMoneroVersionError((event: any, error: string) => {
|
||||
window.electronAPI.unregisterOnMoneroVersion();
|
||||
window.electronAPI.unregisterOnMoneroVersionError();
|
||||
reject(error);
|
||||
});
|
||||
window.electronAPI.getMoneroVersion(monerodPath);
|
||||
});
|
||||
|
||||
window.electronAPI.getMoneroVersion(monerodPath);
|
||||
|
||||
return await promise;
|
||||
}
|
||||
|
||||
throw new Error("Daemon not running");
|
||||
|
@ -1021,6 +1005,7 @@ export class DaemonService {
|
|||
title: 'Error',
|
||||
body: 'Could not stop daemon'
|
||||
});
|
||||
|
||||
throw new Error('Could not stop daemon');
|
||||
}
|
||||
|
||||
|
@ -1196,10 +1181,14 @@ export class DaemonService {
|
|||
|
||||
const getProcessStatsPromise = new Promise<ProcessStats>((resolve, reject) => {
|
||||
window.electronAPI.onMonitorMonerodError((event: any, error: string) => {
|
||||
window.electronAPI.unregisterOnMonitorMonerod();
|
||||
window.electronAPI.unregisterOnMonitorMonerodError();
|
||||
reject(error);
|
||||
});
|
||||
|
||||
window.electronAPI.onMonitorMonerod((event: any, stats: ProcessStats) => {
|
||||
window.electronAPI.unregisterOnMonitorMonerod();
|
||||
window.electronAPI.unregisterOnMonitorMonerodError();
|
||||
resolve(stats);
|
||||
});
|
||||
})
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { Injectable } from '@angular/core';
|
||||
|
||||
// If you import a module but never use any of the imported values other than as TypeScript types,
|
||||
// the resulting javascript file will look as if you never imported the module at all.
|
||||
import { ipcRenderer, webFrame } from 'electron';
|
||||
|
@ -15,6 +14,9 @@ export class ElectronService {
|
|||
childProcess!: typeof childProcess;
|
||||
fs!: typeof fs;
|
||||
|
||||
private _isAppImage?: boolean;
|
||||
private _isAutoLaunched?: boolean;
|
||||
|
||||
constructor() {
|
||||
// Conditional imports
|
||||
if (this.isElectron) {
|
||||
|
@ -54,6 +56,55 @@ export class ElectronService {
|
|||
return !!(window && window.process && window.process.type);
|
||||
}
|
||||
|
||||
public async isWifiConnected(): Promise<boolean> {
|
||||
try {
|
||||
const promise = new Promise<boolean>((resolve, reject) => {
|
||||
try {
|
||||
window.electronAPI.onIsWifiConnectedResponse((event: any, connected: boolean) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnIsWifiConnectedResponse();
|
||||
resolve(connected);
|
||||
});
|
||||
}
|
||||
catch(error: any) {
|
||||
reject(error);
|
||||
}
|
||||
});
|
||||
|
||||
window.electronAPI.isWifiConnected();
|
||||
|
||||
return await promise;
|
||||
}
|
||||
catch(error: any) {
|
||||
console.error(error);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public async isAutoLaunched(): Promise<boolean> {
|
||||
if (this._isAutoLaunched === undefined) {
|
||||
try {
|
||||
const promise = new Promise<boolean>((resolve) => {
|
||||
window.electronAPI.onIsAutoLaunched((event: any, isAutoLaunched: boolean) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnIsAutoLaunched();
|
||||
resolve(isAutoLaunched);
|
||||
});
|
||||
});
|
||||
|
||||
window.electronAPI.isAutoLaunched();
|
||||
|
||||
this._isAutoLaunched = await promise;
|
||||
} catch(error: any) {
|
||||
console.error(error);
|
||||
this._isAutoLaunched = false;
|
||||
}
|
||||
}
|
||||
|
||||
return this._isAutoLaunched;
|
||||
}
|
||||
|
||||
public async isAutoLaunchEnabled(): Promise<boolean> {
|
||||
if (await this.isAppImage()) {
|
||||
return false;
|
||||
|
@ -61,6 +112,7 @@ export class ElectronService {
|
|||
|
||||
const promise = new Promise<boolean>((resolve) => {
|
||||
window.electronAPI.onIsAutoLaunchEnabled((event: any, enabled: boolean) => {
|
||||
window.electronAPI.unregisterOnIsAutoLaunchEnabled();
|
||||
resolve(enabled);
|
||||
});
|
||||
});
|
||||
|
@ -84,11 +136,15 @@ export class ElectronService {
|
|||
const promise = new Promise<void>((resolve, reject) => {
|
||||
window.electronAPI.onEnableAutoLaunchError((event: any, error: string) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnEnableAutoLaunchError();
|
||||
window.electronAPI.unregisterOnEnableAutoLaunchSuccess();
|
||||
reject(error);
|
||||
});
|
||||
|
||||
window.electronAPI.onEnableAutoLaunchSuccess((event: any) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnEnableAutoLaunchError();
|
||||
window.electronAPI.unregisterOnEnableAutoLaunchSuccess();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
@ -113,11 +169,15 @@ export class ElectronService {
|
|||
const promise = new Promise<void>((resolve, reject) => {
|
||||
window.electronAPI.onDisableAutoLaunchError((event: any, error: string) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnDisableAutoLaunchError();
|
||||
window.electronAPI.unregisterOnDisableAutoLaunchSuccess();
|
||||
reject(error);
|
||||
});
|
||||
|
||||
window.electronAPI.onDisableAutoLaunchSuccess((event: any) => {
|
||||
console.debug(event);
|
||||
window.electronAPI.unregisterOnDisableAutoLaunchError();
|
||||
window.electronAPI.unregisterOnDisableAutoLaunchSuccess();
|
||||
resolve();
|
||||
});
|
||||
});
|
||||
|
@ -128,15 +188,20 @@ export class ElectronService {
|
|||
}
|
||||
|
||||
public async isAppImage(): Promise<boolean> {
|
||||
const promise = new Promise<boolean>((resolve) => {
|
||||
window.electronAPI.onIsAppImage((event: any, value: boolean) => {
|
||||
resolve(value);
|
||||
if (this._isAppImage === undefined) {
|
||||
const promise = new Promise<boolean>((resolve) => {
|
||||
window.electronAPI.onIsAppImage((event: any, value: boolean) => {
|
||||
window.electronAPI.unregisterOnIsAppImage();
|
||||
resolve(value);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
window.electronAPI.isAppImage();
|
||||
window.electronAPI.isAppImage();
|
||||
|
||||
return await promise;
|
||||
this._isAppImage = await promise;
|
||||
}
|
||||
|
||||
return this._isAppImage;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ export class MoneroInstallerService {
|
|||
}
|
||||
|
||||
private async getMoneroDownloadLink(): Promise<string> {
|
||||
return new Promise<string>((resolve, reject) => {
|
||||
const promise = new Promise<string>((resolve, reject) => {
|
||||
window.electronAPI.gotOsType((event: any, osType: { platform: string, arch: string }) => {
|
||||
const platform = osType.platform;
|
||||
const arch = osType.arch;
|
||||
|
@ -104,6 +104,9 @@ export class MoneroInstallerService {
|
|||
resource = this.resources.linuxriscv64;
|
||||
}
|
||||
}
|
||||
|
||||
window.electronAPI.unregisterGotOsType();
|
||||
|
||||
if (resource != '')
|
||||
{
|
||||
resolve(resource);
|
||||
|
@ -111,11 +114,10 @@ export class MoneroInstallerService {
|
|||
|
||||
reject('Unsopported platform ' + platform);
|
||||
});
|
||||
|
||||
window.electronAPI.getOsType();
|
||||
});
|
||||
|
||||
window.electronAPI.getOsType();
|
||||
|
||||
|
||||
return await promise;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
<li class="list-group-item"><strong>Minor Version:</strong> {{ lastBlockHeader.minorVersion }}</li>
|
||||
<li class="list-group-item"><strong>Nonce:</strong> {{ lastBlockHeader.nonce }}</li>
|
||||
<li class="list-group-item"><strong>Number of Transactions:</strong> {{ lastBlockHeader.numTxes }}</li>
|
||||
<li class="list-group-item"><strong>Reward:</strong> {{ lastBlockHeader.reward }} XMR</li>
|
||||
<li class="list-group-item"><strong>Reward:</strong> {{ lastBlockHeader.rewardXMR }} XMR</li>
|
||||
<li class="list-group-item"><strong>Timestamp:</strong> {{ lastBlockHeader.timestamp | date:'medium' }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
@ -280,7 +280,7 @@
|
|||
<li class="list-group-item"><strong>Minor Version:</strong> {{ blockHeader.minorVersion }}</li>
|
||||
<li class="list-group-item"><strong>Nonce:</strong> {{ blockHeader.nonce }}</li>
|
||||
<li class="list-group-item"><strong>Number of Transactions:</strong> {{ blockHeader.numTxes }}</li>
|
||||
<li class="list-group-item"><strong>Reward:</strong> {{ blockHeader.reward }} XMR</li>
|
||||
<li class="list-group-item"><strong>Reward:</strong> {{ blockHeader.rewardXMR }} XMR</li>
|
||||
<li class="list-group-item"><strong>Timestamp:</strong> {{ blockHeader.timestamp | date:'medium' }}</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
|
|
@ -241,7 +241,7 @@ export class MiningComponent extends BasePageComponent implements AfterViewInit
|
|||
new SimpleBootstrapCard('Seed hash', `${this.seedHash}`),
|
||||
new SimpleBootstrapCard('Network difficulty', `${this.difficulty}`),
|
||||
new SimpleBootstrapCard('Median block weight', `${this.medianWeight}`),
|
||||
new SimpleBootstrapCard('Generated Coins', `${this.alreadyGeneratedCoins}`)
|
||||
new SimpleBootstrapCard('Generated Coins', `${this.alreadyGeneratedCoins / 1e12} XMR`)
|
||||
];
|
||||
}
|
||||
|
||||
|
|
|
@ -247,9 +247,9 @@ export class TransactionsComponent extends BasePageComponent implements AfterVie
|
|||
const coinbaseTxSum = await this.daemonService.getCoinbaseTxSum(this.coinbaseTxSumHeight, this.coinbaseTxSumCount);
|
||||
|
||||
this.cards = [
|
||||
new SimpleBootstrapCard('Emission Amount', `${coinbaseTxSum.emissionAmount}`),
|
||||
new SimpleBootstrapCard('Emission Amount', `${coinbaseTxSum.emissionAmount / 1e12} XMR`),
|
||||
new SimpleBootstrapCard('Emission Amount Top 64', `${coinbaseTxSum.emissionAmountTop64}`),
|
||||
new SimpleBootstrapCard('Fee Amount', `${coinbaseTxSum.feeAmount}`),
|
||||
new SimpleBootstrapCard('Fee Amount', `${coinbaseTxSum.feeAmount / 1e12} XMR`),
|
||||
new SimpleBootstrapCard('Fee Amount Top 64', `${coinbaseTxSum.feeAmountTop64}`),
|
||||
new SimpleBootstrapCard('Wide Emission Amount', coinbaseTxSum.wideEmissionAmount),
|
||||
new SimpleBootstrapCard('Wide Fee Amount', coinbaseTxSum.wideFeeAmount)
|
||||
|
|
|
@ -49,6 +49,10 @@ export class BlockHeader {
|
|||
public readonly wideCumulativeDifficulty: string;
|
||||
public readonly wideDifficulty: string;
|
||||
|
||||
public get rewardXMR(): number {
|
||||
return this.reward / 1e12;
|
||||
}
|
||||
|
||||
constructor(blockSize: number, blockWeight: number, cumulativeDifficulty: number, cumulativeDifficultyTop64: number, depth: number, difficulty: number, difficultyTop64: number, hash: string, height: number, longTermWeight: number, majorVersion: number
|
||||
, minerTxHash: string, minorVersion: number, nonce: number, numTxes: number, orphanStatus: boolean, powHash: string, prevHash: string, reward: number, timestamp: number, wideCumulativeDifficulty: string, wideDifficulty: string
|
||||
) {
|
||||
|
|
|
@ -60,6 +60,7 @@ declare global {
|
|||
interface Window {
|
||||
electronAPI: {
|
||||
startMonerod: (options: string[]) => void;
|
||||
|
||||
monitorMonerod: () => void;
|
||||
onMonitorMonerod: (callback: (event: any, stats: {
|
||||
cpu: number;
|
||||
|
@ -72,10 +73,17 @@ declare global {
|
|||
}
|
||||
) => void) => void;
|
||||
onMonitorMonerodError: (callback: (event: any, error: string) => void) => void;
|
||||
unregisterOnMonitorMonerod: () => void,
|
||||
unregisterOnMonitorMonerodError: () => void,
|
||||
|
||||
onMonerodStarted: (callback: (event: any, started: boolean) => void) => void;
|
||||
getMoneroVersion: (path: string) => void;
|
||||
|
||||
onMoneroVersion: (callback: (event: any, version: string) => void) => void;
|
||||
onMoneroVersionError: (callback: (event: any, error: string) => void) => void;
|
||||
unregisterOnMoneroVersion: () => void;
|
||||
unregisterOnMoneroVersionError: () => void;
|
||||
|
||||
downloadMonerod: (downloadUrl:string, destination: string) => void;
|
||||
onDownloadProgress: (callback: (event: any, progress: { progress: number, status: string }) => void) => void;
|
||||
checkValidMonerodPath: (path: string) => void;
|
||||
|
@ -83,30 +91,40 @@ declare global {
|
|||
unsubscribeOnMonerodStarted: () => void;
|
||||
onMoneroClose: (callback: (event: any, code: number) => void) => void;
|
||||
onMoneroStdout: (callbak: (event: any, out: string) => void) => void;
|
||||
unregisterOnMoneroStdout: () => void;
|
||||
|
||||
isWifiConnected: () => void;
|
||||
onIsWifiConnectedResponse: (callback: (event: any, connected: boolean) => void) => void;
|
||||
unregisterOnIsWifiConnectedResponse: () => void;
|
||||
selectFolder: () => void;
|
||||
selectFile: (extensions?: string[]) => void;
|
||||
onSelectedFolder: (callback: (event: any, path: string) => void) => void;
|
||||
onSelectedFile: (callback: (event: any, path: string) => void) => void;
|
||||
getOsType: () => void;
|
||||
gotOsType: (callback: (event: any, osType: { platform: string, arch: string }) => void) => void;
|
||||
unregisterGotOsType: () => void;
|
||||
showNotification: (options: NotificationConstructorOptions) => void;
|
||||
quit: () => void;
|
||||
|
||||
isAppImage: () => void;
|
||||
onIsAppImage: (callback: (event: any, value: boolean) => void) => void;
|
||||
unregisterOnIsAppImage: () => void;
|
||||
|
||||
isAutoLaunchEnabled: () => void;
|
||||
onIsAutoLaunchEnabled: (callback: (event: any, enabled: boolean) => void) => void;
|
||||
unregisterOnIsAutoLaunchEnabled: () => void;
|
||||
|
||||
enableAutoLaunch: (minimized: boolean) => void;
|
||||
onEnableAutoLaunchError: (callback: (event: any, error: string) => void) => void;
|
||||
onEnableAutoLaunchSuccess: (callback: (event: any) => void) => void;
|
||||
unregisterOnEnableAutoLaunchError: () => void,
|
||||
unregisterOnEnableAutoLaunchSuccess: () => void,
|
||||
|
||||
disableAutoLaunch: () => void;
|
||||
onDisableAutoLaunchError: (callback: (event: any, error: string) => void) => void;
|
||||
onDisableAutoLaunchSuccess: (callback: (event: any) => void) => void;
|
||||
unregisterOnDisableAutoLaunchError: () => void,
|
||||
unregisterOnDisableAutoLaunchSuccess: () => void,
|
||||
|
||||
isAutoLaunched: () => void;
|
||||
onIsAutoLaunched: (callback: (event: any, isAutoLaunched: boolean) => void) => void;
|
||||
|
|
Loading…
Reference in a new issue