@1delta/initializer-sdk 0.0.1 → 0.0.2

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.d.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './initializer';
2
+ export * from './token-list';
package/dist/index.js CHANGED
@@ -89,7 +89,16 @@ async function fetchLenderMetaFromDir(flags = {}) {
89
89
  };
90
90
  }
91
91
 
92
+ // src/token-list.ts
93
+ var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
94
+ async function getDeltaTokenList(chain) {
95
+ const data = await fetch(getListUrl(chain));
96
+ const list = (await data.json()).list;
97
+ return list;
98
+ }
99
+
92
100
  exports.fetchLenderMetaFromDir = fetchLenderMetaFromDir;
93
101
  exports.fetchLenderMetaFromDirAndInitialize = fetchLenderMetaFromDirAndInitialize;
94
102
  exports.fetchLenderMetaFromDirAndInitializeAll = fetchLenderMetaFromDirAndInitializeAll;
103
+ exports.getDeltaTokenList = getDeltaTokenList;
95
104
  exports.inititalizeAllData = inititalizeAllData;
package/dist/index.mjs CHANGED
@@ -87,4 +87,12 @@ async function fetchLenderMetaFromDir(flags = {}) {
87
87
  };
88
88
  }
89
89
 
90
- export { fetchLenderMetaFromDir, fetchLenderMetaFromDirAndInitialize, fetchLenderMetaFromDirAndInitializeAll, inititalizeAllData };
90
+ // src/token-list.ts
91
+ var getListUrl = (chainId) => `https://raw.githubusercontent.com/1delta-DAO/token-lists/main/${chainId}.json`;
92
+ async function getDeltaTokenList(chain) {
93
+ const data = await fetch(getListUrl(chain));
94
+ const list = (await data.json()).list;
95
+ return list;
96
+ }
97
+
98
+ export { fetchLenderMetaFromDir, fetchLenderMetaFromDirAndInitialize, fetchLenderMetaFromDirAndInitializeAll, getDeltaTokenList, inititalizeAllData };
@@ -0,0 +1,22 @@
1
+ export interface GenericCurrency {
2
+ /** chainId as string */
3
+ chainId: string;
4
+ /** lower case address */
5
+ address: string;
6
+ /** name */
7
+ name?: string;
8
+ /** symbol */
9
+ symbol?: string;
10
+ /** logo */
11
+ logoURI?: string;
12
+ /** group */
13
+ assetGroup?: string;
14
+ /** decimal number */
15
+ decimals: number;
16
+ /** extensible */
17
+ [k: string]: any;
18
+ }
19
+ export type GenericTokenList = {
20
+ [addressLowerCase: string]: GenericCurrency;
21
+ };
22
+ export declare function getDeltaTokenList(chain: string): Promise<any>;
package/package.json CHANGED
@@ -1,49 +1,49 @@
1
1
  {
2
- "name": "@1delta/initializer-sdk",
3
- "license": "MIT",
4
- "publishConfig": {
5
- "access": "public"
6
- },
7
- "version": "0.0.1",
8
- "description": "Deterministic initializer for lending protocol data across the stack",
9
- "files": [
10
- "dist"
11
- ],
12
- "keywords": [
13
- "dex"
14
- ],
15
- "sideEffects": false,
16
- "main": "dist/index.js",
17
- "types": "dist/index.d.ts",
18
- "module": "dist/index.mjs",
19
- "scripts": {
20
- "build": "tsup",
21
- "dev": "tsup --watch",
22
- "test": "vitest --run",
23
- "coverage": "vitest run --coverage",
24
- "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
25
- },
26
- "devDependencies": {
27
- "tsup": "^8.5.1",
28
- "typescript": "^5.9.3"
29
- },
30
- "dependencies": {
31
- "@1delta/data-sdk": "workspace:*"
32
- },
33
- "engines": {
34
- "node": ">=20"
35
- },
36
- "prettier": {
37
- "printWidth": 120,
38
- "semi": false,
39
- "singleQuote": true
40
- },
41
- "exports": {
42
- "./package.json": "./package.json",
43
- ".": {
44
- "types": "./dist/index.d.ts",
45
- "import": "./dist/index.mjs",
46
- "require": "./dist/index.js"
47
- }
48
- }
49
- }
2
+ "name": "@1delta/initializer-sdk",
3
+ "license": "MIT",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
7
+ "version": "0.0.2",
8
+ "description": "Deterministic initializer for lending protocol data across the stack",
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "keywords": [
13
+ "dex"
14
+ ],
15
+ "sideEffects": false,
16
+ "main": "dist/index.js",
17
+ "types": "dist/index.d.ts",
18
+ "module": "dist/index.mjs",
19
+ "devDependencies": {
20
+ "tsup": "^8.5.1",
21
+ "typescript": "^5.9.3"
22
+ },
23
+ "dependencies": {
24
+ "@1delta/data-sdk": "0.0.11"
25
+ },
26
+ "engines": {
27
+ "node": ">=20"
28
+ },
29
+ "prettier": {
30
+ "printWidth": 120,
31
+ "semi": false,
32
+ "singleQuote": true
33
+ },
34
+ "exports": {
35
+ "./package.json": "./package.json",
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.mjs",
39
+ "require": "./dist/index.js"
40
+ }
41
+ },
42
+ "scripts": {
43
+ "build": "tsup",
44
+ "dev": "tsup --watch",
45
+ "test": "vitest --run",
46
+ "coverage": "vitest run --coverage",
47
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
48
+ }
49
+ }