@spirobel/monero-wallet-api 0.5.5 → 0.6.1
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.
- package/dist/actionlog/actionLogOpened.d.ts +96 -1
- package/dist/actionlog/actionLogOpened.js +386 -1
- package/dist/actionlog/actionLogTypes.d.ts +114 -0
- package/dist/actionlog/actionLogTypes.js +198 -0
- package/dist/actionlog/backend/idbBackend.d.ts +13 -0
- package/dist/actionlog/backend/idbBackend.js +109 -0
- package/dist/actionlog/backend/jsonlBackend.d.ts +19 -0
- package/dist/actionlog/backend/jsonlBackend.js +110 -0
- package/dist/actionlog/backend/memoryBackend.d.ts +11 -0
- package/dist/actionlog/backend/memoryBackend.js +31 -0
- package/dist/actionlog/backend/sqliteBackend.d.ts +14 -0
- package/dist/actionlog/backend/sqliteBackend.js +96 -0
- package/dist/actionlog/backend.d.ts +12 -0
- package/dist/actionlog/backend.js +1 -0
- package/dist/actionlog/idbBackend.d.ts +19 -0
- package/dist/actionlog/idbBackend.js +98 -0
- package/dist/actionlog/jsonlBackend.d.ts +19 -0
- package/dist/actionlog/jsonlBackend.js +75 -0
- package/dist/actionlog/memoryBackend.d.ts +14 -0
- package/dist/actionlog/memoryBackend.js +38 -0
- package/dist/actionlog/openMaps.d.ts +11 -0
- package/dist/actionlog/openMaps.js +32 -0
- package/dist/actionlog/sqliteBackend.d.ts +18 -0
- package/dist/actionlog/sqliteBackend.js +105 -0
- package/dist/actionlog/toolContext.d.ts +36 -0
- package/dist/actionlog/toolContext.js +1 -0
- package/dist/actionlog/types.d.ts +62 -0
- package/dist/actionlog/types.js +62 -0
- package/dist/io/logging.js +1 -1
- package/dist/multisig/escrow.js +1 -1
- package/dist/scanning-syncing/backgroundWorker.js +1 -1
- package/dist/scanning-syncing/blocksbuffer/blocksBufferFetchLoop.d.ts +1 -1
- package/dist/scanning-syncing/blocksbuffer/blocksBufferFetchLoop.js +1 -1
- package/dist/scanning-syncing/blocksbuffer/blocksbufferCoordination.d.ts +1 -1
- package/dist/scanning-syncing/blocksbuffer/blocksbufferCoordination.js +2 -2
- package/dist/scanning-syncing/connectionStatus.d.ts +3 -1
- package/dist/scanning-syncing/connectionStatus.js +38 -3
- package/dist/scanning-syncing/connectionStatusOpened.d.ts +1 -1
- package/dist/scanning-syncing/connectionStatusOpened.js +2 -11
- package/dist/scanning-syncing/openWallet.js +1 -1
- package/dist/scanning-syncing/scanresult/computeKeyImage.d.ts +1 -1
- package/dist/scanning-syncing/scanresult/scanCache.d.ts +6 -2
- package/dist/scanning-syncing/scanresult/scanCache.js +12 -3
- package/dist/scanning-syncing/scanresult/scanCacheOpened.d.ts +47 -2
- package/dist/scanning-syncing/scanresult/scanCacheOpened.js +328 -47
- package/dist/scanning-syncing/scanresult/scanCoordination.d.ts +3 -2
- package/dist/scanning-syncing/scanresult/scanCoordination.js +42 -6
- package/dist/scanning-syncing/scanresult/scanLoop.d.ts +1 -1
- package/dist/scanning-syncing/scanresult/scanLoop.js +1 -1
- package/dist/scanning-syncing/scanresult/scanResult.d.ts +1 -1
- package/dist/scanning-syncing/scanresult/scanResult.js +18 -13
- package/dist/scanning-syncing/scanresult/scanStats.d.ts +1 -1
- package/dist/scanning-syncing/scanresult/scanStats.js +9 -6
- package/dist/scanning-syncing/worker-entrypoints/worker.js +1 -1
- package/dist/scanning-syncing/worker-mains/cpubound-main.js +1 -1
- package/dist/scanning-syncing/worker-mains/multisig-main.d.ts +1 -1
- package/dist/scanning-syncing/worker-mains/multisig-main.js +1 -1
- package/dist/scanning-syncing/worker-mains/worker.js +1 -1
- package/dist/scansettings/scanSettings.js +1 -1
- package/dist/scansettings/scanSettingsOpened.d.ts +1 -1
- package/dist/scansettings/scanSettingsOpened.js +1 -1
- package/dist/send-functionality/inputSelection.d.ts +1 -1
- package/dist/send-functionality/transactionBuilding.d.ts +1 -1
- package/dist/tools/calls/001.d.ts +20 -0
- package/dist/tools/calls/001.js +236 -0
- package/dist/tools/calls/002-content.d.ts +46 -0
- package/dist/tools/calls/002-content.js +135 -0
- package/dist/tools/calls/002-fail-cleanup.d.ts +27 -0
- package/dist/tools/calls/002-fail-cleanup.js +60 -0
- package/dist/tools/calls/002.d.ts +64 -0
- package/dist/tools/calls/002.js +353 -0
- package/dist/tools/content.d.ts +22 -0
- package/dist/tools/content.js +41 -0
- package/dist/tools/counterparty.d.ts +3 -0
- package/dist/tools/counterparty.js +1 -0
- package/dist/tools/download-public-suffix.d.ts +1 -0
- package/dist/tools/download-public-suffix.js +20 -0
- package/dist/tools/globals.d.ts +196 -0
- package/dist/tools/globals.js +14 -0
- package/dist/tools/monero-tools-content.d.ts +29 -0
- package/dist/tools/monero-tools-content.js +80 -0
- package/dist/tools/monero-tools.d.ts +27 -52
- package/dist/tools/monero-tools.js +127 -222
- package/dist/tools/public-suffix-list.d.ts +1 -0
- package/dist/tools/public-suffix-list.js +10336 -0
- package/dist/tools/runtimeMessages.d.ts +4 -0
- package/dist/tools/runtimeMessages.js +18 -0
- package/dist/tools/toolActionLogContext.d.ts +33 -0
- package/dist/tools/toolActionLogContext.js +1 -0
- package/dist/tools/toolArm.d.ts +47 -0
- package/dist/tools/toolArm.js +1 -0
- package/dist/tools/ui.d.ts +2 -0
- package/dist/tools/ui.js +1 -0
- package/dist/tools/worker.d.ts +1 -0
- package/dist/tools/worker.js +1 -0
- package/dist/viewpair/ViewPair.d.ts +3 -3
- package/dist/viewpair/ViewPair.js +2 -2
- package/dist/wasm-processing/wasmFile.js +2 -2
- package/dist/{api.d.ts → xmr3.d.ts} +4 -0
- package/dist/{api.js → xmr3.js} +3 -0
- package/package.json +13 -6
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CatastrophicReorgError } from "../../
|
|
1
|
+
import { CatastrophicReorgError } from "../../xmr3";
|
|
2
2
|
import { computeKeyImage } from "./computeKeyImage";
|
|
3
3
|
import { log } from "../../io/logging";
|
|
4
4
|
import { mergeRanges, findRange, findRangeThrows } from "./scanCache";
|
|
@@ -39,7 +39,7 @@ export async function processScanResult(params) {
|
|
|
39
39
|
reverted_spends: [],
|
|
40
40
|
};
|
|
41
41
|
}
|
|
42
|
-
else {
|
|
42
|
+
else if (!cache.reorg_info.split_heights.some((s) => s.block_hash === split_height.block_hash)) {
|
|
43
43
|
cache.reorg_info.split_heights.push(split_height);
|
|
44
44
|
}
|
|
45
45
|
// First, collect reverted spends from all outputs (before any removals)
|
|
@@ -56,11 +56,14 @@ export async function processScanResult(params) {
|
|
|
56
56
|
for (const [id, old_output_state] of removed_outputs) {
|
|
57
57
|
// 1. find key_image of output to be removed (as it was reorged)
|
|
58
58
|
const [key_image] = Object.entries(cache.own_key_images).find(([own_key_image, globalid]) => globalid === id) || [""]; // if this is viewonly the key_image will be empty
|
|
59
|
-
cache.reorg_info.removed_outputs.
|
|
60
|
-
old_output_state
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
if (!cache.reorg_info.removed_outputs.some((r) => r.old_output_state.index_on_blockchain ===
|
|
60
|
+
old_output_state.index_on_blockchain)) {
|
|
61
|
+
cache.reorg_info.removed_outputs.push({
|
|
62
|
+
old_output_state,
|
|
63
|
+
key_image,
|
|
64
|
+
split_height,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
64
67
|
// 2. remove from outputs and own_key_images
|
|
65
68
|
delete cache.outputs[id];
|
|
66
69
|
delete cache.own_key_images[key_image];
|
|
@@ -72,11 +75,14 @@ export async function processScanResult(params) {
|
|
|
72
75
|
for (const [id, old_output_state_pointer] of reverted_outputs) {
|
|
73
76
|
const [key_image] = Object.entries(cache.own_key_images).find(([own_key_image, globalid]) => globalid === id) || [""]; // if this is viewonly the key_image will be empty
|
|
74
77
|
const old_output_state = Object.assign({}, old_output_state_pointer);
|
|
75
|
-
cache.reorg_info.reverted_spends.
|
|
76
|
-
old_output_state
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
if (!cache.reorg_info.reverted_spends.some((r) => r.old_output_state.index_on_blockchain ===
|
|
79
|
+
old_output_state.index_on_blockchain)) {
|
|
80
|
+
cache.reorg_info.reverted_spends.push({
|
|
81
|
+
old_output_state,
|
|
82
|
+
key_image, // in this case key_image only used here, does not get removed
|
|
83
|
+
split_height,
|
|
84
|
+
});
|
|
85
|
+
}
|
|
80
86
|
// remove spend info from original cache (if output still exists
|
|
81
87
|
// it may have been deleted above in the removed_outputs loop)
|
|
82
88
|
if (cache.outputs[id]) {
|
|
@@ -226,7 +232,6 @@ export function outputStatus(output, cache, current_height) {
|
|
|
226
232
|
if (unlock_height > current_height) {
|
|
227
233
|
return { status: "pending", unlock_height };
|
|
228
234
|
}
|
|
229
|
-
// TODO: check that that output is not txlog input indeces
|
|
230
235
|
return { status: "spendable" };
|
|
231
236
|
}
|
|
232
237
|
export function spendable(output, cache, current_height) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { stat } from "fs";
|
|
2
|
-
import { atomicWrite, ViewPair } from "../../
|
|
2
|
+
import { atomicWrite, ViewPair } from "../../xmr3";
|
|
3
3
|
import { outputStatus } from "./scanResult";
|
|
4
4
|
export async function writeStatsFileDefaultLocation(params) {
|
|
5
5
|
let stats = await readStatsFileDefaultLocation(params.primary_address, params.pathPrefix);
|
|
@@ -120,16 +120,19 @@ export function processFoundTransactions(cache, stats, current_height) {
|
|
|
120
120
|
}
|
|
121
121
|
// handle spent case
|
|
122
122
|
if (output.spent_in_tx_hash) {
|
|
123
|
-
const
|
|
124
|
-
? cache.pending_spent_utxos[output.index_on_blockchain]
|
|
125
|
-
:
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
const spentIndex = cache.pending_spent_utxos
|
|
124
|
+
? cache.pending_spent_utxos[String(output.index_on_blockchain)]
|
|
125
|
+
: undefined;
|
|
126
|
+
// index 0 is a real log. do not treat it as missing.
|
|
127
|
+
const txlog = cache.tx_logs && spentIndex !== undefined
|
|
128
|
+
? cache.tx_logs[spentIndex]
|
|
128
129
|
: undefined;
|
|
129
130
|
const spentTx = stats.found_transactions[output.spent_in_tx_hash];
|
|
130
131
|
if (spentTx) {
|
|
131
132
|
spentTx.amount -= output.amount;
|
|
132
133
|
spentTx.inputs.push(output);
|
|
134
|
+
if (!spentTx.txlog && txlog)
|
|
135
|
+
spentTx.txlog = txlog;
|
|
133
136
|
}
|
|
134
137
|
else {
|
|
135
138
|
stats.found_transactions[output.spent_in_tx_hash] = {
|