Skip to content

Commit

Permalink
Merge pull request #81 from windingtree/fix/level-entries
Browse files Browse the repository at this point in the history
Fix/level entries
  • Loading branch information
kostysh authored Jan 17, 2024
2 parents aff7154 + e1bf932 commit 6491844
Show file tree
Hide file tree
Showing 82 changed files with 11,062 additions and 5,033 deletions.
4 changes: 2 additions & 2 deletions examples/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.1.6",
"viem": "^1.3.0",
"viem": "^1.19.13",
"@libp2p/interface": "^0.1.3",
"luxon": "^3.3.0"
},
"dependencies": {
"superjson": "^1.13.1"
"superjson": "^2.2.1"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion examples/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/client/tsconfig.node.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"composite": true,
"module": "ESNext",
"module": "NodeNext",
"moduleResolution": "Node",
"allowSyntheticDefaultImports": true
},
Expand Down
2 changes: 1 addition & 1 deletion examples/e2e-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"@libp2p/peer-id": "^2.0.4",
"@multiformats/multiaddr": "^12.1.3",
"luxon": "^3.3.0",
"viem": "^1.3.0"
"viem": "^1.19.13"
},
"scripts": {
"build": "echo \"no build specified\" && exit 0",
Expand Down
2 changes: 1 addition & 1 deletion examples/e2e-tests/test/examples/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export class NodeExample {
constructor() {
const mnemonic = generateMnemonic();
const signer = mnemonicToAccount(mnemonic);
const supplierId = spId(randomSalt(), signer.address);
const supplierId = spId(signer.address, randomSalt());

const options: NodeOptions = {
topics: ['hello'],
Expand Down
4 changes: 2 additions & 2 deletions examples/manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^5.1.6",
"viem": "^1.3.0",
"viem": "^1.19.13",
"luxon": "^3.3.0"
},
"dependencies": {
"@windingtree/contracts": "^1.0.0",
"@windingtree/sdk-types": "workspace:*",
"@windingtree/sdk-utils": "workspace:*",
"superjson": "^1.13.1"
"superjson": "^2.2.1"
},
"eslintConfig": {
"extends": [
Expand Down
2 changes: 1 addition & 1 deletion examples/manager/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { App } from './App.js';
import {
AppConfig,
ConfigProvider,
NodeProvider,
WalletProvider,
ContractsProvider,
NodeProvider,
} from '@windingtree/sdk-react/providers';
import { hardhat, polygonZkEvmTestnet } from 'viem/chains';
import { contractsConfig } from 'wtmp-examples-shared-files/dist/index.js';
Expand Down
2 changes: 1 addition & 1 deletion examples/manager/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "ESNext",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"resolveJsonModule": true,
"isolatedModules": true,
Expand Down
2 changes: 1 addition & 1 deletion examples/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"@windingtree/sdk-utils": "workspace:*",
"dotenv": "^16.3.1",
"luxon": "^3.3.0",
"viem": "^1.3.0",
"viem": "^1.19.13",
"wtmp-examples-shared-files": "workspace:*"
}
}
7 changes: 5 additions & 2 deletions examples/node/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,13 +280,16 @@ const main = async (): Promise<void> => {
})();

const apiServer = new NodeApiServer({
usersStorage,
dealsStorage,
storage: {
users: usersStorage,
deals: dealsStorage,
},
prefix: 'test',
port: 3456,
secret: 'secret',
ownerAccount: entityOwnerAddress,
protocolContracts: contractsManager,
cors: ['http://localhost:5173'],
});

apiServer.start(appRouter);
Expand Down
5 changes: 4 additions & 1 deletion examples/shared/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@
"lint": "eslint . --ext .ts --ignore-path ../../.lintignore",
"lint:fix": "eslint . --ext .ts --ignore-path ../../.lintignore --fix && prettier --ignore-path ../../.lintignore --write ."
},
"devDependencies": {
"@types/node": "^20.10.4"
},
"dependencies": {
"viem": "^1.3.0",
"viem": "^1.19.13",
"@windingtree/sdk-types": "workspace:*"
}
}
37 changes: 19 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,28 @@
},
"type": "module",
"devDependencies": {
"@commitlint/cli": "^17.6.7",
"@commitlint/config-conventional": "^17.6.7",
"@commitlint/cli": "^18.4.3",
"@commitlint/config-conventional": "^18.4.3",
"@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",
"@types/node": "^20.10.5",
"@typescript-eslint/eslint-plugin": "^6.15.0",
"@typescript-eslint/parser": "^6.15.0",
"@vitest/coverage-v8": "^1.1.0",
"@vitest/ui": "^1.1.0",
"eslint": "^8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.1",
"git-cz": "^4.9.0",
"husky": "^8.0.3",
"lerna": "^7.1.4",
"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"
"lerna": "^7.4.2",
"prettier": "^3.1.1",
"tsup": "^8.0.1",
"typescript": "^5.3.3",
"uint8arrays": "^5.0.0",
"vite": "^5.0.10",
"vite-plugin-dts": "^3.6.4",
"vite-plugin-node-polyfills": "^0.17.0",
"vitest": "^1.1.0"
},
"scripts": {
"prepare": "husky install",
Expand Down
35 changes: 30 additions & 5 deletions packages/client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,44 @@
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)
## [1.3.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.3.1...@windingtree/sdk-client@1.3.2) (2023-12-22)

**Note:** Version bump only for package @windingtree/sdk-client

## [1.3.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.3.0...@windingtree/sdk-client@1.3.1) (2023-12-11)

### Bug Fixes

- 🐛 Fixed wrong arguments order in the supplierId utility ([904ee70](https://github.com/windingtree/sdk/commit/904ee70f7e906b68ae01f86de7d08d956fbf7688))

# [1.3.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.2.2...@windingtree/sdk-client@1.3.0) (2023-11-29)

### 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))
- update superjson ([1a83a91](https://github.com/windingtree/sdk/commit/1a83a91e8467c6cddbb15c67d08cbe30fb6d9633))

## [1.2.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.2.1...@windingtree/sdk-client@1.2.2) (2023-10-31)

### Bug Fixes

- 🐛 Fixed file ext for cjs modules ([6f985f2](https://github.com/windingtree/sdk/commit/6f985f2a6b076abdf145176d5036fe89267f2c5a))

## [1.2.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.2.0...@windingtree/sdk-client@1.2.1) (2023-10-31)

**Note:** Version bump only for package @windingtree/sdk-client

# [1.2.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-client@1.2.0-beta.1...@windingtree/sdk-client@1.2.0) (2023-10-25)

**Note:** Version bump only for package @windingtree/sdk-client

# [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)

Expand Down
12 changes: 6 additions & 6 deletions packages/client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@windingtree/sdk-client",
"version": "1.2.0-beta.1",
"version": "1.3.2",
"description": "The WindingTree market protocol client",
"repository": "https://github.com/windingtree/sdk#readme",
"author": "Kostiantyn Smyrnov <kostysh@gmail.com>",
Expand All @@ -10,7 +10,7 @@
"dist"
],
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"exports": {
".": {
Expand All @@ -20,7 +20,7 @@
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs.js"
"default": "./dist/index.cjs"
}
}
},
Expand All @@ -38,7 +38,7 @@
"@libp2p/mplex": "^9.0.8",
"@libp2p/peer-id": "^3.0.3",
"@libp2p/websockets": "^7.0.9",
"@multiformats/multiaddr": "^12.1.3",
"@multiformats/multiaddr": "^12.1.11",
"@windingtree/sdk-contracts-manager": "workspace:*",
"@windingtree/sdk-logger": "workspace:*",
"@windingtree/sdk-messages": "workspace:*",
Expand All @@ -47,8 +47,8 @@
"@windingtree/sdk-types": "workspace:*",
"@windingtree/sdk-utils": "workspace:*",
"libp2p": "^0.46.14",
"superjson": "^2.0.0",
"viem": "^1.3.0"
"superjson": "^2.2.1",
"viem": "^1.19.13"
},
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/dealsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class ClientDealsManager<
private contracts: Contracts;
private chain: Chain;
private storageKeyPrefix: string;
private checkInterval?: NodeJS.Timer;
private checkInterval?: NodeJS.Timeout;
private ongoingCheck = false;

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export class Client<
/** Server is connected */
private serverConnected = false;
/** Entity for stop timer after reconnect */
private connectionInterval?: NodeJS.Timer;
private connectionInterval?: NodeJS.Timeout;

/**
*Creates an instance of Client.
Expand Down
2 changes: 1 addition & 1 deletion packages/client/test/requestManager.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ describe('Client.ClientRequestManager', () => {
version: '1',
contract: signer.address,
};
const supplierId = spId(randomSalt(), signer.address);
const supplierId = spId(signer.address, randomSalt());

beforeEach(async () => {
const init = memoryStorage.createInitializer();
Expand Down
2 changes: 1 addition & 1 deletion packages/client/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default defineConfig([
},
platform: 'neutral',
treeshake: true,
dts: true,
dts: { resolve: true },
sourcemap: true,
splitting: false,
clean: true,
Expand Down
15 changes: 12 additions & 3 deletions packages/constants/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,25 @@
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)
## [1.2.2](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.2.1...@windingtree/sdk-constants@1.2.2) (2023-12-11)

**Note:** Version bump only for package @windingtree/sdk-constants

## [1.2.1](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.2.0...@windingtree/sdk-constants@1.2.1) (2023-10-31)

### Features
### Bug Fixes

* improve test coverage ([9d49c6e](https://github.com/windingtree/sdk/commit/9d49c6e2e172cce2c6eb320a3f0e4b097d8e83a8))
- 🐛 Fixed file ext for cjs modules ([6f985f2](https://github.com/windingtree/sdk/commit/6f985f2a6b076abdf145176d5036fe89267f2c5a))

# [1.2.0](https://github.com/windingtree/sdk/compare/@windingtree/sdk-constants@1.2.0-beta.0...@windingtree/sdk-constants@1.2.0) (2023-10-25)

**Note:** Version bump only for package @windingtree/sdk-constants

# [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)

Expand Down
6 changes: 3 additions & 3 deletions packages/constants/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@windingtree/sdk-constants",
"version": "1.2.0-beta.0",
"version": "1.2.2",
"description": "libp2p PubSub protocol implementation for the WindingTree market protocol",
"repository": "https://github.com/windingtree/sdk#readme",
"author": "Kostiantyn Smyrnov <kostysh@gmail.com>",
Expand All @@ -10,7 +10,7 @@
"dist"
],
"types": "./dist/index.d.ts",
"main": "./dist/index.cjs.js",
"main": "./dist/index.cjs",
"module": "./dist/index.js",
"exports": {
".": {
Expand All @@ -20,7 +20,7 @@
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.cjs.js"
"default": "./dist/index.cjs"
}
}
},
Expand Down
2 changes: 1 addition & 1 deletion packages/constants/tsup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig([
},
platform: 'neutral',
treeshake: true,
dts: true,
dts: { resolve: true },
sourcemap: true,
splitting: false,
clean: true,
Expand Down
Loading

0 comments on commit 6491844

Please sign in to comment.