@dynamic-labs-wallet/node-midnight 1.1.4 → 1.1.6

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/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "@dynamic-labs-wallet/node-midnight",
3
- "version": "1.1.4",
3
+ "version": "1.1.6",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "dependencies": {
7
- "@dynamic-labs-wallet/node": "1.1.4",
7
+ "@dynamic-labs-wallet/node": "1.1.6",
8
8
  "@midnight-ntwrk/ledger-v8": "^8.1.0",
9
+ "@midnight-ntwrk/wallet-sdk-abstractions": "2.1.0",
9
10
  "@midnight-ntwrk/wallet-sdk-address-format": "3.1.2",
11
+ "@midnight-ntwrk/wallet-sdk-dust-wallet": "4.0.0",
12
+ "@midnight-ntwrk/wallet-sdk-facade": "4.0.0",
13
+ "@midnight-ntwrk/wallet-sdk-shielded": "3.0.2",
14
+ "@midnight-ntwrk/wallet-sdk-unshielded-wallet": "3.0.0",
10
15
  "@scure/bip32": "^2.0.1",
11
16
  "bech32": "^2.0.0"
12
17
  },
@@ -1,10 +1,12 @@
1
1
  import { DynamicWalletClient, type DynamicWalletClientProps, type BIP340KeygenResult, type ServerKeyShare, type ThresholdSignatureScheme, type WalletMetadata } from '@dynamic-labs-wallet/node';
2
+ import type { SignMessageContext } from '@dynamic-labs/sdk-api-core';
3
+ import { type MidnightWalletState, type WalletSyncMode } from './walletState.js';
2
4
  import { type MidnightNetwork } from '../utils/address/index.js';
3
5
  export type DynamicMidnightWalletClientProps = DynamicWalletClientProps & {
4
6
  /** Network whose bech32m HRP addresses are encoded with. Defaults to 'preview'. */
5
7
  network?: MidnightNetwork;
6
8
  };
7
- /** Credentials every key-material operation needs. */
9
+ /** Credentials every facade-backed operation needs to reach the MPC key material. */
8
10
  export type MidnightWalletAccess = {
9
11
  walletMetadata: WalletMetadata;
10
12
  password?: string;
@@ -12,6 +14,12 @@ export type MidnightWalletAccess = {
12
14
  elevatedAccessToken?: string;
13
15
  /** 0/'preview' (default) or 1/'mainnet'. */
14
16
  networkId?: number | string;
17
+ /**
18
+ * Optional sync checkpoint from a previous call. Omit it and the wallet syncs
19
+ * from genesis; pass the last one back to resume from it. The SDK stores
20
+ * nothing itself — see {@link MidnightWalletState}.
21
+ */
22
+ walletState?: MidnightWalletState;
15
23
  };
16
24
  /**
17
25
  * Midnight's three key roles, each derived from the same MPC master xprv.
@@ -25,6 +33,14 @@ export type MidnightRoleKeys = {
25
33
  /** Role 2 (Dust) — gas/fee management, signed client-side. */
26
34
  dust: string;
27
35
  };
36
+ /** What a facade-backed operation is handed once the wallet is booted and synced. */
37
+ type WalletUse<T> = (context: {
38
+ wallet: any;
39
+ roleKeys: MidnightRoleKeys;
40
+ state: any;
41
+ shieldedSecretKeys: any;
42
+ dustSecretKey: any;
43
+ }) => Promise<T>;
28
44
  export declare class DynamicMidnightWalletClient extends DynamicWalletClient {
29
45
  readonly chainName = "MIDNIGHT";
30
46
  private readonly network;
@@ -176,6 +192,175 @@ export declare class DynamicMidnightWalletClient extends DynamicWalletClient {
176
192
  shielded: string;
177
193
  dust?: string;
178
194
  }>;
195
+ /**
196
+ * Boots a synced wallet, runs `use` against it, and stops it afterwards.
197
+ *
198
+ * Nothing is retained between calls: the wallet is created here and torn down
199
+ * in `finally`, so the client holds no state of its own. Callers who want to
200
+ * avoid the ~150s genesis sync pass back the checkpoint from a previous call
201
+ * (`access.walletState`) and receive an updated one alongside every result.
202
+ */
203
+ protected withWallet<T>(label: string, access: MidnightWalletAccess, mode: WalletSyncMode, use: WalletUse<T>): Promise<{
204
+ result: T;
205
+ walletState?: MidnightWalletState;
206
+ sessionState?: MidnightWalletState;
207
+ }>;
208
+ /**
209
+ * Serializes the wallet's shielded and dust state, or returns undefined when
210
+ * the wallet has work in flight.
211
+ *
212
+ * Checkpointing a dirty wallet would carry pending entries forward into every
213
+ * later restore, so the caller keeps its previous checkpoint instead — sync
214
+ * reconciles against the chain either way.
215
+ */
216
+ private checkpoint;
217
+ /**
218
+ * Submits, retrying once past a stale-connection failure.
219
+ *
220
+ * The facade's node client calls `api.disconnect()` during startup, and that
221
+ * promise resolves before the socket has actually closed. A submit issued in
222
+ * that window sees `isConnected === true`, skips reconnecting, and is then
223
+ * rejected by the close that lands a moment later. The retry reconnects for
224
+ * real, because by then the socket reports closed. Resubmitting is safe: the
225
+ * bytes never reached the node, and an identical transaction has an identical
226
+ * hash, so a duplicate would be rejected rather than spent twice.
227
+ */
228
+ private submitWithReconnect;
229
+ /** First emission from the wallet's state observable. */
230
+ private readState;
231
+ private bootWallet;
232
+ /**
233
+ * Resolves once the requested sides report synced.
234
+ *
235
+ * Does not stop the wallet on failure — `withWallet` owns the wallet's
236
+ * lifetime and tears it down in `finally`, whether this resolves or throws.
237
+ */
238
+ private waitForSync;
239
+ /**
240
+ * Reads unshielded, shielded, and dust balances.
241
+ *
242
+ * Resolves as soon as shielded + unshielded are synced, leaving dust folding in
243
+ * the background — `dustSynced` says whether the dust figure is final yet.
244
+ */
245
+ getBalances(access: MidnightWalletAccess): Promise<{
246
+ unshielded: Record<string, string>;
247
+ shielded: Record<string, string>;
248
+ dust: {
249
+ balance: string;
250
+ cap: string;
251
+ };
252
+ dustSynced: boolean;
253
+ address: string;
254
+ walletState?: MidnightWalletState;
255
+ }>;
256
+ /**
257
+ * Registers the wallet's NIGHT UTXOs for dust generation. Dust pays fees on
258
+ * every Midnight transaction, so this is a prerequisite for transacting.
259
+ *
260
+ * Returns immediately after broadcast — dust accrues continuously on-chain and
261
+ * can take minutes, so poll {@link getBalances} rather than blocking here.
262
+ */
263
+ registerDust(access: MidnightWalletAccess): Promise<{
264
+ status: 'registered' | 'already_registered' | 'already_has_dust' | 'no_utxos';
265
+ message: string;
266
+ registeredCount: number;
267
+ dustBalance: string;
268
+ txId?: string;
269
+ walletState?: MidnightWalletState;
270
+ }>;
271
+ /**
272
+ * Builds an unsigned transfer. No MPC, no proving, no broadcast — pair with
273
+ * {@link signTransaction} then {@link submitTransaction}.
274
+ */
275
+ createTransferTransaction(access: MidnightWalletAccess & {
276
+ transfers: Array<{
277
+ type: 'unshielded' | 'shielded';
278
+ recipientAddress: string;
279
+ amount: string;
280
+ tokenType?: string;
281
+ }>;
282
+ /** Defaults to 5 minutes. */
283
+ ttlMinutes?: number;
284
+ }): Promise<{
285
+ serializedTransaction: string;
286
+ walletState?: MidnightWalletState;
287
+ }>;
288
+ /**
289
+ * Broadcasts a finalized transaction. Pure RPC — reuses the cached wallet's
290
+ * node connection; no MPC and no proving.
291
+ *
292
+ * Returns both identifiers, because they are not interchangeable:
293
+ * - `txHash` is the canonical ledger hash, and what the block explorer indexes.
294
+ * - `txIdentifier` is the submission handle; midnight-js polls
295
+ * `transactions(offset: { identifier })` to observe inclusion, so a caller
296
+ * handed only the hash would wait forever on a transaction that succeeded.
297
+ */
298
+ submitTransaction(access: MidnightWalletAccess & {
299
+ transaction: string;
300
+ }): Promise<{
301
+ txHash: string;
302
+ txIdentifier: string;
303
+ walletState?: MidnightWalletState;
304
+ }>;
305
+ /**
306
+ * MPC-signs every unshielded intent segment, then finalizes (ZK-proves) the
307
+ * transaction through the proof server.
308
+ *
309
+ * Side effect: finalizeRecipe mutates wallet state by adding a pending-tx
310
+ * entry. If the caller never submits, that entry lingers until the next
311
+ * re-sync reconciles against the chain.
312
+ */
313
+ signTransaction(access: MidnightWalletAccess & {
314
+ /** Base64 unsigned UnprovenTransaction, from createTransferTransaction. */
315
+ transaction: string;
316
+ context?: SignMessageContext;
317
+ }): Promise<{
318
+ transaction: string;
319
+ walletState?: MidnightWalletState;
320
+ }>;
321
+ /**
322
+ * Returns a Midnight.js-compatible wallet provider for use with
323
+ * midnight-js-contracts (deployment and contract calls). Signing goes through
324
+ * MPC; no private key is handed to the caller.
325
+ *
326
+ * `balanceTx` and `submitTx` boot a wallet per call rather than closing over
327
+ * one, so nothing is held open between the caller's contract operations. To
328
+ * keep that from re-syncing from genesis every time, the provider carries the
329
+ * checkpoint from one call into the next. That state lives in this closure
330
+ * and dies with the provider — read it with `getWalletState()` to persist it
331
+ * beyond that.
332
+ */
333
+ getWalletProvider(access: MidnightWalletAccess): Promise<{
334
+ getCoinPublicKey: () => string;
335
+ getEncryptionPublicKey: () => string;
336
+ balanceTx: (tx: unknown, ttl?: Date) => Promise<unknown>;
337
+ submitTx: (tx: unknown) => Promise<string>;
338
+ /** Latest checkpoint this provider has produced, for the caller to store. */
339
+ getWalletState: () => MidnightWalletState | undefined;
340
+ }>;
341
+ /**
342
+ * Balances a serialized midnight-js UnboundTransaction and returns the
343
+ * finalized transaction, base64-encoded. A transport-friendly wrapper over
344
+ * {@link getWalletProvider}'s `balanceTx` for callers that pass transactions
345
+ * across a process boundary rather than holding ledger objects.
346
+ */
347
+ balanceContractTransaction(access: MidnightWalletAccess & {
348
+ transaction: string;
349
+ ttl?: string;
350
+ }): Promise<{
351
+ transaction: string;
352
+ walletState?: MidnightWalletState;
353
+ }>;
354
+ /**
355
+ * Signs each intent segment via MPC and writes the signatures back onto the
356
+ * transaction.
357
+ *
358
+ * Strictly serial. `tx.intents` is an immutable persistent map — `.set()`
359
+ * returns a new map — so a Promise.all would have every iteration read the
360
+ * same initial map and race to write back, silently dropping all but the last
361
+ * segment's signature. Relay ceremonies serialize anyway, so little is lost.
362
+ */
363
+ private mpcSignIntents;
179
364
  /**
180
365
  * Gets all Midnight wallets
181
366
  * @returns Array of Midnight wallets
@@ -190,4 +375,5 @@ export declare class DynamicMidnightWalletClient extends DynamicWalletClient {
190
375
  thresholdSignatureScheme: ThresholdSignatureScheme;
191
376
  }[]>;
192
377
  }
378
+ export {};
193
379
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,KAAK,wBAAwB,EAC7B,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACn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;QACpB,OAAO,CAAC,EAAE,kBAAkB,CAAC;KAC9B,GACA,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC;IA2CtE;;;;;;;;;;;OAWG;IACG,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,OAAO,CAAC;QAC7D,gBAAgB,EAAE,MAAM,MAAM,CAAC;QAC/B,sBAAsB,EAAE,MAAM,MAAM,CAAC;QACrC,SAAS,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,GAAG,CAAC,EAAE,IAAI,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;QACzD,QAAQ,EAAE,CAAC,EAAE,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;QAC3C,6EAA6E;QAC7E,cAAc,EAAE,MAAM,mBAAmB,GAAG,SAAS,CAAC;KACvD,CAAC;IAiFF;;;;;OAKG;IACG,0BAA0B,CAC9B,MAAM,EAAE,oBAAoB,GAAG;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE,GACnE,OAAO,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,WAAW,CAAC,EAAE,mBAAmB,CAAA;KAAE,CAAC;IA+BtE;;;;;;;;OAQG;YACW,cAAc;IAgE5B;;;OAGG;IACG,kBAAkB;;;;;;;;;CAIzB"}
@@ -11,15 +11,50 @@ export declare const MIDNIGHT_NETWORK_IDS: {
11
11
  readonly undeployed: 0;
12
12
  };
13
13
  export type MidnightNetworkName = keyof typeof MIDNIGHT_NETWORK_IDS;
14
+ export type MidnightWalletInfraConfig = {
15
+ relayUrl: string;
16
+ provingServerUrl: string;
17
+ indexerHttpUrl: string;
18
+ indexerWsUrl: string;
19
+ };
20
+ /**
21
+ * Per-network wallet-facade infrastructure. There is no public mainnet proof
22
+ * server, so Dynamic's is shared across networks for now.
23
+ */
24
+ export declare const MIDNIGHT_INFRA: Record<MidnightNetworkTag, MidnightWalletInfraConfig>;
14
25
  /**
15
26
  * Resolves a caller-supplied network identifier (numeric 0/1, network name, or
16
- * `midnight:<network>` chainId) to the facade network tag. Defaults to 'preview'.
27
+ * `midnight:<network>` chainId) to the facade network tag. Omitting it defaults
28
+ * to 'preview'.
29
+ *
30
+ * Throws on anything else rather than falling back, for the same reason
31
+ * {@link getNetworkIdFromChainId} does: an unrecognized identifier that quietly
32
+ * became 'preview' would have the caller sync one network while signing with
33
+ * another network's replay-protection ID, with no error to show for it.
17
34
  */
18
35
  export declare const resolveMidnightNetworkTag: (networkId?: number | string) => MidnightNetworkTag;
36
+ /**
37
+ * Resolves a network name (or `midnight:<network>` chainId) to its numeric
38
+ * network ID.
39
+ *
40
+ * Throws on unrecognized input rather than defaulting — silently falling back to
41
+ * mainnet would bake the wrong network ID into the transaction hash and break
42
+ * replay protection.
43
+ */
44
+ export declare const getNetworkIdFromChainId: (networkOrChainId: string) => number;
19
45
  export declare const ERROR_KEYGEN_FAILED = "Error with keygen";
20
46
  export declare const ERROR_CREATE_WALLET_ACCOUNT = "Error creating midnight wallet account";
21
47
  export declare const ERROR_IMPORT_PRIVATE_KEY = "Error importing private key";
22
48
  export declare const ERROR_EXPORT_PRIVATE_KEY = "Error exporting private key";
23
49
  export declare const ERROR_SIGN_MESSAGE = "Error signing message";
24
50
  export declare const ERROR_ACCOUNT_ADDRESS_REQUIRED = "Account address is required";
51
+ export declare const ERROR_SIGN_TRANSACTION = "Error signing transaction";
52
+ export declare const ERROR_UNKNOWN_NETWORK = "Unknown Midnight network";
53
+ export declare const ERROR_NETWORK_ID_REQUIRED = "Network ID is required for Midnight transactions";
54
+ export declare const ERROR_NO_DUST = "No dust balance \u2014 register dust first";
55
+ export declare const ERROR_SUBMIT_TRANSACTION = "Error submitting transaction";
56
+ export declare const ERROR_CREATE_TRANSFER = "Error creating transfer transaction";
57
+ export declare const ERROR_GET_BALANCE = "Error fetching balance";
58
+ export declare const ERROR_REGISTER_DUST = "Error registering dust";
59
+ export declare const ERROR_BALANCE_TRANSACTION = "Error balancing contract transaction";
25
60
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,CAAC;AAIvD,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAEpE;;;GAGG;AACH,eAAO,MAAM,yBAAyB,eAAgB,MAAM,GAAG,MAAM,KAAG,kBAKvE,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC"}
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/client/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,GAAG,SAAS,GAAG,SAAS,CAAC;AAIvD,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,MAAM,OAAO,oBAAoB,CAAC;AAEpE,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAKF;;;GAGG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,kBAAkB,EAAE,yBAAyB,CAahF,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,yBAAyB,eAAgB,MAAM,GAAG,MAAM,KAAG,kBAYvE,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,qBAAsB,MAAM,KAAG,MAgBlE,CAAC;AAEF,eAAO,MAAM,mBAAmB,sBAAsB,CAAC;AAEvD,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AAEpF,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,wBAAwB,gCAAgC,CAAC;AAEtE,eAAO,MAAM,kBAAkB,0BAA0B,CAAC;AAE1D,eAAO,MAAM,8BAA8B,gCAAgC,CAAC;AAE5E,eAAO,MAAM,sBAAsB,8BAA8B,CAAC;AAElE,eAAO,MAAM,qBAAqB,6BAA6B,CAAC;AAEhE,eAAO,MAAM,yBAAyB,qDAAqD,CAAC;AAE5F,eAAO,MAAM,aAAa,+CAA0C,CAAC;AAErE,eAAO,MAAM,wBAAwB,iCAAiC,CAAC;AAEvE,eAAO,MAAM,qBAAqB,wCAAwC,CAAC;AAE3E,eAAO,MAAM,iBAAiB,2BAA2B,CAAC;AAE1D,eAAO,MAAM,mBAAmB,2BAA2B,CAAC;AAE5D,eAAO,MAAM,yBAAyB,yCAAyC,CAAC"}
@@ -1,3 +1,4 @@
1
1
  export { DynamicMidnightWalletClient, type DynamicMidnightWalletClientProps, type MidnightRoleKeys, type MidnightWalletAccess, } from './client.js';
2
- export { ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, MIDNIGHT_NETWORK_IDS, resolveMidnightNetworkTag, type MidnightNetworkName, type MidnightNetworkTag, } from './constants.js';
2
+ export { type MidnightWalletState, type WalletSyncMode } from './walletState.js';
3
+ export { ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_BALANCE_TRANSACTION, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, MIDNIGHT_NETWORK_IDS, resolveMidnightNetworkTag, type MidnightNetworkName, type MidnightNetworkTag, } from './constants.js';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,KAAK,gCAAgC,EACrC,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACjF,OAAO,EACL,8BAA8B,EAC9B,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,GACxB,MAAM,gBAAgB,CAAC"}
@@ -0,0 +1,54 @@
1
+ import type { MidnightNetworkTag } from './constants.js';
2
+ /**
3
+ * Sync wait mode:
4
+ * - `full`: wait for all three sub-wallets (incl. dust) — required by anything
5
+ * that builds, signs, or submits a transaction.
6
+ * - `shielded-unshielded`: resolve once shielded + unshielded are synced and let
7
+ * dust finish in the background. Used by balance reads so the public/shielded
8
+ * balance is available without waiting on the (much slower) dust fold.
9
+ */
10
+ export type WalletSyncMode = 'full' | 'shielded-unshielded';
11
+ /**
12
+ * A sync checkpoint the caller may persist and hand back on the next call.
13
+ *
14
+ * Entirely optional: without one the wallet syncs from genesis (~150s measured
15
+ * on preview). Passing the last one back resumes from it instead. The SDK keeps
16
+ * no copy — storage, lifetime and invalidation are the caller's.
17
+ *
18
+ * Contains no key material: secret keys are supplied separately to `start()`.
19
+ * It does describe the wallet's shielded coins, so treat it as private data
20
+ * about the wallet rather than as a public blob.
21
+ *
22
+ * Only shielded and dust are captured. Unshielded syncs in ~1.5s, so persisting
23
+ * it would cost bytes for no meaningful saving.
24
+ */
25
+ export type MidnightWalletState = {
26
+ shielded: string;
27
+ dust: string;
28
+ /** Network the checkpoint was taken on. Restoring it into another network's
29
+ * facade corrupts sync, so it is rejected rather than silently used. */
30
+ network: MidnightNetworkTag;
31
+ savedAt: number;
32
+ };
33
+ /** Whether a sub-wallet side has finished syncing. `highestRelevantIndex` is 0
34
+ * during sync, so `isStrictlyComplete()` is the authoritative signal. */
35
+ export declare const isSideSynced: (side: any) => boolean;
36
+ export declare const isSyncResolved: (state: any, mode: WalletSyncMode) => boolean;
37
+ /**
38
+ * Whether a checkpoint may be restored into a facade for `network`.
39
+ *
40
+ * A checkpoint is only meaningful for the network it was taken on — sync
41
+ * indices do not carry across — so a mismatch is treated as no checkpoint at
42
+ * all rather than as an error, since the caller may legitimately hold state for
43
+ * several networks.
44
+ */
45
+ export declare const isRestorableState: (state: MidnightWalletState | undefined, network: MidnightNetworkTag) => state is MidnightWalletState;
46
+ /**
47
+ * Whether the wallet is at a clean resting point, with nothing in flight.
48
+ *
49
+ * Checkpointing mid-flight would bake pending entries into whatever the caller
50
+ * stores and carry them forward on every later restore, so a dirty wallet is
51
+ * skipped and the caller simply keeps its previous checkpoint.
52
+ */
53
+ export declare const isCleanForCheckpoint: (state: any) => boolean;
54
+ //# sourceMappingURL=walletState.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"walletState.d.ts","sourceRoot":"","sources":["../../src/client/walletState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,qBAAqB,CAAC;AAE5D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb;6EACyE;IACzE,OAAO,EAAE,kBAAkB,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;0EAC0E;AAC1E,eAAO,MAAM,YAAY,SAAU,GAAG,KAAG,OAOxC,CAAC;AAEF,eAAO,MAAM,cAAc,UAAW,GAAG,QAAQ,cAAc,KAAG,OAC0C,CAAC;AAE7G;;;;;;;GAOG;AACH,eAAO,MAAM,iBAAiB,UACrB,mBAAmB,GAAG,SAAS,WAC7B,kBAAkB,KAC1B,KAAK,IAAI,mBAIe,CAAC;AAE5B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,UAAW,GAAG,KAAG,OAIF,CAAC"}
package/src/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { DynamicMidnightWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, MIDNIGHT_NETWORK_IDS, resolveMidnightNetworkTag, type DynamicMidnightWalletClientProps, type MidnightNetworkName, type MidnightNetworkTag, type MidnightRoleKeys, type MidnightWalletAccess, } from './client/index.js';
1
+ export { DynamicMidnightWalletClient, ERROR_ACCOUNT_ADDRESS_REQUIRED, ERROR_BALANCE_TRANSACTION, ERROR_CREATE_WALLET_ACCOUNT, ERROR_EXPORT_PRIVATE_KEY, ERROR_IMPORT_PRIVATE_KEY, ERROR_KEYGEN_FAILED, ERROR_SIGN_MESSAGE, MIDNIGHT_NETWORK_IDS, resolveMidnightNetworkTag, type DynamicMidnightWalletClientProps, type MidnightNetworkName, type MidnightNetworkTag, type MidnightRoleKeys, type MidnightWalletAccess, type MidnightWalletState, type WalletSyncMode, } from './client/index.js';
2
2
  export { decodeMidnightAddress, deriveMidnightAddress, getNetworkFromAddress, isValidMidnightAddress, toXOnlyPublicKeyHex, type MidnightNetwork, } from './utils/index.js';
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,GAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../packages/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,2BAA2B,EAC3B,8BAA8B,EAC9B,yBAAyB,EACzB,2BAA2B,EAC3B,wBAAwB,EACxB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,oBAAoB,EACpB,yBAAyB,EACzB,KAAK,gCAAgC,EACrC,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACxB,KAAK,cAAc,GACpB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,qBAAqB,EACrB,qBAAqB,EACrB,qBAAqB,EACrB,sBAAsB,EACtB,mBAAmB,EACnB,KAAK,eAAe,GACrB,MAAM,kBAAkB,CAAC"}