@indigo-labs/indigo-sdk 0.1.2 → 0.1.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 (40) hide show
  1. package/README.md +52 -7
  2. package/dist/index.d.mts +1064 -182
  3. package/dist/index.d.ts +1064 -182
  4. package/dist/index.js +2565 -561
  5. package/dist/index.mjs +2546 -593
  6. package/package.json +64 -43
  7. package/.nvmrc +0 -1
  8. package/.prettierrc +0 -6
  9. package/babel.config.cjs +0 -13
  10. package/examples/sample-cdp.ts +0 -43
  11. package/jest.config.js +0 -13
  12. package/src/contracts/cdp-creator.ts +0 -86
  13. package/src/contracts/cdp.ts +0 -892
  14. package/src/contracts/collector.ts +0 -91
  15. package/src/contracts/gov.ts +0 -58
  16. package/src/contracts/interest-oracle.ts +0 -49
  17. package/src/contracts/price-oracle.ts +0 -24
  18. package/src/contracts/treasury.ts +0 -95
  19. package/src/helpers/asset-helpers.ts +0 -28
  20. package/src/helpers/cdp-helpers.ts +0 -9
  21. package/src/helpers/helpers.ts +0 -17
  22. package/src/helpers/lucid-utils.ts +0 -24
  23. package/src/helpers/time-helpers.ts +0 -3
  24. package/src/index.ts +0 -23
  25. package/src/scripts/cdp-creator-validator.ts +0 -9
  26. package/src/scripts/cdp-validator.ts +0 -9
  27. package/src/scripts/collector-validator.ts +0 -8
  28. package/src/scripts/interest-oracle-validator.ts +0 -8
  29. package/src/scripts/treasury-validator.ts +0 -8
  30. package/src/types/generic.ts +0 -13
  31. package/src/types/indigo/cdp.ts +0 -33
  32. package/src/types/indigo/gov.ts +0 -21
  33. package/src/types/indigo/interest-oracle.ts +0 -5
  34. package/src/types/indigo/price-oracle.ts +0 -4
  35. package/src/types/system-params.ts +0 -228
  36. package/tests/data/system-params.json +0 -989
  37. package/tests/datums.test.ts +0 -51
  38. package/tests/hash-checks.test.ts +0 -17
  39. package/tests/interest-calculations.test.ts +0 -143
  40. package/tsconfig.json +0 -35
package/README.md CHANGED
@@ -2,7 +2,52 @@
2
2
 
3
3
  ** Not ready for production yet **
4
4
 
5
- `indigo-sdk` is a TypeScript SDK designed to interact with Indigo endpoints for managing CDPs (Collateralized Debt Positions) by integrating the [lucid-evolution](https://github.com/Anastasia-Labs/lucid-evolution) library.
5
+ `indigo-sdk` is a TypeScript SDK designed to interact with Indigo endpoints for managing CDPs (Collateralized Debt Positions), Staking Positions, and Stability Pool Accounts by integrating the [lucid-evolution](https://github.com/Anastasia-Labs/lucid-evolution) library.
6
+
7
+ ## Installation
8
+
9
+ ```bash
10
+ npm install @indigo-labs/indigo-sdk
11
+ ```
12
+
13
+ ## Development
14
+
15
+ ### Prerequisites
16
+
17
+ - Node.js (version specified in `.nvmrc`)
18
+ - pnpm package manager
19
+
20
+ ### Setup
21
+
22
+ 1. Clone this repository
23
+ 2. Install dependencies: `pnpm install`
24
+ 3. Build the project: `pnpm run build`
25
+
26
+ ### Available Scripts
27
+
28
+ - `pnpm run build` - Build the project using tsup
29
+ - `pnpm run lint` - Run ESLint to check code quality
30
+ - `pnpm run format` - Format code using Prettier
31
+ - `pnpm run format:check` - Check if code is properly formatted
32
+ - `pnpm run test` - Run tests using Vitest
33
+
34
+ ### Code Quality
35
+
36
+ This project uses:
37
+
38
+ - **ESLint** for code linting and quality checks
39
+ - **Prettier** for code formatting
40
+ - **TypeScript** for type safety
41
+
42
+ ### Running Tests
43
+
44
+ There are currently a few unit tests available for datums, hash checks, and interest calculations. Additionally, acceptance tests have been published for CDPs, Staking Positions, and Stability Pool accounts. These tests initialize the Indigo Protocol and positively test that the transaction building is working in an emulated Cardano Blockchain.
45
+
46
+ Instructions:
47
+
48
+ 1. Clone this repository
49
+ 2. Run `pnpm install`
50
+ 3. Run `pnpm run test`
6
51
 
7
52
  ## Endpoints
8
53
 
@@ -13,9 +58,9 @@
13
58
  - **Mint against CDP**
14
59
  - **Burn against CDP**
15
60
  - **Pay CDP Interest**
16
-
17
- ## Installation
18
-
19
- ```bash
20
- npm install @indigo-labs/indigo-sdk
21
- ```
61
+ - **Open a Staking Position**
62
+ - **Adjust a Staking Position**
63
+ - **Close a Staking Position**
64
+ - **Open a Stability Pool Account**
65
+ - **Adjust a Stability Pool Account**
66
+ - **Close a Stability Pool Account**