glassnode-api 0.1.4 → 0.7.1
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 +68 -36
- package/dist/errors.d.ts +6 -0
- package/dist/errors.js +25 -0
- package/dist/{src/glassnode-api.d.ts → glassnode-api.d.ts} +12 -1
- package/dist/glassnode-api.esm.min.js +2 -0
- package/dist/glassnode-api.esm.min.js.map +1 -0
- package/dist/{src/glassnode-api.js → glassnode-api.js} +49 -14
- package/dist/glassnode-api.umd.min.js +2 -0
- package/dist/glassnode-api.umd.min.js.map +1 -0
- package/dist/{src/index.d.ts → index.d.ts} +1 -0
- package/dist/{src/index.js → index.js} +1 -0
- package/dist/types/config.d.ts +24 -0
- package/dist/types/config.js +38 -0
- package/dist/types/metadata.d.ts +242 -0
- package/dist/{src/types → types}/metadata.js +55 -5
- package/package.json +39 -28
- package/dist/examples/metadata.validation.d.ts +0 -1
- package/dist/examples/metadata.validation.js +0 -126
- package/dist/examples/metric.dump.d.ts +0 -1
- package/dist/examples/metric.dump.js +0 -28
- package/dist/src/types/config.d.ts +0 -25
- package/dist/src/types/config.js +0 -18
- package/dist/src/types/metadata.d.ts +0 -383
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
2
|
-
/**
|
|
3
|
-
* Zod schema for Glassnode API configuration
|
|
4
|
-
*/
|
|
5
|
-
export declare const GlassnodeConfigSchema: z.ZodObject<{
|
|
6
|
-
/**
|
|
7
|
-
* API key for authentication
|
|
8
|
-
*/
|
|
9
|
-
apiKey: z.ZodString;
|
|
10
|
-
/**
|
|
11
|
-
* Base URL for the Glassnode API
|
|
12
|
-
* @default "https://api.glassnode.com"
|
|
13
|
-
*/
|
|
14
|
-
apiUrl: z.ZodDefault<z.ZodString>;
|
|
15
|
-
}, "strip", z.ZodTypeAny, {
|
|
16
|
-
apiKey: string;
|
|
17
|
-
apiUrl: string;
|
|
18
|
-
}, {
|
|
19
|
-
apiKey: string;
|
|
20
|
-
apiUrl?: string | undefined;
|
|
21
|
-
}>;
|
|
22
|
-
/**
|
|
23
|
-
* Configuration for the Glassnode API client
|
|
24
|
-
*/
|
|
25
|
-
export type GlassnodeConfig = z.input<typeof GlassnodeConfigSchema>;
|
package/dist/src/types/config.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.GlassnodeConfigSchema = void 0;
|
|
4
|
-
const zod_1 = require("zod");
|
|
5
|
-
/**
|
|
6
|
-
* Zod schema for Glassnode API configuration
|
|
7
|
-
*/
|
|
8
|
-
exports.GlassnodeConfigSchema = zod_1.z.object({
|
|
9
|
-
/**
|
|
10
|
-
* API key for authentication
|
|
11
|
-
*/
|
|
12
|
-
apiKey: zod_1.z.string().min(1, 'API key is required'),
|
|
13
|
-
/**
|
|
14
|
-
* Base URL for the Glassnode API
|
|
15
|
-
* @default "https://api.glassnode.com"
|
|
16
|
-
*/
|
|
17
|
-
apiUrl: zod_1.z.string().url().default('https://api.glassnode.com'),
|
|
18
|
-
});
|
|
@@ -1,383 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Metadata response types
|
|
3
|
-
*/
|
|
4
|
-
import { z } from 'zod';
|
|
5
|
-
/**
|
|
6
|
-
* External identifier sources schema
|
|
7
|
-
*/
|
|
8
|
-
export declare const ExternalIdSourceSchema: z.ZodEnum<["ccdata", "coinmarketcap", "coingecko"]>;
|
|
9
|
-
/**
|
|
10
|
-
* External identifier sources type
|
|
11
|
-
*/
|
|
12
|
-
export type ExternalIdSource = z.infer<typeof ExternalIdSourceSchema>;
|
|
13
|
-
/**
|
|
14
|
-
* External identifiers for an asset schema
|
|
15
|
-
*/
|
|
16
|
-
export declare const ExternalIdsSchema: z.ZodRecord<z.ZodEnum<["ccdata", "coinmarketcap", "coingecko"]>, z.ZodOptional<z.ZodString>>;
|
|
17
|
-
/**
|
|
18
|
-
* External identifiers for an asset type
|
|
19
|
-
*/
|
|
20
|
-
export type ExternalIds = z.infer<typeof ExternalIdsSchema>;
|
|
21
|
-
/**
|
|
22
|
-
* Blockchain information for an asset schema
|
|
23
|
-
*/
|
|
24
|
-
export declare const AssetBlockchainSchema: z.ZodObject<{
|
|
25
|
-
/**
|
|
26
|
-
* Blockchain name
|
|
27
|
-
*/
|
|
28
|
-
blockchain: z.ZodString;
|
|
29
|
-
/**
|
|
30
|
-
* Token address on the blockchain
|
|
31
|
-
*/
|
|
32
|
-
address: z.ZodString;
|
|
33
|
-
/**
|
|
34
|
-
* Number of decimal places
|
|
35
|
-
*/
|
|
36
|
-
decimals: z.ZodNumber;
|
|
37
|
-
/**
|
|
38
|
-
* Whether on-chain metrics are supported
|
|
39
|
-
*/
|
|
40
|
-
on_chain_support: z.ZodBoolean;
|
|
41
|
-
}, "strip", z.ZodTypeAny, {
|
|
42
|
-
address: string;
|
|
43
|
-
blockchain: string;
|
|
44
|
-
decimals: number;
|
|
45
|
-
on_chain_support: boolean;
|
|
46
|
-
}, {
|
|
47
|
-
address: string;
|
|
48
|
-
blockchain: string;
|
|
49
|
-
decimals: number;
|
|
50
|
-
on_chain_support: boolean;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Blockchain information for an asset type
|
|
54
|
-
*/
|
|
55
|
-
export type AssetBlockchain = z.infer<typeof AssetBlockchainSchema>;
|
|
56
|
-
/**
|
|
57
|
-
* Asset metadata schema
|
|
58
|
-
*/
|
|
59
|
-
export declare const AssetMetadataSchema: z.ZodObject<{
|
|
60
|
-
/**
|
|
61
|
-
* Asset identifier
|
|
62
|
-
*/
|
|
63
|
-
id: z.ZodString;
|
|
64
|
-
/**
|
|
65
|
-
* Asset symbol (e.g., "BTC", "ETH")
|
|
66
|
-
*/
|
|
67
|
-
symbol: z.ZodString;
|
|
68
|
-
/**
|
|
69
|
-
* Asset name (e.g., "Bitcoin", "Ethereum")
|
|
70
|
-
*/
|
|
71
|
-
name: z.ZodString;
|
|
72
|
-
/**
|
|
73
|
-
* Type of asset (e.g., "coin", "token")
|
|
74
|
-
*/
|
|
75
|
-
asset_type: z.ZodString;
|
|
76
|
-
/**
|
|
77
|
-
* External identifiers for this asset
|
|
78
|
-
*/
|
|
79
|
-
external_ids: z.ZodRecord<z.ZodEnum<["ccdata", "coinmarketcap", "coingecko"]>, z.ZodOptional<z.ZodString>>;
|
|
80
|
-
/**
|
|
81
|
-
* Blockchain information for this asset
|
|
82
|
-
*/
|
|
83
|
-
blockchains: z.ZodArray<z.ZodObject<{
|
|
84
|
-
/**
|
|
85
|
-
* Blockchain name
|
|
86
|
-
*/
|
|
87
|
-
blockchain: z.ZodString;
|
|
88
|
-
/**
|
|
89
|
-
* Token address on the blockchain
|
|
90
|
-
*/
|
|
91
|
-
address: z.ZodString;
|
|
92
|
-
/**
|
|
93
|
-
* Number of decimal places
|
|
94
|
-
*/
|
|
95
|
-
decimals: z.ZodNumber;
|
|
96
|
-
/**
|
|
97
|
-
* Whether on-chain metrics are supported
|
|
98
|
-
*/
|
|
99
|
-
on_chain_support: z.ZodBoolean;
|
|
100
|
-
}, "strip", z.ZodTypeAny, {
|
|
101
|
-
address: string;
|
|
102
|
-
blockchain: string;
|
|
103
|
-
decimals: number;
|
|
104
|
-
on_chain_support: boolean;
|
|
105
|
-
}, {
|
|
106
|
-
address: string;
|
|
107
|
-
blockchain: string;
|
|
108
|
-
decimals: number;
|
|
109
|
-
on_chain_support: boolean;
|
|
110
|
-
}>, "many">;
|
|
111
|
-
}, "strip", z.ZodTypeAny, {
|
|
112
|
-
symbol: string;
|
|
113
|
-
name: string;
|
|
114
|
-
id: string;
|
|
115
|
-
asset_type: string;
|
|
116
|
-
external_ids: Partial<Record<"ccdata" | "coinmarketcap" | "coingecko", string | undefined>>;
|
|
117
|
-
blockchains: {
|
|
118
|
-
address: string;
|
|
119
|
-
blockchain: string;
|
|
120
|
-
decimals: number;
|
|
121
|
-
on_chain_support: boolean;
|
|
122
|
-
}[];
|
|
123
|
-
}, {
|
|
124
|
-
symbol: string;
|
|
125
|
-
name: string;
|
|
126
|
-
id: string;
|
|
127
|
-
asset_type: string;
|
|
128
|
-
external_ids: Partial<Record<"ccdata" | "coinmarketcap" | "coingecko", string | undefined>>;
|
|
129
|
-
blockchains: {
|
|
130
|
-
address: string;
|
|
131
|
-
blockchain: string;
|
|
132
|
-
decimals: number;
|
|
133
|
-
on_chain_support: boolean;
|
|
134
|
-
}[];
|
|
135
|
-
}>;
|
|
136
|
-
/**
|
|
137
|
-
* Asset metadata type
|
|
138
|
-
*/
|
|
139
|
-
export type AssetMetadata = z.infer<typeof AssetMetadataSchema>;
|
|
140
|
-
/**
|
|
141
|
-
* Asset metadata response schema
|
|
142
|
-
*/
|
|
143
|
-
export declare const AssetMetadataResponseSchema: z.ZodArray<z.ZodObject<{
|
|
144
|
-
/**
|
|
145
|
-
* Asset identifier
|
|
146
|
-
*/
|
|
147
|
-
id: z.ZodString;
|
|
148
|
-
/**
|
|
149
|
-
* Asset symbol (e.g., "BTC", "ETH")
|
|
150
|
-
*/
|
|
151
|
-
symbol: z.ZodString;
|
|
152
|
-
/**
|
|
153
|
-
* Asset name (e.g., "Bitcoin", "Ethereum")
|
|
154
|
-
*/
|
|
155
|
-
name: z.ZodString;
|
|
156
|
-
/**
|
|
157
|
-
* Type of asset (e.g., "coin", "token")
|
|
158
|
-
*/
|
|
159
|
-
asset_type: z.ZodString;
|
|
160
|
-
/**
|
|
161
|
-
* External identifiers for this asset
|
|
162
|
-
*/
|
|
163
|
-
external_ids: z.ZodRecord<z.ZodEnum<["ccdata", "coinmarketcap", "coingecko"]>, z.ZodOptional<z.ZodString>>;
|
|
164
|
-
/**
|
|
165
|
-
* Blockchain information for this asset
|
|
166
|
-
*/
|
|
167
|
-
blockchains: z.ZodArray<z.ZodObject<{
|
|
168
|
-
/**
|
|
169
|
-
* Blockchain name
|
|
170
|
-
*/
|
|
171
|
-
blockchain: z.ZodString;
|
|
172
|
-
/**
|
|
173
|
-
* Token address on the blockchain
|
|
174
|
-
*/
|
|
175
|
-
address: z.ZodString;
|
|
176
|
-
/**
|
|
177
|
-
* Number of decimal places
|
|
178
|
-
*/
|
|
179
|
-
decimals: z.ZodNumber;
|
|
180
|
-
/**
|
|
181
|
-
* Whether on-chain metrics are supported
|
|
182
|
-
*/
|
|
183
|
-
on_chain_support: z.ZodBoolean;
|
|
184
|
-
}, "strip", z.ZodTypeAny, {
|
|
185
|
-
address: string;
|
|
186
|
-
blockchain: string;
|
|
187
|
-
decimals: number;
|
|
188
|
-
on_chain_support: boolean;
|
|
189
|
-
}, {
|
|
190
|
-
address: string;
|
|
191
|
-
blockchain: string;
|
|
192
|
-
decimals: number;
|
|
193
|
-
on_chain_support: boolean;
|
|
194
|
-
}>, "many">;
|
|
195
|
-
}, "strip", z.ZodTypeAny, {
|
|
196
|
-
symbol: string;
|
|
197
|
-
name: string;
|
|
198
|
-
id: string;
|
|
199
|
-
asset_type: string;
|
|
200
|
-
external_ids: Partial<Record<"ccdata" | "coinmarketcap" | "coingecko", string | undefined>>;
|
|
201
|
-
blockchains: {
|
|
202
|
-
address: string;
|
|
203
|
-
blockchain: string;
|
|
204
|
-
decimals: number;
|
|
205
|
-
on_chain_support: boolean;
|
|
206
|
-
}[];
|
|
207
|
-
}, {
|
|
208
|
-
symbol: string;
|
|
209
|
-
name: string;
|
|
210
|
-
id: string;
|
|
211
|
-
asset_type: string;
|
|
212
|
-
external_ids: Partial<Record<"ccdata" | "coinmarketcap" | "coingecko", string | undefined>>;
|
|
213
|
-
blockchains: {
|
|
214
|
-
address: string;
|
|
215
|
-
blockchain: string;
|
|
216
|
-
decimals: number;
|
|
217
|
-
on_chain_support: boolean;
|
|
218
|
-
}[];
|
|
219
|
-
}>, "many">;
|
|
220
|
-
/**
|
|
221
|
-
* Asset metadata response type
|
|
222
|
-
*/
|
|
223
|
-
export type AssetMetadataResponse = z.infer<typeof AssetMetadataResponseSchema>;
|
|
224
|
-
/**
|
|
225
|
-
* Metric tier schema
|
|
226
|
-
*/
|
|
227
|
-
export declare const MetricTierSchema: z.ZodEnum<["free", "tier1", "tier2", "tier3", "tier4", "tier5"]>;
|
|
228
|
-
/**
|
|
229
|
-
* Metric tier type
|
|
230
|
-
*/
|
|
231
|
-
export type MetricTier = z.infer<typeof MetricTierSchema>;
|
|
232
|
-
/**
|
|
233
|
-
* Metric data type schema
|
|
234
|
-
*/
|
|
235
|
-
export declare const MetricDataTypeSchema: z.ZodEnum<["average", "sum", "count", "percentage", "ratio"]>;
|
|
236
|
-
/**
|
|
237
|
-
* Metric data type
|
|
238
|
-
*/
|
|
239
|
-
export type MetricDataType = z.infer<typeof MetricDataTypeSchema>;
|
|
240
|
-
/**
|
|
241
|
-
* Metric metadata schema
|
|
242
|
-
*/
|
|
243
|
-
export declare const MetricMetadataSchema: z.ZodObject<{
|
|
244
|
-
/**
|
|
245
|
-
* Metric name
|
|
246
|
-
*/
|
|
247
|
-
path: z.ZodString;
|
|
248
|
-
/**
|
|
249
|
-
* Access tier required for this metric
|
|
250
|
-
*/
|
|
251
|
-
tier: z.ZodNumber;
|
|
252
|
-
/**
|
|
253
|
-
* The last date that the metadata was updated
|
|
254
|
-
*/
|
|
255
|
-
modified: z.ZodEffects<z.ZodOptional<z.ZodNumber>, Date | undefined, number | undefined>;
|
|
256
|
-
/**
|
|
257
|
-
* Next parameter for the metric
|
|
258
|
-
*/
|
|
259
|
-
next_param: z.ZodOptional<z.ZodString>;
|
|
260
|
-
/**
|
|
261
|
-
* Available assets for this metric
|
|
262
|
-
*/
|
|
263
|
-
refs: z.ZodObject<{
|
|
264
|
-
docs: z.ZodOptional<z.ZodString>;
|
|
265
|
-
studio: z.ZodOptional<z.ZodString>;
|
|
266
|
-
}, "strip", z.ZodTypeAny, {
|
|
267
|
-
docs?: string | undefined;
|
|
268
|
-
studio?: string | undefined;
|
|
269
|
-
}, {
|
|
270
|
-
docs?: string | undefined;
|
|
271
|
-
studio?: string | undefined;
|
|
272
|
-
}>;
|
|
273
|
-
/**
|
|
274
|
-
* Queried parameters for the metric
|
|
275
|
-
*/
|
|
276
|
-
queried: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
277
|
-
/**
|
|
278
|
-
* List of all allowed parameters and their values for the metric
|
|
279
|
-
*/
|
|
280
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
281
|
-
}, "strip", z.ZodTypeAny, {
|
|
282
|
-
path: string;
|
|
283
|
-
tier: number;
|
|
284
|
-
refs: {
|
|
285
|
-
docs?: string | undefined;
|
|
286
|
-
studio?: string | undefined;
|
|
287
|
-
};
|
|
288
|
-
queried: Record<string, any>;
|
|
289
|
-
parameters: Record<string, string[]>;
|
|
290
|
-
modified?: Date | undefined;
|
|
291
|
-
next_param?: string | undefined;
|
|
292
|
-
}, {
|
|
293
|
-
path: string;
|
|
294
|
-
tier: number;
|
|
295
|
-
refs: {
|
|
296
|
-
docs?: string | undefined;
|
|
297
|
-
studio?: string | undefined;
|
|
298
|
-
};
|
|
299
|
-
queried: Record<string, any>;
|
|
300
|
-
parameters: Record<string, string[]>;
|
|
301
|
-
modified?: number | undefined;
|
|
302
|
-
next_param?: string | undefined;
|
|
303
|
-
}>;
|
|
304
|
-
/**
|
|
305
|
-
* Metric metadata type
|
|
306
|
-
*/
|
|
307
|
-
export type MetricMetadata = z.infer<typeof MetricMetadataSchema>;
|
|
308
|
-
/**
|
|
309
|
-
* Metric metadata response schema
|
|
310
|
-
*/
|
|
311
|
-
export declare const MetricMetadataResponseSchema: z.ZodObject<{
|
|
312
|
-
/**
|
|
313
|
-
* Metric name
|
|
314
|
-
*/
|
|
315
|
-
path: z.ZodString;
|
|
316
|
-
/**
|
|
317
|
-
* Access tier required for this metric
|
|
318
|
-
*/
|
|
319
|
-
tier: z.ZodNumber;
|
|
320
|
-
/**
|
|
321
|
-
* The last date that the metadata was updated
|
|
322
|
-
*/
|
|
323
|
-
modified: z.ZodEffects<z.ZodOptional<z.ZodNumber>, Date | undefined, number | undefined>;
|
|
324
|
-
/**
|
|
325
|
-
* Next parameter for the metric
|
|
326
|
-
*/
|
|
327
|
-
next_param: z.ZodOptional<z.ZodString>;
|
|
328
|
-
/**
|
|
329
|
-
* Available assets for this metric
|
|
330
|
-
*/
|
|
331
|
-
refs: z.ZodObject<{
|
|
332
|
-
docs: z.ZodOptional<z.ZodString>;
|
|
333
|
-
studio: z.ZodOptional<z.ZodString>;
|
|
334
|
-
}, "strip", z.ZodTypeAny, {
|
|
335
|
-
docs?: string | undefined;
|
|
336
|
-
studio?: string | undefined;
|
|
337
|
-
}, {
|
|
338
|
-
docs?: string | undefined;
|
|
339
|
-
studio?: string | undefined;
|
|
340
|
-
}>;
|
|
341
|
-
/**
|
|
342
|
-
* Queried parameters for the metric
|
|
343
|
-
*/
|
|
344
|
-
queried: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
345
|
-
/**
|
|
346
|
-
* List of all allowed parameters and their values for the metric
|
|
347
|
-
*/
|
|
348
|
-
parameters: z.ZodRecord<z.ZodString, z.ZodArray<z.ZodString, "many">>;
|
|
349
|
-
}, "strip", z.ZodTypeAny, {
|
|
350
|
-
path: string;
|
|
351
|
-
tier: number;
|
|
352
|
-
refs: {
|
|
353
|
-
docs?: string | undefined;
|
|
354
|
-
studio?: string | undefined;
|
|
355
|
-
};
|
|
356
|
-
queried: Record<string, any>;
|
|
357
|
-
parameters: Record<string, string[]>;
|
|
358
|
-
modified?: Date | undefined;
|
|
359
|
-
next_param?: string | undefined;
|
|
360
|
-
}, {
|
|
361
|
-
path: string;
|
|
362
|
-
tier: number;
|
|
363
|
-
refs: {
|
|
364
|
-
docs?: string | undefined;
|
|
365
|
-
studio?: string | undefined;
|
|
366
|
-
};
|
|
367
|
-
queried: Record<string, any>;
|
|
368
|
-
parameters: Record<string, string[]>;
|
|
369
|
-
modified?: number | undefined;
|
|
370
|
-
next_param?: string | undefined;
|
|
371
|
-
}>;
|
|
372
|
-
/**
|
|
373
|
-
* Metric list response schema
|
|
374
|
-
*/
|
|
375
|
-
export declare const MetricListResponseSchema: z.ZodArray<z.ZodString, "many">;
|
|
376
|
-
/**
|
|
377
|
-
* Metric metadata response type
|
|
378
|
-
*/
|
|
379
|
-
export type MetricMetadataResponse = z.infer<typeof MetricMetadataResponseSchema>;
|
|
380
|
-
/**
|
|
381
|
-
* Metric list response type
|
|
382
|
-
*/
|
|
383
|
-
export type MetricListResponse = z.infer<typeof MetricListResponseSchema>;
|