@spirobel/monero-wallet-api 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -4,6 +4,8 @@ export type ScanSetting = {
|
|
|
4
4
|
subaddress_index?: number;
|
|
5
5
|
halted?: boolean;
|
|
6
6
|
wallet_route?: string;
|
|
7
|
+
wallet_name?: string;
|
|
8
|
+
wallet_index?: number;
|
|
7
9
|
};
|
|
8
10
|
export type WriteScanSettingParams = {
|
|
9
11
|
primary_address: string;
|
|
@@ -13,6 +15,8 @@ export type WriteScanSettingParams = {
|
|
|
13
15
|
scan_settings_path?: string;
|
|
14
16
|
node_url?: string;
|
|
15
17
|
wallet_route?: string;
|
|
18
|
+
wallet_name?: string;
|
|
19
|
+
wallet_index?: number;
|
|
16
20
|
};
|
|
17
21
|
export type ScanSettingOpened = {
|
|
18
22
|
primary_address: string;
|
|
@@ -23,6 +27,8 @@ export type ScanSettingOpened = {
|
|
|
23
27
|
halted?: boolean;
|
|
24
28
|
secret_spend_key?: string;
|
|
25
29
|
wallet_route?: string;
|
|
30
|
+
wallet_name?: string;
|
|
31
|
+
wallet_index?: number;
|
|
26
32
|
};
|
|
27
33
|
export type ScanSettings = {
|
|
28
34
|
wallets: ScanSetting[];
|
|
@@ -89,6 +95,8 @@ export declare function walletSettingsPlusKeys(wallet_settings: ScanSettingOpene
|
|
|
89
95
|
subaddress_index?: number;
|
|
90
96
|
halted?: boolean;
|
|
91
97
|
wallet_route?: string;
|
|
98
|
+
wallet_name?: string;
|
|
99
|
+
wallet_index?: number;
|
|
92
100
|
}>;
|
|
93
101
|
export declare function writeWalletToScanSettings(params: WriteScanSettingParams): Promise<number>;
|
|
94
102
|
export declare function openScanSettingsFile(scan_settings_path?: string): Promise<ScanSettings | undefined>;
|
|
@@ -177,6 +177,8 @@ export async function writeWalletToScanSettings(params) {
|
|
|
177
177
|
subaddress_index: params.subaddress_index || 1,
|
|
178
178
|
halted: params.halted,
|
|
179
179
|
wallet_route: params.wallet_route,
|
|
180
|
+
wallet_name: params.wallet_name,
|
|
181
|
+
wallet_index: params.wallet_index,
|
|
180
182
|
},
|
|
181
183
|
],
|
|
182
184
|
node_url: params.node_url,
|
|
@@ -196,6 +198,8 @@ export async function writeWalletToScanSettings(params) {
|
|
|
196
198
|
subaddress_index: params.subaddress_index || 1,
|
|
197
199
|
halted: params.halted,
|
|
198
200
|
wallet_route: params.wallet_route,
|
|
201
|
+
wallet_name: params.wallet_name,
|
|
202
|
+
wallet_index: params.wallet_index,
|
|
199
203
|
});
|
|
200
204
|
}
|
|
201
205
|
else {
|
|
@@ -206,6 +210,8 @@ export async function writeWalletToScanSettings(params) {
|
|
|
206
210
|
params.subaddress_index || wallet.subaddress_index || 1;
|
|
207
211
|
wallet.halted = params.halted || wallet.halted;
|
|
208
212
|
wallet.wallet_route = params.wallet_route || wallet.wallet_route;
|
|
213
|
+
wallet.wallet_name = params.wallet_name || wallet.wallet_name;
|
|
214
|
+
wallet.wallet_index = params.wallet_index || wallet.wallet_index;
|
|
209
215
|
}
|
|
210
216
|
}
|
|
211
217
|
return await atomicWrite(params.scan_settings_path, JSON.stringify(scanSettings, null, 2));
|
|
@@ -20,6 +20,8 @@ export type CreateTransactionParams = {
|
|
|
20
20
|
export declare class ScanCacheOpened {
|
|
21
21
|
readonly view_pair: ViewPair;
|
|
22
22
|
readonly wallet_route: string | undefined;
|
|
23
|
+
readonly wallet_name: string | undefined;
|
|
24
|
+
readonly wallet_index: number | undefined;
|
|
23
25
|
readonly no_worker: boolean;
|
|
24
26
|
readonly masterCacheChanged: CacheChangedCallback | null;
|
|
25
27
|
private _start_height;
|
|
@@ -9,6 +9,8 @@ import { readWriteConnectionStatusFile, } from "../connectionStatus";
|
|
|
9
9
|
export class ScanCacheOpened {
|
|
10
10
|
view_pair;
|
|
11
11
|
wallet_route;
|
|
12
|
+
wallet_name;
|
|
13
|
+
wallet_index;
|
|
12
14
|
no_worker;
|
|
13
15
|
masterCacheChanged;
|
|
14
16
|
_start_height;
|
|
@@ -27,7 +29,7 @@ export class ScanCacheOpened {
|
|
|
27
29
|
// read secret_view_key and secret_spend_key from env
|
|
28
30
|
const walletSettingsWithKeys = await walletSettingsPlusKeys(walletSettings);
|
|
29
31
|
// create viewpair + ScanCacheOpened instance
|
|
30
|
-
const scanCacheOpen = new ScanCacheOpened(await ViewPair.create(params.primary_address, walletSettingsWithKeys.secret_view_key, walletSettings.subaddress_index, walletSettings.node_url), walletSettings.wallet_route, params.no_worker || false, params.masterCacheChanged || null, walletSettings.start_height, params.scan_settings_path, params.pathPrefix, params.workerError);
|
|
32
|
+
const scanCacheOpen = new ScanCacheOpened(await ViewPair.create(params.primary_address, walletSettingsWithKeys.secret_view_key, walletSettings.subaddress_index, walletSettings.node_url), walletSettings.wallet_route, walletSettings.wallet_name, walletSettings.wallet_index, params.no_worker || false, params.masterCacheChanged || null, walletSettings.start_height, params.scan_settings_path, params.pathPrefix, params.workerError);
|
|
31
33
|
if (theCatchToBeOpened)
|
|
32
34
|
scanCacheOpen._cache = theCatchToBeOpened;
|
|
33
35
|
if (!walletSettings.halted) {
|
|
@@ -520,9 +522,11 @@ export class ScanCacheOpened {
|
|
|
520
522
|
primary_address: "",
|
|
521
523
|
};
|
|
522
524
|
worker = undefined;
|
|
523
|
-
constructor(view_pair, wallet_route, no_worker, masterCacheChanged, _start_height, scan_settings_path, pathPrefix, workerError) {
|
|
525
|
+
constructor(view_pair, wallet_route, wallet_name, wallet_index, no_worker, masterCacheChanged, _start_height, scan_settings_path, pathPrefix, workerError) {
|
|
524
526
|
this.view_pair = view_pair;
|
|
525
527
|
this.wallet_route = wallet_route;
|
|
528
|
+
this.wallet_name = wallet_name;
|
|
529
|
+
this.wallet_index = wallet_index;
|
|
526
530
|
this.no_worker = no_worker;
|
|
527
531
|
this.masterCacheChanged = masterCacheChanged;
|
|
528
532
|
this._start_height = _start_height;
|