Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
5e1a525
chore: switch to pnpm and update Node.js to v20
jeffersonBastos May 23, 2025
cdc8d1a
chore: reorganize project structure under packages/cow-sdk
jeffersonBastos May 23, 2025
b54db28
feat: init monorepo structure with Turborepo
jeffersonBastos May 23, 2025
7c5d531
chore: format codebase with pnpm script
jeffersonBastos May 23, 2025
0203727
chore: eslint config.
jeffersonBastos May 26, 2025
074778b
chore: update lint config, .npmrc, and VSCode settings
jeffersonBastos May 27, 2025
70ef622
feat: copy entire src, tests folders, and package/tsconfig files from…
jeffersonBastos May 27, 2025
7601c21
feat: add typescript-config
jeffersonBastos May 27, 2025
5e99f36
feat: create common package with abstract adapter and context classes
jeffersonBastos May 27, 2025
1231f7c
feat: implement adapters for ethers v5, ethers v6, and viem
jeffersonBastos May 27, 2025
bbb0b3c
chore: update pnpm-lock
jean-neiverth May 28, 2025
3e814a5
chore: remove appdata and cow-sdk from build
jean-neiverth May 28, 2025
212c4a7
feat: create config package
jean-neiverth May 28, 2025
41b7ac7
chore: fix eslint tsconfig path
jean-neiverth May 28, 2025
f7fcf73
feat: refactor config
jean-neiverth May 28, 2025
420181c
chore: update pnpm-lock
jean-neiverth May 28, 2025
422afd2
feat: implement adapter usage in app-data; update app-data config and…
jeffersonBastos May 28, 2025
0257ac6
chore: update pnpm-lock file
jeffersonBastos May 28, 2025
46decb7
chore: fix lint and remove cow-sdk from lint.
jeffersonBastos May 28, 2025
003f020
Merge pull request #15 from bleu/jefferson/cow-468-integrate-new-mono…
jeffersonBastos May 28, 2025
8666af4
chore: update sdk-config tsconfig
jean-neiverth May 29, 2025
780a60f
feat: add contracts-ts package
jean-neiverth May 28, 2025
2e14272
feat: refactor contracts-ts
jean-neiverth May 28, 2025
aadd9a7
feat: update adapters with new contracts-ts features
jean-neiverth May 28, 2025
4f39d4d
feat: add tests for contracts-ts
jean-neiverth May 28, 2025
68360fc
chore: update contracts-ts config
jean-neiverth May 29, 2025
1bd47c4
Merge pull request #19 from bleu/feat/create-app-data-package
jean-neiverth May 29, 2025
724c165
Merge branch 'bleu/refactor' into jean/add-config-package
jean-neiverth May 29, 2025
3d8d340
Merge pull request #16 from bleu/jean/add-config-package
jean-neiverth May 29, 2025
9978f0f
Merge branch 'bleu/refactor' into jean/add-contracts-ts-package
jean-neiverth May 29, 2025
06adbc0
Merge pull request #17 from bleu/jean/add-contracts-ts-package
jean-neiverth May 29, 2025
fd2dea1
chore(order-book): move order-book to monorepo package
jeffersonBastos May 29, 2025
a0159cf
restore: bring back deleted type files with their history
jeffersonBastos May 29, 2025
066749b
restore: bring back deleted config and path files with their history
jeffersonBastos May 29, 2025
4a7e5d6
refactor: move cow-error and wallets.ts and remove duplicate types
jeffersonBastos May 29, 2025
6ff4954
feat(order-book): setup order-book package, jest and tsconfig
jeffersonBastos May 29, 2025
fd74389
feat(order-book): refact order-book
jeffersonBastos May 29, 2025
23dc2a5
feat(monorepo-config): adjust all package.json and scripts
jeffersonBastos May 29, 2025
881e345
chore(lint): lint
jeffersonBastos May 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
30 changes: 15 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "Node",
"image": "mcr.microsoft.com/devcontainers/base:0",
"name": "Node",
"image": "mcr.microsoft.com/devcontainers/base:0",

"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
}
}
"features": {
"ghcr.io/devcontainers/features/node:1": {},
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": true,
"configureZshAsDefaultShell": true,
"installOhMyZsh": true,
"installOhMyZshConfig": true,
"upgradePackages": true,
"username": "automatic",
"userUid": "automatic",
"userGid": "automatic"
}
}
}
24 changes: 20 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,27 @@
# Turborepo
.turbo

# Dependencies
node_modules
.pnp

# Build
dist
coverage
.coveralls.yml
jest.results.json

# IDE
.idea
*.iml
.yalc
yalc.lock
src/common/generated
docs/typedoc/

# macOS
.DS_Store

# Generated files
packages/cow-sdk/src/common/generated
packages/cow-sdk/docs/typedoc/


#app-data
packages/app-data/schemas/
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
shamefully-hoist=false
strict-peer-dependencies=false
node-linker=isolated
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14.*
v20.*
3 changes: 2 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
"printWidth": 120,
"endOfLine": "lf"
}
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "always"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.singleQuote": true,
"prettier.semi": false,
"prettier.printWidth": 120
}
83 changes: 46 additions & 37 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,45 +1,54 @@
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import * as tseslint from 'typescript-eslint'
import unusedImports from 'eslint-plugin-unused-imports'

export default tseslint.config(
export default [
{
ignores: ['**/generated/*'],
ignores: ['**/generated/*', '**/jest.config.ts', '**/generated/**/*'],
},
eslint.configs.recommended,
tseslint.configs.recommended,
[
{
plugins: {
'unused-imports': unusedImports,
},
rules: {
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'error',
'no-prototype-builtins': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
...tseslint.configs.recommended,
{
files: ['**/*.ts'],
plugins: {
'unused-imports': unusedImports,
},
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: ['./packages/*/tsconfig.json', './packages/providers/*/tsconfig.json'],
},
},
],
)
rules: {
'@typescript-eslint/no-non-null-assertion': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'no-prototype-builtins': 'off',
'unused-imports/no-unused-imports': 'error',
'unused-imports/no-unused-vars': [
'warn',
{
vars: 'all',
varsIgnorePattern: '^_',
args: 'after-used',
argsIgnorePattern: '^_',
},
],
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
'eol-last': ['error', 'always'],
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts', '**/__mock__/**/*.ts'],
},
]
121 changes: 20 additions & 101 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,109 +1,28 @@
{
"name": "@cowprotocol/cow-sdk",
"version": "6.0.0-RC.43",
"license": "(MIT OR Apache-2.0)",
"files": [
"/dist"
],
"source": "src/index.ts",
"main": "./dist/index.js",
"module": "./dist/index.module.js",
"exports": {
"require": "./dist/index.js",
"default": "./dist/index.js"
},
"types": "dist/index.d.ts",
"name": "cow-monorepo",
"private": true,
"type": "module",
"scripts": {
"prebuild": "rm -rf dist && yarn run codegen",
"build": "microbundle -f modern,esm,cjs",
"start": "microbundle -f modern,esm,cjs watch",
"copy-md-files": "npx cpx \"**/*.md\" dist",
"postbuild": "cp package.json dist && yarn copy-md-files && yarn run trading:generateSchemas",
"lint": "eslint ./src",
"format": "prettier --write \"src/**/*.+(ts|json)\"",
"test": "jest",
"test:coverage": "jest --coverage --json --outputFile=jest.results.json && cat ./coverage/lcov.info | coveralls",
"test:coverage:html": "jest --silent=false --coverage --coverageReporters html",
"codegen": "npm run swagger:codegen && npm run typechain:codegen",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"graphql:codegen": "graphql-codegen --config graphql-codegen.yml",
"swagger:codegen": " openapi --input https://raw.githubusercontent.com/cowprotocol/services/v2.291.0/crates/orderbook/openapi.yml --output src/order-book/generated --exportServices false --exportCore false",
"typechain:codegen": "typechain --target ethers-v5 --out-dir ./src/common/generated './abi/*.json'",
"trading:generateSchemas": "ts-node scripts/generateTradingSchemas.ts"
},
"dependencies": {
"@cowprotocol/app-data": "^3.1.0",
"@cowprotocol/contracts": "^1.8.0",
"@ethersproject/abstract-signer": "^5.8.0",
"@openzeppelin/merkle-tree": "^1.0.8",
"@weiroll/weiroll.js": "^0.3.0",
"cross-fetch": "^3.2.0",
"deepmerge": "^4.3.1",
"ethers": "^5.8.0",
"exponential-backoff": "^3.1.2",
"graphql": "^16.11.0",
"graphql-request": "^4.3.0",
"limiter": "^3.0.0"
},
"peerDependencies": {
"ethers": "^5.7.2"
"build": "turbo run build --filter='!@cowprotocol/cow-sdk'",
"dev": "turbo run dev",
"lint": "turbo run lint --filter=!@cowprotocol/cow-sdk -- --fix",
"test": "turbo run test --filter=!@cowprotocol/cow-sdk",
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
"clean": "turbo run clean --filter=!@cowprotocol/cow-sdk && rm -rf .turbo"
},
"devDependencies": {
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.18.6",
"@babel/plugin-proposal-private-methods": "^7.18.6",
"@babel/preset-env": "^7.27.2",
"@babel/preset-typescript": "^7.27.1",
"@eslint/js": "^9.26.0",
"@graphql-codegen/cli": "5.0.6",
"@graphql-codegen/typescript": "4.1.6",
"@graphql-codegen/typescript-operations": "^4.6.1",
"@typechain/ethers-v5": "^11.1.2",
"@types/jest": "^29.5.14",
"@types/node": "^22.15.17",
"babel-plugin-inline-import": "^3.0.0",
"coveralls": "^3.1.1",
"cpx": "^1.5.0",
"eslint": "^9.26.0",
"@eslint/js": "^9.18.0",
"@typescript-eslint/parser": "^8.32.0",
"@typescript-eslint/utils": "^8.32.0",
"eslint": "^9.18.0",
"eslint-plugin-unused-imports": "^4.1.4",
"jest": "^29.7.0",
"jest-fetch-mock": "^3.0.3",
"microbundle": "^0.15.1",
"openapi-typescript-codegen": "^0.29.0",
"prettier": "^3.5.3",
"ts-json-schema-generator": "^2.4.0",
"ts-mockito": "^2.6.1",
"ts-node": "^10.9.2",
"tsc-watch": "^6.2.1",
"typechain": "^8.3.2",
"typescript": "^5.8.3",
"tsup": "^7.2.0",
"turbo": "latest",
"typescript-eslint": "^8.32.1"
},
"jest": {
"automock": false,
"resetMocks": false,
"setupFiles": [
"./setupTests.js"
],
"collectCoverageFrom": [
"src/**/*.{ts,tsx}"
],
"coveragePathIgnorePatterns": [
"src/composable/generated"
],
"moduleDirectories": [
"node_modules"
],
"modulePaths": [
"<rootDir>/"
]
},
"keywords": [
"cow",
"cow-protocol",
"sdk",
"crypto",
"typescript",
"subgraph"
]
}
"packageManager": "pnpm@10.8.0",
"engines": {
"node": ">=18"
}
}
4 changes: 4 additions & 0 deletions packages/app-data/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
module.exports = {
presets: [['@babel/preset-env', { targets: { node: 'current' } }], '@babel/preset-typescript'],
plugins: [],
}
9 changes: 9 additions & 0 deletions packages/app-data/jest.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
preset: 'ts-jest/presets/js-with-ts-esm',
testEnvironment: 'node',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testMatch: ['**/src/**/*.spec.ts', '**/test/**/*.spec.ts'],
setupFilesAfterEnv: ['<rootDir>/setupTests.cjs'],
}
56 changes: 56 additions & 0 deletions packages/app-data/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"name": "@cowprotocol/sdk-app-data",
"version": "4.0.0",
"description": "CoW Protocol AppData schema definitions",
"type": "module",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"sideEffects": false,
"license": "MIT",
"files": [
"dist/**",
"schemas/**"
],
"scripts": {
"clean": "rm -rf dist/* && rm -rf .turbo && rm -rf node_modules && rm -rf schemas/",
"compile": "tsx src/scripts/compile.ts",
"prebuild": "pnpm run clean && pnpm install && pnpm run compile",
"build": "tsup src/index.ts --format esm,cjs --dts --external multiformats",
"dev": "pnpm run compile && tsup src/index.ts --format esm,cjs --watch --dts --external multiformats",
"lint": "eslint src/**/*.ts",
"test": "jest"
},
"devDependencies": {
"@repo/typescript-config": "workspace:*",
"@babel/core": "7.27.1",
"@babel/preset-env": "7.27.2",
"@babel/preset-typescript": "7.27.1",
"@types/jest": "^29.4.0",
"@types/node": "^20.17.31",
"@types/semver-sort": "^0.0.1",
"babel-jest": "29.7.0",
"jest": "^29.4.2",
"jest-fetch-mock": "^3.0.3",
"json-schema-ref-parser": "^9.0.9",
"json-schema-to-typescript": "^10.1.5",
"ts-jest": "^29.0.0",
"tsup": "^7.2.0",
"tsx": "^4.19.4",
"typescript": "^5.2.2",
"semver-sort": "^1.0.0"
},
"dependencies": {
"@cowprotocol/sdk-common": "workspace:*",
"ajv": "^8.11.0",
"cross-fetch": "^3.1.5",
"ipfs-only-hash": "^4.0.0",
"json-stringify-deterministic": "^1.0.8",
"multiformats": "^9.6.4"
},
"peerDependencies": {
"cross-fetch": "^3.x",
"ipfs-only-hash": "^4.x",
"multiformats": "^9.x"
}
}
Loading