@coingecko/coingecko-typescript 2.5.0 → 3.0.0
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/CHANGELOG.md +62 -0
- package/LICENSE +1 -1
- package/README.md +23 -10
- package/client.d.mts +3 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -2
- package/client.d.ts.map +1 -1
- package/client.js +15 -2
- package/client.js.map +1 -1
- package/client.mjs +15 -2
- package/client.mjs.map +1 -1
- package/internal/parse.d.mts.map +1 -1
- package/internal/parse.d.ts.map +1 -1
- package/internal/parse.js +5 -0
- package/internal/parse.js.map +1 -1
- package/internal/parse.mjs +5 -0
- package/internal/parse.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/coins/coins.d.mts +9 -1
- package/resources/coins/coins.d.mts.map +1 -1
- package/resources/coins/coins.d.ts +9 -1
- package/resources/coins/coins.d.ts.map +1 -1
- package/resources/coins/coins.js.map +1 -1
- package/resources/coins/coins.mjs.map +1 -1
- package/resources/coins/contract/contract.d.mts +9 -1
- package/resources/coins/contract/contract.d.mts.map +1 -1
- package/resources/coins/contract/contract.d.ts +9 -1
- package/resources/coins/contract/contract.d.ts.map +1 -1
- package/resources/coins/contract/contract.js.map +1 -1
- package/resources/coins/contract/contract.mjs.map +1 -1
- package/resources/coins/contract/market-chart.d.mts +5 -1
- package/resources/coins/contract/market-chart.d.mts.map +1 -1
- package/resources/coins/contract/market-chart.d.ts +5 -1
- package/resources/coins/contract/market-chart.d.ts.map +1 -1
- package/resources/coins/contract/market-chart.js +5 -1
- package/resources/coins/contract/market-chart.js.map +1 -1
- package/resources/coins/contract/market-chart.mjs +5 -1
- package/resources/coins/contract/market-chart.mjs.map +1 -1
- package/resources/coins/market-chart.d.mts +5 -1
- package/resources/coins/market-chart.d.mts.map +1 -1
- package/resources/coins/market-chart.d.ts +5 -1
- package/resources/coins/market-chart.d.ts.map +1 -1
- package/resources/coins/market-chart.js +5 -1
- package/resources/coins/market-chart.js.map +1 -1
- package/resources/coins/market-chart.mjs +5 -1
- package/resources/coins/market-chart.mjs.map +1 -1
- package/resources/coins/markets.d.mts +9 -0
- package/resources/coins/markets.d.mts.map +1 -1
- package/resources/coins/markets.d.ts +9 -0
- package/resources/coins/markets.d.ts.map +1 -1
- package/resources/coins/tickers.d.mts +1 -1
- package/resources/coins/tickers.d.mts.map +1 -1
- package/resources/coins/tickers.d.ts +1 -1
- package/resources/coins/tickers.d.ts.map +1 -1
- package/resources/exchanges/exchanges.d.mts +3 -3
- package/resources/exchanges/exchanges.d.mts.map +1 -1
- package/resources/exchanges/exchanges.d.ts +3 -3
- package/resources/exchanges/exchanges.d.ts.map +1 -1
- package/resources/exchanges/tickers.d.mts +1 -1
- package/resources/exchanges/tickers.d.mts.map +1 -1
- package/resources/exchanges/tickers.d.ts +1 -1
- package/resources/exchanges/tickers.d.ts.map +1 -1
- package/resources/global/global.d.mts +4 -0
- package/resources/global/global.d.mts.map +1 -1
- package/resources/global/global.d.ts +4 -0
- package/resources/global/global.d.ts.map +1 -1
- package/resources/global/global.js.map +1 -1
- package/resources/global/global.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/key.d.mts +10 -0
- package/resources/key.d.mts.map +1 -1
- package/resources/key.d.ts +10 -0
- package/resources/key.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/pools.d.mts +8 -0
- package/resources/onchain/networks/tokens/pools.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/pools.d.ts +8 -0
- package/resources/onchain/networks/tokens/pools.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/top-holders.d.mts +12 -0
- package/resources/onchain/networks/tokens/top-holders.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/top-holders.d.ts +12 -0
- package/resources/onchain/networks/tokens/top-holders.d.ts.map +1 -1
- package/resources/onchain/pools/megafilter.d.mts +13 -1
- package/resources/onchain/pools/megafilter.d.mts.map +1 -1
- package/resources/onchain/pools/megafilter.d.ts +13 -1
- package/resources/onchain/pools/megafilter.d.ts.map +1 -1
- package/resources/public-treasury.d.mts +185 -35
- package/resources/public-treasury.d.mts.map +1 -1
- package/resources/public-treasury.d.ts +185 -35
- package/resources/public-treasury.d.ts.map +1 -1
- package/resources/public-treasury.js +4 -4
- package/resources/public-treasury.js.map +1 -1
- package/resources/public-treasury.mjs +4 -4
- package/resources/public-treasury.mjs.map +1 -1
- package/src/client.ts +20 -3
- package/src/internal/parse.ts +6 -0
- package/src/resources/coins/coins.ts +11 -1
- package/src/resources/coins/contract/contract.ts +11 -1
- package/src/resources/coins/contract/market-chart.ts +5 -1
- package/src/resources/coins/market-chart.ts +5 -1
- package/src/resources/coins/markets.ts +11 -0
- package/src/resources/coins/tickers.ts +1 -1
- package/src/resources/exchanges/exchanges.ts +3 -3
- package/src/resources/exchanges/tickers.ts +1 -1
- package/src/resources/global/global.ts +5 -0
- package/src/resources/index.ts +1 -0
- package/src/resources/key.ts +12 -0
- package/src/resources/onchain/networks/tokens/pools.ts +12 -0
- package/src/resources/onchain/networks/tokens/top-holders.ts +21 -0
- package/src/resources/onchain/pools/megafilter.ts +19 -0
- package/src/resources/public-treasury.ts +238 -40
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -26,7 +26,7 @@ export declare class PublicTreasury extends APIResource {
|
|
|
26
26
|
* );
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
getEntityID(entityID: string, options?: RequestOptions): APIPromise<PublicTreasuryGetEntityIDResponse>;
|
|
29
|
+
getEntityID(entityID: string, query?: PublicTreasuryGetEntityIDParams | null | undefined, options?: RequestOptions): APIPromise<PublicTreasuryGetEntityIDResponse>;
|
|
30
30
|
/**
|
|
31
31
|
* This endpoint allows you to **query historical cryptocurrency holdings chart of
|
|
32
32
|
* public companies & governments** by Entity ID and Coin ID
|
|
@@ -55,51 +55,101 @@ export declare class PublicTreasury extends APIResource {
|
|
|
55
55
|
*/
|
|
56
56
|
getTransactionHistory(entityID: string, query?: PublicTreasuryGetTransactionHistoryParams | null | undefined, options?: RequestOptions): APIPromise<PublicTreasuryGetTransactionHistoryResponse>;
|
|
57
57
|
}
|
|
58
|
-
export
|
|
59
|
-
companies?: Array<PublicTreasuryGetCoinIDResponse.Company>;
|
|
60
|
-
/**
|
|
61
|
-
* market cap dominance
|
|
62
|
-
*/
|
|
63
|
-
market_cap_dominance?: number;
|
|
64
|
-
/**
|
|
65
|
-
* total crypto holdings of companies or government
|
|
66
|
-
*/
|
|
67
|
-
total_holdings?: number;
|
|
68
|
-
/**
|
|
69
|
-
* total crypto holdings value in usd
|
|
70
|
-
*/
|
|
71
|
-
total_value_usd?: number;
|
|
72
|
-
}
|
|
58
|
+
export type PublicTreasuryGetCoinIDResponse = PublicTreasuryGetCoinIDResponse.CompaniesTreasury | PublicTreasuryGetCoinIDResponse.GovernmentsTreasury;
|
|
73
59
|
export declare namespace PublicTreasuryGetCoinIDResponse {
|
|
74
|
-
interface
|
|
60
|
+
interface CompaniesTreasury {
|
|
61
|
+
companies: Array<CompaniesTreasury.Company>;
|
|
75
62
|
/**
|
|
76
|
-
*
|
|
63
|
+
* market cap dominance
|
|
77
64
|
*/
|
|
78
|
-
|
|
65
|
+
market_cap_dominance: number;
|
|
79
66
|
/**
|
|
80
|
-
*
|
|
67
|
+
* total crypto holdings of companies
|
|
81
68
|
*/
|
|
82
|
-
|
|
69
|
+
total_holdings: number;
|
|
83
70
|
/**
|
|
84
|
-
*
|
|
71
|
+
* total crypto holdings value in usd
|
|
85
72
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
73
|
+
total_value_usd: number;
|
|
74
|
+
}
|
|
75
|
+
namespace CompaniesTreasury {
|
|
76
|
+
interface Company {
|
|
77
|
+
/**
|
|
78
|
+
* company incorporated or government country
|
|
79
|
+
*/
|
|
80
|
+
country?: string;
|
|
81
|
+
/**
|
|
82
|
+
* company or government name
|
|
83
|
+
*/
|
|
84
|
+
name?: string;
|
|
85
|
+
/**
|
|
86
|
+
* percentage of total crypto supply
|
|
87
|
+
*/
|
|
88
|
+
percentage_of_total_supply?: number;
|
|
89
|
+
/**
|
|
90
|
+
* company symbol
|
|
91
|
+
*/
|
|
92
|
+
symbol?: string;
|
|
93
|
+
/**
|
|
94
|
+
* total current value of crypto holdings in usd
|
|
95
|
+
*/
|
|
96
|
+
total_current_value_usd?: number;
|
|
97
|
+
/**
|
|
98
|
+
* total entry value in usd
|
|
99
|
+
*/
|
|
100
|
+
total_entry_value_usd?: number;
|
|
101
|
+
/**
|
|
102
|
+
* total crypto holdings
|
|
103
|
+
*/
|
|
104
|
+
total_holdings?: number;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
interface GovernmentsTreasury {
|
|
108
|
+
governments: Array<GovernmentsTreasury.Government>;
|
|
91
109
|
/**
|
|
92
|
-
*
|
|
110
|
+
* market cap dominance
|
|
93
111
|
*/
|
|
94
|
-
|
|
112
|
+
market_cap_dominance: number;
|
|
95
113
|
/**
|
|
96
|
-
* total
|
|
114
|
+
* total crypto holdings of governments
|
|
97
115
|
*/
|
|
98
|
-
|
|
116
|
+
total_holdings: number;
|
|
99
117
|
/**
|
|
100
|
-
* total crypto holdings
|
|
118
|
+
* total crypto holdings value in usd
|
|
101
119
|
*/
|
|
102
|
-
|
|
120
|
+
total_value_usd: number;
|
|
121
|
+
}
|
|
122
|
+
namespace GovernmentsTreasury {
|
|
123
|
+
interface Government {
|
|
124
|
+
/**
|
|
125
|
+
* company incorporated or government country
|
|
126
|
+
*/
|
|
127
|
+
country?: string;
|
|
128
|
+
/**
|
|
129
|
+
* company or government name
|
|
130
|
+
*/
|
|
131
|
+
name?: string;
|
|
132
|
+
/**
|
|
133
|
+
* percentage of total crypto supply
|
|
134
|
+
*/
|
|
135
|
+
percentage_of_total_supply?: number;
|
|
136
|
+
/**
|
|
137
|
+
* company symbol
|
|
138
|
+
*/
|
|
139
|
+
symbol?: string;
|
|
140
|
+
/**
|
|
141
|
+
* total current value of crypto holdings in usd
|
|
142
|
+
*/
|
|
143
|
+
total_current_value_usd?: number;
|
|
144
|
+
/**
|
|
145
|
+
* total entry value in usd
|
|
146
|
+
*/
|
|
147
|
+
total_entry_value_usd?: number;
|
|
148
|
+
/**
|
|
149
|
+
* total crypto holdings
|
|
150
|
+
*/
|
|
151
|
+
total_holdings?: number;
|
|
152
|
+
}
|
|
103
153
|
}
|
|
104
154
|
}
|
|
105
155
|
export interface PublicTreasuryGetEntityIDResponse {
|
|
@@ -115,6 +165,10 @@ export interface PublicTreasuryGetEntityIDResponse {
|
|
|
115
165
|
* list of cryptocurrency assets held by the entity
|
|
116
166
|
*/
|
|
117
167
|
holdings?: Array<PublicTreasuryGetEntityIDResponse.Holding>;
|
|
168
|
+
/**
|
|
169
|
+
* market to net asset value ratio
|
|
170
|
+
*/
|
|
171
|
+
m_nav?: number;
|
|
118
172
|
/**
|
|
119
173
|
* entity name
|
|
120
174
|
*/
|
|
@@ -123,6 +177,14 @@ export interface PublicTreasuryGetEntityIDResponse {
|
|
|
123
177
|
* stock market symbol for public company
|
|
124
178
|
*/
|
|
125
179
|
symbol?: string;
|
|
180
|
+
/**
|
|
181
|
+
* total asset value per share in USD
|
|
182
|
+
*/
|
|
183
|
+
total_asset_value_per_share_usd?: number;
|
|
184
|
+
/**
|
|
185
|
+
* total current value of all holdings in USD
|
|
186
|
+
*/
|
|
187
|
+
total_treasury_value_usd?: number;
|
|
126
188
|
/**
|
|
127
189
|
* official Twitter handle of the entity
|
|
128
190
|
*/
|
|
@@ -131,6 +193,10 @@ export interface PublicTreasuryGetEntityIDResponse {
|
|
|
131
193
|
* entity type: company or government
|
|
132
194
|
*/
|
|
133
195
|
type?: string;
|
|
196
|
+
/**
|
|
197
|
+
* unrealized profit and loss (current value - total entry value)
|
|
198
|
+
*/
|
|
199
|
+
unrealized_pnl?: number;
|
|
134
200
|
/**
|
|
135
201
|
* official website URL of the entity
|
|
136
202
|
*/
|
|
@@ -142,14 +208,74 @@ export declare namespace PublicTreasuryGetEntityIDResponse {
|
|
|
142
208
|
* amount of the cryptocurrency held
|
|
143
209
|
*/
|
|
144
210
|
amount?: number;
|
|
211
|
+
/**
|
|
212
|
+
* amount of cryptocurrency per share
|
|
213
|
+
*/
|
|
214
|
+
amount_per_share?: number;
|
|
215
|
+
/**
|
|
216
|
+
* average entry cost per unit in USD
|
|
217
|
+
*/
|
|
218
|
+
average_entry_value_usd?: number;
|
|
145
219
|
/**
|
|
146
220
|
* coin ID
|
|
147
221
|
*/
|
|
148
222
|
coin_id?: string;
|
|
223
|
+
/**
|
|
224
|
+
* current value of holdings in USD
|
|
225
|
+
*/
|
|
226
|
+
current_value_usd?: number;
|
|
227
|
+
/**
|
|
228
|
+
* percentage of entity's total treasury value
|
|
229
|
+
*/
|
|
230
|
+
entity_value_usd_percentage?: number;
|
|
231
|
+
/**
|
|
232
|
+
* holding amount changes over different timeframes (only present if
|
|
233
|
+
* holding_amount_change param is used)
|
|
234
|
+
*/
|
|
235
|
+
holding_amount_change?: Holding.HoldingAmountChange;
|
|
236
|
+
/**
|
|
237
|
+
* holding change percentages over different timeframes (only present if
|
|
238
|
+
* holding_change_percentage param is used)
|
|
239
|
+
*/
|
|
240
|
+
holding_change_percentage?: Holding.HoldingChangePercentage;
|
|
149
241
|
/**
|
|
150
242
|
* percentage of total crypto supply
|
|
151
243
|
*/
|
|
152
244
|
percentage_of_total_supply?: number;
|
|
245
|
+
/**
|
|
246
|
+
* total entry cost/purchase value in USD
|
|
247
|
+
*/
|
|
248
|
+
total_entry_value_usd?: number;
|
|
249
|
+
/**
|
|
250
|
+
* unrealized profit and loss for this holding
|
|
251
|
+
*/
|
|
252
|
+
unrealized_pnl?: number;
|
|
253
|
+
}
|
|
254
|
+
namespace Holding {
|
|
255
|
+
/**
|
|
256
|
+
* holding amount changes over different timeframes (only present if
|
|
257
|
+
* holding_amount_change param is used)
|
|
258
|
+
*/
|
|
259
|
+
interface HoldingAmountChange {
|
|
260
|
+
'14d'?: number;
|
|
261
|
+
'1y'?: number;
|
|
262
|
+
'30d'?: number;
|
|
263
|
+
'7d'?: number;
|
|
264
|
+
'90d'?: number;
|
|
265
|
+
ytd?: number;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* holding change percentages over different timeframes (only present if
|
|
269
|
+
* holding_change_percentage param is used)
|
|
270
|
+
*/
|
|
271
|
+
interface HoldingChangePercentage {
|
|
272
|
+
'14d'?: number;
|
|
273
|
+
'1y'?: number;
|
|
274
|
+
'30d'?: number;
|
|
275
|
+
'7d'?: number;
|
|
276
|
+
'90d'?: number;
|
|
277
|
+
ytd?: number;
|
|
278
|
+
}
|
|
153
279
|
}
|
|
154
280
|
}
|
|
155
281
|
export interface PublicTreasuryGetHoldingChartResponse {
|
|
@@ -197,9 +323,33 @@ export declare namespace PublicTreasuryGetTransactionHistoryResponse {
|
|
|
197
323
|
}
|
|
198
324
|
export interface PublicTreasuryGetCoinIDParams {
|
|
199
325
|
/**
|
|
200
|
-
* public company or government entity
|
|
326
|
+
* Path param: public company or government entity
|
|
201
327
|
*/
|
|
202
328
|
entity: 'companies' | 'governments';
|
|
329
|
+
/**
|
|
330
|
+
* Query param: Sort order for results
|
|
331
|
+
*/
|
|
332
|
+
order?: 'total_holdings_usd_desc' | 'total_holdings_usd_asc';
|
|
333
|
+
/**
|
|
334
|
+
* Query param: Page number to return
|
|
335
|
+
*/
|
|
336
|
+
page?: number;
|
|
337
|
+
/**
|
|
338
|
+
* Query param: Number of results to return per page
|
|
339
|
+
*/
|
|
340
|
+
per_page?: number;
|
|
341
|
+
}
|
|
342
|
+
export interface PublicTreasuryGetEntityIDParams {
|
|
343
|
+
/**
|
|
344
|
+
* include holding amount change for specified timeframes, comma-separated if
|
|
345
|
+
* querying more than 1 timeframe Valid values: 7d, 14d, 30d, 90d, 1y, ytd
|
|
346
|
+
*/
|
|
347
|
+
holding_amount_change?: string;
|
|
348
|
+
/**
|
|
349
|
+
* include holding change percentage for specified timeframes, comma-separated if
|
|
350
|
+
* querying more than 1 timeframe Valid values: 7d, 14d, 30d, 90d, 1y, ytd
|
|
351
|
+
*/
|
|
352
|
+
holding_change_percentage?: string;
|
|
203
353
|
}
|
|
204
354
|
export interface PublicTreasuryGetHoldingChartParams {
|
|
205
355
|
/**
|
|
@@ -237,6 +387,6 @@ export interface PublicTreasuryGetTransactionHistoryParams {
|
|
|
237
387
|
per_page?: number;
|
|
238
388
|
}
|
|
239
389
|
export declare namespace PublicTreasury {
|
|
240
|
-
export { type PublicTreasuryGetCoinIDResponse as PublicTreasuryGetCoinIDResponse, type PublicTreasuryGetEntityIDResponse as PublicTreasuryGetEntityIDResponse, type PublicTreasuryGetHoldingChartResponse as PublicTreasuryGetHoldingChartResponse, type PublicTreasuryGetTransactionHistoryResponse as PublicTreasuryGetTransactionHistoryResponse, type PublicTreasuryGetCoinIDParams as PublicTreasuryGetCoinIDParams, type PublicTreasuryGetHoldingChartParams as PublicTreasuryGetHoldingChartParams, type PublicTreasuryGetTransactionHistoryParams as PublicTreasuryGetTransactionHistoryParams, };
|
|
390
|
+
export { type PublicTreasuryGetCoinIDResponse as PublicTreasuryGetCoinIDResponse, type PublicTreasuryGetEntityIDResponse as PublicTreasuryGetEntityIDResponse, type PublicTreasuryGetHoldingChartResponse as PublicTreasuryGetHoldingChartResponse, type PublicTreasuryGetTransactionHistoryResponse as PublicTreasuryGetTransactionHistoryResponse, type PublicTreasuryGetCoinIDParams as PublicTreasuryGetCoinIDParams, type PublicTreasuryGetEntityIDParams as PublicTreasuryGetEntityIDParams, type PublicTreasuryGetHoldingChartParams as PublicTreasuryGetHoldingChartParams, type PublicTreasuryGetTransactionHistoryParams as PublicTreasuryGetTransactionHistoryParams, };
|
|
241
391
|
}
|
|
242
392
|
//# sourceMappingURL=public-treasury.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-treasury.d.ts","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,SAAS,CACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAK9C;;;;;;;;;;OAUG;IACH,WAAW,
|
|
1
|
+
{"version":3,"file":"public-treasury.d.ts","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,SAAS,CACP,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,+BAA+B,CAAC;IAK9C;;;;;;;;;;OAUG;IACH,WAAW,CACT,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,+BAA+B,GAAG,IAAI,GAAG,SAAc,EAC9D,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,iCAAiC,CAAC;IAIhD;;;;;;;;;;;;OAYG;IACH,eAAe,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,mCAAmC,EAC3C,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,qCAAqC,CAAC;IAQpD;;;;;;;;;;;OAWG;IACH,qBAAqB,CACnB,QAAQ,EAAE,MAAM,EAChB,KAAK,GAAE,yCAAyC,GAAG,IAAI,GAAG,SAAc,EACxE,OAAO,CAAC,EAAE,cAAc,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AAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,qCAAqC,IAAI,qCAAqC,EACnF,KAAK,2CAA2C,IAAI,2CAA2C,EAC/F,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,yCAAyC,IAAI,yCAAyC,GAC5F,CAAC;CACH"}
|
|
@@ -18,8 +18,8 @@ class PublicTreasury extends resource_1.APIResource {
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
getCoinID(coinID, params, options) {
|
|
21
|
-
const { entity } = params;
|
|
22
|
-
return this._client.get((0, path_1.path) `/${entity}/public_treasury/${coinID}`, options);
|
|
21
|
+
const { entity, ...query } = params;
|
|
22
|
+
return this._client.get((0, path_1.path) `/${entity}/public_treasury/${coinID}`, { query, ...options });
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* This endpoint allows you **query public companies & governments' cryptocurrency
|
|
@@ -32,8 +32,8 @@ class PublicTreasury extends resource_1.APIResource {
|
|
|
32
32
|
* );
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
|
-
getEntityID(entityID, options) {
|
|
36
|
-
return this._client.get((0, path_1.path) `/public_treasury/${entityID}`, options);
|
|
35
|
+
getEntityID(entityID, query = {}, options) {
|
|
36
|
+
return this._client.get((0, path_1.path) `/public_treasury/${entityID}`, { query, ...options });
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* This endpoint allows you to **query historical cryptocurrency holdings chart of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-treasury.js","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;OAWG;IACH,SAAS,CACP,MAAc,EACd,MAAqC,EACrC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"public-treasury.js","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,oDAA8C;AAE9C,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;OAWG;IACH,SAAS,CACP,MAAc,EACd,MAAqC,EACrC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,IAAI,MAAM,oBAAoB,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7F,CAAC;IAED;;;;;;;;;;OAUG;IACH,WAAW,CACT,QAAgB,EAChB,QAA4D,EAAE,EAC9D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,QAAQ,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrF,CAAC;IAED;;;;;;;;;;;;OAYG;IACH,eAAe,CACb,MAAc,EACd,MAA2C,EAC3C,OAAwB;QAExB,MAAM,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,GAAG,MAAM,CAAC;QACvC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,SAAS,IAAI,MAAM,gBAAgB,EAAE;YACnF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,qBAAqB,CACnB,QAAgB,EAChB,QAAsE,EAAE,EACxE,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,QAAQ,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;CACF;AArFD,wCAqFC"}
|
|
@@ -15,8 +15,8 @@ export class PublicTreasury extends APIResource {
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
getCoinID(coinID, params, options) {
|
|
18
|
-
const { entity } = params;
|
|
19
|
-
return this._client.get(path `/${entity}/public_treasury/${coinID}`, options);
|
|
18
|
+
const { entity, ...query } = params;
|
|
19
|
+
return this._client.get(path `/${entity}/public_treasury/${coinID}`, { query, ...options });
|
|
20
20
|
}
|
|
21
21
|
/**
|
|
22
22
|
* This endpoint allows you **query public companies & governments' cryptocurrency
|
|
@@ -29,8 +29,8 @@ export class PublicTreasury extends APIResource {
|
|
|
29
29
|
* );
|
|
30
30
|
* ```
|
|
31
31
|
*/
|
|
32
|
-
getEntityID(entityID, options) {
|
|
33
|
-
return this._client.get(path `/public_treasury/${entityID}`, options);
|
|
32
|
+
getEntityID(entityID, query = {}, options) {
|
|
33
|
+
return this._client.get(path `/public_treasury/${entityID}`, { query, ...options });
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
36
|
* This endpoint allows you to **query historical cryptocurrency holdings chart of
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public-treasury.mjs","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;OAWG;IACH,SAAS,CACP,MAAc,EACd,MAAqC,EACrC,OAAwB;QAExB,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"public-treasury.mjs","sourceRoot":"","sources":["../src/resources/public-treasury.ts"],"names":[],"mappings":"AAAA,s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30
|
PublicTreasuryGetCoinIDParams,
|
|
31
31
|
PublicTreasuryGetCoinIDResponse,
|
|
32
|
+
PublicTreasuryGetEntityIDParams,
|
|
32
33
|
PublicTreasuryGetEntityIDResponse,
|
|
33
34
|
PublicTreasuryGetHoldingChartParams,
|
|
34
35
|
PublicTreasuryGetHoldingChartResponse,
|
|
@@ -549,7 +550,7 @@ export class Coingecko {
|
|
|
549
550
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
550
551
|
|
|
551
552
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
552
|
-
const errJSON = safeJSON(errText);
|
|
553
|
+
const errJSON = safeJSON(errText) as any;
|
|
553
554
|
const errMessage = errJSON ? undefined : errText;
|
|
554
555
|
|
|
555
556
|
loggerFor(this).debug(
|
|
@@ -590,9 +591,10 @@ export class Coingecko {
|
|
|
590
591
|
controller: AbortController,
|
|
591
592
|
): Promise<Response> {
|
|
592
593
|
const { signal, method, ...options } = init || {};
|
|
593
|
-
|
|
594
|
+
const abort = this._makeAbort(controller);
|
|
595
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
594
596
|
|
|
595
|
-
const timeout = setTimeout(
|
|
597
|
+
const timeout = setTimeout(abort, ms);
|
|
596
598
|
|
|
597
599
|
const isReadableBody =
|
|
598
600
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -759,6 +761,12 @@ export class Coingecko {
|
|
|
759
761
|
return headers.values;
|
|
760
762
|
}
|
|
761
763
|
|
|
764
|
+
private _makeAbort(controller: AbortController) {
|
|
765
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
766
|
+
// would capture all request options, and cause a memory leak.
|
|
767
|
+
return () => controller.abort();
|
|
768
|
+
}
|
|
769
|
+
|
|
762
770
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
763
771
|
bodyHeaders: HeadersLike;
|
|
764
772
|
body: BodyInit | undefined;
|
|
@@ -791,6 +799,14 @@ export class Coingecko {
|
|
|
791
799
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
792
800
|
) {
|
|
793
801
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
802
|
+
} else if (
|
|
803
|
+
typeof body === 'object' &&
|
|
804
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
805
|
+
) {
|
|
806
|
+
return {
|
|
807
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
808
|
+
body: this.stringifyQuery(body as Record<string, unknown>),
|
|
809
|
+
};
|
|
794
810
|
} else {
|
|
795
811
|
return this.#encoder({ body, headers });
|
|
796
812
|
}
|
|
@@ -907,6 +923,7 @@ export declare namespace Coingecko {
|
|
|
907
923
|
type PublicTreasuryGetHoldingChartResponse as PublicTreasuryGetHoldingChartResponse,
|
|
908
924
|
type PublicTreasuryGetTransactionHistoryResponse as PublicTreasuryGetTransactionHistoryResponse,
|
|
909
925
|
type PublicTreasuryGetCoinIDParams as PublicTreasuryGetCoinIDParams,
|
|
926
|
+
type PublicTreasuryGetEntityIDParams as PublicTreasuryGetEntityIDParams,
|
|
910
927
|
type PublicTreasuryGetHoldingChartParams as PublicTreasuryGetHoldingChartParams,
|
|
911
928
|
type PublicTreasuryGetTransactionHistoryParams as PublicTreasuryGetTransactionHistoryParams,
|
|
912
929
|
};
|
package/src/internal/parse.ts
CHANGED
|
@@ -29,6 +29,12 @@ export async function defaultParseResponse<T>(client: Coingecko, props: APIRespo
|
|
|
29
29
|
const mediaType = contentType?.split(';')[0]?.trim();
|
|
30
30
|
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
|
|
31
31
|
if (isJSON) {
|
|
32
|
+
const contentLength = response.headers.get('content-length');
|
|
33
|
+
if (contentLength === '0') {
|
|
34
|
+
// if there is no content we can't do anything
|
|
35
|
+
return undefined as T;
|
|
36
|
+
}
|
|
37
|
+
|
|
32
38
|
const json = await response.json();
|
|
33
39
|
return json as T;
|
|
34
40
|
}
|
|
@@ -179,6 +179,11 @@ export interface CoinGetIDResponse {
|
|
|
179
179
|
*/
|
|
180
180
|
market_cap_rank?: number;
|
|
181
181
|
|
|
182
|
+
/**
|
|
183
|
+
* coin rank by market cap including rehypothecated tokens
|
|
184
|
+
*/
|
|
185
|
+
market_cap_rank_with_rehypothecated?: number;
|
|
186
|
+
|
|
182
187
|
/**
|
|
183
188
|
* coin market data
|
|
184
189
|
*/
|
|
@@ -723,6 +728,11 @@ export namespace CoinGetIDResponse {
|
|
|
723
728
|
*/
|
|
724
729
|
market_cap_rank?: number;
|
|
725
730
|
|
|
731
|
+
/**
|
|
732
|
+
* coin rank by market cap including rehypothecated tokens
|
|
733
|
+
*/
|
|
734
|
+
market_cap_rank_with_rehypothecated?: number;
|
|
735
|
+
|
|
726
736
|
/**
|
|
727
737
|
* coin max supply
|
|
728
738
|
*/
|
|
@@ -1162,7 +1172,7 @@ export namespace CoinGetIDResponse {
|
|
|
1162
1172
|
/**
|
|
1163
1173
|
* coin ticker trust score
|
|
1164
1174
|
*/
|
|
1165
|
-
trust_score?: string;
|
|
1175
|
+
trust_score?: string | null;
|
|
1166
1176
|
|
|
1167
1177
|
/**
|
|
1168
1178
|
* coin ticker volume
|
|
@@ -126,6 +126,11 @@ export interface ContractGetResponse {
|
|
|
126
126
|
*/
|
|
127
127
|
market_cap_rank?: number;
|
|
128
128
|
|
|
129
|
+
/**
|
|
130
|
+
* coin rank by market cap including rehypothecated tokens
|
|
131
|
+
*/
|
|
132
|
+
market_cap_rank_with_rehypothecated?: number;
|
|
133
|
+
|
|
129
134
|
/**
|
|
130
135
|
* coin market data
|
|
131
136
|
*/
|
|
@@ -503,6 +508,11 @@ export namespace ContractGetResponse {
|
|
|
503
508
|
*/
|
|
504
509
|
market_cap_rank?: number;
|
|
505
510
|
|
|
511
|
+
/**
|
|
512
|
+
* coin rank by market cap including rehypothecated tokens
|
|
513
|
+
*/
|
|
514
|
+
market_cap_rank_with_rehypothecated?: number;
|
|
515
|
+
|
|
506
516
|
/**
|
|
507
517
|
* coin max supply
|
|
508
518
|
*/
|
|
@@ -942,7 +952,7 @@ export namespace ContractGetResponse {
|
|
|
942
952
|
/**
|
|
943
953
|
* coin ticker trust score
|
|
944
954
|
*/
|
|
945
|
-
trust_score?: string;
|
|
955
|
+
trust_score?: string | null;
|
|
946
956
|
|
|
947
957
|
/**
|
|
948
958
|
* coin ticker volume
|
|
@@ -16,7 +16,11 @@ export class MarketChart extends APIResource {
|
|
|
16
16
|
* const marketChart =
|
|
17
17
|
* await client.coins.contract.marketChart.get(
|
|
18
18
|
* '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
19
|
-
* {
|
|
19
|
+
* {
|
|
20
|
+
* id: 'ethereum',
|
|
21
|
+
* days: 'days',
|
|
22
|
+
* vs_currency: 'usd',
|
|
23
|
+
* },
|
|
20
24
|
* );
|
|
21
25
|
* ```
|
|
22
26
|
*/
|
|
@@ -31,7 +31,11 @@ export class MarketChart extends APIResource {
|
|
|
31
31
|
* ```ts
|
|
32
32
|
* const response = await client.coins.marketChart.getRange(
|
|
33
33
|
* 'bitcoin',
|
|
34
|
-
* {
|
|
34
|
+
* {
|
|
35
|
+
* from: 'from',
|
|
36
|
+
* to: 'to',
|
|
37
|
+
* vs_currency: 'usd',
|
|
38
|
+
* },
|
|
35
39
|
* );
|
|
36
40
|
* ```
|
|
37
41
|
*/
|
|
@@ -115,6 +115,11 @@ export namespace MarketGetResponse {
|
|
|
115
115
|
*/
|
|
116
116
|
market_cap_rank?: number | null;
|
|
117
117
|
|
|
118
|
+
/**
|
|
119
|
+
* coin rank by market cap including rehypothecated tokens
|
|
120
|
+
*/
|
|
121
|
+
market_cap_rank_with_rehypothecated?: number | null;
|
|
122
|
+
|
|
118
123
|
/**
|
|
119
124
|
* coin max supply
|
|
120
125
|
*/
|
|
@@ -198,6 +203,12 @@ export interface MarketGetParams {
|
|
|
198
203
|
*/
|
|
199
204
|
ids?: string;
|
|
200
205
|
|
|
206
|
+
/**
|
|
207
|
+
* include rehypothecated tokens in results, default: false When true, returns
|
|
208
|
+
* `market_cap_rank_with_rehypothecated` field
|
|
209
|
+
*/
|
|
210
|
+
include_rehypothecated?: boolean;
|
|
211
|
+
|
|
201
212
|
/**
|
|
202
213
|
* for `symbols` lookups, specify `all` to include all matching tokens Default
|
|
203
214
|
* `top` returns top-ranked tokens (by market cap or volume)
|
|
@@ -91,7 +91,7 @@ export interface ExchangeGetResponse {
|
|
|
91
91
|
has_trading_incentive?: boolean;
|
|
92
92
|
|
|
93
93
|
/**
|
|
94
|
-
* exchange image
|
|
94
|
+
* exchange image URL
|
|
95
95
|
*/
|
|
96
96
|
image?: string;
|
|
97
97
|
|
|
@@ -116,7 +116,7 @@ export interface ExchangeGetResponse {
|
|
|
116
116
|
trust_score_rank?: number;
|
|
117
117
|
|
|
118
118
|
/**
|
|
119
|
-
* exchange website
|
|
119
|
+
* exchange website URL
|
|
120
120
|
*/
|
|
121
121
|
url?: string;
|
|
122
122
|
|
|
@@ -339,7 +339,7 @@ export namespace ExchangeGetIDResponse {
|
|
|
339
339
|
/**
|
|
340
340
|
* coin ticker trust score
|
|
341
341
|
*/
|
|
342
|
-
trust_score?: string;
|
|
342
|
+
trust_score?: string | null;
|
|
343
343
|
|
|
344
344
|
/**
|
|
345
345
|
* coin ticker volume
|
|
@@ -79,6 +79,11 @@ export namespace GlobalGetResponse {
|
|
|
79
79
|
upcoming_icos?: number;
|
|
80
80
|
|
|
81
81
|
updated_at?: number;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* cryptocurrencies volume change percentage in 24 hours in usd
|
|
85
|
+
*/
|
|
86
|
+
volume_change_percentage_24h_usd?: number;
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
export namespace Data {
|
package/src/resources/index.ts
CHANGED
|
@@ -37,6 +37,7 @@ export {
|
|
|
37
37
|
type PublicTreasuryGetHoldingChartResponse,
|
|
38
38
|
type PublicTreasuryGetTransactionHistoryResponse,
|
|
39
39
|
type PublicTreasuryGetCoinIDParams,
|
|
40
|
+
type PublicTreasuryGetEntityIDParams,
|
|
40
41
|
type PublicTreasuryGetHoldingChartParams,
|
|
41
42
|
type PublicTreasuryGetTransactionHistoryParams,
|
|
42
43
|
} from './public-treasury';
|
package/src/resources/key.ts
CHANGED
|
@@ -20,6 +20,18 @@ export class Key extends APIResource {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface KeyGetResponse {
|
|
23
|
+
/**
|
|
24
|
+
* Specific monthly credit limit configured for the API key used to authenticate
|
|
25
|
+
* this request
|
|
26
|
+
*/
|
|
27
|
+
api_key_monthly_call_credit?: number;
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Specific request per minute configured for the API key used to authenticate this
|
|
31
|
+
* request
|
|
32
|
+
*/
|
|
33
|
+
api_key_rate_limit_request_per_minute?: number;
|
|
34
|
+
|
|
23
35
|
current_remaining_monthly_calls?: number;
|
|
24
36
|
|
|
25
37
|
current_total_monthly_calls?: number;
|