@midnight-ntwrk/wallet-sdk-facade 2.0.0-rc.2 → 2.0.0-rc.3

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
@@ -61,6 +61,7 @@ export type UtxoWithMeta = {
61
61
  utxo: ledger.Utxo;
62
62
  meta: {
63
63
  ctime: Date;
64
+ registeredForDustGeneration: boolean;
64
65
  };
65
66
  };
66
67
  export declare class FacadeState {
package/dist/index.js CHANGED
@@ -132,7 +132,11 @@ export class WalletFacade {
132
132
  }
133
133
  async createDustActionTransaction(action, nightUtxos, nightVerifyingKey, signDustRegistration) {
134
134
  const ttl = this.defaultTtl();
135
- const transaction = await this.dust.createDustGenerationTransaction(undefined, ttl, nightUtxos.map(({ utxo, meta }) => ({ ...utxo, ctime: meta.ctime })), nightVerifyingKey, action.type === 'registration' ? action.dustReceiverAddress : undefined);
135
+ const transaction = await this.dust.createDustGenerationTransaction(undefined, ttl, nightUtxos.map(({ utxo, meta }) => ({
136
+ ...utxo,
137
+ ctime: meta.ctime,
138
+ registeredForDustGeneration: meta.registeredForDustGeneration,
139
+ })), nightVerifyingKey, action.type === 'registration' ? action.dustReceiverAddress : undefined);
136
140
  const intent = transaction.intents?.get(1);
137
141
  if (!intent) {
138
142
  throw Error('Dust generation transaction is missing intent segment 1.');
@@ -365,7 +369,11 @@ export class WalletFacade {
365
369
  async estimateRegistration(nightUtxos) {
366
370
  const now = new Date();
367
371
  const dustState = await this.dust.waitForSyncedState();
368
- const dustGenerationEstimations = pipe(nightUtxos, Arr.map(({ utxo, meta }) => ({ ...utxo, ctime: meta.ctime })), (utxosWithMeta) => dustState.estimateDustGeneration(utxosWithMeta, now), (estimatedUtxos) => dustState.capabilities.coinsAndBalances.splitNightUtxos(estimatedUtxos), (split) => split.guaranteed);
372
+ const dustGenerationEstimations = pipe(nightUtxos, Arr.map(({ utxo, meta }) => ({
373
+ ...utxo,
374
+ ctime: meta.ctime,
375
+ registeredForDustGeneration: meta.registeredForDustGeneration,
376
+ })), (utxosWithMeta) => dustState.estimateDustGeneration(utxosWithMeta, now), (estimatedUtxos) => dustState.capabilities.coinsAndBalances.splitNightUtxos(estimatedUtxos), (split) => split.guaranteed);
369
377
  const fakeSigningKey = ledger.sampleSigningKey();
370
378
  const fakeVerifyingKey = ledger.signatureVerifyingKey(fakeSigningKey);
371
379
  const fakeRegistrationRecipe = await this.registerNightUtxosForDustGeneration(nightUtxos, fakeVerifyingKey, (payload) => ledger.signData(fakeSigningKey, payload), dustState.address);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/wallet-sdk-facade",
3
- "version": "2.0.0-rc.2",
3
+ "version": "2.0.0-rc.3",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -27,7 +27,7 @@
27
27
  "@midnight-ntwrk/ledger-v7": "^7.0.0",
28
28
  "@midnight-ntwrk/wallet-sdk-address-format": "^3.0.0",
29
29
  "@midnight-ntwrk/wallet-sdk-capabilities": "^3.1.0-rc.2",
30
- "@midnight-ntwrk/wallet-sdk-dust-wallet": "^2.0.0-rc.2",
30
+ "@midnight-ntwrk/wallet-sdk-dust-wallet": "^2.0.0-rc.3",
31
31
  "@midnight-ntwrk/wallet-sdk-shielded": "^2.0.0-rc.2",
32
32
  "@midnight-ntwrk/wallet-sdk-unshielded-wallet": "^2.0.0-rc.2",
33
33
  "rxjs": "^7.5"