@midnight-ntwrk/wallet-sdk-indexer-client 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.
- package/dist/effect/ConnectionHelper.js +12 -0
- package/dist/effect/HttpQueryClient.js +12 -0
- package/dist/effect/Query.js +12 -0
- package/dist/effect/QueryClient.js +12 -0
- package/dist/effect/Subscription.js +12 -0
- package/dist/effect/SubscriptionClient.js +12 -0
- package/dist/effect/WsSubscriptionClient.js +12 -0
- package/dist/effect/index.js +12 -0
- package/dist/effect/test/httpQueryClient.spied.test.js +12 -0
- package/dist/effect/test/httpQueryClient.test.js +12 -0
- package/dist/effect/test/wsSubscriptionClient.spied.test.js +12 -0
- package/dist/effect/test/wsSubscriptionClient.test.js +12 -0
- package/dist/graphql/generated/gql.js +12 -0
- package/dist/graphql/generated/graphql.d.ts +3 -3
- package/dist/graphql/generated/graphql.js +481 -7
- package/dist/graphql/generated/index.js +12 -0
- package/dist/graphql/queries/BlockHash.js +12 -0
- package/dist/graphql/queries/Connect.js +12 -0
- package/dist/graphql/queries/Disconnect.js +12 -0
- package/dist/graphql/queries/index.js +12 -0
- package/dist/graphql/queries/test/BlockHash.test.js +29 -15
- package/dist/graphql/subscriptions/DustLedgerEvents.js +12 -0
- package/dist/graphql/subscriptions/ShieldedTransactions.js +12 -0
- package/dist/graphql/subscriptions/UnshieldedTransactions.js +12 -0
- package/dist/graphql/subscriptions/ZswapEvents.js +12 -0
- package/dist/graphql/subscriptions/index.js +12 -0
- package/dist/graphql/subscriptions/test/ShieldedTransactions.test.js +27 -13
- package/dist/graphql/subscriptions/test/UnshieldedTransactions.test.js +27 -13
- package/dist/graphql/subscriptions/test/ZswapEvents.test.js +27 -13
- package/dist/index.js +12 -0
- package/package.json +6 -4
|
@@ -1,31 +1,45 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
|
2
14
|
import { Effect, Option } from 'effect';
|
|
3
15
|
import { randomUUID } from 'node:crypto';
|
|
4
|
-
import
|
|
16
|
+
import { buildTestEnvironmentVariables, getComposeDirectory } from '@midnight-ntwrk/wallet-sdk-utilities/testing';
|
|
5
17
|
import { DockerComposeEnvironment, Wait } from 'testcontainers';
|
|
6
18
|
import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
|
|
7
19
|
import { HttpQueryClient } from '../../../effect/index.js';
|
|
8
20
|
import { BlockHash } from '../BlockHash.js';
|
|
9
|
-
const COMPOSE_PATH = path.resolve(new URL(import.meta.url).pathname, '../../../../../');
|
|
10
21
|
const timeout_minutes = (mins) => 1_000 * 60 * mins;
|
|
22
|
+
const environmentId = randomUUID();
|
|
23
|
+
const environmentVars = buildTestEnvironmentVariables(['APP_INFRA_SECRET'], {
|
|
24
|
+
additionalVars: {
|
|
25
|
+
TESTCONTAINERS_UID: environmentId,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const environment = new DockerComposeEnvironment(getComposeDirectory(), 'docker-compose.yml')
|
|
29
|
+
// The test below assumes indexer is able to serve blocks, so we wait for it to index at least one block
|
|
30
|
+
// Otherwise the test below would be flakey or not precise enough to be useful
|
|
31
|
+
// Inspecting logs is not the best idea, but here it's the only way
|
|
32
|
+
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
33
|
+
.withEnvironment(environmentVars);
|
|
11
34
|
describe('BlockHash query', () => {
|
|
12
35
|
describe('with available Indexer Server', () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const getIndexerPort = () => environment?.getContainer(`indexer_${environmentId}`)?.getMappedPort(8088) ?? 8088;
|
|
36
|
+
let startedEnvironment = undefined;
|
|
37
|
+
const getIndexerPort = () => startedEnvironment?.getContainer(`indexer_${environmentId}`)?.getMappedPort(8088) ?? 8088;
|
|
16
38
|
beforeAll(async () => {
|
|
17
|
-
|
|
18
|
-
.withEnvironment({
|
|
19
|
-
TESTCONTAINERS_UID: environmentId,
|
|
20
|
-
})
|
|
21
|
-
// The test below assumes indexer is able to serve blocks, so we wait for it to index at least one block
|
|
22
|
-
// Otherwise the test below would be flakey or not precise enough to be useful
|
|
23
|
-
// Inspecting logs is not the best idea, but here it's the only way
|
|
24
|
-
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
25
|
-
.up();
|
|
39
|
+
startedEnvironment = await environment.up();
|
|
26
40
|
}, timeout_minutes(3));
|
|
27
41
|
afterAll(async () => {
|
|
28
|
-
await
|
|
42
|
+
await startedEnvironment?.down();
|
|
29
43
|
}, timeout_minutes(1));
|
|
30
44
|
it('should fail with ClientError for unknown URL', async () => {
|
|
31
45
|
await BlockHash.run({ offset: null }).pipe(Effect.catchSome((err) => (err._tag === 'ClientError' ? Option.some(Effect.succeed(void 0)) : Option.none())), Effect.catchAll((err) => Effect.fail(`Encountered unexpected '${err._tag}' error: ${err.message}`)), Effect.flatMap((data) => (data ? Effect.fail('Unexpectedly received data') : Effect.succeed(void 0))), Effect.provide(HttpQueryClient.layer({ url: `http://127.0.0.1:${getIndexerPort()}/a__p__i/v3/graphql` })), Effect.scoped, Effect.runPromise);
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Subscription } from '../../effect/index.js';
|
|
2
14
|
import { gql } from '../generated/index.js';
|
|
3
15
|
export const DustLedgerEvents = Subscription.make('DustLedgerEvents', gql(`
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Subscription } from '../../effect/index.js';
|
|
2
14
|
import { gql } from '../generated/index.js';
|
|
3
15
|
export const ShieldedTransactions = Subscription.make('ShieldedTransactions', gql(`
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Subscription } from '../../effect/index.js';
|
|
2
14
|
import { gql } from '../generated/index.js';
|
|
3
15
|
export const UnshieldedTransactions = Subscription.make('UnshieldedTransactions', gql(`
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Subscription } from '../../effect/index.js';
|
|
2
14
|
import { gql } from '../generated/index.js';
|
|
3
15
|
export const ZswapEvents = Subscription.make('ZswapEvents', gql(`
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
export * from './DustLedgerEvents.js';
|
|
2
14
|
export * from './ShieldedTransactions.js';
|
|
3
15
|
export * from './UnshieldedTransactions.js';
|
|
@@ -1,30 +1,44 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Effect, Stream } from 'effect';
|
|
2
14
|
import { randomUUID } from 'node:crypto';
|
|
3
|
-
import
|
|
15
|
+
import { buildTestEnvironmentVariables, getComposeDirectory } from '@midnight-ntwrk/wallet-sdk-utilities/testing';
|
|
4
16
|
import { DockerComposeEnvironment, Wait } from 'testcontainers';
|
|
5
17
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
18
|
import { HttpQueryClient, WsSubscriptionClient } from '../../../effect/index.js';
|
|
7
19
|
import { Connect, Disconnect } from '../../queries/index.js';
|
|
8
20
|
import { ShieldedTransactions } from '../ShieldedTransactions.js';
|
|
9
|
-
const COMPOSE_PATH = path.resolve(new URL(import.meta.url).pathname, '../../../../../');
|
|
10
21
|
const KNOWN_VIEWING_KEY = 'mn_shield-esk_undeployed1d45kgmnfva58gwn9de3hy7tsw35k7m3dwdjkxun9wskkketetdmrzhf6dlyj7u8juj68fd4psnkqhjxh32sec0q480vzswg8kd485e2kljcsmxqc0u';
|
|
11
22
|
const timeout_minutes = (mins) => 1_000 * 60 * mins;
|
|
23
|
+
const environmentId = randomUUID();
|
|
24
|
+
const environmentVars = buildTestEnvironmentVariables(['APP_INFRA_SECRET'], {
|
|
25
|
+
additionalVars: {
|
|
26
|
+
TESTCONTAINERS_UID: environmentId,
|
|
27
|
+
},
|
|
28
|
+
});
|
|
29
|
+
const environment = new DockerComposeEnvironment(getComposeDirectory(), 'docker-compose.yml')
|
|
30
|
+
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
31
|
+
.withWaitStrategy(`indexer_${environmentId}`, Wait.forListeningPorts())
|
|
32
|
+
.withEnvironment(environmentVars);
|
|
12
33
|
describe('Wallet subscription', () => {
|
|
13
34
|
describe('with available Indexer Server', () => {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const getIndexerPort = () => environment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
35
|
+
let startedEnvironment = undefined;
|
|
36
|
+
const getIndexerPort = () => startedEnvironment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
17
37
|
beforeAll(async () => {
|
|
18
|
-
|
|
19
|
-
.withEnvironment({
|
|
20
|
-
TESTCONTAINERS_UID: environmentId,
|
|
21
|
-
})
|
|
22
|
-
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
23
|
-
.withWaitStrategy(`indexer_${environmentId}`, Wait.forListeningPorts())
|
|
24
|
-
.up();
|
|
38
|
+
startedEnvironment = await environment.up();
|
|
25
39
|
}, timeout_minutes(3));
|
|
26
40
|
afterAll(async () => {
|
|
27
|
-
await
|
|
41
|
+
await startedEnvironment?.down();
|
|
28
42
|
}, timeout_minutes(1));
|
|
29
43
|
it('should stream GraphQL subscription', async () => {
|
|
30
44
|
const makeScopedSession = Effect.acquireRelease(Connect.run({ viewingKey: KNOWN_VIEWING_KEY }), (session) => Disconnect.run({ sessionId: session.connect }).pipe(Effect.catchAll((_) => Effect.void)));
|
|
@@ -1,29 +1,43 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Effect, Stream } from 'effect';
|
|
2
14
|
import { randomUUID } from 'node:crypto';
|
|
3
|
-
import
|
|
15
|
+
import { buildTestEnvironmentVariables, getComposeDirectory } from '@midnight-ntwrk/wallet-sdk-utilities/testing';
|
|
4
16
|
import { DockerComposeEnvironment, Wait } from 'testcontainers';
|
|
5
17
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
18
|
import { WsSubscriptionClient } from '../../../effect/index.js';
|
|
7
19
|
import { UnshieldedTransactions } from '../UnshieldedTransactions.js';
|
|
8
|
-
const COMPOSE_PATH = path.resolve(new URL(import.meta.url).pathname, '../../../../../');
|
|
9
20
|
const timeout_minutes = (mins) => 1_000 * 60 * mins;
|
|
10
21
|
const ADDRESS = 'mn_addr_undeployed1rhqz8aq6t74ym2uq5gh53t9x02gducxnamtdvnjxfhelxwaf8ztqpmrwwj';
|
|
22
|
+
const environmentId = randomUUID();
|
|
23
|
+
const environmentVars = buildTestEnvironmentVariables(['APP_INFRA_SECRET'], {
|
|
24
|
+
additionalVars: {
|
|
25
|
+
TESTCONTAINERS_UID: environmentId,
|
|
26
|
+
},
|
|
27
|
+
});
|
|
28
|
+
const environment = new DockerComposeEnvironment(getComposeDirectory(), 'docker-compose.yml')
|
|
29
|
+
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
30
|
+
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
31
|
+
.withEnvironment(environmentVars);
|
|
11
32
|
describe('Wallet subscription', () => {
|
|
12
33
|
describe('with available Indexer Server', () => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
const getIndexerPort = () => environment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
34
|
+
let startedEnvironment = undefined;
|
|
35
|
+
const getIndexerPort = () => startedEnvironment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
16
36
|
beforeAll(async () => {
|
|
17
|
-
|
|
18
|
-
.withEnvironment({
|
|
19
|
-
TESTCONTAINERS_UID: environmentId,
|
|
20
|
-
})
|
|
21
|
-
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
22
|
-
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
23
|
-
.up();
|
|
37
|
+
startedEnvironment = await environment.up();
|
|
24
38
|
}, timeout_minutes(3));
|
|
25
39
|
afterAll(async () => {
|
|
26
|
-
await
|
|
40
|
+
await startedEnvironment?.down();
|
|
27
41
|
}, timeout_minutes(1));
|
|
28
42
|
it('should stream GraphQL subscription', async () => {
|
|
29
43
|
await Effect.gen(function* () {
|
|
@@ -1,28 +1,42 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
import { Effect, Stream } from 'effect';
|
|
2
14
|
import { randomUUID } from 'node:crypto';
|
|
3
|
-
import
|
|
15
|
+
import { buildTestEnvironmentVariables, getComposeDirectory } from '@midnight-ntwrk/wallet-sdk-utilities/testing';
|
|
4
16
|
import { DockerComposeEnvironment, Wait } from 'testcontainers';
|
|
5
17
|
import { afterAll, beforeAll, describe, expect, it } from 'vitest';
|
|
6
18
|
import { WsSubscriptionClient } from '../../../effect/index.js';
|
|
7
19
|
import { ZswapEvents } from '../ZswapEvents.js';
|
|
8
|
-
const COMPOSE_PATH = path.resolve(new URL(import.meta.url).pathname, '../../../../../');
|
|
9
20
|
const timeout_minutes = (mins) => 1_000 * 60 * mins;
|
|
21
|
+
const environmentId = randomUUID();
|
|
22
|
+
const environmentVars = buildTestEnvironmentVariables(['APP_INFRA_SECRET'], {
|
|
23
|
+
additionalVars: {
|
|
24
|
+
TESTCONTAINERS_UID: environmentId,
|
|
25
|
+
},
|
|
26
|
+
});
|
|
27
|
+
const environment = new DockerComposeEnvironment(getComposeDirectory(), 'docker-compose.yml')
|
|
28
|
+
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
29
|
+
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
30
|
+
.withEnvironment(environmentVars);
|
|
10
31
|
describe('ZSwap events subscription', () => {
|
|
11
32
|
describe('with available Indexer Server', () => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const getIndexerPort = () => environment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
33
|
+
let startedEnvironment = undefined;
|
|
34
|
+
const getIndexerPort = () => startedEnvironment?.getContainer(`indexer_${environmentId}`).getMappedPort(8088) ?? 8088;
|
|
15
35
|
beforeAll(async () => {
|
|
16
|
-
|
|
17
|
-
.withEnvironment({
|
|
18
|
-
TESTCONTAINERS_UID: environmentId,
|
|
19
|
-
})
|
|
20
|
-
.withWaitStrategy(`node_${environmentId}`, Wait.forListeningPorts())
|
|
21
|
-
.withWaitStrategy(`indexer_${environmentId}`, Wait.forLogMessage(/block indexed/))
|
|
22
|
-
.up();
|
|
36
|
+
startedEnvironment = await environment.up();
|
|
23
37
|
}, timeout_minutes(3));
|
|
24
38
|
afterAll(async () => {
|
|
25
|
-
await
|
|
39
|
+
await startedEnvironment?.down();
|
|
26
40
|
}, timeout_minutes(1));
|
|
27
41
|
it('should stream GraphQL subscription', async () => {
|
|
28
42
|
await Effect.gen(function* () {
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
// This file is part of MIDNIGHT-WALLET-SDK.
|
|
2
|
+
// Copyright (C) 2025 Midnight Foundation
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
// You may not use this file except in compliance with the License.
|
|
6
|
+
// You may obtain a copy of the License at
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
9
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
10
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
|
+
// See the License for the specific language governing permissions and
|
|
12
|
+
// limitations under the License.
|
|
1
13
|
export * from './graphql/queries/index.js';
|
|
2
14
|
export * from './graphql/subscriptions/index.js';
|
|
3
15
|
export * from './graphql/generated/graphql.js';
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnight-ntwrk/wallet-sdk-indexer-client",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"module": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
|
-
"author": "
|
|
7
|
+
"author": "Midnight Foundation",
|
|
8
8
|
"license": "Apache-2.0",
|
|
9
9
|
"publishConfig": {
|
|
10
10
|
"registry": "https://npm.pkg.github.com/"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@effect/platform": "^0.90.0",
|
|
31
31
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
32
|
-
"@midnight-ntwrk/wallet-sdk-abstractions": "1.0.0-beta.
|
|
32
|
+
"@midnight-ntwrk/wallet-sdk-abstractions": "1.0.0-beta.9",
|
|
33
33
|
"@midnight-ntwrk/wallet-sdk-utilities": "1.0.0-beta.7",
|
|
34
34
|
"effect": "^3.17.3",
|
|
35
35
|
"graphql": "^16.11.0",
|
|
@@ -44,13 +44,15 @@
|
|
|
44
44
|
"eslint": "^9.37.0",
|
|
45
45
|
"publint": "~0.3.14",
|
|
46
46
|
"rimraf": "^6.0.1",
|
|
47
|
-
"testcontainers": "^11.
|
|
47
|
+
"testcontainers": "^11.8.1",
|
|
48
48
|
"typescript": "^5.9.3",
|
|
49
49
|
"vitest": "^3.2.4"
|
|
50
50
|
},
|
|
51
51
|
"scripts": {
|
|
52
52
|
"gql:codegen": "graphql-codegen",
|
|
53
53
|
"typecheck": "tsc -b ./tsconfig.json --noEmit",
|
|
54
|
+
"format": "prettier --write \"**/*.{ts,js,json,yaml,yml}\"",
|
|
55
|
+
"format:check": "prettier --check \"**/*.{ts,js,json,yaml,yml}\"",
|
|
54
56
|
"test": "vitest run",
|
|
55
57
|
"lint": "eslint",
|
|
56
58
|
"dist": "tsc -b ./tsconfig.build.json",
|