From 73da6f97656592b03851c95f45bcb955937e2a8d Mon Sep 17 00:00:00 2001 From: Eugene Date: Sat, 29 Jul 2023 17:01:50 +0600 Subject: [PATCH 01/21] feat: update reconnect flow, update e2e tests --- examples/client/src/App.tsx | 10 ++ examples/e2e-tests/test/e2e.spec.ts | 193 ++++++++++++++++++++- examples/e2e-tests/test/examples/client.ts | 55 ++++-- examples/e2e-tests/test/examples/server.ts | 6 +- packages/client/src/index.ts | 15 +- packages/node/src/index.ts | 7 +- 6 files changed, 261 insertions(+), 25 deletions(-) diff --git a/examples/client/src/App.tsx b/examples/client/src/App.tsx index 037daf62..426c137b 100644 --- a/examples/client/src/App.tsx +++ b/examples/client/src/App.tsx @@ -24,6 +24,7 @@ import { Requests, RequestsRegistryRecord } from './components/Requests.js'; import { MakeDeal } from './components/MakeDeal.js'; import { Offers } from './components/Offers.js'; import { Deals, DealsRegistryRecord } from './components/Deals.js'; +import { isExpired } from '@windingtree/sdk-utils'; /** Target chain config */ const chain = @@ -90,6 +91,15 @@ export const App = () => { '🔗 Client connected to server at:', new Date().toISOString(), ); + + const requests = requestsManager.current?.getAll(); + const requestIds = requests + ?.filter( + (requests: ClientRequestRecord) => !isExpired(requests.data.expire), + ) + .map((request: ClientRequestRecord) => request.data.id); + + requestIds?.forEach((id: string) => client.current?.subscribe(id)); }; const onClientDisconnected = () => { diff --git a/examples/e2e-tests/test/e2e.spec.ts b/examples/e2e-tests/test/e2e.spec.ts index 25ceab2f..62dea5c5 100644 --- a/examples/e2e-tests/test/e2e.spec.ts +++ b/examples/e2e-tests/test/e2e.spec.ts @@ -2,15 +2,21 @@ import { afterAll, beforeAll, describe, expect, it } from 'vitest'; import { NodeExample } from './examples/node.js'; import { ClientExample } from './examples/client.js'; import { ServerExample } from './examples/server.js'; - -let server: ServerExample; -let node: NodeExample; -let client: ClientExample; +import { RequestData } from '@windingtree/sdk-types'; +import { RequestQuery } from 'wtmp-examples-shared-files'; const topic = 'hello'; const message = 'Test request'; -describe('e2e', () => { +process.on('unhandledRejection', (error) => { + console.log('Unhandled rejection detected:', error); +}); + +describe('e2e 1 scenario', () => { + let server: ServerExample; + let node: NodeExample; + let client: ClientExample; + beforeAll(async () => { server = new ServerExample(); await server.start(); @@ -64,7 +70,88 @@ describe('e2e', () => { it('client should exist offer', () => { expect(client.getOffers.size).to.be.gt(0); const [offer] = client.getOffers; - expect(offer.request.topic).to.be.eq(topic); + const [request] = client.getRequests; + expect(offer.request.id).to.be.eq(request.id); + }); + + afterAll(async () => { + await server.stop(); + await node.stop(); + await client.stop(); + }); +}); + +describe('e2e 2 scenario', () => { + let server: ServerExample; + let node: NodeExample; + let client: ClientExample; + + beforeAll(async () => { + client = new ClientExample(); + node = new NodeExample(); + + await client.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 2000); + }); + + server = new ServerExample(); + }); + + it('client status should be connected', () => { + expect(server.connected).to.be.false; + }); + + it('client status should be connected', () => { + expect(client.connected).to.be.false; + }); + + it('connect server', async () => { + await server.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + }); + + it('server status should be connected', () => { + expect(server.connected).to.be.true; + }); + + it('client status should be connected', () => { + expect(client.connected).to.be.true; + }); + + it('client should add request', async () => { + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + + await client.sendRequest(topic, message); + }); + + it("client shouldn't exist offer", () => { + expect(client.getOffers.size).to.be.eq(0); + }); + + it('connect node', async () => { + await node.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + }); + + it('node status should be connected', () => { + expect(node.connected).to.be.true; + }); + + it('client should exist offer', () => { + expect(client.getOffers.size).to.be.gt(0); + const [offer] = client.getOffers; + const [request] = client.getRequests; + expect(offer.request.id).to.be.eq(request.id); }); afterAll(async () => { @@ -73,3 +160,97 @@ describe('e2e', () => { await server.stop(); }); }); + +describe('e2e 3 scenario', () => { + let server: ServerExample; + let node: NodeExample; + let client: ClientExample; + let client2: ClientExample; + let requests: Set>; + + beforeAll(async () => { + server = new ServerExample(); + await server.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 500); + }); + + client = new ClientExample(); + await client.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 2000); + }); + + node = new NodeExample(); + }); + + it('server status should be connected', () => { + expect(server.connected).to.be.true; + }); + + it('client status should be connected', () => { + expect(client.connected).to.be.true; + }); + + it('node status should be not connected', () => { + expect(node.connected).to.be.false; + }); + + it('client should add request', async () => { + await client.sendRequest(topic, message); + }); + + it("client shouldn't exist offer", () => { + expect(client.getOffers.size).to.be.eq(0); + }); + + it('connect node', async () => { + requests = client.getRequests; + await client.stop(); + await node.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + }); + + it('node status should be connected', () => { + expect(node.connected).to.be.true; + }); + + it('client status should be connected', () => { + expect(client.connected).to.be.false; + }); + + it('client should be started', async () => { + client2 = new ClientExample(); + client2.setRequests(requests); + await client2.start(); + + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + }); + + it('client status should be connected', () => { + expect(client2.connected).to.be.true; + }); + + it('client should exist offer', async () => { + await new Promise((resolve) => { + return setTimeout(() => resolve(), 3000); + }); + expect(client2.getOffers.size).to.be.gt(0); + const [offer] = client2.getOffers; + const [request] = client2.getRequests; + expect(offer.request.id).to.be.eq(request.id); + }); + + afterAll(async () => { + await server.stop(); + await node.stop(); + await client.stop(); + }); +}); diff --git a/examples/e2e-tests/test/examples/client.ts b/examples/e2e-tests/test/examples/client.ts index b57ca51e..4b6cb220 100644 --- a/examples/e2e-tests/test/examples/client.ts +++ b/examples/e2e-tests/test/examples/client.ts @@ -1,8 +1,4 @@ -import { - OfferOptions, - RequestQuery, - serverAddress, -} from 'wtmp-examples-shared-files'; +import { RequestQuery, serverAddress } from 'wtmp-examples-shared-files'; import { EventHandler } from '@libp2p/interfaces/events'; import { buildRequest } from '@windingtree/sdk-messages'; import { memoryStorage } from '@windingtree/sdk-storage'; @@ -13,22 +9,27 @@ import { RequestData, } from '@windingtree/sdk-types'; import { - ClientRequestsManager, Client, - createClient, ClientRequestRecord, + ClientRequestsManager, } from '@windingtree/sdk-client'; +import { createLogger } from '@windingtree/sdk-logger'; const defaultExpire = '30s'; +const logger = createLogger('Server'); + export class ClientExample { + private requests: Set> = new Set< + RequestData + >(); private client: Client | undefined; private requestsManager: ClientRequestsManager | undefined; private offers: Set = new Set(); public start = async () => { - this.client = createClient({ + this.client = new Client({ serverAddress, }); @@ -56,19 +57,24 @@ export class ClientExample { }; onClientStart = () => { - console.log('🚀 Client started at:', new Date().toISOString()); + logger.trace('🚀 Client started at:', new Date().toISOString()); }; onClientStop = () => { - console.log('👋 Client stopped at:', new Date().toISOString()); + logger.trace('👋 Client stopped at:', new Date().toISOString()); }; onClientConnected = () => { - console.log('🔗 Client connected to server at:', new Date().toISOString()); + logger.trace('🔗 Client connected to server at:', new Date().toISOString()); + //requests emit localstorage + this.requests.forEach((request) => { + this.client?.subscribe(request.id); + this.requestsManager?.add(request); + }); }; onClientDisconnected = () => { - console.log( + logger.trace( '🔌 Client disconnected from server at:', new Date().toISOString(), ); @@ -113,6 +119,7 @@ export class ClientExample { }, }); + this.requests.add(request); this.client.publish(request); }; @@ -124,7 +131,31 @@ export class ClientExample { return this.offers; } + get getRequests() { + return this.requests; + } + + setRequests = (requests: Set>) => { + this.requests = requests; + }; + stop = async () => { + this.client?.removeEventListener('start', this.onClientStart); + this.client?.removeEventListener('stop', this.onClientStop); + this.client?.removeEventListener('connected', this.onClientConnected); + this.client?.removeEventListener('disconnected', this.onClientDisconnected); + this.client?.removeEventListener('publish', this.onRequestPublish); + this.client?.removeEventListener('offer', this.onOffer); + + this.requestsManager?.removeEventListener( + 'subscribe', + this.onRequestSubscribe, + ); + this.requestsManager?.removeEventListener( + 'unsubscribe', + this.onRequestUnsubscribe, + ); + await this.client?.stop(); }; } diff --git a/examples/e2e-tests/test/examples/server.ts b/examples/e2e-tests/test/examples/server.ts index 0a10c77f..503bdcdb 100644 --- a/examples/e2e-tests/test/examples/server.ts +++ b/examples/e2e-tests/test/examples/server.ts @@ -52,7 +52,11 @@ export class ServerExample { }; get connected() { - return !!this.server.multiaddrs; + try { + return !!this.server.multiaddrs; + } catch (e) { + return false; + } } stop = async () => { diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index be10bb6d..4d6517c7 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -239,6 +239,10 @@ export class Client< 'gossipsub:heartbeat', () => { this.dispatchEvent(new CustomEvent('heartbeat')); + + if (!this.serverConnected) { + this.retryConnection(); + } }, ); @@ -311,8 +315,6 @@ export class Client< await this.libp2p.start(); this.dispatchEvent(new CustomEvent('start')); logger.trace('🚀 Client started at:', new Date().toISOString()); - - this.retryConnection(); } /** @@ -376,7 +378,7 @@ export class Client< if (!this.libp2p) { throw new Error('libp2p not initialized yet'); } - + await (this.libp2p.services.pubsub as CenterSub).stop(); await this.libp2p.stop(); this.dispatchEvent(new CustomEvent('stop')); logger.trace('👋 Client stopped at:', new Date().toISOString()); @@ -388,18 +390,21 @@ export class Client< if (this.libp2p && !this.serverConnected) { try { await this.libp2p.dial(this.serverMultiaddr); + await (this.libp2p.services.pubsub as CenterSub).stop(); + await (this.libp2p.services.pubsub as CenterSub).start(); } catch (error) { logger.error(error); } } }; - dial().catch((error) => { logger.error(error); }); }.bind(this); - this.connectionInterval = setInterval(retry, 5000); + if (!this.connectionInterval) { + this.connectionInterval = setInterval(retry, 5000); + } } } diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 33c19166..17a74259 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -462,6 +462,9 @@ export class Node< if (this.libp2p && !this.serverConnected) { try { await this.libp2p.dial(this.serverMultiaddr); + await (this.libp2p.services.pubsub as CenterSub).stop(); + await (this.libp2p.services.pubsub as CenterSub).start(); + this.enable(); } catch (error) { logger.error(error); } @@ -473,7 +476,9 @@ export class Node< }); }.bind(this); - this.connectionInterval = setInterval(retry, 5000); + if (!this.connectionInterval) { + this.connectionInterval = setInterval(retry, 5000); + } } } From cfded5d7ade0058f62db2284474d169edf3dc273 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Mon, 31 Jul 2023 14:15:52 +0200 Subject: [PATCH 02/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Contracts=20versio?= =?UTF-8?q?n=20is=20changed=20to=201.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 24 ++++++++++++-- examples/e2e-tests/package.json | 2 +- examples/manager/package.json | 2 +- examples/node/package.json | 2 +- packages/client/package.json | 2 +- packages/contracts-manger/package.json | 2 +- packages/db/package.json | 2 +- packages/messages/package.json | 2 +- packages/queue/package.json | 2 +- packages/test-utils/package.json | 2 +- packages/utils/package.json | 2 +- pnpm-lock.yaml | 44 +++++++++++++------------- 12 files changed, 54 insertions(+), 34 deletions(-) diff --git a/README.md b/README.md index 8f24b3f5..3eaca6eb 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,4 @@ -[![@windingtree/sdk](https://img.shields.io/npm/v/@windingtree/sdk)](https://www.npmjs.com/package/@windingtree/sdk) -[![Beta Release](https://github.com/windingtree/sdk/actions/workflows/release.yml/badge.svg?branch=beta)](https://github.com/windingtree/sdk/actions/workflows/release.yml) +[![Beta Release](https://github.com/windingtree/sdk/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/windingtree/sdk/actions/workflows/release.yml) # @windingtree/sdk @@ -7,6 +6,27 @@ The WindingTree market protocol SDK > To find the documentation of the SDK please follow the [https://windingtree.github.io/sdk](https://windingtree.github.io/sdk) +## Packages + +| Package | Description | Version | +|---|---|---| +| @windingtree/contracts | Smart contracts and utilities | [![@windingtree/contracts](https://img.shields.io/npm/v/@windingtree/contracts)](https://www.npmjs.com/package/@windingtree/contracts) | +| @windingtree/sdk-server | The protocol coordination server | [![@windingtree/sdk-server](https://img.shields.io/npm/v/@windingtree/sdk-server)](https://www.npmjs.com/package/@windingtree/sdk-server) | +| @windingtree/sdk-node | The protocol node | [![@windingtree/sdk-node](https://img.shields.io/npm/v/@windingtree/sdk-node)](https://www.npmjs.com/package/@windingtree/sdk-node) | +| @windingtree/sdk-node-api | The protocol node management API | [![@windingtree/sdk-node-api](https://img.shields.io/npm/v/@windingtree/sdk-node-api)](https://www.npmjs.com/package/@windingtree/sdk-node-api) | +| @windingtree/sdk-client | The protocol client | [![@windingtree/sdk-client](https://img.shields.io/npm/v/@windingtree/sdk-client)](https://www.npmjs.com/package/@windingtree/sdk-client) | +| @windingtree/sdk-react | React components and utilities | [![@windingtree/sdk-react](https://img.shields.io/npm/v/@windingtree/sdk-react)](https://www.npmjs.com/package/@windingtree/sdk-react) | +| @windingtree/sdk-constants | Constants | [![@windingtree/sdk-constants](https://img.shields.io/npm/v/@windingtree/sdk-constants)](https://www.npmjs.com/package/@windingtree/sdk-constants) | +| @windingtree/sdk-types | The SDK shared Typescript types | [![@windingtree/sdk-types](https://img.shields.io/npm/v/@windingtree/sdk-types)](https://www.npmjs.com/package/@windingtree/sdk-types) | +| @windingtree/sdk-utils | Shared utilities | [![@windingtree/sdk-utils](https://img.shields.io/npm/v/@windingtree/sdk-utils)](https://www.npmjs.com/package/@windingtree/sdk-utils) | +| @windingtree/sdk-test-utils | Test utilities | [![@windingtree/sdk-test-utils](https://img.shields.io/npm/v/@windingtree/sdk-test-utils)](https://www.npmjs.com/package/@windingtree/sdk-test-utils) | +| @windingtree/sdk-pubsub | The protocol pubsub service | [![@windingtree/sdk-pubsub](https://img.shields.io/npm/v/@windingtree/sdk-pubsub)](https://www.npmjs.com/package/@windingtree/sdk-pubsub) | +| @windingtree/sdk-contracts-manager | Smart contracts connection and management | [![@windingtree/sdk-contracts-manager](https://img.shields.io/npm/v/@windingtree/sdk-contracts-manager)](https://www.npmjs.com/package/@windingtree/sdk-contracts-manager) | +| @windingtree/sdk-messages | The protocol messages utilities | [![@windingtree/sdk-messages](https://img.shields.io/npm/v/@windingtree/sdk-messages)](https://www.npmjs.com/package/@windingtree/sdk-messages) | +| @windingtree/sdk-queue | Jobs queue | [![@windingtree/sdk-queue](https://img.shields.io/npm/v/@windingtree/sdk-queue)](https://www.npmjs.com/package/@windingtree/sdk-queue) | +| @windingtree/sdk-storage | Cross-platform storage layer | [![@windingtree/sdk-storage](https://img.shields.io/npm/v/@windingtree/sdk-storage)](https://www.npmjs.com/package/@windingtree/sdk-storage) | +| @windingtree/sdk-db | Databases tools | [![@windingtree/sdk-db](https://img.shields.io/npm/v/@windingtree/sdk-db)](https://www.npmjs.com/package/@windingtree/sdk-db) | +| @windingtree/sdk-logger | Logging utility | [![@windingtree/sdk-logger](https://img.shields.io/npm/v/@windingtree/sdk-logger)](https://www.npmjs.com/package/@windingtree/sdk-logger) | ## Setup > This repository uses [`pnpm` package manager](https://pnpm.io/installation). diff --git a/examples/e2e-tests/package.json b/examples/e2e-tests/package.json index 7c013892..521efb41 100644 --- a/examples/e2e-tests/package.json +++ b/examples/e2e-tests/package.json @@ -14,7 +14,7 @@ "license": "ISC", "devDependencies": { "@types/luxon": "3.3.1", - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", "@windingtree/sdk-client": "workspace:*", diff --git a/examples/manager/package.json b/examples/manager/package.json index 927d512e..b86dc78f 100644 --- a/examples/manager/package.json +++ b/examples/manager/package.json @@ -25,7 +25,7 @@ "luxon": "^3.3.0" }, "dependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", "superjson": "^1.13.1" diff --git a/examples/node/package.json b/examples/node/package.json index e7b5313d..3386b9c2 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -28,7 +28,7 @@ }, "dependencies": { "@libp2p/interfaces": "^3.3.2", - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-constants": "workspace:*", "@windingtree/sdk-contracts-manager": "workspace:*", "@windingtree/sdk-db": "workspace:*", diff --git a/packages/client/package.json b/packages/client/package.json index 13c0c8b6..c679228c 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -28,7 +28,7 @@ "access": "public" }, "devDependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-test-utils": "workspace:*" }, "dependencies": { diff --git a/packages/contracts-manger/package.json b/packages/contracts-manger/package.json index 7ee32ee3..304dfc18 100644 --- a/packages/contracts-manger/package.json +++ b/packages/contracts-manger/package.json @@ -28,7 +28,7 @@ "access": "public" }, "dependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-logger": "workspace:*", "@windingtree/sdk-types": "workspace:*", "superjson": "^1.13.1", diff --git a/packages/db/package.json b/packages/db/package.json index eb713c7e..8da7b336 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -48,7 +48,7 @@ "access": "public" }, "devDependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-messages": "workspace:*", "@windingtree/sdk-test-utils": "workspace:*", "@windingtree/sdk-utils": "workspace:*" diff --git a/packages/messages/package.json b/packages/messages/package.json index 9ca1ba7e..4a821253 100644 --- a/packages/messages/package.json +++ b/packages/messages/package.json @@ -31,7 +31,7 @@ "@windingtree/sdk-test-utils": "workspace:*" }, "dependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", "abitype": "^0.9.3", diff --git a/packages/queue/package.json b/packages/queue/package.json index e7130bd1..e637a155 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -29,7 +29,7 @@ }, "dependencies": { "@libp2p/interfaces": "^3.3.2", - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-logger": "workspace:*", "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-utils": "workspace:*" diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 00337cdb..63669b26 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -28,7 +28,7 @@ "access": "public" }, "dependencies": { - "@windingtree/contracts": "1.0.0-beta.12", + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-types": "workspace:*", "viem": "^1.3.0", "vitest": "^0.33.0" diff --git a/packages/utils/package.json b/packages/utils/package.json index 61bbd339..be1f65da 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -89,7 +89,7 @@ }, "devDependencies": { "@types/luxon": "^3.3.0", - "@windingtree/contracts": "1.0.0-beta.12" + "@windingtree/contracts": "^1.0.0" }, "dependencies": { "h3-js": "^4.1.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9d0e4e94..af1ac6aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -166,8 +166,8 @@ importers: specifier: 3.3.1 version: 3.3.1 '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-client': specifier: workspace:* version: link:../../packages/client @@ -217,8 +217,8 @@ importers: examples/manager: dependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-types': specifier: workspace:* version: link:../../packages/types @@ -293,8 +293,8 @@ importers: specifier: ^3.3.2 version: 3.3.2 '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-constants': specifier: workspace:* version: link:../../packages/constants @@ -430,8 +430,8 @@ importers: version: 1.3.0(typescript@5.1.6)(zod@3.21.4) devDependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-test-utils': specifier: workspace:* version: link:../test-utils @@ -441,8 +441,8 @@ importers: packages/contracts-manger: dependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-logger': specifier: workspace:* version: link:../logger @@ -478,8 +478,8 @@ importers: version: 3.21.4 devDependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-messages': specifier: workspace:* version: link:../messages @@ -503,8 +503,8 @@ importers: packages/messages: dependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-types': specifier: workspace:* version: link:../types @@ -677,8 +677,8 @@ importers: specifier: ^3.3.2 version: 3.3.2 '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-logger': specifier: workspace:* version: link:../logger @@ -785,8 +785,8 @@ importers: packages/test-utils: dependencies: '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-types': specifier: workspace:* version: link:../types @@ -819,8 +819,8 @@ importers: specifier: ^3.3.0 version: 3.3.0 '@windingtree/contracts': - specifier: 1.0.0-beta.12 - version: 1.0.0-beta.12 + specifier: ^1.0.0 + version: 1.0.0 packages: @@ -4584,8 +4584,8 @@ packages: dependencies: typescript: 5.1.6 - /@windingtree/contracts@1.0.0-beta.12: - resolution: {integrity: sha512-Ivh+y/nqwgH8QfbpSkDw/WVuXXjjJlJjuJe2npz9bapWiw3ow9xmYzaQWdN8o6CWLLcaPoksCuLuaI0gE/A+0g==} + /@windingtree/contracts@1.0.0: + resolution: {integrity: sha512-foRPGrAuxNwSsI0rAPgVi8dsOclVxEVCQ8HO8Oat+HUgOPGzsKi45+tUjXBEuECMeRNdhEOXLystheW65SsEaw==} /@yarnpkg/lockfile@1.1.0: resolution: {integrity: sha512-GpSwvyXOcOOlV70vbnzjj4fW5xW/FdUF6nQEt1ENy7m4ZCczi1+/buVUPAqmGfqznsORNFzUMjctTIp8a9tuCQ==} From 738a6b6cd5894a6b3fccb71978cd12beec039fcd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 31 Jul 2023 12:36:16 +0000 Subject: [PATCH 03/21] Publish - @windingtree/sdk-client@1.2.0-beta.0 - @windingtree/sdk-contracts-manager@1.2.0-beta.0 - @windingtree/sdk-db@1.2.0-beta.0 - @windingtree/sdk-messages@1.2.0-beta.0 - @windingtree/sdk-node@1.1.1-beta.0 - @windingtree/sdk-node-api@1.1.1-beta.0 - @windingtree/sdk-pubsub@1.1.1-beta.0 - @windingtree/sdk-queue@1.2.0-beta.0 - @windingtree/sdk-react@1.1.1-beta.0 - @windingtree/sdk-server@1.1.1-beta.0 - @windingtree/sdk-test-utils@1.2.0-beta.0 - @windingtree/sdk-utils@1.2.0-beta.0 --- packages/client/CHANGELOG.md | 11 +++++++++++ packages/client/package.json | 2 +- packages/contracts-manger/CHANGELOG.md | 11 +++++++++++ packages/contracts-manger/package.json | 2 +- packages/db/CHANGELOG.md | 11 +++++++++++ packages/db/package.json | 2 +- packages/messages/CHANGELOG.md | 11 +++++++++++ packages/messages/package.json | 2 +- packages/node-api/CHANGELOG.md | 8 ++++++++ packages/node-api/package.json | 2 +- packages/node/CHANGELOG.md | 8 ++++++++ packages/node/package.json | 2 +- packages/pubsub/CHANGELOG.md | 8 ++++++++ packages/pubsub/package.json | 2 +- packages/queue/CHANGELOG.md | 11 +++++++++++ packages/queue/package.json | 2 +- packages/react/CHANGELOG.md | 8 ++++++++ packages/react/package.json | 2 +- packages/server/CHANGELOG.md | 8 ++++++++ packages/server/package.json | 2 +- packages/test-utils/CHANGELOG.md | 11 +++++++++++ packages/test-utils/package.json | 2 +- packages/utils/CHANGELOG.md | 11 +++++++++++ packages/utils/package.json | 2 +- 24 files changed, 129 insertions(+), 12 deletions(-) diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 12331387..bef62ef6 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0...@windingtree/sdk-client@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0-beta.3...@windingtree/sdk-client@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-client diff --git a/packages/client/package.json b/packages/client/package.json index c679228c..f0b1baf5 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-client", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "The WindingTree market protocol client", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/contracts-manger/CHANGELOG.md b/packages/contracts-manger/CHANGELOG.md index 1bcd8fac..79bbd4d2 100644 --- a/packages/contracts-manger/CHANGELOG.md +++ b/packages/contracts-manger/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0...@windingtree/sdk-contracts-manager@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0-beta.3...@windingtree/sdk-contracts-manager@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-contracts-manager diff --git a/packages/contracts-manger/package.json b/packages/contracts-manger/package.json index 304dfc18..a45a7eb5 100644 --- a/packages/contracts-manger/package.json +++ b/packages/contracts-manger/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-contracts-manager", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Utility class for interaction with the protocol smart contracts", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 220eab3c..8cd5bbfe 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0...@windingtree/sdk-db@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0-beta.3...@windingtree/sdk-db@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-db diff --git a/packages/db/package.json b/packages/db/package.json index 8da7b336..258b76d7 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-db", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Databases for the WindingTree market protocol", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/messages/CHANGELOG.md b/packages/messages/CHANGELOG.md index fe7ca10c..ad1e0e15 100644 --- a/packages/messages/CHANGELOG.md +++ b/packages/messages/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0...@windingtree/sdk-messages@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0-beta.3...@windingtree/sdk-messages@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-messages diff --git a/packages/messages/package.json b/packages/messages/package.json index 4a821253..64349184 100644 --- a/packages/messages/package.json +++ b/packages/messages/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-messages", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "The WindingTree market protocol messages utilities", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/node-api/CHANGELOG.md b/packages/node-api/CHANGELOG.md index bf673d64..79db6486 100644 --- a/packages/node-api/CHANGELOG.md +++ b/packages/node-api/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0...@windingtree/sdk-node-api@1.1.1-beta.0) (2023-07-31) + +**Note:** Version bump only for package @windingtree/sdk-node-api + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0-beta.3...@windingtree/sdk-node-api@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node-api diff --git a/packages/node-api/package.json b/packages/node-api/package.json index 761ee949..6dea719c 100644 --- a/packages/node-api/package.json +++ b/packages/node-api/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-node-api", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "The WindingTree market protocol node API server and client", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index d5d41cb3..fed2b320 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0...@windingtree/sdk-node@1.1.1-beta.0) (2023-07-31) + +**Note:** Version bump only for package @windingtree/sdk-node + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0-beta.3...@windingtree/sdk-node@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node diff --git a/packages/node/package.json b/packages/node/package.json index 409c8c10..b4014f05 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-node", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "The WindingTree market protocol node", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index 009fc867..918528d4 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0...@windingtree/sdk-pubsub@1.1.1-beta.0) (2023-07-31) + +**Note:** Version bump only for package @windingtree/sdk-pubsub + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0-beta.3...@windingtree/sdk-pubsub@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-pubsub diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 67d9c558..bc8151a7 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-pubsub", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "libp2p PubSub protocol implementation for the WindingTree market protocol", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/queue/CHANGELOG.md b/packages/queue/CHANGELOG.md index 3db006d0..05cab0d6 100644 --- a/packages/queue/CHANGELOG.md +++ b/packages/queue/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0...@windingtree/sdk-queue@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0-beta.3...@windingtree/sdk-queue@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-queue diff --git a/packages/queue/package.json b/packages/queue/package.json index e637a155..07750256 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-queue", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Jobs queue", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 83946fd1..51e0b821 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0...@windingtree/sdk-react@1.1.1-beta.0) (2023-07-31) + +**Note:** Version bump only for package @windingtree/sdk-react + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0-beta.3...@windingtree/sdk-react@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-react diff --git a/packages/react/package.json b/packages/react/package.json index a5391acb..52f76e40 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-react", - "version": "1.1.0", + "version": "1.1.1-beta.0", "publishConfig": { "access": "public" }, diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index 9026fe69..6f39f22e 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0...@windingtree/sdk-server@1.1.1-beta.0) (2023-07-31) + +**Note:** Version bump only for package @windingtree/sdk-server + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0-beta.3...@windingtree/sdk-server@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-server diff --git a/packages/server/package.json b/packages/server/package.json index e574e6f8..5a1bde4c 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-server", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "The WindingTree market protocol server", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index 773c5978..4cce06f4 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0...@windingtree/sdk-test-utils@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0-beta.3...@windingtree/sdk-test-utils@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-test-utils diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 63669b26..51b129b9 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-test-utils", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Testing utilities for the Windingtree market protocol SDK", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 01ac25fc..16994dab 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0...@windingtree/sdk-utils@1.2.0-beta.0) (2023-07-31) + + +### Features + +* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0-beta.3...@windingtree/sdk-utils@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-utils diff --git a/packages/utils/package.json b/packages/utils/package.json index be1f65da..e5b5c4d4 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-utils", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Utility class for interaction with the protocol smart contracts", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", From 31b24aa83a3313cfa88e99790399bc814f1197a1 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Mon, 31 Jul 2023 15:42:33 +0200 Subject: [PATCH 04/21] =?UTF-8?q?ci:=20=F0=9F=8E=A1=20Added=20branch-depen?= =?UTF-8?q?ded=20npm=20publishing=20dist-tag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/release.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 42ce9326..adb59601 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -45,6 +45,11 @@ jobs: env: GH_TOKEN: ${{ secrets.PAT }} - name: Publish to npm - run: pnpm lerna publish from-package + run: | + if [[ "${{ github.ref }}" == "refs/heads/master" ]]; then + pnpm lerna publish from-package --dist-tag latest + elif [[ "${{ github.ref }}" == "refs/heads/beta" ]]; then + pnpm lerna publish from-package --dist-tag beta + fi env: NPM_TOKEN: ${{ secrets.NPM_TOKEN }} From 6a4e98c59c7d178454702225151a3717daeb2c4a Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Mon, 31 Jul 2023 16:06:29 +0200 Subject: [PATCH 05/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Prettier=20fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/client/CHANGELOG.md | 19 +------------------ packages/constants/CHANGELOG.md | 12 ------------ packages/contracts-manger/CHANGELOG.md | 19 +------------------ packages/db/CHANGELOG.md | 19 +------------------ packages/logger/CHANGELOG.md | 12 ------------ packages/messages/CHANGELOG.md | 19 +------------------ packages/node-api/CHANGELOG.md | 16 ---------------- packages/node/CHANGELOG.md | 16 ---------------- packages/pubsub/CHANGELOG.md | 16 ---------------- packages/queue/CHANGELOG.md | 19 +------------------ packages/server/CHANGELOG.md | 16 ---------------- packages/storage/CHANGELOG.md | 12 ------------ packages/test-utils/CHANGELOG.md | 19 +------------------ packages/types/CHANGELOG.md | 12 ------------ packages/utils/CHANGELOG.md | 19 +------------------ 15 files changed, 7 insertions(+), 238 deletions(-) diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index bef62ef6..7bb2ed83 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0...@windingtree/sdk-client@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0-beta.3...@windingtree/sdk-client@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-client - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0-beta.2...@windingtree/sdk-client@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-client - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0-beta.1...@windingtree/sdk-client@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-client - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0-beta.0...@windingtree/sdk-client@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-client diff --git a/packages/constants/CHANGELOG.md b/packages/constants/CHANGELOG.md index 29f8225f..60770fbf 100644 --- a/packages/constants/CHANGELOG.md +++ b/packages/constants/CHANGELOG.md @@ -7,26 +7,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-constants - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.1.0-beta.2...@windingtree/sdk-constants@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-constants - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.1.0-beta.1...@windingtree/sdk-constants@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-constants - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.1.0-beta.0...@windingtree/sdk-constants@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-constants diff --git a/packages/contracts-manger/CHANGELOG.md b/packages/contracts-manger/CHANGELOG.md index 79bbd4d2..ec483c79 100644 --- a/packages/contracts-manger/CHANGELOG.md +++ b/packages/contracts-manger/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0...@windingtree/sdk-contracts-manager@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0-beta.3...@windingtree/sdk-contracts-manager@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-contracts-manager - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0-beta.2...@windingtree/sdk-contracts-manager@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-contracts-manager - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0-beta.1...@windingtree/sdk-contracts-manager@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-contracts-manager - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0-beta.0...@windingtree/sdk-contracts-manager@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-contracts-manager diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 8cd5bbfe..4a37c833 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0...@windingtree/sdk-db@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0-beta.3...@windingtree/sdk-db@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-db - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0-beta.2...@windingtree/sdk-db@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-db - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0-beta.1...@windingtree/sdk-db@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-db - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0-beta.0...@windingtree/sdk-db@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-db diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index 69bf357f..a6485358 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -7,26 +7,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-logger - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-logger@1.1.0-beta.2...@windingtree/sdk-logger@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-logger - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-logger@1.1.0-beta.1...@windingtree/sdk-logger@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-logger - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-logger@1.1.0-beta.0...@windingtree/sdk-logger@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-logger diff --git a/packages/messages/CHANGELOG.md b/packages/messages/CHANGELOG.md index ad1e0e15..0912d068 100644 --- a/packages/messages/CHANGELOG.md +++ b/packages/messages/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0...@windingtree/sdk-messages@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0-beta.3...@windingtree/sdk-messages@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-messages - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0-beta.2...@windingtree/sdk-messages@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-messages - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0-beta.1...@windingtree/sdk-messages@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-messages - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0-beta.0...@windingtree/sdk-messages@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-messages diff --git a/packages/node-api/CHANGELOG.md b/packages/node-api/CHANGELOG.md index 79db6486..73390cba 100644 --- a/packages/node-api/CHANGELOG.md +++ b/packages/node-api/CHANGELOG.md @@ -7,34 +7,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-node-api - - - - # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0-beta.3...@windingtree/sdk-node-api@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node-api - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0-beta.2...@windingtree/sdk-node-api@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node-api - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0-beta.1...@windingtree/sdk-node-api@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node-api - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0-beta.0...@windingtree/sdk-node-api@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-node-api diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index fed2b320..abc73ff7 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -7,34 +7,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-node - - - - # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0-beta.3...@windingtree/sdk-node@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0-beta.2...@windingtree/sdk-node@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0-beta.1...@windingtree/sdk-node@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-node - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0-beta.0...@windingtree/sdk-node@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-node diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index 918528d4..b096e109 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -7,34 +7,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-pubsub - - - - # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0-beta.3...@windingtree/sdk-pubsub@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-pubsub - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0-beta.2...@windingtree/sdk-pubsub@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-pubsub - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0-beta.1...@windingtree/sdk-pubsub@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-pubsub - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0-beta.0...@windingtree/sdk-pubsub@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-pubsub diff --git a/packages/queue/CHANGELOG.md b/packages/queue/CHANGELOG.md index 05cab0d6..1c9c0127 100644 --- a/packages/queue/CHANGELOG.md +++ b/packages/queue/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0...@windingtree/sdk-queue@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0-beta.3...@windingtree/sdk-queue@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-queue - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0-beta.2...@windingtree/sdk-queue@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-queue - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0-beta.1...@windingtree/sdk-queue@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-queue - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0-beta.0...@windingtree/sdk-queue@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-queue diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index 6f39f22e..8c246717 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -7,34 +7,18 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-server - - - - # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0-beta.3...@windingtree/sdk-server@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-server - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0-beta.2...@windingtree/sdk-server@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-server - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0-beta.1...@windingtree/sdk-server@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-server - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0-beta.0...@windingtree/sdk-server@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-server diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 4e815dca..64436bed 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -7,26 +7,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-storage - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-storage@1.1.0-beta.2...@windingtree/sdk-storage@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-storage - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-storage@1.1.0-beta.1...@windingtree/sdk-storage@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-storage - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-storage@1.1.0-beta.0...@windingtree/sdk-storage@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-storage diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index 4cce06f4..53a69ef8 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0...@windingtree/sdk-test-utils@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0-beta.3...@windingtree/sdk-test-utils@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-test-utils - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0-beta.2...@windingtree/sdk-test-utils@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-test-utils - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0-beta.1...@windingtree/sdk-test-utils@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-test-utils - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0-beta.0...@windingtree/sdk-test-utils@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-test-utils diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index 99282f70..b90e76b7 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -7,26 +7,14 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-types - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-types@1.1.0-beta.2...@windingtree/sdk-types@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-types - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-types@1.1.0-beta.1...@windingtree/sdk-types@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-types - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-types@1.1.0-beta.0...@windingtree/sdk-types@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-types diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 16994dab..91f634c3 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -5,39 +5,22 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0...@windingtree/sdk-utils@1.2.0-beta.0) (2023-07-31) - ### Features -* 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) - - - - +- 🎸 Contracts version is changed to 1.0.0 ([cfded5d](https://github.com/windingtree/sdk/commit/cfded5d7ade0058f62db2284474d169edf3dc273)) # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0-beta.3...@windingtree/sdk-utils@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-utils - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0-beta.2...@windingtree/sdk-utils@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-utils - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0-beta.1...@windingtree/sdk-utils@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-utils - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0-beta.0...@windingtree/sdk-utils@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-utils From 90009e2c20ef8b9a472cb3d5978b844280e928fc Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 3 Aug 2023 23:16:22 +0600 Subject: [PATCH 06/21] feat: move renew subscribe flow to request manager move interval check in heartbeat --- examples/client/src/App.tsx | 10 +--------- packages/client/src/index.ts | 6 ++---- packages/client/src/requestsManager.ts | 12 ++++++++++++ packages/node/src/index.ts | 6 ++---- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/examples/client/src/App.tsx b/examples/client/src/App.tsx index 426c137b..31c6d34b 100644 --- a/examples/client/src/App.tsx +++ b/examples/client/src/App.tsx @@ -24,7 +24,6 @@ import { Requests, RequestsRegistryRecord } from './components/Requests.js'; import { MakeDeal } from './components/MakeDeal.js'; import { Offers } from './components/Offers.js'; import { Deals, DealsRegistryRecord } from './components/Deals.js'; -import { isExpired } from '@windingtree/sdk-utils'; /** Target chain config */ const chain = @@ -92,14 +91,7 @@ export const App = () => { new Date().toISOString(), ); - const requests = requestsManager.current?.getAll(); - const requestIds = requests - ?.filter( - (requests: ClientRequestRecord) => !isExpired(requests.data.expire), - ) - .map((request: ClientRequestRecord) => request.data.id); - - requestIds?.forEach((id: string) => client.current?.subscribe(id)); + requestsManager.current?.refreshSubscriptions(); }; const onClientDisconnected = () => { diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index 4d6517c7..e1e03b26 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -240,7 +240,7 @@ export class Client< () => { this.dispatchEvent(new CustomEvent('heartbeat')); - if (!this.serverConnected) { + if (!this.serverConnected && !this.connectionInterval) { this.retryConnection(); } }, @@ -402,9 +402,7 @@ export class Client< }); }.bind(this); - if (!this.connectionInterval) { - this.connectionInterval = setInterval(retry, 5000); - } + this.connectionInterval = setInterval(retry, 5000); } } diff --git a/packages/client/src/requestsManager.ts b/packages/client/src/requestsManager.ts index e6f03817..e71dd9fc 100644 --- a/packages/client/src/requestsManager.ts +++ b/packages/client/src/requestsManager.ts @@ -512,4 +512,16 @@ export class ClientRequestsManager< }), ); } + + refreshSubscriptions() { + const requestIds = this.getAll().filter( + (requestRecord) => + requestRecord.subscribed && !isExpired(requestRecord.data.expire), + ); + + requestIds.forEach((requestRecord) => { + requestRecord.subscribed = false; + this._subscribe(requestRecord); + }); + } } diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index 17a74259..b48b2e28 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -361,7 +361,7 @@ export class Node< () => { this.dispatchEvent(new CustomEvent('heartbeat')); - if (!this.serverConnected) { + if (!this.serverConnected && !this.connectionInterval) { this.retryConnection(); } }, @@ -476,9 +476,7 @@ export class Node< }); }.bind(this); - if (!this.connectionInterval) { - this.connectionInterval = setInterval(retry, 5000); - } + this.connectionInterval = setInterval(retry, 5000); } } From ab77a45712c9dd7ce98ff4fccdea56cf1682137d Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 3 Aug 2023 23:39:52 +0600 Subject: [PATCH 07/21] feat: add force param to subscribe method in requests manager --- packages/client/src/requestsManager.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/client/src/requestsManager.ts b/packages/client/src/requestsManager.ts index e71dd9fc..9186e851 100644 --- a/packages/client/src/requestsManager.ts +++ b/packages/client/src/requestsManager.ts @@ -286,13 +286,15 @@ export class ClientRequestsManager< * * @private * @param {ClientRequestRecord} record Request record + * @param {boolean} force * @returns {ClientRequestRecord} * @memberof ClientRequestsManager */ private _subscribe( record: ClientRequestRecord, + force: boolean = false, ): ClientRequestRecord { - if (!isExpired(record.data.expire) && !record.subscribed) { + if ((!isExpired(record.data.expire) && !record.subscribed) || force) { const subscribedRecord = { ...record, subscribed: true, @@ -520,8 +522,7 @@ export class ClientRequestsManager< ); requestIds.forEach((requestRecord) => { - requestRecord.subscribed = false; - this._subscribe(requestRecord); + this._subscribe(requestRecord, true); }); } } From b5f24b879b6752654325e385841c4061d952a419 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 12:31:29 +0200 Subject: [PATCH 08/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Added=20providers?= =?UTF-8?q?=20for=20client=20and=20requestsManager?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react/CHANGELOG.md | 25 +-------- packages/react/README.md | 13 ++++- packages/react/package.json | 5 +- .../ClientProvider/ClientProviderContext.ts | 21 ++++++++ .../src/providers/ClientProvider/index.tsx | 35 +++++++++++++ .../src/providers/ConfigProvider/index.tsx | 6 +-- .../src/providers/ContractsProvider/index.tsx | 9 ++-- .../src/providers/NodeProvider/index.tsx | 13 +++-- .../RequestsManagerProviderContext.ts | 23 ++++++++ .../RequestsManagerProvider/index.tsx | 52 +++++++++++++++++++ .../src/providers/WalletProvider/index.tsx | 5 +- packages/react/src/providers/index.ts | 3 ++ pnpm-lock.yaml | 6 +++ 13 files changed, 178 insertions(+), 38 deletions(-) create mode 100644 packages/react/src/providers/ClientProvider/ClientProviderContext.ts create mode 100644 packages/react/src/providers/ClientProvider/index.tsx create mode 100644 packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts create mode 100644 packages/react/src/providers/RequestsManagerProvider/index.tsx diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 51e0b821..3b743e76 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -7,46 +7,25 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline **Note:** Version bump only for package @windingtree/sdk-react - - - - # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0-beta.3...@windingtree/sdk-react@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-react - - - - # [1.1.0-beta.3](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0-beta.2...@windingtree/sdk-react@1.1.0-beta.3) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-react - - - - # [1.1.0-beta.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0-beta.1...@windingtree/sdk-react@1.1.0-beta.2) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-react - - - - # [1.1.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0-beta.0...@windingtree/sdk-react@1.1.0-beta.1) (2023-07-23) **Note:** Version bump only for package @windingtree/sdk-react - - - - # 1.1.0-beta.0 (2023-07-23) - ### Features -* 🎸 Added release workflow script ([1d7b84a](https://github.com/windingtree/sdk/commit/1d7b84a3623848c449522c0bb2af2c5f114c8a0a)) -* 🎸 NodeProvider and ConfigProvider are added to sdk-react ([963e087](https://github.com/windingtree/sdk/commit/963e0876dacd11c28610d31471fa0686634fc416)) +- 🎸 Added release workflow script ([1d7b84a](https://github.com/windingtree/sdk/commit/1d7b84a3623848c449522c0bb2af2c5f114c8a0a)) +- 🎸 NodeProvider and ConfigProvider are added to sdk-react ([963e087](https://github.com/windingtree/sdk/commit/963e0876dacd11c28610d31471fa0686634fc416)) diff --git a/packages/react/README.md b/packages/react/README.md index 39b7dff6..113a4e06 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -27,7 +27,12 @@ The providers can be imported directly from the package: import { createRoot } from 'react-dom/client'; import { Hash } from 'viem'; import { App } from './App.js'; -import { ConfigProvider, NodeProvider, WalletProvider, ContractsProvider } from '@windingtree/sdk-react/providers'; +import { + ConfigProvider, + NodeProvider, + WalletProvider, + ContractsProvider, +} from '@windingtree/sdk-react/providers'; import { polygonZkEvmTestnet } from 'viem/chains'; import { contractsConfig } from 'wtmp-examples-shared-files/dist/index.js'; @@ -48,7 +53,11 @@ root.render( Then these providers can be used inside components: ```typescript -import { useConfig, useNode, useWallet } from '@windingtree/sdk-react/providers'; +import { + useConfig, + useNode, + useWallet, +} from '@windingtree/sdk-react/providers'; export const Widget = () => { const { isAuth, login, setAuth, resetAuth } = useConfig(); diff --git a/packages/react/package.json b/packages/react/package.json index 52f76e40..fbabfccb 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -50,6 +50,8 @@ "@vitejs/plugin-react": "^4.0.3", "@windingtree/sdk-contracts-manager": "workspace:*", "@windingtree/sdk-node-api": "workspace:*", + "@windingtree/sdk-client": "workspace:*", + "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-types": "workspace:*", "eslint": "^8.45.0", "eslint-config-react-app": "^7.0.1", @@ -78,6 +80,7 @@ }, "scripts": { "build": "vite build", - "lint": "eslint . --ext .ts" + "lint": "eslint . --ext .ts", + "lint:fix": "eslint . --ext .ts --ignore-path ../../.lintignore --fix && prettier --ignore-path ../../.lintignore --write ." } } diff --git a/packages/react/src/providers/ClientProvider/ClientProviderContext.ts b/packages/react/src/providers/ClientProvider/ClientProviderContext.ts new file mode 100644 index 00000000..2308fdc7 --- /dev/null +++ b/packages/react/src/providers/ClientProvider/ClientProviderContext.ts @@ -0,0 +1,21 @@ +import { createContext, useContext } from 'react'; +import { Client } from '@windingtree/sdk-client'; + +export interface ClientContextData { + client: Client; + clientConnected: boolean; +} + +export const ClientContext = createContext( + {} as ClientContextData, +); + +export const useClient = () => { + const context = useContext(ClientContext); + + if (context === undefined) { + throw new Error('useClient must be used within a "ClientContext"'); + } + + return context; +}; diff --git a/packages/react/src/providers/ClientProvider/index.tsx b/packages/react/src/providers/ClientProvider/index.tsx new file mode 100644 index 00000000..850acdca --- /dev/null +++ b/packages/react/src/providers/ClientProvider/index.tsx @@ -0,0 +1,35 @@ +import { PropsWithChildren, useMemo } from 'react'; +import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; +import { createClient } from '@windingtree/sdk-client'; +import { ClientContext } from './ClientProviderContext.js'; + +export interface ClientProvideProps extends PropsWithChildren { + serverAddress: string; +} + +export const ClientProvider = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +>({ + children, + serverAddress, +}: ClientProvideProps) => { + const client = useMemo( + () => + createClient({ + serverAddress, + }), + [serverAddress], + ); + + return ( + + {children} + + ); +}; diff --git a/packages/react/src/providers/ConfigProvider/index.tsx b/packages/react/src/providers/ConfigProvider/index.tsx index b92c6243..e52c808f 100644 --- a/packages/react/src/providers/ConfigProvider/index.tsx +++ b/packages/react/src/providers/ConfigProvider/index.tsx @@ -60,14 +60,14 @@ export const ConfigProvider = ({ children }: PropsWithChildren) => { setConfig({ type: ConfigActions.SET_CONFIG, payload: { login }, - }) + }); }, []); const resetAuth = useCallback(() => { setConfig({ type: ConfigActions.SET_CONFIG, - payload: { login: undefined, }, - }) + payload: { login: undefined }, + }); }, []); useEffect(() => { diff --git a/packages/react/src/providers/ContractsProvider/index.tsx b/packages/react/src/providers/ContractsProvider/index.tsx index fe22cbfb..cbc1444e 100644 --- a/packages/react/src/providers/ContractsProvider/index.tsx +++ b/packages/react/src/providers/ContractsProvider/index.tsx @@ -8,7 +8,10 @@ export interface ContractProviderProps extends PropsWithChildren { contractsConfig: Contracts; } -export const ContractsProvider = ({ contractsConfig, children }: ContractProviderProps) => { +export const ContractsProvider = ({ + contractsConfig, + children, +}: ContractProviderProps) => { const { publicClient, walletClient } = useWallet(); const [contracts, setContracts] = useState(); @@ -18,7 +21,7 @@ export const ContractsProvider = ({ contractsConfig, children }: ContractProvide contracts: contractsConfig, publicClient, walletClient, - }) + }), ); return () => setContracts(undefined); @@ -27,7 +30,7 @@ export const ContractsProvider = ({ contractsConfig, children }: ContractProvide return ( {children} diff --git a/packages/react/src/providers/NodeProvider/index.tsx b/packages/react/src/providers/NodeProvider/index.tsx index 877c12d4..4a0950d9 100644 --- a/packages/react/src/providers/NodeProvider/index.tsx +++ b/packages/react/src/providers/NodeProvider/index.tsx @@ -1,4 +1,8 @@ -import { CreateTRPCClientOptions, createTRPCProxyClient, httpBatchLink } from '@trpc/client'; +import { + CreateTRPCClientOptions, + createTRPCProxyClient, + httpBatchLink, +} from '@trpc/client'; import superjson from 'superjson'; import { PropsWithChildren, useState, useEffect } from 'react'; import { NodeContext } from './NodeProviderContext.js'; @@ -33,7 +37,8 @@ export const NodeProvider = ({ children }: PropsWithChildren) => { setError(undefined); const tRpcNode = createTRPCProxyClient({ - transformer: superjson as unknown as CreateTRPCClientOptions['transformer'], + transformer: + superjson as unknown as CreateTRPCClientOptions['transformer'], links: [ unauthorizedLink(resetAuth), httpBatchLink({ @@ -63,9 +68,7 @@ export const NodeProvider = ({ children }: PropsWithChildren) => { errMessage = 'Node connection failed'; } - setError( - () => errMessage || 'Unknown node provider error', - ); + setError(() => errMessage || 'Unknown node provider error'); } }; diff --git a/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts b/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts new file mode 100644 index 00000000..ac6a7693 --- /dev/null +++ b/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts @@ -0,0 +1,23 @@ +import { createContext, useContext } from 'react'; +import { ClientRequestsManager } from '@windingtree/sdk-client'; + +export interface RequestsManagerProviderContextData { + requestManager?: ClientRequestsManager; +} + +export const RequestsManagerContext = + createContext( + {} as RequestsManagerProviderContextData, + ); + +export const useRequestsManager = () => { + const context = useContext(RequestsManagerContext); + + if (context === undefined) { + throw new Error( + 'useRequestsManager must be used within a "RequestsManagerContext"', + ); + } + + return context; +}; diff --git a/packages/react/src/providers/RequestsManagerProvider/index.tsx b/packages/react/src/providers/RequestsManagerProvider/index.tsx new file mode 100644 index 00000000..7313ee51 --- /dev/null +++ b/packages/react/src/providers/RequestsManagerProvider/index.tsx @@ -0,0 +1,52 @@ +import { PropsWithChildren, useEffect, useState } from 'react'; +import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; +import { Storage, StorageInitializer } from '@windingtree/sdk-storage'; +import { ClientRequestsManager } from '@windingtree/sdk-client'; +import { RequestsManagerContext } from './RequestsManagerProviderContext.js'; + +export interface RequestsManagerProvideProps< + CustomStorage extends Storage = Storage, +> extends PropsWithChildren { + storageInitializer: StorageInitializer; + prefix: string; +} + +export const RequestsManagerProvider = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, + CustomStorage extends Storage = Storage, +>({ + children, + storageInitializer, + prefix, +}: RequestsManagerProvideProps) => { + const [requestManager, setRequestManager] = useState< + ClientRequestsManager | undefined + >(); + + useEffect(() => { + const startManager = async () => { + const storage = await storageInitializer(); + + setRequestManager( + () => + new ClientRequestsManager({ + storage, + prefix, + }), + ); + }; + + startManager().catch(console.error); + }, [storageInitializer, prefix]); + + return ( + + {children} + + ); +}; diff --git a/packages/react/src/providers/WalletProvider/index.tsx b/packages/react/src/providers/WalletProvider/index.tsx index badbafe1..b39b5b78 100644 --- a/packages/react/src/providers/WalletProvider/index.tsx +++ b/packages/react/src/providers/WalletProvider/index.tsx @@ -22,7 +22,10 @@ export interface WalletProviderProps extends PropsWithChildren { targetChain: Chain; } -export const WalletProvider = ({ targetChain, children }: WalletProviderProps) => { +export const WalletProvider = ({ + targetChain, + children, +}: WalletProviderProps) => { const [walletClient, setWalletClient] = useState(); const [chainId, setChainId] = useState(); const [account, setAccount] = useState
(); diff --git a/packages/react/src/providers/index.ts b/packages/react/src/providers/index.ts index 2ebc99c7..5ae0223d 100644 --- a/packages/react/src/providers/index.ts +++ b/packages/react/src/providers/index.ts @@ -12,3 +12,6 @@ export * from './NodeProvider/index.js'; export * from './ConfigProvider/ConfigProviderContext.js'; export * from './ConfigProvider/index.js'; + +export * from './ClientProvider/ClientProviderContext.js'; +export * from './ClientProvider/index.js'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index af1ac6aa..b0ead43b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -703,12 +703,18 @@ importers: '@vitejs/plugin-react': specifier: ^4.0.3 version: 4.0.3(vite@4.4.4) + '@windingtree/sdk-client': + specifier: workspace:* + version: link:../client '@windingtree/sdk-contracts-manager': specifier: workspace:* version: link:../contracts-manger '@windingtree/sdk-node-api': specifier: workspace:* version: link:../node-api + '@windingtree/sdk-storage': + specifier: workspace:* + version: link:../storage '@windingtree/sdk-types': specifier: workspace:* version: link:../types From ac1129f5d1c45c9f93336718d59bfbe4c7bb60fc Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 15:01:24 +0200 Subject: [PATCH 09/21] =?UTF-8?q?feat:=20=F0=9F=8E=B8=20Added=20DealsManag?= =?UTF-8?q?erProvider=20to=20the=20react=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DealsManagerProviderContext.ts | 30 ++++++++ .../providers/DealsManagerProvider/index.tsx | 76 +++++++++++++++++++ 2 files changed, 106 insertions(+) create mode 100644 packages/react/src/providers/DealsManagerProvider/DealsManagerProviderContext.ts create mode 100644 packages/react/src/providers/DealsManagerProvider/index.tsx diff --git a/packages/react/src/providers/DealsManagerProvider/DealsManagerProviderContext.ts b/packages/react/src/providers/DealsManagerProvider/DealsManagerProviderContext.ts new file mode 100644 index 00000000..2a7b0953 --- /dev/null +++ b/packages/react/src/providers/DealsManagerProvider/DealsManagerProviderContext.ts @@ -0,0 +1,30 @@ +import { createContext, useContext } from 'react'; +import { ClientDealsManager } from '@windingtree/sdk-client'; +import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; + +export interface DealsManagerProviderContextData< + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +> { + dealsManager?: ClientDealsManager; +} + +export const DealsManagerContext = createContext({}); + +export const useDealsManager = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +>() => { + const context = + useContext>( + DealsManagerContext, + ); + + if (context === undefined) { + throw new Error( + 'useDealsManager must be used within a "DealsManagerContext"', + ); + } + + return context; +}; diff --git a/packages/react/src/providers/DealsManagerProvider/index.tsx b/packages/react/src/providers/DealsManagerProvider/index.tsx new file mode 100644 index 00000000..63634686 --- /dev/null +++ b/packages/react/src/providers/DealsManagerProvider/index.tsx @@ -0,0 +1,76 @@ +import { PropsWithChildren, useEffect, useState } from 'react'; +import { Chain } from 'viem/chains'; +import { + GenericQuery, + GenericOfferOptions, + Contracts, +} from '@windingtree/sdk-types'; +import { Storage, StorageInitializer } from '@windingtree/sdk-storage'; +import { ClientDealsManager } from '@windingtree/sdk-client'; +import { useWallet } from '../WalletProvider/WalletProviderContext.js'; +import { DealsManagerContext } from './DealsManagerProviderContext.js'; + +export interface DealsManagerProvideProps< + CustomStorage extends Storage = Storage, +> extends PropsWithChildren { + storageInitializer: StorageInitializer; + prefix: string; + checkInterval: string | number; + chain: Chain; + contracts: Contracts; +} + +export const DealsManagerProvider = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, + CustomStorage extends Storage = Storage, +>({ + children, + storageInitializer, + prefix, + checkInterval, + chain, + contracts, +}: DealsManagerProvideProps) => { + const { publicClient } = useWallet(); + const [dealsManager, setDealsManager] = useState< + ClientDealsManager | undefined + >(); + + useEffect(() => { + const startManager = async () => { + const storage = await storageInitializer(); + + setDealsManager( + () => + new ClientDealsManager({ + storage, + prefix, + checkInterval, + chain, + contracts, + publicClient, + }), + ); + }; + + startManager().catch(console.error); + }, [ + storageInitializer, + prefix, + checkInterval, + chain, + contracts, + publicClient, + ]); + + return ( + + {children} + + ); +}; From e81592814ae7ec729f0491712ab0b24b9cbf644c Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 15:03:55 +0200 Subject: [PATCH 10/21] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Added=20custom?= =?UTF-8?q?=20typing=20to=20the=20RequestsManagerProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../RequestsManagerProviderContext.ts | 22 ++++++++++++------- .../RequestsManagerProvider/index.tsx | 6 ++--- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts b/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts index ac6a7693..9a0d2c54 100644 --- a/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts +++ b/packages/react/src/providers/RequestsManagerProvider/RequestsManagerProviderContext.ts @@ -1,17 +1,23 @@ import { createContext, useContext } from 'react'; import { ClientRequestsManager } from '@windingtree/sdk-client'; +import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; -export interface RequestsManagerProviderContextData { - requestManager?: ClientRequestsManager; +export interface RequestsManagerProviderContextData< + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +> { + requestsManager?: ClientRequestsManager; } -export const RequestsManagerContext = - createContext( - {} as RequestsManagerProviderContextData, - ); +export const RequestsManagerContext = createContext({}); -export const useRequestsManager = () => { - const context = useContext(RequestsManagerContext); +export const useRequestsManager = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +>() => { + const context = useContext< + RequestsManagerProviderContextData + >(RequestsManagerContext); if (context === undefined) { throw new Error( diff --git a/packages/react/src/providers/RequestsManagerProvider/index.tsx b/packages/react/src/providers/RequestsManagerProvider/index.tsx index 7313ee51..db756bbb 100644 --- a/packages/react/src/providers/RequestsManagerProvider/index.tsx +++ b/packages/react/src/providers/RequestsManagerProvider/index.tsx @@ -20,7 +20,7 @@ export const RequestsManagerProvider = < storageInitializer, prefix, }: RequestsManagerProvideProps) => { - const [requestManager, setRequestManager] = useState< + const [requestsManager, setRequestsManager] = useState< ClientRequestsManager | undefined >(); @@ -28,7 +28,7 @@ export const RequestsManagerProvider = < const startManager = async () => { const storage = await storageInitializer(); - setRequestManager( + setRequestsManager( () => new ClientRequestsManager({ storage, @@ -43,7 +43,7 @@ export const RequestsManagerProvider = < return ( {children} From 2f894d6068a1fbb1b33d81c9b1789b2840e4b23a Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 15:06:06 +0200 Subject: [PATCH 11/21] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20Added=20custom?= =?UTF-8?q?=20typing=20to=20the=20CLientProvider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ClientProvider/ClientProviderContext.ts | 20 ++++++++++++------- .../src/providers/ClientProvider/index.tsx | 17 ++++++++++++++-- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/packages/react/src/providers/ClientProvider/ClientProviderContext.ts b/packages/react/src/providers/ClientProvider/ClientProviderContext.ts index 2308fdc7..2d9e6c8f 100644 --- a/packages/react/src/providers/ClientProvider/ClientProviderContext.ts +++ b/packages/react/src/providers/ClientProvider/ClientProviderContext.ts @@ -1,17 +1,23 @@ import { createContext, useContext } from 'react'; import { Client } from '@windingtree/sdk-client'; +import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; -export interface ClientContextData { - client: Client; +export interface ClientContextData< + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +> { + client: Client; clientConnected: boolean; } -export const ClientContext = createContext( - {} as ClientContextData, -); +export const ClientContext = createContext({} as ClientContextData); -export const useClient = () => { - const context = useContext(ClientContext); +export const useClient = < + RequestQuery extends GenericQuery = GenericQuery, + OfferOptions extends GenericOfferOptions = GenericOfferOptions, +>() => { + const context = + useContext>(ClientContext); if (context === undefined) { throw new Error('useClient must be used within a "ClientContext"'); diff --git a/packages/react/src/providers/ClientProvider/index.tsx b/packages/react/src/providers/ClientProvider/index.tsx index 850acdca..4568a32d 100644 --- a/packages/react/src/providers/ClientProvider/index.tsx +++ b/packages/react/src/providers/ClientProvider/index.tsx @@ -1,4 +1,4 @@ -import { PropsWithChildren, useMemo } from 'react'; +import { PropsWithChildren, useMemo, useState, useEffect } from 'react'; import { GenericQuery, GenericOfferOptions } from '@windingtree/sdk-types'; import { createClient } from '@windingtree/sdk-client'; import { ClientContext } from './ClientProviderContext.js'; @@ -21,12 +21,25 @@ export const ClientProvider = < }), [serverAddress], ); + const [clientConnected, setClientConnected] = useState(false); + + useEffect(() => { + const onClientConnected = () => setClientConnected(true); + const onClientDisconnected = () => setClientConnected(false); + client.addEventListener('connected', onClientConnected); + client.addEventListener('disconnected', onClientDisconnected); + + return () => { + client.removeEventListener('connected', onClientConnected); + client.removeEventListener('disconnected', onClientDisconnected); + }; + }, [client]); return ( {children} From cbb4b75f497b1a58e004d9135cd7e2a869de119f Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 15:08:48 +0200 Subject: [PATCH 12/21] =?UTF-8?q?fix:=20=F0=9F=90=9B=20Missed=20exaports?= =?UTF-8?q?=20are=20added=20to=20the=20react=20package?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/react/src/providers/index.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/react/src/providers/index.ts b/packages/react/src/providers/index.ts index 5ae0223d..3d2def6f 100644 --- a/packages/react/src/providers/index.ts +++ b/packages/react/src/providers/index.ts @@ -15,3 +15,9 @@ export * from './ConfigProvider/index.js'; export * from './ClientProvider/ClientProviderContext.js'; export * from './ClientProvider/index.js'; + +export * from './RequestsManagerProvider/RequestsManagerProviderContext.js'; +export * from './RequestsManagerProvider/index.js'; + +export * from './DealsManagerProvider/DealsManagerProviderContext.js'; +export * from './DealsManagerProvider/index.js'; From e717928e87e00041fa0c9b7ea47049869fc221e4 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Fri, 4 Aug 2023 15:11:43 +0200 Subject: [PATCH 13/21] =?UTF-8?q?refactor:=20=F0=9F=92=A1=20New=20provider?= =?UTF-8?q?s=20used=20in=20the=20Client=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- examples/client/src/App.tsx | 238 ++++++++++++----------------------- examples/client/src/main.tsx | 38 +++++- 2 files changed, 115 insertions(+), 161 deletions(-) diff --git a/examples/client/src/App.tsx b/examples/client/src/App.tsx index 31c6d34b..60c9cc73 100644 --- a/examples/client/src/App.tsx +++ b/examples/client/src/App.tsx @@ -1,23 +1,15 @@ -import { useState, useEffect, useRef } from 'react'; -import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; +import { useState, useEffect } from 'react'; import { EventHandler } from '@libp2p/interfaces/events'; -import { - Client, - createClient, - ClientRequestsManager, - ClientDealsManager, - ClientRequestRecord, -} from '@windingtree/sdk-client'; -import { localStorage } from '@windingtree/sdk-storage'; +import { ClientRequestRecord } from '@windingtree/sdk-client'; import { buildRequest } from '@windingtree/sdk-messages'; -import { - RequestQuery, - OfferOptions, - contractsConfig, - serverAddress, -} from 'wtmp-examples-shared-files'; +import { RequestQuery, OfferOptions } from 'wtmp-examples-shared-files'; import { OfferData, RequestData } from '@windingtree/sdk-types'; -import { useWallet, AccountWidget } from '@windingtree/sdk-react/providers'; +import { + AccountWidget, + useClient, + useRequestsManager, + useDealsManager, +} from '@windingtree/sdk-react/providers'; import { FormValues, RequestForm } from './components/RequestForm.js'; import { Tabs, TabPanel } from './components/Tabs.js'; import { Requests, RequestsRegistryRecord } from './components/Requests.js'; @@ -25,10 +17,6 @@ import { MakeDeal } from './components/MakeDeal.js'; import { Offers } from './components/Offers.js'; import { Deals, DealsRegistryRecord } from './components/Deals.js'; -/** Target chain config */ -const chain = - import.meta.env.LOCAL_NODE === 'true' ? hardhat : polygonZkEvmTestnet; - /** Default request expiration time */ const defaultExpire = '30s'; @@ -39,13 +27,9 @@ const defaultTopic = 'hello'; * Main application component */ export const App = () => { - const client = useRef | undefined>(); - const requestsManager = useRef< - ClientRequestsManager | undefined - >(); - const dealsManager = useRef>(); - const { publicClient } = useWallet(); - const [connected, setConnected] = useState(false); + const { client, clientConnected } = useClient(); + const { requestsManager } = useRequestsManager(); + const { dealsManager } = useDealsManager(); const [selectedTab, setSelectedTab] = useState(0); const [requests, setRequests] = useState([]); const [deals, setDeals] = useState([]); @@ -57,21 +41,18 @@ export const App = () => { >(); const [error, setError] = useState(); - /** This hook starts the client that will be available via `client.current` */ useEffect(() => { const updateRequests = () => { - setRequests(requestsManager.current?.getAll() || []); + setRequests(() => requestsManager?.getAll() || []); }; const updateDeals = () => { - if (dealsManager.current) { - dealsManager.current - .getAll() - .then((newDeals) => { - setDeals(newDeals); - }) - .catch(console.error); - } + dealsManager + ?.getAll() + .then((newDeals) => { + setDeals(() => newDeals); + }) + .catch(console.error); }; const onClientStart = () => { @@ -85,154 +66,95 @@ export const App = () => { }; const onClientConnected = () => { - setConnected(true); console.log( '🔗 Client connected to server at:', new Date().toISOString(), ); - requestsManager.current?.refreshSubscriptions(); + requestsManager?.refreshSubscriptions(); }; const onClientDisconnected = () => { - setConnected(false); console.log( '🔌 Client disconnected from server at:', new Date().toISOString(), ); }; - const onRequestSubscribe: EventHandler< - CustomEvent - > = ({ detail }) => { - client.current?.subscribe(detail.data.id); - }; - - const onRequestUnsubscribe: EventHandler< - CustomEvent - > = ({ detail }) => { - client.current?.unsubscribe(detail.data.id); - }; - const onRequestPublish: EventHandler< CustomEvent> > = ({ detail }) => { - requestsManager.current?.add(detail); + requestsManager?.add(detail); }; const onOffer: EventHandler< CustomEvent> > = ({ detail }) => { - requestsManager.current?.addOffer(detail); + requestsManager?.addOffer(detail); }; - const startClient = async () => { - try { - setError(undefined); - - const storageInitializer = localStorage.createInitializer({ - session: false, // session or local storage - }); - - const store = await storageInitializer(); - - requestsManager.current = new ClientRequestsManager< - RequestQuery, - OfferOptions - >({ - storage: store, - prefix: 'wt_requests_', - }); - - dealsManager.current = new ClientDealsManager< - RequestQuery, - OfferOptions - >({ - storage: store, - prefix: 'wt_deals_', - checkInterval: '5s', - chain, - contracts: contractsConfig, - publicClient, - }); - - client.current = createClient({ - serverAddress, - }); - - client.current.addEventListener('start', onClientStart); - client.current.addEventListener('stop', onClientStop); - client.current.addEventListener('connected', onClientConnected); - client.current.addEventListener('disconnected', onClientDisconnected); - client.current.addEventListener('publish', onRequestPublish); - client.current.addEventListener('offer', onOffer); - - requestsManager.current.addEventListener('request', updateRequests); - requestsManager.current.addEventListener('expire', updateRequests); - requestsManager.current.addEventListener('cancel', updateRequests); - requestsManager.current.addEventListener('delete', updateRequests); - requestsManager.current.addEventListener('clear', updateRequests); - requestsManager.current.addEventListener('offer', updateRequests); - requestsManager.current.addEventListener( - 'subscribe', - onRequestSubscribe, - ); - requestsManager.current.addEventListener( - 'unsubscribe', - onRequestUnsubscribe, - ); - - dealsManager.current.addEventListener('changed', updateDeals); - - await client.current.start(); - } catch (error) { - console.log(error); - setError('Something went wrong...'); - } + const onRequestSubscribe: EventHandler< + CustomEvent + > = ({ detail }) => { + client.subscribe(detail.data.id); }; - const stopClient = async () => { - client.current?.stop(); + const onRequestUnsubscribe: EventHandler< + CustomEvent + > = ({ detail }) => { + client.unsubscribe(detail.data.id); }; - startClient(); + client.addEventListener('start', onClientStart); + client.addEventListener('stop', onClientStop); + client.addEventListener('connected', onClientConnected); + client.addEventListener('disconnected', onClientDisconnected); + client.addEventListener('publish', onRequestPublish); + client.addEventListener('offer', onOffer); - return () => { - client.current?.removeEventListener('start', onClientStart); - client.current?.removeEventListener('stop', onClientStop); - client.current?.removeEventListener('connected', onClientConnected); - client.current?.removeEventListener('disconnected', onClientDisconnected); - client.current?.removeEventListener('publish', onRequestPublish); - client.current?.removeEventListener('offer', onOffer); + requestsManager?.addEventListener('request', updateRequests); + requestsManager?.addEventListener('expire', updateRequests); + requestsManager?.addEventListener('cancel', updateRequests); + requestsManager?.addEventListener('delete', updateRequests); + requestsManager?.addEventListener('clear', updateRequests); + requestsManager?.addEventListener('offer', updateRequests); + requestsManager?.addEventListener('subscribe', onRequestSubscribe); + requestsManager?.addEventListener('unsubscribe', onRequestUnsubscribe); - requestsManager.current?.removeEventListener('request', updateRequests); - requestsManager.current?.removeEventListener('expire', updateRequests); - requestsManager.current?.removeEventListener('cancel', updateRequests); - requestsManager.current?.removeEventListener('delete', updateRequests); - requestsManager.current?.removeEventListener('clear', updateRequests); - requestsManager.current?.removeEventListener('offer', updateRequests); - requestsManager.current?.removeEventListener( - 'subscribe', - onRequestSubscribe, - ); - requestsManager.current?.removeEventListener( - 'unsubscribe', - onRequestUnsubscribe, - ); + dealsManager?.addEventListener('changed', updateDeals); - dealsManager.current?.removeEventListener('changed', updateDeals); + client.start().catch(console.error); - stopClient().catch(console.error); - dealsManager.current?.stop(); + return () => { + client.removeEventListener('start', onClientStart); + client.removeEventListener('stop', onClientStop); + client.removeEventListener('connected', onClientConnected); + client.removeEventListener('disconnected', onClientDisconnected); + client.removeEventListener('publish', onRequestPublish); + client.removeEventListener('offer', onOffer); + + requestsManager?.removeEventListener('request', updateRequests); + requestsManager?.removeEventListener('expire', updateRequests); + requestsManager?.removeEventListener('cancel', updateRequests); + requestsManager?.removeEventListener('delete', updateRequests); + requestsManager?.removeEventListener('clear', updateRequests); + requestsManager?.removeEventListener('offer', updateRequests); + requestsManager?.removeEventListener('subscribe', onRequestSubscribe); + requestsManager?.removeEventListener('unsubscribe', onRequestUnsubscribe); + + dealsManager?.removeEventListener('changed', updateDeals); + + client.stop().catch(console.error); + dealsManager?.stop(); }; - }, [publicClient]); + }, [client, requestsManager, dealsManager]); /** Publishing of request */ const sendRequest = async ({ topic, message }: FormValues) => { try { setError(undefined); - if (!client.current) { + if (!client) { throw new Error('The client is not initialized yet'); } @@ -245,7 +167,7 @@ export const App = () => { }, }); - client.current.publish(request); + client.publish(request); } catch (error) { console.log('@@@', error); setError((error as Error).message); @@ -262,10 +184,10 @@ export const App = () => { - {client.current &&
✅ Client started
} - {connected &&
✅ Connected to the coordination server
} + {client &&
✅ Client started
} + {clientConnected &&
✅ Connected to the coordination server
} @@ -286,15 +208,13 @@ export const App = () => { - requestsManager.current?.get(id)?.subscribed || false - } + subscribed={(id) => requestsManager?.get(id)?.subscribed || false} onClear={() => { - requestsManager.current?.clear(); + requestsManager?.clear(); }} onCancel={(id) => { - if (client.current) { - requestsManager.current?.cancel(id); + if (client) { + requestsManager?.cancel(id); } }} onOffers={setOffers} @@ -307,10 +227,10 @@ export const App = () => { setOffers(undefined); }} /> - + - + {error &&
🚨 {error}
} diff --git a/examples/client/src/main.tsx b/examples/client/src/main.tsx index 68f47f79..45911632 100644 --- a/examples/client/src/main.tsx +++ b/examples/client/src/main.tsx @@ -1,6 +1,21 @@ import { createRoot } from 'react-dom/client'; -import { WalletProvider } from '@windingtree/sdk-react/providers'; +import { + WalletProvider, + ClientProvider, + RequestsManagerProvider, + DealsManagerProvider, +} from '@windingtree/sdk-react/providers'; import { polygonZkEvmTestnet, hardhat } from 'viem/chains'; +import { + RequestQuery, + OfferOptions, + serverAddress, + contractsConfig, +} from 'wtmp-examples-shared-files'; +import { + LocalStorage, + createInitializer, +} from '@windingtree/sdk-storage/local'; import { App } from './App.js'; const targetChain = @@ -16,6 +31,25 @@ window.addEventListener('unhandledrejection', (event) => { const root = createRoot(document.getElementById('root') as HTMLElement); root.render( - + serverAddress={serverAddress}> + + storageInitializer={createInitializer({ + session: false, // session or local storage + })} + prefix={'wt_requests_'} + > + + storageInitializer={createInitializer({ + session: false, // session or local storage + })} + prefix={'wt_deals_'} + checkInterval={'5s'} + chain={targetChain} + contracts={contractsConfig} + > + + + + , ); From 7756a720dd59e22183c758fa3845c637978a91a9 Mon Sep 17 00:00:00 2001 From: Eugene Date: Thu, 17 Aug 2023 23:44:01 +0600 Subject: [PATCH 14/21] feat: add level db storage --- .gitignore | 2 +- packages/storage/package.json | 2 + packages/storage/src/abstract.ts | 6 +- packages/storage/src/level.ts | 153 +++++++++++++++++++++ packages/storage/test/level.memory.spec.ts | 95 +++++++++++++ pnpm-lock.yaml | 77 ++++++++++- 6 files changed, 327 insertions(+), 8 deletions(-) create mode 100644 packages/storage/src/level.ts create mode 100644 packages/storage/test/level.memory.spec.ts diff --git a/.gitignore b/.gitignore index b2e72335..eb93c212 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,6 @@ temp coverage typedoc typechain - +db/* #ide .idea diff --git a/packages/storage/package.json b/packages/storage/package.json index e52d9b98..94673177 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -49,6 +49,8 @@ }, "dependencies": { "@windingtree/sdk-logger": "workspace:*", + "classic-level": "^1.3.0", + "level-transcoder": "^1.0.1", "superjson": "^1.13.1" }, "scripts": { diff --git a/packages/storage/src/abstract.ts b/packages/storage/src/abstract.ts index 8f086a62..9ce0b1da 100644 --- a/packages/storage/src/abstract.ts +++ b/packages/storage/src/abstract.ts @@ -10,9 +10,9 @@ export abstract class Storage { key: string, ): Promise; abstract delete(key: string): Promise; - abstract entries(): IterableIterator< - [string, CustomValueType] - >; + abstract entries(): + | IterableIterator<[string, CustomValueType]> + | Promise<[[string, CustomValueType]]>; } export interface GenericStorageOptions { diff --git a/packages/storage/src/level.ts b/packages/storage/src/level.ts new file mode 100644 index 00000000..21a5330f --- /dev/null +++ b/packages/storage/src/level.ts @@ -0,0 +1,153 @@ +import { + GenericStorageOptions, + Storage, + StorageInitializerFunction, +} from './abstract.js'; +import { ClassicLevel } from 'classic-level'; +import { parse, stringify } from 'superjson'; +import { IEncoding } from 'level-transcoder'; +import { createLogger } from '@windingtree/sdk-logger'; + +const logger = createLogger('LocalStorage'); + +const superJsonEncoding: IEncoding< + string | string[], + Uint8Array, + string | string[] +> = { + encode: (data: string | string[]) => Buffer.from(stringify(data)), + decode: (data: Uint8Array) => parse(data.toString()), + format: 'buffer', + name: 'super-json-encoding', +}; + +export class LevelDBStorage extends Storage { + protected db: ClassicLevel; + /** Key for storing ids included in the scope */ + scopeIdsKey?: string; + + constructor(options?: GenericStorageOptions) { + super(); + + options = options ?? {}; + + this.db = new ClassicLevel('./db', { + keyEncoding: 'utf8', + valueEncoding: superJsonEncoding, + createIfMissing: true, + errorIfExists: false, + }); + + if (options.scope) { + this.scopeIdsKey = `level_storage_scope_${options.scope}_ids`; + } + + logger.trace('LevelDB storage initialized'); + } + + private async getScopeIds(): Promise> { + if (!this.scopeIdsKey) { + return new Set(); + } + + const scope = (await this.get(this.scopeIdsKey)) as Iterable; + return new Set(scope); + } + + private async saveScopeIds(ids: Set) { + if (!this.scopeIdsKey) { + return; + } + + await this.db.put(this.scopeIdsKey, Array.from(ids)); + } + + private async addScopeId(id: string) { + try { + if (!this.scopeIdsKey) { + return; + } + + const ids = await this.getScopeIds(); + ids.add(id); + await this.saveScopeIds(ids); + } catch (error) { + logger.error('addScopeId', error); + } + } + + private async deleteScopeId(id: string) { + try { + if (!this.scopeIdsKey) { + return; + } + + const ids = await this.getScopeIds(); + ids.delete(id); + await this.saveScopeIds(ids); + } catch (error) { + logger.error('addScopeId', error); + } + } + + async delete(key: string): Promise { + try { + await this.db.del(key); + const isDeleted = (await this.db.get(key)) === null; + + if (isDeleted) { + await this.deleteScopeId(key); + } + + return isDeleted; + } catch (e) { + return false; + } + } + + entries(): Promise<[[string, ValueType]]> { + return this.db.iterator().all() as Promise<[[string, ValueType]]>; + } + + async get(key: string): Promise { + try { + return (await this.db.get(key)) as ValueType; + } catch (e) { + logger.error(e); + return; + } + } + + protected a = 0; + + async set(key: string, value: ValueType): Promise { + await this.db.put(key, value as string | string[]); + await this.addScopeId(key); + } + + async reset() { + await this.db.clear(); + } + + async open() { + await this.db.open(); + } + + get instance() { + return this.db; + } +} + +export interface LevelStorageOptions extends GenericStorageOptions { + scope?: string; +} + +export const createInitializer: StorageInitializerFunction< + LevelDBStorage, + LevelStorageOptions +> = + (options) => + // eslint-disable-next-line @typescript-eslint/require-await + async (): Promise => { + return new LevelDBStorage(options); + }; diff --git a/packages/storage/test/level.memory.spec.ts b/packages/storage/test/level.memory.spec.ts new file mode 100644 index 00000000..b7565d6f --- /dev/null +++ b/packages/storage/test/level.memory.spec.ts @@ -0,0 +1,95 @@ +import { beforeAll, describe, expect, it } from 'vitest'; +import { GenericStorageOptions } from '../src/index.js'; +import { createInitializer, LevelDBStorage } from '../src/level.js'; + +describe('Level', () => { + let levelDBStorage: LevelDBStorage; + + beforeAll(() => { + const options: GenericStorageOptions = { + scope: 'test', + }; + levelDBStorage = new LevelDBStorage(options); + }); + + describe('#constructor', () => { + it('LevelDBStorage is initialized correctly', () => { + expect(levelDBStorage).toBeDefined(); + expect(levelDBStorage).toBeInstanceOf(LevelDBStorage); + }); + }); + + describe('#set', () => { + it('Value is set correctly', async () => { + await levelDBStorage.set('testKey', 'testValue'); + const result = await levelDBStorage.get('testKey'); + expect(result).toEqual('testValue'); + }); + }); + + describe('#get', () => { + it('Returns undefined when a non-existing key is used', async () => { + const result = await levelDBStorage.get('nonExistingKey'); + expect(result).toBeUndefined(); + }); + + it('Throws an error when a non-string key is used', async () => { + const result = await levelDBStorage.get(undefined as unknown as string); + expect(result).toBeUndefined(); + }); + }); + + describe('#delete', () => { + it('Value is deleted correctly', async () => { + await levelDBStorage.delete('testKey'); + const result = await levelDBStorage.get('testKey'); + expect(result).toBeUndefined(); + }); + + it('Returns false when a non-existing key is used', async () => { + const result = await levelDBStorage.delete('nonExistingKey'); + expect(result).toBeFalsy(); + }); + }); + + describe('#entries', () => { + it('Entries are retrieved correctly', async () => { + await levelDBStorage.set('test', 'value'); + const result = await levelDBStorage.get('test'); + expect(result).toEqual('value'); + }); + + it('Entries are retrieved correctly', async () => { + const entries = Array.from(await levelDBStorage.entries()); + expect(entries).toContainEqual(['test', 'value']); + }); + + it('Returns an empty iterator when storage is empty', async () => { + await levelDBStorage.reset(); + const entries = Array.from(await levelDBStorage.entries()); + expect(entries.length).toEqual(0); + }); + }); + + describe('#reset', () => { + it('Storage is reset correctly', async () => { + await levelDBStorage.reset(); + const result = await levelDBStorage.get('test'); + expect(result).toBeUndefined(); + const entries = Array.from(await levelDBStorage.entries()); + expect(entries.length).toEqual(0); + }); + }); + + describe('#createInitializer', () => { + it('Initializer creates instance correctly', async () => { + const options: GenericStorageOptions = { scope: 'testInitializer' }; + const initializer = createInitializer(options); + const initializedStorage = await initializer(); + expect(initializedStorage).toBeInstanceOf(LevelDBStorage); + expect(initializedStorage.scopeIdsKey).toEqual( + 'level_storage_scope_testInitializer_ids', + ); + }); + }); +}); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b0ead43b..447fa10f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -784,6 +784,15 @@ importers: '@windingtree/sdk-logger': specifier: workspace:* version: link:../logger + abstract-level: + specifier: ^1.0.3 + version: 1.0.3 + classic-level: + specifier: ^1.3.0 + version: 1.3.0 + level-transcoder: + specifier: ^1.0.1 + version: 1.0.1 superjson: specifier: ^1.13.1 version: 1.13.1 @@ -4659,6 +4668,19 @@ packages: it-stream-types: 2.0.1 dev: false + /abstract-level@1.0.3: + resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} + engines: {node: '>=12'} + dependencies: + buffer: 6.0.3 + catering: 2.1.1 + is-buffer: 2.0.5 + level-supports: 4.0.1 + level-transcoder: 1.0.1 + module-error: 1.0.2 + queue-microtask: 1.2.3 + dev: false + /acorn-jsx@5.3.2(acorn@8.10.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -5058,7 +5080,6 @@ packages: /base64-js@1.5.1: resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - dev: true /bcrypt-ts@4.0.0: resolution: {integrity: sha512-EsO/XpRoEr+3d63rEwytqYUs2yeQcTdQ5qonRHgcRBUSY5yZXCSbgL1seMUt61Gx9JuYZaPIccWuAWqqmGU/TQ==} @@ -5233,6 +5254,13 @@ packages: ieee754: 1.2.1 dev: true + /buffer@6.0.3: + resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} + dependencies: + base64-js: 1.5.1 + ieee754: 1.2.1 + dev: false + /builtin-status-codes@3.0.0: resolution: {integrity: sha512-HpGFw18DgFWlncDfjTa2rcQ4W88O1mC8e8yZ2AvQY5KDaktSTwo+KRf6nHK6FRI5FyRyb/5T6+TSxfP7QyGsmQ==} dev: true @@ -5347,6 +5375,11 @@ packages: resolution: {integrity: sha512-Vdhm5S11DaFVLlyiKu4hiUTkpZu+y1KA/rZZqVQfOD5YdDT/eQKlkt7NaE0WGOFgX32diqt9MiP9CAiFeRklaA==} dev: true + /catering@2.1.1: + resolution: {integrity: sha512-K7Qy8O9p76sL3/3m7/zLKbRkyOlSZAgzEaLhyj2mXS8PsCud2Eo4hAb8aLtZqHh0QGqLcb9dlJSu6lHRVENm1w==} + engines: {node: '>=6'} + dev: false + /chai@4.3.7: resolution: {integrity: sha512-HLnAzZ2iupm25PlN0xFreAlBA5zaBSv3og0DdeGA4Ar6h6rJ3A0rolRUKJhSF2V10GZKDgWF/VmAEsNWjCRB+A==} engines: {node: '>=4'} @@ -5446,6 +5479,18 @@ packages: safe-buffer: 5.2.1 dev: true + /classic-level@1.3.0: + resolution: {integrity: sha512-iwFAJQYtqRTRM0F6L8h4JCt00ZSGdOyqh7yVrhhjrOpFhmBjNlRUey64MCiyo6UmQHMJ+No3c81nujPv+n9yrg==} + engines: {node: '>=12'} + requiresBuild: true + dependencies: + abstract-level: 1.0.3 + catering: 2.1.1 + module-error: 1.0.2 + napi-macros: 2.2.2 + node-gyp-build: 4.6.0 + dev: false + /clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -7708,7 +7753,6 @@ packages: /ieee754@1.2.1: resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - dev: true /ignore-walk@5.0.1: resolution: {integrity: sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==} @@ -7902,6 +7946,11 @@ packages: has-tostringtag: 1.0.0 dev: true + /is-buffer@2.0.5: + resolution: {integrity: sha512-i2R6zNFDwgEHJyQUtJEk0XFi1i0dPFn/oqjK3/vPCcDeJvW5NQ83V8QbicfF1SupOaB0h8ntgBC2YiE7dfyctQ==} + engines: {node: '>=4'} + dev: false + /is-callable@1.2.7: resolution: {integrity: sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==} engines: {node: '>= 0.4'} @@ -8662,6 +8711,19 @@ packages: - supports-color dev: true + /level-supports@4.0.1: + resolution: {integrity: sha512-PbXpve8rKeNcZ9C1mUicC9auIYFyGpkV9/i6g76tLgANwWhtG2v7I4xNBUlkn3lE2/dZF3Pi0ygYGtLc4RXXdA==} + engines: {node: '>=12'} + dev: false + + /level-transcoder@1.0.1: + resolution: {integrity: sha512-t7bFwFtsQeD8cl8NIoQ2iwxA0CL/9IFw7/9gAjOonH0PWTTiRfY7Hq+Ejbsxh86tXobDQ6IOiddjNYIfOBs06w==} + engines: {node: '>=12'} + dependencies: + buffer: 6.0.3 + module-error: 1.0.2 + dev: false + /levn@0.4.1: resolution: {integrity: sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==} engines: {node: '>= 0.8.0'} @@ -9353,6 +9415,11 @@ packages: engines: {node: '>=0.10.0'} dev: true + /module-error@1.0.2: + resolution: {integrity: sha512-0yuvsqSCv8LbaOKhnsQ/T5JhyFlCYLPXK3U2sgV10zoKQwzs/MyfuQUOZQ1V/6OCOJsK/TRgNVrPuPDqtdMFtA==} + engines: {node: '>=10'} + dev: false + /mortice@3.0.1: resolution: {integrity: sha512-eyDUsl1nCR9+JtNksKnaESLP9MgAXCA4w1LTtsmOSQNsThnv++f36rrBu5fC/fdGIwTJZmbiaR/QewptH93pYA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -9425,6 +9492,10 @@ packages: hasBin: true dev: false + /napi-macros@2.2.2: + resolution: {integrity: sha512-hmEVtAGYzVQpCKdbQea4skABsdXW4RUh5t5mJ2zzqowJS2OyXZTU1KhDVFhx+NlWZ4ap9mqR9TcDO3LTTttd+g==} + dev: false + /native-fetch@4.0.2(undici@5.22.1): resolution: {integrity: sha512-4QcVlKFtv2EYVS5MBgsGX5+NWKtbDbIECdUXDBGDMAZXq3Jkv9zf+y8iS7Ub8fEdga3GpYeazp9gauNqXHJOCg==} peerDependencies: @@ -9481,7 +9552,6 @@ packages: /node-gyp-build@4.6.0: resolution: {integrity: sha512-NTZVKn9IylLwUzaKjkas1e4u2DLNcV4rdYagA4PWdPwW87Bi7z+BznyKSRwS/761tV/lzCGXplWsiaMjLqP2zQ==} hasBin: true - dev: true /node-gyp@9.4.0: resolution: {integrity: sha512-dMXsYP6gc9rRbejLXmTbVRYjAHw7ppswsKyMxuxJxxOHzluIO1rGp9TOQgjFJ+2MCqcOcQTOPB/8Xwhr+7s4Eg==} @@ -10538,7 +10608,6 @@ packages: /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - dev: true /quick-lru@4.0.1: resolution: {integrity: sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==} From 803ab03f1b5d176844247c2d065dfadabc12355f Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 30 Aug 2023 10:51:34 +0600 Subject: [PATCH 15/21] feat: fix async issues --- packages/db/src/deals.ts | 7 ++++--- packages/pubsub/src/cache.ts | 6 +++--- packages/pubsub/src/index.ts | 7 ++++--- pnpm-lock.yaml | 3 --- 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/packages/db/src/deals.ts b/packages/db/src/deals.ts index c8513aa0..6897b7a7 100644 --- a/packages/db/src/deals.ts +++ b/packages/db/src/deals.ts @@ -84,8 +84,9 @@ export class DealsDb { * @returns {Promise} Deals records * @memberof DealsDb */ - async getAll(pagination?: PaginationOptions): Promise { - return new Promise((resolve, reject) => { + getAll(pagination?: PaginationOptions): Promise { + // eslint-disable-next-line @typescript-eslint/no-misused-promises, no-async-promise-executor + return new Promise(async (resolve, reject) => { try { const page: Required = { start: pagination?.start ?? 0, @@ -96,7 +97,7 @@ export class DealsDb { const to = from + page.skip ?? 0; const records: DealRecord[] = []; - for (const record of this.storage.entries()) { + for (const record of await this.storage.entries()) { if (to > 0 && cursor >= from && cursor < to) { records.push(record[1]); } diff --git a/packages/pubsub/src/cache.ts b/packages/pubsub/src/cache.ts index 5e529ee1..498dfbae 100644 --- a/packages/pubsub/src/cache.ts +++ b/packages/pubsub/src/cache.ts @@ -49,7 +49,7 @@ export class MessagesCache { */ async prune(): Promise { const now = Math.ceil(Date.now() / 1000); - for (const [id, message] of this.cache.entries()) { + for (const [id, message] of await this.cache.entries()) { if (message.expire < now) { await this.cache.delete(id); } @@ -62,9 +62,9 @@ export class MessagesCache { * @returns {CashedMessageEntry[]} * @memberof MessagesCache */ - get(): CashedMessageEntry[] { + async get(): Promise { const messages: CashedMessageEntry[] = []; - for (const [id, entry] of this.cache.entries()) { + for (const [id, entry] of await this.cache.entries()) { messages.push({ id, data: entry.data, diff --git a/packages/pubsub/src/index.ts b/packages/pubsub/src/index.ts index c6f07905..f68ba45f 100644 --- a/packages/pubsub/src/index.ts +++ b/packages/pubsub/src/index.ts @@ -6,7 +6,7 @@ import { } from '@chainsafe/libp2p-gossipsub'; import { ToSendGroupCount } from '@chainsafe/libp2p-gossipsub/metrics'; import { PeerIdStr, TopicStr } from '@chainsafe/libp2p-gossipsub/types'; -import { PubSub, Message } from '@libp2p/interface-pubsub'; +import { Message, PubSub } from '@libp2p/interface-pubsub'; import { PeerId } from '@libp2p/interface-peer-id'; import type { Direction } from '@libp2p/interface-connection'; import { RPC } from '@chainsafe/libp2p-gossipsub/message'; @@ -204,13 +204,13 @@ export class CenterSub extends GossipSub { * @returns {void} * @memberof CenterSub */ - private handlePeerConnect(peerId: PeerId): void { + private async handlePeerConnect(peerId: PeerId): Promise { try { if (!this.messages) { logger.trace('Messages storage not initialized'); return; } - const missedMessages = this.messages.get(); + const missedMessages = await this.messages.get(); logger.trace( 'handlePeerConnect: missedMessages.length:', missedMessages.length, @@ -244,6 +244,7 @@ export class CenterSub extends GossipSub { if (!hasPeer && direction === 'inbound') { // We need to wait for the outbound stream to be opened + // eslint-disable-next-line @typescript-eslint/no-misused-promises setTimeout(() => this.handlePeerConnect(peerId), outboundStreamDelay); } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 447fa10f..53983c80 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -784,9 +784,6 @@ importers: '@windingtree/sdk-logger': specifier: workspace:* version: link:../logger - abstract-level: - specifier: ^1.0.3 - version: 1.0.3 classic-level: specifier: ^1.3.0 version: 1.3.0 From 9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8 Mon Sep 17 00:00:00 2001 From: Eugene Date: Fri, 22 Sep 2023 15:18:21 +0600 Subject: [PATCH 16/21] feat: improve test coverage --- package.json | 7 +- packages/constants/package.json | 3 + packages/constants/test/constans.spec.ts | 35 +++++ packages/contracts-manger/package.json | 8 +- .../test/contractsManager.spec.ts | 33 +++++ packages/db/test/db.deals.spec.ts | 49 +----- packages/messages/test/messages.spec.ts | 95 ++++++++++-- packages/node-api/package.json | 4 +- packages/node-api/src/router/deals.ts | 10 +- packages/node-api/src/router/user.ts | 5 +- .../node-api/test/api.nodeApiServer.spec.ts | 139 +++++++++++++++++- packages/node/src/index.ts | 2 + packages/test-utils/package.json | 1 + packages/test-utils/src/index.ts | 37 +++++ pnpm-lock.yaml | 98 +++++++++--- vite.config.ts | 1 + 16 files changed, 436 insertions(+), 91 deletions(-) create mode 100644 packages/constants/test/constans.spec.ts create mode 100644 packages/contracts-manger/test/contractsManager.spec.ts diff --git a/package.json b/package.json index 0783319f..fca6624b 100644 --- a/package.json +++ b/package.json @@ -31,9 +31,11 @@ "devDependencies": { "@commitlint/cli": "^17.6.7", "@commitlint/config-conventional": "^17.6.7", + "@libp2p/crypto": "^1.0.17", "@typescript-eslint/eslint-plugin": "^6.1.0", "@typescript-eslint/parser": "^6.1.0", "@vitest/coverage-v8": "^0.33.0", + "@vitest/ui": "^0.34.3", "eslint": "^8.45.0", "eslint-config-prettier": "^8.8.0", "eslint-plugin-prettier": "^5.0.0", @@ -43,12 +45,11 @@ "prettier": "^3.0.0", "tsup": "^7.1.0", "typescript": "^5.1.6", + "uint8arrays": "^4.0.4", "vite": "^4.4.4", "vite-plugin-dts": "^3.3.1", "vite-plugin-node-polyfills": "^0.9.0", - "vitest": "^0.33.0", - "@libp2p/crypto": "^1.0.17", - "uint8arrays": "^4.0.4" + "vitest": "^0.33.0" }, "scripts": { "prepare": "husky install", diff --git a/packages/constants/package.json b/packages/constants/package.json index 35d8b776..74369c5c 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -27,6 +27,9 @@ "publishConfig": { "access": "public" }, + "devDependencies": { + "@windingtree/sdk-test-utils": "workspace:*" + }, "scripts": { "build": "tsup", "lint": "eslint . --ext .ts --ignore-path ../../.lintignore", diff --git a/packages/constants/test/constans.spec.ts b/packages/constants/test/constans.spec.ts new file mode 100644 index 00000000..59fb6689 --- /dev/null +++ b/packages/constants/test/constans.spec.ts @@ -0,0 +1,35 @@ +import { describe, expect, it } from '@windingtree/sdk-test-utils'; +import { + defaultExpirationTime, + noncePeriod, + outboundStreamDelay, + queueConcurrentJobsNumber, + queueHeartbeat, + queueJobAttemptsDelay, +} from '../src/index.js'; + +describe('Node', () => { + it('defaultExpirationTime should be defined', () => { + expect(defaultExpirationTime).toBeDefined(); + }); + + it('outboundStreamDelay should be defined', () => { + expect(outboundStreamDelay).toBeDefined(); + }); + + it('noncePeriod should be defined', () => { + expect(noncePeriod).toBeDefined(); + }); + + it('queueConcurrentJobsNumber should be defined', () => { + expect(queueConcurrentJobsNumber).toBeDefined(); + }); + + it('queueJobAttemptsDelay should be defined', () => { + expect(queueJobAttemptsDelay).toBeDefined(); + }); + + it('queueHeartbeat should be defined', () => { + expect(queueHeartbeat).toBeDefined(); + }); +}); diff --git a/packages/contracts-manger/package.json b/packages/contracts-manger/package.json index a45a7eb5..d50831c6 100644 --- a/packages/contracts-manger/package.json +++ b/packages/contracts-manger/package.json @@ -34,10 +34,16 @@ "superjson": "^1.13.1", "viem": "^1.3.0" }, + "devDependencies": { + "@windingtree/sdk-utils": "workspace:*", + "@windingtree/sdk-test-utils": "workspace:*", + "wtmp-examples-shared-files": "workspace:*" + }, "scripts": { "build": "tsup", "lint": "eslint . --ext .ts --ignore-path ../../.lintignore", "lint:fix": "eslint . --ext .ts --ignore-path ../../.lintignore --fix && prettier --ignore-path ../../.lintignore --write .", - "test": "echo \"Error: no test specified\" && exit 0" + "test": "vitest --run test", + "test:rel": "vitest related --run" } } diff --git a/packages/contracts-manger/test/contractsManager.spec.ts b/packages/contracts-manger/test/contractsManager.spec.ts new file mode 100644 index 00000000..1691dc89 --- /dev/null +++ b/packages/contracts-manger/test/contractsManager.spec.ts @@ -0,0 +1,33 @@ +import { beforeAll, describe, expect, it } from '@windingtree/sdk-test-utils'; +import { ProtocolContracts } from '../dist/index.js'; +import { createPublicClient, createWalletClient, http } from 'viem'; +import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; +import { mnemonicToAccount } from 'viem/accounts'; +import { contractsConfig } from 'wtmp-examples-shared-files'; +import { generateMnemonic } from '@windingtree/sdk-utils'; +import { GenericOfferOptions, GenericQuery } from '@windingtree/sdk-types'; + +const chain = process.env.LOCAL_NODE === 'true' ? hardhat : polygonZkEvmTestnet; + +describe('ContractsManager.', () => { + const signer = mnemonicToAccount(generateMnemonic()); + let contractsManager: ProtocolContracts; + beforeAll(() => { + contractsManager = new ProtocolContracts({ + contracts: contractsConfig, + publicClient: createPublicClient({ + chain, + transport: http(), + }), + walletClient: createWalletClient({ + chain, + transport: http(), + account: signer.address, + }), + }); + }); + + it('should ', () => { + expect(contractsManager.publicClient.chain).toEqual(chain); + }); +}); diff --git a/packages/db/test/db.deals.spec.ts b/packages/db/test/db.deals.spec.ts index 8570dd7c..cbd38f3c 100644 --- a/packages/db/test/db.deals.spec.ts +++ b/packages/db/test/db.deals.spec.ts @@ -1,50 +1,17 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { describe, expect, it, beforeAll } from '@windingtree/sdk-test-utils'; import { - createRandomRequest, - createRandomOffer, -} from '@windingtree/sdk-messages'; -import { HDAccount, Hash } from 'viem'; + beforeAll, + buildRandomDeal, + describe, + expect, + it, +} from '@windingtree/sdk-test-utils'; import { mnemonicToAccount } from 'viem/accounts'; import { randomSalt } from '@windingtree/contracts'; -import { supplierId as spId } from '@windingtree/sdk-utils'; -import { generateMnemonic } from '@windingtree/sdk-utils'; -import { Storage } from '@windingtree/sdk-storage'; -import { memoryStorage } from '@windingtree/sdk-storage'; +import { generateMnemonic, supplierId as spId } from '@windingtree/sdk-utils'; +import { memoryStorage, Storage } from '@windingtree/sdk-storage'; import { DealRecord } from '@windingtree/sdk-types'; import { DealsDb, DealsDbOptions } from '../src/deals.js'; -import { DealStatus } from '@windingtree/sdk-types'; - -const buildRandomDeal = async ( - signer: HDAccount, - supplierId: Hash, -): Promise => { - const typedDomain = { - chainId: 1, - name: 'Test', - version: '1', - contract: signer.address, - }; - const request = await createRandomRequest('test', '100s'); - const offer = await createRandomOffer( - request, - '200s', - typedDomain, - supplierId, - signer, - ); - - return { - chainId: typedDomain.chainId, - created: BigInt(Math.round(Date.now() / 1000)), - offer, - retailerId: 'test', - buyer: '0x0', - price: BigInt(1), - asset: '0x0', - status: DealStatus.Claimed, - }; -}; describe('DealsDb', () => { const signer = mnemonicToAccount(generateMnemonic()); diff --git a/packages/messages/test/messages.spec.ts b/packages/messages/test/messages.spec.ts index d12fbdc2..e49d0a11 100644 --- a/packages/messages/test/messages.spec.ts +++ b/packages/messages/test/messages.spec.ts @@ -1,22 +1,25 @@ import { mnemonicToAccount } from 'viem/accounts'; import { - expect, - describe, - it, beforeAll, + describe, + expect, expectDeepEqual, + it, } from '@windingtree/sdk-test-utils'; -import { supplierId as spId } from '@windingtree/sdk-utils'; +import { generateMnemonic, supplierId as spId } from '@windingtree/sdk-utils'; import { randomSalt } from '@windingtree/contracts'; -import { RequestData, OfferData } from '@windingtree/sdk-types'; -import { generateMnemonic } from '@windingtree/sdk-utils'; +import { OfferData, RequestData } from '@windingtree/sdk-types'; import { - CustomQuery, - CustomOfferOptions, createRandomOffer, createRandomRequest, -} from '../src/testUtils.js'; -import { buildOffer, verifyOffer } from '../src/index.js'; + CustomOfferOptions, + CustomQuery, +} from '../src/index.js'; +import { + buildOffer, + createCheckInOutSignature, + verifyOffer, +} from '../src/index.js'; describe('Shared.messages', () => { const topic = 'test'; @@ -97,6 +100,43 @@ describe('Shared.messages', () => { expectDeepEqual(fromRaw, offer); }); + it('should restore an offer from raw data without transferable option', async () => { + const fromRaw = await buildOffer({ + domain: typedDomain, + account: signer, + supplierId, + expire: offer.expire, + request: offer.request, + options: offer.options, + payment: offer.payment, + cancel: offer.cancel, + checkIn: offer.payload.checkIn, + checkOut: offer.payload.checkOut, + transferable: offer.payload.transferable, + idOverride: offer.id, + signatureOverride: offer.signature, + }); + expectDeepEqual(fromRaw, offer); + }); + + it('should throw Chain Id must be provided with a typed domain', async () => { + await expect( + buildOffer({ + domain: {}, + supplierId, + expire: offer.expire, + request: offer.request, + options: offer.options, + payment: offer.payment, + cancel: offer.cancel, + checkIn: offer.payload.checkIn, + checkOut: offer.payload.checkOut, + transferable: offer.payload.transferable, + idOverride: offer.id, + }), + ).rejects.toThrow('Chain Id must be provided with a typed domain'); + }); + it('should throw is signatureOverride not been provided', async () => { await expect( buildOffer({ @@ -153,4 +193,39 @@ describe('Shared.messages', () => { ).resolves.toBeUndefined(); }); }); + + describe('#createCheckInOutSignature', () => { + let offer: OfferData; + + beforeAll(async () => { + offer = await createRandomOffer( + request, + BigInt(1), + typedDomain, + supplierId, + signer, + ); + }); + + it('should create check in out signature', async () => { + await expect( + createCheckInOutSignature({ + offerId: offer.id, + domain: typedDomain, + account: signer, + address: signer.address, + }), + ).resolves.toBeTypeOf('string'); + }); + + it('should create check in out signature without address', async () => { + await expect( + createCheckInOutSignature({ + offerId: offer.id, + domain: typedDomain, + account: signer, + }), + ).resolves.toBeTypeOf('string'); + }); + }); }); diff --git a/packages/node-api/package.json b/packages/node-api/package.json index 6dea719c..2eb2500a 100644 --- a/packages/node-api/package.json +++ b/packages/node-api/package.json @@ -58,8 +58,10 @@ "access": "public" }, "devDependencies": { + "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-test-utils": "workspace:*", - "@windingtree/sdk-utils": "workspace:*" + "@windingtree/sdk-utils": "workspace:*", + "wtmp-examples-shared-files": "workspace:*" }, "dependencies": { "@trpc/client": "^10.34.0", diff --git a/packages/node-api/src/router/deals.ts b/packages/node-api/src/router/deals.ts index 7c1f0a50..0882a52d 100644 --- a/packages/node-api/src/router/deals.ts +++ b/packages/node-api/src/router/deals.ts @@ -35,6 +35,7 @@ export const dealsRouter = router({ try { const { deals } = ctx; return await deals.getAll(input); + /* c8 ignore next 7 */ } catch (error) { logger.error('deals.getAll', error); throw new TRPCError({ @@ -71,6 +72,7 @@ export const dealsRouter = router({ .use(withDeals.unstable_pipe(withContracts)) .input(DealsCheckInInputSchema) .mutation(async ({ input, ctx }) => { + /* c8 ignore next 77 */ try { const { id, sign } = input; const { deals, contracts } = ctx; @@ -142,7 +144,7 @@ export const dealsRouter = router({ receipt, }; } catch (error) { - logger.error('user.register', error); + logger.error('deals.checkIn', error); throw new TRPCError({ code: 'BAD_REQUEST', message: (error as Error).message, @@ -157,6 +159,7 @@ export const dealsRouter = router({ .use(withDeals.unstable_pipe(withContracts)) .input(DealsGetInputSchema) .mutation(async ({ input, ctx }) => { + /* c8 ignore next 61 */ try { const { id } = input; const { deals, contracts } = ctx; @@ -212,7 +215,7 @@ export const dealsRouter = router({ receipt, }; } catch (error) { - logger.error('user.register', error); + logger.error('deals.checkOut', error); throw new TRPCError({ code: 'BAD_REQUEST', message: (error as Error).message, @@ -269,8 +272,9 @@ export const dealsRouter = router({ await deals.set(deal); return deal; + /* c8 ignore next 7 */ } catch (error) { - logger.error('user.register', error); + logger.error('deals.seek', error); throw new TRPCError({ code: 'BAD_REQUEST', message: (error as Error).message, diff --git a/packages/node-api/src/router/user.ts b/packages/node-api/src/router/user.ts index f018f6be..156e8841 100644 --- a/packages/node-api/src/router/user.ts +++ b/packages/node-api/src/router/user.ts @@ -85,6 +85,7 @@ export const userRouter = router({ `${ACCESS_TOKEN_NAME}=deleted; expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly`, ); logger.trace(`User ${user.login} logged out`); + /* c8 ignore next 7 */ } catch (error) { logger.error('user.logout', error); throw new TRPCError({ @@ -107,6 +108,7 @@ export const userRouter = router({ `${ACCESS_TOKEN_NAME}=deleted; expires=Thu, 01 Jan 1970 00:00:00 GMT; HttpOnly`, ); logger.trace(`User ${user.login} deleted`); + /* c8 ignore next 7 */ } catch (error) { logger.error('user.delete', error); throw new TRPCError({ @@ -131,8 +133,9 @@ export const userRouter = router({ const { user, users } = ctx; await users.set(user, password); logger.trace(`User ${user.login} updated`); + /* c8 ignore next 7 */ } catch (error) { - logger.error('users.get', error); + logger.error('users.update', error); throw new TRPCError({ code: 'BAD_REQUEST', message: (error as Error).message, diff --git a/packages/node-api/test/api.nodeApiServer.spec.ts b/packages/node-api/test/api.nodeApiServer.spec.ts index fc45e289..968303f0 100644 --- a/packages/node-api/test/api.nodeApiServer.spec.ts +++ b/packages/node-api/test/api.nodeApiServer.spec.ts @@ -1,36 +1,45 @@ import { - describe, - beforeAll, afterAll, - it, + beforeAll, + buildRandomDeal, + describe, expect, + it, } from '@windingtree/sdk-test-utils'; import { createTRPCProxyClient, httpBatchLink } from '@trpc/client'; import { z } from 'zod'; -import { Hash } from 'viem'; +import { createPublicClient, createWalletClient, Hash, http } from 'viem'; import { mnemonicToAccount } from 'viem/accounts'; import superjson from 'superjson'; -import { generateMnemonic } from '@windingtree/sdk-utils'; +import { generateMnemonic, supplierId as spId } from '@windingtree/sdk-utils'; import { UserInputType } from '@windingtree/sdk-db'; import { + authAdminProcedure, + authProcedure, NodeApiServer, NodeApiServerOptions, router, - authProcedure, - authAdminProcedure, } from '../src/server.js'; -import { adminRouter, userRouter, dealsRouter } from '../src/router/index.js'; +import { adminRouter, dealsRouter, userRouter } from '../src/router/index.js'; import { memoryStorage } from '@windingtree/sdk-storage'; import { ACCESS_TOKEN_NAME, accessTokenLink, createAdminSignature, } from '../src/client.js'; +import { HashSchema } from '../dist/router.js'; +import { ProtocolContracts } from '@windingtree/sdk-contracts-manager'; +import { contractsConfig } from 'wtmp-examples-shared-files'; +import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; +import { PaginationOptions } from '@windingtree/sdk-types'; +import { randomSalt } from '@windingtree/contracts'; +import { serviceRouter } from '../src/router/service.js'; const testRouter = router({ admin: adminRouter, user: userRouter, deals: dealsRouter, + service: serviceRouter, testAuth: authProcedure.output(z.boolean()).mutation(() => { return true; }), @@ -39,6 +48,8 @@ const testRouter = router({ }), }); +const chain = process.env.LOCAL_NODE === 'true' ? hardhat : polygonZkEvmTestnet; + describe('NodeApiServer', () => { const user: UserInputType = { login: 'testUser', @@ -53,6 +64,18 @@ describe('NodeApiServer', () => { let accessTokenAdmin: string | undefined; beforeAll(async () => { + const contractsManager = new ProtocolContracts({ + contracts: contractsConfig, + publicClient: createPublicClient({ + chain, + transport: http(), + }), + walletClient: createWalletClient({ + chain, + transport: http(), + account: owner.address, + }), + }); options = { usersStorage: await memoryStorage.createInitializer({ scope: 'users', @@ -61,6 +84,10 @@ describe('NodeApiServer', () => { port: 3456, secret: 'secret', ownerAccount: owner.address, + dealsStorage: await memoryStorage.createInitializer({ + scope: 'deals', + })(), + protocolContracts: contractsManager, }; server = new NodeApiServer(options); @@ -168,6 +195,28 @@ describe('NodeApiServer', () => { }); }); + describe('user.update', () => { + const newPassword = 'new-password'; + + it('should log in a registered user and return an access token', async () => { + const result = await clientUser.user.update.mutate({ + ...user, + password: newPassword, + }); + expect(result).to.be.eq(undefined); + expect(accessTokenUser).toBeDefined(); + }); + + it('should log in a registered user and return an access token', async () => { + const result = await clientUser.user.login.mutate({ + ...user, + password: newPassword, + }); + expect(result).to.be.eq(undefined); + expect(accessTokenUser).toBeDefined(); + }); + }); + describe('user.logout', () => { it('should logout a logged in user', async () => { const result = await clientUser.user.logout.mutate(); @@ -350,4 +399,78 @@ describe('NodeApiServer', () => { }); }); }); + + describe('Deal route', () => { + let admin: UserInputType; + let id: `0x${string}`; + let deal; + + beforeAll(async () => { + admin = { + login: 'admin', + password: await createAdminSignature(owner), + }; + await clientAdmin.admin.register.mutate(admin); + await clientAdmin.admin.login.mutate(admin); + const signer = mnemonicToAccount(generateMnemonic()); + const supplierId = spId(randomSalt(), signer.address); + deal = await buildRandomDeal(signer, supplierId); + id = deal.offer.id; + await server.deals?.set(deal); + }); + + afterAll(async () => { + await clientAdmin.user.delete.mutate(); + }); + + it('should throw if accessed by a not an admin 1', () => { + expect(HashSchema).to.be.string; + }); + + it('should throw if accessed by a not an admin 2', async () => { + const randomId = randomSalt(); + expect( + (await clientAdmin.deals.seek.mutate({ id: randomId })).offer.id, + ).toEqual(randomId); + expect( + (await clientAdmin.deals.get.query({ id: randomId })).offer.id, + ).toEqual(randomId); + expect((await clientAdmin.service.ping.query()).message).toEqual('pong'); + }); + + it('should throw if accessed by a not an admin 3', async () => { + const salt = randomSalt(); + await expect( + /* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */ + clientAdmin.deals.get.query(JSON.parse(JSON.stringify({ id: salt }))), + ).rejects.toThrow(`Deal ${salt} not found`); + }); + + it('should throw if accessed by a not an admin 4', async () => { + expect((await clientAdmin.deals.seek.mutate({ id })).offer.id).toEqual( + id, + ); + }); + + it('should throw if accessed by a not an admin 8', async () => { + const salt = randomSalt(); + await expect( + /* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */ + clientAdmin.deals.get.query(JSON.parse(JSON.stringify({ id: salt }))), + ).rejects.toThrow(`Deal ${salt} not found`); + }); + + it('should throw if accessed by a not an admin 9', async () => { + await clientAdmin.deals.getAll.query({}); + }); + + it('should throw if accessed by a not an admin 10', async () => { + await expect( + clientAdmin.deals.getAll.query({ + start: 'string', + skip: 10, + } as unknown as PaginationOptions), + ).rejects.toThrow('Expected number, received string'); + }); + }); }); diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index b48b2e28..bb7b4d02 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -129,6 +129,8 @@ export interface NodeOptions extends ServerAddressOption, ChainsConfigOption { signerPk?: Hex; } +/* all test of Node module in e2e tests */ +/* c8 ignore next 370 */ /** * The protocol node * diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 51b129b9..666b9b88 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -29,6 +29,7 @@ }, "dependencies": { "@windingtree/contracts": "^1.0.0", + "@windingtree/sdk-messages": "workspace:*", "@windingtree/sdk-types": "workspace:*", "viem": "^1.3.0", "vitest": "^0.33.0" diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index a99d86bf..8988fc60 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -2,6 +2,12 @@ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ import { expect } from 'vitest'; +import { Hash, HDAccount } from 'viem'; +import { DealRecord, DealStatus } from '@windingtree/sdk-types'; +import { + createRandomOffer, + createRandomRequest, +} from '@windingtree/sdk-messages'; export * from 'vitest'; @@ -32,3 +38,34 @@ export const expectDeepEqual = ( ); } }; + +export const buildRandomDeal = async ( + signer: HDAccount, + supplierId: Hash, +): Promise => { + const typedDomain = { + chainId: 1, + name: 'Test', + version: '1', + contract: signer.address, + }; + const request = await createRandomRequest('test', '100s'); + const offer = await createRandomOffer( + request, + '200s', + typedDomain, + supplierId, + signer, + ); + + return { + chainId: typedDomain.chainId, + created: BigInt(Math.round(Date.now() / 1000)), + offer, + retailerId: 'test', + buyer: '0x0', + price: BigInt(1), + asset: '0x0', + status: DealStatus.Claimed, + }; +}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 53983c80..0b53a1df 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -26,6 +26,9 @@ importers: '@vitest/coverage-v8': specifier: ^0.33.0 version: 0.33.0(vitest@0.33.0) + '@vitest/ui': + specifier: ^0.34.3 + version: 0.34.3(vitest@0.33.0) eslint: specifier: ^8.45.0 version: 8.45.0 @@ -67,7 +70,7 @@ importers: version: 0.9.0(vite@4.4.4) vitest: specifier: ^0.33.0 - version: 0.33.0 + version: 0.33.0(@vitest/ui@0.34.3) docs: devDependencies: @@ -436,7 +439,11 @@ importers: specifier: workspace:* version: link:../test-utils - packages/constants: {} + packages/constants: + devDependencies: + '@windingtree/sdk-test-utils': + specifier: workspace:* + version: link:../test-utils packages/contracts-manger: dependencies: @@ -455,6 +462,16 @@ importers: viem: specifier: ^1.3.0 version: 1.3.0(typescript@5.1.6)(zod@3.21.4) + devDependencies: + '@windingtree/sdk-test-utils': + specifier: workspace:* + version: link:../test-utils + '@windingtree/sdk-utils': + specifier: workspace:* + version: link:../utils + wtmp-examples-shared-files: + specifier: workspace:* + version: link:../../examples/shared packages/db: dependencies: @@ -625,12 +642,18 @@ importers: specifier: ^3.21.4 version: 3.21.4 devDependencies: + '@windingtree/contracts': + specifier: ^1.0.0 + version: 1.0.0 '@windingtree/sdk-test-utils': specifier: workspace:* version: link:../test-utils '@windingtree/sdk-utils': specifier: workspace:* version: link:../utils + wtmp-examples-shared-files: + specifier: workspace:* + version: link:../../examples/shared packages/pubsub: dependencies: @@ -799,6 +822,9 @@ importers: '@windingtree/contracts': specifier: ^1.0.0 version: 1.0.0 + '@windingtree/sdk-messages': + specifier: workspace:* + version: link:../messages '@windingtree/sdk-types': specifier: workspace:* version: link:../types @@ -807,7 +833,7 @@ importers: version: 1.3.0(typescript@5.1.6)(zod@3.21.4) vitest: specifier: ^0.33.0 - version: 0.33.0 + version: 0.33.0(@vitest/ui@0.34.3) packages/types: dependencies: @@ -3513,12 +3539,10 @@ packages: dependencies: '@nodelib/fs.stat': 2.0.5 run-parallel: 1.2.0 - dev: true /@nodelib/fs.stat@2.0.5: resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} engines: {node: '>= 8'} - dev: true /@nodelib/fs.walk@1.2.8: resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} @@ -3526,7 +3550,6 @@ packages: dependencies: '@nodelib/fs.scandir': 2.1.5 fastq: 1.15.0 - dev: true /@npmcli/fs@3.1.0: resolution: {integrity: sha512-7kZUAaLscfgbwBQRbvdMYaZOWyMEcPTH/tJjnyAWJ/dvvs9Ef+CERx/qJb9GExJpl1qipaDGn7KqHnFGGixd0w==} @@ -3864,6 +3887,9 @@ packages: tslib: 2.6.0 dev: true + /@polka/url@1.0.0-next.21: + resolution: {integrity: sha512-a5Sab1C4/icpTZVzZc5Ghpz88yQtGOyNqYXcZgOssB2uuAr+wF/MvN6bgtW32q7HHrvBki+BsZ0OuNv6EV3K9g==} + /@protobufjs/aspromise@1.1.2: resolution: {integrity: sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==} @@ -4476,7 +4502,7 @@ packages: std-env: 3.3.3 test-exclude: 6.0.0 v8-to-istanbul: 9.1.0 - vitest: 0.33.0 + vitest: 0.33.0(@vitest/ui@0.34.3) transitivePeerDependencies: - supports-color dev: true @@ -4507,6 +4533,20 @@ packages: dependencies: tinyspy: 2.1.1 + /@vitest/ui@0.34.3(vitest@0.33.0): + resolution: {integrity: sha512-iNcOQ0xML9znOReiwpKJrTLSj5zFxmveD3VCxIJNqnsaMYpONSbSiiJLC1Y1dYlkmiHylp+ElNcUZYIMWdxRvA==} + peerDependencies: + vitest: '>=0.30.1 <1' + dependencies: + '@vitest/utils': 0.34.3 + fast-glob: 3.3.0 + fflate: 0.8.0 + flatted: 3.2.7 + pathe: 1.1.1 + picocolors: 1.0.0 + sirv: 2.0.3 + vitest: 0.33.0(@vitest/ui@0.34.3) + /@vitest/utils@0.33.0: resolution: {integrity: sha512-pF1w22ic965sv+EN6uoePkAOTkAPWM03Ri/jXNyMIKBb/XHLDPfhLvf/Fa9g0YECevAIz56oVYXhodLvLQ/awA==} dependencies: @@ -4514,6 +4554,13 @@ packages: loupe: 2.3.6 pretty-format: 29.6.1 + /@vitest/utils@0.34.3: + resolution: {integrity: sha512-kiSnzLG6m/tiT0XEl4U2H8JDBjFtwVlaE8I3QfGiMFR0QvnRDfYfdP3YvTBWM/6iJDAyaPY6yVQiCTUc7ZzTHA==} + dependencies: + diff-sequences: 29.4.3 + loupe: 2.3.6 + pretty-format: 29.6.1 + /@volar/language-core@1.9.0: resolution: {integrity: sha512-+PTRrGanAD2PxqMty0ZC46xhgW5BWzb67RLHhZyB3Im4+eMXsKlYjFUt7Z8ZCwTWQQOnj8NQ6gSgUEoOTwAHrQ==} dependencies: @@ -5158,7 +5205,6 @@ packages: engines: {node: '>=8'} dependencies: fill-range: 7.0.1 - dev: true /brorand@1.1.0: resolution: {integrity: sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==} @@ -6984,7 +7030,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.5 - dev: true /fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} @@ -6998,7 +7043,9 @@ packages: resolution: {integrity: sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==} dependencies: reusify: 1.0.4 - dev: true + + /fflate@0.8.0: + resolution: {integrity: sha512-FAdS4qMuFjsJj6XHbBaZeXOgaypXp8iw/Tpyuq/w3XA41jjLHT8NPA+n7czH/DDhdncq0nAyDZmPeWXh2qmdIg==} /figlet@1.6.0: resolution: {integrity: sha512-31EQGhCEITv6+hi2ORRPyn3bulaV9Fl4xOdR169cBzH/n1UqcxsiSB/noo6SJdD7Kfb1Ljit+IgR1USvF/XbdA==} @@ -7031,7 +7078,6 @@ packages: engines: {node: '>=8'} dependencies: to-regex-range: 5.0.1 - dev: true /finalhandler@1.1.2: resolution: {integrity: sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==} @@ -7086,7 +7132,6 @@ packages: /flatted@3.2.7: resolution: {integrity: sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==} - dev: true /follow-redirects@1.15.2: resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} @@ -7365,7 +7410,6 @@ packages: engines: {node: '>= 6'} dependencies: is-glob: 4.0.3 - dev: true /glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} @@ -7999,7 +8043,6 @@ packages: /is-extglob@2.1.1: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - dev: true /is-fullwidth-code-point@3.0.0: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} @@ -8018,7 +8061,6 @@ packages: engines: {node: '>=0.10.0'} dependencies: is-extglob: 2.1.1 - dev: true /is-inside-container@1.0.0: resolution: {integrity: sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==} @@ -8077,7 +8119,6 @@ packages: /is-number@7.0.0: resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==} engines: {node: '>=0.12.0'} - dev: true /is-obj@2.0.0: resolution: {integrity: sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==} @@ -9208,7 +9249,6 @@ packages: /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - dev: true /micromatch@4.0.5: resolution: {integrity: sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==} @@ -9216,7 +9256,6 @@ packages: dependencies: braces: 3.0.2 picomatch: 2.3.1 - dev: true /miller-rabin@4.0.1: resolution: {integrity: sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==} @@ -9427,6 +9466,10 @@ packages: p-timeout: 6.1.2 dev: false + /mrmime@1.0.1: + resolution: {integrity: sha512-hzzEagAgDyoU1Q6yg5uI+AorQgdvMCur3FcKf7NhMKWsaYg+RnbTyHRa/9IlLF9rf455MOCtcqqrQQ83pPP7Uw==} + engines: {node: '>=10'} + /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true @@ -10329,7 +10372,6 @@ packages: /picomatch@2.3.1: resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==} engines: {node: '>=8.6'} - dev: true /pify@2.3.0: resolution: {integrity: sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==} @@ -10936,7 +10978,6 @@ packages: /reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - dev: true /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} @@ -10993,7 +11034,6 @@ packages: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: queue-microtask: 1.2.3 - dev: true /rxjs@7.8.1: resolution: {integrity: sha512-AA3TVj+0A2iuIoQkWEK/tqFjBq2j+6PO6Y0zJcvzLAFhEFIO3HL0vls9hWLncZbAAbK0mar7oZ4V079I/qPMxg==} @@ -11189,6 +11229,14 @@ packages: - supports-color dev: true + /sirv@2.0.3: + resolution: {integrity: sha512-O9jm9BsID1P+0HOi81VpXPoDxYP374pkOLzACAoyUQ/3OUVndNpsz6wMnY2z+yOxzbllCKZrM+9QrWsv4THnyA==} + engines: {node: '>= 10'} + dependencies: + '@polka/url': 1.0.0-next.21 + mrmime: 1.0.1 + totalist: 3.0.1 + /slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -11672,13 +11720,16 @@ packages: engines: {node: '>=8.0'} dependencies: is-number: 7.0.0 - dev: true /toidentifier@1.0.1: resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} engines: {node: '>=0.6'} dev: true + /totalist@3.0.1: + resolution: {integrity: sha512-sf4i37nQ2LBx4m3wB74y+ubopq6W/dIzXg0FDGjsYnZHVa1Da8FH853wlL2gtUhg+xJXjfk3kUZS3BRoQeoQBQ==} + engines: {node: '>=6'} + /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} dev: true @@ -12302,7 +12353,7 @@ packages: optionalDependencies: fsevents: 2.3.2 - /vitest@0.33.0: + /vitest@0.33.0(@vitest/ui@0.34.3): resolution: {integrity: sha512-1CxaugJ50xskkQ0e969R/hW47za4YXDUfWJDxip1hwbnhUjYolpfUn2AMOulqG/Dtd9WYAtkHmM/m3yKVrEejQ==} engines: {node: '>=v14.18.0'} hasBin: true @@ -12340,6 +12391,7 @@ packages: '@vitest/runner': 0.33.0 '@vitest/snapshot': 0.33.0 '@vitest/spy': 0.33.0 + '@vitest/ui': 0.34.3(vitest@0.33.0) '@vitest/utils': 0.33.0 acorn: 8.10.0 acorn-walk: 8.2.0 diff --git a/vite.config.ts b/vite.config.ts index f2775316..aadd43b0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -5,6 +5,7 @@ export default defineConfig({ coverage: { provider: 'v8', reporter: ['html'], + enabled: true, }, }, }); From 593cd7002ace89636ff92c56dcbc6a83c4ae87e4 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Tue, 26 Sep 2023 21:29:37 +0300 Subject: [PATCH 17/21] Rename constans.spec.ts to constants.spec.ts Fixed file name typo --- packages/constants/test/{constans.spec.ts => constants.spec.ts} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename packages/constants/test/{constans.spec.ts => constants.spec.ts} (100%) diff --git a/packages/constants/test/constans.spec.ts b/packages/constants/test/constants.spec.ts similarity index 100% rename from packages/constants/test/constans.spec.ts rename to packages/constants/test/constants.spec.ts From 71daad41838ae6b2833c76aa36b5b2071a041e92 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 25 Oct 2023 10:07:46 +0600 Subject: [PATCH 18/21] feat: update libp2p --- examples/client/package.json | 2 +- examples/client/src/App.tsx | 2 +- examples/e2e-tests/package.json | 4 +- examples/e2e-tests/test/examples/client.ts | 2 +- examples/e2e-tests/test/examples/node.ts | 14 +- examples/manager/package.json | 1 - examples/node/package.json | 2 +- examples/node/src/index.ts | 2 +- packages/client/package.json | 18 +- packages/client/src/dealsManager.ts | 2 +- packages/client/src/index.ts | 16 +- packages/client/src/requestsManager.ts | 2 +- packages/node/package.json | 18 +- packages/node/src/index.ts | 13 +- packages/node/src/requestManager.ts | 2 +- packages/pubsub/package.json | 7 +- packages/pubsub/src/index.ts | 7 +- packages/queue/package.json | 2 +- packages/queue/src/index.ts | 2 +- packages/server/package.json | 14 +- packages/server/src/index.ts | 4 +- pnpm-lock.yaml | 930 ++++++++------------- 22 files changed, 424 insertions(+), 642 deletions(-) diff --git a/examples/client/package.json b/examples/client/package.json index 94a93c12..770dba54 100644 --- a/examples/client/package.json +++ b/examples/client/package.json @@ -22,7 +22,7 @@ "react-dom": "^18.2.0", "typescript": "^5.1.6", "viem": "^1.3.0", - "@libp2p/interfaces": "^3.3.2", + "@libp2p/interface": "^0.1.3", "luxon": "^3.3.0" }, "dependencies": { diff --git a/examples/client/src/App.tsx b/examples/client/src/App.tsx index 60c9cc73..91f51eae 100644 --- a/examples/client/src/App.tsx +++ b/examples/client/src/App.tsx @@ -1,5 +1,5 @@ import { useState, useEffect } from 'react'; -import { EventHandler } from '@libp2p/interfaces/events'; +import { EventHandler } from '@libp2p/interface/events'; import { ClientRequestRecord } from '@windingtree/sdk-client'; import { buildRequest } from '@windingtree/sdk-messages'; import { RequestQuery, OfferOptions } from 'wtmp-examples-shared-files'; diff --git a/examples/e2e-tests/package.json b/examples/e2e-tests/package.json index 521efb41..b32bd389 100644 --- a/examples/e2e-tests/package.json +++ b/examples/e2e-tests/package.json @@ -28,9 +28,7 @@ "@windingtree/sdk-server": "workspace:*", "@windingtree/sdk-storage": "workspace:*", "wtmp-examples-shared-files": "workspace:*", - "@libp2p/interface-connection": "^5.1.1", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interfaces": "^3.3.2", + "@libp2p/interface": "^0.1.3", "@libp2p/peer-id": "^2.0.4", "@multiformats/multiaddr": "^12.1.3", "luxon": "^3.3.0", diff --git a/examples/e2e-tests/test/examples/client.ts b/examples/e2e-tests/test/examples/client.ts index 4b6cb220..5722a7cd 100644 --- a/examples/e2e-tests/test/examples/client.ts +++ b/examples/e2e-tests/test/examples/client.ts @@ -1,5 +1,5 @@ import { RequestQuery, serverAddress } from 'wtmp-examples-shared-files'; -import { EventHandler } from '@libp2p/interfaces/events'; +import { EventHandler } from '@libp2p/interface/events'; import { buildRequest } from '@windingtree/sdk-messages'; import { memoryStorage } from '@windingtree/sdk-storage'; import { diff --git a/examples/e2e-tests/test/examples/node.ts b/examples/e2e-tests/test/examples/node.ts index f10e1349..56443373 100644 --- a/examples/e2e-tests/test/examples/node.ts +++ b/examples/e2e-tests/test/examples/node.ts @@ -1,4 +1,3 @@ -import { EventHandler } from '@libp2p/interfaces/events'; import { Hash, Hex, zeroAddress } from 'viem'; import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; import { randomSalt } from '@windingtree/contracts'; @@ -9,10 +8,9 @@ import { serverAddress, stableCoins, } from 'wtmp-examples-shared-files'; -import { OPEN } from '@libp2p/interface-connection/status'; import { multiaddr } from '@multiformats/multiaddr'; import { peerIdFromString } from '@libp2p/peer-id'; -import { PeerId } from '@libp2p/interface-peer-id'; +import { PeerId } from '@libp2p/interface/peer-id'; import { mnemonicToAccount } from 'viem/accounts'; import { ProtocolContracts } from '@windingtree/sdk-contracts-manager'; import { createLogger } from '@windingtree/sdk-logger'; @@ -23,17 +21,18 @@ import { supplierId as spId, } from '@windingtree/sdk-utils'; import { - NodeOptions, - Node, createNode, - RequestEvent, + Node, + NodeOptions, NodeRequestManager, + RequestEvent, } from '@windingtree/sdk-node'; import { JobHandler } from '@windingtree/sdk-queue'; import { DealStatus, OfferData } from '@windingtree/sdk-types'; import { noncePeriod } from '@windingtree/sdk-constants'; import { CenterSub } from '@windingtree/sdk-pubsub'; import { DateTime } from 'luxon'; +import { EventHandler } from '@libp2p/interface/events'; const logger = createLogger('NodeMain'); @@ -274,8 +273,7 @@ export class NodeExample { !!this.node.libp2p && (this.node.libp2p.services.pubsub as CenterSub).started && this.node.libp2p.getPeers().length > 0 && - this.node.libp2p.getConnections(this.serverPeerId)[0]?.stat.status === - OPEN + this.node.libp2p.getConnections(this.serverPeerId)[0]?.status === 'open' ); } diff --git a/examples/manager/package.json b/examples/manager/package.json index b86dc78f..01e22270 100644 --- a/examples/manager/package.json +++ b/examples/manager/package.json @@ -21,7 +21,6 @@ "react-dom": "^18.2.0", "typescript": "^5.1.6", "viem": "^1.3.0", - "@libp2p/interfaces": "^3.3.2", "luxon": "^3.3.0" }, "dependencies": { diff --git a/examples/node/package.json b/examples/node/package.json index 3386b9c2..3ee8f4f6 100644 --- a/examples/node/package.json +++ b/examples/node/package.json @@ -27,7 +27,7 @@ "vite": "^4.4.4" }, "dependencies": { - "@libp2p/interfaces": "^3.3.2", + "@libp2p/interface": "^0.1.3", "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-constants": "workspace:*", "@windingtree/sdk-contracts-manager": "workspace:*", diff --git a/examples/node/src/index.ts b/examples/node/src/index.ts index 095be9ff..11c3a5dd 100644 --- a/examples/node/src/index.ts +++ b/examples/node/src/index.ts @@ -1,5 +1,5 @@ import 'dotenv/config'; -import { EventHandler } from '@libp2p/interfaces/events'; +import { EventHandler } from '@libp2p/interface/events'; import { DateTime } from 'luxon'; import { Address, diff --git a/packages/client/package.json b/packages/client/package.json index f0b1baf5..4621bbce 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -32,14 +32,12 @@ "@windingtree/sdk-test-utils": "workspace:*" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.2", - "@chainsafe/libp2p-yamux": "^4.0.2", - "@libp2p/interface-connection": "^5.1.1", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interfaces": "^3.3.2", - "@libp2p/mplex": "^8.0.4", - "@libp2p/peer-id": "^2.0.4", - "@libp2p/websockets": "^6.0.3", + "@chainsafe/libp2p-noise": "^13.0.1", + "@chainsafe/libp2p-yamux": "^5.0.0", + "@libp2p/interface": "^0.1.3", + "@libp2p/mplex": "^9.0.8", + "@libp2p/peer-id": "^3.0.3", + "@libp2p/websockets": "^7.0.9", "@multiformats/multiaddr": "^12.1.3", "@windingtree/sdk-contracts-manager": "workspace:*", "@windingtree/sdk-logger": "workspace:*", @@ -48,8 +46,8 @@ "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", - "libp2p": "^0.45.9", - "superjson": "^1.13.1", + "libp2p": "^0.46.14", + "superjson": "^2.0.0", "viem": "^1.3.0" }, "scripts": { diff --git a/packages/client/src/dealsManager.ts b/packages/client/src/dealsManager.ts index 563e8986..93a02e32 100644 --- a/packages/client/src/dealsManager.ts +++ b/packages/client/src/dealsManager.ts @@ -1,4 +1,4 @@ -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; +import { EventEmitter, CustomEvent } from '@libp2p/interface/events'; import { Address, Hash, diff --git a/packages/client/src/index.ts b/packages/client/src/index.ts index e1e03b26..5ffb38ac 100644 --- a/packages/client/src/index.ts +++ b/packages/client/src/index.ts @@ -1,5 +1,5 @@ -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; -import { createLibp2p, Libp2pOptions, Libp2p, Libp2pInit } from 'libp2p'; +import { CustomEvent, EventEmitter } from '@libp2p/interface/events'; +import { createLibp2p, Libp2p, Libp2pInit, Libp2pOptions } from 'libp2p'; import { noise } from '@chainsafe/libp2p-noise'; import { mplex } from '@libp2p/mplex'; import { yamux } from '@chainsafe/libp2p-yamux'; @@ -7,21 +7,19 @@ import { webSockets } from '@libp2p/websockets'; import { all } from '@libp2p/websockets/filters'; import { multiaddr, Multiaddr } from '@multiformats/multiaddr'; import { peerIdFromString } from '@libp2p/peer-id'; -import { PeerId } from '@libp2p/interface-peer-id'; -import { OPEN } from '@libp2p/interface-connection/status'; -import { stringify, parse } from 'superjson'; +import { PeerId } from '@libp2p/interface/peer-id'; +import { parse, stringify } from 'superjson'; import { - OfferData, GenericOfferOptions, GenericQuery, + OfferData, RequestData, ServerAddressOption, } from '@windingtree/sdk-types'; import { centerSub, CenterSub } from '@windingtree/sdk-pubsub'; -import { encodeText, decodeText } from '@windingtree/sdk-utils'; +import { decodeText, encodeText } from '@windingtree/sdk-utils'; import { createLogger } from '@windingtree/sdk-logger'; - /** * Requests registry exports */ @@ -184,7 +182,7 @@ export class Client< !!this.libp2p && (this.libp2p.services.pubsub as CenterSub).started && this.libp2p.getPeers().length > 0 && - this.libp2p.getConnections(this.serverPeerId)[0]?.stat.status === OPEN + this.libp2p.getConnections(this.serverPeerId)[0]?.status === 'open' ); } diff --git a/packages/client/src/requestsManager.ts b/packages/client/src/requestsManager.ts index 9186e851..4712eb22 100644 --- a/packages/client/src/requestsManager.ts +++ b/packages/client/src/requestsManager.ts @@ -1,4 +1,4 @@ -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; +import { EventEmitter, CustomEvent } from '@libp2p/interface/events'; import { GenericOfferOptions, GenericQuery, diff --git a/packages/node/package.json b/packages/node/package.json index b4014f05..3675f7e4 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -31,14 +31,12 @@ "@windingtree/sdk-test-utils": "workspace:*" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.2", - "@chainsafe/libp2p-yamux": "^4.0.2", - "@libp2p/interface-connection": "^5.1.1", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interfaces": "^3.3.2", - "@libp2p/mplex": "^8.0.4", - "@libp2p/peer-id": "^2.0.4", - "@libp2p/websockets": "^6.0.3", + "@chainsafe/libp2p-noise": "^13.0.1", + "@chainsafe/libp2p-yamux": "^5.0.0", + "@libp2p/interface": "^0.1.3", + "@libp2p/mplex": "^9.0.8", + "@libp2p/peer-id": "^3.0.3", + "@libp2p/websockets": "^7.0.9", "@multiformats/multiaddr": "^12.1.3", "@windingtree/sdk-contracts-manager": "workspace:*", "@windingtree/sdk-logger": "workspace:*", @@ -46,8 +44,8 @@ "@windingtree/sdk-pubsub": "workspace:*", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", - "libp2p": "^0.45.9", - "superjson": "^1.13.1", + "libp2p": "^0.46.14", + "superjson": "^2.0.0", "viem": "^1.3.0" }, "scripts": { diff --git a/packages/node/src/index.ts b/packages/node/src/index.ts index bb7b4d02..1476e9f7 100644 --- a/packages/node/src/index.ts +++ b/packages/node/src/index.ts @@ -1,25 +1,24 @@ -import { createLibp2p, Libp2pInit, Libp2pOptions, Libp2p } from 'libp2p'; +import { createLibp2p, Libp2p, Libp2pInit, Libp2pOptions } from 'libp2p'; import { noise } from '@chainsafe/libp2p-noise'; import { mplex } from '@libp2p/mplex'; import { yamux } from '@chainsafe/libp2p-yamux'; import { webSockets } from '@libp2p/websockets'; import { all } from '@libp2p/websockets/filters'; -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; -import { OPEN } from '@libp2p/interface-connection/status'; +import { CustomEvent, EventEmitter } from '@libp2p/interface/events'; import { multiaddr, Multiaddr } from '@multiformats/multiaddr'; -import { PeerId } from '@libp2p/interface-peer-id'; +import { PeerId } from '@libp2p/interface/peer-id'; import { peerIdFromString } from '@libp2p/peer-id'; -import { Hex, Hash, Chain } from 'viem'; +import { Chain, Hash, Hex } from 'viem'; import { stringify } from 'superjson'; import { mnemonicToAccount, privateKeyToAccount } from 'viem/accounts'; import { + ChainsConfigOption, Contracts, GenericOfferOptions, GenericQuery, OfferData, ServerAddressOption, - ChainsConfigOption, } from '@windingtree/sdk-types'; import { Account, @@ -224,7 +223,7 @@ export class Node< !!this.libp2p && (this.libp2p.services.pubsub as CenterSub).started && this.libp2p.getPeers().length > 0 && - this.libp2p.getConnections(this.serverPeerId)[0]?.stat.status === OPEN + this.libp2p.getConnections(this.serverPeerId)[0]?.status === 'open' ); } diff --git a/packages/node/src/requestManager.ts b/packages/node/src/requestManager.ts index fc474e94..a26c8dae 100644 --- a/packages/node/src/requestManager.ts +++ b/packages/node/src/requestManager.ts @@ -1,4 +1,4 @@ -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; +import { EventEmitter, CustomEvent } from '@libp2p/interface/events'; import { RequestData, GenericQuery, diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index bc8151a7..8c48e9da 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -28,16 +28,15 @@ "access": "public" }, "dependencies": { - "@chainsafe/libp2p-gossipsub": "^9.1.0", - "@libp2p/interface-connection": "^5.1.1", - "@libp2p/interface-peer-id": "^2.0.2", - "@libp2p/interface-pubsub": "^4.0.1", + "@chainsafe/libp2p-gossipsub": "^10.1.0", + "@libp2p/interface": "^0.1.3", "@multiformats/multiaddr": "^12.1.3", "@windingtree/sdk-constants": "workspace:*", "@windingtree/sdk-logger": "workspace:*", "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", + "libp2p": "^0.46.14", "multiformats": "^12.0.1", "superjson": "^1.13.1" }, diff --git a/packages/pubsub/src/index.ts b/packages/pubsub/src/index.ts index f68ba45f..2acbdb5c 100644 --- a/packages/pubsub/src/index.ts +++ b/packages/pubsub/src/index.ts @@ -6,9 +6,9 @@ import { } from '@chainsafe/libp2p-gossipsub'; import { ToSendGroupCount } from '@chainsafe/libp2p-gossipsub/metrics'; import { PeerIdStr, TopicStr } from '@chainsafe/libp2p-gossipsub/types'; -import { Message, PubSub } from '@libp2p/interface-pubsub'; -import { PeerId } from '@libp2p/interface-peer-id'; -import type { Direction } from '@libp2p/interface-connection'; +import { PeerId } from '@libp2p/interface/peer-id'; +import type { Direction } from '@libp2p/interface/connection'; +import type { Message, PubSub } from '@libp2p/interface/pubsub'; import { RPC } from '@chainsafe/libp2p-gossipsub/message'; import { Multiaddr } from '@multiformats/multiaddr'; import { sha256 } from 'multiformats/hashes/sha2'; @@ -56,7 +56,6 @@ export class CenterSub extends GossipSub { protected messages: MessagesCache | undefined; protected seenPeerMessageCache = new Map>(); protected messageTransformer: MessageTransformer; - /** * Creates an instance of CenterSub. * diff --git a/packages/queue/package.json b/packages/queue/package.json index 07750256..51d15f19 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -28,7 +28,7 @@ "access": "public" }, "dependencies": { - "@libp2p/interfaces": "^3.3.2", + "@libp2p/interface": "^0.1.3", "@windingtree/contracts": "^1.0.0", "@windingtree/sdk-logger": "workspace:*", "@windingtree/sdk-storage": "workspace:*", diff --git a/packages/queue/src/index.ts b/packages/queue/src/index.ts index 48dd8b7a..a277b8a3 100644 --- a/packages/queue/src/index.ts +++ b/packages/queue/src/index.ts @@ -1,4 +1,4 @@ -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; +import { EventEmitter, CustomEvent } from '@libp2p/interface/events'; import { simpleUid } from '@windingtree/contracts'; import { Storage } from '@windingtree/sdk-storage'; import { backoffWithJitter } from '@windingtree/sdk-utils'; diff --git a/packages/server/package.json b/packages/server/package.json index 5a1bde4c..f4703f26 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -28,18 +28,18 @@ "access": "public" }, "dependencies": { - "@chainsafe/libp2p-noise": "^12.0.2", - "@chainsafe/libp2p-yamux": "^4.0.2", - "@libp2p/interfaces": "^3.3.2", - "@libp2p/mplex": "^8.0.4", - "@libp2p/peer-id-factory": "^2.0.4", - "@libp2p/websockets": "^6.0.3", + "@chainsafe/libp2p-noise": "^13.0.1", + "@chainsafe/libp2p-yamux": "^5.0.0", + "@libp2p/interface": "^0.1.3", + "@libp2p/mplex": "^9.0.8", + "@libp2p/peer-id-factory": "^3.0.5", + "@libp2p/websockets": "^7.0.9", "@windingtree/sdk-logger": "workspace:*", "@windingtree/sdk-pubsub": "workspace:*", "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-types": "workspace:*", "@windingtree/sdk-utils": "workspace:*", - "libp2p": "^0.45.9" + "libp2p": "^0.46.14" }, "scripts": { "build": "tsup", diff --git a/packages/server/src/index.ts b/packages/server/src/index.ts index f1461c42..806072b3 100644 --- a/packages/server/src/index.ts +++ b/packages/server/src/index.ts @@ -1,11 +1,11 @@ -import { createLibp2p, Libp2pOptions, Libp2p } from 'libp2p'; +import { createLibp2p, Libp2p, Libp2pOptions } from 'libp2p'; import { createFromJSON } from '@libp2p/peer-id-factory'; import { noise } from '@chainsafe/libp2p-noise'; import { mplex } from '@libp2p/mplex'; import { yamux } from '@chainsafe/libp2p-yamux'; import { webSockets } from '@libp2p/websockets'; import { all } from '@libp2p/websockets/filters'; -import { EventEmitter, CustomEvent } from '@libp2p/interfaces/events'; +import { CustomEvent, EventEmitter } from '@libp2p/interface/events'; import { NodeKeyJson, PeerOptions } from '@windingtree/sdk-types'; import { centerSub, CenterSub } from '@windingtree/sdk-pubsub'; import { decodeText } from '@windingtree/sdk-utils'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b53a1df..ebc72b40 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -87,9 +87,9 @@ importers: specifier: ^1.13.1 version: 1.13.1 devDependencies: - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@types/luxon': specifier: ^3.3.0 version: 3.3.0 @@ -150,15 +150,9 @@ importers: examples/e2e-tests: devDependencies: - '@libp2p/interface-connection': - specifier: ^5.1.1 - version: 5.1.1 - '@libp2p/interface-peer-id': - specifier: ^2.0.2 - version: 2.0.2 - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@libp2p/peer-id': specifier: ^2.0.4 version: 2.0.4 @@ -232,9 +226,6 @@ importers: specifier: ^1.13.1 version: 1.13.1 devDependencies: - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 '@types/luxon': specifier: ^3.3.0 version: 3.3.0 @@ -292,9 +283,9 @@ importers: examples/node: dependencies: - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@windingtree/contracts': specifier: ^1.0.0 version: 1.0.0 @@ -375,29 +366,23 @@ importers: packages/client: dependencies: '@chainsafe/libp2p-noise': - specifier: ^12.0.2 - version: 12.0.2 + specifier: ^13.0.1 + version: 13.0.1 '@chainsafe/libp2p-yamux': - specifier: ^4.0.2 - version: 4.0.2 - '@libp2p/interface-connection': - specifier: ^5.1.1 - version: 5.1.1 - '@libp2p/interface-peer-id': - specifier: ^2.0.2 - version: 2.0.2 - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^5.0.0 + version: 5.0.0 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@libp2p/mplex': - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.8 + version: 9.0.8 '@libp2p/peer-id': - specifier: ^2.0.4 - version: 2.0.4 + specifier: ^3.0.3 + version: 3.0.3 '@libp2p/websockets': - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.9 + version: 7.0.9 '@multiformats/multiaddr': specifier: ^12.1.3 version: 12.1.3 @@ -423,11 +408,11 @@ importers: specifier: workspace:* version: link:../utils libp2p: - specifier: ^0.45.9 - version: 0.45.9 + specifier: ^0.46.14 + version: 0.46.14 superjson: - specifier: ^1.13.1 - version: 1.13.1 + specifier: ^2.0.0 + version: 2.0.0 viem: specifier: ^1.3.0 version: 1.3.0(typescript@5.1.6)(zod@3.21.4) @@ -542,29 +527,23 @@ importers: packages/node: dependencies: '@chainsafe/libp2p-noise': - specifier: ^12.0.2 - version: 12.0.2 + specifier: ^13.0.1 + version: 13.0.1 '@chainsafe/libp2p-yamux': - specifier: ^4.0.2 - version: 4.0.2 - '@libp2p/interface-connection': - specifier: ^5.1.1 - version: 5.1.1 - '@libp2p/interface-peer-id': - specifier: ^2.0.2 - version: 2.0.2 - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^5.0.0 + version: 5.0.0 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@libp2p/mplex': - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.8 + version: 9.0.8 '@libp2p/peer-id': - specifier: ^2.0.4 - version: 2.0.4 + specifier: ^3.0.3 + version: 3.0.3 '@libp2p/websockets': - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.9 + version: 7.0.9 '@multiformats/multiaddr': specifier: ^12.1.3 version: 12.1.3 @@ -587,11 +566,11 @@ importers: specifier: workspace:* version: link:../utils libp2p: - specifier: ^0.45.9 - version: 0.45.9 + specifier: ^0.46.14 + version: 0.46.14 superjson: - specifier: ^1.13.1 - version: 1.13.1 + specifier: ^2.0.0 + version: 2.0.0 viem: specifier: ^1.3.0 version: 1.3.0(typescript@5.1.6)(zod@3.21.4) @@ -658,17 +637,11 @@ importers: packages/pubsub: dependencies: '@chainsafe/libp2p-gossipsub': - specifier: ^9.1.0 - version: 9.1.0 - '@libp2p/interface-connection': - specifier: ^5.1.1 - version: 5.1.1 - '@libp2p/interface-peer-id': - specifier: ^2.0.2 - version: 2.0.2 - '@libp2p/interface-pubsub': - specifier: ^4.0.1 - version: 4.0.1 + specifier: ^10.1.0 + version: 10.1.0 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@multiformats/multiaddr': specifier: ^12.1.3 version: 12.1.3 @@ -687,6 +660,9 @@ importers: '@windingtree/sdk-utils': specifier: workspace:* version: link:../utils + libp2p: + specifier: ^0.46.14 + version: 0.46.14 multiformats: specifier: ^12.0.1 version: 12.0.1 @@ -696,9 +672,9 @@ importers: packages/queue: dependencies: - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@windingtree/contracts': specifier: ^1.0.0 version: 1.0.0 @@ -766,23 +742,23 @@ importers: packages/server: dependencies: '@chainsafe/libp2p-noise': - specifier: ^12.0.2 - version: 12.0.2 + specifier: ^13.0.1 + version: 13.0.1 '@chainsafe/libp2p-yamux': - specifier: ^4.0.2 - version: 4.0.2 - '@libp2p/interfaces': - specifier: ^3.3.2 - version: 3.3.2 + specifier: ^5.0.0 + version: 5.0.0 + '@libp2p/interface': + specifier: ^0.1.3 + version: 0.1.3 '@libp2p/mplex': - specifier: ^8.0.4 - version: 8.0.4 + specifier: ^9.0.8 + version: 9.0.8 '@libp2p/peer-id-factory': - specifier: ^2.0.4 - version: 2.0.4 + specifier: ^3.0.5 + version: 3.0.5 '@libp2p/websockets': - specifier: ^6.0.3 - version: 6.0.3 + specifier: ^7.0.9 + version: 7.0.9 '@windingtree/sdk-logger': specifier: workspace:* version: link:../logger @@ -799,8 +775,8 @@ importers: specifier: workspace:* version: link:../utils libp2p: - specifier: ^0.45.9 - version: 0.45.9 + specifier: ^0.46.14 + version: 0.46.14 packages/storage: dependencies: @@ -867,14 +843,6 @@ packages: engines: {node: '>=0.10.0'} dev: true - /@achingbrain/ip-address@8.1.0: - resolution: {integrity: sha512-Zus4vMKVRDm+R1o0QJNhD0PD/8qRGO3Zx8YPsFG5lANt5utVtGg3iHVGBSAF80TfQmhi8rP+Kg/OigdxY0BXHw==} - engines: {node: '>= 12'} - dependencies: - jsbn: 1.1.0 - sprintf-js: 1.1.2 - dev: false - /@achingbrain/nat-port-mapper@1.0.9: resolution: {integrity: sha512-w1M7dh7IsO5fvX9VQpH0w8MMphzLUl52Kf+paXTScNmFH4Ua+R6XI+x5p7LI3vY36JkTllTqAxNo8g1y0CMCrA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -2360,74 +2328,65 @@ packages: /@chainsafe/is-ip@2.0.1: resolution: {integrity: sha512-nqSJ8u2a1Rv9FYbyI8qpDhTYujaKEyLknNrTejLYoSWmdeg+2WB7R6BZqPZYfrJzDxVi3rl6ZQuoaEvpKRZWgQ==} - /@chainsafe/libp2p-gossipsub@9.1.0: - resolution: {integrity: sha512-zc1Jx0DcVNH0iAncDlyd0/rAN9mWCpIxrmrw8eC6/gvHDmi24y8orDH8Npj2Naydh/ukeDhG9Iqx4Dnoe8V51w==} + /@chainsafe/is-ip@2.0.2: + resolution: {integrity: sha512-ndGqEMG1W5WkGagaqOZHpPU172AGdxr+LD15sv3WIUvT5oCFUrG1Y0CW/v2Egwj4JXEvSibaIIIqImsm98y1nA==} + + /@chainsafe/libp2p-gossipsub@10.1.0: + resolution: {integrity: sha512-mOVYJAvxYRkh2HeggNFW/7ukEccQDVEI9LPhvlnJk7gnJhyJJ6mhZxUAaytfp3v3qTkmeBRnEL0eJOQBm+MoOA==} engines: {npm: '>=8.7.0'} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-connection-manager': 3.0.1 - '@libp2p/interface-keys': 1.0.8 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-peer-store': 2.0.4 - '@libp2p/interface-pubsub': 4.0.1 - '@libp2p/interface-registrar': 2.0.12 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@libp2p/peer-id': 2.0.4 - '@libp2p/peer-record': 5.0.4 - '@libp2p/pubsub': 7.0.3 - '@libp2p/topology': 4.0.3 - '@multiformats/multiaddr': 12.1.3 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/interface-internal': 0.1.6 + '@libp2p/logger': 3.0.3 + '@libp2p/peer-id': 3.0.3 + '@libp2p/pubsub': 8.0.7 + '@multiformats/multiaddr': 12.1.7 abortable-iterator: 5.0.1 - denque: 1.5.1 + denque: 2.1.0 it-length-prefixed: 9.0.1 it-pipe: 3.0.1 it-pushable: 3.2.1 - multiformats: 11.0.2 - protobufjs: 6.11.3 + multiformats: 12.0.1 + protobufjs: 7.2.4 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@chainsafe/libp2p-noise@12.0.2: - resolution: {integrity: sha512-bKlasdYJBXsCgcOw+gNNnpvNo3jD8BiSRpKrhYxEmBPQzesme15PBrj5Cx369PZEk4SvKSHS6dzL4oLxXqPSLw==} + /@chainsafe/libp2p-noise@13.0.1: + resolution: {integrity: sha512-eeOFubXyS9sK0oBg/qRfve6LVGzZX1vyULVidaKGTJr8Y4dtyU4+Btqw/aVo3o1lhdvb/qoY+p/Ep2pUsvJKhg==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-connection-encrypter': 4.0.1 - '@libp2p/interface-keys': 1.0.8 - '@libp2p/interface-metrics': 4.0.8 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/logger': 2.1.1 - '@libp2p/peer-id': 2.0.4 - '@noble/ciphers': 0.1.4 - '@noble/curves': 1.1.0 - '@noble/hashes': 1.3.1 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 + '@libp2p/peer-id': 3.0.3 + '@noble/ciphers': 0.3.0 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + it-byte-stream: 1.0.1 it-length-prefixed: 9.0.1 + it-length-prefixed-stream: 1.0.2 it-pair: 2.0.6 - it-pb-stream: 4.0.2 it-pipe: 3.0.1 it-stream-types: 2.0.1 protons-runtime: 5.0.1(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@chainsafe/libp2p-yamux@4.0.2: - resolution: {integrity: sha512-p0m/4ab4JLaIQqUtxvm8bSqdt9sb0uXX8PFj1CQM1eJLeV1LxzzygaSOeLxN/5ckHCuK7q/9eb9xybvl6vz/JA==} + /@chainsafe/libp2p-yamux@5.0.0: + resolution: {integrity: sha512-aWTnBPR2hJt0A2y579sMtZVB6IqgSSHlZ6Eg+WDxNZQ0zcexafuruZQDj+z3FUTNPz+E8IeuyCi7tjI4IEehjw==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-stream-muxer': 4.1.2 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 abortable-iterator: 5.0.1 - any-signal: 4.1.1 + it-foreach: 2.0.4 it-pipe: 3.0.1 it-pushable: 3.2.1 uint8arraylist: 2.4.3 @@ -2965,121 +2924,38 @@ packages: protons-runtime: 5.0.1(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 uint8arrays: 4.0.4 + dev: true - /@libp2p/interface-address-manager@3.0.1: - resolution: {integrity: sha512-8N1nfOtZ/CnZ/cL0Bnj59fhcSs7orI4evmNVsv2DM1VaNHXqc9tPy8JmQE2HRjrUXeUPwtzzG2eoP7l0ZYdC0g==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@multiformats/multiaddr': 12.1.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-connection-encrypter@4.0.1: - resolution: {integrity: sha512-fOtZpaFL2f5vID/RaBpVMAR9OKx5DmDT/yMEFTCarNc6Bb37fWwClI4WNCtoVbDQwcnr4H4ZIo0+9yCxjEIjjQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-id': 2.0.2 - it-stream-types: 2.0.1 - dev: false - - /@libp2p/interface-connection-gater@3.0.1: - resolution: {integrity: sha512-3a+EmcKFIdYVM6tmmIKZt/4fREPApA/Z/PZHOEa4lqJA9c/BHO1HTq0YzEoYsptudYTcdhQLgpYzh8FVhfZGDg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-id': 2.0.2 - '@multiformats/multiaddr': 12.1.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-connection-manager@3.0.1: - resolution: {integrity: sha512-7ZAvzOWfHs3BtaoZoWsT+Ks1bo6HjyRMq1SJdFWDJ+ZkYEzrf6sdtQwsX8eXhwRDO6PuzpUDqLZ9TNQ2GVKEEw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/crypto@2.0.5: + resolution: {integrity: sha512-m6Rn7i9q3SHCzMUBkEwZgAKS4evpGQ4SEx/YD96pM0ZoPtU5PFO0psfrerraanxFBh8wUX4vkCtKfyTPH7F+bQ==} dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interfaces': 3.3.2 - '@libp2p/peer-collections': 3.0.2 - '@multiformats/multiaddr': 12.1.3 + '@libp2p/interface': 0.1.3 + '@noble/curves': 1.2.0 + '@noble/hashes': 1.3.2 + multiformats: 12.0.1 + node-forge: 1.3.1 + protons-runtime: 5.0.1(uint8arraylist@2.4.3) + uint8arraylist: 2.4.3 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/interface-connection@5.1.1: - resolution: {integrity: sha512-ytknMbuuNW72LYMmTP7wFGP5ZTaUSGBCmV9f+uQ55XPcFHtKXLtKWVU/HE8IqPmwtyU8AO7veGoJ/qStMHNRVA==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/interface-internal@0.1.6: + resolution: {integrity: sha512-n4Sv9tSr+2QRN7tHShmUJILQRoIPRPPkl0Zr8mVOW91XcdN2CfLYrzqeM1Yvl/iZx98bNMZXJveZV9OVuBynuQ==} dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interfaces': 3.3.2 - '@multiformats/multiaddr': 12.1.3 - it-stream-types: 2.0.1 + '@libp2p/interface': 0.1.3 + '@libp2p/peer-collections': 4.0.5 + '@multiformats/multiaddr': 12.1.7 uint8arraylist: 2.4.3 transitivePeerDependencies: - supports-color - - /@libp2p/interface-content-routing@2.1.1: - resolution: {integrity: sha512-nRPOUWgq1K1fDr3FKW93Tip7aH8AFefCw3nJygL4crepxWTSGw95s1GyDpC7t0RJkWTRNHsqZvsFsJ9FkHExKw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-info': 1.0.10 - '@libp2p/interfaces': 3.3.2 - multiformats: 11.0.2 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-keychain@2.0.5: - resolution: {integrity: sha512-mb7QNgn9fIvC7CaJCi06GJ+a6DN6RVT9TmEi0NmedZGATeCArPeWWG7r7IfxNVXb9cVOOE1RzV1swK0ZxEJF9Q==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-id': 2.0.2 - multiformats: 11.0.2 dev: false /@libp2p/interface-keys@1.0.8: resolution: {integrity: sha512-CJ1SlrwuoHMquhEEWS77E+4vv7hwB7XORkqzGQrPQmA9MRdIEZRS64bA4JqCLUDa4ltH0l+U1vp0oZHLT67NEA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} - - /@libp2p/interface-libp2p@3.2.0: - resolution: {integrity: sha512-Vow6xNdjpQ0M/Kt3EDz1qE/Os5OZUyhFt0YTPU5Fp3/kXw/6ocsxYq/Bzird/96gjUjU5/i+Vukn4WgctJf55Q==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-content-routing': 2.1.1 - '@libp2p/interface-keychain': 2.0.5 - '@libp2p/interface-metrics': 4.0.8 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-peer-info': 1.0.10 - '@libp2p/interface-peer-routing': 1.1.1 - '@libp2p/interface-peer-store': 2.0.4 - '@libp2p/interface-registrar': 2.0.12 - '@libp2p/interface-transport': 4.0.3 - '@libp2p/interfaces': 3.3.2 - '@multiformats/multiaddr': 12.1.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-metrics@4.0.8: - resolution: {integrity: sha512-1b9HjYyJH0m35kvPHipuoz2EtYCxyq34NUhuV8VK1VNtrouMpA3uCKp5FI7yHCA6V6+ux1R3UriKgNFOSGbIXQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-peer-discovery@2.0.0: - resolution: {integrity: sha512-Mien5t3Tc+ntP5p50acKUYJN90ouMnq1lOTQDKQNvGcXoajG8A1AEYLocnzVia/MXiexuj6S/Q28WBBacoOlBg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-info': 1.0.10 - '@libp2p/interfaces': 3.3.2 - transitivePeerDependencies: - - supports-color - dev: false + dev: true /@libp2p/interface-peer-id@2.0.2: resolution: {integrity: sha512-9pZp9zhTDoVwzRmp0Wtxw0Yfa//Yc0GqBCJi3EznBDE6HGIAVvppR91wSh2knt/0eYg0AQj7Y35VSesUTzMCUg==} @@ -3087,115 +2963,35 @@ packages: dependencies: multiformats: 11.0.2 - /@libp2p/interface-peer-info@1.0.10: - resolution: {integrity: sha512-HQlo8NwQjMyamCHJrnILEZz+YwEOXCB2sIIw3slIrhVUYeYlTaia1R6d9umaAeLHa255Zmdm4qGH8rJLRqhCcg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@multiformats/multiaddr': 12.1.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-peer-routing@1.1.1: - resolution: {integrity: sha512-/XEhwob9qXjdmI8PBcc+qFin32xmtyoC58nRpq8RliqHY5uOVWiHfZoNtdOXIsNvzVvq5FqlHOWt71ofxXTtlg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/interface@0.1.3: + resolution: {integrity: sha512-C1O7Xqd2TGVWrIOEDx6kGJSk4YOysWGmYG5Oh3chnsCY0wjUSsLDpl9+wKrdiM/lJbAlHlV65ZOvSkIQ9cWPBQ==} dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-peer-info': 1.0.10 - '@libp2p/interfaces': 3.3.2 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-peer-store@2.0.4: - resolution: {integrity: sha512-jNvBK3O1JPJqSiDN2vkb+PV8bTPnYdP54nxsLtut1BWukNm610lwzwleV7CetFI4bJCn6g+BgBvvq8fdADy0tA==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@multiformats/multiaddr': 12.1.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-pubsub@4.0.1: - resolution: {integrity: sha512-PIc5V/J98Yr1ZTHh8lQshP7GdVUh+pKNIqj6wGaDmXs8oQLB40qKCjcpHQNlAnv2e1Bh9mEH2GXv5sGZOA651A==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interfaces': 3.3.2 - it-pushable: 3.2.1 - uint8arraylist: 2.4.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-record@2.0.7: - resolution: {integrity: sha512-AFPytZWI+p8FJWP0xuK5zbSjalLAOIMzEed2lBKdRWvdGBQUHt9ENLTkfkI9G7p/Pp3hlhVzzBXdIErKd+0GxQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-peer-id': 2.0.2 - uint8arraylist: 2.4.3 - dev: false - - /@libp2p/interface-registrar@2.0.12: - resolution: {integrity: sha512-EyCi2bycC2rn3oPB4Swr7EqBsvcaWd6RcqR6zsImNIG9BKc4/R1gl6iaF861JaELYgYmzBMS31x1rQpVz5UekQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-id': 2.0.2 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/interface-stream-muxer@4.1.2: - resolution: {integrity: sha512-dQJcn67UaAa8YQFRJDhbo4uT453z/2lCzD/ZwTk1YOqJxATXbXgVcB8dXDQFEUiUX3ZjVQ1IBu+NlQd+IZ++zw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 + '@multiformats/multiaddr': 12.1.7 abortable-iterator: 5.0.1 - any-signal: 4.1.1 it-pushable: 3.2.1 it-stream-types: 2.0.1 + multiformats: 12.0.1 + p-defer: 4.0.0 + race-signal: 1.0.1 uint8arraylist: 2.4.3 transitivePeerDependencies: - supports-color - dev: false - - /@libp2p/interface-transport@4.0.3: - resolution: {integrity: sha512-jXFQ3blhFMEyQbFw/U8Glo3F/fUO5LEaX5HIdeqNpCliK+XnwTfpkcaG+WsJrcApWK4FFyUHc+GGqiWR0hAFFg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-stream-muxer': 4.1.2 - '@libp2p/interfaces': 3.3.2 - '@multiformats/multiaddr': 12.1.3 - it-stream-types: 2.0.1 - transitivePeerDependencies: - - supports-color - dev: false /@libp2p/interfaces@3.3.2: resolution: {integrity: sha512-p/M7plbrxLzuQchvNwww1Was7ZeGE2NaOFulMaZBYIihU8z3fhaV+a033OqnC/0NTX/yhfdNOG7znhYq3XoR/g==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} - /@libp2p/keychain@2.0.1: - resolution: {integrity: sha512-A59jilLYS+8Paq38Z96uSAxbD+3+3LJZx2qcHdMpTyqDO7yfJCbMPfVhP6EKmH5EY3z3qxBwUPVw35P4F4fslg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/keychain@3.0.5: + resolution: {integrity: sha512-D8Tisc5yi2+ykM4Yw4Qsan/hGITF+jfHMC6Nti1upOOLAhGFpm92if/hkb2rZH3Q1iXs7l3fIhgOs9VayNplhA==} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-keychain': 2.0.5 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@libp2p/peer-id': 2.0.4 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 + '@libp2p/peer-id': 3.0.3 interface-datastore: 8.2.3 merge-options: 3.0.4 sanitize-filename: 1.6.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false @@ -3205,7 +3001,7 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: '@libp2p/interface-peer-id': 2.0.2 - '@multiformats/multiaddr': 12.1.3 + '@multiformats/multiaddr': 12.1.7 debug: 4.3.4 interface-datastore: 8.2.3 multiformats: 11.0.2 @@ -3213,34 +3009,41 @@ packages: - supports-color dev: false - /@libp2p/mplex@8.0.4: - resolution: {integrity: sha512-or3F5sGl8cw3TbnQgmkJ8z7/c97rwuzoy6f3b9gmkEVN8EzdxG2jOq+TEsgXzLz1GekRUR8nuDhliJ3UPhUnFw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/logger@3.0.3: + resolution: {integrity: sha512-85ioPX10QN4ZOZeurAZe5sQeRUCkIBT2DikKRbE/AIWKauIKHvvIrN4CSdCdzLw29XNA+xxNO2FVkf51HGgCeQ==} dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-stream-muxer': 4.1.2 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 + '@libp2p/interface': 0.1.3 + '@multiformats/multiaddr': 12.1.7 + debug: 4.3.4 + interface-datastore: 8.2.3 + multiformats: 12.0.1 + transitivePeerDependencies: + - supports-color + dev: false + + /@libp2p/mplex@9.0.8: + resolution: {integrity: sha512-NHsoBWEImqr7nVNujNmedFW5ctefPG4kMAW0+UhLwJsq6X0p3qtaGbAAQZm6PqI7KIE16lEXFJkZfFFgMOpXJQ==} + dependencies: + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 abortable-iterator: 5.0.1 - any-signal: 4.1.1 benchmark: 2.1.4 it-batched-bytes: 2.0.3 it-pushable: 3.2.1 it-stream-types: 2.0.1 - rate-limiter-flexible: 2.4.1 + rate-limiter-flexible: 3.0.0 + uint8-varint: 2.0.1 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 - varint: 6.0.0 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/multistream-select@3.1.9: - resolution: {integrity: sha512-iSNqr8jXvOrkNTyA43h/ARs4wd0Rd55/D6oFRndLcV4yQSUMmfjl7dUcbC5MAw+5/sgskfDx9TMawSwNq47Qwg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/multistream-select@4.0.3: + resolution: {integrity: sha512-6iBYf/TAqi0oqusZ3LJ3DC0odABRukuLN+4Xh7tDmHCJX0tCjSSRibRYsiFcBNQMpcI0btRkQ0dZ0KqKhQ2kUw==} dependencies: - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 abortable-iterator: 5.0.1 it-first: 3.0.2 it-handshake: 4.1.3 @@ -3250,32 +3053,32 @@ packages: it-pushable: 3.2.1 it-reader: 6.0.4 it-stream-types: 2.0.1 + uint8-varint: 2.0.1 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/peer-collections@3.0.2: - resolution: {integrity: sha512-3vRVMWVRCF6dVs/1/CHbw4YSv83bcqjZuAt9ZQHW85vn6OfHNFQesOHWT1TbRBuL8TSb//IwJkOfTAVLd6Mymw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/peer-collections@4.0.5: + resolution: {integrity: sha512-GdbVufdDLhYyHbDBO2juK54Nm+Cdu01ws0N0hNB0yVLM7GIP075RLgSO/0vTpLoPS1cEufKPsYfl4Bb5nKHaRg==} dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/peer-id': 2.0.4 + '@libp2p/interface': 0.1.3 + '@libp2p/peer-id': 3.0.3 dev: false - /@libp2p/peer-id-factory@2.0.4: - resolution: {integrity: sha512-+0D+oklFzHpjRI3v7uw3PMMx00P36DV7YvAgL0+gpos0VzR/BI9tRiM6dpObZTrQ1hxp78F03p+qR1Zy9Qnmuw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/peer-id-factory@3.0.5: + resolution: {integrity: sha512-i7h/u3zDvcj8+GR+kpazmjikr3A6Rr5flVZmrTZfarkq5qAmD1bWd0vbgPrtKEgbhT+1S8NL3jR05/n7cbF7Tw==} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-keys': 1.0.8 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/peer-id': 2.0.4 - multiformats: 11.0.2 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/peer-id': 3.0.3 + multiformats: 12.0.1 protons-runtime: 5.0.1(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 + transitivePeerDependencies: + - supports-color dev: false /@libp2p/peer-id@2.0.4: @@ -3285,108 +3088,83 @@ packages: '@libp2p/interface-peer-id': 2.0.2 '@libp2p/interfaces': 3.3.2 multiformats: 11.0.2 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 + dev: true - /@libp2p/peer-record@5.0.4: - resolution: {integrity: sha512-e+AArf7pwMLqF24mehTe1OYjr1v0SOKshVrI1E9YH/Cb1F3ZZuK3smyGmnLaS4JlqsarRCMSe3V50tRkqMFY7g==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/peer-id@3.0.3: + resolution: {integrity: sha512-IPVeywoC40bDd3ohtAIzpN8AOkMmD3U0BjdrFz/5ZbNP1+4n2gDIAwVzkAbF/t1iYYS4CX1TWfHuMqaMvd8l1A==} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-record': 2.0.7 - '@libp2p/interfaces': 3.3.2 - '@libp2p/peer-id': 2.0.4 - '@libp2p/utils': 3.0.12 - '@multiformats/multiaddr': 12.1.3 + '@libp2p/interface': 0.1.3 + multiformats: 12.0.1 + uint8arrays: 4.0.6 + dev: false + + /@libp2p/peer-record@6.0.6: + resolution: {integrity: sha512-SNFafmUrnEOB2zplYJVjheN5UVFbi2UBdrYfIwi4SEaPA4ZFprnWBeQcVaLUSq7t2JkBGZUmWwtj4teVIxr60g==} + dependencies: + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/peer-id': 3.0.3 + '@libp2p/utils': 4.0.4 + '@multiformats/multiaddr': 12.1.7 protons-runtime: 5.0.1(uint8arraylist@2.4.3) - uint8-varint: 1.0.6 + uint8-varint: 2.0.1 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/peer-store@8.2.1: - resolution: {integrity: sha512-mr0GsZ7zucta3l5EblOGrBeVgdTVujRJ9WC+FmnYErQe023SRJevAZEv1WeMinMGVGL6CY+gmWw0oLpExu9AWg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/peer-store@9.0.6: + resolution: {integrity: sha512-aBAvRKKg2Hsf0/bGrHEcxr6cGL8RDJhBx2xBhNuu7sROMd0isPrKNxfnrQKadYMxlQUnGzIEY3qFVQJJPFHZvA==} dependencies: - '@libp2p/interface-libp2p': 3.2.0 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-peer-store': 2.0.4 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@libp2p/peer-collections': 3.0.2 - '@libp2p/peer-id': 2.0.4 - '@libp2p/peer-id-factory': 2.0.4 - '@libp2p/peer-record': 5.0.4 - '@multiformats/multiaddr': 12.1.3 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 + '@libp2p/peer-collections': 4.0.5 + '@libp2p/peer-id': 3.0.3 + '@libp2p/peer-id-factory': 3.0.5 + '@libp2p/peer-record': 6.0.6 + '@multiformats/multiaddr': 12.1.7 interface-datastore: 8.2.3 it-all: 3.0.2 mortice: 3.0.1 - multiformats: 11.0.2 + multiformats: 12.0.1 protons-runtime: 5.0.1(uint8arraylist@2.4.3) uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/pubsub@7.0.3: - resolution: {integrity: sha512-BrUBQ6ljN1tU+2Hn1Vq+ZT/foVBGUVIywqoavNrFw5CmaBBTGuVRrmqE/MUToIS8dhonpW5RNCRabz3woq/4iQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/pubsub@8.0.7: + resolution: {integrity: sha512-gpkKNMlxdF/tObBPE/3pY3aItfleLWUr7ghEpnK2CcRWkmb+ZACGC2MrYM9IbdHn3/jfQFSWoxJwMcoFJ8IJ0w==} dependencies: - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-pubsub': 4.0.1 - '@libp2p/interface-registrar': 2.0.12 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@libp2p/peer-collections': 3.0.2 - '@libp2p/peer-id': 2.0.4 - '@libp2p/topology': 4.0.3 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/interface-internal': 0.1.6 + '@libp2p/logger': 3.0.3 + '@libp2p/peer-collections': 4.0.5 + '@libp2p/peer-id': 3.0.3 abortable-iterator: 5.0.1 it-length-prefixed: 9.0.1 it-pipe: 3.0.1 it-pushable: 3.2.1 - multiformats: 11.0.2 + multiformats: 12.0.1 p-queue: 7.3.4 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false - /@libp2p/topology@4.0.3: - resolution: {integrity: sha512-uXd9ZYpmgb+onMTypsAPUlvKKeY20HMtxwsjAMEfDa29yqshK8DiEunHZNjLmtXaMIIO9CBl2w5ykjt5TtFsBQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/utils@4.0.4: + resolution: {integrity: sha512-V++nWaCEO5QBk800SJ3kzzVn62cyBLt7fzVPDvVnxPyfLBn9prfShYb7XmvuZrnGSRCaUvD3b+q7CHGUEcdP2g==} dependencies: - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-registrar': 2.0.12 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/tracked-map@3.0.3: - resolution: {integrity: sha512-7wpIXZtZFJrN/P7PCiYaeUEALXrmqWv6s2ilHELLDGE3yziVW2fpcISNXuCbw/LLarVkS8fzHqw0cjonsgp4hQ==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@libp2p/interface-metrics': 4.0.8 - transitivePeerDependencies: - - supports-color - dev: false - - /@libp2p/utils@3.0.12: - resolution: {integrity: sha512-n6RuDKZV4kQpUucMcFf3QLY1wLIa2MWwTmFdmWvfuN/GjK9XMMphz7J++46Crf4Pc90rHJ2vh0efp98LipD3Gw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - '@achingbrain/ip-address': 8.1.0 - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-peer-store': 2.0.4 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@multiformats/multiaddr': 12.1.3 - abortable-iterator: 5.0.1 + '@chainsafe/is-ip': 2.0.2 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 + '@multiformats/multiaddr': 12.1.7 + '@multiformats/multiaddr-matcher': 1.0.2 is-loopback-addr: 2.0.1 it-stream-types: 2.0.1 private-ip: 3.0.1 @@ -3395,23 +3173,19 @@ packages: - supports-color dev: false - /@libp2p/websockets@6.0.3: - resolution: {integrity: sha512-pwOr3iAbczWmmCg1nHnC2Dl0Ek81Y6LE8ptImiUbuZ08q1E/fTumM8pRNmrrsogSshG4lugebArIO9SNMylJZg==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /@libp2p/websockets@7.0.9: + resolution: {integrity: sha512-+MJKxGrLSv/aSHpdhlc05sVVPWg9TVJMCHfpN3WXG0B9DVk/qLdX+mCHpmPvRRdrDoYx6QfWvzHmhDHwfKNAdg==} dependencies: - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-transport': 4.0.3 - '@libp2p/interfaces': 3.3.2 - '@libp2p/logger': 2.1.1 - '@libp2p/utils': 3.0.12 + '@libp2p/interface': 0.1.3 + '@libp2p/logger': 3.0.3 + '@libp2p/utils': 4.0.4 '@multiformats/mafmt': 12.1.5 - '@multiformats/multiaddr': 12.1.3 + '@multiformats/multiaddr': 12.1.7 '@multiformats/multiaddr-to-uri': 9.0.7 '@types/ws': 8.5.5 abortable-iterator: 5.0.1 it-ws: 6.0.1 p-defer: 4.0.0 - p-timeout: 6.1.2 wherearewe: 2.0.1 ws: 8.13.0 transitivePeerDependencies: @@ -3471,6 +3245,16 @@ packages: - supports-color dev: false + /@multiformats/multiaddr-matcher@1.0.2: + resolution: {integrity: sha512-YzviFV31TsDbatWhEmkNnpWC82F/Wfc+alaOBT94Lk6KJeKKfzsaLhYPsjyhElXiUtCKvB3p5e4+WsE5ZYy1kg==} + dependencies: + '@chainsafe/is-ip': 2.0.2 + '@multiformats/multiaddr': 12.1.7 + multiformats: 12.0.1 + transitivePeerDependencies: + - supports-color + dev: false + /@multiformats/multiaddr-to-uri@9.0.7: resolution: {integrity: sha512-i3ldtPMN6XJt+MCi34hOl0wGuGEHfWWMw6lmNag5BpckPwPTf9XGOOFMmh7ed/uO3Vjah/g173iOe61HTQVoBA==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -3494,6 +3278,20 @@ packages: transitivePeerDependencies: - supports-color + /@multiformats/multiaddr@12.1.7: + resolution: {integrity: sha512-MZRj+uUrtF2WqgByrsPolrdyPDSFstw7Fe0ewabWgWl27fcOmfDOSrEt2aUVkSzapXbyCG7JQh0QvimmTF4aMA==} + engines: {node: '>=18.0.0', npm: '>=8.6.0'} + dependencies: + '@chainsafe/is-ip': 2.0.2 + '@chainsafe/netmask': 2.0.0 + '@libp2p/interface': 0.1.3 + dns-over-http-resolver: 2.1.1 + multiformats: 12.0.1 + uint8-varint: 2.0.1 + uint8arrays: 4.0.6 + transitivePeerDependencies: + - supports-color + /@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1: resolution: {integrity: sha512-54/JRvkLIzzDWshCWfuhadfrfZVPiElY8Fcgmg1HroEly/EDSszzhBAsarCux+D/kOslTRquNzuyGSmUSTTHGg==} dependencies: @@ -3505,8 +3303,8 @@ packages: hasBin: true dev: true - /@noble/ciphers@0.1.4: - resolution: {integrity: sha512-d3ZR8vGSpy3v/nllS+bD/OMN5UZqusWiQqkyj7AwzTnhXFH72pF5oB4Ach6DQ50g5kXxC28LdaYBEpsyv9KOUQ==} + /@noble/ciphers@0.3.0: + resolution: {integrity: sha512-ldbrnOjmNRwFdXcTM6uXDcxpMIFrbzAWNnpBPp4oTJTFF0XByGD6vf45WrehZGXRQTRVV+Zm8YP+EgEf+e4cWA==} dev: false /@noble/curves@1.0.0: @@ -3514,14 +3312,15 @@ packages: dependencies: '@noble/hashes': 1.3.0 - /@noble/curves@1.1.0: - resolution: {integrity: sha512-091oBExgENk/kGj3AZmtBDMpxQPDtxQABR2B9lb1JbVTs6ytdzZNwvhxQ4MWasRNEzlbEH8jCWFCwhF/Obj5AA==} + /@noble/curves@1.2.0: + resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} dependencies: - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.2 dev: false /@noble/ed25519@1.7.3: resolution: {integrity: sha512-iR8GBkDt0Q3GyaVcIu7mSsVIqnFbkbRzGLWlvhwunacoLwt4J3swfKhfaM6rN6WY+TBGoYT1GtT1mIh2/jGbRQ==} + dev: true /@noble/hashes@1.3.0: resolution: {integrity: sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg==} @@ -3530,8 +3329,14 @@ packages: resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} engines: {node: '>= 16'} + /@noble/hashes@1.3.2: + resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} + engines: {node: '>= 16'} + dev: false + /@noble/secp256k1@1.7.1: resolution: {integrity: sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==} + dev: true /@nodelib/fs.scandir@2.1.5: resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} @@ -4119,10 +3924,6 @@ packages: '@types/node': 20.4.2 dev: true - /@types/long@4.0.2: - resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} - dev: false - /@types/luxon@3.3.0: resolution: {integrity: sha512-uKRI5QORDnrGFYgcdAVnHvEIvEZ8noTpP/Bg+HeUzZghwinDlIS87DEenV5r1YoOF9G4x600YsUXLWZ19rmTmg==} dev: true @@ -4178,8 +3979,8 @@ packages: '@types/node': 20.4.2 dev: true - /@types/retry@0.12.1: - resolution: {integrity: sha512-xoDlM2S4ortawSWORYqsdU+2rxdh4LRW9ytc3zmT37RIKQh6IHyKwwtKhKis9ah8ol07DCkZxPt8BBvPjC6v4g==} + /@types/retry@0.12.2: + resolution: {integrity: sha512-XISRgDJ2Tc5q4TRqvgJtzsRkFYNJzZrhTdtMoGVBttwzzQJkPnS3WWTFc7kuDRoPtPakl+T+OfdEUjYJj7Jbow==} dev: false /@types/scheduler@0.16.3: @@ -4710,7 +4511,6 @@ packages: dependencies: get-iterator: 2.0.0 it-stream-types: 2.0.1 - dev: false /abstract-level@1.0.3: resolution: {integrity: sha512-t6jv+xHy+VYwc4xqZMn2Pa9DjcdzvzZmQGRjTFc8spIbRGHgBrEKbPq+rYXc7CCo0lxgYvSgKVg9qZAhpVQSjA==} @@ -6011,7 +5811,7 @@ packages: it-pushable: 3.2.1 it-sort: 3.0.2 it-take: 3.0.2 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 transitivePeerDependencies: - supports-color dev: false @@ -6149,6 +5949,11 @@ packages: object-keys: 1.1.1 dev: true + /delay@6.0.0: + resolution: {integrity: sha512-2NJozoOHQ4NuZuVIr5CWd0iiLVIRSDepakaovIN+9eIDHEhdCAEvSy2cuf1DCrPPQLvHmbqTHODlhHg8UCy4zw==} + engines: {node: '>=16'} + dev: false + /delayed-stream@1.0.0: resolution: {integrity: sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==} engines: {node: '>=0.4.0'} @@ -6158,8 +5963,8 @@ packages: resolution: {integrity: sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==} dev: true - /denque@1.5.1: - resolution: {integrity: sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==} + /denque@2.1.0: + resolution: {integrity: sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==} engines: {node: '>=0.10'} dev: false @@ -6936,7 +6741,6 @@ packages: /events@3.3.0: resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} engines: {node: '>=0.8.x'} - dev: true /evp_bytestokey@1.0.3: resolution: {integrity: sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==} @@ -7288,7 +7092,6 @@ packages: /get-iterator@2.0.0: resolution: {integrity: sha512-BDJawD5PU2gZv6Vlp8O28H4GnZcsr3h9gZUvnAP5xXP3WOy/QAoOsyMepSkw21jur+4t5Vppde72ChjhTIzxzg==} - dev: false /get-pkg-repo@4.2.1: resolution: {integrity: sha512-2+QbHjFRfGB74v/pYWjd5OhU3TDIC2Gv/YKUTk/tCvAz0pkn/Mz6P3uByuBimLOcPvN2jYdScl3xGFSrx0jEcA==} @@ -7915,7 +7718,7 @@ packages: dependencies: interface-store: 5.1.2 nanoid: 4.0.2 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 dev: false /interface-store@5.1.2: @@ -8104,6 +7907,11 @@ packages: engines: {node: '>= 0.4'} dev: true + /is-network-error@1.0.0: + resolution: {integrity: sha512-P3fxi10Aji2FZmHTrMPSNFbNC6nnp4U5juPAIjXPHkUNubi4+qK7vvdsaNpAUwXslhYm9oyjEYTxs1xd/+Ph0w==} + engines: {node: '>=16'} + dev: false + /is-npm@4.0.0: resolution: {integrity: sha512-96ECIfh9xtDDlPylNPXhzjsykHsMJZ18ASpaWzQyBr4YRTcVjUvzaHayDAES2oU/3KpljhHUjtSRNiDwi0F0ig==} engines: {node: '>=8'} @@ -8328,6 +8136,14 @@ packages: uint8arraylist: 2.4.3 dev: false + /it-byte-stream@1.0.1: + resolution: {integrity: sha512-Nu1/y8ObmrEmpHfWBHrWKtla9xwTdnMceB7v1z7tM+H84VP5Ou59wyFiJHsyvuIETLfKFY+TfhEbOJy24FRGjQ==} + dependencies: + it-pushable: 3.2.1 + it-stream-types: 2.0.1 + uint8arraylist: 2.4.3 + dev: false + /it-drain@3.0.2: resolution: {integrity: sha512-0hJvS/4Ktt9wT/bktmovjjMAY8r6FCsXqpL3zjqBBNwoL21VgQfguEnwbLSGuCip9Zq1vfU43cbHkmaRZdBfOg==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -8345,6 +8161,12 @@ packages: engines: {node: '>=16.0.0', npm: '>=7.0.0'} dev: false + /it-foreach@2.0.4: + resolution: {integrity: sha512-txxcoc09g+KdLyOapxAuB12H9zUb2FuZC/TqSXRT+YR0T5fHnvcDIhspgvx/e/HiPKlKjOR8onA0qtuiAtcXqg==} + dependencies: + it-peekable: 3.0.1 + dev: false + /it-handshake@4.1.3: resolution: {integrity: sha512-V6Lt9A9usox9iduOX+edU1Vo94E6v9Lt9dOvg3ubFaw1qf5NCxXLi93Ao4fyCHWDYd8Y+DUhadwNtWVyn7qqLg==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -8356,6 +8178,16 @@ packages: uint8arraylist: 2.4.3 dev: false + /it-length-prefixed-stream@1.0.2: + resolution: {integrity: sha512-gWevodoctgwWUaRJN9t+xEs1H1GQNYAjLCR7FO50fon9Ph4OJGgrxPKTc26QXKrC/cIQZLkHYClphUw0wl1k2A==} + dependencies: + it-byte-stream: 1.0.1 + it-length-prefixed: 9.0.1 + it-stream-types: 2.0.1 + uint8-varint: 2.0.1 + uint8arraylist: 2.4.3 + dev: false + /it-length-prefixed@9.0.1: resolution: {integrity: sha512-ZBD8ZFLERj8d1q9CeBtk0eJ4EpeI3qwnkmWtemBSm3ZI2dM8PUweNVk5haZ2vw3EIq2uYQiabV9YwNm6EASM4A==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -8364,7 +8196,7 @@ packages: it-stream-types: 2.0.1 uint8-varint: 1.0.6 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 dev: false /it-map@3.0.3: @@ -8396,19 +8228,6 @@ packages: p-defer: 4.0.0 dev: false - /it-pb-stream@4.0.2: - resolution: {integrity: sha512-wZ4Bvx2MfwamZTeyFQdX1SnD97hqdhpnaQwmbHqX4eT0pNWFPZ0mkKXbUkhLw2M0UNQNkEGN4wxljMod95c/ig==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dependencies: - err-code: 3.0.1 - it-length-prefixed: 9.0.1 - it-pushable: 3.2.1 - it-stream-types: 2.0.1 - protons-runtime: 5.0.1(uint8arraylist@2.4.3) - uint8-varint: 1.0.6 - uint8arraylist: 2.4.3 - dev: false - /it-peekable@3.0.1: resolution: {integrity: sha512-5zBfkf6e+YoxxWV0YDXMwdQKnc7eeTX6xo3WYPm/8dIoctIiDnddInRWOW+83W/8/76sbnpWqqsO4gSyXandeQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -8423,12 +8242,20 @@ packages: it-stream-types: 2.0.1 dev: false + /it-protobuf-stream@1.0.2: + resolution: {integrity: sha512-2lESJIeZS2ZlYJc/1SKs6LL4Y83rCCvZv750xV1e4uuP9114yNkw2MhIGCtSReg+qNWCvzGqOwjQbKV0LFE6wQ==} + dependencies: + it-length-prefixed-stream: 1.0.2 + it-stream-types: 2.0.1 + protons-runtime: 5.0.1(uint8arraylist@2.4.3) + uint8arraylist: 2.4.3 + dev: false + /it-pushable@3.2.1: resolution: {integrity: sha512-sLFz2Q0oyDCJpTciZog7ipP4vSftfPy3e6JnH6YyztRa1XqkpGQaafK3Jw/JlfEBtCXfnX9uVfcpu3xpSAqCVQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} dependencies: p-defer: 4.0.0 - dev: false /it-reader@6.0.4: resolution: {integrity: sha512-XCWifEcNFFjjBHtor4Sfaj8rcpt+FkY0L6WdhD578SCDhV4VUm7fCkF3dv5a+fTcfQqvN9BsxBTvWbYO6iCjTg==} @@ -8535,10 +8362,6 @@ packages: argparse: 2.0.1 dev: true - /jsbn@1.1.0: - resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - dev: false - /jsesc@0.5.0: resolution: {integrity: sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA==} hasBin: true @@ -8796,48 +8619,29 @@ packages: - supports-color dev: true - /libp2p@0.45.9: - resolution: {integrity: sha512-cf2dCf8naZqQoDw3xxSEZ6rKgQ8BBne5iWgtIKHAYrCvL+ulshz72jNgeAG0FQ/jjRD3yzmUuwoMaLHj6gf7Bw==} - engines: {node: '>=16.0.0', npm: '>=7.0.0'} + /libp2p@0.46.14: + resolution: {integrity: sha512-7HC1VdVqeSVRZ8PdtGHwpCyGGz2Xrd5TeLcOspqdBXL6EOXeFY0n0P6qaC83IVzVP4SWULCbnzjstACw+SGluw==} dependencies: '@achingbrain/nat-port-mapper': 1.0.9 - '@libp2p/crypto': 1.0.17 - '@libp2p/interface-address-manager': 3.0.1 - '@libp2p/interface-connection': 5.1.1 - '@libp2p/interface-connection-encrypter': 4.0.1 - '@libp2p/interface-connection-gater': 3.0.1 - '@libp2p/interface-connection-manager': 3.0.1 - '@libp2p/interface-content-routing': 2.1.1 - '@libp2p/interface-keychain': 2.0.5 - '@libp2p/interface-libp2p': 3.2.0 - '@libp2p/interface-metrics': 4.0.8 - '@libp2p/interface-peer-discovery': 2.0.0 - '@libp2p/interface-peer-id': 2.0.2 - '@libp2p/interface-peer-info': 1.0.10 - '@libp2p/interface-peer-routing': 1.1.1 - '@libp2p/interface-peer-store': 2.0.4 - '@libp2p/interface-pubsub': 4.0.1 - '@libp2p/interface-record': 2.0.7 - '@libp2p/interface-registrar': 2.0.12 - '@libp2p/interface-stream-muxer': 4.1.2 - '@libp2p/interface-transport': 4.0.3 - '@libp2p/interfaces': 3.3.2 - '@libp2p/keychain': 2.0.1 - '@libp2p/logger': 2.1.1 - '@libp2p/multistream-select': 3.1.9 - '@libp2p/peer-collections': 3.0.2 - '@libp2p/peer-id': 2.0.4 - '@libp2p/peer-id-factory': 2.0.4 - '@libp2p/peer-record': 5.0.4 - '@libp2p/peer-store': 8.2.1 - '@libp2p/topology': 4.0.3 - '@libp2p/tracked-map': 3.0.3 - '@libp2p/utils': 3.0.12 + '@libp2p/crypto': 2.0.5 + '@libp2p/interface': 0.1.3 + '@libp2p/interface-internal': 0.1.6 + '@libp2p/keychain': 3.0.5 + '@libp2p/logger': 3.0.3 + '@libp2p/multistream-select': 4.0.3 + '@libp2p/peer-collections': 4.0.5 + '@libp2p/peer-id': 3.0.3 + '@libp2p/peer-id-factory': 3.0.5 + '@libp2p/peer-record': 6.0.6 + '@libp2p/peer-store': 9.0.6 + '@libp2p/utils': 4.0.4 '@multiformats/mafmt': 12.1.5 - '@multiformats/multiaddr': 12.1.3 - abortable-iterator: 5.0.1 + '@multiformats/multiaddr': 12.1.7 + '@multiformats/multiaddr-matcher': 1.0.2 any-signal: 4.1.1 datastore-core: 9.2.0 + delay: 6.0.0 + events: 3.3.0 interface-datastore: 8.2.3 it-all: 3.0.2 it-drain: 3.0.2 @@ -8849,19 +8653,19 @@ packages: it-merge: 3.0.1 it-pair: 2.0.6 it-parallel: 3.0.3 - it-pb-stream: 4.0.2 it-pipe: 3.0.1 + it-protobuf-stream: 1.0.2 it-stream-types: 2.0.1 merge-options: 3.0.4 - multiformats: 11.0.2 + multiformats: 12.0.1 p-defer: 4.0.0 p-queue: 7.3.4 - p-retry: 5.1.2 + p-retry: 6.1.0 private-ip: 3.0.1 protons-runtime: 5.0.1(uint8arraylist@2.4.3) - rate-limiter-flexible: 2.4.1 + rate-limiter-flexible: 3.0.0 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 wherearewe: 2.0.1 xsalsa20: 1.2.0 transitivePeerDependencies: @@ -9028,10 +8832,6 @@ packages: is-unicode-supported: 0.1.0 dev: true - /long@4.0.0: - resolution: {integrity: sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==} - dev: false - /long@5.2.3: resolution: {integrity: sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==} @@ -9491,7 +9291,6 @@ packages: /multiformats@12.0.1: resolution: {integrity: sha512-s01wijBJoDUqESWSzePY0lvTw7J3PVO9x2Cc6ASI5AMZM2Gnhh7BC17+nlFhHKU7dDzaCaRfb+NiqNzOsgPUoQ==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} - dev: false /multimatch@5.0.0: resolution: {integrity: sha512-ypMKuglUrZUD99Tk2bUQ+xNQj43lPEfAeX2o9cTteAmShXy2VHDJpuwu1o0xqoKCt9jLVAvwyFKdLTPXKAfJyA==} @@ -10056,7 +9855,6 @@ packages: /p-defer@4.0.0: resolution: {integrity: sha512-Vb3QRvQ0Y5XnF40ZUWW7JfLogicVh/EnA5gBIvKDJoYpeI82+1E3AlB9yOcKFS0AhHrWVnAQO39fbR0G99IVEQ==} engines: {node: '>=12'} - dev: false /p-event@4.2.0: resolution: {integrity: sha512-KXatOjCRXXkSePPb1Nbi0p0m+gQAwdlbhi4wQKJPI1HsMQS9g+Sqp2o+QHziPr7eYJyOZet836KoHEVM1mwOrQ==} @@ -10156,11 +9954,12 @@ packages: engines: {node: '>=8'} dev: true - /p-retry@5.1.2: - resolution: {integrity: sha512-couX95waDu98NfNZV+i/iLt+fdVxmI7CbrrdC2uDWfPdUAApyxT4wmDlyOtR5KtTDmkDO0zDScDjDou9YHhd9g==} - engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} + /p-retry@6.1.0: + resolution: {integrity: sha512-fJLEQ2KqYBJRuaA/8cKMnqhulqNM+bpcjYtXNex2t3mOXKRYPitAJt9NacSf8XAFzcYahSAbKpobiWDSqHSh2g==} + engines: {node: '>=16.17'} dependencies: - '@types/retry': 0.12.1 + '@types/retry': 0.12.2 + is-network-error: 1.0.0 retry: 0.13.1 dev: false @@ -10488,7 +10287,7 @@ packages: resolution: {integrity: sha512-Ezc16ANuhSHmWAE6lbXUKburNzGpR0J5X0Zh5Um/PZ/s57Fp+HYqYe6BYPH2QbqKr/5WebfzJQ1jq6Kj5dbRmA==} engines: {node: '>=14.16'} dependencies: - '@chainsafe/is-ip': 2.0.1 + '@chainsafe/is-ip': 2.0.2 ip-regex: 5.0.0 ipaddr.js: 2.1.0 netmask: 2.0.2 @@ -10540,26 +10339,6 @@ packages: react-is: 16.13.1 dev: true - /protobufjs@6.11.3: - resolution: {integrity: sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg==} - hasBin: true - requiresBuild: true - dependencies: - '@protobufjs/aspromise': 1.1.2 - '@protobufjs/base64': 1.1.2 - '@protobufjs/codegen': 2.0.4 - '@protobufjs/eventemitter': 1.1.0 - '@protobufjs/fetch': 1.1.0 - '@protobufjs/float': 1.0.2 - '@protobufjs/inquire': 1.1.0 - '@protobufjs/path': 1.1.2 - '@protobufjs/pool': 1.1.0 - '@protobufjs/utf8': 1.1.0 - '@types/long': 4.0.2 - '@types/node': 20.4.2 - long: 4.0.0 - dev: false - /protobufjs@7.2.4: resolution: {integrity: sha512-AT+RJgD2sH8phPmCf7OUZR8xGdcJRga4+1cOaXJ64hvcSkVhNcRHOwIxUatPH15+nj59WAGTDv3LSGZPEQbJaQ==} engines: {node: '>=12.0.0'} @@ -10653,6 +10432,9 @@ packages: engines: {node: '>=8'} dev: true + /race-signal@1.0.1: + resolution: {integrity: sha512-a5un4dInIWoB7+76DieVE+Xv+wmyochKJ3P2GVs9dUKIzGuPyFR5iU3gEWJvztde/15fSOGkslbIsPxi+Loosw==} + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -10671,8 +10453,8 @@ packages: engines: {node: '>= 0.6'} dev: true - /rate-limiter-flexible@2.4.1: - resolution: {integrity: sha512-dgH4T44TzKVO9CLArNto62hJOwlWJMLUjVVr/ii0uUzZXEXthDNr7/yefW5z/1vvHAfycc1tnuiYyNJ8CTRB3g==} + /rate-limiter-flexible@3.0.0: + resolution: {integrity: sha512-janAJkWxWxmLka0hV+XvCTo0M8keeSeOuz8ZL33cTXrkS4ek9mQ2VJm9ri7fm03oTVth19Sfqb1ijCmo7K/vAg==} dev: false /rc@1.2.8: @@ -11327,10 +11109,6 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true - /sprintf-js@1.1.2: - resolution: {integrity: sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==} - dev: false - /ssri@10.0.4: resolution: {integrity: sha512-12+IR2CB2C28MMAw0Ncqwj5QbTcs0nGIhgJzYWzDkb21vWmfNI83KS4f3Ci6GI98WreIfG7o9UXp3C0qbpA8nQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -11550,6 +11328,13 @@ packages: dependencies: copy-anything: 3.0.5 + /superjson@2.0.0: + resolution: {integrity: sha512-W3n+NJ7TFjaLle8ihIIvsr/bbuKpnxeatsyjmhy7iSkom+/cshaHziCQAWXrHGWJVQSQFDOuES6C3nSEvcbrQg==} + engines: {node: '>=16'} + dependencies: + copy-anything: 3.0.5 + dev: false + /supports-color@2.0.0: resolution: {integrity: sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g==} engines: {node: '>=0.8.0'} @@ -12013,9 +11798,15 @@ packages: byte-access: 1.0.1 longbits: 1.1.0 uint8arraylist: 2.4.3 - uint8arrays: 4.0.4 + uint8arrays: 4.0.6 dev: false + /uint8-varint@2.0.1: + resolution: {integrity: sha512-euvmpuulJstK5+xNuI4S1KfnxJnbI5QP52RXIR3GZ3/ZMkOsEK2AgCtFpNvEQLXMxMx2o0qcyevK1fJwOZJagQ==} + dependencies: + uint8arraylist: 2.4.3 + uint8arrays: 4.0.6 + /uint8arraylist@2.4.3: resolution: {integrity: sha512-oEVZr4/GrH87K0kjNce6z8pSCzLEPqHNLNR5sj8cJOySrTP8Vb/pMIbZKLJGhQKxm1TiZ31atNrpn820Pyqpow==} engines: {node: '>=16.0.0', npm: '>=7.0.0'} @@ -12027,6 +11818,11 @@ packages: dependencies: multiformats: 11.0.2 + /uint8arrays@4.0.6: + resolution: {integrity: sha512-4ZesjQhqOU2Ip6GPReIwN60wRxIupavL8T0Iy36BBHr2qyMrNxsPJvr7vpS4eFt8F8kSguWUPad6ZM9izs/vyw==} + dependencies: + multiformats: 12.0.1 + /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: From e0aea265f62cd5ca91b259c6f683a596ceb3ddd4 Mon Sep 17 00:00:00 2001 From: Eugene Date: Wed, 25 Oct 2023 16:10:18 +0600 Subject: [PATCH 19/21] feat: move buildRandomDeal to messages package --- packages/db/test/db.deals.spec.ts | 2 +- packages/messages/src/testUtils.ts | 35 ++++++++++++++++- .../node-api/test/api.nodeApiServer.spec.ts | 2 +- packages/test-utils/package.json | 1 - packages/test-utils/src/index.ts | 39 +------------------ pnpm-lock.yaml | 3 -- 6 files changed, 36 insertions(+), 46 deletions(-) diff --git a/packages/db/test/db.deals.spec.ts b/packages/db/test/db.deals.spec.ts index cbd38f3c..1e8ac14a 100644 --- a/packages/db/test/db.deals.spec.ts +++ b/packages/db/test/db.deals.spec.ts @@ -1,7 +1,6 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ import { beforeAll, - buildRandomDeal, describe, expect, it, @@ -12,6 +11,7 @@ import { generateMnemonic, supplierId as spId } from '@windingtree/sdk-utils'; import { memoryStorage, Storage } from '@windingtree/sdk-storage'; import { DealRecord } from '@windingtree/sdk-types'; import { DealsDb, DealsDbOptions } from '../src/deals.js'; +import { buildRandomDeal } from "@windingtree/sdk-messages"; describe('DealsDb', () => { const signer = mnemonicToAccount(generateMnemonic()); diff --git a/packages/messages/src/testUtils.ts b/packages/messages/src/testUtils.ts index 93793b68..271c6415 100644 --- a/packages/messages/src/testUtils.ts +++ b/packages/messages/src/testUtils.ts @@ -1,8 +1,8 @@ import { GenericQuery, GenericOfferOptions, - RequestData, -} from '@windingtree/sdk-types'; + RequestData, DealRecord, DealStatus +} from "@windingtree/sdk-types"; import { Hash, HDAccount, TypedDataDomain } from 'viem'; import { randomSalt } from '@windingtree/contracts'; import { buildRequest, buildOffer } from './index.js'; @@ -82,3 +82,34 @@ export const createRandomOffer = ( checkOut: 1n, transferable: true, }); + +export const buildRandomDeal = async ( + signer: HDAccount, + supplierId: Hash, +): Promise => { + const typedDomain = { + chainId: 1, + name: 'Test', + version: '1', + contract: signer.address, + }; + const request = await createRandomRequest('test', '100s'); + const offer = await createRandomOffer( + request, + '200s', + typedDomain, + supplierId, + signer, + ); + + return { + chainId: typedDomain.chainId, + created: BigInt(Math.round(Date.now() / 1000)), + offer, + retailerId: 'test', + buyer: '0x0', + price: BigInt(1), + asset: '0x0', + status: DealStatus.Claimed, + }; +}; diff --git a/packages/node-api/test/api.nodeApiServer.spec.ts b/packages/node-api/test/api.nodeApiServer.spec.ts index 968303f0..ce1d57d0 100644 --- a/packages/node-api/test/api.nodeApiServer.spec.ts +++ b/packages/node-api/test/api.nodeApiServer.spec.ts @@ -1,7 +1,6 @@ import { afterAll, beforeAll, - buildRandomDeal, describe, expect, it, @@ -34,6 +33,7 @@ import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; import { PaginationOptions } from '@windingtree/sdk-types'; import { randomSalt } from '@windingtree/contracts'; import { serviceRouter } from '../src/router/service.js'; +import { buildRandomDeal } from "@windingtree/sdk-messages"; const testRouter = router({ admin: adminRouter, diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 666b9b88..51b129b9 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -29,7 +29,6 @@ }, "dependencies": { "@windingtree/contracts": "^1.0.0", - "@windingtree/sdk-messages": "workspace:*", "@windingtree/sdk-types": "workspace:*", "viem": "^1.3.0", "vitest": "^0.33.0" diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index 8988fc60..93207ef8 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -1,13 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { expect } from 'vitest'; -import { Hash, HDAccount } from 'viem'; -import { DealRecord, DealStatus } from '@windingtree/sdk-types'; -import { - createRandomOffer, - createRandomRequest, -} from '@windingtree/sdk-messages'; +import { expect } from "vitest"; export * from 'vitest'; @@ -38,34 +32,3 @@ export const expectDeepEqual = ( ); } }; - -export const buildRandomDeal = async ( - signer: HDAccount, - supplierId: Hash, -): Promise => { - const typedDomain = { - chainId: 1, - name: 'Test', - version: '1', - contract: signer.address, - }; - const request = await createRandomRequest('test', '100s'); - const offer = await createRandomOffer( - request, - '200s', - typedDomain, - supplierId, - signer, - ); - - return { - chainId: typedDomain.chainId, - created: BigInt(Math.round(Date.now() / 1000)), - offer, - retailerId: 'test', - buyer: '0x0', - price: BigInt(1), - asset: '0x0', - status: DealStatus.Claimed, - }; -}; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ebc72b40..8eefa209 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -798,9 +798,6 @@ importers: '@windingtree/contracts': specifier: ^1.0.0 version: 1.0.0 - '@windingtree/sdk-messages': - specifier: workspace:* - version: link:../messages '@windingtree/sdk-types': specifier: workspace:* version: link:../types From 8f7455fbf4e3af34b609e7740957e2a2a4d02fe8 Mon Sep 17 00:00:00 2001 From: Kostiantyn Smyrnov Date: Wed, 25 Oct 2023 18:07:01 +0200 Subject: [PATCH 20/21] =?UTF-8?q?chore:=20=F0=9F=A4=96=20Added=20linter=20?= =?UTF-8?q?autofixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/db/test/db.deals.spec.ts | 9 ++------- packages/messages/src/testUtils.ts | 6 ++++-- packages/node-api/test/api.nodeApiServer.spec.ts | 2 +- packages/test-utils/src/index.ts | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/packages/db/test/db.deals.spec.ts b/packages/db/test/db.deals.spec.ts index 1e8ac14a..a2d3907f 100644 --- a/packages/db/test/db.deals.spec.ts +++ b/packages/db/test/db.deals.spec.ts @@ -1,17 +1,12 @@ /* eslint-disable @typescript-eslint/no-unused-vars */ -import { - beforeAll, - describe, - expect, - it, -} from '@windingtree/sdk-test-utils'; +import { beforeAll, describe, expect, it } from '@windingtree/sdk-test-utils'; import { mnemonicToAccount } from 'viem/accounts'; import { randomSalt } from '@windingtree/contracts'; import { generateMnemonic, supplierId as spId } from '@windingtree/sdk-utils'; import { memoryStorage, Storage } from '@windingtree/sdk-storage'; import { DealRecord } from '@windingtree/sdk-types'; import { DealsDb, DealsDbOptions } from '../src/deals.js'; -import { buildRandomDeal } from "@windingtree/sdk-messages"; +import { buildRandomDeal } from '@windingtree/sdk-messages'; describe('DealsDb', () => { const signer = mnemonicToAccount(generateMnemonic()); diff --git a/packages/messages/src/testUtils.ts b/packages/messages/src/testUtils.ts index 271c6415..e0068a0b 100644 --- a/packages/messages/src/testUtils.ts +++ b/packages/messages/src/testUtils.ts @@ -1,8 +1,10 @@ import { GenericQuery, GenericOfferOptions, - RequestData, DealRecord, DealStatus -} from "@windingtree/sdk-types"; + RequestData, + DealRecord, + DealStatus, +} from '@windingtree/sdk-types'; import { Hash, HDAccount, TypedDataDomain } from 'viem'; import { randomSalt } from '@windingtree/contracts'; import { buildRequest, buildOffer } from './index.js'; diff --git a/packages/node-api/test/api.nodeApiServer.spec.ts b/packages/node-api/test/api.nodeApiServer.spec.ts index ce1d57d0..68c28656 100644 --- a/packages/node-api/test/api.nodeApiServer.spec.ts +++ b/packages/node-api/test/api.nodeApiServer.spec.ts @@ -33,7 +33,7 @@ import { hardhat, polygonZkEvmTestnet } from 'viem/chains'; import { PaginationOptions } from '@windingtree/sdk-types'; import { randomSalt } from '@windingtree/contracts'; import { serviceRouter } from '../src/router/service.js'; -import { buildRandomDeal } from "@windingtree/sdk-messages"; +import { buildRandomDeal } from '@windingtree/sdk-messages'; const testRouter = router({ admin: adminRouter, diff --git a/packages/test-utils/src/index.ts b/packages/test-utils/src/index.ts index 93207ef8..a99d86bf 100644 --- a/packages/test-utils/src/index.ts +++ b/packages/test-utils/src/index.ts @@ -1,7 +1,7 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ /* eslint-disable @typescript-eslint/no-unsafe-argument */ /* eslint-disable @typescript-eslint/no-unsafe-member-access */ -import { expect } from "vitest"; +import { expect } from 'vitest'; export * from 'vitest'; From aff715481eca42cd46f9d39e45173016c4178a3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 25 Oct 2023 16:26:40 +0000 Subject: [PATCH 21/21] Publish - @windingtree/sdk-client@1.2.0-beta.1 - @windingtree/sdk-constants@1.2.0-beta.0 - @windingtree/sdk-contracts-manager@1.2.0-beta.1 - @windingtree/sdk-db@1.2.0-beta.1 - @windingtree/sdk-logger@1.1.1-beta.0 - @windingtree/sdk-messages@1.2.0-beta.1 - @windingtree/sdk-node@1.2.0-beta.0 - @windingtree/sdk-node-api@1.2.0-beta.0 - @windingtree/sdk-pubsub@1.2.0-beta.0 - @windingtree/sdk-queue@1.2.0-beta.1 - @windingtree/sdk-react@1.2.0-beta.0 - @windingtree/sdk-server@1.2.0-beta.0 - @windingtree/sdk-storage@1.2.0-beta.0 - @windingtree/sdk-test-utils@1.2.0-beta.1 - @windingtree/sdk-types@1.1.1-beta.0 - @windingtree/sdk-utils@1.2.0-beta.1 --- packages/client/CHANGELOG.md | 14 ++++++++++++++ packages/client/package.json | 2 +- packages/constants/CHANGELOG.md | 11 +++++++++++ packages/constants/package.json | 2 +- packages/contracts-manger/CHANGELOG.md | 11 +++++++++++ packages/contracts-manger/package.json | 4 ++-- packages/db/CHANGELOG.md | 13 +++++++++++++ packages/db/package.json | 2 +- packages/logger/CHANGELOG.md | 8 ++++++++ packages/logger/package.json | 2 +- packages/messages/CHANGELOG.md | 12 ++++++++++++ packages/messages/package.json | 2 +- packages/node-api/CHANGELOG.md | 12 ++++++++++++ packages/node-api/package.json | 2 +- packages/node/CHANGELOG.md | 14 ++++++++++++++ packages/node/package.json | 2 +- packages/pubsub/CHANGELOG.md | 12 ++++++++++++ packages/pubsub/package.json | 2 +- packages/queue/CHANGELOG.md | 11 +++++++++++ packages/queue/package.json | 2 +- packages/react/CHANGELOG.md | 17 +++++++++++++++++ packages/react/package.json | 4 ++-- packages/server/CHANGELOG.md | 11 +++++++++++ packages/server/package.json | 2 +- packages/storage/CHANGELOG.md | 11 +++++++++++ packages/storage/package.json | 2 +- packages/test-utils/CHANGELOG.md | 8 ++++++++ packages/test-utils/package.json | 2 +- packages/types/CHANGELOG.md | 8 ++++++++ packages/types/package.json | 2 +- packages/utils/CHANGELOG.md | 8 ++++++++ packages/utils/package.json | 2 +- 32 files changed, 199 insertions(+), 18 deletions(-) diff --git a/packages/client/CHANGELOG.md b/packages/client/CHANGELOG.md index 7bb2ed83..829938a0 100644 --- a/packages/client/CHANGELOG.md +++ b/packages/client/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.2.0-beta.0...@windingtree/sdk-client@1.2.0-beta.1) (2023-10-25) + + +### Features + +* add force param to subscribe method in requests manager ([ab77a45](https://github.com/windingtree/sdk/commit/ab77a45712c9dd7ce98ff4fccdea56cf1682137d)) +* move renew subscribe flow to request manager ([90009e2](https://github.com/windingtree/sdk/commit/90009e2c20ef8b9a472cb3d5978b844280e928fc)) +* update libp2p ([71daad4](https://github.com/windingtree/sdk/commit/71daad41838ae6b2833c76aa36b5b2071a041e92)) +* update reconnect flow, update e2e tests ([73da6f9](https://github.com/windingtree/sdk/commit/73da6f97656592b03851c95f45bcb955937e2a8d)) + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.1.0...@windingtree/sdk-client@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/client/package.json b/packages/client/package.json index 4621bbce..2fba9659 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-client", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "The WindingTree market protocol client", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/constants/CHANGELOG.md b/packages/constants/CHANGELOG.md index 60770fbf..25badb98 100644 --- a/packages/constants/CHANGELOG.md +++ b/packages/constants/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.1.0...@windingtree/sdk-constants@1.2.0-beta.0) (2023-10-25) + + +### Features + +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.1.0-beta.3...@windingtree/sdk-constants@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-constants diff --git a/packages/constants/package.json b/packages/constants/package.json index 74369c5c..2a1976b6 100644 --- a/packages/constants/package.json +++ b/packages/constants/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-constants", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "libp2p PubSub protocol implementation for the WindingTree market protocol", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/contracts-manger/CHANGELOG.md b/packages/contracts-manger/CHANGELOG.md index ec483c79..a33b33f8 100644 --- a/packages/contracts-manger/CHANGELOG.md +++ b/packages/contracts-manger/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.2.0-beta.0...@windingtree/sdk-contracts-manager@1.2.0-beta.1) (2023-10-25) + + +### Features + +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-contracts-manager@1.1.0...@windingtree/sdk-contracts-manager@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/contracts-manger/package.json b/packages/contracts-manger/package.json index d50831c6..adf999bd 100644 --- a/packages/contracts-manger/package.json +++ b/packages/contracts-manger/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-contracts-manager", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "Utility class for interaction with the protocol smart contracts", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", @@ -35,8 +35,8 @@ "viem": "^1.3.0" }, "devDependencies": { - "@windingtree/sdk-utils": "workspace:*", "@windingtree/sdk-test-utils": "workspace:*", + "@windingtree/sdk-utils": "workspace:*", "wtmp-examples-shared-files": "workspace:*" }, "scripts": { diff --git a/packages/db/CHANGELOG.md b/packages/db/CHANGELOG.md index 4a37c833..d14a928a 100644 --- a/packages/db/CHANGELOG.md +++ b/packages/db/CHANGELOG.md @@ -3,6 +3,19 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.2.0-beta.0...@windingtree/sdk-db@1.2.0-beta.1) (2023-10-25) + + +### Features + +* fix async issues ([803ab03](https://github.com/windingtree/sdk/commit/803ab03f1b5d176844247c2d065dfadabc12355f)) +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) +* move buildRandomDeal to messages package ([e0aea26](https://github.com/windingtree/sdk/commit/e0aea265f62cd5ca91b259c6f683a596ceb3ddd4)) + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-db@1.1.0...@windingtree/sdk-db@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/db/package.json b/packages/db/package.json index 258b76d7..e2f2d96b 100644 --- a/packages/db/package.json +++ b/packages/db/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-db", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "Databases for the WindingTree market protocol", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/logger/CHANGELOG.md b/packages/logger/CHANGELOG.md index a6485358..713e7d49 100644 --- a/packages/logger/CHANGELOG.md +++ b/packages/logger/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-logger@1.1.0...@windingtree/sdk-logger@1.1.1-beta.0) (2023-10-25) + +**Note:** Version bump only for package @windingtree/sdk-logger + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-logger@1.1.0-beta.3...@windingtree/sdk-logger@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-logger diff --git a/packages/logger/package.json b/packages/logger/package.json index e4e27753..cc41def7 100644 --- a/packages/logger/package.json +++ b/packages/logger/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-logger", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "Logger", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/messages/CHANGELOG.md b/packages/messages/CHANGELOG.md index 0912d068..380159af 100644 --- a/packages/messages/CHANGELOG.md +++ b/packages/messages/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.2.0-beta.0...@windingtree/sdk-messages@1.2.0-beta.1) (2023-10-25) + + +### Features + +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) +* move buildRandomDeal to messages package ([e0aea26](https://github.com/windingtree/sdk/commit/e0aea265f62cd5ca91b259c6f683a596ceb3ddd4)) + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-messages@1.1.0...@windingtree/sdk-messages@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/messages/package.json b/packages/messages/package.json index 64349184..7a6631bc 100644 --- a/packages/messages/package.json +++ b/packages/messages/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-messages", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "The WindingTree market protocol messages utilities", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/node-api/CHANGELOG.md b/packages/node-api/CHANGELOG.md index 73390cba..a6b49b86 100644 --- a/packages/node-api/CHANGELOG.md +++ b/packages/node-api/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.1-beta.0...@windingtree/sdk-node-api@1.2.0-beta.0) (2023-10-25) + + +### Features + +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) +* move buildRandomDeal to messages package ([e0aea26](https://github.com/windingtree/sdk/commit/e0aea265f62cd5ca91b259c6f683a596ceb3ddd4)) + + + + + ## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node-api@1.1.0...@windingtree/sdk-node-api@1.1.1-beta.0) (2023-07-31) **Note:** Version bump only for package @windingtree/sdk-node-api diff --git a/packages/node-api/package.json b/packages/node-api/package.json index 2eb2500a..94a05732 100644 --- a/packages/node-api/package.json +++ b/packages/node-api/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-node-api", - "version": "1.1.1-beta.0", + "version": "1.2.0-beta.0", "description": "The WindingTree market protocol node API server and client", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/node/CHANGELOG.md b/packages/node/CHANGELOG.md index abc73ff7..46e9d03c 100644 --- a/packages/node/CHANGELOG.md +++ b/packages/node/CHANGELOG.md @@ -3,6 +3,20 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.1-beta.0...@windingtree/sdk-node@1.2.0-beta.0) (2023-10-25) + + +### Features + +* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8)) +* move renew subscribe flow to request manager ([90009e2](https://github.com/windingtree/sdk/commit/90009e2c20ef8b9a472cb3d5978b844280e928fc)) +* update libp2p ([71daad4](https://github.com/windingtree/sdk/commit/71daad41838ae6b2833c76aa36b5b2071a041e92)) +* update reconnect flow, update e2e tests ([73da6f9](https://github.com/windingtree/sdk/commit/73da6f97656592b03851c95f45bcb955937e2a8d)) + + + + + ## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-node@1.1.0...@windingtree/sdk-node@1.1.1-beta.0) (2023-07-31) **Note:** Version bump only for package @windingtree/sdk-node diff --git a/packages/node/package.json b/packages/node/package.json index 3675f7e4..4f4a557d 100644 --- a/packages/node/package.json +++ b/packages/node/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-node", - "version": "1.1.1-beta.0", + "version": "1.2.0-beta.0", "description": "The WindingTree market protocol node", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/pubsub/CHANGELOG.md b/packages/pubsub/CHANGELOG.md index b096e109..53ab44ce 100644 --- a/packages/pubsub/CHANGELOG.md +++ b/packages/pubsub/CHANGELOG.md @@ -3,6 +3,18 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.1-beta.0...@windingtree/sdk-pubsub@1.2.0-beta.0) (2023-10-25) + + +### Features + +* fix async issues ([803ab03](https://github.com/windingtree/sdk/commit/803ab03f1b5d176844247c2d065dfadabc12355f)) +* update libp2p ([71daad4](https://github.com/windingtree/sdk/commit/71daad41838ae6b2833c76aa36b5b2071a041e92)) + + + + + ## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-pubsub@1.1.0...@windingtree/sdk-pubsub@1.1.1-beta.0) (2023-07-31) **Note:** Version bump only for package @windingtree/sdk-pubsub diff --git a/packages/pubsub/package.json b/packages/pubsub/package.json index 8c48e9da..0ab0feed 100644 --- a/packages/pubsub/package.json +++ b/packages/pubsub/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-pubsub", - "version": "1.1.1-beta.0", + "version": "1.2.0-beta.0", "description": "libp2p PubSub protocol implementation for the WindingTree market protocol", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/queue/CHANGELOG.md b/packages/queue/CHANGELOG.md index 1c9c0127..c4fedd2b 100644 --- a/packages/queue/CHANGELOG.md +++ b/packages/queue/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.2.0-beta.0...@windingtree/sdk-queue@1.2.0-beta.1) (2023-10-25) + + +### Features + +* update libp2p ([71daad4](https://github.com/windingtree/sdk/commit/71daad41838ae6b2833c76aa36b5b2071a041e92)) + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-queue@1.1.0...@windingtree/sdk-queue@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/queue/package.json b/packages/queue/package.json index 51d15f19..9ce42c88 100644 --- a/packages/queue/package.json +++ b/packages/queue/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-queue", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "Jobs queue", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 3b743e76..d1eb8eb9 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -3,6 +3,23 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.1-beta.0...@windingtree/sdk-react@1.2.0-beta.0) (2023-10-25) + + +### Bug Fixes + +* 🐛 Missed exaports are added to the react package ([cbb4b75](https://github.com/windingtree/sdk/commit/cbb4b75f497b1a58e004d9135cd7e2a869de119f)) + + +### Features + +* 🎸 Added DealsManagerProvider to the react package ([ac1129f](https://github.com/windingtree/sdk/commit/ac1129f5d1c45c9f93336718d59bfbe4c7bb60fc)) +* 🎸 Added providers for client and requestsManager ([b5f24b8](https://github.com/windingtree/sdk/commit/b5f24b879b6752654325e385841c4061d952a419)) + + + + + ## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-react@1.1.0...@windingtree/sdk-react@1.1.1-beta.0) (2023-07-31) **Note:** Version bump only for package @windingtree/sdk-react diff --git a/packages/react/package.json b/packages/react/package.json index fbabfccb..9b16ff2b 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-react", - "version": "1.1.1-beta.0", + "version": "1.2.0-beta.0", "publishConfig": { "access": "public" }, @@ -48,9 +48,9 @@ "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", "@vitejs/plugin-react": "^4.0.3", + "@windingtree/sdk-client": "workspace:*", "@windingtree/sdk-contracts-manager": "workspace:*", "@windingtree/sdk-node-api": "workspace:*", - "@windingtree/sdk-client": "workspace:*", "@windingtree/sdk-storage": "workspace:*", "@windingtree/sdk-types": "workspace:*", "eslint": "^8.45.0", diff --git a/packages/server/CHANGELOG.md b/packages/server/CHANGELOG.md index 8c246717..773b29c5 100644 --- a/packages/server/CHANGELOG.md +++ b/packages/server/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.1-beta.0...@windingtree/sdk-server@1.2.0-beta.0) (2023-10-25) + + +### Features + +* update libp2p ([71daad4](https://github.com/windingtree/sdk/commit/71daad41838ae6b2833c76aa36b5b2071a041e92)) + + + + + ## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-server@1.1.0...@windingtree/sdk-server@1.1.1-beta.0) (2023-07-31) **Note:** Version bump only for package @windingtree/sdk-server diff --git a/packages/server/package.json b/packages/server/package.json index f4703f26..fa081195 100644 --- a/packages/server/package.json +++ b/packages/server/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-server", - "version": "1.1.1-beta.0", + "version": "1.2.0-beta.0", "description": "The WindingTree market protocol server", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/storage/CHANGELOG.md b/packages/storage/CHANGELOG.md index 64436bed..2cd1dd9b 100644 --- a/packages/storage/CHANGELOG.md +++ b/packages/storage/CHANGELOG.md @@ -3,6 +3,17 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-storage@1.1.0...@windingtree/sdk-storage@1.2.0-beta.0) (2023-10-25) + + +### Features + +* add level db storage ([7756a72](https://github.com/windingtree/sdk/commit/7756a720dd59e22183c758fa3845c637978a91a9)) + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-storage@1.1.0-beta.3...@windingtree/sdk-storage@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-storage diff --git a/packages/storage/package.json b/packages/storage/package.json index 94673177..d94a5c90 100644 --- a/packages/storage/package.json +++ b/packages/storage/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-storage", - "version": "1.1.0", + "version": "1.2.0-beta.0", "description": "Key-value database abstraction layer", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/test-utils/CHANGELOG.md b/packages/test-utils/CHANGELOG.md index 53a69ef8..be28362b 100644 --- a/packages/test-utils/CHANGELOG.md +++ b/packages/test-utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.2.0-beta.0...@windingtree/sdk-test-utils@1.2.0-beta.1) (2023-10-25) + +**Note:** Version bump only for package @windingtree/sdk-test-utils + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-test-utils@1.1.0...@windingtree/sdk-test-utils@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/test-utils/package.json b/packages/test-utils/package.json index 51b129b9..26a2ee7f 100644 --- a/packages/test-utils/package.json +++ b/packages/test-utils/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-test-utils", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "Testing utilities for the Windingtree market protocol SDK", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/types/CHANGELOG.md b/packages/types/CHANGELOG.md index b90e76b7..b4765d34 100644 --- a/packages/types/CHANGELOG.md +++ b/packages/types/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +## [1.1.1-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-types@1.1.0...@windingtree/sdk-types@1.1.1-beta.0) (2023-10-25) + +**Note:** Version bump only for package @windingtree/sdk-types + + + + + # [1.1.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-types@1.1.0-beta.3...@windingtree/sdk-types@1.1.0) (2023-07-27) **Note:** Version bump only for package @windingtree/sdk-types diff --git a/packages/types/package.json b/packages/types/package.json index 59a5041c..b1ed62d3 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-types", - "version": "1.1.0", + "version": "1.1.1-beta.0", "description": "Typescript types for the Windingtree market protocol SDK", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ", diff --git a/packages/utils/CHANGELOG.md b/packages/utils/CHANGELOG.md index 91f634c3..9eb12624 100644 --- a/packages/utils/CHANGELOG.md +++ b/packages/utils/CHANGELOG.md @@ -3,6 +3,14 @@ All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. +# [1.2.0-beta.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.2.0-beta.0...@windingtree/sdk-utils@1.2.0-beta.1) (2023-10-25) + +**Note:** Version bump only for package @windingtree/sdk-utils + + + + + # [1.2.0-beta.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-utils@1.1.0...@windingtree/sdk-utils@1.2.0-beta.0) (2023-07-31) ### Features diff --git a/packages/utils/package.json b/packages/utils/package.json index e5b5c4d4..755ab502 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -1,6 +1,6 @@ { "name": "@windingtree/sdk-utils", - "version": "1.2.0-beta.0", + "version": "1.2.0-beta.1", "description": "Utility class for interaction with the protocol smart contracts", "repository": "https://github.com/windingtree/sdk#readme", "author": "Kostiantyn Smyrnov ",