@strkfarm/sdk 1.2.0 → 2.0.0-dev-strategy2.1
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.
- package/dist/index.browser.global.js +76556 -66640
- package/dist/index.browser.mjs +34235 -24392
- package/dist/index.d.ts +2372 -793
- package/dist/index.js +31967 -22084
- package/dist/index.mjs +25545 -15719
- package/package.json +86 -76
- package/readme.md +56 -1
- package/src/data/extended-deposit.abi.json +3613 -0
- package/src/data/universal-vault.abi.json +135 -20
- package/src/dataTypes/_bignumber.ts +11 -0
- package/src/dataTypes/address.ts +7 -0
- package/src/global.ts +240 -193
- package/src/interfaces/common.tsx +26 -2
- package/src/modules/ExtendedWrapperSDk/index.ts +62 -0
- package/src/modules/ExtendedWrapperSDk/types.ts +311 -0
- package/src/modules/ExtendedWrapperSDk/wrapper.ts +448 -0
- package/src/modules/avnu.ts +17 -4
- package/src/modules/ekubo-quoter.ts +89 -10
- package/src/modules/erc20.ts +67 -21
- package/src/modules/harvests.ts +29 -43
- package/src/modules/index.ts +5 -1
- package/src/modules/lst-apr.ts +36 -0
- package/src/modules/midas.ts +159 -0
- package/src/modules/pricer-from-api.ts +2 -2
- package/src/modules/pricer-lst.ts +1 -1
- package/src/modules/pricer.ts +3 -38
- package/src/modules/token-market-data.ts +202 -0
- package/src/node/deployer.ts +1 -36
- package/src/strategies/autoCompounderStrk.ts +1 -1
- package/src/strategies/base-strategy.ts +20 -3
- package/src/strategies/btc-vesu-extended-strategy/core-strategy.tsx +1486 -0
- package/src/strategies/btc-vesu-extended-strategy/services/operationService.ts +32 -0
- package/src/strategies/btc-vesu-extended-strategy/utils/constants.ts +3 -0
- package/src/strategies/btc-vesu-extended-strategy/utils/helper.ts +396 -0
- package/src/strategies/btc-vesu-extended-strategy/utils/types.ts +5 -0
- package/src/strategies/ekubo-cl-vault.tsx +123 -306
- package/src/strategies/index.ts +7 -1
- package/src/strategies/svk-strategy.ts +247 -0
- package/src/strategies/universal-adapters/adapter-optimizer.ts +65 -0
- package/src/strategies/universal-adapters/adapter-utils.ts +5 -1
- package/src/strategies/universal-adapters/avnu-adapter.ts +432 -0
- package/src/strategies/universal-adapters/baseAdapter.ts +181 -153
- package/src/strategies/universal-adapters/common-adapter.ts +98 -77
- package/src/strategies/universal-adapters/extended-adapter.ts +976 -0
- package/src/strategies/universal-adapters/index.ts +7 -1
- package/src/strategies/universal-adapters/unused-balance-adapter.ts +109 -0
- package/src/strategies/universal-adapters/vesu-adapter.ts +230 -230
- package/src/strategies/universal-adapters/vesu-borrow-adapter.ts +1247 -0
- package/src/strategies/universal-adapters/vesu-multiply-adapter.ts +1306 -0
- package/src/strategies/universal-adapters/vesu-supply-only-adapter.ts +58 -51
- package/src/strategies/universal-lst-muliplier-strategy.tsx +716 -844
- package/src/strategies/universal-strategy.tsx +1103 -1181
- package/src/strategies/vesu-extended-strategy/services/operationService.ts +34 -0
- package/src/strategies/vesu-extended-strategy/types/transaction-metadata.ts +25 -0
- package/src/strategies/vesu-extended-strategy/utils/config.runtime.ts +77 -0
- package/src/strategies/vesu-extended-strategy/utils/constants.ts +50 -0
- package/src/strategies/vesu-extended-strategy/utils/helper.ts +367 -0
- package/src/strategies/vesu-extended-strategy/vesu-extended-strategy.tsx +1420 -0
- package/src/strategies/vesu-rebalance.tsx +16 -20
- package/src/utils/health-factor-math.ts +11 -5
package/package.json
CHANGED
|
@@ -1,79 +1,89 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
},
|
|
24
|
-
"files": [
|
|
25
|
-
"dist",
|
|
26
|
-
"src"
|
|
27
|
-
],
|
|
28
|
-
"scripts": {
|
|
29
|
-
"test": "jest",
|
|
30
|
-
"build": "tsup --clean && pnpm run build:esm && npm run build:dts && npm run build:iife && npm run build-cli && pnpm run build:iife-esm",
|
|
31
|
-
"build:esm": "tsup --clean false --format esm --platform node",
|
|
32
|
-
"build-cli:esm": "tsup ./src/cli.ts --clean false --format esm --platform node",
|
|
33
|
-
"build-cli": "tsup ./src/cli.ts --clean false && pnpm run build-cli:esm",
|
|
34
|
-
"build:dts": "tsup --clean false --dts-only",
|
|
35
|
-
"build:iife": "tsup --clean false --format iife --platform browser",
|
|
36
|
-
"build:iife-esm": "tsup --clean false --format iife --format esm --platform browser"
|
|
37
|
-
},
|
|
38
|
-
"keywords": [],
|
|
39
|
-
"author": "",
|
|
40
|
-
"license": "ISC",
|
|
41
|
-
"devDependencies": {
|
|
42
|
-
"@types/jest": "^29.5.12",
|
|
43
|
-
"@types/node-telegram-bot-api": "^0.64.7",
|
|
44
|
-
"jest": "^29.7.0",
|
|
45
|
-
"jest-environment-jsdom": "^29.7.0",
|
|
46
|
-
"request": "^2.88.2",
|
|
47
|
-
"ts-jest": "^29.1.5",
|
|
48
|
-
"ts-node": "^10.9.2",
|
|
49
|
-
"tsup": "^8.1.0",
|
|
50
|
-
"typedoc": "^0.26.3",
|
|
51
|
-
"typescript": "^5.5.3"
|
|
52
|
-
},
|
|
53
|
-
"peerDependencies": {
|
|
54
|
-
"@types/react": "^19.1.2",
|
|
55
|
-
"axios": "^1.7.2",
|
|
56
|
-
"react": "19.1.2",
|
|
57
|
-
"starknet": "9.2.1"
|
|
58
|
-
},
|
|
59
|
-
"dependencies": {
|
|
60
|
-
"@apollo/client": "3.11.8",
|
|
61
|
-
"@avnu/avnu-sdk": "3.0.2",
|
|
62
|
-
"@ericnordelo/strk-merkle-tree": "^1.0.0",
|
|
63
|
-
"@noble/curves": "^1.0.0",
|
|
64
|
-
"@noble/hashes": "^2.0.0",
|
|
65
|
-
"@scure/starknet": "^2.0.0",
|
|
66
|
-
"bignumber.js": "4.0.4",
|
|
67
|
-
"browser-assert": "^1.2.1",
|
|
68
|
-
"chalk": "^4.1.2",
|
|
69
|
-
"commander": "^12.1.0",
|
|
70
|
-
"ethers": "^6.13.5",
|
|
71
|
-
"graphql": "16.9.0",
|
|
72
|
-
"inquirer": "^10.1.2",
|
|
73
|
-
"node-telegram-bot-api": "^0.66.0",
|
|
74
|
-
"proxy-from-env": "^1.1.0",
|
|
75
|
-
"redis": "^4.7.0",
|
|
76
|
-
"stacktrace-js": "^2.0.2",
|
|
77
|
-
"winston": "^3.13.0"
|
|
2
|
+
"name": "@strkfarm/sdk",
|
|
3
|
+
"version": "2.0.0-dev-strategy2.1",
|
|
4
|
+
"description": "STRKFarm TS SDK (Meant for our internal use, but feel free to use it)",
|
|
5
|
+
"typings": "dist/index.d.ts",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"bin": {
|
|
8
|
+
"accountsecure": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"browser": "./dist/index.browser.mjs",
|
|
14
|
+
"default": "./dist/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"browser": "./dist/index.browser.global.js",
|
|
18
|
+
"default": "./dist/index.js"
|
|
19
|
+
},
|
|
20
|
+
"browser": "./dist/index.browser.global.js",
|
|
21
|
+
"types": "./dist/index.d.ts"
|
|
78
22
|
}
|
|
23
|
+
},
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"src"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"test": "jest",
|
|
30
|
+
"build": "tsup --clean && pnpm run build:esm && npm run build:dts && npm run build:iife && npm run build-cli && pnpm run build:iife-esm",
|
|
31
|
+
"build:watch": "nodemon --watch src --ext ts,tsx --ignore 'src/**/*.test.ts' --exec 'pnpm run build'",
|
|
32
|
+
"build:esm": "tsup --clean false --format esm --platform node",
|
|
33
|
+
"build-cli:esm": "tsup ./src/cli.ts --clean false --format esm --platform node",
|
|
34
|
+
"build-cli": "tsup ./src/cli.ts --clean false && pnpm run build-cli:esm",
|
|
35
|
+
"build:dts": "tsup --clean false --dts-only",
|
|
36
|
+
"build:iife": "tsup --clean false --format iife --platform browser",
|
|
37
|
+
"build:iife-esm": "tsup --clean false --format iife --format esm --platform browser",
|
|
38
|
+
"link": "pnpm link --global",
|
|
39
|
+
"unlink": "pnpm unlink --global"
|
|
40
|
+
},
|
|
41
|
+
"keywords": [],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "ISC",
|
|
44
|
+
"publishConfig": {
|
|
45
|
+
"tag": "dev"
|
|
46
|
+
},
|
|
47
|
+
"devDependencies": {
|
|
48
|
+
"@types/jest": "^29.5.12",
|
|
49
|
+
"@types/node-telegram-bot-api": "^0.64.7",
|
|
50
|
+
"jest": "^29.7.0",
|
|
51
|
+
"jest-environment-jsdom": "^29.7.0",
|
|
52
|
+
"nodemon": "^3.1.0",
|
|
53
|
+
"request": "^2.88.2",
|
|
54
|
+
"ts-jest": "^29.1.5",
|
|
55
|
+
"ts-node": "^10.9.2",
|
|
56
|
+
"tsup": "^8.1.0",
|
|
57
|
+
"typedoc": "^0.26.3",
|
|
58
|
+
"typescript": "^5.5.3"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"@types/react": "^19.1.2",
|
|
62
|
+
"axios": "^1.7.2",
|
|
63
|
+
"react": "19.1.0",
|
|
64
|
+
"starknet": "8.5.2"
|
|
65
|
+
},
|
|
66
|
+
"dependencies": {
|
|
67
|
+
"@apollo/client": "3.11.8",
|
|
68
|
+
"@avnu/avnu-sdk": "3.0.2",
|
|
69
|
+
"@ericnordelo/strk-merkle-tree": "^1.0.0",
|
|
70
|
+
"@neondatabase/serverless": "^1.0.2",
|
|
71
|
+
"@noble/curves": "^1.0.0",
|
|
72
|
+
"@noble/hashes": "^2.0.0",
|
|
73
|
+
"@scure/starknet": "^2.0.0",
|
|
74
|
+
"bignumber.js": "4.0.4",
|
|
75
|
+
"browser-assert": "^1.2.1",
|
|
76
|
+
"chalk": "^4.1.2",
|
|
77
|
+
"commander": "^12.1.0",
|
|
78
|
+
"dotenv": "^17.2.3",
|
|
79
|
+
"drizzle-orm": "^0.45.1",
|
|
80
|
+
"ethers": "^6.13.5",
|
|
81
|
+
"graphql": "16.9.0",
|
|
82
|
+
"inquirer": "^10.1.2",
|
|
83
|
+
"node-telegram-bot-api": "^0.66.0",
|
|
84
|
+
"proxy-from-env": "^1.1.0",
|
|
85
|
+
"redis": "^4.7.0",
|
|
86
|
+
"stacktrace-js": "^2.0.2",
|
|
87
|
+
"winston": "^3.13.0"
|
|
88
|
+
}
|
|
79
89
|
}
|
package/readme.md
CHANGED
|
@@ -1,4 +1,59 @@
|
|
|
1
1
|
# STRKFarm SDK
|
|
2
2
|
We are working on the documentation. It's not a priority right now, but we will get to it soon. If you have any questions, feel free to ask in our [Telegram](https://t.me/+HQ_eHaXmF-1lZDc1) in dev topic.
|
|
3
3
|
|
|
4
|
-
Also, if you are interested to help in the documentation, please let us know in the Telegram group. We appreciate open source contributions and have a reward system for contributors on onlydust.
|
|
4
|
+
Also, if you are interested to help in the documentation, please let us know in the Telegram group. We appreciate open source contributions and have a reward system for contributors on onlydust.
|
|
5
|
+
|
|
6
|
+
## Linking in Other Repositories
|
|
7
|
+
|
|
8
|
+
This package can be linked in other repositories using pnpm. There are two main approaches:
|
|
9
|
+
|
|
10
|
+
### Method 1: Global Link (Recommended for Development)
|
|
11
|
+
|
|
12
|
+
1. **In this repository**, build the package and create a global link:
|
|
13
|
+
```bash
|
|
14
|
+
pnpm build
|
|
15
|
+
pnpm link --global
|
|
16
|
+
# or simply: pnpm link
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
2. **In your other repository**, link to the package:
|
|
20
|
+
```bash
|
|
21
|
+
pnpm link @strkfarm/sdk
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
3. To unlink later:
|
|
25
|
+
```bash
|
|
26
|
+
# In this repo:
|
|
27
|
+
pnpm unlink --global
|
|
28
|
+
|
|
29
|
+
# In other repo:
|
|
30
|
+
pnpm unlink @strkfarm/sdk
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Method 2: Direct Path Link
|
|
34
|
+
|
|
35
|
+
In your other repository, add this package directly:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
pnpm add file:../path/to/sdk-ts-1
|
|
39
|
+
# or
|
|
40
|
+
pnpm link ../path/to/sdk-ts-1
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Method 3: Workspace Setup (Monorepo)
|
|
44
|
+
|
|
45
|
+
If you're setting up a monorepo, add this package to your workspace:
|
|
46
|
+
|
|
47
|
+
1. In your root `pnpm-workspace.yaml`:
|
|
48
|
+
```yaml
|
|
49
|
+
packages:
|
|
50
|
+
- 'packages/*'
|
|
51
|
+
- '../sdk-ts-1' # or wherever this package is located
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
2. Then in your other packages, add:
|
|
55
|
+
```bash
|
|
56
|
+
pnpm add @strkfarm/sdk
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
**Note**: Make sure to rebuild this package (`pnpm build`) after making changes for the changes to be reflected in linked packages.
|