glassnode-api 0.1.0 → 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/README.md +8 -8
- package/package.json +5 -1
- package/dist/types/response.d.ts +0 -39
- package/dist/types/response.js +0 -14
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@ A Node.js client for the [Glassnode API](https://docs.glassnode.com/).
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
|
|
8
|
+
npm install glassnode-api
|
|
9
9
|
```
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
@@ -47,26 +47,26 @@ Check the `examples` directory for usage examples. To run the examples:
|
|
|
47
47
|
|
|
48
48
|
1. Navigate to the examples directory
|
|
49
49
|
2. Create a `.env` file based on `.env.example` with your API key
|
|
50
|
-
3. Install dependencies with `
|
|
51
|
-
4. Run an example with `
|
|
50
|
+
3. Install dependencies with `npm install`
|
|
51
|
+
4. Run an example with `npx ts-node metadata.ts`
|
|
52
52
|
|
|
53
53
|
## Development
|
|
54
54
|
|
|
55
55
|
```bash
|
|
56
56
|
# Install dependencies
|
|
57
|
-
|
|
57
|
+
npm install
|
|
58
58
|
|
|
59
59
|
# Build the project
|
|
60
|
-
|
|
60
|
+
npm run build
|
|
61
61
|
|
|
62
62
|
# Run tests
|
|
63
|
-
|
|
63
|
+
npm test
|
|
64
64
|
|
|
65
65
|
# Lint code
|
|
66
|
-
|
|
66
|
+
npm run lint
|
|
67
67
|
|
|
68
68
|
# Format code
|
|
69
|
-
|
|
69
|
+
npm run format
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
## License
|
package/package.json
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glassnode-api",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Node.js client for the Glassnode API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist"
|
|
9
9
|
],
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/planadecu/glassnode-api-node.git"
|
|
13
|
+
},
|
|
10
14
|
"scripts": {
|
|
11
15
|
"build": "tsc",
|
|
12
16
|
"test": "jest",
|
package/dist/types/response.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Generic API response schema
|
|
4
|
-
*/
|
|
5
|
-
export declare const ResponseSchema: <T extends z.ZodTypeAny>(dataSchema: T) => z.ZodObject<{
|
|
6
|
-
/**
|
|
7
|
-
* Response data
|
|
8
|
-
*/
|
|
9
|
-
data: T;
|
|
10
|
-
}, "strip", z.ZodTypeAny, z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
11
|
-
/**
|
|
12
|
-
* Response data
|
|
13
|
-
*/
|
|
14
|
-
data: T;
|
|
15
|
-
}>, any> extends infer T_1 ? { [k in keyof T_1]: z.objectUtil.addQuestionMarks<z.baseObjectOutputType<{
|
|
16
|
-
/**
|
|
17
|
-
* Response data
|
|
18
|
-
*/
|
|
19
|
-
data: T;
|
|
20
|
-
}>, any>[k]; } : never, z.baseObjectInputType<{
|
|
21
|
-
/**
|
|
22
|
-
* Response data
|
|
23
|
-
*/
|
|
24
|
-
data: T;
|
|
25
|
-
}> extends infer T_2 ? { [k_1 in keyof T_2]: z.baseObjectInputType<{
|
|
26
|
-
/**
|
|
27
|
-
* Response data
|
|
28
|
-
*/
|
|
29
|
-
data: T;
|
|
30
|
-
}>[k_1]; } : never>;
|
|
31
|
-
/**
|
|
32
|
-
* Generic API response type
|
|
33
|
-
*/
|
|
34
|
-
export type Response<T> = {
|
|
35
|
-
/**
|
|
36
|
-
* Response data
|
|
37
|
-
*/
|
|
38
|
-
data: T;
|
|
39
|
-
};
|
package/dist/types/response.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ResponseSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Generic API response schema
|
|
7
|
-
*/
|
|
8
|
-
const ResponseSchema = (dataSchema) => zod_1.z.object({
|
|
9
|
-
/**
|
|
10
|
-
* Response data
|
|
11
|
-
*/
|
|
12
|
-
data: dataSchema
|
|
13
|
-
});
|
|
14
|
-
exports.ResponseSchema = ResponseSchema;
|