@shieldedtech/moth-wallet 0.2.0
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/README.md +62 -0
- package/dist/contract/args-parser.d.ts +29 -0
- package/dist/contract/args-parser.d.ts.map +1 -0
- package/dist/contract/args-parser.js +123 -0
- package/dist/contract/args-parser.js.map +1 -0
- package/dist/contract/artifact-loader.d.ts +26 -0
- package/dist/contract/artifact-loader.d.ts.map +1 -0
- package/dist/contract/artifact-loader.js +129 -0
- package/dist/contract/artifact-loader.js.map +1 -0
- package/dist/contract/call.d.ts +32 -0
- package/dist/contract/call.d.ts.map +1 -0
- package/dist/contract/call.js +245 -0
- package/dist/contract/call.js.map +1 -0
- package/dist/contract/deploy.d.ts +36 -0
- package/dist/contract/deploy.d.ts.map +1 -0
- package/dist/contract/deploy.js +388 -0
- package/dist/contract/deploy.js.map +1 -0
- package/dist/contract/fungible-token.d.ts +40 -0
- package/dist/contract/fungible-token.d.ts.map +1 -0
- package/dist/contract/fungible-token.js +88 -0
- package/dist/contract/fungible-token.js.map +1 -0
- package/dist/contract/initial-private-state.d.ts +18 -0
- package/dist/contract/initial-private-state.d.ts.map +1 -0
- package/dist/contract/initial-private-state.js +44 -0
- package/dist/contract/initial-private-state.js.map +1 -0
- package/dist/contract/maintenance.d.ts +72 -0
- package/dist/contract/maintenance.d.ts.map +1 -0
- package/dist/contract/maintenance.js +430 -0
- package/dist/contract/maintenance.js.map +1 -0
- package/dist/contract/state.d.ts +16 -0
- package/dist/contract/state.d.ts.map +1 -0
- package/dist/contract/state.js +18 -0
- package/dist/contract/state.js.map +1 -0
- package/dist/contract/witness-loader.d.ts +3 -0
- package/dist/contract/witness-loader.d.ts.map +1 -0
- package/dist/contract/witness-loader.js +27 -0
- package/dist/contract/witness-loader.js.map +1 -0
- package/dist/daemon/api-keys.d.ts +66 -0
- package/dist/daemon/api-keys.d.ts.map +1 -0
- package/dist/daemon/api-keys.js +222 -0
- package/dist/daemon/api-keys.js.map +1 -0
- package/dist/daemon/audit-log.d.ts +65 -0
- package/dist/daemon/audit-log.d.ts.map +1 -0
- package/dist/daemon/audit-log.js +73 -0
- package/dist/daemon/audit-log.js.map +1 -0
- package/dist/daemon/client.d.ts +63 -0
- package/dist/daemon/client.d.ts.map +1 -0
- package/dist/daemon/client.js +214 -0
- package/dist/daemon/client.js.map +1 -0
- package/dist/daemon/confirmation-queue.d.ts +46 -0
- package/dist/daemon/confirmation-queue.d.ts.map +1 -0
- package/dist/daemon/confirmation-queue.js +92 -0
- package/dist/daemon/confirmation-queue.js.map +1 -0
- package/dist/daemon/index.d.ts +23 -0
- package/dist/daemon/index.d.ts.map +1 -0
- package/dist/daemon/index.js +26 -0
- package/dist/daemon/index.js.map +1 -0
- package/dist/daemon/protocol.d.ts +40 -0
- package/dist/daemon/protocol.d.ts.map +1 -0
- package/dist/daemon/protocol.js +104 -0
- package/dist/daemon/protocol.js.map +1 -0
- package/dist/daemon/server.d.ts +158 -0
- package/dist/daemon/server.d.ts.map +1 -0
- package/dist/daemon/server.js +297 -0
- package/dist/daemon/server.js.map +1 -0
- package/dist/daemon/wallet-handlers.d.ts +37 -0
- package/dist/daemon/wallet-handlers.d.ts.map +1 -0
- package/dist/daemon/wallet-handlers.js +533 -0
- package/dist/daemon/wallet-handlers.js.map +1 -0
- package/dist/daemon/wallet-rpc-parsers.d.ts +14 -0
- package/dist/daemon/wallet-rpc-parsers.d.ts.map +1 -0
- package/dist/daemon/wallet-rpc-parsers.js +259 -0
- package/dist/daemon/wallet-rpc-parsers.js.map +1 -0
- package/dist/daemon/wallet-rpc-types.d.ts +138 -0
- package/dist/daemon/wallet-rpc-types.d.ts.map +1 -0
- package/dist/daemon/wallet-rpc-types.js +11 -0
- package/dist/daemon/wallet-rpc-types.js.map +1 -0
- package/dist/diagnostics/fs-timing-store.d.ts +29 -0
- package/dist/diagnostics/fs-timing-store.d.ts.map +1 -0
- package/dist/diagnostics/fs-timing-store.js +81 -0
- package/dist/diagnostics/fs-timing-store.js.map +1 -0
- package/dist/diagnostics/timings.d.ts +64 -0
- package/dist/diagnostics/timings.d.ts.map +1 -0
- package/dist/diagnostics/timings.js +100 -0
- package/dist/diagnostics/timings.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +47 -0
- package/dist/index.js.map +1 -0
- package/dist/network/indexer-client.d.ts +66 -0
- package/dist/network/indexer-client.d.ts.map +1 -0
- package/dist/network/indexer-client.js +112 -0
- package/dist/network/indexer-client.js.map +1 -0
- package/dist/network/node-client.d.ts +27 -0
- package/dist/network/node-client.d.ts.map +1 -0
- package/dist/network/node-client.js +94 -0
- package/dist/network/node-client.js.map +1 -0
- package/dist/proof/client.d.ts +15 -0
- package/dist/proof/client.d.ts.map +1 -0
- package/dist/proof/client.js +77 -0
- package/dist/proof/client.js.map +1 -0
- package/dist/proof/provider.d.ts +12 -0
- package/dist/proof/provider.d.ts.map +1 -0
- package/dist/proof/provider.js +96 -0
- package/dist/proof/provider.js.map +1 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +2 -0
- package/dist/providers/index.js.map +1 -0
- package/dist/providers/midnight-provider.d.ts +11 -0
- package/dist/providers/midnight-provider.d.ts.map +1 -0
- package/dist/providers/midnight-provider.js +30 -0
- package/dist/providers/midnight-provider.js.map +1 -0
- package/dist/storage/adapter.d.ts +8 -0
- package/dist/storage/adapter.d.ts.map +1 -0
- package/dist/storage/adapter.js +2 -0
- package/dist/storage/adapter.js.map +1 -0
- package/dist/storage/fs-adapter.d.ts +14 -0
- package/dist/storage/fs-adapter.d.ts.map +1 -0
- package/dist/storage/fs-adapter.js +126 -0
- package/dist/storage/fs-adapter.js.map +1 -0
- package/dist/storage/safe-path.d.ts +13 -0
- package/dist/storage/safe-path.d.ts.map +1 -0
- package/dist/storage/safe-path.js +35 -0
- package/dist/storage/safe-path.js.map +1 -0
- package/dist/sync/activity.d.ts +53 -0
- package/dist/sync/activity.d.ts.map +1 -0
- package/dist/sync/activity.js +92 -0
- package/dist/sync/activity.js.map +1 -0
- package/dist/sync/dust-registration-estimate.d.ts +54 -0
- package/dist/sync/dust-registration-estimate.d.ts.map +1 -0
- package/dist/sync/dust-registration-estimate.js +103 -0
- package/dist/sync/dust-registration-estimate.js.map +1 -0
- package/dist/sync/node-sync-store.d.ts +10 -0
- package/dist/sync/node-sync-store.d.ts.map +1 -0
- package/dist/sync/node-sync-store.js +42 -0
- package/dist/sync/node-sync-store.js.map +1 -0
- package/dist/sync/operations.d.ts +138 -0
- package/dist/sync/operations.d.ts.map +1 -0
- package/dist/sync/operations.js +395 -0
- package/dist/sync/operations.js.map +1 -0
- package/dist/sync/preseed-parts.d.ts +18 -0
- package/dist/sync/preseed-parts.d.ts.map +1 -0
- package/dist/sync/preseed-parts.js +33 -0
- package/dist/sync/preseed-parts.js.map +1 -0
- package/dist/sync/preseed.d.ts +95 -0
- package/dist/sync/preseed.d.ts.map +1 -0
- package/dist/sync/preseed.js +365 -0
- package/dist/sync/preseed.js.map +1 -0
- package/dist/sync/progress.d.ts +45 -0
- package/dist/sync/progress.d.ts.map +1 -0
- package/dist/sync/progress.js +51 -0
- package/dist/sync/progress.js.map +1 -0
- package/dist/sync/sdk-dedup.d.ts +53 -0
- package/dist/sync/sdk-dedup.d.ts.map +1 -0
- package/dist/sync/sdk-dedup.js +134 -0
- package/dist/sync/sdk-dedup.js.map +1 -0
- package/dist/sync/sync-store.d.ts +33 -0
- package/dist/sync/sync-store.d.ts.map +1 -0
- package/dist/sync/sync-store.js +45 -0
- package/dist/sync/sync-store.js.map +1 -0
- package/dist/sync/wallet-sync.d.ts +153 -0
- package/dist/sync/wallet-sync.d.ts.map +1 -0
- package/dist/sync/wallet-sync.js +943 -0
- package/dist/sync/wallet-sync.js.map +1 -0
- package/dist/types/errors.d.ts +18 -0
- package/dist/types/errors.d.ts.map +1 -0
- package/dist/types/errors.js +33 -0
- package/dist/types/errors.js.map +1 -0
- package/dist/types/exit-codes.d.ts +8 -0
- package/dist/types/exit-codes.d.ts.map +1 -0
- package/dist/types/exit-codes.js +7 -0
- package/dist/types/exit-codes.js.map +1 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/network.d.ts +65 -0
- package/dist/types/network.d.ts.map +1 -0
- package/dist/types/network.js +108 -0
- package/dist/types/network.js.map +1 -0
- package/dist/types/tokens.d.ts +3 -0
- package/dist/types/tokens.d.ts.map +1 -0
- package/dist/types/tokens.js +11 -0
- package/dist/types/tokens.js.map +1 -0
- package/dist/types/transaction.d.ts +13 -0
- package/dist/types/transaction.d.ts.map +1 -0
- package/dist/types/transaction.js +2 -0
- package/dist/types/transaction.js.map +1 -0
- package/dist/types/wallet.d.ts +82 -0
- package/dist/types/wallet.d.ts.map +1 -0
- package/dist/types/wallet.js +2 -0
- package/dist/types/wallet.js.map +1 -0
- package/dist/wallet/address-validate.d.ts +7 -0
- package/dist/wallet/address-validate.d.ts.map +1 -0
- package/dist/wallet/address-validate.js +28 -0
- package/dist/wallet/address-validate.js.map +1 -0
- package/dist/wallet/address.d.ts +32 -0
- package/dist/wallet/address.d.ts.map +1 -0
- package/dist/wallet/address.js +107 -0
- package/dist/wallet/address.js.map +1 -0
- package/dist/wallet/app-secret.d.ts +15 -0
- package/dist/wallet/app-secret.d.ts.map +1 -0
- package/dist/wallet/app-secret.js +45 -0
- package/dist/wallet/app-secret.js.map +1 -0
- package/dist/wallet/balance-format.d.ts +12 -0
- package/dist/wallet/balance-format.d.ts.map +1 -0
- package/dist/wallet/balance-format.js +51 -0
- package/dist/wallet/balance-format.js.map +1 -0
- package/dist/wallet/batch-transfer.d.ts +36 -0
- package/dist/wallet/batch-transfer.d.ts.map +1 -0
- package/dist/wallet/batch-transfer.js +93 -0
- package/dist/wallet/batch-transfer.js.map +1 -0
- package/dist/wallet/keystore.d.ts +16 -0
- package/dist/wallet/keystore.d.ts.map +1 -0
- package/dist/wallet/keystore.js +76 -0
- package/dist/wallet/keystore.js.map +1 -0
- package/dist/wallet/manager.d.ts +77 -0
- package/dist/wallet/manager.d.ts.map +1 -0
- package/dist/wallet/manager.js +474 -0
- package/dist/wallet/manager.js.map +1 -0
- package/dist/wallet/mnemonic.d.ts +5 -0
- package/dist/wallet/mnemonic.d.ts.map +1 -0
- package/dist/wallet/mnemonic.js +28 -0
- package/dist/wallet/mnemonic.js.map +1 -0
- package/dist/wallet/sign-message.d.ts +20 -0
- package/dist/wallet/sign-message.d.ts.map +1 -0
- package/dist/wallet/sign-message.js +58 -0
- package/dist/wallet/sign-message.js.map +1 -0
- package/package.json +55 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Client-side workaround for an off-by-one in
|
|
2
|
+
// @midnightntwrk/wallet-sdk-shielded and @midnightntwrk/wallet-sdk-dust-wallet.
|
|
3
|
+
//
|
|
4
|
+
// The SDKs' default applyUpdate looks roughly like:
|
|
5
|
+
//
|
|
6
|
+
// const last = updates.at(-1);
|
|
7
|
+
// if (BigInt(last.id) <= state.progress.appliedIndex) return early-skip;
|
|
8
|
+
// replayEventsWithChanges(state, ..., updates.map(toEvent));
|
|
9
|
+
// appliedIndex = BigInt(last.id);
|
|
10
|
+
//
|
|
11
|
+
// The early-skip only fires when the LAST event in the batch is already
|
|
12
|
+
// applied. When the indexer re-sends a boundary event (subscription
|
|
13
|
+
// reconnect, keepalive race, etc.) and that event sits at the head of an
|
|
14
|
+
// otherwise-fresh batch, the duplicate slips through to the WASM tree:
|
|
15
|
+
//
|
|
16
|
+
// Error: values inserted non-linearly into zswap commitment tree;
|
|
17
|
+
// expected to insert index N+1, but received N.
|
|
18
|
+
//
|
|
19
|
+
// The fix is to filter the batch BEFORE replay, dropping any event with
|
|
20
|
+
// id <= state.progress.appliedIndex. If everything filters out the
|
|
21
|
+
// behavior matches the SDK's own skip path; if some events remain we
|
|
22
|
+
// hand them to the original applyUpdate which advances appliedIndex
|
|
23
|
+
// against the new tail.
|
|
24
|
+
//
|
|
25
|
+
// We wrap rather than fork — V1Builder.withSync is the documented
|
|
26
|
+
// extension point.
|
|
27
|
+
import { V1Builder as ShieldedV1Builder, Sync as ShieldedSync, CoreWallet as ShieldedCoreWallet, } from '@midnightntwrk/wallet-sdk/shielded/v1';
|
|
28
|
+
import { V1Builder as DustV1Builder, SyncService as DustSyncService, CoreWallet as DustCoreWallet, } from '@midnightntwrk/wallet-sdk/dust/v1';
|
|
29
|
+
/**
|
|
30
|
+
* Walk the updates array and split into "already applied" vs "still to
|
|
31
|
+
* apply" against the wallet's current appliedIndex. The boundary event
|
|
32
|
+
* — the one whose id equals appliedIndex — counts as already applied.
|
|
33
|
+
*/
|
|
34
|
+
function partitionByAppliedIndex(updates, appliedIndex) {
|
|
35
|
+
const fresh = [];
|
|
36
|
+
for (const u of updates) {
|
|
37
|
+
if (BigInt(u.id) > appliedIndex)
|
|
38
|
+
fresh.push(u);
|
|
39
|
+
}
|
|
40
|
+
return { fresh, droppedCount: updates.length - fresh.length };
|
|
41
|
+
}
|
|
42
|
+
function makeDedupingApplyUpdate(base, updateProgress) {
|
|
43
|
+
return (state, wrapped) => {
|
|
44
|
+
if (wrapped.updates.length === 0) {
|
|
45
|
+
return base.applyUpdate(state, wrapped);
|
|
46
|
+
}
|
|
47
|
+
const { fresh, droppedCount } = partitionByAppliedIndex(wrapped.updates, state.progress.appliedIndex);
|
|
48
|
+
if (droppedCount === 0) {
|
|
49
|
+
// No duplicates — fast path, defer entirely to the SDK.
|
|
50
|
+
return base.applyUpdate(state, wrapped);
|
|
51
|
+
}
|
|
52
|
+
if (fresh.length === 0) {
|
|
53
|
+
// Whole batch is already-applied. Mirror the SDK's own early-skip
|
|
54
|
+
// shape so downstream observers see the same "still-connected,
|
|
55
|
+
// bumped highest-relevant-index" signal.
|
|
56
|
+
const tail = wrapped.updates[wrapped.updates.length - 1];
|
|
57
|
+
const highestRelevantWalletIndex = BigInt(tail.maxId);
|
|
58
|
+
return [
|
|
59
|
+
updateProgress(state, { highestRelevantWalletIndex, isConnected: true }),
|
|
60
|
+
{ changes: [], protocolVersion: Number(state.protocolVersion) },
|
|
61
|
+
];
|
|
62
|
+
}
|
|
63
|
+
// Partial overlap — hand only the fresh suffix to the SDK so its
|
|
64
|
+
// own appliedIndex advancement still reflects the batch tail.
|
|
65
|
+
return base.applyUpdate(state, { ...wrapped, updates: fresh });
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
// The V1Builder generics evolve through each builder method (withSync
|
|
69
|
+
// narrows the configuration intersection, withTransacting adds more, etc).
|
|
70
|
+
// Annotating an exact return type is brittle and adds no value — callers
|
|
71
|
+
// pass the result directly to CustomShieldedWallet / CustomDustWallet,
|
|
72
|
+
// which already accept their own narrowed V1Builder type. Let TS infer.
|
|
73
|
+
/**
|
|
74
|
+
* Build a V1Builder for the shielded wallet whose syncCapability filters
|
|
75
|
+
* already-applied events before handing them to the SDK's
|
|
76
|
+
* makeEventsSyncCapability. Pass to CustomShieldedWallet(cfg, builder).
|
|
77
|
+
*/
|
|
78
|
+
// The inferred narrow V1Builder type references internal SDK paths that
|
|
79
|
+
// aren't part of the SDK's public type surface, which makes the `.d.ts`
|
|
80
|
+
// non-portable. Callers always feed the result straight into
|
|
81
|
+
// CustomShieldedWallet(cfg, builder) / CustomDustWallet(cfg, builder),
|
|
82
|
+
// both of which accept their own builder generic — so the actual type
|
|
83
|
+
// at the call site is recovered. We return `unknown` here as a
|
|
84
|
+
// deliberate escape hatch, and the callers cast.
|
|
85
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
86
|
+
export function dedupingShieldedBuilder() {
|
|
87
|
+
return new ShieldedV1Builder().withDefaults().withSync(
|
|
88
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
89
|
+
ShieldedSync.makeEventsSyncService,
|
|
90
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
|
+
((_config, _getContext) => {
|
|
92
|
+
const base = ShieldedSync.makeEventsSyncCapability();
|
|
93
|
+
return {
|
|
94
|
+
applyUpdate: makeDedupingApplyUpdate(
|
|
95
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
96
|
+
base,
|
|
97
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
+
(state, patch) => ShieldedCoreWallet.updateProgress(state, patch)),
|
|
99
|
+
};
|
|
100
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Build a V1Builder for the dust wallet whose syncCapability filters
|
|
105
|
+
* already-applied events before handing them to the SDK's
|
|
106
|
+
* makeDefaultSyncCapability. Pass to CustomDustWallet(cfg, builder).
|
|
107
|
+
*/
|
|
108
|
+
// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
|
|
109
|
+
export function dedupingDustBuilder() {
|
|
110
|
+
return new DustV1Builder().withDefaults().withSync(
|
|
111
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
112
|
+
DustSyncService.makeDefaultSyncService,
|
|
113
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
114
|
+
((_config, _getContext) => {
|
|
115
|
+
// makeDefaultSyncCapability ignores its args at runtime even though
|
|
116
|
+
// V1Builder invokes the factory with (config, getContext).
|
|
117
|
+
const base = DustSyncService.makeDefaultSyncCapability();
|
|
118
|
+
return {
|
|
119
|
+
applyUpdate: makeDedupingApplyUpdate(
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
|
+
base,
|
|
122
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
123
|
+
(state, patch) => DustCoreWallet.updateProgress(state, patch)),
|
|
124
|
+
};
|
|
125
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
// Exported for unit-testing the boundary-filter logic in isolation,
|
|
129
|
+
// without needing a live SDK wallet instance.
|
|
130
|
+
export const __TEST_ONLY__ = {
|
|
131
|
+
partitionByAppliedIndex,
|
|
132
|
+
makeDedupingApplyUpdate,
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=sdk-dedup.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk-dedup.js","sourceRoot":"","sources":["../../src/sync/sdk-dedup.ts"],"names":[],"mappings":"AAAA,8CAA8C;AAC9C,gFAAgF;AAChF,EAAE;AACF,oDAAoD;AACpD,EAAE;AACF,iCAAiC;AACjC,2EAA2E;AAC3E,+DAA+D;AAC/D,oCAAoC;AACpC,EAAE;AACF,wEAAwE;AACxE,oEAAoE;AACpE,yEAAyE;AACzE,uEAAuE;AACvE,EAAE;AACF,oEAAoE;AACpE,yDAAyD;AACzD,EAAE;AACF,wEAAwE;AACxE,mEAAmE;AACnE,qEAAqE;AACrE,oEAAoE;AACpE,wBAAwB;AACxB,EAAE;AACF,kEAAkE;AAClE,mBAAmB;AAEnB,OAAO,EACL,SAAS,IAAI,iBAAiB,EAC9B,IAAI,IAAI,YAAY,EACpB,UAAU,IAAI,kBAAkB,GACjC,MAAM,uCAAuC,CAAC;AAE/C,OAAO,EACL,SAAS,IAAI,aAAa,EAC1B,WAAW,IAAI,eAAe,EAC9B,UAAU,IAAI,cAAc,GAC7B,MAAM,mCAAmC,CAAC;AAmB3C;;;;GAIG;AACH,SAAS,uBAAuB,CAC9B,OAAyB,EACzB,YAAoB;IAEpB,MAAM,KAAK,GAAQ,EAAE,CAAC;IACtB,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,YAAY;YAAE,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACjD,CAAC;IACD,OAAO,EAAC,KAAK,EAAE,YAAY,EAAE,OAAO,CAAC,MAAM,GAAG,K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CAAC;AAED,oEAAoE;AACpE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,uBAAuB;IACvB,uBAAuB;CACxB,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface SyncStateStore {
|
|
2
|
+
get(key: string): Promise<string | null>;
|
|
3
|
+
put(key: string, value: string): Promise<void>;
|
|
4
|
+
delete(key: string): Promise<void>;
|
|
5
|
+
}
|
|
6
|
+
export type WalletPart = 'shielded' | 'unshielded' | 'dust' | 'history';
|
|
7
|
+
export declare function syncStateKey(networkId: string, walletName: string, part: WalletPart): string;
|
|
8
|
+
/** Reserved wallet name for the pre-seed reference wallet (see preseed.ts). */
|
|
9
|
+
export declare const EMPTY_REF_WALLET = "__empty_ref__";
|
|
10
|
+
/**
|
|
11
|
+
* Where the pre-seed reference wallet's state lives: its ordinary sync-cache
|
|
12
|
+
* location. It MUST match what `startWalletSync(…, EMPTY_REF_WALLET, …)`
|
|
13
|
+
* saves, because the pre-seed reads the reference state back from there.
|
|
14
|
+
*/
|
|
15
|
+
export declare function emptyRefStateKey(networkId: string, part: WalletPart): string;
|
|
16
|
+
/**
|
|
17
|
+
* Chain height the reference wallet was synced to, recorded at build time.
|
|
18
|
+
*
|
|
19
|
+
* The snapshots' own `offset` is an event index, not a block height, so it
|
|
20
|
+
* cannot be compared against a wallet's `birthday` (which is a height). This
|
|
21
|
+
* records the height separately, because pre-seeding a wallet from a reference
|
|
22
|
+
* NEWER than its birthday would skip that wallet's own history.
|
|
23
|
+
*/
|
|
24
|
+
export declare function emptyRefHeightKey(networkId: string): string;
|
|
25
|
+
export declare function emptyRefMnemonicKey(networkId: string): string;
|
|
26
|
+
/** Volatile store — used as the default outside Node when none is provided. */
|
|
27
|
+
export declare class InMemorySyncStateStore implements SyncStateStore {
|
|
28
|
+
private readonly entries;
|
|
29
|
+
get(key: string): Promise<string | null>;
|
|
30
|
+
put(key: string, value: string): Promise<void>;
|
|
31
|
+
delete(key: string):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CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGzC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Storage abstraction for serialized wallet sync state.
|
|
2
|
+
// Keys are relative paths (e.g. "sync/devnet/alice/shielded.dat") so the
|
|
3
|
+
// Node store can map them 1:1 onto the legacy ~/.moth file layout while
|
|
4
|
+
// browser stores treat them as opaque strings.
|
|
5
|
+
export function syncStateKey(networkId, walletName, part) {
|
|
6
|
+
return `sync/${networkId}/${walletName}/${part}.dat`;
|
|
7
|
+
}
|
|
8
|
+
/** Reserved wallet name for the pre-seed reference wallet (see preseed.ts). */
|
|
9
|
+
export const EMPTY_REF_WALLET = '__empty_ref__';
|
|
10
|
+
/**
|
|
11
|
+
* Where the pre-seed reference wallet's state lives: its ordinary sync-cache
|
|
12
|
+
* location. It MUST match what `startWalletSync(…, EMPTY_REF_WALLET, …)`
|
|
13
|
+
* saves, because the pre-seed reads the reference state back from there.
|
|
14
|
+
*/
|
|
15
|
+
export function emptyRefStateKey(networkId, part) {
|
|
16
|
+
return syncStateKey(networkId, EMPTY_REF_WALLET, part);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Chain height the reference wallet was synced to, recorded at build time.
|
|
20
|
+
*
|
|
21
|
+
* The snapshots' own `offset` is an event index, not a block height, so it
|
|
22
|
+
* cannot be compared against a wallet's `birthday` (which is a height). This
|
|
23
|
+
* records the height separately, because pre-seeding a wallet from a reference
|
|
24
|
+
* NEWER than its birthday would skip that wallet's own history.
|
|
25
|
+
*/
|
|
26
|
+
export function emptyRefHeightKey(networkId) {
|
|
27
|
+
return `empty-ref/${networkId}/height.txt`;
|
|
28
|
+
}
|
|
29
|
+
export function emptyRefMnemonicKey(networkId) {
|
|
30
|
+
return `empty-ref/${networkId}/mnemonic.txt`;
|
|
31
|
+
}
|
|
32
|
+
/** Volatile store — used as the default outside Node when none is provided. */
|
|
33
|
+
export class InMemorySyncStateStore {
|
|
34
|
+
entries = new Map();
|
|
35
|
+
async get(key) {
|
|
36
|
+
return this.entries.get(key) ?? null;
|
|
37
|
+
}
|
|
38
|
+
async put(key, value) {
|
|
39
|
+
this.entries.set(key, value);
|
|
40
|
+
}
|
|
41
|
+
async delete(key) {
|
|
42
|
+
this.entries.delete(key);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
//# sourceMappingURL=sync-store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sync-store.js","sourceRoot":"","sources":["../../src/sync/sync-store.ts"],"names":[],"mappings":"AAAA,wDAAwD;AACxD,yEAAyE;AACzE,wEAAwE;AACxE,+CAA+C;AAU/C,MAAM,UAAU,YAAY,CAAC,SAAiB,EAAE,UAAkB,EAAE,IAAgB;IAClF,OAAO,QAAQ,SAAS,IAAI,UAAU,IAAI,IAAI,MAAM,CAAC;AACvD,CAAC;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,gBAAgB,GAAG,eAAe,CAAC;AAEhD;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,IAAgB;IAClE,OAAO,YAAY,CAAC,SAAS,EAAE,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACzD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,OAAO,aAAa,SAAS,aAAa,CAAC;AAC7C,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACnD,OAAO,aAAa,SAAS,eAAe,CAAC;AAC/C,CAAC;AAED,+EAA+E;AAC/E,MAAM,OAAO,sBAAsB;IAChB,OAAO,GAAG,IAAI,GAAG,EAAkB,CAAC;IAErD,KAAK,CAAC,GAAG,CAAC,GAAW;QACnB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,GAAG,CAAC,GAAW,EAAE,KAAa;QAClC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,GAAW;QACtB,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF"}
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { WalletFacade } from '@midnightntwrk/wallet-sdk/facade';
|
|
2
|
+
import { type NetworkConfig } from '../types/network.js';
|
|
3
|
+
import { NIGHT_TOKEN_ID, formatNight } from '../types/tokens.js';
|
|
4
|
+
import { type SyncStateStore } from './sync-store.js';
|
|
5
|
+
import { type SubWallet } from './progress.js';
|
|
6
|
+
import type { WalletKeys } from './operations.js';
|
|
7
|
+
export { NIGHT_TOKEN_ID, formatNight };
|
|
8
|
+
export interface DustGeneration {
|
|
9
|
+
balance: bigint;
|
|
10
|
+
designated: bigint;
|
|
11
|
+
ratePerDay: bigint;
|
|
12
|
+
limit: bigint;
|
|
13
|
+
fillTime: Date;
|
|
14
|
+
numUtxos: number;
|
|
15
|
+
registered: boolean;
|
|
16
|
+
/** NIGHT (raw STAR) actually registered for generation — the sum of the
|
|
17
|
+
* registered UTXOs. Balance beyond this contributes no DUST capacity until
|
|
18
|
+
* it, too, is registered. */
|
|
19
|
+
registeredNight: bigint;
|
|
20
|
+
/** Creation time of the newest registered NIGHT UTXO, or null when none.
|
|
21
|
+
* Lets callers distinguish "generation records still settling" (recent)
|
|
22
|
+
* from a stale local dust view (old UTXOs with no records). */
|
|
23
|
+
newestRegisteredAt: Date | null;
|
|
24
|
+
}
|
|
25
|
+
export interface SyncProgress {
|
|
26
|
+
/** 0.0 to 1.0 */
|
|
27
|
+
percentage: number;
|
|
28
|
+
/** Estimated seconds remaining, or null if unknown */
|
|
29
|
+
etaSeconds: number | null;
|
|
30
|
+
/** Which sub-wallets are synced */
|
|
31
|
+
shieldedSynced: boolean;
|
|
32
|
+
unshieldedSynced: boolean;
|
|
33
|
+
dustSynced: boolean;
|
|
34
|
+
/** Which sub-wallet the percentage came from; null once synced. */
|
|
35
|
+
slowest: SubWallet | null;
|
|
36
|
+
}
|
|
37
|
+
/** Per-sub-wallet sync progress as raw applied/total indices (mirrors midnight-wallet-cli). */
|
|
38
|
+
export interface SubWalletSyncProgress {
|
|
39
|
+
applied: number;
|
|
40
|
+
total: number;
|
|
41
|
+
}
|
|
42
|
+
export interface ShieldedCoinInfo {
|
|
43
|
+
value: bigint;
|
|
44
|
+
type: string;
|
|
45
|
+
}
|
|
46
|
+
export interface UnshieldedCoinInfo {
|
|
47
|
+
value: bigint;
|
|
48
|
+
type: string;
|
|
49
|
+
registeredForDustGeneration: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface DustCoinInfo {
|
|
52
|
+
generatedNow: bigint;
|
|
53
|
+
maxCap: bigint;
|
|
54
|
+
maxCapReachedAt: Date;
|
|
55
|
+
/** Set when the underlying NIGHT UTXO has been deregistered. */
|
|
56
|
+
dtime: Date | null;
|
|
57
|
+
}
|
|
58
|
+
export interface WalletCoinDetails {
|
|
59
|
+
shielded: {
|
|
60
|
+
available: ShieldedCoinInfo[];
|
|
61
|
+
pending: ShieldedCoinInfo[];
|
|
62
|
+
};
|
|
63
|
+
unshielded: {
|
|
64
|
+
available: UnshieldedCoinInfo[];
|
|
65
|
+
pending: UnshieldedCoinInfo[];
|
|
66
|
+
};
|
|
67
|
+
dust: {
|
|
68
|
+
available: DustCoinInfo[];
|
|
69
|
+
pending: DustCoinInfo[];
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export interface SubWalletProgress {
|
|
73
|
+
shielded: SubWalletSyncProgress;
|
|
74
|
+
unshielded: SubWalletSyncProgress;
|
|
75
|
+
dust: SubWalletSyncProgress;
|
|
76
|
+
}
|
|
77
|
+
export interface WalletBalances {
|
|
78
|
+
shielded: Record<string, bigint>;
|
|
79
|
+
unshielded: Record<string, bigint>;
|
|
80
|
+
dust: bigint;
|
|
81
|
+
dustGeneration: DustGeneration | null;
|
|
82
|
+
syncProgress: SyncProgress;
|
|
83
|
+
synced: boolean;
|
|
84
|
+
/** Per-coin breakdown (matches midnight-wallet-cli's WalletStateView). */
|
|
85
|
+
coins: WalletCoinDetails;
|
|
86
|
+
/** Per-sub-wallet sync progress as raw applied/total. */
|
|
87
|
+
subProgress: SubWalletProgress;
|
|
88
|
+
}
|
|
89
|
+
export declare const EMPTY_COINS: WalletCoinDetails;
|
|
90
|
+
export declare const EMPTY_SUB_PROGRESS: SubWalletProgress;
|
|
91
|
+
export interface SyncedWallet {
|
|
92
|
+
facade: WalletFacade;
|
|
93
|
+
balances: WalletBalances;
|
|
94
|
+
stop: () => Promise<void>;
|
|
95
|
+
refresh: () => Promise<WalletBalances>;
|
|
96
|
+
/** Subscribe to progressive balance updates. Returns unsubscribe function. */
|
|
97
|
+
subscribe: (cb: (balances: WalletBalances) => void) => () => void;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Resolve the sync-state store: explicit option → Node filesystem store
|
|
101
|
+
* (legacy ~/.moth layout, loaded lazily so browser bundles never pull in
|
|
102
|
+
* node:fs) → volatile in-memory store.
|
|
103
|
+
*/
|
|
104
|
+
export declare function resolveSyncStore(explicit?: SyncStateStore): Promise<SyncStateStore>;
|
|
105
|
+
/** Tuning for how the SDK groups sync events into synchronous WASM applies. */
|
|
106
|
+
export interface BatchUpdatesOptions {
|
|
107
|
+
/** Max events applied per batch. Bigger = faster sync, longer main-thread blocks. */
|
|
108
|
+
size?: number;
|
|
109
|
+
/** Max ms to wait for a full batch before emitting a partial one. */
|
|
110
|
+
timeout?: number;
|
|
111
|
+
/** Min ms between consecutive batches — lets the event loop breathe. */
|
|
112
|
+
spacing?: number;
|
|
113
|
+
}
|
|
114
|
+
export interface WalletSyncOptions {
|
|
115
|
+
/** Where serialized sync state is cached. Defaults to the filesystem store in Node, in-memory elsewhere. */
|
|
116
|
+
syncStore?: SyncStateStore;
|
|
117
|
+
/**
|
|
118
|
+
* Event-batching overrides. Defaults favour throughput (size 500), which is
|
|
119
|
+
* right for Node CLIs; UI hosts that share a thread with rendering should
|
|
120
|
+
* pass smaller batches so each synchronous WASM apply stays short.
|
|
121
|
+
*/
|
|
122
|
+
batchUpdates?: BatchUpdatesOptions;
|
|
123
|
+
}
|
|
124
|
+
export declare function startWalletSync(keys: WalletKeys, network: NetworkConfig, onProgress?: (msg: string) => void, walletName?: string, isNewWallet?: boolean,
|
|
125
|
+
/** Chain tip index at wallet creation time. Skips scanning blocks before this index on first sync. */
|
|
126
|
+
birthday?: number, options?: WalletSyncOptions): Promise<SyncedWallet>;
|
|
127
|
+
/**
|
|
128
|
+
* Clear cached sync state for a wallet on a specific network.
|
|
129
|
+
* Useful after a devnet genesis reset or corrupted state.
|
|
130
|
+
*/
|
|
131
|
+
export declare function clearSyncCache(walletName: string, networkId: string, store?: SyncStateStore): Promise<void>;
|
|
132
|
+
/**
|
|
133
|
+
* Remove every artifact a wallet leaves behind so re-creating a wallet under
|
|
134
|
+
* the same name never silently inherits stale state from a previous seed:
|
|
135
|
+
* - the serialized sync state held in the SyncStateStore (the `.dat` entries;
|
|
136
|
+
* IndexedDB in the extension, the fs-backed store under the daemon/CLI/TUI),
|
|
137
|
+
* cleared via clearSyncCache so this works in the browser too; and
|
|
138
|
+
* - on node only, the per-wallet `~/.moth/sync/<network>/<name>/` directory
|
|
139
|
+
* and the matching daemon `.sock` file, which live outside the store.
|
|
140
|
+
*
|
|
141
|
+
* Best-effort: missing artifacts are ignored. The node-only fs work is behind a
|
|
142
|
+
* dynamic import so this module keeps its "no static node:* imports" invariant
|
|
143
|
+
* (see the file header) and stays browser-bundleable.
|
|
144
|
+
*/
|
|
145
|
+
export declare function removeWalletSyncArtifacts(walletName: string, networkId: string, store?: SyncStateStore): Promise<void>;
|
|
146
|
+
/**
|
|
147
|
+
* Clear ONLY the dust sub-wallet's cached state, keeping the (much larger)
|
|
148
|
+
* shielded/unshielded caches. The next sync start rebuilds the dust view from
|
|
149
|
+
* the chain — the targeted repair for a dust view that stopped ingesting
|
|
150
|
+
* generation records for newer NIGHT UTXOs.
|
|
151
|
+
*/
|
|
152
|
+
export declare function clearDustSyncCache(walletName: string, networkId: string, store?: SyncStateStore): Promise<void>;
|
|
153
|
+
//# sourceMappingURL=wallet-sync.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wallet-sync.d.ts","sourceRoot":"","sources":["../../src/sync/wallet-sync.ts"],"names":[],"mappings":"AAQA,OAAO,EAAuB,YAAY,EAAmB,MAAM,kCAAkC,CAAC;AActG,OAAO,EAAsB,KAAK,aAAa,EAAC,MAAM,qBAAqB,CAAC;AAE5E,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAG/D,OAAO,EAAuC,KAAK,cAAc,EAAkB,MAAM,iBAAiB,CAAC;AAE3G,OAAO,EAAsB,KAAK,SAAS,EAAC,MAAM,eAAe,CAAC;AAElE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,iBAAiB,CAAC;AAIhD,OAAO,EAAC,cAAc,EAAE,WAAW,EAAC,CAAC;AAgKrC,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,IAAI,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB;;kCAE8B;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB;;oEAEgE;IAChE,kBAAkB,EAAE,IAAI,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,YAAY;IAC3B,iBAAiB;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,sDAAsD;IACtD,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,mCAAmC;IACnC,cAAc,EAAE,OAAO,CAAC;IACxB,gBAAg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