@gmx-io/sdk 0.0.2 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/README.md +98 -20
  2. package/build/scripts/prebuild/index.d.ts +1 -0
  3. package/build/scripts/prebuild/index.js +7 -0
  4. package/build/scripts/prebuild/prebuildMarketConfigKeys.d.ts +1 -0
  5. package/build/scripts/prebuild/prebuildMarketConfigKeys.js +18 -0
  6. package/build/scripts/prebuild/prebuildMarketValuesKeys.d.ts +1 -0
  7. package/build/scripts/prebuild/prebuildMarketValuesKeys.js +18 -0
  8. package/build/src/configs/markets.d.ts +1 -2
  9. package/build/src/index.d.ts +2 -0
  10. package/build/src/index.js +7 -4
  11. package/build/src/modules/accounts/accounts.spec.js +1 -1
  12. package/build/src/modules/base.d.ts +3 -4
  13. package/build/src/modules/base.js +1 -1
  14. package/build/src/modules/markets/index.d.ts +4 -19
  15. package/build/src/modules/markets/index.js +72 -76
  16. package/build/src/modules/markets/markets.spec.js +14 -9
  17. package/build/src/modules/markets/query-builders.js +2 -0
  18. package/build/src/modules/markets/types.d.ts +0 -2
  19. package/build/src/modules/oracle.d.ts +2 -9
  20. package/build/src/modules/orders/orders.spec.js +1 -1
  21. package/build/src/modules/orders/transactions/createIncreaseOrderTxn.js +0 -1
  22. package/build/src/modules/orders/transactions/createSwapOrderTxn.d.ts +1 -1
  23. package/build/src/modules/orders/transactions/createSwapOrderTxn.js +13 -31
  24. package/build/src/modules/positions/positions.spec.js +1 -1
  25. package/build/src/modules/tokens/tokens.d.ts +6 -13
  26. package/build/src/modules/tokens/tokens.js +8 -3
  27. package/build/src/modules/tokens/tokens.spec.js +16 -9
  28. package/build/src/modules/trades/trades.js +0 -3
  29. package/build/src/modules/trades/trades.spec.js +1 -1
  30. package/build/src/types/markets.d.ts +7 -0
  31. package/build/src/types/sdk.d.ts +12 -20
  32. package/build/src/utils/marketKeysAndConfigs.d.ts +3 -3
  33. package/build/src/utils/marketKeysAndConfigs.js +2 -2
  34. package/build/src/utils/markets.d.ts +1 -1
  35. package/build/src/utils/markets.js +2 -2
  36. package/build/src/utils/multicall.js +2 -0
  37. package/build/src/utils/simulateExecuteOrder.js +2 -0
  38. package/build/src/utils/testUtil.d.ts +575 -0
  39. package/build/src/utils/{test.js → testUtil.js} +4 -7
  40. package/build/tsconfig.tsbuildinfo +1 -1
  41. package/package.json +75 -91
  42. package/build/src/utils/test.d.ts +0 -2
package/package.json CHANGED
@@ -1,95 +1,79 @@
1
1
  {
2
- "name": "@gmx-io/sdk",
3
- "version": "0.0.2",
4
- "type": "module",
5
- "main": "build/index.js",
6
- "exports": {
7
- ".": {
8
- "import": "./build/index.js",
9
- "require": "./build/index.js"
10
- },
11
- "./abis/*": "./build/abis/*",
12
- "./prebuilt/*": "./build/prebuilt/*",
13
- "./utils/*": "./build/utils/*"
2
+ "name": "@gmx-io/sdk",
3
+ "version": "0.0.4",
4
+ "type": "module",
5
+ "main": "build/src/index.js",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./build/src/index.js",
9
+ "require": "./build/src/index.js"
14
10
  },
15
- "scripts": {
16
- "prebuild": "yarn tsx scripts/prebuild",
17
- "prepare": "ts-patch install -s",
18
- "copy:jsons": "cp -r src/abis build && cp -r src/prebuilt build",
19
- "test": "jest",
20
- "tscheck": "tsc -p tsconfig.json --noEmit",
21
- "build": "rm -rf build && tsc -p tsconfig.json && yarn copy:jsons"
22
- },
23
- "dependencies": {
24
- "cross-fetch": "4.0.0",
25
- "graphql": "15.8.0",
26
- "isomorphic-performance": "5.1.1",
27
- "lodash": "4.17.21",
28
- "query-string": "7.1.1",
29
- "typescript": "5.4.2",
30
- "universal-perf-hooks": "1.0.1",
31
- "viem": "2.7.20"
32
- },
33
- "jest": {
34
- "preset": "ts-jest/presets/default-esm",
35
- "testEnvironment": "node",
36
- "testPathIgnorePatterns": [
37
- "/build/",
38
- "/node_modules/"
39
- ],
40
- "moduleFileExtensions": [
41
- "ts",
42
- "js",
43
- "json"
44
- ],
45
- "moduleNameMapper": {
46
- "^configs/(.*)$": "<rootDir>/src/configs/$1",
47
- "^modules/(.*)$": "<rootDir>/src/modules/$1",
48
- "^utils/(.*)$": "<rootDir>/src/utils/$1",
49
- "^types/(.*)$": "<rootDir>/src/types/$1",
50
- "prebuilt": "<rootDir>/src/prebuilt/index.ts",
51
- "^abis/(.*)$": "<rootDir>/src/abis/$1"
52
- }
53
- },
54
- "eslintConfig": {
55
- "rules": {
56
- "no-console": "warn"
57
- }
58
- },
59
- "engines": {
60
- "node": ">=18.0.0"
61
- },
62
- "devDependencies": {
63
- "@babel/plugin-proposal-private-property-in-object": "7.21.11",
64
- "@types/jest": "29.5.13",
65
- "@types/lodash": "4.14.198",
66
- "@types/node": "18.7.13",
67
- "@typescript-eslint/eslint-plugin": "6.5.0",
68
- "@typescript-eslint/parser": "6.5.0",
69
- "eslint": "^8.41.0",
70
- "eslint-config-prettier": "9.0.0",
71
- "eslint-config-recommended": "4.1.0",
72
- "eslint-plugin-local-rules": "2.0.1",
73
- "husky": "7.0.4",
74
- "jest": "29.7.0",
75
- "lint-staged": "12.3.4",
76
- "prettier": "3.2.5",
77
- "ts-jest": "29.2.5",
78
- "ts-patch": "3.2.1",
79
- "tsx": "4.19.0",
80
- "typescript-transform-paths": "3.5.1"
81
- },
82
- "lint-staged": {
83
- "src/**/*.{js,ts,jsx,tsx}": [
84
- "eslint --fix --max-warnings=0 ./src",
85
- "prettier --write"
86
- ],
87
- "src/**/*.{css,scss}": [
88
- "prettier --write"
89
- ]
90
- },
91
- "files": [
92
- "build"
11
+ "./abis/*": "./build/abis/*",
12
+ "./prebuilt/*": "./build/prebuilt/*",
13
+ "./utils/*": "./build/src/utils/*",
14
+ "./types/*": "./build/src/types/*",
15
+ "./configs/*": "./build/src/configs/*"
16
+ },
17
+ "scripts": {
18
+ "prebuild": "yarn tsx scripts/prebuild",
19
+ "prepare": "ts-patch install -s",
20
+ "copy:jsons": "cp -r src/abis build && cp -r src/prebuilt build",
21
+ "test": "jest",
22
+ "tscheck": "tsc -p tsconfig.json --noEmit",
23
+ "build": "rm -rf build && tsc -p tsconfig.json && yarn copy:jsons"
24
+ },
25
+ "jest": {
26
+ "preset": "ts-jest/presets/default-esm",
27
+ "testEnvironment": "node",
28
+ "testTimeout": 15000,
29
+ "testPathIgnorePatterns": [
30
+ "/build/",
31
+ "/node_modules/"
32
+ ],
33
+ "moduleFileExtensions": [
34
+ "ts",
35
+ "js",
36
+ "json"
93
37
  ],
94
- "packageManager": "yarn@3.1.0"
38
+ "moduleNameMapper": {
39
+ "^configs/(.*)$": "<rootDir>/src/configs/$1",
40
+ "^modules/(.*)$": "<rootDir>/src/modules/$1",
41
+ "^utils/(.*)$": "<rootDir>/src/utils/$1",
42
+ "^types/(.*)$": "<rootDir>/src/types/$1",
43
+ "prebuilt": "<rootDir>/src/prebuilt/index.ts",
44
+ "^abis/(.*)$": "<rootDir>/src/abis/$1"
45
+ }
46
+ },
47
+ "publishConfig": {
48
+ "access": "public"
49
+ },
50
+ "engines": {
51
+ "node": ">=18.0.0"
52
+ },
53
+ "dependencies": {
54
+ "cross-fetch": "4.0.0",
55
+ "graphql": "15.8.0",
56
+ "isomorphic-performance": "5.1.1",
57
+ "lodash": "4.17.21",
58
+ "query-string": "7.1.1",
59
+ "typescript": "5.4.2",
60
+ "universal-perf-hooks": "1.0.1",
61
+ "viem": "2.7.20"
62
+ },
63
+ "devDependencies": {
64
+ "@babel/plugin-proposal-private-property-in-object": "7.21.11",
65
+ "@types/jest": "29.5.13",
66
+ "@types/lodash": "4.14.198",
67
+ "@types/node": "18.7.13",
68
+ "jest": "29.7.0",
69
+ "lint-staged": "12.3.4",
70
+ "ts-jest": "29.2.5",
71
+ "ts-patch": "3.2.1",
72
+ "tsx": "4.19.0",
73
+ "typescript-transform-paths": "3.5.1"
74
+ },
75
+ "files": [
76
+ "build"
77
+ ],
78
+ "packageManager": "yarn@3.1.0"
95
79
  }
@@ -1,2 +0,0 @@
1
- import { GmxSdk } from "../index";
2
- export declare const arbitrumSdk: GmxSdk;