@midnight-ntwrk/wallet-sdk-facade 1.0.0-beta.16 → 1.0.0-beta.17

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/index.d.ts CHANGED
@@ -4,6 +4,16 @@ import { type UnshieldedWallet, UnshieldedWalletState } from '@midnight-ntwrk/wa
4
4
  import { AnyTransaction, DustWallet, DustWalletState, CoinsAndBalances as DustCoinsAndBalances } from '@midnight-ntwrk/wallet-sdk-dust-wallet';
5
5
  import * as ledger from '@midnight-ntwrk/ledger-v7';
6
6
  export type UnboundTransaction = ledger.Transaction<ledger.SignatureEnabled, ledger.Proof, ledger.PreBinding>;
7
+ type TokenKind = 'dust' | 'shielded' | 'unshielded';
8
+ type TokenKindsToBalance = 'all' | TokenKind[];
9
+ declare const TokenKindsToBalance: {
10
+ allTokenKinds: string[];
11
+ toFlags: (tokenKinds: TokenKindsToBalance) => {
12
+ shouldBalanceUnshielded: boolean;
13
+ shouldBalanceShielded: boolean;
14
+ shouldBalanceDust: boolean;
15
+ };
16
+ };
7
17
  export type FinalizedTransactionRecipe = {
8
18
  type: 'FINALIZED_TRANSACTION';
9
19
  originalTransaction: ledger.FinalizedTransaction;
@@ -12,7 +22,7 @@ export type FinalizedTransactionRecipe = {
12
22
  export type UnboundTransactionRecipe = {
13
23
  type: 'UNBOUND_TRANSACTION';
14
24
  baseTransaction: UnboundTransaction;
15
- balancingTransaction: ledger.UnprovenTransaction;
25
+ balancingTransaction?: ledger.UnprovenTransaction | undefined;
16
26
  };
17
27
  export type UnprovenTransactionRecipe = {
18
28
  type: 'UNPROVEN_TRANSACTION';
@@ -58,22 +68,54 @@ export declare class WalletFacade {
58
68
  state(): Observable<FacadeState>;
59
69
  waitForSyncedState(): Promise<FacadeState>;
60
70
  submitTransaction(tx: ledger.FinalizedTransaction): Promise<TransactionIdentifier>;
61
- balanceFinalizedTransaction(zswapSecretKeys: ledger.ZswapSecretKeys, dustSecretKeys: ledger.DustSecretKey, tx: ledger.FinalizedTransaction, ttl: Date): Promise<FinalizedTransactionRecipe>;
62
- balanceUnboundTransaction(zswapSecretKeys: ledger.ZswapSecretKeys, dustSecretKeys: ledger.DustSecretKey, tx: UnboundTransaction, ttl: Date): Promise<UnboundTransactionRecipe>;
63
- balanceUnprovenTransaction(zswapSecretKeys: ledger.ZswapSecretKeys, dustSecretKeys: ledger.DustSecretKey, tx: ledger.UnprovenTransaction, ttl: Date): Promise<UnprovenTransactionRecipe>;
71
+ balanceFinalizedTransaction(tx: ledger.FinalizedTransaction, secretKeys: {
72
+ shieldedSecretKeys: ledger.ZswapSecretKeys;
73
+ dustSecretKey: ledger.DustSecretKey;
74
+ }, options: {
75
+ ttl: Date;
76
+ tokenKindsToBalance?: TokenKindsToBalance;
77
+ }): Promise<FinalizedTransactionRecipe>;
78
+ balanceUnboundTransaction(tx: UnboundTransaction, secretKeys: {
79
+ shieldedSecretKeys: ledger.ZswapSecretKeys;
80
+ dustSecretKey: ledger.DustSecretKey;
81
+ }, options: {
82
+ ttl: Date;
83
+ tokenKindsToBalance?: TokenKindsToBalance;
84
+ }): Promise<UnboundTransactionRecipe>;
85
+ balanceUnprovenTransaction(tx: ledger.UnprovenTransaction, secretKeys: {
86
+ shieldedSecretKeys: ledger.ZswapSecretKeys;
87
+ dustSecretKey: ledger.DustSecretKey;
88
+ }, options: {
89
+ ttl: Date;
90
+ tokenKindsToBalance?: TokenKindsToBalance;
91
+ }): Promise<UnprovenTransactionRecipe>;
64
92
  finalizeRecipe(recipe: BalancingRecipe): Promise<ledger.FinalizedTransaction>;
65
93
  signRecipe(recipe: BalancingRecipe, signSegment: (data: Uint8Array) => ledger.Signature): Promise<BalancingRecipe>;
66
- signTransaction(tx: ledger.UnprovenTransaction, signSegment: (data: Uint8Array) => ledger.Signature): Promise<ledger.UnprovenTransaction>;
94
+ signUnprovenTransaction(tx: ledger.UnprovenTransaction, signSegment: (data: Uint8Array) => ledger.Signature): Promise<ledger.UnprovenTransaction>;
95
+ signUnboundTransaction(tx: UnboundTransaction, signSegment: (data: Uint8Array) => ledger.Signature): Promise<UnboundTransaction>;
67
96
  finalizeTransaction(tx: ledger.UnprovenTransaction): Promise<ledger.FinalizedTransaction>;
68
97
  calculateTransactionFee(tx: AnyTransaction): Promise<bigint>;
69
- transferTransaction(zswapSecretKeys: ledger.ZswapSecretKeys, dustSecretKey: ledger.DustSecretKey, outputs: CombinedTokenTransfer[], ttl: Date): Promise<UnprovenTransactionRecipe>;
98
+ transferTransaction(outputs: CombinedTokenTransfer[], secretKeys: {
99
+ shieldedSecretKeys: ledger.ZswapSecretKeys;
100
+ dustSecretKey: ledger.DustSecretKey;
101
+ }, options: {
102
+ ttl: Date;
103
+ payFees?: boolean;
104
+ }): Promise<UnprovenTransactionRecipe>;
70
105
  estimateRegistration(nightUtxos: readonly UtxoWithMeta[]): Promise<{
71
106
  fee: bigint;
72
107
  dustGenerationEstimations: ReadonlyArray<DustCoinsAndBalances.UtxoWithFullDustDetails>;
73
108
  }>;
74
- initSwap(zswapSecretKeys: ledger.ZswapSecretKeys, desiredInputs: CombinedSwapInputs, desiredOutputs: CombinedSwapOutputs[], ttl: Date): Promise<UnprovenTransactionRecipe>;
109
+ initSwap(desiredInputs: CombinedSwapInputs, desiredOutputs: CombinedSwapOutputs[], secretKeys: {
110
+ shieldedSecretKeys: ledger.ZswapSecretKeys;
111
+ dustSecretKey: ledger.DustSecretKey;
112
+ }, options: {
113
+ ttl: Date;
114
+ payFees?: boolean;
115
+ }): Promise<UnprovenTransactionRecipe>;
75
116
  registerNightUtxosForDustGeneration(nightUtxos: readonly UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: (payload: Uint8Array) => ledger.Signature, dustReceiverAddress?: string): Promise<UnprovenTransactionRecipe>;
76
117
  deregisterFromDustGeneration(nightUtxos: UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: (payload: Uint8Array) => ledger.Signature): Promise<UnprovenTransactionRecipe>;
77
- start(zswapSecretKeys: ledger.ZswapSecretKeys, dustSecretKey: ledger.DustSecretKey): Promise<void>;
118
+ start(shieldedSecretKeys: ledger.ZswapSecretKeys, dustSecretKey: ledger.DustSecretKey): Promise<void>;
78
119
  stop(): Promise<void>;
79
120
  }
121
+ export {};
package/dist/index.js CHANGED
@@ -13,6 +13,16 @@
13
13
  import { combineLatest, map } from 'rxjs';
14
14
  import { Array as Arr, pipe } from 'effect';
15
15
  import * as ledger from '@midnight-ntwrk/ledger-v7';
16
+ const TokenKindsToBalance = new (class {
17
+ allTokenKinds = ['shielded', 'unshielded', 'dust'];
18
+ toFlags = (tokenKinds) => {
19
+ return pipe(tokenKinds, (kinds) => (kinds === 'all' ? this.allTokenKinds : kinds), (kinds) => ({
20
+ shouldBalanceUnshielded: kinds.includes('unshielded'),
21
+ shouldBalanceShielded: kinds.includes('shielded'),
22
+ shouldBalanceDust: kinds.includes('dust'),
23
+ }));
24
+ };
25
+ })();
16
26
  export class FacadeState {
17
27
  shielded;
18
28
  unshielded;
@@ -72,53 +82,89 @@ export class WalletFacade {
72
82
  await this.shielded.submitTransaction(tx, 'Finalized');
73
83
  return tx.identifiers().at(-1);
74
84
  }
75
- async balanceFinalizedTransaction(zswapSecretKeys, dustSecretKeys, tx, ttl) {
76
- const unshieldedBalancing = await this.unshielded.balanceFinalizedTransaction(tx);
77
- const shieldedBalancing = await this.shielded.balanceTransaction(zswapSecretKeys, tx);
78
- const mergedBalancing = this.mergeUnprovenTransactions(shieldedBalancing, unshieldedBalancing);
79
- const feeBalancingTransaction = await this.dust.balanceTransactions(dustSecretKeys, mergedBalancing ? [tx, mergedBalancing] : [tx], ttl);
80
- const balancingTransaction = mergedBalancing
81
- ? mergedBalancing.merge(feeBalancingTransaction)
82
- : feeBalancingTransaction;
85
+ async balanceFinalizedTransaction(tx, secretKeys, options) {
86
+ const { shieldedSecretKeys, dustSecretKey } = secretKeys;
87
+ const { ttl, tokenKindsToBalance = 'all' } = options;
88
+ const { shouldBalanceDust, shouldBalanceShielded, shouldBalanceUnshielded } = TokenKindsToBalance.toFlags(tokenKindsToBalance);
89
+ // Step 1: Run unshielded and shielded balancing
90
+ const unshieldedBalancingTx = shouldBalanceUnshielded
91
+ ? await this.unshielded.balanceFinalizedTransaction(tx)
92
+ : undefined;
93
+ const shieldedBalancingTx = shouldBalanceShielded
94
+ ? await this.shielded.balanceTransaction(shieldedSecretKeys, tx)
95
+ : undefined;
96
+ // Step 2: Merge unshielded and shielded balancing
97
+ const mergedBalancingTx = this.mergeUnprovenTransactions(shieldedBalancingTx, unshieldedBalancingTx);
98
+ // Step 3: Conditionally add dust/fee balancing
99
+ const feeBalancingTx = shouldBalanceDust
100
+ ? await this.dust.balanceTransactions(dustSecretKey, mergedBalancingTx ? [tx, mergedBalancingTx] : [tx], ttl)
101
+ : undefined;
102
+ // Step 4: Merge fee balancing and create final recipe
103
+ const balancingTx = this.mergeUnprovenTransactions(mergedBalancingTx, feeBalancingTx);
104
+ if (!balancingTx) {
105
+ throw new Error('No balancing transaction was created. Please check your transaction.');
106
+ }
83
107
  return {
84
108
  type: 'FINALIZED_TRANSACTION',
85
109
  originalTransaction: tx,
86
- balancingTransaction,
110
+ balancingTransaction: balancingTx,
87
111
  };
88
112
  }
89
- async balanceUnboundTransaction(zswapSecretKeys, dustSecretKeys, tx, ttl) {
113
+ async balanceUnboundTransaction(tx, secretKeys, options) {
114
+ const { shieldedSecretKeys, dustSecretKey } = secretKeys;
115
+ const { ttl, tokenKindsToBalance = 'all' } = options;
116
+ const { shouldBalanceDust, shouldBalanceShielded, shouldBalanceUnshielded } = TokenKindsToBalance.toFlags(tokenKindsToBalance);
117
+ // Step 1: Run unshielded and shielded balancing
118
+ const shieldedBalancingTx = shouldBalanceShielded
119
+ ? await this.shielded.balanceTransaction(shieldedSecretKeys, tx)
120
+ : undefined;
90
121
  // For unbound transactions, unshielded balancing happens in place not with a balancing transaction
91
- const balancedUnshieldedTx = await this.unshielded.balanceUnboundTransaction(tx);
92
- const shieldedBalancingTx = await this.shielded.balanceTransaction(zswapSecretKeys, tx);
93
- // unbound unshielded tx are balanced in place, check if balancedUnshieldedTx is present and use it as base tx
122
+ const balancedUnshieldedTx = shouldBalanceUnshielded
123
+ ? await this.unshielded.balanceUnboundTransaction(tx)
124
+ : undefined;
125
+ // Step 2: Unbound unshielded tx are balanced in place, use it as base tx if present
94
126
  const baseTx = balancedUnshieldedTx ?? tx;
95
- // Add fee payment - pass shielded balancing if present, otherwise just calculate fee for base tx
96
- const transactionsToPayFeesFor = shieldedBalancingTx ? [baseTx, shieldedBalancingTx] : [baseTx];
97
- const feeBalancingTransaction = await this.dust.balanceTransactions(dustSecretKeys, transactionsToPayFeesFor, ttl);
98
- // Create the final balancing transaction
99
- const balancingTransaction = shieldedBalancingTx
100
- ? shieldedBalancingTx.merge(feeBalancingTransaction)
101
- : feeBalancingTransaction;
127
+ // Step 3: Conditionally add dust/fee balancing
128
+ const feeBalancingTransaction = shouldBalanceDust
129
+ ? await this.dust.balanceTransactions(dustSecretKey, shieldedBalancingTx ? [baseTx, shieldedBalancingTx] : [baseTx], ttl)
130
+ : undefined;
131
+ // Step 4: Create the final balancing transaction
132
+ const balancingTransaction = this.mergeUnprovenTransactions(shieldedBalancingTx, feeBalancingTransaction);
133
+ // if there is no balancingTransaction and there was no unshielded tx balancing (in place) throw an error.
134
+ if (!balancingTransaction && !balancedUnshieldedTx) {
135
+ throw new Error('No balancing transaction was created. Please check your transaction.');
136
+ }
102
137
  return {
103
138
  type: 'UNBOUND_TRANSACTION',
104
139
  baseTransaction: baseTx,
105
- balancingTransaction,
140
+ balancingTransaction: balancingTransaction ?? undefined,
106
141
  };
107
142
  }
108
- async balanceUnprovenTransaction(zswapSecretKeys, dustSecretKeys, tx, ttl) {
143
+ async balanceUnprovenTransaction(tx, secretKeys, options) {
144
+ const { shieldedSecretKeys, dustSecretKey } = secretKeys;
145
+ const { ttl, tokenKindsToBalance = 'all' } = options;
146
+ const { shouldBalanceDust, shouldBalanceShielded, shouldBalanceUnshielded } = TokenKindsToBalance.toFlags(tokenKindsToBalance);
147
+ // Step 1: Run unshielded and shielded balancing
148
+ const shieldedBalancingTx = shouldBalanceShielded
149
+ ? await this.shielded.balanceTransaction(shieldedSecretKeys, tx)
150
+ : undefined;
109
151
  // For unproven transactions, unshielded balancing happens in place
110
- const balancedUnshieldedTx = await this.unshielded.balanceUnprovenTransaction(tx);
111
- const shieldedBalancingTx = await this.shielded.balanceTransaction(zswapSecretKeys, tx);
112
- // Use the balanced unshielded tx if present, otherwise use the original tx
152
+ const balancedUnshieldedTx = shouldBalanceUnshielded
153
+ ? await this.unshielded.balanceUnprovenTransaction(tx)
154
+ : undefined;
155
+ // Step 2: Use the balanced unshielded tx if present, otherwise use the original tx
113
156
  const baseTx = balancedUnshieldedTx ?? tx;
114
- // Merge shielded balancing into base tx if present
115
- const mergedTx = shieldedBalancingTx ? baseTx.merge(shieldedBalancingTx) : baseTx;
116
- // Add fee payment
117
- const feeBalancingTransaction = await this.dust.balanceTransactions(dustSecretKeys, [mergedTx], ttl);
118
- const balancedTransaction = mergedTx.merge(feeBalancingTransaction);
157
+ // Step 3: Merge shielded balancing into base tx if present
158
+ const mergedTx = this.mergeUnprovenTransactions(baseTx, shieldedBalancingTx);
159
+ // Step 4: Conditionally add dust/fee balancing
160
+ const feeBalancingTx = shouldBalanceDust
161
+ ? await this.dust.balanceTransactions(dustSecretKey, [mergedTx], ttl)
162
+ : undefined;
163
+ // Step 5: Merge fee balancing if present
164
+ const balancedTx = this.mergeUnprovenTransactions(mergedTx, feeBalancingTx);
119
165
  return {
120
166
  type: 'UNPROVEN_TRANSACTION',
121
- transaction: balancedTransaction,
167
+ transaction: balancedTx,
122
168
  };
123
169
  }
124
170
  async finalizeRecipe(recipe) {
@@ -128,9 +174,11 @@ export class WalletFacade {
128
174
  return recipe.originalTransaction.merge(finalizedBalancing);
129
175
  }
130
176
  case 'UNBOUND_TRANSACTION': {
131
- const finalizedBalancingTx = await this.finalizeTransaction(recipe.balancingTransaction);
177
+ const finalizedBalancingTx = recipe.balancingTransaction
178
+ ? await this.finalizeTransaction(recipe.balancingTransaction)
179
+ : undefined;
132
180
  const finalizedTransaction = recipe.baseTransaction.bind();
133
- return finalizedTransaction.merge(finalizedBalancingTx);
181
+ return finalizedBalancingTx ? finalizedTransaction.merge(finalizedBalancingTx) : finalizedTransaction;
134
182
  }
135
183
  case 'UNPROVEN_TRANSACTION': {
136
184
  return await this.finalizeTransaction(recipe.transaction);
@@ -140,32 +188,38 @@ export class WalletFacade {
140
188
  async signRecipe(recipe, signSegment) {
141
189
  switch (recipe.type) {
142
190
  case 'FINALIZED_TRANSACTION': {
143
- const signedBalancing = await this.signTransaction(recipe.balancingTransaction, signSegment);
191
+ const signedBalancingTx = await this.signUnprovenTransaction(recipe.balancingTransaction, signSegment);
144
192
  return {
145
193
  type: 'FINALIZED_TRANSACTION',
146
194
  originalTransaction: recipe.originalTransaction,
147
- balancingTransaction: signedBalancing,
195
+ balancingTransaction: signedBalancingTx,
148
196
  };
149
197
  }
150
198
  case 'UNBOUND_TRANSACTION': {
151
- const signedBalancing = await this.signTransaction(recipe.balancingTransaction, signSegment);
199
+ const signedBalancingTx = recipe.balancingTransaction
200
+ ? await this.signUnprovenTransaction(recipe.balancingTransaction, signSegment)
201
+ : undefined;
202
+ const signedBaseTx = await this.signUnboundTransaction(recipe.baseTransaction, signSegment);
152
203
  return {
153
204
  type: 'UNBOUND_TRANSACTION',
154
- baseTransaction: recipe.baseTransaction,
155
- balancingTransaction: signedBalancing,
205
+ baseTransaction: signedBaseTx,
206
+ balancingTransaction: signedBalancingTx,
156
207
  };
157
208
  }
158
209
  case 'UNPROVEN_TRANSACTION': {
159
- const signedTransaction = await this.signTransaction(recipe.transaction, signSegment);
210
+ const signedTx = await this.signUnprovenTransaction(recipe.transaction, signSegment);
160
211
  return {
161
212
  type: 'UNPROVEN_TRANSACTION',
162
- transaction: signedTransaction,
213
+ transaction: signedTx,
163
214
  };
164
215
  }
165
216
  }
166
217
  }
167
- async signTransaction(tx, signSegment) {
168
- return await this.unshielded.signTransaction(tx, signSegment);
218
+ async signUnprovenTransaction(tx, signSegment) {
219
+ return await this.unshielded.signUnprovenTransaction(tx, signSegment);
220
+ }
221
+ async signUnboundTransaction(tx, signSegment) {
222
+ return await this.unshielded.signUnboundTransaction(tx, signSegment);
169
223
  }
170
224
  async finalizeTransaction(tx) {
171
225
  return await this.shielded.finalizeTransaction(tx);
@@ -173,7 +227,9 @@ export class WalletFacade {
173
227
  async calculateTransactionFee(tx) {
174
228
  return await this.dust.calculateFee([tx]);
175
229
  }
176
- async transferTransaction(zswapSecretKeys, dustSecretKey, outputs, ttl) {
230
+ async transferTransaction(outputs, secretKeys, options) {
231
+ const { shieldedSecretKeys, dustSecretKey } = secretKeys;
232
+ const { ttl, payFees = true } = options;
177
233
  const unshieldedOutputs = outputs
178
234
  .filter((output) => output.type === 'unshielded')
179
235
  .flatMap((output) => output.outputs);
@@ -181,20 +237,17 @@ export class WalletFacade {
181
237
  if (unshieldedOutputs.length === 0 && shieldedOutputs.length === 0) {
182
238
  throw Error('At least one shielded or unshielded output is required.');
183
239
  }
184
- let shieldedTx;
185
- let unshieldedTx;
186
- if (unshieldedOutputs.length > 0) {
187
- unshieldedTx = await this.unshielded.transferTransaction(unshieldedOutputs, ttl);
188
- }
189
- if (shieldedOutputs.length > 0) {
190
- shieldedTx = await this.shielded.transferTransaction(zswapSecretKeys, shieldedOutputs);
191
- }
240
+ const shieldedTx = shieldedOutputs.length > 0
241
+ ? await this.shielded.transferTransaction(shieldedSecretKeys, shieldedOutputs)
242
+ : undefined;
243
+ const unshieldedTx = unshieldedOutputs.length > 0 ? await this.unshielded.transferTransaction(unshieldedOutputs, ttl) : undefined;
192
244
  const mergedTxs = this.mergeUnprovenTransactions(shieldedTx, unshieldedTx);
193
245
  // Add fee payment
194
- const feeBalancingTransaction = await this.dust.balanceTransactions(dustSecretKey, [mergedTxs], ttl);
246
+ const feeBalancingTx = payFees ? await this.dust.balanceTransactions(dustSecretKey, [mergedTxs], ttl) : undefined;
247
+ const finalTx = this.mergeUnprovenTransactions(mergedTxs, feeBalancingTx);
195
248
  return {
196
249
  type: 'UNPROVEN_TRANSACTION',
197
- transaction: mergedTxs.merge(feeBalancingTransaction),
250
+ transaction: finalTx,
198
251
  };
199
252
  }
200
253
  async estimateRegistration(nightUtxos) {
@@ -211,7 +264,9 @@ export class WalletFacade {
211
264
  dustGenerationEstimations,
212
265
  };
213
266
  }
214
- async initSwap(zswapSecretKeys, desiredInputs, desiredOutputs, ttl) {
267
+ async initSwap(desiredInputs, desiredOutputs, secretKeys, options) {
268
+ const { shieldedSecretKeys, dustSecretKey } = secretKeys;
269
+ const { ttl, payFees = false } = options;
215
270
  const { shielded: shieldedInputs, unshielded: unshieldedInputs } = desiredInputs;
216
271
  const shieldedOutputs = desiredOutputs
217
272
  .filter((output) => output.type === 'shielded')
@@ -225,7 +280,7 @@ export class WalletFacade {
225
280
  throw Error('At least one shielded or unshielded swap is required.');
226
281
  }
227
282
  const shieldedTx = hasShieldedPart && shieldedInputs !== undefined
228
- ? await this.shielded.initSwap(zswapSecretKeys, shieldedInputs, shieldedOutputs)
283
+ ? await this.shielded.initSwap(shieldedSecretKeys, shieldedInputs, shieldedOutputs)
229
284
  : undefined;
230
285
  const unshieldedTx = hasUnshieldedPart && unshieldedInputs !== undefined
231
286
  ? await this.unshielded.initSwap(unshieldedInputs, unshieldedOutputs, ttl)
@@ -234,9 +289,11 @@ export class WalletFacade {
234
289
  if (!combinedTx) {
235
290
  throw Error('Unexpected transaction state.');
236
291
  }
292
+ const feeBalancingTx = payFees ? await this.dust.balanceTransactions(dustSecretKey, [combinedTx], ttl) : undefined;
293
+ const finalTx = this.mergeUnprovenTransactions(combinedTx, feeBalancingTx);
237
294
  return {
238
295
  type: 'UNPROVEN_TRANSACTION',
239
- transaction: combinedTx,
296
+ transaction: finalTx,
240
297
  };
241
298
  }
242
299
  async registerNightUtxosForDustGeneration(nightUtxos, nightVerifyingKey, signDustRegistration, dustReceiverAddress) {
@@ -258,8 +315,12 @@ export class WalletFacade {
258
315
  transaction: dustDeregistrationTx,
259
316
  };
260
317
  }
261
- async start(zswapSecretKeys, dustSecretKey) {
262
- await Promise.all([this.shielded.start(zswapSecretKeys), this.unshielded.start(), this.dust.start(dustSecretKey)]);
318
+ async start(shieldedSecretKeys, dustSecretKey) {
319
+ await Promise.all([
320
+ this.shielded.start(shieldedSecretKeys),
321
+ this.unshielded.start(),
322
+ this.dust.start(dustSecretKey),
323
+ ]);
263
324
  }
264
325
  async stop() {
265
326
  await Promise.all([this.shielded.stop(), this.unshielded.stop(), this.dust.stop()]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/wallet-sdk-facade",
3
- "version": "1.0.0-beta.16",
3
+ "version": "1.0.0-beta.17",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -24,17 +24,17 @@
24
24
  }
25
25
  },
26
26
  "dependencies": {
27
- "@midnight-ntwrk/ledger-v7": "7.0.0-rc.1",
27
+ "@midnight-ntwrk/ledger-v7": "7.0.0",
28
28
  "@midnight-ntwrk/wallet-sdk-abstractions": "1.0.0-beta.10",
29
- "@midnight-ntwrk/wallet-sdk-address-format": "3.0.0-beta.11",
30
- "@midnight-ntwrk/wallet-sdk-dust-wallet": "1.0.0-beta.15",
29
+ "@midnight-ntwrk/wallet-sdk-address-format": "3.0.0-beta.12",
30
+ "@midnight-ntwrk/wallet-sdk-dust-wallet": "1.0.0-beta.16",
31
31
  "@midnight-ntwrk/wallet-sdk-hd": "3.0.0-beta.8",
32
- "@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.16",
33
- "@midnight-ntwrk/wallet-sdk-unshielded-wallet": "1.0.0-beta.18",
32
+ "@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.17",
33
+ "@midnight-ntwrk/wallet-sdk-unshielded-wallet": "1.0.0-beta.19",
34
34
  "rxjs": "^7.5"
35
35
  },
36
36
  "devDependencies": {
37
- "@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.13",
37
+ "@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.14",
38
38
  "eslint": "^9.37.0",
39
39
  "prettier": "^3.7.0",
40
40
  "publint": "~0.3.14",