@midnight-ntwrk/wallet-sdk-shielded 2.0.0-rc.2 → 2.0.0-rc.4
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/v1/Sync.d.ts +1 -0
- package/dist/v1/Sync.js +1 -1
- package/package.json +25 -29
package/dist/v1/Sync.d.ts
CHANGED
|
@@ -13,6 +13,7 @@ export interface SyncCapability<TState, TUpdate> {
|
|
|
13
13
|
export type IndexerClientConnection = {
|
|
14
14
|
indexerHttpUrl: string;
|
|
15
15
|
indexerWsUrl?: string;
|
|
16
|
+
keepAlive?: number;
|
|
16
17
|
};
|
|
17
18
|
export type DefaultSyncConfiguration = {
|
|
18
19
|
indexerClientConnection: IndexerClientConnection;
|
package/dist/v1/Sync.js
CHANGED
|
@@ -98,7 +98,7 @@ export const makeEventsSyncService = (config) => {
|
|
|
98
98
|
const indexerWsUrl = indexerWsUrlResult.right;
|
|
99
99
|
const appliedIndex = state.progress?.appliedIndex ?? 0n;
|
|
100
100
|
const batchSize = config.batchSize ?? 10;
|
|
101
|
-
return pipe(ZswapEvents.run({ id: Number(appliedIndex) }), Stream.provideLayer(WsSubscriptionClient.layer({ url: indexerWsUrl })), Stream.mapError((error) => new SyncWalletError(error)), Stream.mapEffect((subscription) => pipe(subscription.zswapLedgerEvents, Schema.decodeUnknownEither(EventsSyncUpdateFromPayload), Either.mapLeft((err) => new SyncWalletError(err)), EitherOps.toEffect)), Stream.groupedWithin(batchSize, Duration.millis(1)), Stream.map(Chunk.toArray), Stream.map((data) => WalletSyncUpdate.create(data, secretKeys)), Stream.schedule(Schedule.spaced(Duration.millis(4))));
|
|
101
|
+
return pipe(ZswapEvents.run({ id: Number(appliedIndex) }), Stream.provideLayer(WsSubscriptionClient.layer({ url: indexerWsUrl, keepAlive: config.indexerClientConnection.keepAlive })), Stream.mapError((error) => new SyncWalletError(error)), Stream.mapEffect((subscription) => pipe(subscription.zswapLedgerEvents, Schema.decodeUnknownEither(EventsSyncUpdateFromPayload), Either.mapLeft((err) => new SyncWalletError(err)), EitherOps.toEffect)), Stream.groupedWithin(batchSize, Duration.millis(1)), Stream.map(Chunk.toArray), Stream.map((data) => WalletSyncUpdate.create(data, secretKeys)), Stream.schedule(Schedule.spaced(Duration.millis(4))));
|
|
102
102
|
},
|
|
103
103
|
};
|
|
104
104
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnight-ntwrk/wallet-sdk-shielded",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.js",
|
|
@@ -28,20 +28,16 @@
|
|
|
28
28
|
}
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@midnight-ntwrk/ledger-v7": "7.0.
|
|
31
|
+
"@midnight-ntwrk/ledger-v7": "^7.0.2",
|
|
32
32
|
"@midnight-ntwrk/wallet-sdk-abstractions": "2.0.0-rc.1",
|
|
33
33
|
"@midnight-ntwrk/wallet-sdk-address-format": "3.0.0",
|
|
34
34
|
"@midnight-ntwrk/wallet-sdk-capabilities": "3.1.0-rc.2",
|
|
35
|
-
"@midnight-ntwrk/wallet-sdk-indexer-client": "1.1.0-rc.
|
|
36
|
-
"@midnight-ntwrk/wallet-sdk-runtime": "1.0.1-rc.
|
|
37
|
-
"@midnight-ntwrk/wallet-sdk-utilities": "1.0.1-rc.
|
|
38
|
-
"@scure/base": "^
|
|
39
|
-
"effect": "^3.19.
|
|
40
|
-
"
|
|
41
|
-
"node-fetch": "3.3.2",
|
|
42
|
-
"rxjs": "^7.5",
|
|
43
|
-
"scale-ts": "^1.1.0",
|
|
44
|
-
"ws": "^8.18.3"
|
|
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",
|
|
39
|
+
"effect": "^3.19.19",
|
|
40
|
+
"rxjs": "^7.8.2"
|
|
45
41
|
},
|
|
46
42
|
"scripts": {
|
|
47
43
|
"typecheck": "tsc -b ./tsconfig.json --noEmit --force",
|
|
@@ -55,23 +51,23 @@
|
|
|
55
51
|
"publint": "publint --strict"
|
|
56
52
|
},
|
|
57
53
|
"devDependencies": {
|
|
58
|
-
"@effect/cluster": "^0.
|
|
59
|
-
"@effect/experimental": "^0.
|
|
60
|
-
"@effect/platform": "^0.
|
|
61
|
-
"@effect/platform-node": "^0.
|
|
62
|
-
"@effect/rpc": "^0.
|
|
63
|
-
"@effect/sql": "^0.
|
|
64
|
-
"@effect/workflow": "^0.
|
|
65
|
-
"@midnight-ntwrk/wallet-sdk-prover-client": "1.1.0-rc.
|
|
66
|
-
"@polkadot/types": "^16.4
|
|
67
|
-
"eslint": "^
|
|
68
|
-
"fast-check": "^4.
|
|
69
|
-
"prettier": "^3.
|
|
70
|
-
"publint": "
|
|
71
|
-
"rimraf": "^6.
|
|
72
|
-
"testcontainers": "^11.
|
|
73
|
-
"to-words": "^
|
|
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",
|
|
74
70
|
"typescript": "^5.9.3",
|
|
75
|
-
"vitest": "^4.0.
|
|
71
|
+
"vitest": "^4.0.18"
|
|
76
72
|
}
|
|
77
73
|
}
|