@stabilitydao/host 0.5.5 → 0.5.9

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.
@@ -5,7 +5,7 @@
5
5
  "timestamp": "2026-02-08T00:00:00+00:00",
6
6
  "version": {
7
7
  "major": 1,
8
- "minor": 3,
8
+ "minor": 4,
9
9
  "patch": 0
10
10
  },
11
11
  "tags": {
@@ -2021,6 +2021,78 @@
2021
2021
  "decimals": 18,
2022
2022
  "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/ptsusde.svg",
2023
2023
  "tags": ["pt"]
2024
+ },
2025
+ {
2026
+ "chainId": 9745,
2027
+ "address": "0x1B64B9025EEbb9A6239575dF9Ea4b9Ac46D4d193",
2028
+ "symbol": "XAUt0",
2029
+ "name": "XAUt0",
2030
+ "decimals": 6,
2031
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/xaut0.png",
2032
+ "tags": []
2033
+ },
2034
+ {
2035
+ "chainId": 9745,
2036
+ "address": "0x93B544c330F60A2aa05ceD87aEEffB8D38FD8c9a",
2037
+ "symbol": "PT-USDe-15JAN2026",
2038
+ "name": "PT Ethena USDe 15JAN2026",
2039
+ "decimals": 18,
2040
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/ptusde.svg",
2041
+ "tags": ["pt"]
2042
+ },
2043
+ {
2044
+ "chainId": 9745,
2045
+ "address": "0x02FCC4989B4C9D435b7ceD3fE1Ba4CF77BBb5Dd8",
2046
+ "symbol": "PT-sUSDE-15JAN2026",
2047
+ "name": "PT Ethena sUSDE 15JAN2026",
2048
+ "decimals": 18,
2049
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/PT-sUSDE-25SEP2025.svg",
2050
+ "tags": ["pt"]
2051
+ },
2052
+ {
2053
+ "chainId": 9745,
2054
+ "address": "0xe48D935e6C9e735463ccCf29a7F11e32bC09136E",
2055
+ "symbol": "wstETH",
2056
+ "name": "Wrapped liquid staked Ether 2.0",
2057
+ "decimals": 18,
2058
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/wstETH.svg",
2059
+ "tags": ["lst", "eth"]
2060
+ },
2061
+ {
2062
+ "chainId": 9745,
2063
+ "address": "0xe561FE05C39075312Aa9Bc6af79DdaE981461359",
2064
+ "symbol": "wrsETH",
2065
+ "name": "rsETHWrapper",
2066
+ "decimals": 18,
2067
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/wrseth.svg",
2068
+ "tags": ["lst", "eth"]
2069
+ },
2070
+ {
2071
+ "chainId": 9745,
2072
+ "address": "0xC4374775489CB9C56003BF2C9b12495fC64F0771",
2073
+ "symbol": "syrupUSDT",
2074
+ "name": "Syrup USDT",
2075
+ "decimals": 6,
2076
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/syrupusdt.webp",
2077
+ "tags": ["usd"]
2078
+ },
2079
+ {
2080
+ "chainId": 9745,
2081
+ "address": "0xab509448ad489e2E1341e25CC500f2596464Cc82",
2082
+ "symbol": "PT-sUSDE-9APR2026",
2083
+ "name": "PT Ethena sUSDE 9APR2026",
2084
+ "decimals": 18,
2085
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/PT-sUSDE-25SEP2025.svg",
2086
+ "tags": ["pt"]
2087
+ },
2088
+ {
2089
+ "chainId": 9745,
2090
+ "address": "0x54Dc267be2839303ff1e323584A16e86CeC4Aa44",
2091
+ "symbol": "PT-USDe-9APR2026",
2092
+ "name": "PT Ethena USDe 9APR2026",
2093
+ "decimals": 18,
2094
+ "logoURI": "https://raw.githubusercontent.com/stabilitydao/.github/main/tokens/ptusde.svg",
2095
+ "tags": ["pt"]
2024
2096
  }
2025
2097
  ]
2026
2098
  }
@@ -0,0 +1,15 @@
1
+ import { Activity } from "./activity";
2
+ import { IFunding, IVesting, LifecyclePhase } from "./host";
3
+ import { IOSSettings } from "./host/types";
4
+ export declare class Validation {
5
+ /**
6
+ * Ensure that the activity array does not contain duplicate activities
7
+ * and if builder activity exist one more other activity should exist too
8
+ * @param activity
9
+ */
10
+ static validateActivity(activity: Activity[]): void;
11
+ static validateFunding(daoPhase: LifecyclePhase, fundings: IFunding[], settings: IOSSettings): void;
12
+ static validateVesting(daoPhase: LifecyclePhase, vestings: IVesting[], settings: IOSSettings, tge?: IFunding): void;
13
+ private static _validateVesting;
14
+ }
15
+ //# sourceMappingURL=validation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.d.ts","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAe,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,qBAAa,UAAU;IACrB;;;;OAIG;WACW,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,EAAE;WAgBrC,eAAe,CAC3B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,QAAQ,EAAE,EACpB,QAAQ,EAAE,WAAW;WAiDT,eAAe,CAC3B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,QAAQ,EAAE,EACpB,QAAQ,EAAE,WAAW,EACrB,GAAG,CAAC,EAAE,QAAQ;IA8BhB,OAAO,CAAC,MAAM,CAAC,gBAAgB;CA4BhC"}
@@ -0,0 +1,106 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Validation = void 0;
4
+ const activity_1 = require("./activity");
5
+ const host_1 = require("./host");
6
+ class Validation {
7
+ /**
8
+ * Ensure that the activity array does not contain duplicate activities
9
+ * and if builder activity exist one more other activity should exist too
10
+ * @param activity
11
+ */
12
+ static validateActivity(activity) {
13
+ // ensure that the activity array does not contain duplicate activities
14
+ let set = new Set();
15
+ for (let a of activity) {
16
+ if (set.has(a)) {
17
+ throw new Error("InvalidActivityCombination");
18
+ }
19
+ set.add(a);
20
+ }
21
+ // if builder activity exist one more other activity should exist too
22
+ if (activity.length === 1 && activity.includes(activity_1.Activity.BUILDER)) {
23
+ throw new Error("SingleBuilderActivityNotAllowed");
24
+ }
25
+ }
26
+ static validateFunding(daoPhase, fundings, settings) {
27
+ const set = new Set();
28
+ for (const funding of fundings) {
29
+ // ----------------------- Check phase
30
+ if (funding.type === host_1.FundingType.SEED &&
31
+ daoPhase !== host_1.LifecyclePhase.DRAFT) {
32
+ throw new Error("TooLateToUpdateSuchFunding");
33
+ }
34
+ if (funding.type === host_1.FundingType.TGE &&
35
+ ![
36
+ host_1.LifecyclePhase.DRAFT,
37
+ host_1.LifecyclePhase.SEED,
38
+ host_1.LifecyclePhase.DEVELOPMENT,
39
+ ].includes(daoPhase)) {
40
+ throw new Error("TooLateToUpdateSuchFunding");
41
+ }
42
+ // ----------------------- Check duplicate funding types
43
+ if (set.has(funding.type)) {
44
+ throw new Error("InvalidFundingArray");
45
+ }
46
+ set.add(funding.type);
47
+ // ----------------------- Min/max round duration
48
+ const duration = funding.end - funding.start;
49
+ if (duration < settings.minFundingDuration * 24 * 3600 ||
50
+ duration > settings.maxFundingDuration * 24 * 3600) {
51
+ throw new Error("InvalidFundingPeriod");
52
+ }
53
+ // ----------------------- Min/max raise
54
+ if (funding.minRaise >= funding.maxRaise ||
55
+ funding.minRaise < settings.minFundingRaise ||
56
+ funding.maxRaise > settings.maxFundingRaise) {
57
+ throw new Error("InvalidFundingRaise");
58
+ }
59
+ // start date delay is not checked
60
+ }
61
+ }
62
+ static validateVesting(daoPhase, vestings, settings, tge) {
63
+ if ([
64
+ host_1.LifecyclePhase.LIVE_CLIFF,
65
+ host_1.LifecyclePhase.LIVE_VESTING,
66
+ host_1.LifecyclePhase.LIVE,
67
+ ].includes(daoPhase)) {
68
+ throw new Error("TooLateToUpdateVesting");
69
+ }
70
+ if (!tge?.claim) {
71
+ if (vestings.length !== 0) {
72
+ throw new Error("VestingNotAllowed");
73
+ }
74
+ }
75
+ else {
76
+ let totalAllocation = 0;
77
+ for (const vesting of vestings) {
78
+ // check vesting consistency
79
+ this._validateVesting(vesting, settings, tge);
80
+ totalAllocation += vesting.allocation;
81
+ }
82
+ if (totalAllocation >= 100) {
83
+ throw new Error("TotalAllocationTooHigh");
84
+ }
85
+ }
86
+ }
87
+ static _validateVesting(vesting, settings, tge) {
88
+ if (vesting.name.length < settings.minVestingNameLen ||
89
+ vesting.name.length > settings.maxVestingNameLen) {
90
+ throw new Error(`NameLength(${vesting.name.length})`);
91
+ }
92
+ if (vesting.allocation === 0) {
93
+ throw new Error("ZeroValueNotAllowed");
94
+ }
95
+ if (vesting.start < (tge.claim ?? 0) + settings.minCliff * 24 * 3600) {
96
+ throw new Error("IncorrectVestingStart");
97
+ }
98
+ const duration = vesting.end - vesting.start;
99
+ if (duration < settings.minVestingDuration * 24 * 3600 ||
100
+ duration > settings.maxVestingDuration * 24 * 3600) {
101
+ throw new Error("InvalidVestingPeriod");
102
+ }
103
+ }
104
+ }
105
+ exports.Validation = Validation;
106
+ //# sourceMappingURL=validation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validation.js","sourceRoot":"","sources":["../src/validation.ts"],"names":[],"mappings":";;;AAAA,yCAAsC;AACtC,iCAAyE;AAGzE,MAAa,UAAU;IACrB;;;;OAIG;IACI,MAAM,CAAC,gBAAgB,CAAC,QAAoB;QACjD,uEAAuE;QACvE,IAAI,GAAG,GAAkB,IAAI,GAAG,EAAE,CAAC;QACnC,KAAK,IAAI,CAAC,IAAI,QAAQ,EAAE,CAAC;YACvB,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC;gBACf,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAChD,CAAC;YACD,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACb,CAAC;QAED,qEAAqE;QACrE,IAAI,QAAQ,CAAC,M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Eb,IACE,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,iBAAiB;YAChD,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,iBAAiB,EAChD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,cAAc,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;QACxD,CAAC;QAED,IAAI,OAAO,CAAC,UAAU,KAAK,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;QACzC,CAAC;QAED,IAAI,OAAO,CAAC,KAAK,GAAG,CAAC,GAAG,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC,QAAQ,GAAG,EAAE,GAAG,IAAI,EAAE,CAAC;YACrE,MAAM,IAAI,KAAK,CAAC,uBAAuB,CAAC,CAAC;QAC3C,CAAC;QAED,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC;QAC7C,IACE,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,GAAG,EAAE,GAAG,IAAI;YAClD,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,GAAG,EAAE,GAAG,IAAI,EAClD,CAAC;YACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;CACF;AAxID,gCAwIC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stabilitydao/host",
3
- "version": "0.5.5",
3
+ "version": "0.5.9",
4
4
  "description": "Host library",
5
5
  "main": "out/index.js",
6
6
  "types": "out/index.d.ts",
@@ -20,7 +20,9 @@
20
20
  "build": "tsc",
21
21
  "test": "jest",
22
22
  "coverage": "jest --collect-coverage",
23
- "postbuild": "shx cp src/tokenlist.json out/"
23
+ "postbuild": "shx cp src/tokenlist.json out/",
24
+ "format": "prettier --write .",
25
+ "format:check": "prettier --check ."
24
26
  },
25
27
  "devDependencies": {
26
28
  "@types/jest": "^30.0.0",