@midnight-ntwrk/wallet-sdk-shielded 2.0.0-rc.4 → 2.1.0-rc.0

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.
@@ -1,6 +1,6 @@
1
1
  import { type ProtocolState, ProtocolVersion, SyncProgress } from '@midnight-ntwrk/wallet-sdk-abstractions';
2
2
  import { type BaseV1Configuration, type DefaultV1Configuration, type V1Variant, CoreWallet } from './v1/index.js';
3
- import * as ledger from '@midnight-ntwrk/ledger-v7';
3
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
4
4
  import * as rx from 'rxjs';
5
5
  import { type BalancingResult } from './v1/Transacting.js';
6
6
  import { type SerializationCapability } from './v1/Serialization.js';
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
  import { ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
14
14
  import { V1Builder, V1Tag, CoreWallet, } from './v1/index.js';
15
- import * as ledger from '@midnight-ntwrk/ledger-v7';
15
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
16
16
  import { Effect, Either } from 'effect';
17
17
  import * as rx from 'rxjs';
18
18
  import { WalletBuilder } from '@midnight-ntwrk/wallet-sdk-runtime';
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
1
1
  import { CoreWallet } from './CoreWallet.js';
2
- import * as ledger from '@midnight-ntwrk/ledger-v7';
2
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
3
3
  export type AvailableCoin = {
4
4
  coin: ledger.QualifiedShieldedCoinInfo;
5
5
  commitment: ledger.CoinCommitment;
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { ProtocolVersion, SyncProgress } from '@midnight-ntwrk/wallet-sdk-abstractions';
3
3
  import { Either } from 'effect';
4
4
  import { WalletError } from './WalletError.js';
@@ -40,7 +40,7 @@ export declare const CoreWallet: {
40
40
  replayEvents(wallet: CoreWallet, secretKeys: ledger.ZswapSecretKeys, events: ledger.Event[]): CoreWallet;
41
41
  updateProgress(wallet: CoreWallet, { appliedIndex, highestRelevantWalletIndex, highestIndex, highestRelevantIndex, isConnected, }: Partial<SyncProgress.SyncProgressData>): CoreWallet;
42
42
  addTransaction(wallet: CoreWallet, _tx: ledger.FinalizedTransaction): CoreWallet;
43
- revertTransaction<TTx extends ledger.Transaction<ledger.Signaturish, ledger.Proofish, ledger.Bindingish>>(wallet: CoreWallet, _tx: TTx): CoreWallet;
43
+ revertTransaction<TTx extends ledger.Transaction<ledger.Signaturish, ledger.Proofish, ledger.Bindingish>>(wallet: CoreWallet, tx: TTx): CoreWallet;
44
44
  updateTxHistory(wallet: CoreWallet, _newTxs: readonly ledger.FinalizedTransaction[]): CoreWallet;
45
45
  spendCoins(wallet: CoreWallet, secretKeys: ledger.ZswapSecretKeys, coins: ReadonlyArray<ledger.QualifiedShieldedCoinInfo>, segment: number): [ReadonlyArray<ledger.ZswapOffer<ledger.PreProof>>, CoreWallet];
46
46
  watchCoins(wallet: CoreWallet, secretKeys: ledger.ZswapSecretKeys, coins: ReadonlyArray<ledger.ShieldedCoinInfo>): CoreWallet;
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import * as ledger from '@midnight-ntwrk/ledger-v7';
13
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
14
14
  import { ProtocolVersion, SyncProgress } from '@midnight-ntwrk/wallet-sdk-abstractions';
15
15
  import { Either, Iterable, pipe, Record, Array as Arr } from 'effect';
16
16
  import { InvalidCoinHashesError } from './WalletError.js';
@@ -126,8 +126,9 @@ export const CoreWallet = {
126
126
  return wallet;
127
127
  },
128
128
  /* not implemented until this is done https://shielded.atlassian.net/browse/PM-19678 */
129
- revertTransaction(wallet, _tx) {
130
- return wallet;
129
+ revertTransaction(wallet, tx) {
130
+ const newState = wallet.state.revertTransaction(tx);
131
+ return { ...wallet, state: newState };
131
132
  },
132
133
  // TODO: Remove after tx history is implemented
133
134
  updateTxHistory(wallet, _newTxs) {
@@ -1,4 +1,4 @@
1
- import type * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import type * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { Effect, Scope, Stream } from 'effect';
3
3
  import { type WalletRuntimeError, type Variant, StateChange } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
4
4
  import { type SerializationCapability } from './Serialization.js';
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -12,7 +12,7 @@
12
12
  // limitations under the License.
13
13
  import { Effect, ParseResult, Either, pipe, Schema } from 'effect';
14
14
  import { WalletError } from './WalletError.js';
15
- import * as ledger from '@midnight-ntwrk/ledger-v7';
15
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
16
16
  import { CoreWallet } from './CoreWallet.js';
17
17
  const StateSchema = Schema.declare((input) => input instanceof ledger.ZswapLocalState).annotations({
18
18
  identifier: 'ledger.ZswapLocalState',
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { Array as Arr, Effect, type Scope, Stream, SubscriptionRef } from 'effect';
3
3
  export type SimulatorState = Readonly<{
4
4
  ledger: ledger.LedgerState;
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import * as ledger from '@midnight-ntwrk/ledger-v7';
13
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
14
14
  import { Array as Arr, Effect, Encoding, pipe, Stream, SubscriptionRef, Clock } from 'effect';
15
15
  import { ArrayOps, EitherOps } from '@midnight-ntwrk/wallet-sdk-utilities';
16
16
  import * as crypto from 'crypto';
@@ -33,6 +33,7 @@ export class Simulator {
33
33
  parentBlockHash: hash,
34
34
  secondsSinceEpoch: number,
35
35
  secondsSinceEpochErr: 1,
36
+ lastBlockTime: 1n,
36
37
  })));
37
38
  static init(genesisMints) {
38
39
  const emptyState = ledger.LedgerState.blank(NetworkId.NetworkId.Undeployed);
package/dist/v1/Sync.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { Schema, Scope, Stream } from 'effect';
3
3
  import { CoreWallet } from './CoreWallet.js';
4
4
  import { Simulator, SimulatorState } from './Simulator.js';
package/dist/v1/Sync.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import * as ledger from '@midnight-ntwrk/ledger-v7';
13
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
14
14
  import { Chunk, Duration, Effect, Either, ParseResult, pipe, Schedule, Schema, Stream } from 'effect';
15
15
  import { CoreWallet } from './CoreWallet.js';
16
16
  import { ZswapEvents } from '@midnight-ntwrk/wallet-sdk-indexer-client';
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { NetworkId } from '@midnight-ntwrk/wallet-sdk-abstractions';
3
3
  import { Array as Arr, Either } from 'effect';
4
4
  import { CoreWallet } from './CoreWallet.js';
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import * as ledger from '@midnight-ntwrk/ledger-v7';
13
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
14
14
  import { Array as Arr, Either, Option, pipe, Record } from 'effect';
15
15
  import { ArrayOps } from '@midnight-ntwrk/wallet-sdk-utilities';
16
16
  import { CoreWallet } from './CoreWallet.js';
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { CoreWallet } from './CoreWallet.js';
3
3
  export type TransactionHistoryCapability<TState, TTransaction> = {
4
4
  updateTxHistory(state: TState, newTxs: TTransaction[]): TState;
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -1,6 +1,6 @@
1
1
  import { Imbalances } from '@midnight-ntwrk/wallet-sdk-capabilities';
2
2
  import { TransactionImbalances } from './TransactionImbalances.js';
3
- import * as ledger from '@midnight-ntwrk/ledger-v7';
3
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
4
4
  export type TransactionOps<Tx> = {
5
5
  getImbalances(tx: Tx): TransactionImbalances;
6
6
  id(tx: Tx): string;
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { type Either, type Types } from 'effect';
3
3
  import { type NetworkId } from '@midnight-ntwrk/wallet-sdk-abstractions';
4
4
  import { type Variant, type VariantBuilder } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
@@ -10,7 +10,7 @@
10
10
  // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11
11
  // See the License for the specific language governing permissions and
12
12
  // limitations under the License.
13
- import * as ledger from '@midnight-ntwrk/ledger-v7';
13
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
14
14
  import { Effect, Scope } from 'effect';
15
15
  import { WalletSeed } from '@midnight-ntwrk/wallet-sdk-abstractions';
16
16
  import { RunningV1Variant, V1Tag } from './RunningV1Variant.js';
@@ -1,4 +1,4 @@
1
- import * as ledger from '@midnight-ntwrk/ledger-v7';
1
+ import * as ledger from '@midnight-ntwrk/ledger-v8';
2
2
  import { LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
3
3
  export declare const WalletError: {
4
4
  other(err: unknown): WalletError;
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
package/dist/v1/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // This file is part of MIDNIGHT-WALLET-SDK.
2
- // Copyright (C) 2025 Midnight Foundation
2
+ // Copyright (C) Midnight Foundation
3
3
  // SPDX-License-Identifier: Apache-2.0
4
4
  // Licensed under the Apache License, Version 2.0 (the "License");
5
5
  // You may not use this file except in compliance with the License.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/wallet-sdk-shielded",
3
- "version": "2.0.0-rc.4",
3
+ "version": "2.1.0-rc.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -28,14 +28,13 @@
28
28
  }
29
29
  },
30
30
  "dependencies": {
31
- "@midnight-ntwrk/ledger-v7": "^7.0.2",
32
- "@midnight-ntwrk/wallet-sdk-abstractions": "2.0.0-rc.1",
33
- "@midnight-ntwrk/wallet-sdk-address-format": "3.0.0",
34
- "@midnight-ntwrk/wallet-sdk-capabilities": "3.1.0-rc.2",
35
- "@midnight-ntwrk/wallet-sdk-indexer-client": "1.1.0-rc.4",
36
- "@midnight-ntwrk/wallet-sdk-runtime": "1.0.1-rc.2",
37
- "@midnight-ntwrk/wallet-sdk-utilities": "1.0.1-rc.1",
38
- "@scure/base": "^2.0.0",
31
+ "@midnight-ntwrk/ledger-v8": "^8.0.2",
32
+ "@midnight-ntwrk/wallet-sdk-abstractions": "2.0.0",
33
+ "@midnight-ntwrk/wallet-sdk-address-format": "3.1.0-rc.0",
34
+ "@midnight-ntwrk/wallet-sdk-capabilities": "3.2.0-rc.0",
35
+ "@midnight-ntwrk/wallet-sdk-indexer-client": "1.2.0-rc.0",
36
+ "@midnight-ntwrk/wallet-sdk-runtime": "1.0.2-rc.0",
37
+ "@midnight-ntwrk/wallet-sdk-utilities": "1.1.0-rc.0",
39
38
  "effect": "^3.19.19",
40
39
  "rxjs": "^7.8.2"
41
40
  },
@@ -49,25 +48,5 @@
49
48
  "dist:publish": "tsc -b ./tsconfig.publish.json",
50
49
  "clean": "rimraf --glob dist 'tsconfig.*.tsbuildinfo' && date +%s > .clean-timestamp",
51
50
  "publint": "publint --strict"
52
- },
53
- "devDependencies": {
54
- "@effect/cluster": "^0.56.4",
55
- "@effect/experimental": "^0.58.0",
56
- "@effect/platform": "^0.94.5",
57
- "@effect/platform-node": "^0.104.1",
58
- "@effect/rpc": "^0.73.2",
59
- "@effect/sql": "^0.49.0",
60
- "@effect/workflow": "^0.16.0",
61
- "@midnight-ntwrk/wallet-sdk-prover-client": "1.1.0-rc.3",
62
- "@polkadot/types": "^16.5.4",
63
- "eslint": "^10.0.2",
64
- "fast-check": "^4.5.3",
65
- "prettier": "^3.8.1",
66
- "publint": "^0.3.17",
67
- "rimraf": "^6.1.3",
68
- "testcontainers": "^11.12.0",
69
- "to-words": "^5.1.0",
70
- "typescript": "^5.9.3",
71
- "vitest": "^4.0.18"
72
51
  }
73
52
  }