@midnight-ntwrk/wallet-sdk-dust-wallet 1.0.0-beta.11 → 1.0.0-beta.12

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.
Files changed (2) hide show
  1. package/dist/Sync.js +4 -2
  2. package/package.json +5 -5
package/dist/Sync.js CHANGED
@@ -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 { Effect, Either, Layer, ParseResult, pipe, Schema, Stream } from 'effect';
13
+ import { Effect, Either, Layer, ParseResult, pipe, Schema, Stream, Duration } from 'effect';
14
14
  import { Event as LedgerEvent, LedgerParameters } from '@midnight-ntwrk/ledger-v6';
15
15
  import { BlockHash, DustLedgerEvents } from '@midnight-ntwrk/wallet-sdk-indexer-client';
16
16
  import { WsSubscriptionClient, HttpQueryClient, ConnectionHelper, } from '@midnight-ntwrk/wallet-sdk-indexer-client/effect';
@@ -69,7 +69,9 @@ export const makeDefaultSyncService = (config) => {
69
69
  const indexerSyncService = makeIndexerSyncService(config);
70
70
  return {
71
71
  updates: (state, secretKey) => {
72
- return pipe(indexerSyncService.subscribeWallet(state), Stream.map((data) => WalletSyncUpdate.create(data, secretKey)), Stream.provideSomeLayer(indexerSyncService.connectionLayer()));
72
+ const batchSize = 50;
73
+ const batchTimeout = Duration.seconds(10);
74
+ return pipe(indexerSyncService.subscribeWallet(state), Stream.map((data) => WalletSyncUpdate.create(data, secretKey)), Stream.groupedWithin(batchSize, batchTimeout), Stream.flatMap((chunk) => Stream.fromIterable(chunk)), Stream.provideSomeLayer(indexerSyncService.connectionLayer()));
73
75
  },
74
76
  blockData: () => {
75
77
  return Effect.gen(function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/wallet-sdk-dust-wallet",
3
- "version": "1.0.0-beta.11",
3
+ "version": "1.0.0-beta.12",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -28,11 +28,11 @@
28
28
  "@midnight-ntwrk/wallet-sdk-address-format": "3.0.0-beta.9",
29
29
  "@midnight-ntwrk/wallet-sdk-capabilities": "3.0.0-beta.9",
30
30
  "@midnight-ntwrk/wallet-sdk-hd": "3.0.0-beta.7",
31
- "@midnight-ntwrk/wallet-sdk-indexer-client": "1.0.0-beta.13",
31
+ "@midnight-ntwrk/wallet-sdk-indexer-client": "1.0.0-beta.14",
32
32
  "@midnight-ntwrk/wallet-sdk-node-client": "1.0.0-beta.10",
33
- "@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.10",
34
- "@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.12",
35
- "@midnight-ntwrk/wallet-sdk-utilities": "1.0.0-beta.7",
33
+ "@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.11",
34
+ "@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.13",
35
+ "@midnight-ntwrk/wallet-sdk-utilities": "1.0.0-beta.8",
36
36
  "effect": "^3.17.3",
37
37
  "rxjs": "^7.5"
38
38
  },