@midnightntwrk/wallet-sdk-facade 5.0.0-beta.1 → 5.0.0-beta.2

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,7 +4,7 @@ import { type DefaultProvingConfiguration, type ProvingService, type UnboundTran
4
4
  import { type DefaultDustConfiguration, type DustWalletAPI, type DustWalletState } from '@midnightntwrk/wallet-sdk-dust-wallet';
5
5
  import { type AnyTransaction, type CoinsAndBalances as DustCoinsAndBalances } from '@midnightntwrk/wallet-sdk-dust-wallet/v1';
6
6
  import { type DefaultShieldedConfiguration, type ShieldedWalletAPI, type ShieldedWalletState } from '@midnightntwrk/wallet-sdk-shielded';
7
- import type { DefaultUnshieldedConfiguration, UnshieldedWalletAPI } from '@midnightntwrk/wallet-sdk-unshielded-wallet';
7
+ import type { DefaultUnshieldedConfiguration, SignSegment, UnshieldedWalletAPI } from '@midnightntwrk/wallet-sdk-unshielded-wallet';
8
8
  import { type UnshieldedWalletState } from '@midnightntwrk/wallet-sdk-unshielded-wallet';
9
9
  import { Clock } from '@midnightntwrk/wallet-sdk-utilities';
10
10
  import { Schema } from 'effect';
@@ -179,6 +179,11 @@ export declare class FacadeState {
179
179
  * without a circular dependency.
180
180
  */
181
181
  export { Clock };
182
+ /**
183
+ * The asynchronous signer callback used by every signing entry point. A `Promise`-returning callback so out-of-process
184
+ * signers (MPC, HSM) can be plugged in directly; an in-process keystore resolves immediately.
185
+ */
186
+ export type { SignSegment };
182
187
  /**
183
188
  * The Terms and Conditions returned by the indexer, containing a URL for display and a SHA-256 hash for content
184
189
  * verification.
@@ -408,9 +413,9 @@ export declare class WalletFacade {
408
413
  tokenKindsToBalance?: TokenKindsToBalance;
409
414
  }): Promise<UnprovenTransactionRecipe>;
410
415
  finalizeRecipe(recipe: BalancingRecipe): Promise<ledger.FinalizedTransaction>;
411
- signRecipe(recipe: BalancingRecipe, signSegment: (data: Uint8Array) => ledger.Signature): Promise<BalancingRecipe>;
412
- signUnprovenTransaction(tx: ledger.UnprovenTransaction, signSegment: (data: Uint8Array) => ledger.Signature): Promise<ledger.UnprovenTransaction>;
413
- signUnboundTransaction(tx: UnboundTransaction, signSegment: (data: Uint8Array) => ledger.Signature): Promise<UnboundTransaction>;
416
+ signRecipe(recipe: BalancingRecipe, signSegment: SignSegment): Promise<BalancingRecipe>;
417
+ signUnprovenTransaction(tx: ledger.UnprovenTransaction, signSegment: SignSegment): Promise<ledger.UnprovenTransaction>;
418
+ signUnboundTransaction(tx: UnboundTransaction, signSegment: SignSegment): Promise<UnboundTransaction>;
414
419
  finalizeTransaction(tx: ledger.UnprovenTransaction): Promise<ledger.FinalizedTransaction>;
415
420
  /** Estimates the fee for the given transaction only. This lacks the fees of the balancing transaction. */
416
421
  calculateTransactionFee(tx: AnyTransaction): Promise<bigint>;
@@ -444,7 +449,7 @@ export declare class WalletFacade {
444
449
  ttl: Date;
445
450
  payFees?: boolean;
446
451
  }): Promise<UnprovenTransactionRecipe>;
447
- registerNightUtxosForDustGeneration(nightUtxos: readonly UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: (payload: Uint8Array) => ledger.Signature, dustReceiverAddress?: DustAddress): Promise<UnprovenTransactionRecipe>;
452
+ registerNightUtxosForDustGeneration(nightUtxos: readonly UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: SignSegment, dustReceiverAddress?: DustAddress): Promise<UnprovenTransactionRecipe>;
448
453
  /**
449
454
  * Waits until the dust projected to be generated by the given Night UTxOs reaches `requiredAmount`, re-checking every
450
455
  * second. Pair with {@link estimateRegistration} to pick `requiredAmount`, then call before
@@ -458,7 +463,7 @@ export declare class WalletFacade {
458
463
  waitForGeneratedDust(nightUtxos: readonly UtxoWithMeta[], requiredAmount: bigint, opts?: {
459
464
  timeoutMs?: number;
460
465
  }): Promise<void>;
461
- deregisterFromDustGeneration(nightUtxos: UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: (payload: Uint8Array) => ledger.Signature): Promise<UnprovenTransactionRecipe>;
466
+ deregisterFromDustGeneration(nightUtxos: UtxoWithMeta[], nightVerifyingKey: ledger.SignatureVerifyingKey, signDustRegistration: SignSegment): Promise<UnprovenTransactionRecipe>;
462
467
  revert(txOrRecipe: AnyTransaction | BalancingRecipe): Promise<void>;
463
468
  revertTransaction(tx: AnyTransaction): Promise<void>;
464
469
  start(shieldedSecretKeys: ledger.ZswapSecretKeys, dustSecretKey: ledger.DustSecretKey): Promise<void>;
package/dist/index.js CHANGED
@@ -649,7 +649,7 @@ export class WalletFacade {
649
649
  if (!intent || registrations.length === 0) {
650
650
  return tx;
651
651
  }
652
- const signature = signSegment(intent.signatureData(1));
652
+ const signature = await signSegment(intent.signatureData(1));
653
653
  return await this.dust.addDustRegistrationSignature(tx, signature);
654
654
  }
655
655
  async signUnprovenTransaction(tx, signSegment) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnightntwrk/wallet-sdk-facade",
3
- "version": "5.0.0-beta.1",
3
+ "version": "5.0.0-beta.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -26,14 +26,14 @@
26
26
  }
27
27
  },
28
28
  "dependencies": {
29
- "@midnightntwrk/ledger-v9": "1.0.0-rc.2",
29
+ "@midnightntwrk/ledger-v9": "1.0.0-rc.3",
30
30
  "@midnightntwrk/wallet-sdk-abstractions": "3.0.0-beta.0",
31
- "@midnightntwrk/wallet-sdk-address-format": "4.0.0-beta.1",
32
- "@midnightntwrk/wallet-sdk-capabilities": "4.0.0-beta.1",
33
- "@midnightntwrk/wallet-sdk-dust-wallet": "5.0.0-beta.1",
31
+ "@midnightntwrk/wallet-sdk-address-format": "4.0.0-beta.2",
32
+ "@midnightntwrk/wallet-sdk-capabilities": "4.0.0-beta.2",
33
+ "@midnightntwrk/wallet-sdk-dust-wallet": "5.0.0-beta.2",
34
34
  "@midnightntwrk/wallet-sdk-indexer-client": "1.3.0-beta.1",
35
- "@midnightntwrk/wallet-sdk-shielded": "4.0.0-beta.1",
36
- "@midnightntwrk/wallet-sdk-unshielded-wallet": "4.0.0-beta.1",
35
+ "@midnightntwrk/wallet-sdk-shielded": "4.0.0-beta.2",
36
+ "@midnightntwrk/wallet-sdk-unshielded-wallet": "4.0.0-beta.2",
37
37
  "effect": "^3.19.19",
38
38
  "rxjs": "^7.8.2"
39
39
  },