@indigo-labs/indigo-sdk 0.1.2 → 0.1.3
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/.github/workflows/ci.yml +62 -0
- package/.github/workflows/test.yml +44 -0
- package/.husky/pre-commit +1 -0
- package/.prettierrc +1 -1
- package/README.md +52 -7
- package/dist/index.d.mts +1064 -182
- package/dist/index.d.ts +1064 -182
- package/dist/index.js +2565 -561
- package/dist/index.mjs +2546 -593
- package/eslint.config.mjs +35 -0
- package/package.json +61 -43
- package/src/contracts/cdp.ts +208 -359
- package/src/contracts/collector.ts +13 -6
- package/src/contracts/gov.ts +1 -58
- package/src/contracts/interest-oracle.ts +139 -39
- package/src/contracts/lrp.ts +223 -0
- package/src/contracts/one-shot.ts +67 -0
- package/src/contracts/stability-pool.ts +684 -0
- package/src/contracts/staking.ts +348 -0
- package/src/contracts/treasury.ts +30 -13
- package/src/helpers/asset-helpers.ts +51 -22
- package/src/helpers/helper-txs.ts +30 -0
- package/src/helpers/helpers.ts +29 -8
- package/src/helpers/indigo-helpers.ts +19 -0
- package/src/helpers/interest-oracle.ts +57 -0
- package/src/helpers/lucid-utils.ts +62 -16
- package/src/helpers/price-oracle-helpers.ts +36 -0
- package/src/helpers/stability-pool-helpers.ts +207 -0
- package/src/helpers/staking-helpers.ts +94 -0
- package/src/helpers/time-helpers.ts +4 -3
- package/src/helpers/value-helpers.ts +16 -0
- package/src/index.ts +15 -4
- package/src/scripts/always-fail-validator.ts +7 -0
- package/src/scripts/auth-token-policy.ts +23 -0
- package/src/scripts/cdp-creator-validator.ts +46 -2
- package/src/scripts/collector-validator.ts +2 -2
- package/src/scripts/execute-validator.ts +52 -0
- package/src/scripts/gov-validator.ts +44 -0
- package/src/scripts/iasset-policy.ts +22 -0
- package/src/scripts/interest-oracle-validator.ts +18 -3
- package/src/scripts/lrp-validator.ts +23 -0
- package/src/scripts/one-shot-policy.ts +62 -0
- package/src/scripts/poll-manager-validator.ts +52 -0
- package/src/scripts/poll-shard-validator.ts +47 -0
- package/src/scripts/price-oracle-validator.ts +26 -0
- package/src/scripts/stability-pool-validator.ts +60 -0
- package/src/scripts/staking-validator.ts +8 -0
- package/src/scripts/version-record-policy.ts +26 -0
- package/src/scripts/version-registry.ts +15 -0
- package/src/types/generic.ts +99 -6
- package/src/types/indigo/cdp-creator.ts +46 -0
- package/src/types/indigo/cdp.ts +86 -31
- package/src/types/indigo/execute.ts +21 -0
- package/src/types/indigo/gov.ts +50 -20
- package/src/types/indigo/interest-oracle.ts +55 -5
- package/src/types/indigo/lrp.ts +54 -0
- package/src/types/indigo/poll-manager.ts +21 -0
- package/src/types/indigo/poll-shard.ts +16 -0
- package/src/types/indigo/price-oracle.ts +38 -4
- package/src/types/indigo/stability-pool.ts +233 -0
- package/src/types/indigo/staking.ts +99 -0
- package/src/types/indigo/version-record.ts +17 -0
- package/src/types/on-chain-decimal.ts +23 -0
- package/src/types/one-shot.ts +22 -0
- package/src/types/system-params.ts +95 -77
- package/tests/data/system-params.json +972 -972
- package/tests/datums.test.ts +279 -44
- package/tests/endpoints/initialize.ts +1013 -0
- package/tests/hash-checks.test.ts +71 -15
- package/tests/indigo-test-helpers.ts +115 -0
- package/tests/initialize.test.ts +27 -0
- package/tests/interest-calculations.test.ts +110 -133
- package/tests/interest-oracle.test.ts +90 -0
- package/tests/lrp.test.ts +149 -0
- package/tests/queries/governance-queries.ts +31 -0
- package/tests/queries/iasset-queries.ts +39 -0
- package/tests/queries/interest-oracle-queries.ts +13 -0
- package/tests/queries/lrp-queries.ts +39 -0
- package/tests/queries/price-oracle-queries.ts +27 -0
- package/tests/queries/stability-pool-queries.ts +75 -0
- package/tests/queries/staking-queries.ts +43 -0
- package/tests/stability-pool.test.ts +364 -0
- package/tests/staking.test.ts +105 -0
- package/tests/test-helpers.ts +38 -0
- package/tsconfig.build.json +4 -0
- package/tsconfig.json +8 -27
- package/vitest.config.ts +9 -0
- package/babel.config.cjs +0 -13
- package/examples/sample-cdp.ts +0 -43
- package/jest.config.js +0 -13
- package/src/contracts/cdp-creator.ts +0 -86
- package/src/contracts/price-oracle.ts +0 -24
- package/src/helpers/cdp-helpers.ts +0 -9
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import eslint from '@eslint/js';
|
|
2
|
+
import tseslint from 'typescript-eslint';
|
|
3
|
+
|
|
4
|
+
export default tseslint.config(
|
|
5
|
+
{
|
|
6
|
+
ignores: ['**/dist/*', '**/node_modules/*'],
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
files: ['**/*.ts'],
|
|
10
|
+
extends: [
|
|
11
|
+
eslint.configs.recommended,
|
|
12
|
+
tseslint.configs.recommendedTypeChecked,
|
|
13
|
+
{
|
|
14
|
+
languageOptions: {
|
|
15
|
+
parserOptions: {
|
|
16
|
+
projectService: true,
|
|
17
|
+
tsconfigRootDir: import.meta.dirname,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
rules: {
|
|
23
|
+
'no-use-before-define': 'error',
|
|
24
|
+
'@typescript-eslint/no-unused-vars': [
|
|
25
|
+
'error',
|
|
26
|
+
{
|
|
27
|
+
args: 'all',
|
|
28
|
+
argsIgnorePattern: '^_',
|
|
29
|
+
varsIgnorePattern: '^_',
|
|
30
|
+
caughtErrorsIgnorePattern: '^_',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
);
|
package/package.json
CHANGED
|
@@ -1,45 +1,63 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"sdk",
|
|
24
|
-
"typescript",
|
|
25
|
-
"lucid-evolution",
|
|
26
|
-
"cdp"
|
|
2
|
+
"name": "@indigo-labs/indigo-sdk",
|
|
3
|
+
"version": "0.1.3",
|
|
4
|
+
"description": "Indigo SDK for interacting with Indigo endpoints via lucid-evolution",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.mjs",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --clean --tsconfig tsconfig.build.json",
|
|
10
|
+
"lint": "npx eslint .",
|
|
11
|
+
"lint:fix": "npx eslint --fix .",
|
|
12
|
+
"repack": "pnpm run build && pnpm pack",
|
|
13
|
+
"format": "npx prettier --write src/ tests/",
|
|
14
|
+
"format:check": "npx prettier --check src/ tests/",
|
|
15
|
+
"test": "vitest run",
|
|
16
|
+
"prepare": "husky",
|
|
17
|
+
"lint-staged": "lint-staged"
|
|
18
|
+
},
|
|
19
|
+
"lint-staged": {
|
|
20
|
+
"*.{js,ts,jsx,tsx}": [
|
|
21
|
+
"prettier --write",
|
|
22
|
+
"eslint --fix"
|
|
27
23
|
],
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
24
|
+
"*.{json,md,yml,yaml}": [
|
|
25
|
+
"prettier --write"
|
|
26
|
+
]
|
|
27
|
+
},
|
|
28
|
+
"repository": {
|
|
29
|
+
"type": "git",
|
|
30
|
+
"url": "https://github.com/IndigoProtocol/indigo-sdk.git"
|
|
31
|
+
},
|
|
32
|
+
"keywords": [
|
|
33
|
+
"indigo",
|
|
34
|
+
"sdk",
|
|
35
|
+
"typescript",
|
|
36
|
+
"lucid-evolution",
|
|
37
|
+
"cdp"
|
|
38
|
+
],
|
|
39
|
+
"author": "3rd Eye Labs",
|
|
40
|
+
"license": "MIT",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@lucid-evolution/experimental": "^0.0.9",
|
|
43
|
+
"@lucid-evolution/lucid": "^0.4.29",
|
|
44
|
+
"dotenv": "^16.5.0",
|
|
45
|
+
"fp-ts": "^2.16.10",
|
|
46
|
+
"ts-pattern": "^5.8.0"
|
|
47
|
+
},
|
|
48
|
+
"devDependencies": {
|
|
49
|
+
"@babel/core": "^7.21.4",
|
|
50
|
+
"@babel/preset-env": "^7.21.4",
|
|
51
|
+
"@babel/preset-typescript": "^7.21.4",
|
|
52
|
+
"@eslint/js": "^9.32.0",
|
|
53
|
+
"@types/node": "^24.3.0",
|
|
54
|
+
"eslint": "^9.32.0",
|
|
55
|
+
"husky": "^9.1.7",
|
|
56
|
+
"lint-staged": "^16.1.5",
|
|
57
|
+
"prettier": "^3.6.2",
|
|
58
|
+
"tsup": "^8.3.6",
|
|
59
|
+
"typescript": "^5.9.2",
|
|
60
|
+
"typescript-eslint": "^8.39.0",
|
|
61
|
+
"vitest": "3.2.4"
|
|
62
|
+
}
|
|
63
|
+
}
|