This commit is contained in:
Aleksandr Kraiz
2023-03-31 17:47:56 +04:00
parent 94e99efd46
commit 8588b55725
103 changed files with 745 additions and 905 deletions

View File

@@ -1,128 +0,0 @@
module.exports = {
ignorePatterns: ['.eslintrc.js'],
env: {
browser: true,
es2021: true,
node: true,
},
extends: [
'standard-with-typescript',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'plugin:import/recommended',
'plugin:import/typescript'
],
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: [
"./tsconfig.json"
],
ecmaVersion: 2021,
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
],
rules: {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "separate-type-imports",
"disallowTypeAnnotations": true
}
],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowNullableObject": true,
"allowString": false,
"allowNumber": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false,
"allowNullableEnum": false
}
],
"eqeqeq": "error",
"@typescript-eslint/consistent-type-definitions": [
"warn",
"type"
],
"@typescript-eslint/indent": [
"error",
2,
{
"SwitchCase": 1,
"ignoredNodes": [
"TSTypeParameterInstantiation"
]
}
],
"@typescript-eslint/promise-function-async": 0,
"import/no-cycle": "error",
"@typescript-eslint/space-before-function-paren": 0,
"@typescript-eslint/comma-dangle": 0,
"@typescript-eslint/semi": 0,
"comma-dangle": 0,
"semi": 0,
"space-before-function-paren": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": ["acc", "prev"]
}
],
"camelcase": "off",
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'never',
},
],
'import/max-dependencies': [
'error',
{
max: 20,
ignoreTypeImports: false,
},
],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'no-shadow': 'off',
'@typescript-eslint/no-shadow': ['error'],
'max-len': [
1,
140,
2,
{
ignoreComments: true,
ignoreUrls: true,
ignoreTemplateLiterals: true,
}
],
'import/extensions': [
'error',
'ignorePackages',
{
js: 'never',
jsx: 'never',
ts: 'never',
tsx: 'never',
},
],
},
settings: {
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
},
},
};

140
.eslintrc.json Normal file
View File

@@ -0,0 +1,140 @@
{
"ignorePatterns": [
".eslintrc.js"
],
"env": {
"browser": true,
"es2021": true,
"node": true
},
"extends": [
"standard-with-typescript",
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:@typescript-eslint/strict"
// "plugin:import/recommended",
// "plugin:import/typescript"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"tsconfigRootDir": ".",
"project": [
"./tsconfig.json"
],
"ecmaVersion": 2020,
"sourceType": "module"
},
"plugins": [
"@typescript-eslint"
],
"rules": {
"@typescript-eslint/consistent-type-imports": [
"error",
{
"fixStyle": "separate-type-imports",
"disallowTypeAnnotations": true
}
],
"@typescript-eslint/strict-boolean-expressions": [
"error",
{
"allowNullableObject": true,
"allowString": false,
"allowNumber": false,
"allowNullableBoolean": false,
"allowNullableString": false,
"allowNullableNumber": false,
"allowAny": false,
"allowNullableEnum": false
}
],
"eqeqeq": "error",
"@typescript-eslint/consistent-type-definitions": [
"warn",
"type"
],
"@typescript-eslint/indent": [
"error",
2,
{
"SwitchCase": 1,
"ignoredNodes": [
"TSTypeParameterInstantiation"
]
}
],
"@typescript-eslint/promise-function-async": 0,
// "import/no-cycle": "error",
"@typescript-eslint/space-before-function-paren": 0,
"@typescript-eslint/comma-dangle": 0,
"@typescript-eslint/semi": 0,
"comma-dangle": 0,
"semi": 0,
"space-before-function-paren": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"no-param-reassign": [
"error",
{
"props": true,
"ignorePropertyModificationsFor": [
"acc",
"prev"
]
}
],
"camelcase": "off",
"@typescript-eslint/consistent-type-assertions": [
"error",
{
"assertionStyle": "never"
}
],
// "import/max-dependencies": [
// "error",
// {
// "max": 20,
// "ignoreTypeImports": false
// }
// ],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"no-shadow": "off",
"@typescript-eslint/no-shadow": [
"error"
],
"max-len": [
1,
140,
2,
{
"ignoreComments": true,
"ignoreUrls": true,
"ignoreTemplateLiterals": true
}
]
// "import/extensions": [
// "error",
// "ignorePackages",
// {
// "js": "never",
// "jsx": "never",
// "ts": "never",
// "tsx": "never"
// }
// ]
},
"settings": {
"import/resolver": {
"node": {
"extensions": [
".js",
".jsx",
".ts",
".tsx"
]
}
}
}
}

View File

@@ -1,12 +1,23 @@
import type { JestConfigWithTsJest } from 'ts-jest'; import type { JestConfigWithTsJest } from 'ts-jest';
const config: JestConfigWithTsJest = { const config: JestConfigWithTsJest = {
extensionsToTreatAsEsm: ['.ts'],
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
preset: 'ts-jest', preset: 'ts-jest',
testEnvironment: 'node', testEnvironment: 'node',
testMatch: ['**/__tests__/**/*.test.ts'], testMatch: ['**/__tests__/**/*.test.ts'],
modulePathIgnorePatterns: ['lib', 'node_modules'], modulePathIgnorePatterns: ['lib', 'node_modules'],
transform: { transform: {
'^.+\\.ts$': 'ts-jest', // '^.+\\.[tj]sx?$' to process js/ts with `ts-jest`
}, // '^.+\\.m?[tj]sx?$' to process js/ts/mjs/mts with `ts-jest`
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},
}; };
export default config; export default config;

466
package-lock.json generated
View File

@@ -12,7 +12,6 @@
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.2", "@ethersproject/providers": "^5.7.2",
"@lukeed/csprng": "^1.0.1",
"@orionprotocol/contracts": "0.6.0", "@orionprotocol/contracts": "0.6.0",
"bignumber.js": "^9.1.1", "bignumber.js": "^9.1.1",
"bson-objectid": "^2.0.4", "bson-objectid": "^2.0.4",
@@ -24,7 +23,7 @@
"just-clone": "^6.2.0", "just-clone": "^6.2.0",
"merge-anything": "^5.1.4", "merge-anything": "^5.1.4",
"neverthrow": "^6.0.0", "neverthrow": "^6.0.0",
"simple-typed-fetch": "^0.1.4", "simple-typed-fetch": "^0.1.5",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"tiny-invariant": "^1.3.1", "tiny-invariant": "^1.3.1",
"ts-is-present": "^1.2.2", "ts-is-present": "^1.2.2",
@@ -34,25 +33,26 @@
"zod": "3.21.4" "zod": "3.21.4"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.3", "@babel/core": "^7.21.4",
"@tsconfig/strictest": "^1.0.2", "@babel/plugin-syntax-import-assertions": "^7.20.0",
"@tsconfig/esm": "^1.0.2",
"@tsconfig/strictest": "^2.0.0",
"@types/express": "^4.17.17", "@types/express": "^4.17.17",
"@types/jest": "^29.5.0", "@types/jest": "^29.5.0",
"@types/node": "^18.15.6", "@types/node": "^18.15.11",
"@types/node-fetch": "^2.6.2",
"@types/socket.io-client": "1.4.33", "@types/socket.io-client": "1.4.33",
"@types/uuid": "^9.0.1", "@types/uuid": "^9.0.1",
"@types/ws": "^8.5.4", "@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.56.0", "@typescript-eslint/parser": "^5.57.0",
"babel-loader": "^9.1.2", "babel-loader": "^9.1.2",
"concurrently": "^7.6.0", "concurrently": "^8.0.1",
"eslint": "^8.35.0", "eslint": "^8.37.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-standard": "^17.0.0", "eslint-config-standard": "^17.0.0",
"eslint-config-standard-with-typescript": "^34.0.0", "eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1", "eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1", "eslint-plugin-promise": "^6.1.1",
"http-terminator": "^3.2.0", "http-terminator": "^3.2.0",
"husky": "^8.0.3", "husky": "^8.0.3",
@@ -60,8 +60,8 @@
"jest": "^29.5.0", "jest": "^29.5.0",
"ts-jest": "^29.0.5", "ts-jest": "^29.0.5",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^5.0.2", "typescript": "^5.0.3",
"webpack": "^5.76.3", "webpack": "^5.77.0",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.1"
}, },
"engines": { "engines": {
@@ -82,9 +82,9 @@
} }
}, },
"node_modules/@babel/code-frame": { "node_modules/@babel/code-frame": {
"version": "7.18.6", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.18.6.tgz", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.21.4.tgz",
"integrity": "sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q==", "integrity": "sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/highlight": "^7.18.6" "@babel/highlight": "^7.18.6"
@@ -94,30 +94,30 @@
} }
}, },
"node_modules/@babel/compat-data": { "node_modules/@babel/compat-data": {
"version": "7.21.0", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.0.tgz", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.21.4.tgz",
"integrity": "sha512-gMuZsmsgxk/ENC3O/fRw5QY8A9/uxQbbCEypnLIiYYc/qVJtEV7ouxC3EllIIwNzMqAQee5tanFabWsUOutS7g==", "integrity": "sha512-/DYyDpeCfaVinT40FPGdkkb+lYSKvsVuMjDAG7jPOWWiM1ibOaB9CXJAlc4d1QpP/U2q2P9jbrSlClKSErd55g==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": ">=6.9.0" "node": ">=6.9.0"
} }
}, },
"node_modules/@babel/core": { "node_modules/@babel/core": {
"version": "7.21.3", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.3.tgz", "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.21.4.tgz",
"integrity": "sha512-qIJONzoa/qiHghnm0l1n4i/6IIziDpzqc36FBs4pzMhDUraHqponwJLiAKm1hGLP3OSB/TVNz6rMwVGpwxxySw==", "integrity": "sha512-qt/YV149Jman/6AfmlxJ04LMIu8bMoyl3RB91yTFrxQmgbrSvQMy7cI8Q62FHx1t8wJ8B5fu0UDoLwHAhUo1QA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@ampproject/remapping": "^2.2.0", "@ampproject/remapping": "^2.2.0",
"@babel/code-frame": "^7.18.6", "@babel/code-frame": "^7.21.4",
"@babel/generator": "^7.21.3", "@babel/generator": "^7.21.4",
"@babel/helper-compilation-targets": "^7.20.7", "@babel/helper-compilation-targets": "^7.21.4",
"@babel/helper-module-transforms": "^7.21.2", "@babel/helper-module-transforms": "^7.21.2",
"@babel/helpers": "^7.21.0", "@babel/helpers": "^7.21.0",
"@babel/parser": "^7.21.3", "@babel/parser": "^7.21.4",
"@babel/template": "^7.20.7", "@babel/template": "^7.20.7",
"@babel/traverse": "^7.21.3", "@babel/traverse": "^7.21.4",
"@babel/types": "^7.21.3", "@babel/types": "^7.21.4",
"convert-source-map": "^1.7.0", "convert-source-map": "^1.7.0",
"debug": "^4.1.0", "debug": "^4.1.0",
"gensync": "^1.0.0-beta.2", "gensync": "^1.0.0-beta.2",
@@ -133,12 +133,12 @@
} }
}, },
"node_modules/@babel/generator": { "node_modules/@babel/generator": {
"version": "7.21.3", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.3.tgz", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.21.4.tgz",
"integrity": "sha512-QS3iR1GYC/YGUnW7IdggFeN5c1poPUurnGttOV/bZgPGV+izC/D8HnD6DLwod0fsatNyVn1G3EVWMYIF0nHbeA==", "integrity": "sha512-NieM3pVIYW2SwGzKoqfPrQsf4xGs9M9AIG3ThppsSRmO+m7eQhmI6amajKMUeIO37wFfsvnvcxQFx6x6iqxDnA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/types": "^7.21.3", "@babel/types": "^7.21.4",
"@jridgewell/gen-mapping": "^0.3.2", "@jridgewell/gen-mapping": "^0.3.2",
"@jridgewell/trace-mapping": "^0.3.17", "@jridgewell/trace-mapping": "^0.3.17",
"jsesc": "^2.5.1" "jsesc": "^2.5.1"
@@ -162,13 +162,13 @@
} }
}, },
"node_modules/@babel/helper-compilation-targets": { "node_modules/@babel/helper-compilation-targets": {
"version": "7.20.7", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.4.tgz",
"integrity": "sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ==", "integrity": "sha512-Fa0tTuOXZ1iL8IeDFUWCzjZcn+sJGd9RZdH9esYVjEejGmzf+FFYQpMi/kZUk2kPy/q1H3/GPw7np8qar/stfg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/compat-data": "^7.20.5", "@babel/compat-data": "^7.21.4",
"@babel/helper-validator-option": "^7.18.6", "@babel/helper-validator-option": "^7.21.0",
"browserslist": "^4.21.3", "browserslist": "^4.21.3",
"lru-cache": "^5.1.1", "lru-cache": "^5.1.1",
"semver": "^6.3.0" "semver": "^6.3.0"
@@ -349,9 +349,9 @@
} }
}, },
"node_modules/@babel/parser": { "node_modules/@babel/parser": {
"version": "7.21.3", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.3.tgz", "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.21.4.tgz",
"integrity": "sha512-lobG0d7aOfQRXh8AyklEAgZGvA4FShxo6xQbUrrT/cNBPUdIDojlokwJsQyCC/eKia7ifqM0yP+2DRZ4WKw2RQ==", "integrity": "sha512-alVJj7k7zIxqBZ7BTRhz0IqJFxW1VJbm6N8JbcYhQ186df9ZBPbZBmWSqAMXwHGsCJdYks7z/voa3ibiS5bCIw==",
"dev": true, "dev": true,
"bin": { "bin": {
"parser": "bin/babel-parser.js" "parser": "bin/babel-parser.js"
@@ -396,6 +396,21 @@
"@babel/core": "^7.0.0-0" "@babel/core": "^7.0.0-0"
} }
}, },
"node_modules/@babel/plugin-syntax-import-assertions": {
"version": "7.20.0",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz",
"integrity": "sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ==",
"dev": true,
"dependencies": {
"@babel/helper-plugin-utils": "^7.19.0"
},
"engines": {
"node": ">=6.9.0"
},
"peerDependencies": {
"@babel/core": "^7.0.0-0"
}
},
"node_modules/@babel/plugin-syntax-import-meta": { "node_modules/@babel/plugin-syntax-import-meta": {
"version": "7.10.4", "version": "7.10.4",
"resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-import-meta/-/plugin-syntax-import-meta-7.10.4.tgz",
@@ -568,19 +583,19 @@
} }
}, },
"node_modules/@babel/traverse": { "node_modules/@babel/traverse": {
"version": "7.21.3", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.3.tgz", "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.21.4.tgz",
"integrity": "sha512-XLyopNeaTancVitYZe2MlUEvgKb6YVVPXzofHgqHijCImG33b/uTurMS488ht/Hbsb2XK3U2BnSTxKVNGV3nGQ==", "integrity": "sha512-eyKrRHKdyZxqDm+fV1iqL9UAHMoIg0nDaGqfIOd8rKH17m5snv7Gn4qgjBoFfLz9APvjFU/ICT00NVCv1Epp8Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/code-frame": "^7.18.6", "@babel/code-frame": "^7.21.4",
"@babel/generator": "^7.21.3", "@babel/generator": "^7.21.4",
"@babel/helper-environment-visitor": "^7.18.9", "@babel/helper-environment-visitor": "^7.18.9",
"@babel/helper-function-name": "^7.21.0", "@babel/helper-function-name": "^7.21.0",
"@babel/helper-hoist-variables": "^7.18.6", "@babel/helper-hoist-variables": "^7.18.6",
"@babel/helper-split-export-declaration": "^7.18.6", "@babel/helper-split-export-declaration": "^7.18.6",
"@babel/parser": "^7.21.3", "@babel/parser": "^7.21.4",
"@babel/types": "^7.21.3", "@babel/types": "^7.21.4",
"debug": "^4.1.0", "debug": "^4.1.0",
"globals": "^11.1.0" "globals": "^11.1.0"
}, },
@@ -589,9 +604,9 @@
} }
}, },
"node_modules/@babel/types": { "node_modules/@babel/types": {
"version": "7.21.3", "version": "7.21.4",
"resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.3.tgz", "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.21.4.tgz",
"integrity": "sha512-sBGdETxC+/M4o/zKC0sl6sjWv62WFR/uzxrJ6uYyMLZOUlPnwzw0tKgVHOXxaAd5l2g8pEDM5RZ495GPQI77kg==", "integrity": "sha512-rU2oY501qDxE8Pyo7i/Orqma4ziCOrby0/9mvbDUGEfvZjb279Nk9k19e2fiCxHbRRpY2ZyrgW1eq22mvmOIzA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@babel/helper-string-parser": "^7.19.4", "@babel/helper-string-parser": "^7.19.4",
@@ -662,14 +677,14 @@
} }
}, },
"node_modules/@eslint/eslintrc": { "node_modules/@eslint/eslintrc": {
"version": "2.0.0", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz",
"integrity": "sha512-fluIaaV+GyV24CCu/ggiHdV+j4RNh85yQnAYS/G2mZODZgGmmlrgCydjUcV3YvxCm9x8nMAfThsqTni4KiXT4A==", "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"ajv": "^6.12.4", "ajv": "^6.12.4",
"debug": "^4.3.2", "debug": "^4.3.2",
"espree": "^9.4.0", "espree": "^9.5.1",
"globals": "^13.19.0", "globals": "^13.19.0",
"ignore": "^5.2.0", "ignore": "^5.2.0",
"import-fresh": "^3.2.1", "import-fresh": "^3.2.1",
@@ -712,9 +727,9 @@
} }
}, },
"node_modules/@eslint/js": { "node_modules/@eslint/js": {
"version": "8.35.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.35.0.tgz", "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.37.0.tgz",
"integrity": "sha512-JXdzbRiWclLVoD8sNUjR443VVlYqiYmDVT6rGUEIEHU5YJW0gaVZwV2xgM7D4arkvASqD0IlLUVjHiFuxaftRw==", "integrity": "sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -2285,14 +2300,6 @@
"@jridgewell/sourcemap-codec": "1.4.14" "@jridgewell/sourcemap-codec": "1.4.14"
} }
}, },
"node_modules/@lukeed/csprng": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.0.1.tgz",
"integrity": "sha512-uSvJdwQU5nK+Vdf6zxcWAY2A8r7uqe+gePwLWzJ+fsQehq18pc0I2hJKwypZ2aLM90+Er9u1xn4iLJPZ+xlL4g==",
"engines": {
"node": ">=8"
}
},
"node_modules/@nodelib/fs.scandir": { "node_modules/@nodelib/fs.scandir": {
"version": "2.1.5", "version": "2.1.5",
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
@@ -2357,6 +2364,12 @@
"@sinonjs/commons": "^2.0.0" "@sinonjs/commons": "^2.0.0"
} }
}, },
"node_modules/@tsconfig/esm": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/@tsconfig/esm/-/esm-1.0.2.tgz",
"integrity": "sha512-awiISx+G4L+7k97nKnfA5QF6rukawiuycMPfASFHG/0fqjrUlYBuNISy3Yjl1SHIpVi57lYf7dc6L/FoQQCKcA==",
"dev": true
},
"node_modules/@tsconfig/node10": { "node_modules/@tsconfig/node10": {
"version": "1.0.9", "version": "1.0.9",
"resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz", "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.9.tgz",
@@ -2378,9 +2391,9 @@
"integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ==" "integrity": "sha512-yOlFc+7UtL/89t2ZhjPvvB/DeAr3r+Dq58IgzsFkOAvVC6NMJXmCGjbptdXdR9qsX7pKcTL+s87FtYREi2dEEQ=="
}, },
"node_modules/@tsconfig/strictest": { "node_modules/@tsconfig/strictest": {
"version": "1.0.2", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-1.0.2.tgz", "resolved": "https://registry.npmjs.org/@tsconfig/strictest/-/strictest-2.0.0.tgz",
"integrity": "sha512-IRKlC8cnP7zMz1SDBjyIVyPapkEGWLZ6wkF6Z8T+xU80P9sO5uGXlIUvtzjx+7ehPJRWxkB6CeIDwUfyqNtYkQ==", "integrity": "sha512-E0dpiZNdwO20c8d3seh7OmjAvDpwoRkTcU6M8cvggzB45Bd45tyTU2XJeA5Wfq+8NzVGhunvqOJ30AjSkywMXA==",
"dev": true "dev": true
}, },
"node_modules/@types/babel__core": { "node_modules/@types/babel__core": {
@@ -2554,19 +2567,9 @@
"dev": true "dev": true
}, },
"node_modules/@types/node": { "node_modules/@types/node": {
"version": "18.15.7", "version": "18.15.11",
"resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.7.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.11.tgz",
"integrity": "sha512-LFmUbFunqmBn26wJZgZPYZPrDR1RwGOu2v79Mgcka1ndO6V0/cwjivPTc4yoK6n9kmw4/ls1r8cLrvh2iMibFA==" "integrity": "sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q=="
},
"node_modules/@types/node-fetch": {
"version": "2.6.2",
"resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.2.tgz",
"integrity": "sha512-DHqhlq5jeESLy19TYhLakJ07kNumXWjcDdxXsLUMJZ6ue8VZJj4kLPQVE/2mdHh3xZziNF1xppu5lwmS53HR+A==",
"dev": true,
"dependencies": {
"@types/node": "*",
"form-data": "^3.0.0"
}
}, },
"node_modules/@types/prettier": { "node_modules/@types/prettier": {
"version": "2.7.2", "version": "2.7.2",
@@ -2645,15 +2648,15 @@
"dev": true "dev": true
}, },
"node_modules/@typescript-eslint/eslint-plugin": { "node_modules/@typescript-eslint/eslint-plugin": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.0.tgz",
"integrity": "sha512-ZNW37Ccl3oMZkzxrYDUX4o7cnuPgU+YrcaYXzsRtLB16I1FR5SHMqga3zGsaSliZADCWo2v8qHWqAYIj8nWCCg==", "integrity": "sha512-itag0qpN6q2UMM6Xgk6xoHa0D0/P+M17THnr4SVgqn9Rgam5k/He33MA7/D7QoJcdMxHFyX7U9imaBonAX/6qA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/regexpp": "^4.4.0", "@eslint-community/regexpp": "^4.4.0",
"@typescript-eslint/scope-manager": "5.56.0", "@typescript-eslint/scope-manager": "5.57.0",
"@typescript-eslint/type-utils": "5.56.0", "@typescript-eslint/type-utils": "5.57.0",
"@typescript-eslint/utils": "5.56.0", "@typescript-eslint/utils": "5.57.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"grapheme-splitter": "^1.0.4", "grapheme-splitter": "^1.0.4",
"ignore": "^5.2.0", "ignore": "^5.2.0",
@@ -2720,7 +2723,7 @@
} }
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/scope-manager": { "node_modules/@typescript-eslint/scope-manager": {
"version": "5.57.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.57.0.tgz",
"integrity": "sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw==", "integrity": "sha512-NANBNOQvllPlizl9LatX8+MHi7bx7WGIWYjPHDmQe5Si/0YEYfxSljJpoTyTWFTgRy3X8gLYSE4xQ2U+aCozSw==",
@@ -2737,103 +2740,14 @@
"url": "https://opencollective.com/typescript-eslint" "url": "https://opencollective.com/typescript-eslint"
} }
}, },
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/types": {
"version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.0.tgz",
"integrity": "sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ==",
"dev": true,
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/typescript-estree": {
"version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz",
"integrity": "sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.57.0",
"@typescript-eslint/visitor-keys": "5.57.0",
"debug": "^4.3.4",
"globby": "^11.1.0",
"is-glob": "^4.0.3",
"semver": "^7.3.7",
"tsutils": "^3.21.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependenciesMeta": {
"typescript": {
"optional": true
}
}
},
"node_modules/@typescript-eslint/parser/node_modules/@typescript-eslint/visitor-keys": {
"version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz",
"integrity": "sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.57.0",
"eslint-visitor-keys": "^3.3.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/parser/node_modules/semver": {
"version": "7.3.8",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.8.tgz",
"integrity": "sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A==",
"dev": true,
"dependencies": {
"lru-cache": "^6.0.0"
},
"bin": {
"semver": "bin/semver.js"
},
"engines": {
"node": ">=10"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "5.56.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.56.0.tgz",
"integrity": "sha512-jGYKyt+iBakD0SA5Ww8vFqGpoV2asSjwt60Gl6YcO8ksQ8s2HlUEyHBMSa38bdLopYqGf7EYQMUIGdT/Luw+sw==",
"dev": true,
"dependencies": {
"@typescript-eslint/types": "5.56.0",
"@typescript-eslint/visitor-keys": "5.56.0"
},
"engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/type-utils": { "node_modules/@typescript-eslint/type-utils": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.57.0.tgz",
"integrity": "sha512-8WxgOgJjWRy6m4xg9KoSHPzBNZeQbGlQOH7l2QEhQID/+YseaFxg5J/DLwWSsi9Axj4e/cCiKx7PVzOq38tY4A==", "integrity": "sha512-kxXoq9zOTbvqzLbdNKy1yFrxLC6GDJFE2Yuo3KqSwTmDOFjUGeWSakgoXT864WcK5/NAJkkONCiKb1ddsqhLXQ==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/typescript-estree": "5.56.0", "@typescript-eslint/typescript-estree": "5.57.0",
"@typescript-eslint/utils": "5.56.0", "@typescript-eslint/utils": "5.57.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"tsutils": "^3.21.0" "tsutils": "^3.21.0"
}, },
@@ -2854,9 +2768,9 @@
} }
}, },
"node_modules/@typescript-eslint/types": { "node_modules/@typescript-eslint/types": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.57.0.tgz",
"integrity": "sha512-JyAzbTJcIyhuUhogmiu+t79AkdnqgPUEsxMTMc/dCZczGMJQh1MK2wgrju++yMN6AWroVAy2jxyPcPr3SWCq5w==", "integrity": "sha512-mxsod+aZRSyLT+jiqHw1KK6xrANm19/+VFALVFP5qa/aiJnlP38qpyaTd0fEKhWvQk6YeNZ5LGwI1pDpBRBhtQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -2867,13 +2781,13 @@
} }
}, },
"node_modules/@typescript-eslint/typescript-estree": { "node_modules/@typescript-eslint/typescript-estree": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.0.tgz",
"integrity": "sha512-41CH/GncsLXOJi0jb74SnC7jVPWeVJ0pxQj8bOjH1h2O26jXN3YHKDT1ejkVz5YeTEQPeLCCRY0U2r68tfNOcg==", "integrity": "sha512-LTzQ23TV82KpO8HPnWuxM2V7ieXW8O142I7hQTxWIHDcCEIjtkat6H96PFkYBQqGFLW/G/eVVOB9Z8rcvdY/Vw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.56.0", "@typescript-eslint/types": "5.57.0",
"@typescript-eslint/visitor-keys": "5.56.0", "@typescript-eslint/visitor-keys": "5.57.0",
"debug": "^4.3.4", "debug": "^4.3.4",
"globby": "^11.1.0", "globby": "^11.1.0",
"is-glob": "^4.0.3", "is-glob": "^4.0.3",
@@ -2909,17 +2823,17 @@
} }
}, },
"node_modules/@typescript-eslint/utils": { "node_modules/@typescript-eslint/utils": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.57.0.tgz",
"integrity": "sha512-XhZDVdLnUJNtbzaJeDSCIYaM+Tgr59gZGbFuELgF7m0IY03PlciidS7UQNKLE0+WpUTn1GlycEr6Ivb/afjbhA==", "integrity": "sha512-ps/4WohXV7C+LTSgAL5CApxvxbMkl9B9AUZRtnEFonpIxZDIT7wC1xfvuJONMidrkB9scs4zhtRyIwHh4+18kw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/eslint-utils": "^4.2.0",
"@types/json-schema": "^7.0.9", "@types/json-schema": "^7.0.9",
"@types/semver": "^7.3.12", "@types/semver": "^7.3.12",
"@typescript-eslint/scope-manager": "5.56.0", "@typescript-eslint/scope-manager": "5.57.0",
"@typescript-eslint/types": "5.56.0", "@typescript-eslint/types": "5.57.0",
"@typescript-eslint/typescript-estree": "5.56.0", "@typescript-eslint/typescript-estree": "5.57.0",
"eslint-scope": "^5.1.1", "eslint-scope": "^5.1.1",
"semver": "^7.3.7" "semver": "^7.3.7"
}, },
@@ -2950,12 +2864,12 @@
} }
}, },
"node_modules/@typescript-eslint/visitor-keys": { "node_modules/@typescript-eslint/visitor-keys": {
"version": "5.56.0", "version": "5.57.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.56.0.tgz", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.0.tgz",
"integrity": "sha512-1mFdED7u5bZpX6Xxf5N9U2c18sb+8EvU3tyOIj6LQZ5OOvnmj8BVeNNP603OFPm5KkS1a7IvCIcwrdHXaEMG/Q==", "integrity": "sha512-ery2g3k0hv5BLiKpPuwYt9KBkAp2ugT6VvyShXdLOkax895EC55sP0Tx5L0fZaQueiK3fBLvHVvEl3jFS5ia+g==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/types": "5.56.0", "@typescript-eslint/types": "5.57.0",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.3.0"
}, },
"engines": { "engines": {
@@ -3431,12 +3345,6 @@
"resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz",
"integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA=="
}, },
"node_modules/asynckit": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
"dev": true
},
"node_modules/babel-jest": { "node_modules/babel-jest": {
"version": "29.5.0", "version": "29.5.0",
"resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-29.5.0.tgz",
@@ -4079,18 +3987,6 @@
"integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==", "integrity": "sha512-3tlv/dIP7FWvj3BsbHrGLJ6l/oKh1O3TcgBqMn+yyCagOxc23fyzDS6HypQbgxWbkpDnf52p1LuR4eWDQ/K9WQ==",
"dev": true "dev": true
}, },
"node_modules/combined-stream": {
"version": "1.0.8",
"resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
"dev": true,
"dependencies": {
"delayed-stream": "~1.0.0"
},
"engines": {
"node": ">= 0.8"
}
},
"node_modules/commander": { "node_modules/commander": {
"version": "2.20.3", "version": "2.20.3",
"resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz",
@@ -4110,27 +4006,27 @@
"dev": true "dev": true
}, },
"node_modules/concurrently": { "node_modules/concurrently": {
"version": "7.6.0", "version": "8.0.1",
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-7.6.0.tgz", "resolved": "https://registry.npmjs.org/concurrently/-/concurrently-8.0.1.tgz",
"integrity": "sha512-BKtRgvcJGeZ4XttiDiNcFiRlxoAeZOseqUvyYRUp/Vtd+9p1ULmeoSqGsDA+2ivdeDFpqrJvGvmI+StKfKl5hw==", "integrity": "sha512-Sh8bGQMEL0TAmAm2meAXMjcASHZa7V0xXQVDBLknCPa9TPtkY9yYs+0cnGGgfdkW0SV1Mlg+hVGfXcoI8d3MJA==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"chalk": "^4.1.0", "chalk": "^4.1.2",
"date-fns": "^2.29.1", "date-fns": "^2.29.3",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"rxjs": "^7.0.0", "rxjs": "^7.8.0",
"shell-quote": "^1.7.3", "shell-quote": "^1.8.0",
"spawn-command": "^0.0.2-1", "spawn-command": "0.0.2-1",
"supports-color": "^8.1.0", "supports-color": "^8.1.1",
"tree-kill": "^1.2.2", "tree-kill": "^1.2.2",
"yargs": "^17.3.1" "yargs": "^17.7.1"
}, },
"bin": { "bin": {
"conc": "dist/bin/concurrently.js", "conc": "dist/bin/concurrently.js",
"concurrently": "dist/bin/concurrently.js" "concurrently": "dist/bin/concurrently.js"
}, },
"engines": { "engines": {
"node": "^12.20.0 || ^14.13.0 || >=16.0.0" "node": "^14.13.0 || >=16.0.0"
}, },
"funding": { "funding": {
"url": "https://github.com/open-cli-tools/concurrently?sponsor=1" "url": "https://github.com/open-cli-tools/concurrently?sponsor=1"
@@ -4431,15 +4327,6 @@
"url": "https://github.com/sponsors/sindresorhus" "url": "https://github.com/sponsors/sindresorhus"
} }
}, },
"node_modules/delayed-stream": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
"dev": true,
"engines": {
"node": ">=0.4.0"
}
},
"node_modules/depd": { "node_modules/depd": {
"version": "2.0.0", "version": "2.0.0",
"resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz",
@@ -4715,13 +4602,15 @@
} }
}, },
"node_modules/eslint": { "node_modules/eslint": {
"version": "8.35.0", "version": "8.37.0",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-8.35.0.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.37.0.tgz",
"integrity": "sha512-BxAf1fVL7w+JLRQhWl2pzGeSiGqbWumV4WNvc9Rhp6tiCtm4oHnyPBSEtMGZwrQgudFQ+otqzWoPB7x+hxoWsw==", "integrity": "sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@eslint/eslintrc": "^2.0.0", "@eslint-community/eslint-utils": "^4.2.0",
"@eslint/js": "8.35.0", "@eslint-community/regexpp": "^4.4.0",
"@eslint/eslintrc": "^2.0.2",
"@eslint/js": "8.37.0",
"@humanwhocodes/config-array": "^0.11.8", "@humanwhocodes/config-array": "^0.11.8",
"@humanwhocodes/module-importer": "^1.0.1", "@humanwhocodes/module-importer": "^1.0.1",
"@nodelib/fs.walk": "^1.2.8", "@nodelib/fs.walk": "^1.2.8",
@@ -4732,9 +4621,8 @@
"doctrine": "^3.0.0", "doctrine": "^3.0.0",
"escape-string-regexp": "^4.0.0", "escape-string-regexp": "^4.0.0",
"eslint-scope": "^7.1.1", "eslint-scope": "^7.1.1",
"eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.4.0",
"eslint-visitor-keys": "^3.3.0", "espree": "^9.5.1",
"espree": "^9.4.0",
"esquery": "^1.4.2", "esquery": "^1.4.2",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"fast-deep-equal": "^3.1.3", "fast-deep-equal": "^3.1.3",
@@ -4756,7 +4644,6 @@
"minimatch": "^3.1.2", "minimatch": "^3.1.2",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"optionator": "^0.9.1", "optionator": "^0.9.1",
"regexpp": "^3.2.0",
"strip-ansi": "^6.0.1", "strip-ansi": "^6.0.1",
"strip-json-comments": "^3.1.0", "strip-json-comments": "^3.1.0",
"text-table": "^0.2.0" "text-table": "^0.2.0"
@@ -4817,16 +4704,16 @@
} }
}, },
"node_modules/eslint-config-standard-with-typescript": { "node_modules/eslint-config-standard-with-typescript": {
"version": "34.0.0", "version": "34.0.1",
"resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-34.0.0.tgz", "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-34.0.1.tgz",
"integrity": "sha512-zhCsI4/A0rJ1ma8sf3RLXYc0gc7yPmdTWRVXMh9dtqeUx3yBQyALH0wosHhk1uQ9QyItynLdNOtcHKNw8G7lQw==", "integrity": "sha512-J7WvZeLtd0Vr9F+v4dZbqJCLD16cbIy4U+alJMq4MiXdpipdBM3U5NkXaGUjePc4sb1ZE01U9g6VuTBpHHz1fg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@typescript-eslint/parser": "^5.0.0", "@typescript-eslint/parser": "^5.43.0",
"eslint-config-standard": "17.0.0" "eslint-config-standard": "17.0.0"
}, },
"peerDependencies": { "peerDependencies": {
"@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.43.0",
"eslint": "^8.0.1", "eslint": "^8.0.1",
"eslint-plugin-import": "^2.25.2", "eslint-plugin-import": "^2.25.2",
"eslint-plugin-n": "^15.0.0", "eslint-plugin-n": "^15.0.0",
@@ -4974,9 +4861,9 @@
} }
}, },
"node_modules/eslint-plugin-n": { "node_modules/eslint-plugin-n": {
"version": "15.6.1", "version": "15.7.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.6.1.tgz", "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz",
"integrity": "sha512-R9xw9OtCRxxaxaszTQmQAlPgM+RdGjaL1akWuY/Fv9fRAi8Wj4CUKc6iYVG8QNRjRuo8/BqVYIpfqberJUEacA==", "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"builtins": "^5.0.1", "builtins": "^5.0.1",
@@ -5066,12 +4953,15 @@
} }
}, },
"node_modules/eslint-visitor-keys": { "node_modules/eslint-visitor-keys": {
"version": "3.3.0", "version": "3.4.0",
"resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz",
"integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==",
"dev": true, "dev": true,
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
} }
}, },
"node_modules/eslint/node_modules/ansi-styles": { "node_modules/eslint/node_modules/ansi-styles": {
@@ -5206,14 +5096,14 @@
} }
}, },
"node_modules/espree": { "node_modules/espree": {
"version": "9.4.1", "version": "9.5.1",
"resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz",
"integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"acorn": "^8.8.0", "acorn": "^8.8.0",
"acorn-jsx": "^5.3.2", "acorn-jsx": "^5.3.2",
"eslint-visitor-keys": "^3.3.0" "eslint-visitor-keys": "^3.4.0"
}, },
"engines": { "engines": {
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
@@ -5698,20 +5588,6 @@
"integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==",
"dev": true "dev": true
}, },
"node_modules/form-data": {
"version": "3.0.1",
"resolved": "https://registry.npmjs.org/form-data/-/form-data-3.0.1.tgz",
"integrity": "sha512-RHkBKtLWUVwd7SqRIvCZMEvAMoGUp0XU+seQiZejj0COz3RI3hWP4sCv3gZWWLjJTd7rGwcsF5eKZGii0r/hbg==",
"dev": true,
"dependencies": {
"asynckit": "^0.4.0",
"combined-stream": "^1.0.8",
"mime-types": "^2.1.12"
},
"engines": {
"node": ">= 6"
}
},
"node_modules/formdata-polyfill": { "node_modules/formdata-polyfill": {
"version": "4.0.10", "version": "4.0.10",
"resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz", "resolved": "https://registry.npmjs.org/formdata-polyfill/-/formdata-polyfill-4.0.10.tgz",
@@ -9507,9 +9383,9 @@
} }
}, },
"node_modules/rxjs": { "node_modules/rxjs": {
"version": "7.5.7", "version": "7.8.0",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.7.tgz", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz",
"integrity": "sha512-z9MzKh/UcOqB3i20H6rtrlaE/CgjLOvheWK/9ILrbhROGTweAi1BaFsTT9FbwZi5Trr1qNRs+MXkhmR06awzQA==", "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"tslib": "^2.1.0" "tslib": "^2.1.0"
@@ -9750,9 +9626,9 @@
} }
}, },
"node_modules/shell-quote": { "node_modules/shell-quote": {
"version": "1.7.4", "version": "1.8.0",
"resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.7.4.tgz", "resolved": "https://registry.npmjs.org/shell-quote/-/shell-quote-1.8.0.tgz",
"integrity": "sha512-8o/QEhSSRb1a5i7TFR0iM4G16Z0vYB2OQVs4G3aAFXjn3T6yEx8AZxy1PgDF7I00LZHYA3WxaSYIf5e5sAX8Rw==", "integrity": "sha512-QHsz8GgQIGKlRi24yFc6a6lN69Idnx634w49ay6+jA5yFh7a1UY+4Rp6HPx/L/1zcEDPEij8cIsiqR6bQsE5VQ==",
"dev": true, "dev": true,
"funding": { "funding": {
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
@@ -10438,9 +10314,9 @@
} }
}, },
"node_modules/tslib": { "node_modules/tslib": {
"version": "2.4.1", "version": "2.5.0",
"resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.1.tgz", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz",
"integrity": "sha512-tGyy4dAjRIEwI7BzsB0lynWgOpfqjUdq91XXAlIWD2OwKBH7oCl/GZG/HT4BOHrTlPMOASlMQ7veyTqpmRcrNA==", "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==",
"dev": true "dev": true
}, },
"node_modules/tsutils": { "node_modules/tsutils": {
@@ -10510,9 +10386,9 @@
} }
}, },
"node_modules/typescript": { "node_modules/typescript": {
"version": "5.0.2", "version": "5.0.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.2.tgz", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.3.tgz",
"integrity": "sha512-wVORMBGO/FAs/++blGNeAVdbNKtIh1rbBL2EyQ1+J9lClJ93KiiKe8PmFIVdXhHcyv44SL9oglmfeSsndo0jRw==", "integrity": "sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA==",
"bin": { "bin": {
"tsc": "bin/tsc", "tsc": "bin/tsc",
"tsserver": "bin/tsserver" "tsserver": "bin/tsserver"
@@ -10658,9 +10534,9 @@
} }
}, },
"node_modules/webpack": { "node_modules/webpack": {
"version": "5.76.3", "version": "5.77.0",
"resolved": "https://registry.npmjs.org/webpack/-/webpack-5.76.3.tgz", "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.77.0.tgz",
"integrity": "sha512-18Qv7uGPU8b2vqGeEEObnfICyw2g39CHlDEK4I7NK13LOur1d0HGmGNKGT58Eluwddpn3oEejwvBPoP4M7/KSA==", "integrity": "sha512-sbGNjBr5Ya5ss91yzjeJTLKyfiwo5C628AFjEa6WSXcZa4E+F57om3Cc8xLb1Jh0b243AWuSYRf3dn7HVeFQ9Q==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"@types/eslint-scope": "^3.7.3", "@types/eslint-scope": "^3.7.3",
@@ -10949,9 +10825,9 @@
"dev": true "dev": true
}, },
"node_modules/yargs": { "node_modules/yargs": {
"version": "17.6.2", "version": "17.7.1",
"resolved": "https://registry.npmjs.org/yargs/-/yargs-17.6.2.tgz", "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.1.tgz",
"integrity": "sha512-1/9UrdHjDZc0eOU0HxOHoS78C69UD3JRMvzlJ7S79S2nTaWRA/whGCTV8o9e/N/1Va9YIV7Q4sOxD8VV4pCWOw==", "integrity": "sha512-cwiTb08Xuv5fqF4AovYacTFNxk62th7LKJ6BL9IGUpTJrWoU7/7WdQGTP2SjKf1dUNBGzDd28p/Yfs/GI6JrLw==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"cliui": "^8.0.1", "cliui": "^8.0.1",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@orionprotocol/sdk", "name": "@orionprotocol/sdk",
"version": "0.17.38", "version": "0.18.0",
"description": "Orion Protocol SDK", "description": "Orion Protocol SDK",
"main": "./lib/esm/index.js", "main": "./lib/esm/index.js",
"module": "./lib/esm/index.js", "module": "./lib/esm/index.js",
@@ -8,6 +8,7 @@
"engines": { "engines": {
"node": ">=18.0.0" "node": ">=18.0.0"
}, },
"type": "module",
"scripts": { "scripts": {
"start": "npm run build && node lib/esm/index.js", "start": "npm run build && node lib/esm/index.js",
"develop": "concurrently -i -k -p \"[{name}]\" -n \"Node,TypeScript\" -c \"yellow.bold,cyan.bold\" \"yarn watch-js\" \"yarn watch-ts\"", "develop": "concurrently -i -k -p \"[{name}]\" -n \"Node,TypeScript\" -c \"yellow.bold,cyan.bold\" \"yarn watch-js\" \"yarn watch-ts\"",
@@ -42,25 +43,26 @@
"url": "https://github.com/orionprotocol/sdk/issues" "url": "https://github.com/orionprotocol/sdk/issues"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.21.3", "@babel/core": "^7.21.4",
"@tsconfig/strictest": "^1.0.2", "@babel/plugin-syntax-import-assertions": "^7.20.0",
"@tsconfig/esm": "^1.0.2",
"@tsconfig/strictest": "^2.0.0",
"@types/express": "^4.17.17", "@types/express": "^4.17.17",
"@types/jest": "^29.5.0", "@types/jest": "^29.5.0",
"@types/node": "^18.15.6", "@types/node": "^18.15.11",
"@types/node-fetch": "^2.6.2",
"@types/socket.io-client": "1.4.33", "@types/socket.io-client": "1.4.33",
"@types/uuid": "^9.0.1", "@types/uuid": "^9.0.1",
"@types/ws": "^8.5.4", "@types/ws": "^8.5.4",
"@typescript-eslint/eslint-plugin": "^5.56.0", "@typescript-eslint/eslint-plugin": "^5.57.0",
"@typescript-eslint/parser": "^5.56.0", "@typescript-eslint/parser": "^5.57.0",
"babel-loader": "^9.1.2", "babel-loader": "^9.1.2",
"concurrently": "^7.6.0", "concurrently": "^8.0.1",
"eslint": "^8.35.0", "eslint": "^8.37.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
"eslint-config-standard": "^17.0.0", "eslint-config-standard": "^17.0.0",
"eslint-config-standard-with-typescript": "^34.0.0", "eslint-config-standard-with-typescript": "^34.0.1",
"eslint-plugin-import": "^2.27.5", "eslint-plugin-import": "^2.27.5",
"eslint-plugin-n": "^15.6.1", "eslint-plugin-n": "^15.7.0",
"eslint-plugin-promise": "^6.1.1", "eslint-plugin-promise": "^6.1.1",
"http-terminator": "^3.2.0", "http-terminator": "^3.2.0",
"husky": "^8.0.3", "husky": "^8.0.3",
@@ -68,15 +70,14 @@
"jest": "^29.5.0", "jest": "^29.5.0",
"ts-jest": "^29.0.5", "ts-jest": "^29.0.5",
"ts-loader": "^9.4.2", "ts-loader": "^9.4.2",
"typescript": "^5.0.2", "typescript": "^5.0.3",
"webpack": "^5.76.3", "webpack": "^5.77.0",
"webpack-cli": "^5.0.1" "webpack-cli": "^5.0.1"
}, },
"dependencies": { "dependencies": {
"@babel/runtime": "^7.21.0", "@babel/runtime": "^7.21.0",
"@ethersproject/abstract-signer": "^5.7.0", "@ethersproject/abstract-signer": "^5.7.0",
"@ethersproject/providers": "^5.7.2", "@ethersproject/providers": "^5.7.2",
"@lukeed/csprng": "^1.0.1",
"@orionprotocol/contracts": "0.6.0", "@orionprotocol/contracts": "0.6.0",
"bignumber.js": "^9.1.1", "bignumber.js": "^9.1.1",
"bson-objectid": "^2.0.4", "bson-objectid": "^2.0.4",
@@ -88,7 +89,7 @@
"just-clone": "^6.2.0", "just-clone": "^6.2.0",
"merge-anything": "^5.1.4", "merge-anything": "^5.1.4",
"neverthrow": "^6.0.0", "neverthrow": "^6.0.0",
"simple-typed-fetch": "^0.1.4", "simple-typed-fetch": "^0.1.5",
"stream-browserify": "^3.0.0", "stream-browserify": "^3.0.0",
"tiny-invariant": "^1.3.1", "tiny-invariant": "^1.3.1",
"ts-is-present": "^1.2.2", "ts-is-present": "^1.2.2",

View File

@@ -1,13 +1,13 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import clone from 'just-clone'; import clone from 'just-clone';
import { ERC20__factory } from '@orionprotocol/contracts'; import { ERC20__factory } from '@orionprotocol/contracts';
import { APPROVE_ERC20_GAS_LIMIT, NATIVE_CURRENCY_PRECISION } from './constants'; import { APPROVE_ERC20_GAS_LIMIT, NATIVE_CURRENCY_PRECISION } from './constants/index.js';
import type { import type {
AggregatedBalanceRequirement, ApproveFix, Asset, BalanceIssue, BalanceRequirement, Source, AggregatedBalanceRequirement, ApproveFix, Asset, BalanceIssue, BalanceRequirement, Source,
} from './types'; } from './types.js';
import { denormalizeNumber } from './utils'; import { denormalizeNumber } from './utils/index.js';
import arrayEquals from './utils/arrayEquals'; import arrayEquals from './utils/arrayEquals.js';
export default class BalanceGuard { export default class BalanceGuard {
private readonly balances: Partial< private readonly balances: Partial<

View File

@@ -1,9 +1,11 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type OrionUnit from '../../OrionUnit'; import type OrionUnit from '../../OrionUnit/index.js';
import type { SupportedChainId } from '../../types'; import type { SupportedChainId } from '../../types.js';
import { isValidChainId } from '../../utils'; import { isValidChainId } from '../../utils/index.js';
import ObjectID from 'bson-objectid';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
import bsonObjectId from 'bson-objectid';
const ObjectID = bsonObjectId.default
const getHistory = async (units: OrionUnit[], address: string, limit = 1000) => { const getHistory = async (units: OrionUnit[], address: string, limit = 1000) => {
if (!ethers.utils.isAddress(address)) throw new Error(`Invalid address: ${address}`); if (!ethers.utils.isAddress(address)) throw new Error(`Invalid address: ${address}`);

View File

@@ -1,22 +1,22 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts'; import { Exchange__factory } from '@orionprotocol/contracts';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources'; import getAvailableSources from '../../utils/getAvailableFundsSources.js';
import { import {
INTERNAL_ORION_PRECISION, INTERNAL_ORION_PRECISION,
NATIVE_CURRENCY_PRECISION, NATIVE_CURRENCY_PRECISION,
LOCKATOMIC_GAS_LIMIT, LOCKATOMIC_GAS_LIMIT,
REDEEMATOMIC_GAS_LIMIT, REDEEMATOMIC_GAS_LIMIT,
WITHDRAW_GAS_LIMIT WITHDRAW_GAS_LIMIT
} from '../../constants'; } from '../../constants/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { denormalizeNumber, generateSecret, normalizeNumber, toUpperCase } from '../../utils'; import { denormalizeNumber, generateSecret, normalizeNumber, toUpperCase } from '../../utils/index.js';
import type { SupportedChainId } from '../../types'; import type { SupportedChainId } from '../../types.js';
import type Orion from '..'; import type Orion from '../index.js';
import type { z } from 'zod'; import type { z } from 'zod';
import type { placeAtomicSwapSchema } from '../../services/OrionAggregator/schemas'; import type { placeAtomicSwapSchema } from '../../services/OrionAggregator/schemas/index.js';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
type Params = { type Params = {

View File

@@ -1,14 +1,14 @@
import type BigNumber from 'bignumber.js'; import type { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
import { merge } from 'merge-anything'; import { merge } from 'merge-anything';
import { chains, envs } from '../config'; import { chains, envs } from '../config/index.js';
import type { networkCodes } from '../constants'; import type { networkCodes } from '../constants/index.js';
import OrionUnit from '../OrionUnit'; import OrionUnit from '../OrionUnit/index.js';
import { ReferralSystem } from '../services/ReferralSystem'; import { ReferralSystem } from '../services/ReferralSystem/index.js';
import type { SupportedChainId, DeepPartial, VerboseOrionUnitConfig, KnownEnv } from '../types'; import type { SupportedChainId, DeepPartial, VerboseOrionUnitConfig, KnownEnv } from '../types.js';
import { isValidChainId } from '../utils'; import { isValidChainId } from '../utils/index.js';
import swap from './bridge/swap'; import swap from './bridge/swap.js';
import getHistory from './bridge/getHistory'; import getHistory from './bridge/getHistory.js';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
type EnvConfig = { type EnvConfig = {

View File

@@ -1,14 +1,14 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts'; import { Exchange__factory } from '@orionprotocol/contracts';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import type OrionUnit from '..'; import type OrionUnit from '../index.js';
import { import {
DEPOSIT_ERC20_GAS_LIMIT, DEPOSIT_ETH_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, DEPOSIT_ERC20_GAS_LIMIT, DEPOSIT_ETH_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION,
} from '../../constants'; } from '../../constants/index.js';
import { denormalizeNumber, normalizeNumber } from '../../utils'; import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
export type DepositParams = { export type DepositParams = {

View File

@@ -1,11 +1,11 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
import { NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants'; import { NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants/index.js';
import type { OrionAggregator } from '../../services/OrionAggregator'; import type { OrionAggregator } from '../../services/OrionAggregator/index.js';
import type { OrionBlockchain } from '../../services/OrionBlockchain'; import type { OrionBlockchain } from '../../services/OrionBlockchain/index.js';
import { calculateFeeInFeeAsset, denormalizeNumber, getNativeCryptocurrency } from '../../utils'; import { calculateFeeInFeeAsset, denormalizeNumber, getNativeCryptocurrency } from '../../utils/index.js';
export type GetSwapInfoParams = { export type GetSwapInfoParams = {
type: 'exactSpend' | 'exactReceive' type: 'exactSpend' | 'exactReceive'

View File

@@ -1,10 +1,10 @@
import type OrionUnit from '..'; import type OrionUnit from '../index.js';
import deposit, { type DepositParams } from './deposit'; import deposit, { type DepositParams } from './deposit.js';
import getSwapInfo, { type GetSwapInfoParams } from './getSwapInfo'; import getSwapInfo, { type GetSwapInfoParams } from './getSwapInfo.js';
import type { SwapLimitParams } from './swapLimit'; import type { SwapLimitParams } from './swapLimit.js';
import swapLimit from './swapLimit'; import swapLimit from './swapLimit.js';
import swapMarket, { type SwapMarketParams } from './swapMarket'; import swapMarket, { type SwapMarketParams } from './swapMarket.js';
import withdraw, { type WithdrawParams } from './withdraw'; import withdraw, { type WithdrawParams } from './withdraw.js';
type PureSwapMarketParams = Omit<SwapMarketParams, 'orionUnit'> type PureSwapMarketParams = Omit<SwapMarketParams, 'orionUnit'>
type PureSwapLimitParams = Omit<SwapLimitParams, 'orionUnit'> type PureSwapLimitParams = Omit<SwapLimitParams, 'orionUnit'>

View File

@@ -1,15 +1,15 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts'; import { Exchange__factory } from '@orionprotocol/contracts';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources'; import getAvailableSources from '../../utils/getAvailableFundsSources.js';
import type OrionUnit from '..'; import type OrionUnit from '../index.js';
import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants'; import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils'; import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import { signOrder } from '../../crypt'; import { signOrder } from '../../crypt/index.js';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema'; import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema.js';
import type { z } from 'zod'; import type { z } from 'zod';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';

View File

@@ -1,16 +1,16 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts'; import { Exchange__factory } from '@orionprotocol/contracts';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import getAvailableSources from '../../utils/getAvailableFundsSources'; import getAvailableSources from '../../utils/getAvailableFundsSources.js';
import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants'; import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, SWAP_THROUGH_ORION_POOL_GAS_LIMIT } from '../../constants/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils'; import { calculateFeeInFeeAsset, denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import { signOrder } from '../../crypt'; import { signOrder } from '../../crypt/index.js';
import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema'; import type orderSchema from '../../services/OrionAggregator/schemas/orderSchema.js';
import type { z } from 'zod'; import type { z } from 'zod';
import type { SwapLimitParams } from './swapLimit'; import type { SwapLimitParams } from './swapLimit.js';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
export type SwapMarketParams = Omit<SwapLimitParams, 'price'> & { export type SwapMarketParams = Omit<SwapLimitParams, 'price'> & {

View File

@@ -1,14 +1,14 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { Exchange__factory } from '@orionprotocol/contracts'; import { Exchange__factory } from '@orionprotocol/contracts';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import type OrionUnit from '..'; import type OrionUnit from '../index.js';
import { import {
INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, WITHDRAW_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION, WITHDRAW_GAS_LIMIT,
} from '../../constants'; } from '../../constants/index.js';
import { denormalizeNumber, normalizeNumber } from '../../utils'; import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
export type WithdrawParams = { export type WithdrawParams = {

View File

@@ -1,13 +1,13 @@
import { Exchange__factory, IUniswapV2Pair__factory, IUniswapV2Router__factory } from '@orionprotocol/contracts'; import { Exchange__factory, IUniswapV2Pair__factory, IUniswapV2Router__factory } from '@orionprotocol/contracts';
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { simpleFetch } from 'simple-typed-fetch'; import { simpleFetch } from 'simple-typed-fetch';
import type OrionUnit from '..'; import type OrionUnit from '../index.js';
import BalanceGuard from '../../BalanceGuard'; import BalanceGuard from '../../BalanceGuard.js';
import { ADD_LIQUIDITY_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../../constants'; import { ADD_LIQUIDITY_GAS_LIMIT, INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../../constants/index.js';
import { denormalizeNumber, normalizeNumber } from '../../utils'; import { denormalizeNumber, normalizeNumber } from '../../utils/index.js';
import getBalances from '../../utils/getBalances'; import getBalances from '../../utils/getBalances.js';
import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency'; import getNativeCryptocurrency from '../../utils/getNativeCryptocurrency.js';
const ADD_LIQUIDITY_SLIPPAGE = 0.05; const ADD_LIQUIDITY_SLIPPAGE = 0.05;

View File

@@ -1,12 +1,12 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { OrionAggregator } from '../services/OrionAggregator'; import { OrionAggregator } from '../services/OrionAggregator/index.js';
import { OrionBlockchain } from '../services/OrionBlockchain'; import { OrionBlockchain } from '../services/OrionBlockchain/index.js';
import { PriceFeed } from '../services/PriceFeed'; import { PriceFeed } from '../services/PriceFeed/index.js';
import type { KnownEnv, SupportedChainId, VerboseOrionUnitConfig } from '../types'; import type { KnownEnv, SupportedChainId, VerboseOrionUnitConfig } from '../types.js';
import Exchange from './Exchange'; import Exchange from './Exchange/index.js';
import FarmingManager from './FarmingManager'; import FarmingManager from './FarmingManager/index.js';
import { chains, envs } from '../config'; import { chains, envs } from '../config/index.js';
import type { networkCodes } from '../constants'; import type { networkCodes } from '../constants/index.js';
type KnownConfig = { type KnownConfig = {
env: KnownEnv env: KnownEnv

View File

@@ -1,10 +1,10 @@
import Orion from '../Orion'; import Orion from '../Orion/index.js';
import { ReferralSystem } from '../services/ReferralSystem'; import { ReferralSystem } from '../services/ReferralSystem/index.js';
import { SupportedChainId } from '../types'; import { SupportedChainId } from '../types.js';
import express from 'express'; import express from 'express';
import WebSocket from 'ws'; import WebSocket from 'ws';
import http from 'http'; import http from 'http';
import httpToWS from '../utils/httpToWS'; import httpToWS from '../utils/httpToWS.js';
import { import {
createHttpTerminator, createHttpTerminator,
} from 'http-terminator'; } from 'http-terminator';

View File

@@ -1,6 +1,6 @@
import { Wallet } from 'ethers'; import { Wallet } from 'ethers';
import Orion from '../Orion'; import Orion from '../Orion/index.js';
import { SupportedChainId } from '../types'; import { SupportedChainId } from '../types.js';
const privateKey = process.env['PRIVATE_KEY'] const privateKey = process.env['PRIVATE_KEY']
if (privateKey === undefined) throw new Error('Private key is required'); if (privateKey === undefined) throw new Error('Private key is required');

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import Orion from '../Orion'; import Orion from '../Orion/index.js';
const privateKey = process.env['PRIVATE_KEY']; const privateKey = process.env['PRIVATE_KEY'];
if (privateKey === undefined) throw new Error('Private key is required'); if (privateKey === undefined) throw new Error('Private key is required');

View File

@@ -1,4 +1,4 @@
import Orion from '../Orion'; import Orion from '../Orion/index.js';
describe('Orion Aggregator', () => { describe('Orion Aggregator', () => {
test('Handle error aus', async () => { test('Handle error aus', async () => {

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import Orion from '../Orion'; import Orion from '../Orion/index.js';
const privateKey = process.env['PRIVATE_KEY'] const privateKey = process.env['PRIVATE_KEY']
if (privateKey === undefined) throw new Error('Private key is required'); if (privateKey === undefined) throw new Error('Private key is required');

View File

@@ -1,4 +1,4 @@
import Orion from '../Orion'; import Orion from '../Orion/index.js';
describe('Price Feed', () => { describe('Price Feed', () => {
test('Ticker', async () => { test('Ticker', async () => {

View File

@@ -1,6 +1,6 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import Orion from '../Orion'; import Orion from '../Orion/index.js';
import swapMarket from '../OrionUnit/Exchange/swapMarket'; import swapMarket from '../OrionUnit/Exchange/swapMarket.js';
const privateKey = process.env['PRIVATE_KEY'] const privateKey = process.env['PRIVATE_KEY']
if (privateKey === undefined) throw new Error('Private key is required'); if (privateKey === undefined) throw new Error('Private key is required');

View File

@@ -1,6 +1,6 @@
import jsonChains from './chains.json'; import jsonChains from './chains.json' assert { type: 'json' };
import jsonEnvs from './envs.json'; import jsonEnvs from './envs.json' assert { type: 'json' };
import { pureEnvSchema, pureChainInfoSchema } from './schemas'; import { pureEnvSchema, pureChainInfoSchema } from './schemas/index.js';
const chains = pureChainInfoSchema.parse(jsonChains); const chains = pureChainInfoSchema.parse(jsonChains);
const envs = pureEnvSchema.parse(jsonEnvs); const envs = pureEnvSchema.parse(jsonEnvs);
@@ -10,4 +10,4 @@ export {
envs, envs,
}; };
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';

View File

@@ -1,3 +1,3 @@
export { default as eip712DomainSchema } from './eip712DomainSchema'; export { default as eip712DomainSchema } from './eip712DomainSchema.js';
export * from './pureEnvSchema'; export * from './pureEnvSchema.js';
export * from './pureChainSchema'; export * from './pureChainSchema.js';

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import { networkCodes } from '../../constants'; import { networkCodes } from '../../constants/index.js';
import { SupportedChainId } from '../../types'; import { SupportedChainId } from '../../types.js';
export const pureChainInfoPayloadSchema = z.object({ export const pureChainInfoPayloadSchema = z.object({
chainId: z.nativeEnum(SupportedChainId), chainId: z.nativeEnum(SupportedChainId),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { SupportedChainId } from '../../types'; import { SupportedChainId } from '../../types.js';
export const pureEnvNetworksSchema = z.object({ export const pureEnvNetworksSchema = z.object({
api: z.string(), api: z.string(),

View File

@@ -1,4 +1,4 @@
import { SupportedChainId } from '../types'; import { SupportedChainId } from '../types.js';
export const developmentChains = [ export const developmentChains = [
SupportedChainId.BSC_TESTNET, SupportedChainId.BSC_TESTNET,

View File

@@ -1,4 +1,4 @@
import type exchanges from './exchanges'; import type exchanges from './exchanges.js';
const mapping: Record< const mapping: Record<
typeof exchanges[number], typeof exchanges[number],

View File

@@ -1,11 +1,11 @@
export { default as cancelOrderTypes } from './cancelOrderTypes'; export { default as cancelOrderTypes } from './cancelOrderTypes.js';
export { default as orderStatuses } from './orderStatuses'; export { default as orderStatuses } from './orderStatuses.js';
export { default as orderTypes } from './orderTypes'; export { default as orderTypes } from './orderTypes.js';
export { default as subOrderStatuses } from './subOrderStatuses'; export { default as subOrderStatuses } from './subOrderStatuses.js';
export { default as networkCodes } from './networkCodes'; export { default as networkCodes } from './networkCodes.js';
export { default as exchanges } from './exchanges'; export { default as exchanges } from './exchanges.js';
export { default as exchangesMap } from './exchangesMap'; export { default as exchangesMap } from './exchangesMap.js';
export * from './chains'; export * from './chains.js';
export * from './precisions'; export * from './precisions.js';
export * from './gasLimits'; export * from './gasLimits.js';

View File

@@ -1,4 +1,4 @@
import subOrderStatuses from './subOrderStatuses'; import subOrderStatuses from './subOrderStatuses.js';
// https://github.com/orionprotocol/orion-aggregator/blob/develop/src/main/java/io/orionprotocol/aggregator/model/order/status/OrderStatus.java // https://github.com/orionprotocol/orion-aggregator/blob/develop/src/main/java/io/orionprotocol/aggregator/model/order/status/OrderStatus.java
const orderStatuses = [ const orderStatuses = [

View File

@@ -1,6 +1,6 @@
import type { SupportedChainId } from '../types'; import type { SupportedChainId } from '../types.js';
import eip712DomainData from '../config/eip712DomainData.json'; import eip712DomainData from '../config/eip712DomainData.json' assert { type: 'json' };
import eip712DomainSchema from '../config/schemas/eip712DomainSchema'; import eip712DomainSchema from '../config/schemas/eip712DomainSchema.js';
const EIP712Domain = eip712DomainSchema.parse(eip712DomainData); const EIP712Domain = eip712DomainSchema.parse(eip712DomainData);

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type { CFDOrder } from '../types'; import type { CFDOrder } from '../types.js';
const hashCFDOrder = (order: CFDOrder) => ethers.utils.solidityKeccak256( const hashCFDOrder = (order: CFDOrder) => ethers.utils.solidityKeccak256(
[ [

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type { Order } from '../types'; import type { Order } from '../types.js';
const hashOrder = (order: Order) => ethers.utils.solidityKeccak256( const hashOrder = (order: Order) => ethers.utils.solidityKeccak256(
[ [

View File

@@ -1,5 +1,5 @@
export { default as signCancelOrder } from './signCancelOrder'; export { default as signCancelOrder } from './signCancelOrder.js';
export { default as signCancelOrderPersonal } from './signCancelOrderPersonal'; export { default as signCancelOrderPersonal } from './signCancelOrderPersonal.js';
export { default as signOrder } from './signOrder'; export { default as signOrder } from './signOrder.js';
export { default as signCFDOrder } from './signCFDOrder'; export { default as signCFDOrder } from './signCFDOrder.js';
export { default as signOrderPersonal } from './signOrderPersonal'; export { default as signOrderPersonal } from './signOrderPersonal.js';

View File

@@ -1,14 +1,14 @@
import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import type { TypedDataSigner } from '@ethersproject/abstract-signer';
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
import { joinSignature, splitSignature } from 'ethers/lib/utils'; import { joinSignature, splitSignature } from 'ethers/lib/utils.js';
import { INTERNAL_ORION_PRECISION } from '../constants'; import { INTERNAL_ORION_PRECISION } from '../constants/index.js';
import type { CFDOrder, SignedCFDOrder, SupportedChainId } from '../types'; import type { CFDOrder, SignedCFDOrder, SupportedChainId } from '../types.js';
import normalizeNumber from '../utils/normalizeNumber'; import normalizeNumber from '../utils/normalizeNumber.js';
import getDomainData from './getDomainData'; import getDomainData from './getDomainData.js';
import signCFDOrderPersonal from './signCFDOrderPersonal'; import signCFDOrderPersonal from './signCFDOrderPersonal.js';
import hashCFDOrder from './hashCFDOrder'; import hashCFDOrder from './hashCFDOrder.js';
import CFD_ORDER_TYPES from '../constants/cfdOrderTypes'; import CFD_ORDER_TYPES from '../constants/cfdOrderTypes.js';
const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type { CFDOrder } from '../types'; import type { CFDOrder } from '../types.js';
const { arrayify, joinSignature, splitSignature } = ethers.utils; const { arrayify, joinSignature, splitSignature } = ethers.utils;

View File

@@ -1,10 +1,10 @@
import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import type { TypedDataSigner } from '@ethersproject/abstract-signer';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
import { joinSignature, splitSignature } from 'ethers/lib/utils'; import { joinSignature, splitSignature } from 'ethers/lib/utils.js';
import CANCEL_ORDER_TYPES from '../constants/cancelOrderTypes'; import CANCEL_ORDER_TYPES from '../constants/cancelOrderTypes.js';
import type { CancelOrderRequest, SignedCancelOrderRequest, SupportedChainId } from '../types'; import type { CancelOrderRequest, SignedCancelOrderRequest, SupportedChainId } from '../types.js';
import getDomainData from './getDomainData'; import getDomainData from './getDomainData.js';
import signCancelOrderPersonal from './signCancelOrderPersonal'; import signCancelOrderPersonal from './signCancelOrderPersonal.js';
type SignerWithTypedDataSign = ethers.Signer & TypedDataSigner; type SignerWithTypedDataSign = ethers.Signer & TypedDataSigner;

View File

@@ -1,6 +1,6 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { arrayify, joinSignature, splitSignature } from 'ethers/lib/utils'; import { arrayify, joinSignature, splitSignature } from 'ethers/lib/utils.js';
import type { CancelOrderRequest } from '../types'; import type { CancelOrderRequest } from '../types.js';
const signCancelOrderPersonal = async ( const signCancelOrderPersonal = async (
cancelOrderRequest: CancelOrderRequest, cancelOrderRequest: CancelOrderRequest,

View File

@@ -1,14 +1,14 @@
import type { TypedDataSigner } from '@ethersproject/abstract-signer'; import type { TypedDataSigner } from '@ethersproject/abstract-signer';
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
import { joinSignature, splitSignature } from 'ethers/lib/utils'; import { joinSignature, splitSignature } from 'ethers/lib/utils.js';
import { INTERNAL_ORION_PRECISION } from '../constants'; import { INTERNAL_ORION_PRECISION } from '../constants/index.js';
import ORDER_TYPES from '../constants/orderTypes'; import ORDER_TYPES from '../constants/orderTypes.js';
import type { Order, SignedOrder, SupportedChainId } from '../types'; import type { Order, SignedOrder, SupportedChainId } from '../types.js';
import normalizeNumber from '../utils/normalizeNumber'; import normalizeNumber from '../utils/normalizeNumber.js';
import getDomainData from './getDomainData'; import getDomainData from './getDomainData.js';
import hashOrder from './hashOrder'; import hashOrder from './hashOrder.js';
import signOrderPersonal from './signOrderPersonal'; import signOrderPersonal from './signOrderPersonal.js';
const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days const DEFAULT_EXPIRATION = 29 * 24 * 60 * 60 * 1000; // 29 days

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type { Order } from '../types'; import type { Order } from '../types.js';
const { arrayify, joinSignature, splitSignature } = ethers.utils; const { arrayify, joinSignature, splitSignature } = ethers.utils;

View File

@@ -1,14 +1,14 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { simpleFetch, fetchWithValidation } from 'simple-typed-fetch'; import { simpleFetch, fetchWithValidation } from 'simple-typed-fetch';
BigNumber.config({ EXPONENTIAL_AT: 1e+9 }); BigNumber.config({ EXPONENTIAL_AT: 1e+9 });
export * as config from './config'; export * as config from './config/index.js';
export { default as OrionUnit } from './OrionUnit'; export { default as OrionUnit } from './initOrionUnit.js';
export { default as Orion } from './Orion'; export { default as Orion } from './Orion/index.js';
export { default as initOrionUnit } from './initOrionUnit'; export { default as initOrionUnit } from './initOrionUnit.js';
export * as utils from './utils'; export * as utils from './utils/index.js';
export * as services from './services'; export * as services from './services/index.js';
export * as crypt from './crypt'; export * as crypt from './crypt/index.js';
export * from './constants'; export * from './constants/index.js';
export * from './types'; export * from './types.js';
export { simpleFetch, fetchWithValidation }; export { simpleFetch, fetchWithValidation };

View File

@@ -1,4 +1,4 @@
import OrionUnit from './OrionUnit'; import OrionUnit from './OrionUnit/index.js';
// backward compatibility // backward compatibility
export default function initOrionUnit(...params: ConstructorParameters<typeof OrionUnit>) { export default function initOrionUnit(...params: ConstructorParameters<typeof OrionUnit>) {

View File

@@ -1,24 +1,24 @@
import type BigNumber from 'bignumber.js'; import type { BigNumber } from 'bignumber.js';
import { z } from 'zod'; import { z } from 'zod';
import swapInfoSchema from './schemas/swapInfoSchema'; import swapInfoSchema from './schemas/swapInfoSchema.js';
import exchangeInfoSchema from './schemas/exchangeInfoSchema'; import exchangeInfoSchema from './schemas/exchangeInfoSchema.js';
import cancelOrderSchema from './schemas/cancelOrderSchema'; import cancelOrderSchema from './schemas/cancelOrderSchema.js';
import orderBenefitsSchema from './schemas/orderBenefitsSchema'; import orderBenefitsSchema from './schemas/orderBenefitsSchema.js';
import errorSchema from './schemas/errorSchema'; import errorSchema from './schemas/errorSchema.js';
import placeAtomicSwapSchema from './schemas/placeAtomicSwapSchema'; import placeAtomicSwapSchema from './schemas/placeAtomicSwapSchema.js';
import { OrionAggregatorWS } from './ws'; import { OrionAggregatorWS } from './ws/index.js';
import { atomicSwapHistorySchema } from './schemas/atomicSwapHistorySchema'; import { atomicSwapHistorySchema } from './schemas/atomicSwapHistorySchema.js';
import type { Exchange, SignedCancelOrderRequest, SignedCFDOrder, SignedOrder } from '../../types'; import type { Exchange, SignedCancelOrderRequest, SignedCFDOrder, SignedOrder } from '../../types.js';
import { pairConfigSchema } from './schemas'; import { pairConfigSchema } from './schemas/index.js';
import { import {
aggregatedOrderbookSchema, exchangeOrderbookSchema, poolReservesSchema, aggregatedOrderbookSchema, exchangeOrderbookSchema, poolReservesSchema,
} from './schemas/aggregatedOrderbookSchema'; } from './schemas/aggregatedOrderbookSchema.js';
import type networkCodes from '../../constants/networkCodes'; import type networkCodes from '../../constants/networkCodes.js';
import toUpperCase from '../../utils/toUpperCase'; import toUpperCase from '../../utils/toUpperCase.js';
import httpToWS from '../../utils/httpToWS'; import httpToWS from '../../utils/httpToWS.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import orderSchema from './schemas/orderSchema'; import orderSchema from './schemas/orderSchema.js';
import { exchanges } from '../../constants'; import { exchanges } from '../../constants/index.js';
import { fetchWithValidation } from 'simple-typed-fetch'; import { fetchWithValidation } from 'simple-typed-fetch';
class OrionAggregator { class OrionAggregator {
@@ -362,6 +362,6 @@ class OrionAggregator {
return fetchWithValidation(url.toString(), atomicSwapHistorySchema); return fetchWithValidation(url.toString(), atomicSwapHistorySchema);
}; };
} }
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export * as ws from './ws'; export * as ws from './ws/index.js';
export { OrionAggregator }; export { OrionAggregator };

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { exchanges } from '../../../constants'; import { exchanges } from '../../../constants/index.js';
const orderbookElementSchema = z.object({ const orderbookElementSchema = z.object({
price: z.number(), price: z.number(),

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import uppercasedNetworkCodes from '../../../constants/uppercasedNetworkCodes'; import uppercasedNetworkCodes from '../../../constants/uppercasedNetworkCodes.js';
import redeemOrderSchema from './redeemOrderSchema'; import redeemOrderSchema from './redeemOrderSchema.js';
export const atomicSwapHistorySchema = z.array(z.object({ export const atomicSwapHistorySchema = z.array(z.object({
id: z.string(), id: z.string(),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import pairConfigSchema from './pairConfigSchema'; import pairConfigSchema from './pairConfigSchema.js';
const exchangeInfoSchema = z.array(pairConfigSchema); const exchangeInfoSchema = z.array(pairConfigSchema);

View File

@@ -1,9 +1,9 @@
export { default as atomicSwapHistorySchema } from './atomicSwapHistorySchema'; export { default as atomicSwapHistorySchema } from './atomicSwapHistorySchema.js';
export { default as cancelOrderSchema } from './cancelOrderSchema'; export { default as cancelOrderSchema } from './cancelOrderSchema.js';
export { default as exchangeInfoSchema } from './exchangeInfoSchema'; export { default as exchangeInfoSchema } from './exchangeInfoSchema.js';
export { default as orderBenefitsSchema } from './orderBenefitsSchema'; export { default as orderBenefitsSchema } from './orderBenefitsSchema.js';
export { default as pairConfigSchema } from './pairConfigSchema'; export { default as pairConfigSchema } from './pairConfigSchema.js';
export { default as placeAtomicSwapSchema } from './placeAtomicSwapSchema'; export { default as placeAtomicSwapSchema } from './placeAtomicSwapSchema.js';
export { default as redeemOrderSchema } from './redeemOrderSchema'; export { default as redeemOrderSchema } from './redeemOrderSchema.js';
export { default as swapInfoSchema } from './swapInfoSchema'; export { default as swapInfoSchema } from './swapInfoSchema.js';
export { default as errorSchema } from './errorSchema'; export { default as errorSchema } from './errorSchema.js';

View File

@@ -1,6 +1,6 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { z } from 'zod'; import { z } from 'zod';
import { exchanges, orderStatuses, subOrderStatuses } from '../../../constants'; import { exchanges, orderStatuses, subOrderStatuses } from '../../../constants/index.js';
const blockchainOrderSchema = z.object({ const blockchainOrderSchema = z.object({
id: z.string().refine(ethers.utils.isHexString, (value) => ({ id: z.string().refine(ethers.utils.isHexString, (value) => ({

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { exchanges } from '../../../constants'; import { exchanges } from '../../../constants/index.js';
const orderInfoSchema = z.object({ const orderInfoSchema = z.object({
assetPair: z.string(), assetPair: z.string(),

View File

@@ -1,24 +1,24 @@
import { z } from 'zod'; import { z } from 'zod';
import WebSocket from 'isomorphic-ws'; import WebSocket from 'isomorphic-ws';
import { validate as uuidValidate, v4 as uuidv4 } from 'uuid'; import { validate as uuidValidate, v4 as uuidv4 } from 'uuid';
import MessageType from './MessageType'; import MessageType from './MessageType.js';
import SubscriptionType from './SubscriptionType'; import SubscriptionType from './SubscriptionType.js';
import { import {
pingPongMessageSchema, initMessageSchema, pingPongMessageSchema, initMessageSchema,
errorSchema, brokerMessageSchema, orderBookSchema, errorSchema, brokerMessageSchema, orderBookSchema,
assetPairsConfigSchema, addressUpdateSchema, swapInfoSchema, assetPairsConfigSchema, addressUpdateSchema, swapInfoSchema,
} from './schemas'; } from './schemas/index.js';
import UnsubscriptionType from './UnsubscriptionType'; import UnsubscriptionType from './UnsubscriptionType.js';
import type { import type {
SwapInfoBase, AssetPairUpdate, OrderbookItem, SwapInfoBase, AssetPairUpdate, OrderbookItem,
Balance, Exchange, CFDBalance, FuturesTradeInfo, SwapInfo, Json, Balance, Exchange, CFDBalance, FuturesTradeInfo, SwapInfo, Json,
} from '../../../types'; } from '../../../types.js';
import unsubscriptionDoneSchema from './schemas/unsubscriptionDoneSchema'; import unsubscriptionDoneSchema from './schemas/unsubscriptionDoneSchema.js';
import assetPairConfigSchema from './schemas/assetPairConfigSchema'; import assetPairConfigSchema from './schemas/assetPairConfigSchema.js';
import type { fullOrderSchema, orderUpdateSchema } from './schemas/addressUpdateSchema'; import type { fullOrderSchema, orderUpdateSchema } from './schemas/addressUpdateSchema.js';
import cfdAddressUpdateSchema from './schemas/cfdAddressUpdateSchema'; import cfdAddressUpdateSchema from './schemas/cfdAddressUpdateSchema.js';
import futuresTradeInfoSchema from './schemas/futuresTradeInfoSchema'; import futuresTradeInfoSchema from './schemas/futuresTradeInfoSchema.js';
import { objectKeys } from '../../../utils/objectKeys'; import { objectKeys } from '../../../utils/objectKeys.js';
// import errorSchema from './schemas/errorSchema'; // import errorSchema from './schemas/errorSchema';
const UNSUBSCRIBE = 'u'; const UNSUBSCRIBE = 'u';
@@ -639,7 +639,7 @@ class OrionAggregatorWS {
} }
} }
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export { export {
OrionAggregatorWS, OrionAggregatorWS,
SubscriptionType, SubscriptionType,

View File

@@ -1,11 +1,11 @@
import { z } from 'zod'; import { z } from 'zod';
import { exchanges } from '../../../../constants'; import { exchanges } from '../../../../constants/index.js';
import orderStatuses from '../../../../constants/orderStatuses'; import orderStatuses from '../../../../constants/orderStatuses.js';
import subOrderStatuses from '../../../../constants/subOrderStatuses'; import subOrderStatuses from '../../../../constants/subOrderStatuses.js';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import balancesSchema from './balancesSchema'; import balancesSchema from './balancesSchema.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
import executionTypes from '../../../../constants/cfdExecutionTypes'; import executionTypes from '../../../../constants/cfdExecutionTypes.js';
const baseAddressUpdate = baseMessageSchema.extend({ const baseAddressUpdate = baseMessageSchema.extend({
id: z.string(), id: z.string(),

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const assetPairConfigSchema = baseMessageSchema.extend({ const assetPairConfigSchema = baseMessageSchema.extend({
id: z.string(), id: z.string(),

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const assetPairsConfigSchema = baseMessageSchema.extend({ const assetPairsConfigSchema = baseMessageSchema.extend({
id: z.string(), id: z.string(),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { makePartial } from '../../../../utils'; import { makePartial } from '../../../../utils/index.js';
const balancesSchema = z.record( // changed balances in format const balancesSchema = z.record( // changed balances in format
z.string(), // asset z.string(), // asset

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
const baseMessageSchema = z.object({ const baseMessageSchema = z.object({
T: z.nativeEnum(MessageType), T: z.nativeEnum(MessageType),

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const brokerMessageSchema = baseMessageSchema.extend({ const brokerMessageSchema = baseMessageSchema.extend({
T: z.literal(MessageType.BROKER_TRADABLE_ATOMIC_SWAP_ASSETS_BALANCE_UPDATE), T: z.literal(MessageType.BROKER_TRADABLE_ATOMIC_SWAP_ASSETS_BALANCE_UPDATE),

View File

@@ -1,8 +1,8 @@
import { z } from 'zod'; import { z } from 'zod';
import { fullOrderSchema, orderUpdateSchema } from './addressUpdateSchema'; import { fullOrderSchema, orderUpdateSchema } from './addressUpdateSchema.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import cfdBalancesSchema from './cfdBalancesSchema'; import cfdBalancesSchema from './cfdBalancesSchema.js';
const baseCfdAddressUpdate = baseMessageSchema.extend({ const baseCfdAddressUpdate = baseMessageSchema.extend({
id: z.string(), id: z.string(),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import positionStatuses from '../../../../constants/positionStatuses'; import positionStatuses from '../../../../constants/positionStatuses.js';
const cfdBalanceSchema = z const cfdBalanceSchema = z
.object({ .object({

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const errorSchema = baseMessageSchema.extend({ const errorSchema = baseMessageSchema.extend({
T: z.literal(MessageType.ERROR), T: z.literal(MessageType.ERROR),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
const futuresTradeInfoSchema = z.object({ const futuresTradeInfoSchema = z.object({
T: z.literal(MessageType.FUTURES_TRADE_INFO_UPDATE), T: z.literal(MessageType.FUTURES_TRADE_INFO_UPDATE),

View File

@@ -1,12 +1,12 @@
export { default as addressUpdateSchema } from './addressUpdateSchema'; export { default as addressUpdateSchema } from './addressUpdateSchema.js';
export { default as assetPairsConfigSchema } from './assetPairsConfigSchema'; export { default as assetPairsConfigSchema } from './assetPairsConfigSchema.js';
export { default as baseMessageSchema } from './baseMessageSchema'; export { default as baseMessageSchema } from './baseMessageSchema.js';
export { default as brokerMessageSchema } from './brokerMessageSchema'; export { default as brokerMessageSchema } from './brokerMessageSchema.js';
export { default as errorSchema } from './errorSchema'; export { default as errorSchema } from './errorSchema.js';
export { default as initMessageSchema } from './initMessageSchema'; export { default as initMessageSchema } from './initMessageSchema.js';
export { default as pingPongMessageSchema } from './pingPongMessageSchema'; export { default as pingPongMessageSchema } from './pingPongMessageSchema.js';
export { default as swapInfoSchema } from './swapInfoSchema'; export { default as swapInfoSchema } from './swapInfoSchema.js';
export { default as balancesSchema } from './balancesSchema'; export { default as balancesSchema } from './balancesSchema.js';
export { default as cfdBalancesSchema } from './cfdBalancesSchema'; export { default as cfdBalancesSchema } from './cfdBalancesSchema.js';
export * from './orderBookSchema'; export * from './orderBookSchema.js';

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const initMessageSchema = baseMessageSchema.extend({ const initMessageSchema = baseMessageSchema.extend({
T: z.literal(MessageType.INITIALIZATION), T: z.literal(MessageType.INITIALIZATION),

View File

@@ -1,7 +1,7 @@
import { z } from 'zod'; import { z } from 'zod';
import exchanges from '../../../../constants/exchanges'; import exchanges from '../../../../constants/exchanges.js';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
export const orderBookItemSchema = z.tuple([ export const orderBookItemSchema = z.tuple([
z.string(), // price z.string(), // price

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const pingPongMessageSchema = baseMessageSchema.extend({ const pingPongMessageSchema = baseMessageSchema.extend({
T: z.literal(MessageType.PING_PONG), T: z.literal(MessageType.PING_PONG),

View File

@@ -1,7 +1,7 @@
import { z } from 'zod'; import { z } from 'zod';
import exchanges from '../../../../constants/exchanges'; import exchanges from '../../../../constants/exchanges.js';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const alternativeSchema = z.object({ // execution alternatives const alternativeSchema = z.object({ // execution alternatives
e: z.enum(exchanges).array(), // exchanges e: z.enum(exchanges).array(), // exchanges

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import MessageType from '../MessageType'; import MessageType from '../MessageType.js';
import baseMessageSchema from './baseMessageSchema'; import baseMessageSchema from './baseMessageSchema.js';
const unsubscriptionDoneSchema = baseMessageSchema.extend({ const unsubscriptionDoneSchema = baseMessageSchema.extend({
id: z.string(), id: z.string(),

View File

@@ -12,11 +12,11 @@ import {
cfdContractsSchema, cfdContractsSchema,
cfdHistorySchema, cfdHistorySchema,
governanceContractsSchema, governanceContractsSchema,
} from './schemas'; } from './schemas/index.js';
import type redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema'; import type redeemOrderSchema from '../OrionAggregator/schemas/redeemOrderSchema.js';
import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema'; import { sourceAtomicHistorySchema, targetAtomicHistorySchema } from './schemas/atomicHistorySchema.js';
import { makePartial } from '../../utils'; import { makePartial } from '../../utils/index.js';
import type { networkCodes } from '../../constants'; import type { networkCodes } from '../../constants/index.js';
import { fetchWithValidation } from 'simple-typed-fetch'; import { fetchWithValidation } from 'simple-typed-fetch';
type IAdminAuthHeaders = { type IAdminAuthHeaders = {
@@ -431,5 +431,5 @@ class OrionBlockchain {
); );
} }
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export { OrionBlockchain }; export { OrionBlockchain };

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { poolOnVerificationSchema } from './adminPoolSchema'; import { poolOnVerificationSchema } from './adminPoolSchema.js';
export default z.array(poolOnVerificationSchema); export default z.array(poolOnVerificationSchema);

View File

@@ -1,6 +1,6 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { z } from 'zod'; import { z } from 'zod';
import getValidArrayItemsSchema from '../../../utils/getValidArrayItems'; import getValidArrayItemsSchema from '../../../utils/getValidArrayItems.js';
const baseAtomicHistorySchema = z.object({ const baseAtomicHistorySchema = z.object({
success: z.boolean(), success: z.boolean(),

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { HistoryTransactionStatus } from '../../../types'; import { HistoryTransactionStatus } from '../../../types.js';
export enum historyTransactionType { export enum historyTransactionType {
WITHDRAW = 'withdrawal', WITHDRAW = 'withdrawal',

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { HistoryTransactionStatus } from '../../../types'; import { HistoryTransactionStatus } from '../../../types.js';
const historySchema = z.array(z.object( const historySchema = z.array(z.object(
{ {

View File

@@ -1,17 +1,17 @@
export * from './adminPoolSchema'; export * from './adminPoolSchema.js';
export { default as adminPoolsListSchema } from './adminPoolsListSchema'; export { default as adminPoolsListSchema } from './adminPoolsListSchema.js';
export { default as addPoolSchema } from './addPoolSchema'; export { default as addPoolSchema } from './addPoolSchema.js';
export { default as atomicHistorySchema } from './atomicHistorySchema'; export { default as atomicHistorySchema } from './atomicHistorySchema.js';
export { default as checkRedeemOrderSchema } from './checkRedeemOrderSchema'; export { default as checkRedeemOrderSchema } from './checkRedeemOrderSchema.js';
export { default as historySchema } from './historySchema'; export { default as historySchema } from './historySchema.js';
export { default as IDOSchema } from './IDOSchema'; export { default as IDOSchema } from './IDOSchema.js';
export { default as infoSchema } from './infoSchema'; export { default as infoSchema } from './infoSchema.js';
export { default as poolsConfigSchema } from './poolsConfigSchema'; export { default as poolsConfigSchema } from './poolsConfigSchema.js';
export { default as poolsInfoSchema } from './poolsInfoSchema'; export { default as poolsInfoSchema } from './poolsInfoSchema.js';
export { default as atomicSummarySchema } from './atomicSummarySchema'; export { default as atomicSummarySchema } from './atomicSummarySchema.js';
export { default as poolsLpAndStakedSchema } from './poolsLpAndStakedSchema'; export { default as poolsLpAndStakedSchema } from './poolsLpAndStakedSchema.js';
export { default as userVotesSchema } from './userVotesSchema'; export { default as userVotesSchema } from './userVotesSchema.js';
export { default as userEarnedSchema } from './userEarnedSchema'; export { default as userEarnedSchema } from './userEarnedSchema.js';
export { default as cfdContractsSchema } from './cfdContractsSchema'; export { default as cfdContractsSchema } from './cfdContractsSchema.js';
export { default as cfdHistorySchema } from './cfdHistorySchema'; export { default as cfdHistorySchema } from './cfdHistorySchema.js';
export { default as governanceContractsSchema } from './governanceContractsSchema'; export { default as governanceContractsSchema } from './governanceContractsSchema.js';

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { makePartial } from '../../../utils'; import { makePartial } from '../../../utils/index.js';
const internalFeeAssetSchema = z.object({ const internalFeeAssetSchema = z.object({
type: z.enum(['percent', 'plain']), type: z.enum(['percent', 'plain']),

View File

@@ -1,6 +1,6 @@
import { z } from 'zod'; import { z } from 'zod';
import addressSchema from '../../../addressSchema'; import addressSchema from '../../../addressSchema.js';
import { makePartial } from '../../../utils'; import { makePartial } from '../../../utils/index.js';
const poolsConfigSchema = z.object({ const poolsConfigSchema = z.object({
WETHAddress: addressSchema.optional(), WETHAddress: addressSchema.optional(),

View File

@@ -1,8 +1,8 @@
import { fetchWithValidation } from 'simple-typed-fetch'; import { fetchWithValidation } from 'simple-typed-fetch';
import type { Exchange } from '../../types'; import type { Exchange } from '../../types.js';
import { statisticsOverviewSchema, topPairsStatisticsSchema } from './schemas'; import { statisticsOverviewSchema, topPairsStatisticsSchema } from './schemas/index.js';
import candlesSchema from './schemas/candlesSchema'; import candlesSchema from './schemas/candlesSchema.js';
import { PriceFeedWS } from './ws'; import { PriceFeedWS } from './ws/index.js';
class PriceFeed { class PriceFeed {
private readonly apiUrl: string; private readonly apiUrl: string;
@@ -68,6 +68,6 @@ class PriceFeed {
} }
} }
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export { PriceFeed }; export { PriceFeed };

View File

@@ -1,5 +1,5 @@
export { default as candlesSchema } from './candlesSchema'; export { default as candlesSchema } from './candlesSchema.js';
export { export {
statisticsOverviewSchema, statisticsOverviewSchema,
topPairsStatisticsSchema, topPairsStatisticsSchema,
} from './statisticsSchema'; } from './statisticsSchema.js';

View File

@@ -1,11 +1,11 @@
import WebSocket from 'isomorphic-ws'; import WebSocket from 'isomorphic-ws';
import { z } from 'zod'; import { z } from 'zod';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import priceFeedSubscriptions from './priceFeedSubscriptions'; import priceFeedSubscriptions from './priceFeedSubscriptions.js';
import { tickerInfoSchema, candleSchema } from './schemas'; import { tickerInfoSchema, candleSchema } from './schemas/index.js';
import priceSchema from './schemas/priceSchema'; import priceSchema from './schemas/priceSchema.js';
import type { Json } from '../../../types'; import type { Json } from '../../../types.js';
import allTickersSchema from './schemas/allTickersSchema'; import allTickersSchema from './schemas/allTickersSchema.js';
export const subscriptions = { export const subscriptions = {
[priceFeedSubscriptions.ALL_TICKERS]: { [priceFeedSubscriptions.ALL_TICKERS]: {

View File

@@ -1,7 +1,7 @@
import type WebSocket from 'ws'; import type WebSocket from 'ws';
import PriceFeedSubscription, { type SubscriptionType, type Subscription } from './PriceFeedSubscription'; import PriceFeedSubscription, { type SubscriptionType, type Subscription } from './PriceFeedSubscription.js';
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export class PriceFeedWS { export class PriceFeedWS {
private subscriptions: Partial<{ private subscriptions: Partial<{
[K in SubscriptionType]: Partial< [K in SubscriptionType]: Partial<

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import tickerInfoSchema from './tickerInfoSchema'; import tickerInfoSchema from './tickerInfoSchema.js';
type TickerInfo = z.infer<typeof tickerInfoSchema> type TickerInfo = z.infer<typeof tickerInfoSchema>

View File

@@ -1,4 +1,4 @@
export { default as tickerInfoSchema } from './tickerInfoSchema'; export { default as tickerInfoSchema } from './tickerInfoSchema.js';
export { default as candleSchema } from './candleSchema'; export { default as candleSchema } from './candleSchema.js';
export { default as priceSchema } from './priceSchema'; export { default as priceSchema } from './priceSchema.js';
export { default as allTickersSchema } from './allTickersSchema'; export { default as allTickersSchema } from './allTickersSchema.js';

View File

@@ -7,7 +7,7 @@ import {
globalAnalyticsSchema, globalAnalyticsSchema,
rewardsClaimedSchema, rewardsClaimedSchema,
linkSchema, linkSchema,
} from './schemas'; } from './schemas/index.js';
type CreateLinkPayloadType = { type CreateLinkPayloadType = {
referer: string referer: string
@@ -154,5 +154,5 @@ class ReferralSystem {
); );
} }
export * as schemas from './schemas'; export * as schemas from './schemas/index.js';
export { ReferralSystem }; export { ReferralSystem };

View File

@@ -1,7 +1,7 @@
export { default as linkSchema } from './linkSchema'; export { default as linkSchema } from './linkSchema.js';
export { default as distinctAnalyticsSchema } from './distinctAnalyticsSchema'; export { default as distinctAnalyticsSchema } from './distinctAnalyticsSchema.js';
export { default as errorSchema } from './errorSchema'; export { default as errorSchema } from './errorSchema.js';
export { default as miniStatsSchema } from './miniStatsSchema'; export { default as miniStatsSchema } from './miniStatsSchema.js';
export { default as rewardsMappingSchema } from './rewardsMappingSchema'; export { default as rewardsMappingSchema } from './rewardsMappingSchema.js';
export { default as rewardsClaimedSchema } from './rewardsClaimedSchema'; export { default as rewardsClaimedSchema } from './rewardsClaimedSchema.js';
export { default as globalAnalyticsSchema } from './globalAnalyticsSchema'; export { default as globalAnalyticsSchema } from './globalAnalyticsSchema.js';

View File

@@ -1,3 +1,3 @@
export * as orionAggregator from './OrionAggregator'; export * as orionAggregator from './OrionAggregator/index.js';
export * as orionBlockchain from './OrionBlockchain'; export * as orionBlockchain from './OrionBlockchain/index.js';
export * as priceFeed from './PriceFeed'; export * as priceFeed from './PriceFeed/index.js';

View File

@@ -1,9 +1,9 @@
/* eslint-disable @typescript-eslint/consistent-type-definitions */ /* eslint-disable @typescript-eslint/consistent-type-definitions */
import type BigNumber from 'bignumber.js'; import type { BigNumber } from 'bignumber.js';
import type exchanges from './constants/exchanges'; import type exchanges from './constants/exchanges.js';
import type subOrderStatuses from './constants/subOrderStatuses'; import type subOrderStatuses from './constants/subOrderStatuses.js';
import type positionStatuses from './constants/positionStatuses'; import type positionStatuses from './constants/positionStatuses.js';
import type { knownEnvs } from './config/schemas'; import type { knownEnvs } from './config/schemas/index.js';
export type DeepPartial<T> = T extends object ? { export type DeepPartial<T> = T extends object ? {
[P in keyof T]?: DeepPartial<T[P]>; [P in keyof T]?: DeepPartial<T[P]>;

View File

@@ -1,7 +1,7 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { FILL_ORDERS_GAS_LIMIT } from '../constants'; import { FILL_ORDERS_GAS_LIMIT } from '../constants/index.js';
import calculateNetworkFeeInFeeAsset from './calculateNetworkFeeInFeeAsset'; import calculateNetworkFeeInFeeAsset from './calculateNetworkFeeInFeeAsset.js';
import calculateOrionFeeInFeeAsset from './calculateOrionFeeInFeeAsset'; import calculateOrionFeeInFeeAsset from './calculateOrionFeeInFeeAsset.js';
const calculateFeeInFeeAsset = ( const calculateFeeInFeeAsset = (
amount: BigNumber.Value, amount: BigNumber.Value,

View File

@@ -1,6 +1,6 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { NATIVE_CURRENCY_PRECISION } from '../constants/precisions'; import { NATIVE_CURRENCY_PRECISION } from '../constants/precisions.js';
export default function calculateNetworkFee( export default function calculateNetworkFee(
gasPriceGwei: BigNumber.Value, gasPriceGwei: BigNumber.Value,

View File

@@ -1,5 +1,5 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import calculateNetworkFee from './calculateNetworkFee'; import calculateNetworkFee from './calculateNetworkFee.js';
const calculateNetworkFeeInFeeAsset = ( const calculateNetworkFeeInFeeAsset = (
gasPriceGwei: BigNumber.Value, gasPriceGwei: BigNumber.Value,

View File

@@ -1,4 +1,4 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
export default function calculateOrionFeeInFeeAsset( export default function calculateOrionFeeInFeeAsset(
amount: BigNumber.Value, amount: BigNumber.Value,

View File

@@ -1,4 +1,4 @@
import BigNumber from 'bignumber.js'; import { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
/** /**

View File

@@ -1,9 +1,9 @@
import { random } from '@lukeed/csprng'; import { randomBytes } from 'crypto';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
const generateSecret = () => { const generateSecret = () => {
const RANDOM_BITS = 256; const RANDOM_BITS = 256;
const rand = random(RANDOM_BITS); const rand = randomBytes(RANDOM_BITS);
const secret = ethers.utils.keccak256(rand); const secret = ethers.utils.keccak256(rand);
return secret; return secret;
}; };

View File

@@ -1,5 +1,5 @@
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import type { Source } from '../types'; import type { Source } from '../types.js';
export default function getAvailableFundsSources( export default function getAvailableFundsSources(
expenseType: 'amount' | 'network_fee' | 'orion_fee', expenseType: 'amount' | 'network_fee' | 'orion_fee',

View File

@@ -1,10 +1,10 @@
import { ERC20__factory, type Exchange } from '@orionprotocol/contracts'; import { ERC20__factory, type Exchange } from '@orionprotocol/contracts';
import type BigNumber from 'bignumber.js'; import type { BigNumber } from 'bignumber.js';
import { ethers } from 'ethers'; import { ethers } from 'ethers';
import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../constants'; import { INTERNAL_ORION_PRECISION, NATIVE_CURRENCY_PRECISION } from '../constants/index.js';
import type { OrionAggregator } from '../services/OrionAggregator'; import type { OrionAggregator } from '../services/OrionAggregator/index.js';
import denormalizeNumber from './denormalizeNumber'; import denormalizeNumber from './denormalizeNumber.js';
export default async function getBalance( export default async function getBalance(
orionAggregator: OrionAggregator, orionAggregator: OrionAggregator,

View File

@@ -1,8 +1,8 @@
import type { Exchange } from '@orionprotocol/contracts'; import type { Exchange } from '@orionprotocol/contracts';
import type BigNumber from 'bignumber.js'; import type { BigNumber } from 'bignumber.js';
import type { ethers } from 'ethers'; import type { ethers } from 'ethers';
import type { OrionAggregator } from '../services/OrionAggregator'; import type { OrionAggregator } from '../services/OrionAggregator/index.js';
import getBalance from './getBalance'; import getBalance from './getBalance.js';
export default async ( export default async (
balancesRequired: Partial<Record<string, string>>, balancesRequired: Partial<Record<string, string>>,

View File

@@ -1,20 +1,20 @@
export { default as calculateFeeInFeeAsset } from './calculateFeeInFeeAsset'; export { default as calculateFeeInFeeAsset } from './calculateFeeInFeeAsset.js';
export { default as calculateNetworkFee } from './calculateNetworkFee'; export { default as calculateNetworkFee } from './calculateNetworkFee.js';
export { default as calculateNetworkFeeInFeeAsset } from './calculateNetworkFeeInFeeAsset'; export { default as calculateNetworkFeeInFeeAsset } from './calculateNetworkFeeInFeeAsset.js';
export { default as calculateOrionFeeInFeeAsset } from './calculateOrionFeeInFeeAsset'; export { default as calculateOrionFeeInFeeAsset } from './calculateOrionFeeInFeeAsset.js';
export { default as checkIsToken } from './checkIsToken'; export { default as checkIsToken } from './checkIsToken.js';
export { default as generateSecret } from './generateSecret'; export { default as generateSecret } from './generateSecret.js';
export { default as denormalizeNumber } from './denormalizeNumber'; export { default as denormalizeNumber } from './denormalizeNumber.js';
export { default as normalizeNumber } from './normalizeNumber'; export { default as normalizeNumber } from './normalizeNumber.js';
export { default as isNetworkCodeInEnvironment } from './isNetworkCodeInEnvironment'; export { default as isNetworkCodeInEnvironment } from './isNetworkCodeInEnvironment.js';
export { default as parseExchangeTradeTransaction } from './parseExchangeTradeTransaction'; export { default as parseExchangeTradeTransaction } from './parseExchangeTradeTransaction.js';
export { default as toUpperCase } from './toUpperCase'; export { default as toUpperCase } from './toUpperCase.js';
export { default as toLowerCase } from './toLowerCase'; export { default as toLowerCase } from './toLowerCase.js';
export { default as isUppercasedNetworkCode } from './isUppercasedNetworkCode'; export { default as isUppercasedNetworkCode } from './isUppercasedNetworkCode.js';
export { default as getNativeCryptocurrency } from './getNativeCryptocurrency'; export { default as getNativeCryptocurrency } from './getNativeCryptocurrency.js';
export { default as isValidChainId } from './isValidChainId'; export { default as isValidChainId } from './isValidChainId.js';
export { default as isKnownEnv } from './isKnownEnv'; export { default as isKnownEnv } from './isKnownEnv.js';
// export { default as HttpError } from './httpError'; // export { default as HttpError } from './httpError';
export * from './typeHelpers'; export * from './typeHelpers.js';

View File

@@ -1,5 +1,5 @@
import { knownEnvs } from '../config/schemas'; import { knownEnvs } from '../config/schemas/index.js';
import type { KnownEnv, } from '../types'; import type { KnownEnv, } from '../types.js';
const isKnownEnv = (env: string): env is KnownEnv => { const isKnownEnv = (env: string): env is KnownEnv => {
return knownEnvs.some((knownEnv) => knownEnv === env); return knownEnvs.some((knownEnv) => knownEnv === env);

View File

@@ -1,4 +1,4 @@
import { chains, envs } from '../config'; import { chains, envs } from '../config/index.js';
export default function isNetworkCodeInEnvironment(networkCode: string, env: string) { export default function isNetworkCodeInEnvironment(networkCode: string, env: string) {
if (!(env in envs)) { if (!(env in envs)) {

View File

@@ -1,5 +1,5 @@
import { networkCodes } from '../constants'; import { networkCodes } from '../constants/index.js';
import toUpperCase from './toUpperCase'; import toUpperCase from './toUpperCase.js';
const isUppercasedNetworkCode = (value: string): value is Uppercase<typeof networkCodes[number]> => networkCodes const isUppercasedNetworkCode = (value: string): value is Uppercase<typeof networkCodes[number]> => networkCodes
.map(toUpperCase).some((networkCode) => networkCode === value); .map(toUpperCase).some((networkCode) => networkCode === value);

View File

@@ -1,5 +1,5 @@
import { z } from 'zod'; import { z } from 'zod';
import { SupportedChainId } from '../types'; import { SupportedChainId } from '../types.js';
const isValidChainId = (chainId: string): chainId is SupportedChainId => { const isValidChainId = (chainId: string): chainId is SupportedChainId => {
const { success } = z.nativeEnum(SupportedChainId).safeParse(chainId); const { success } = z.nativeEnum(SupportedChainId).safeParse(chainId);

Some files were not shown because too many files have changed in this diff Show More