@coingecko/coingecko-typescript 1.13.0 → 1.15.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 +41 -0
- package/client.d.mts +6 -3
- package/client.d.mts.map +1 -1
- package/client.d.ts +6 -3
- package/client.d.ts.map +1 -1
- package/client.js +6 -3
- package/client.js.map +1 -1
- package/client.mjs +6 -3
- package/client.mjs.map +1 -1
- package/internal/utils/values.js +3 -3
- package/internal/utils/values.js.map +1 -1
- package/internal/utils/values.mjs +3 -3
- package/internal/utils/values.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/coins/circulating-supply-chart.d.mts +7 -5
- package/resources/coins/circulating-supply-chart.d.mts.map +1 -1
- package/resources/coins/circulating-supply-chart.d.ts +7 -5
- package/resources/coins/circulating-supply-chart.d.ts.map +1 -1
- package/resources/coins/circulating-supply-chart.js +1 -1
- package/resources/coins/circulating-supply-chart.mjs +1 -1
- package/resources/coins/contract/market-chart.d.mts +13 -5
- package/resources/coins/contract/market-chart.d.mts.map +1 -1
- package/resources/coins/contract/market-chart.d.ts +13 -5
- package/resources/coins/contract/market-chart.d.ts.map +1 -1
- package/resources/coins/contract/market-chart.js +6 -1
- package/resources/coins/contract/market-chart.js.map +1 -1
- package/resources/coins/contract/market-chart.mjs +6 -1
- package/resources/coins/contract/market-chart.mjs.map +1 -1
- package/resources/coins/history.d.mts +2 -2
- package/resources/coins/history.d.ts +2 -2
- package/resources/coins/history.js +1 -1
- package/resources/coins/history.mjs +1 -1
- package/resources/coins/market-chart.d.mts +7 -5
- package/resources/coins/market-chart.d.mts.map +1 -1
- package/resources/coins/market-chart.d.ts +7 -5
- package/resources/coins/market-chart.d.ts.map +1 -1
- package/resources/coins/market-chart.js +1 -1
- package/resources/coins/market-chart.mjs +1 -1
- package/resources/coins/markets.d.mts +1 -1
- package/resources/coins/markets.d.ts +1 -1
- package/resources/coins/ohlc.d.mts +12 -5
- package/resources/coins/ohlc.d.mts.map +1 -1
- package/resources/coins/ohlc.d.ts +12 -5
- package/resources/coins/ohlc.d.ts.map +1 -1
- package/resources/coins/ohlc.js +6 -1
- package/resources/coins/ohlc.js.map +1 -1
- package/resources/coins/ohlc.mjs +6 -1
- package/resources/coins/ohlc.mjs.map +1 -1
- package/resources/coins/top-gainers-losers.d.mts +95 -5
- package/resources/coins/top-gainers-losers.d.mts.map +1 -1
- package/resources/coins/top-gainers-losers.d.ts +95 -5
- package/resources/coins/top-gainers-losers.d.ts.map +1 -1
- package/resources/coins/top-gainers-losers.js +1 -1
- package/resources/coins/top-gainers-losers.mjs +1 -1
- package/resources/coins/total-supply-chart.d.mts +8 -6
- package/resources/coins/total-supply-chart.d.mts.map +1 -1
- package/resources/coins/total-supply-chart.d.ts +8 -6
- package/resources/coins/total-supply-chart.d.ts.map +1 -1
- package/resources/coins/total-supply-chart.js +2 -2
- package/resources/coins/total-supply-chart.mjs +2 -2
- package/resources/derivatives/exchanges.d.mts +2 -2
- package/resources/derivatives/exchanges.d.ts +2 -2
- package/resources/derivatives/exchanges.js +2 -2
- package/resources/derivatives/exchanges.mjs +2 -2
- package/resources/entities.d.mts +54 -0
- package/resources/entities.d.mts.map +1 -0
- package/resources/entities.d.ts +54 -0
- package/resources/entities.d.ts.map +1 -0
- package/resources/entities.js +21 -0
- package/resources/entities.js.map +1 -0
- package/resources/entities.mjs +17 -0
- package/resources/entities.mjs.map +1 -0
- package/resources/exchanges/exchanges.d.mts +3 -3
- package/resources/exchanges/exchanges.d.ts +3 -3
- package/resources/exchanges/exchanges.js +3 -3
- package/resources/exchanges/exchanges.mjs +3 -3
- package/resources/exchanges/tickers.d.mts +2 -2
- package/resources/exchanges/tickers.d.mts.map +1 -1
- package/resources/exchanges/tickers.d.ts +2 -2
- package/resources/exchanges/tickers.d.ts.map +1 -1
- package/resources/exchanges/tickers.js +1 -1
- package/resources/exchanges/tickers.mjs +1 -1
- package/resources/exchanges/volume-chart.d.mts +2 -2
- package/resources/exchanges/volume-chart.d.ts +2 -2
- package/resources/exchanges/volume-chart.js +2 -2
- package/resources/exchanges/volume-chart.mjs +2 -2
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +5 -3
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +2 -1
- package/resources/index.mjs.map +1 -1
- package/resources/onchain/networks/pools/info.d.mts +72 -48
- package/resources/onchain/networks/pools/info.d.mts.map +1 -1
- package/resources/onchain/networks/pools/info.d.ts +72 -48
- package/resources/onchain/networks/pools/info.d.ts.map +1 -1
- package/resources/onchain/networks/pools/info.js +5 -2
- package/resources/onchain/networks/pools/info.js.map +1 -1
- package/resources/onchain/networks/pools/info.mjs +5 -2
- package/resources/onchain/networks/pools/info.mjs.map +1 -1
- package/resources/onchain/networks/pools/multi.d.mts +35 -0
- package/resources/onchain/networks/pools/multi.d.mts.map +1 -1
- package/resources/onchain/networks/pools/multi.d.ts +35 -0
- package/resources/onchain/networks/pools/multi.d.ts.map +1 -1
- package/resources/onchain/networks/pools/ohlcv.d.mts +2 -2
- package/resources/onchain/networks/pools/ohlcv.d.mts.map +1 -1
- package/resources/onchain/networks/pools/ohlcv.d.ts +2 -2
- package/resources/onchain/networks/pools/ohlcv.d.ts.map +1 -1
- package/resources/onchain/networks/pools/ohlcv.js.map +1 -1
- package/resources/onchain/networks/pools/ohlcv.mjs.map +1 -1
- package/resources/onchain/networks/pools/pools.d.mts +35 -0
- package/resources/onchain/networks/pools/pools.d.mts.map +1 -1
- package/resources/onchain/networks/pools/pools.d.ts +35 -0
- package/resources/onchain/networks/pools/pools.d.ts.map +1 -1
- package/resources/onchain/networks/pools/pools.js.map +1 -1
- package/resources/onchain/networks/pools/pools.mjs.map +1 -1
- package/resources/onchain/networks/tokens/info.d.mts +1 -1
- package/resources/onchain/networks/tokens/info.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/info.d.ts +1 -1
- package/resources/onchain/networks/tokens/info.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/multi.d.mts +132 -0
- package/resources/onchain/networks/tokens/multi.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/multi.d.ts +132 -0
- package/resources/onchain/networks/tokens/multi.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/ohlcv.d.mts +2 -2
- package/resources/onchain/networks/tokens/ohlcv.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/ohlcv.d.ts +2 -2
- package/resources/onchain/networks/tokens/ohlcv.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/ohlcv.js.map +1 -1
- package/resources/onchain/networks/tokens/ohlcv.mjs.map +1 -1
- package/resources/onchain/networks/tokens/tokens.d.mts +15 -0
- package/resources/onchain/networks/tokens/tokens.d.mts.map +1 -1
- package/resources/onchain/networks/tokens/tokens.d.ts +15 -0
- package/resources/onchain/networks/tokens/tokens.d.ts.map +1 -1
- package/resources/onchain/networks/tokens/tokens.js.map +1 -1
- package/resources/onchain/networks/tokens/tokens.mjs.map +1 -1
- package/resources/onchain/pools/megafilter.d.mts +1 -1
- package/resources/onchain/pools/megafilter.d.mts.map +1 -1
- package/resources/onchain/pools/megafilter.d.ts +1 -1
- package/resources/onchain/pools/megafilter.d.ts.map +1 -1
- package/resources/public-treasury.d.mts +137 -0
- package/resources/public-treasury.d.mts.map +1 -0
- package/resources/public-treasury.d.ts +137 -0
- package/resources/public-treasury.d.ts.map +1 -0
- package/resources/public-treasury.js +40 -0
- package/resources/public-treasury.js.map +1 -0
- package/resources/public-treasury.mjs +36 -0
- package/resources/public-treasury.mjs.map +1 -0
- package/resources/simple/price.d.mts +2 -2
- package/resources/simple/price.d.ts +2 -2
- package/src/client.ts +24 -5
- package/src/internal/utils/values.ts +3 -3
- package/src/resources/coins/circulating-supply-chart.ts +7 -5
- package/src/resources/coins/contract/market-chart.ts +13 -5
- package/src/resources/coins/history.ts +2 -2
- package/src/resources/coins/market-chart.ts +7 -5
- package/src/resources/coins/markets.ts +1 -1
- package/src/resources/coins/ohlc.ts +12 -5
- package/src/resources/coins/top-gainers-losers.ts +117 -5
- package/src/resources/coins/total-supply-chart.ts +8 -6
- package/src/resources/derivatives/exchanges.ts +2 -2
- package/src/resources/entities.ts +73 -0
- package/src/resources/exchanges/exchanges.ts +3 -3
- package/src/resources/exchanges/tickers.ts +9 -2
- package/src/resources/exchanges/volume-chart.ts +2 -2
- package/src/resources/index.ts +7 -1
- package/src/resources/onchain/networks/pools/info.ts +92 -54
- package/src/resources/onchain/networks/pools/multi.ts +61 -0
- package/src/resources/onchain/networks/pools/ohlcv.ts +2 -2
- package/src/resources/onchain/networks/pools/pools.ts +61 -0
- package/src/resources/onchain/networks/tokens/info.ts +1 -1
- package/src/resources/onchain/networks/tokens/multi.ts +211 -0
- package/src/resources/onchain/networks/tokens/ohlcv.ts +2 -2
- package/src/resources/onchain/networks/tokens/tokens.ts +25 -0
- package/src/resources/onchain/pools/megafilter.ts +7 -0
- package/src/resources/public-treasury.ts +178 -0
- package/src/resources/simple/price.ts +2 -2
- 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
- package/resources/companies/companies.d.mts +0 -10
- package/resources/companies/companies.d.mts.map +0 -1
- package/resources/companies/companies.d.ts +0 -10
- package/resources/companies/companies.d.ts.map +0 -1
- package/resources/companies/companies.js +0 -17
- package/resources/companies/companies.js.map +0 -1
- package/resources/companies/companies.mjs +0 -12
- package/resources/companies/companies.mjs.map +0 -1
- package/resources/companies/index.d.mts +0 -3
- package/resources/companies/index.d.mts.map +0 -1
- package/resources/companies/index.d.ts +0 -3
- package/resources/companies/index.d.ts.map +0 -1
- package/resources/companies/index.js +0 -9
- package/resources/companies/index.js.map +0 -1
- package/resources/companies/index.mjs +0 -4
- package/resources/companies/index.mjs.map +0 -1
- package/resources/companies/public-treasury.d.mts +0 -69
- package/resources/companies/public-treasury.d.mts.map +0 -1
- package/resources/companies/public-treasury.d.ts +0 -69
- package/resources/companies/public-treasury.d.ts.map +0 -1
- package/resources/companies/public-treasury.js +0 -25
- package/resources/companies/public-treasury.js.map +0 -1
- package/resources/companies/public-treasury.mjs +0 -21
- package/resources/companies/public-treasury.mjs.map +0 -1
- package/resources/companies.d.mts +0 -2
- package/resources/companies.d.mts.map +0 -1
- package/resources/companies.d.ts +0 -2
- package/resources/companies.d.ts.map +0 -1
- package/resources/companies.js +0 -6
- package/resources/companies.js.map +0 -1
- package/resources/companies.mjs +0 -3
- package/resources/companies.mjs.map +0 -1
- package/src/resources/companies/companies.ts +0 -18
- package/src/resources/companies/index.ts +0 -4
- package/src/resources/companies/public-treasury.ts +0 -89
- package/src/resources/companies.ts +0 -3
package/src/client.ts
CHANGED
|
@@ -21,12 +21,18 @@ import {
|
|
|
21
21
|
AssetPlatformGetResponse,
|
|
22
22
|
AssetPlatforms,
|
|
23
23
|
} from './resources/asset-platforms';
|
|
24
|
+
import { Entities, EntityGetListParams, EntityGetListResponse } from './resources/entities';
|
|
24
25
|
import { ExchangeRateGetResponse, ExchangeRates } from './resources/exchange-rates';
|
|
25
26
|
import { Key, KeyGetResponse } from './resources/key';
|
|
26
27
|
import { Ping, PingGetResponse } from './resources/ping';
|
|
28
|
+
import {
|
|
29
|
+
PublicTreasury,
|
|
30
|
+
PublicTreasuryGetCoinIDParams,
|
|
31
|
+
PublicTreasuryGetCoinIDResponse,
|
|
32
|
+
PublicTreasuryGetEntityIDResponse,
|
|
33
|
+
} from './resources/public-treasury';
|
|
27
34
|
import { TokenListGetAllJsonResponse, TokenLists } from './resources/token-lists';
|
|
28
35
|
import { CoinGetIDParams, CoinGetIDResponse, Coins } from './resources/coins/coins';
|
|
29
|
-
import { Companies } from './resources/companies/companies';
|
|
30
36
|
import { DerivativeGetResponse, Derivatives } from './resources/derivatives/derivatives';
|
|
31
37
|
import {
|
|
32
38
|
ExchangeGetIDParams,
|
|
@@ -807,8 +813,8 @@ export class Coingecko {
|
|
|
807
813
|
|
|
808
814
|
assetPlatforms: API.AssetPlatforms = new API.AssetPlatforms(this);
|
|
809
815
|
coins: API.Coins = new API.Coins(this);
|
|
810
|
-
companies: API.Companies = new API.Companies(this);
|
|
811
816
|
derivatives: API.Derivatives = new API.Derivatives(this);
|
|
817
|
+
entities: API.Entities = new API.Entities(this);
|
|
812
818
|
exchangeRates: API.ExchangeRates = new API.ExchangeRates(this);
|
|
813
819
|
exchanges: API.Exchanges = new API.Exchanges(this);
|
|
814
820
|
global: API.Global = new API.Global(this);
|
|
@@ -816,6 +822,7 @@ export class Coingecko {
|
|
|
816
822
|
nfts: API.NFTs = new API.NFTs(this);
|
|
817
823
|
onchain: API.Onchain = new API.Onchain(this);
|
|
818
824
|
ping: API.Ping = new API.Ping(this);
|
|
825
|
+
publicTreasury: API.PublicTreasury = new API.PublicTreasury(this);
|
|
819
826
|
search: API.Search = new API.Search(this);
|
|
820
827
|
simple: API.Simple = new API.Simple(this);
|
|
821
828
|
tokenLists: API.TokenLists = new API.TokenLists(this);
|
|
@@ -823,8 +830,8 @@ export class Coingecko {
|
|
|
823
830
|
|
|
824
831
|
Coingecko.AssetPlatforms = AssetPlatforms;
|
|
825
832
|
Coingecko.Coins = Coins;
|
|
826
|
-
Coingecko.Companies = Companies;
|
|
827
833
|
Coingecko.Derivatives = Derivatives;
|
|
834
|
+
Coingecko.Entities = Entities;
|
|
828
835
|
Coingecko.ExchangeRates = ExchangeRates;
|
|
829
836
|
Coingecko.Exchanges = Exchanges;
|
|
830
837
|
Coingecko.Global = Global;
|
|
@@ -832,6 +839,7 @@ Coingecko.Key = Key;
|
|
|
832
839
|
Coingecko.NFTs = NFTs;
|
|
833
840
|
Coingecko.Onchain = Onchain;
|
|
834
841
|
Coingecko.Ping = Ping;
|
|
842
|
+
Coingecko.PublicTreasury = PublicTreasury;
|
|
835
843
|
Coingecko.Search = Search;
|
|
836
844
|
Coingecko.Simple = Simple;
|
|
837
845
|
Coingecko.TokenLists = TokenLists;
|
|
@@ -851,10 +859,14 @@ export declare namespace Coingecko {
|
|
|
851
859
|
type CoinGetIDParams as CoinGetIDParams,
|
|
852
860
|
};
|
|
853
861
|
|
|
854
|
-
export { Companies as Companies };
|
|
855
|
-
|
|
856
862
|
export { Derivatives as Derivatives, type DerivativeGetResponse as DerivativeGetResponse };
|
|
857
863
|
|
|
864
|
+
export {
|
|
865
|
+
Entities as Entities,
|
|
866
|
+
type EntityGetListResponse as EntityGetListResponse,
|
|
867
|
+
type EntityGetListParams as EntityGetListParams,
|
|
868
|
+
};
|
|
869
|
+
|
|
858
870
|
export { ExchangeRates as ExchangeRates, type ExchangeRateGetResponse as ExchangeRateGetResponse };
|
|
859
871
|
|
|
860
872
|
export {
|
|
@@ -884,6 +896,13 @@ export declare namespace Coingecko {
|
|
|
884
896
|
|
|
885
897
|
export { Ping as Ping, type PingGetResponse as PingGetResponse };
|
|
886
898
|
|
|
899
|
+
export {
|
|
900
|
+
PublicTreasury as PublicTreasury,
|
|
901
|
+
type PublicTreasuryGetCoinIDResponse as PublicTreasuryGetCoinIDResponse,
|
|
902
|
+
type PublicTreasuryGetEntityIDResponse as PublicTreasuryGetEntityIDResponse,
|
|
903
|
+
type PublicTreasuryGetCoinIDParams as PublicTreasuryGetCoinIDParams,
|
|
904
|
+
};
|
|
905
|
+
|
|
887
906
|
export {
|
|
888
907
|
Search as Search,
|
|
889
908
|
type SearchGetResponse as SearchGetResponse,
|
|
@@ -76,21 +76,21 @@ export const coerceBoolean = (value: unknown): boolean => {
|
|
|
76
76
|
};
|
|
77
77
|
|
|
78
78
|
export const maybeCoerceInteger = (value: unknown): number | undefined => {
|
|
79
|
-
if (value
|
|
79
|
+
if (value == null) {
|
|
80
80
|
return undefined;
|
|
81
81
|
}
|
|
82
82
|
return coerceInteger(value);
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
export const maybeCoerceFloat = (value: unknown): number | undefined => {
|
|
86
|
-
if (value
|
|
86
|
+
if (value == null) {
|
|
87
87
|
return undefined;
|
|
88
88
|
}
|
|
89
89
|
return coerceFloat(value);
|
|
90
90
|
};
|
|
91
91
|
|
|
92
92
|
export const maybeCoerceBoolean = (value: unknown): boolean | undefined => {
|
|
93
|
-
if (value
|
|
93
|
+
if (value == null) {
|
|
94
94
|
return undefined;
|
|
95
95
|
}
|
|
96
96
|
return coerceBoolean(value);
|
|
@@ -35,7 +35,7 @@ export class CirculatingSupplyChart extends APIResource {
|
|
|
35
35
|
* const response =
|
|
36
36
|
* await client.coins.circulatingSupplyChart.getRange(
|
|
37
37
|
* 'bitcoin',
|
|
38
|
-
* { from:
|
|
38
|
+
* { from: 'from', to: 'to' },
|
|
39
39
|
* );
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
@@ -70,14 +70,16 @@ export interface CirculatingSupplyChartGetParams {
|
|
|
70
70
|
|
|
71
71
|
export interface CirculatingSupplyChartGetRangeParams {
|
|
72
72
|
/**
|
|
73
|
-
* starting date in UNIX
|
|
73
|
+
* starting date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
74
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
74
75
|
*/
|
|
75
|
-
from:
|
|
76
|
+
from: string;
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
|
-
* ending date in UNIX
|
|
79
|
+
* ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
80
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
79
81
|
*/
|
|
80
|
-
to:
|
|
82
|
+
to: string;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
export declare namespace CirculatingSupplyChart {
|
|
@@ -42,7 +42,12 @@ export class MarketChart extends APIResource {
|
|
|
42
42
|
* const response =
|
|
43
43
|
* await client.coins.contract.marketChart.getRange(
|
|
44
44
|
* '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
45
|
-
* {
|
|
45
|
+
* {
|
|
46
|
+
* id: 'ethereum',
|
|
47
|
+
* from: 'from',
|
|
48
|
+
* to: 'to',
|
|
49
|
+
* vs_currency: 'usd',
|
|
50
|
+
* },
|
|
46
51
|
* );
|
|
47
52
|
* ```
|
|
48
53
|
*/
|
|
@@ -133,14 +138,17 @@ export interface MarketChartGetRangeParams {
|
|
|
133
138
|
id: string;
|
|
134
139
|
|
|
135
140
|
/**
|
|
136
|
-
* Query param: starting date in
|
|
141
|
+
* Query param: starting date in ISO date string (`YYYY-MM-DD` or
|
|
142
|
+
* `YYYY-MM-DDTHH:MM`) or UNIX timestamp. **use ISO date string for best
|
|
143
|
+
* compatibility**
|
|
137
144
|
*/
|
|
138
|
-
from:
|
|
145
|
+
from: string;
|
|
139
146
|
|
|
140
147
|
/**
|
|
141
|
-
* Query param: ending date in
|
|
148
|
+
* Query param: ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`)
|
|
149
|
+
* or UNIX timestamp. **use ISO date string for best compatibility**
|
|
142
150
|
*/
|
|
143
|
-
to:
|
|
151
|
+
to: string;
|
|
144
152
|
|
|
145
153
|
/**
|
|
146
154
|
* Query param: target currency of market data \*refers to
|
|
@@ -13,7 +13,7 @@ export class History extends APIResource {
|
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
15
15
|
* const history = await client.coins.history.get('bitcoin', {
|
|
16
|
-
* date: '
|
|
16
|
+
* date: 'date',
|
|
17
17
|
* });
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
@@ -243,7 +243,7 @@ export namespace HistoryGetResponse {
|
|
|
243
243
|
|
|
244
244
|
export interface HistoryGetParams {
|
|
245
245
|
/**
|
|
246
|
-
*
|
|
246
|
+
* date of data snapshot (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`)
|
|
247
247
|
*/
|
|
248
248
|
date: string;
|
|
249
249
|
|
|
@@ -31,7 +31,7 @@ export class MarketChart extends APIResource {
|
|
|
31
31
|
* ```ts
|
|
32
32
|
* const response = await client.coins.marketChart.getRange(
|
|
33
33
|
* 'bitcoin',
|
|
34
|
-
* { from:
|
|
34
|
+
* { from: 'from', to: 'to', vs_currency: 'usd' },
|
|
35
35
|
* );
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
@@ -106,14 +106,16 @@ export interface MarketChartGetParams {
|
|
|
106
106
|
|
|
107
107
|
export interface MarketChartGetRangeParams {
|
|
108
108
|
/**
|
|
109
|
-
* starting date in UNIX
|
|
109
|
+
* starting date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
110
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
110
111
|
*/
|
|
111
|
-
from:
|
|
112
|
+
from: string;
|
|
112
113
|
|
|
113
114
|
/**
|
|
114
|
-
* ending date in UNIX
|
|
115
|
+
* ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
116
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
115
117
|
*/
|
|
116
|
-
to:
|
|
118
|
+
to: string;
|
|
117
119
|
|
|
118
120
|
/**
|
|
119
121
|
* target currency of market data \*refers to
|
|
@@ -290,7 +290,7 @@ export interface MarketGetParams {
|
|
|
290
290
|
|
|
291
291
|
/**
|
|
292
292
|
* include price change percentage timeframe, comma-separated if query more than 1
|
|
293
|
-
*
|
|
293
|
+
* timeframe Valid values: 1h, 24h, 7d, 14d, 30d, 200d, 1y
|
|
294
294
|
*/
|
|
295
295
|
price_change_percentage?: string;
|
|
296
296
|
|
|
@@ -30,7 +30,12 @@ export class Ohlc extends APIResource {
|
|
|
30
30
|
* ```ts
|
|
31
31
|
* const response = await client.coins.ohlc.getRange(
|
|
32
32
|
* 'bitcoin',
|
|
33
|
-
* {
|
|
33
|
+
* {
|
|
34
|
+
* from: 'from',
|
|
35
|
+
* interval: 'daily',
|
|
36
|
+
* to: 'to',
|
|
37
|
+
* vs_currency: 'usd',
|
|
38
|
+
* },
|
|
34
39
|
* );
|
|
35
40
|
* ```
|
|
36
41
|
*/
|
|
@@ -92,9 +97,10 @@ export interface OhlcGetParams {
|
|
|
92
97
|
|
|
93
98
|
export interface OhlcGetRangeParams {
|
|
94
99
|
/**
|
|
95
|
-
* starting date in UNIX
|
|
100
|
+
* starting date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
101
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
96
102
|
*/
|
|
97
|
-
from:
|
|
103
|
+
from: string;
|
|
98
104
|
|
|
99
105
|
/**
|
|
100
106
|
* data interval
|
|
@@ -102,9 +108,10 @@ export interface OhlcGetRangeParams {
|
|
|
102
108
|
interval: 'daily' | 'hourly';
|
|
103
109
|
|
|
104
110
|
/**
|
|
105
|
-
* ending date in UNIX
|
|
111
|
+
* ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
112
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
106
113
|
*/
|
|
107
|
-
to:
|
|
114
|
+
to: string;
|
|
108
115
|
|
|
109
116
|
/**
|
|
110
117
|
* target currency of price data \*refers to
|
|
@@ -11,7 +11,7 @@ export class TopGainersLosers extends APIResource {
|
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
|
-
* const
|
|
14
|
+
* const topGainersLoser =
|
|
15
15
|
* await client.coins.topGainersLosers.get({
|
|
16
16
|
* vs_currency: 'usd',
|
|
17
17
|
* });
|
|
@@ -22,10 +22,86 @@ export class TopGainersLosers extends APIResource {
|
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
export
|
|
25
|
+
export interface TopGainersLoserGetResponse {
|
|
26
|
+
top_gainers?: Array<TopGainersLoserGetResponse.TopGainer>;
|
|
27
|
+
|
|
28
|
+
top_losers?: Array<TopGainersLoserGetResponse.TopLoser>;
|
|
29
|
+
}
|
|
26
30
|
|
|
27
31
|
export namespace TopGainersLoserGetResponse {
|
|
28
|
-
export interface
|
|
32
|
+
export interface TopGainer {
|
|
33
|
+
/**
|
|
34
|
+
* coin ID
|
|
35
|
+
*/
|
|
36
|
+
id?: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* coin image url
|
|
40
|
+
*/
|
|
41
|
+
image?: string;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* coin rank by market cap
|
|
45
|
+
*/
|
|
46
|
+
market_cap_rank?: number;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* coin name
|
|
50
|
+
*/
|
|
51
|
+
name?: string;
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* coin symbol
|
|
55
|
+
*/
|
|
56
|
+
symbol?: string;
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* coin price in USD
|
|
60
|
+
*/
|
|
61
|
+
usd?: number;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* coin 14 day change percentage in USD
|
|
65
|
+
*/
|
|
66
|
+
usd_14d_change?: number | null;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* coin 1hr change percentage in USD
|
|
70
|
+
*/
|
|
71
|
+
usd_1h_change?: number | null;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* coin 1 year change percentage in USD
|
|
75
|
+
*/
|
|
76
|
+
usd_1y_change?: number | null;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* coin 200 day change percentage in USD
|
|
80
|
+
*/
|
|
81
|
+
usd_200d_change?: number | null;
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* coin 24hr change percentage in USD
|
|
85
|
+
*/
|
|
86
|
+
usd_24h_change?: number | null;
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* coin 24hr volume in USD
|
|
90
|
+
*/
|
|
91
|
+
usd_24h_vol?: number;
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* coin 30 day change percentage in USD
|
|
95
|
+
*/
|
|
96
|
+
usd_30d_change?: number | null;
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* coin 7 day change percentage in USD
|
|
100
|
+
*/
|
|
101
|
+
usd_7d_change?: number | null;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface TopLoser {
|
|
29
105
|
/**
|
|
30
106
|
* coin ID
|
|
31
107
|
*/
|
|
@@ -57,14 +133,44 @@ export namespace TopGainersLoserGetResponse {
|
|
|
57
133
|
usd?: number;
|
|
58
134
|
|
|
59
135
|
/**
|
|
60
|
-
* coin
|
|
136
|
+
* coin 14 day change percentage in USD
|
|
137
|
+
*/
|
|
138
|
+
usd_14d_change?: number | null;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* coin 1hr change percentage in USD
|
|
142
|
+
*/
|
|
143
|
+
usd_1h_change?: number | null;
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* coin 1 year change percentage in USD
|
|
147
|
+
*/
|
|
148
|
+
usd_1y_change?: number | null;
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* coin 200 day change percentage in USD
|
|
152
|
+
*/
|
|
153
|
+
usd_200d_change?: number | null;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* coin 24hr change percentage in USD
|
|
61
157
|
*/
|
|
62
|
-
|
|
158
|
+
usd_24h_change?: number | null;
|
|
63
159
|
|
|
64
160
|
/**
|
|
65
161
|
* coin 24hr volume in USD
|
|
66
162
|
*/
|
|
67
163
|
usd_24h_vol?: number;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* coin 30 day change percentage in USD
|
|
167
|
+
*/
|
|
168
|
+
usd_30d_change?: number | null;
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* coin 7 day change percentage in USD
|
|
172
|
+
*/
|
|
173
|
+
usd_7d_change?: number | null;
|
|
68
174
|
}
|
|
69
175
|
}
|
|
70
176
|
|
|
@@ -80,6 +186,12 @@ export interface TopGainersLoserGetParams {
|
|
|
80
186
|
*/
|
|
81
187
|
duration?: '1h' | '24h' | '7d' | '14d' | '30d' | '60d' | '1y';
|
|
82
188
|
|
|
189
|
+
/**
|
|
190
|
+
* include price change percentage timeframe, comma-separated if query more than 1
|
|
191
|
+
* price change percentage timeframe Valid values: 1h, 24h, 7d, 14d, 30d, 200d, 1y
|
|
192
|
+
*/
|
|
193
|
+
price_change_percentage?: string;
|
|
194
|
+
|
|
83
195
|
/**
|
|
84
196
|
* filter result by market cap ranking (top 300 to 1000) or all coins (including
|
|
85
197
|
* coins that do not have market cap) Default value: `1000`
|
|
@@ -34,8 +34,8 @@ export class TotalSupplyChart extends APIResource {
|
|
|
34
34
|
* ```ts
|
|
35
35
|
* const response =
|
|
36
36
|
* await client.coins.totalSupplyChart.getRange('bitcoin', {
|
|
37
|
-
* from:
|
|
38
|
-
* to:
|
|
37
|
+
* from: 'from',
|
|
38
|
+
* to: 'to',
|
|
39
39
|
* });
|
|
40
40
|
* ```
|
|
41
41
|
*/
|
|
@@ -70,14 +70,16 @@ export interface TotalSupplyChartGetParams {
|
|
|
70
70
|
|
|
71
71
|
export interface TotalSupplyChartGetRangeParams {
|
|
72
72
|
/**
|
|
73
|
-
* starting date in UNIX
|
|
73
|
+
* starting date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
74
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
74
75
|
*/
|
|
75
|
-
from:
|
|
76
|
+
from: string;
|
|
76
77
|
|
|
77
78
|
/**
|
|
78
|
-
* ending date in UNIX
|
|
79
|
+
* ending date in ISO date string (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) or UNIX
|
|
80
|
+
* timestamp. **use ISO date string for best compatibility**
|
|
79
81
|
*/
|
|
80
|
-
to:
|
|
82
|
+
to: string;
|
|
81
83
|
}
|
|
82
84
|
|
|
83
85
|
export declare namespace TotalSupplyChart {
|
|
@@ -23,8 +23,8 @@ export class Exchanges extends APIResource {
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
|
-
* This endpoint allows you to **query the derivatives exchange
|
|
27
|
-
* name, open interest, ...) based on the exchanges
|
|
26
|
+
* This endpoint allows you to **query the derivatives exchange's related data (ID,
|
|
27
|
+
* name, open interest, ...) based on the exchanges' ID**
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { RequestOptions } from '../internal/request-options';
|
|
6
|
+
|
|
7
|
+
export class Entities extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* This endpoint allows you to **query all the supported entities on CoinGecko with
|
|
10
|
+
* entities ID, name, symbol, and country**
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response = await client.entities.getList();
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
getList(
|
|
18
|
+
query: EntityGetListParams | null | undefined = {},
|
|
19
|
+
options?: RequestOptions,
|
|
20
|
+
): APIPromise<EntityGetListResponse> {
|
|
21
|
+
return this._client.get('/entities/list', { query, ...options });
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type EntityGetListResponse = Array<EntityGetListResponse.EntityGetListResponseItem>;
|
|
26
|
+
|
|
27
|
+
export namespace EntityGetListResponse {
|
|
28
|
+
export interface EntityGetListResponseItem {
|
|
29
|
+
/**
|
|
30
|
+
* entity ID
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* country code
|
|
36
|
+
*/
|
|
37
|
+
country?: string;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* entity name
|
|
41
|
+
*/
|
|
42
|
+
name?: string;
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* ticker symbol of public company
|
|
46
|
+
*/
|
|
47
|
+
symbol?: string;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface EntityGetListParams {
|
|
52
|
+
/**
|
|
53
|
+
* filter by entity type, default: false
|
|
54
|
+
*/
|
|
55
|
+
entity_type?: 'company' | 'government';
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* page through results, default: 1
|
|
59
|
+
*/
|
|
60
|
+
page?: number;
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* total results per page, default: 100 Valid values: 1...250
|
|
64
|
+
*/
|
|
65
|
+
per_page?: number;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export declare namespace Entities {
|
|
69
|
+
export {
|
|
70
|
+
type EntityGetListResponse as EntityGetListResponse,
|
|
71
|
+
type EntityGetListParams as EntityGetListParams,
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -20,7 +20,7 @@ export class Exchanges extends APIResource {
|
|
|
20
20
|
volumeChart: VolumeChartAPI.VolumeChart = new VolumeChartAPI.VolumeChart(this._client);
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* This endpoint allows you to **query all the supported exchanges with exchanges
|
|
23
|
+
* This endpoint allows you to **query all the supported exchanges with exchanges'
|
|
24
24
|
* data (ID, name, country, ...) that have active trading volumes on CoinGecko**
|
|
25
25
|
*
|
|
26
26
|
* @example
|
|
@@ -36,8 +36,8 @@ export class Exchanges extends APIResource {
|
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
|
-
* This endpoint allows you to **query exchange
|
|
40
|
-
* country, ...), exchange volume in BTC and top 100 tickers based on exchange
|
|
39
|
+
* This endpoint allows you to **query exchange's data (name, year established,
|
|
40
|
+
* country, ...), exchange volume in BTC and top 100 tickers based on exchange's
|
|
41
41
|
* ID**
|
|
42
42
|
*
|
|
43
43
|
* @example
|
|
@@ -7,7 +7,7 @@ import { path } from '../../internal/utils/path';
|
|
|
7
7
|
|
|
8
8
|
export class Tickers extends APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* This endpoint allows you to **query exchange's tickers based on exchange
|
|
10
|
+
* This endpoint allows you to **query exchange's tickers based on exchange's ID**
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
@@ -217,7 +217,14 @@ export interface TickerGetParams {
|
|
|
217
217
|
/**
|
|
218
218
|
* use this to sort the order of responses, default: trust_score_desc
|
|
219
219
|
*/
|
|
220
|
-
order?:
|
|
220
|
+
order?:
|
|
221
|
+
| 'market_cap_asc'
|
|
222
|
+
| 'market_cap_desc'
|
|
223
|
+
| 'trust_score_desc'
|
|
224
|
+
| 'trust_score_asc'
|
|
225
|
+
| 'volume_desc'
|
|
226
|
+
| 'volume_asc'
|
|
227
|
+
| 'base_target';
|
|
221
228
|
|
|
222
229
|
/**
|
|
223
230
|
* page through results
|
|
@@ -8,7 +8,7 @@ import { path } from '../../internal/utils/path';
|
|
|
8
8
|
export class VolumeChart extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* This endpoint allows you to **query the historical volume chart data with time
|
|
11
|
-
* in UNIX and trading volume data in BTC based on exchange
|
|
11
|
+
* in UNIX and trading volume data in BTC based on exchange's ID**
|
|
12
12
|
*
|
|
13
13
|
* @example
|
|
14
14
|
* ```ts
|
|
@@ -24,7 +24,7 @@ export class VolumeChart extends APIResource {
|
|
|
24
24
|
|
|
25
25
|
/**
|
|
26
26
|
* This endpoint allows you to **query the historical volume chart data in BTC by
|
|
27
|
-
* specifying date range in UNIX based on exchange
|
|
27
|
+
* specifying date range in UNIX based on exchange's ID**
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
package/src/resources/index.ts
CHANGED
|
@@ -6,8 +6,8 @@ export {
|
|
|
6
6
|
type AssetPlatformGetParams,
|
|
7
7
|
} from './asset-platforms';
|
|
8
8
|
export { Coins, type CoinGetIDResponse, type CoinGetIDParams } from './coins/coins';
|
|
9
|
-
export { Companies } from './companies/companies';
|
|
10
9
|
export { Derivatives, type DerivativeGetResponse } from './derivatives/derivatives';
|
|
10
|
+
export { Entities, type EntityGetListResponse, type EntityGetListParams } from './entities';
|
|
11
11
|
export { ExchangeRates, type ExchangeRateGetResponse } from './exchange-rates';
|
|
12
12
|
export {
|
|
13
13
|
Exchanges,
|
|
@@ -30,6 +30,12 @@ export {
|
|
|
30
30
|
} from './nfts/nfts';
|
|
31
31
|
export { Onchain } from './onchain/onchain';
|
|
32
32
|
export { Ping, type PingGetResponse } from './ping';
|
|
33
|
+
export {
|
|
34
|
+
PublicTreasury,
|
|
35
|
+
type PublicTreasuryGetCoinIDResponse,
|
|
36
|
+
type PublicTreasuryGetEntityIDResponse,
|
|
37
|
+
type PublicTreasuryGetCoinIDParams,
|
|
38
|
+
} from './public-treasury';
|
|
33
39
|
export { Search, type SearchGetResponse, type SearchGetParams } from './search/search';
|
|
34
40
|
export { Simple } from './simple/simple';
|
|
35
41
|
export { TokenLists, type TokenListGetAllJsonResponse } from './token-lists';
|