@coingecko/coingecko-typescript 2.5.0 → 3.1.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 +93 -0
- package/LICENSE +1 -1
- package/README.md +23 -10
- package/client.d.mts +4 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +4 -3
- package/client.d.ts.map +1 -1
- package/client.js +23 -19
- package/client.js.map +1 -1
- package/client.mjs +23 -19
- 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/internal/utils/query.d.mts +5 -0
- package/internal/utils/query.d.mts.map +1 -0
- package/internal/utils/query.d.ts +5 -0
- package/internal/utils/query.d.ts.map +1 -0
- package/internal/utils/query.js +23 -0
- package/internal/utils/query.js.map +1 -0
- package/internal/utils/query.mjs +20 -0
- package/internal/utils/query.mjs.map +1 -0
- package/internal/utils.d.mts +1 -0
- package/internal/utils.d.ts +1 -0
- package/internal/utils.js +1 -0
- package/internal/utils.js.map +1 -1
- package/internal/utils.mjs +1 -0
- package/package.json +12 -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 +30 -24
- package/src/internal/parse.ts +6 -0
- package/src/internal/utils/query.ts +23 -0
- package/src/internal/utils.ts +1 -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
|
@@ -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,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,KAAK,EAAE,GAAG,MAAM,CAAC;QACpC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,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,IAAI,CAAA,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,IAAI,CAAA,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,IAAI,CAAA,oBAAoB,QAAQ,sBAAsB,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACzG,CAAC;CACF"}
|
package/src/client.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { APIResponseProps } from './internal/parse';
|
|
|
11
11
|
import { getPlatformHeaders } from './internal/detect-platform';
|
|
12
12
|
import * as Shims from './internal/shims';
|
|
13
13
|
import * as Opts from './internal/request-options';
|
|
14
|
+
import { stringifyQuery } from './internal/utils/query';
|
|
14
15
|
import { VERSION } from './version';
|
|
15
16
|
import * as Errors from './core/error';
|
|
16
17
|
import * as Uploads from './core/uploads';
|
|
@@ -29,6 +30,7 @@ import {
|
|
|
29
30
|
PublicTreasury,
|
|
30
31
|
PublicTreasuryGetCoinIDParams,
|
|
31
32
|
PublicTreasuryGetCoinIDResponse,
|
|
33
|
+
PublicTreasuryGetEntityIDParams,
|
|
32
34
|
PublicTreasuryGetEntityIDResponse,
|
|
33
35
|
PublicTreasuryGetHoldingChartParams,
|
|
34
36
|
PublicTreasuryGetHoldingChartResponse,
|
|
@@ -314,21 +316,8 @@ export class Coingecko {
|
|
|
314
316
|
/**
|
|
315
317
|
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
316
318
|
*/
|
|
317
|
-
protected stringifyQuery(query: Record<string, unknown>): string {
|
|
318
|
-
return
|
|
319
|
-
.filter(([_, value]) => typeof value !== 'undefined')
|
|
320
|
-
.map(([key, value]) => {
|
|
321
|
-
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
322
|
-
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
323
|
-
}
|
|
324
|
-
if (value === null) {
|
|
325
|
-
return `${encodeURIComponent(key)}=`;
|
|
326
|
-
}
|
|
327
|
-
throw new Errors.CoingeckoError(
|
|
328
|
-
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
329
|
-
);
|
|
330
|
-
})
|
|
331
|
-
.join('&');
|
|
319
|
+
protected stringifyQuery(query: object | Record<string, unknown>): string {
|
|
320
|
+
return stringifyQuery(query);
|
|
332
321
|
}
|
|
333
322
|
|
|
334
323
|
private getUserAgent(): string {
|
|
@@ -360,12 +349,13 @@ export class Coingecko {
|
|
|
360
349
|
: new URL(baseURL + (baseURL.endsWith('/') && path.startsWith('/') ? path.slice(1) : path));
|
|
361
350
|
|
|
362
351
|
const defaultQuery = this.defaultQuery();
|
|
363
|
-
|
|
364
|
-
|
|
352
|
+
const pathQuery = Object.fromEntries(url.searchParams);
|
|
353
|
+
if (!isEmptyObj(defaultQuery) || !isEmptyObj(pathQuery)) {
|
|
354
|
+
query = { ...pathQuery, ...defaultQuery, ...query };
|
|
365
355
|
}
|
|
366
356
|
|
|
367
357
|
if (typeof query === 'object' && query && !Array.isArray(query)) {
|
|
368
|
-
url.search = this.stringifyQuery(query
|
|
358
|
+
url.search = this.stringifyQuery(query);
|
|
369
359
|
}
|
|
370
360
|
|
|
371
361
|
return url.toString();
|
|
@@ -549,7 +539,7 @@ export class Coingecko {
|
|
|
549
539
|
loggerFor(this).info(`${responseInfo} - ${retryMessage}`);
|
|
550
540
|
|
|
551
541
|
const errText = await response.text().catch((err: any) => castToError(err).message);
|
|
552
|
-
const errJSON = safeJSON(errText);
|
|
542
|
+
const errJSON = safeJSON(errText) as any;
|
|
553
543
|
const errMessage = errJSON ? undefined : errText;
|
|
554
544
|
|
|
555
545
|
loggerFor(this).debug(
|
|
@@ -590,9 +580,10 @@ export class Coingecko {
|
|
|
590
580
|
controller: AbortController,
|
|
591
581
|
): Promise<Response> {
|
|
592
582
|
const { signal, method, ...options } = init || {};
|
|
593
|
-
|
|
583
|
+
const abort = this._makeAbort(controller);
|
|
584
|
+
if (signal) signal.addEventListener('abort', abort, { once: true });
|
|
594
585
|
|
|
595
|
-
const timeout = setTimeout(
|
|
586
|
+
const timeout = setTimeout(abort, ms);
|
|
596
587
|
|
|
597
588
|
const isReadableBody =
|
|
598
589
|
((globalThis as any).ReadableStream && options.body instanceof (globalThis as any).ReadableStream) ||
|
|
@@ -669,9 +660,9 @@ export class Coingecko {
|
|
|
669
660
|
}
|
|
670
661
|
}
|
|
671
662
|
|
|
672
|
-
// If the API asks us to wait a certain amount of time
|
|
673
|
-
//
|
|
674
|
-
if (
|
|
663
|
+
// If the API asks us to wait a certain amount of time, just do what it
|
|
664
|
+
// says, but otherwise calculate a default
|
|
665
|
+
if (timeoutMillis === undefined) {
|
|
675
666
|
const maxRetries = options.maxRetries ?? this.maxRetries;
|
|
676
667
|
timeoutMillis = this.calculateDefaultRetryTimeoutMillis(retriesRemaining, maxRetries);
|
|
677
668
|
}
|
|
@@ -759,6 +750,12 @@ export class Coingecko {
|
|
|
759
750
|
return headers.values;
|
|
760
751
|
}
|
|
761
752
|
|
|
753
|
+
private _makeAbort(controller: AbortController) {
|
|
754
|
+
// note: we can't just inline this method inside `fetchWithTimeout()` because then the closure
|
|
755
|
+
// would capture all request options, and cause a memory leak.
|
|
756
|
+
return () => controller.abort();
|
|
757
|
+
}
|
|
758
|
+
|
|
762
759
|
private buildBody({ options: { body, headers: rawHeaders } }: { options: FinalRequestOptions }): {
|
|
763
760
|
bodyHeaders: HeadersLike;
|
|
764
761
|
body: BodyInit | undefined;
|
|
@@ -791,6 +788,14 @@ export class Coingecko {
|
|
|
791
788
|
(Symbol.iterator in body && 'next' in body && typeof body.next === 'function'))
|
|
792
789
|
) {
|
|
793
790
|
return { bodyHeaders: undefined, body: Shims.ReadableStreamFrom(body as AsyncIterable<Uint8Array>) };
|
|
791
|
+
} else if (
|
|
792
|
+
typeof body === 'object' &&
|
|
793
|
+
headers.values.get('content-type') === 'application/x-www-form-urlencoded'
|
|
794
|
+
) {
|
|
795
|
+
return {
|
|
796
|
+
bodyHeaders: { 'content-type': 'application/x-www-form-urlencoded' },
|
|
797
|
+
body: this.stringifyQuery(body),
|
|
798
|
+
};
|
|
794
799
|
} else {
|
|
795
800
|
return this.#encoder({ body, headers });
|
|
796
801
|
}
|
|
@@ -907,6 +912,7 @@ export declare namespace Coingecko {
|
|
|
907
912
|
type PublicTreasuryGetHoldingChartResponse as PublicTreasuryGetHoldingChartResponse,
|
|
908
913
|
type PublicTreasuryGetTransactionHistoryResponse as PublicTreasuryGetTransactionHistoryResponse,
|
|
909
914
|
type PublicTreasuryGetCoinIDParams as PublicTreasuryGetCoinIDParams,
|
|
915
|
+
type PublicTreasuryGetEntityIDParams as PublicTreasuryGetEntityIDParams,
|
|
910
916
|
type PublicTreasuryGetHoldingChartParams as PublicTreasuryGetHoldingChartParams,
|
|
911
917
|
type PublicTreasuryGetTransactionHistoryParams as PublicTreasuryGetTransactionHistoryParams,
|
|
912
918
|
};
|
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
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { CoingeckoError } from '../../core/error';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Basic re-implementation of `qs.stringify` for primitive types.
|
|
7
|
+
*/
|
|
8
|
+
export function stringifyQuery(query: object | Record<string, unknown>) {
|
|
9
|
+
return Object.entries(query)
|
|
10
|
+
.filter(([_, value]) => typeof value !== 'undefined')
|
|
11
|
+
.map(([key, value]) => {
|
|
12
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
13
|
+
return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
|
|
14
|
+
}
|
|
15
|
+
if (value === null) {
|
|
16
|
+
return `${encodeURIComponent(key)}=`;
|
|
17
|
+
}
|
|
18
|
+
throw new CoingeckoError(
|
|
19
|
+
`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`,
|
|
20
|
+
);
|
|
21
|
+
})
|
|
22
|
+
.join('&');
|
|
23
|
+
}
|
package/src/internal/utils.ts
CHANGED
|
@@ -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;
|
|
@@ -54,6 +54,8 @@ export namespace PoolGetResponse {
|
|
|
54
54
|
|
|
55
55
|
base_token_price_usd?: string;
|
|
56
56
|
|
|
57
|
+
community_sus_report?: number;
|
|
58
|
+
|
|
57
59
|
fdv_usd?: string;
|
|
58
60
|
|
|
59
61
|
last_trade_timestamp?: number;
|
|
@@ -74,6 +76,10 @@ export namespace PoolGetResponse {
|
|
|
74
76
|
|
|
75
77
|
reserve_in_usd?: string;
|
|
76
78
|
|
|
79
|
+
sentiment_vote_negative_percentage?: number;
|
|
80
|
+
|
|
81
|
+
sentiment_vote_positive_percentage?: number;
|
|
82
|
+
|
|
77
83
|
transactions?: Attributes.Transactions;
|
|
78
84
|
|
|
79
85
|
volume_usd?: Attributes.VolumeUsd;
|
|
@@ -257,6 +263,12 @@ export interface PoolGetParams {
|
|
|
257
263
|
*/
|
|
258
264
|
include?: string;
|
|
259
265
|
|
|
266
|
+
/**
|
|
267
|
+
* Query param: include GeckoTerminal community data (Sentiment votes, Suspicious
|
|
268
|
+
* reports) Default value: false
|
|
269
|
+
*/
|
|
270
|
+
include_gt_community_data?: boolean;
|
|
271
|
+
|
|
260
272
|
/**
|
|
261
273
|
* Query param: include tokens from inactive pools using the most recent swap,
|
|
262
274
|
* default: false
|
|
@@ -58,12 +58,28 @@ export namespace TopHolderGetResponse {
|
|
|
58
58
|
|
|
59
59
|
amount?: string;
|
|
60
60
|
|
|
61
|
+
average_buy_price_usd?: string;
|
|
62
|
+
|
|
63
|
+
explorer_url?: string;
|
|
64
|
+
|
|
61
65
|
label?: string;
|
|
62
66
|
|
|
63
67
|
percentage?: string;
|
|
64
68
|
|
|
65
69
|
rank?: number;
|
|
66
70
|
|
|
71
|
+
realized_pnl_percentage?: string;
|
|
72
|
+
|
|
73
|
+
realized_pnl_usd?: string;
|
|
74
|
+
|
|
75
|
+
total_buy_count?: number;
|
|
76
|
+
|
|
77
|
+
total_sell_count?: number;
|
|
78
|
+
|
|
79
|
+
unrealized_pnl_percentage?: string;
|
|
80
|
+
|
|
81
|
+
unrealized_pnl_usd?: string;
|
|
82
|
+
|
|
67
83
|
value?: string;
|
|
68
84
|
}
|
|
69
85
|
}
|
|
@@ -81,6 +97,11 @@ export interface TopHolderGetParams {
|
|
|
81
97
|
* `max` Default value: 10
|
|
82
98
|
*/
|
|
83
99
|
holders?: string;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Query param: include PnL details for token holders, default: false
|
|
103
|
+
*/
|
|
104
|
+
include_pnl_details?: boolean;
|
|
84
105
|
}
|
|
85
106
|
|
|
86
107
|
export declare namespace TopHolders {
|
|
@@ -330,6 +330,21 @@ export interface MegafilterGetParams {
|
|
|
330
330
|
*/
|
|
331
331
|
pool_created_hour_min?: number;
|
|
332
332
|
|
|
333
|
+
/**
|
|
334
|
+
* duration for price change percentage metric
|
|
335
|
+
*/
|
|
336
|
+
price_change_percentage_duration?: '5m' | '1h' | '6h' | '24h';
|
|
337
|
+
|
|
338
|
+
/**
|
|
339
|
+
* maximum price change percentage
|
|
340
|
+
*/
|
|
341
|
+
price_change_percentage_max?: number;
|
|
342
|
+
|
|
343
|
+
/**
|
|
344
|
+
* minimum price change percentage
|
|
345
|
+
*/
|
|
346
|
+
price_change_percentage_min?: number;
|
|
347
|
+
|
|
333
348
|
/**
|
|
334
349
|
* maximum reserve in USD
|
|
335
350
|
*/
|
|
@@ -374,7 +389,9 @@ export interface MegafilterGetParams {
|
|
|
374
389
|
| 'h6_trending'
|
|
375
390
|
| 'h24_trending'
|
|
376
391
|
| 'h24_tx_count_desc'
|
|
392
|
+
| 'h24_tx_count_asc'
|
|
377
393
|
| 'h24_volume_usd_desc'
|
|
394
|
+
| 'h24_volume_usd_asc'
|
|
378
395
|
| 'm5_price_change_percentage_asc'
|
|
379
396
|
| 'h1_price_change_percentage_asc'
|
|
380
397
|
| 'h6_price_change_percentage_asc'
|
|
@@ -387,6 +404,8 @@ export interface MegafilterGetParams {
|
|
|
387
404
|
| 'fdv_usd_desc'
|
|
388
405
|
| 'reserve_in_usd_asc'
|
|
389
406
|
| 'reserve_in_usd_desc'
|
|
407
|
+
| 'price_asc'
|
|
408
|
+
| 'price_desc'
|
|
390
409
|
| 'pool_created_at_desc';
|
|
391
410
|
|
|
392
411
|
/**
|