@midnightntwrk/wallet-sdk-testkit 0.3.0-beta.0 → 0.3.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.
@@ -42,6 +42,12 @@ export const NETWORK_PRESETS = {
42
42
  indexerWsUrl: 'wss://indexer.preprod.midnight.network/api/v4/graphql/ws',
43
43
  nodeUrl: 'wss://rpc.preprod.midnight.network',
44
44
  },
45
+ stagenet: {
46
+ networkId: NetworkId.NetworkId.StageNet,
47
+ indexerHttpUrl: 'https://indexer.stagenet.shielded.tools/api/v4/graphql',
48
+ indexerWsUrl: 'wss://indexer.stagenet.shielded.tools/api/v4/graphql/ws',
49
+ nodeUrl: 'wss://rpc.stagenet.shielded.tools',
50
+ },
45
51
  };
46
52
  /**
47
53
  * Builds a {@link WalletTestEnvironment} from already-resolved endpoints. Shared by the remote factory below and the
@@ -54,7 +54,7 @@ export function registerDustHealthchecks({ getEnv, seed, syncCacheDir, timeout =
54
54
  logger.info(`utxo length: ${unregisteredUtxosNumber}`);
55
55
  const firstTwoNightUtxos = unregisteredNightUtxos.slice(0, 2);
56
56
  logger.info(`Registering UTXOs: ${inspect(firstTwoNightUtxos, { depth: null })}`);
57
- const dustRegistrationRecipe = await wallet.wallet.registerNightUtxosForDustGeneration(firstTwoNightUtxos, wallet.unshieldedKeystore.getPublicKey(), (payload) => wallet.unshieldedKeystore.signData(payload));
57
+ const dustRegistrationRecipe = await wallet.wallet.registerNightUtxosForDustGeneration(firstTwoNightUtxos, wallet.unshieldedKeystore.getPublicKey(), wallet.unshieldedKeystore.signDataAsync);
58
58
  const finalizedDustTx = await wallet.wallet.finalizeRecipe(dustRegistrationRecipe);
59
59
  const dustRegistrationTxid = await wallet.wallet.submitTransaction(finalizedDustTx);
60
60
  expect(dustRegistrationTxid).toBeDefined();
@@ -75,7 +75,7 @@ export function registerDustHealthchecks({ getEnv, seed, syncCacheDir, timeout =
75
75
  logger.info(`Registered night UTXOs: ${inspect(registeredNightUtxos, { depth: null })}`);
76
76
  expect(registeredNightUtxos.length, 'Not enough registered UTXOs found').toBeGreaterThan(1);
77
77
  const firstTwoRegisteredNightUtxos = registeredNightUtxos.slice(0, 2);
78
- const dustDeregistrationRecipe = await wallet.wallet.deregisterFromDustGeneration(firstTwoRegisteredNightUtxos, wallet.unshieldedKeystore.getPublicKey(), (payload) => wallet.unshieldedKeystore.signData(payload));
78
+ const dustDeregistrationRecipe = await wallet.wallet.deregisterFromDustGeneration(firstTwoRegisteredNightUtxos, wallet.unshieldedKeystore.getPublicKey(), wallet.unshieldedKeystore.signDataAsync);
79
79
  const balancedTransactionRecipe = await wallet.wallet.balanceUnprovenTransaction(dustDeregistrationRecipe.transaction, {
80
80
  shieldedSecretKeys: wallet.shieldedSecretKeys,
81
81
  dustSecretKey: wallet.dustSecretKey,
@@ -155,7 +155,7 @@ export function registerTokenTransferHealthchecks(deps) {
155
155
  });
156
156
  logger.info('Signing tx...');
157
157
  logger.info(txRecipe);
158
- const signedTxRecipe = await sender.wallet.signRecipe(txRecipe, (payload) => sender.unshieldedKeystore.signData(payload));
158
+ const signedTxRecipe = await sender.wallet.signRecipe(txRecipe, sender.unshieldedKeystore.signDataAsync);
159
159
  logger.info('Transaction to prove...');
160
160
  logger.info(signedTxRecipe);
161
161
  const finalizedTx = await sender.wallet.finalizeRecipe(signedTxRecipe);
@@ -14,22 +14,37 @@ export declare const waitForStateAfterDustRegistration: (wallet: WalletFacade, f
14
14
  export declare const waitForRegisteredTokens: (wallet: WalletFacade) => Promise<import("@midnightntwrk/wallet-sdk-facade").FacadeState>;
15
15
  export declare const waitForTxInHistory: (txHash: string, wallet: WalletFacade, ready?: (entry: WalletEntry) => boolean) => Promise<{
16
16
  readonly hash: string;
17
- readonly protocolVersion: number;
18
- readonly status: "SUCCESS" | "FAILURE" | "PARTIAL_SUCCESS";
19
- readonly identifiers?: readonly string[] | undefined;
17
+ readonly identifiers: readonly string[];
18
+ readonly protocolVersion?: number | undefined;
19
+ readonly status?: "SUCCESS" | "FAILURE" | "PARTIAL_SUCCESS" | undefined;
20
20
  readonly timestamp?: Date | undefined;
21
21
  readonly fees?: bigint | null | undefined;
22
+ readonly lifecycle: {
23
+ readonly status: "pending";
24
+ readonly submittedAt: Date;
25
+ } | {
26
+ readonly status: "finalized";
27
+ readonly finalizedBlock: {
28
+ readonly hash: string;
29
+ readonly timestamp: Date;
30
+ readonly height: number;
31
+ };
32
+ } | {
33
+ readonly status: "rejected";
34
+ readonly rejectedAt: Date;
35
+ readonly reason?: string | undefined;
36
+ };
22
37
  readonly shielded?: {
23
38
  readonly receivedCoins: readonly {
39
+ readonly value: bigint;
24
40
  readonly type: string;
25
41
  readonly nonce: string;
26
- readonly value: bigint;
27
42
  readonly mtIndex: bigint;
28
43
  }[];
29
44
  readonly spentCoins: readonly {
45
+ readonly value: bigint;
30
46
  readonly type: string;
31
47
  readonly nonce: string;
32
- readonly value: bigint;
33
48
  readonly mtIndex: bigint;
34
49
  }[];
35
50
  } | undefined;
package/dist/types.d.ts CHANGED
@@ -4,7 +4,7 @@ import { type DefaultV1Configuration as DefaultDustV1Configuration } from '@midn
4
4
  import { type DefaultProvingConfiguration } from '@midnightntwrk/wallet-sdk-capabilities/proving';
5
5
  import { type DefaultSubmissionConfiguration } from '@midnightntwrk/wallet-sdk-capabilities/submission';
6
6
  /** Networks a wallet test environment can target. */
7
- export type MidnightNetwork = 'undeployed' | 'qanet' | 'devnet' | 'preview' | 'preprod';
7
+ export type MidnightNetwork = 'undeployed' | 'qanet' | 'devnet' | 'preview' | 'preprod' | 'stagenet';
8
8
  /** A remote (already-running) network — anything other than the local testcontainers stack. */
9
9
  export type RemoteNetwork = Exclude<MidnightNetwork, 'undeployed'>;
10
10
  /**
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@midnightntwrk/wallet-sdk-testkit",
3
3
  "description": "Reusable wallet-SDK test harness: environment provisioning, wallet bootstrapping, sync waiters and tx-history assertions",
4
- "version": "0.3.0-beta.0",
4
+ "version": "0.3.0-beta.2",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",
@@ -39,22 +39,22 @@
39
39
  }
40
40
  },
41
41
  "dependencies": {
42
- "@midnightntwrk/ledger-v9": "1.0.0-rc.2",
43
- "@midnightntwrk/wallet-sdk-abstractions": "workspace:^",
44
- "@midnightntwrk/wallet-sdk-address-format": "workspace:^",
45
- "@midnightntwrk/wallet-sdk-capabilities": "workspace:^",
46
- "@midnightntwrk/wallet-sdk-dust-wallet": "workspace:^",
47
- "@midnightntwrk/wallet-sdk-facade": "workspace:^",
48
- "@midnightntwrk/wallet-sdk-hd": "workspace:^",
49
- "@midnightntwrk/wallet-sdk-indexer-client": "workspace:^",
50
- "@midnightntwrk/wallet-sdk-shielded": "workspace:^",
51
- "@midnightntwrk/wallet-sdk-unshielded-wallet": "workspace:^",
42
+ "@midnightntwrk/ledger-v9": "1.0.0-rc.3",
43
+ "@midnightntwrk/wallet-sdk-abstractions": "3.0.0-beta.0",
44
+ "@midnightntwrk/wallet-sdk-address-format": "4.0.0-beta.2",
45
+ "@midnightntwrk/wallet-sdk-capabilities": "4.0.0-beta.2",
46
+ "@midnightntwrk/wallet-sdk-dust-wallet": "5.0.0-beta.2",
47
+ "@midnightntwrk/wallet-sdk-facade": "5.0.0-beta.2",
48
+ "@midnightntwrk/wallet-sdk-hd": "3.1.0-beta.1",
49
+ "@midnightntwrk/wallet-sdk-indexer-client": "1.3.0-beta.1",
50
+ "@midnightntwrk/wallet-sdk-shielded": "4.0.0-beta.2",
51
+ "@midnightntwrk/wallet-sdk-unshielded-wallet": "4.0.0-beta.2",
52
52
  "pino": "^10.3.1",
53
53
  "pino-pretty": "^13.1.3",
54
54
  "rxjs": "^7.8.2"
55
55
  },
56
56
  "peerDependencies": {
57
- "@midnightntwrk/wallet-sdk-utilities": "workspace:^",
57
+ "@midnightntwrk/wallet-sdk-utilities": "1.2.0",
58
58
  "testcontainers": "^11.12.0",
59
59
  "vitest": "^4.1.4"
60
60
  },