From e0bf5186eaaf4a10315c162e71f40a1c7c8bfffc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:15:22 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 +- .../coins/circulating_supply_chart.py | 4 +- src/coingecko_sdk/resources/coins/coins.py | 8 ++ src/coingecko_sdk/resources/coins/history.py | 4 +- .../resources/onchain/networks/dexes.py | 10 ++ .../resources/onchain/networks/new_pools.py | 20 ++++ .../resources/onchain/networks/pools/pools.py | 10 ++ .../onchain/networks/tokens/multi.py | 8 ++ .../onchain/networks/tokens/ohlcv.py | 12 ++ .../onchain/networks/tokens/pools.py | 8 ++ .../onchain/networks/tokens/tokens.py | 12 ++ .../onchain/networks/trending_pools.py | 20 ++++ .../onchain/simple/networks/token_price.py | 10 ++ src/coingecko_sdk/types/coin_get_id_params.py | 3 + .../types/coin_get_id_response.py | 110 ++++++++++++++++++ .../circulating_supply_chart_get_params.py | 2 +- .../types/coins/history_get_params.py | 2 +- .../onchain/networks/dex_get_pools_params.py | 6 + .../networks/dex_get_pools_response.py | 6 + .../networks/new_pool_get_network_params.py | 6 + .../networks/new_pool_get_network_response.py | 6 + .../onchain/networks/new_pool_get_params.py | 6 + .../onchain/networks/new_pool_get_response.py | 6 + .../types/onchain/networks/pool_get_params.py | 6 + .../onchain/networks/pool_get_response.py | 6 + .../networks/pools/info_get_response.py | 4 + .../networks/token_get_address_params.py | 6 + .../networks/token_get_address_response.py | 2 + .../networks/tokens/info_get_response.py | 4 + .../tokens/multi_get_addresses_params.py | 3 + .../tokens/multi_get_addresses_response.py | 2 + .../tokens/ohlcv_get_timeframe_params.py | 6 + .../networks/tokens/pool_get_params.py | 3 + .../networks/tokens/pool_get_response.py | 2 + .../trending_pool_get_network_params.py | 6 + .../trending_pool_get_network_response.py | 6 + .../networks/trending_pool_get_params.py | 6 + .../networks/trending_pool_get_response.py | 6 + .../token_price_get_addresses_params.py | 6 + .../token_price_get_addresses_response.py | 10 ++ .../coins/test_circulating_supply_chart.py | 4 +- .../onchain/networks/test_dexes.py | 2 + .../onchain/networks/test_new_pools.py | 4 + .../onchain/networks/test_pools.py | 2 + .../onchain/networks/test_tokens.py | 2 + .../onchain/networks/test_trending_pools.py | 4 + .../onchain/networks/tokens/test_multi.py | 2 + .../onchain/networks/tokens/test_ohlcv.py | 2 + .../onchain/networks/tokens/test_pools.py | 2 + .../simple/networks/test_token_price.py | 2 + tests/api_resources/test_coins.py | 2 + 51 files changed, 385 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index b4544a5..43ccdcf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 81 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/coingecko%2Fcoingecko-9782d0fc256ca80aa3bb4c14cb3b3944b0076c5cea6046563c8a5979adc8981d.yml -openapi_spec_hash: dcb61d2acfd79e5b906fd191f6b512bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/coingecko%2Fcoingecko-a23494dedfc230f769076f4022de83a327d642db68ceadedf998921c66ff9310.yml +openapi_spec_hash: 0bcc6962d4ee8f39880019986e87e433 config_hash: 7710c0bb2c0cea0ec5a44596f81188a6 diff --git a/src/coingecko_sdk/resources/coins/circulating_supply_chart.py b/src/coingecko_sdk/resources/coins/circulating_supply_chart.py index 248ba8d..c75ffea 100644 --- a/src/coingecko_sdk/resources/coins/circulating_supply_chart.py +++ b/src/coingecko_sdk/resources/coins/circulating_supply_chart.py @@ -49,7 +49,7 @@ def get( id: str, *, days: str, - interval: Literal["daily"] | Omit = omit, + interval: Literal["5m", "hourly", "daily"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -172,7 +172,7 @@ async def get( id: str, *, days: str, - interval: Literal["daily"] | Omit = omit, + interval: Literal["5m", "hourly", "daily"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, diff --git a/src/coingecko_sdk/resources/coins/coins.py b/src/coingecko_sdk/resources/coins/coins.py index a804142..65de0ba 100644 --- a/src/coingecko_sdk/resources/coins/coins.py +++ b/src/coingecko_sdk/resources/coins/coins.py @@ -182,6 +182,7 @@ def get_id( community_data: bool | Omit = omit, developer_data: bool | Omit = omit, dex_pair_format: Literal["contract_address", "symbol"] | Omit = omit, + include_categories_details: bool | Omit = omit, localization: bool | Omit = omit, market_data: bool | Omit = omit, sparkline: bool | Omit = omit, @@ -208,6 +209,8 @@ def get_id( set to `symbol` to display DEX pair base and target as symbols, default: `contract_address` + include_categories_details: include categories details, default: false + localization: include all the localized languages in the response, default: true market_data: include market data, default: true @@ -238,6 +241,7 @@ def get_id( "community_data": community_data, "developer_data": developer_data, "dex_pair_format": dex_pair_format, + "include_categories_details": include_categories_details, "localization": localization, "market_data": market_data, "sparkline": sparkline, @@ -321,6 +325,7 @@ async def get_id( community_data: bool | Omit = omit, developer_data: bool | Omit = omit, dex_pair_format: Literal["contract_address", "symbol"] | Omit = omit, + include_categories_details: bool | Omit = omit, localization: bool | Omit = omit, market_data: bool | Omit = omit, sparkline: bool | Omit = omit, @@ -347,6 +352,8 @@ async def get_id( set to `symbol` to display DEX pair base and target as symbols, default: `contract_address` + include_categories_details: include categories details, default: false + localization: include all the localized languages in the response, default: true market_data: include market data, default: true @@ -377,6 +384,7 @@ async def get_id( "community_data": community_data, "developer_data": developer_data, "dex_pair_format": dex_pair_format, + "include_categories_details": include_categories_details, "localization": localization, "market_data": market_data, "sparkline": sparkline, diff --git a/src/coingecko_sdk/resources/coins/history.py b/src/coingecko_sdk/resources/coins/history.py index ff54902..a4a3487 100644 --- a/src/coingecko_sdk/resources/coins/history.py +++ b/src/coingecko_sdk/resources/coins/history.py @@ -59,7 +59,7 @@ def get( 24hrs volume, ...) at a given date for a coin based on a particular coin ID** Args: - date: date of data snapshot (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) + date: date of data snapshot (`YYYY-MM-DD`) localization: include all the localized languages in response, default: true @@ -130,7 +130,7 @@ async def get( 24hrs volume, ...) at a given date for a coin based on a particular coin ID** Args: - date: date of data snapshot (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`) + date: date of data snapshot (`YYYY-MM-DD`) localization: include all the localized languages in response, default: true diff --git a/src/coingecko_sdk/resources/onchain/networks/dexes.py b/src/coingecko_sdk/resources/onchain/networks/dexes.py index 225eb53..a7baa11 100644 --- a/src/coingecko_sdk/resources/onchain/networks/dexes.py +++ b/src/coingecko_sdk/resources/onchain/networks/dexes.py @@ -91,6 +91,7 @@ def get_pools( *, network: str, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -108,6 +109,9 @@ def get_pools( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_tx_count_desc @@ -134,6 +138,7 @@ def get_pools( query=maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, "sort": sort, }, @@ -211,6 +216,7 @@ async def get_pools( *, network: str, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -228,6 +234,9 @@ async def get_pools( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_tx_count_desc @@ -254,6 +263,7 @@ async def get_pools( query=await async_maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, "sort": sort, }, diff --git a/src/coingecko_sdk/resources/onchain/networks/new_pools.py b/src/coingecko_sdk/resources/onchain/networks/new_pools.py index c61e977..e84029a 100644 --- a/src/coingecko_sdk/resources/onchain/networks/new_pools.py +++ b/src/coingecko_sdk/resources/onchain/networks/new_pools.py @@ -46,6 +46,7 @@ def get( self, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -62,6 +63,9 @@ def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex`, `network` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -82,6 +86,7 @@ def get( query=maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, new_pool_get_params.NewPoolGetParams, @@ -95,6 +100,7 @@ def get_network( network: str, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -111,6 +117,9 @@ def get_network( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -133,6 +142,7 @@ def get_network( query=maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, new_pool_get_network_params.NewPoolGetNetworkParams, @@ -166,6 +176,7 @@ async def get( self, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -182,6 +193,9 @@ async def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex`, `network` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -202,6 +216,7 @@ async def get( query=await async_maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, new_pool_get_params.NewPoolGetParams, @@ -215,6 +230,7 @@ async def get_network( network: str, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -231,6 +247,9 @@ async def get_network( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -253,6 +272,7 @@ async def get_network( query=await async_maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, new_pool_get_network_params.NewPoolGetNetworkParams, diff --git a/src/coingecko_sdk/resources/onchain/networks/pools/pools.py b/src/coingecko_sdk/resources/onchain/networks/pools/pools.py index 9ecb08d..8bef6b8 100644 --- a/src/coingecko_sdk/resources/onchain/networks/pools/pools.py +++ b/src/coingecko_sdk/resources/onchain/networks/pools/pools.py @@ -97,6 +97,7 @@ def get( network: str, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -114,6 +115,9 @@ def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_tx_count_desc @@ -138,6 +142,7 @@ def get( query=maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, "sort": sort, }, @@ -247,6 +252,7 @@ async def get( network: str, *, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -264,6 +270,9 @@ async def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_tx_count_desc @@ -288,6 +297,7 @@ async def get( query=await async_maybe_transform( { "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, "sort": sort, }, diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/multi.py b/src/coingecko_sdk/resources/onchain/networks/tokens/multi.py index c3fb7d0..7f87115 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/multi.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/multi.py @@ -50,6 +50,7 @@ def get_addresses( network: str, include: Literal["top_pools"] | Omit = omit, include_composition: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -66,6 +67,8 @@ def get_addresses( include_composition: include pool composition, default: false + include_inactive_source: include tokens from inactive pools using the most recent swap, default: false + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -89,6 +92,7 @@ def get_addresses( { "include": include, "include_composition": include_composition, + "include_inactive_source": include_inactive_source, }, multi_get_addresses_params.MultiGetAddressesParams, ), @@ -124,6 +128,7 @@ async def get_addresses( network: str, include: Literal["top_pools"] | Omit = omit, include_composition: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -140,6 +145,8 @@ async def get_addresses( include_composition: include pool composition, default: false + include_inactive_source: include tokens from inactive pools using the most recent swap, default: false + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -163,6 +170,7 @@ async def get_addresses( { "include": include, "include_composition": include_composition, + "include_inactive_source": include_inactive_source, }, multi_get_addresses_params.MultiGetAddressesParams, ), diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/ohlcv.py b/src/coingecko_sdk/resources/onchain/networks/tokens/ohlcv.py index dce890b..e7489ec 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/ohlcv.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/ohlcv.py @@ -53,6 +53,7 @@ def get_timeframe( before_timestamp: int | Omit = omit, currency: Literal["usd", "token"] | Omit = omit, include_empty_intervals: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -76,6 +77,10 @@ def get_timeframe( include_empty_intervals: include empty intervals with no trade data, default: false + include_inactive_source: + include token data from inactive pools using the most recent swap, default: + false + limit: number of OHLCV results to return, maximum 1000 Default value: 100 extra_headers: Send extra headers @@ -105,6 +110,7 @@ def get_timeframe( "before_timestamp": before_timestamp, "currency": currency, "include_empty_intervals": include_empty_intervals, + "include_inactive_source": include_inactive_source, "limit": limit, }, ohlcv_get_timeframe_params.OhlcvGetTimeframeParams, @@ -144,6 +150,7 @@ async def get_timeframe( before_timestamp: int | Omit = omit, currency: Literal["usd", "token"] | Omit = omit, include_empty_intervals: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, limit: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -167,6 +174,10 @@ async def get_timeframe( include_empty_intervals: include empty intervals with no trade data, default: false + include_inactive_source: + include token data from inactive pools using the most recent swap, default: + false + limit: number of OHLCV results to return, maximum 1000 Default value: 100 extra_headers: Send extra headers @@ -196,6 +207,7 @@ async def get_timeframe( "before_timestamp": before_timestamp, "currency": currency, "include_empty_intervals": include_empty_intervals, + "include_inactive_source": include_inactive_source, "limit": limit, }, ohlcv_get_timeframe_params.OhlcvGetTimeframeParams, diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/pools.py b/src/coingecko_sdk/resources/onchain/networks/tokens/pools.py index 4784320..4d6b8b3 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/pools.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/pools.py @@ -49,6 +49,7 @@ def get( *, network: str, include: str | Omit = omit, + include_inactive_source: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_volume_usd_liquidity_desc", "h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -66,6 +67,8 @@ def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_inactive_source: include tokens from inactive pools using the most recent swap, default: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_volume_usd_liquidity_desc @@ -92,6 +95,7 @@ def get( query=maybe_transform( { "include": include, + "include_inactive_source": include_inactive_source, "page": page, "sort": sort, }, @@ -128,6 +132,7 @@ async def get( *, network: str, include: str | Omit = omit, + include_inactive_source: bool | Omit = omit, page: int | Omit = omit, sort: Literal["h24_volume_usd_liquidity_desc", "h24_tx_count_desc", "h24_volume_usd_desc"] | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. @@ -145,6 +150,8 @@ async def get( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_inactive_source: include tokens from inactive pools using the most recent swap, default: false + page: page through results Default value: 1 sort: sort the pools by field Default value: h24_volume_usd_liquidity_desc @@ -171,6 +178,7 @@ async def get( query=await async_maybe_transform( { "include": include, + "include_inactive_source": include_inactive_source, "page": page, "sort": sort, }, diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py b/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py index d0e71a6..99b7f14 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py @@ -134,6 +134,7 @@ def get_address( network: str, include: Literal["top_pools"] | Omit = omit, include_composition: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -150,6 +151,10 @@ def get_address( include_composition: include pool composition, default: false + include_inactive_source: + include token data from inactive pools using the most recent swap, default: + false + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -173,6 +178,7 @@ def get_address( { "include": include, "include_composition": include_composition, + "include_inactive_source": include_inactive_source, }, token_get_address_params.TokenGetAddressParams, ), @@ -236,6 +242,7 @@ async def get_address( network: str, include: Literal["top_pools"] | Omit = omit, include_composition: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. extra_headers: Headers | None = None, @@ -252,6 +259,10 @@ async def get_address( include_composition: include pool composition, default: false + include_inactive_source: + include token data from inactive pools using the most recent swap, default: + false + extra_headers: Send extra headers extra_query: Add additional query parameters to the request @@ -275,6 +286,7 @@ async def get_address( { "include": include, "include_composition": include_composition, + "include_inactive_source": include_inactive_source, }, token_get_address_params.TokenGetAddressParams, ), diff --git a/src/coingecko_sdk/resources/onchain/networks/trending_pools.py b/src/coingecko_sdk/resources/onchain/networks/trending_pools.py index 3022dc0..9d4b95b 100644 --- a/src/coingecko_sdk/resources/onchain/networks/trending_pools.py +++ b/src/coingecko_sdk/resources/onchain/networks/trending_pools.py @@ -49,6 +49,7 @@ def get( *, duration: Literal["5m", "1h", "6h", "24h"] | Omit = omit, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -68,6 +69,9 @@ def get( values: `base_token`, `quote_token`, `dex`, `network`. Example: `base_token` or `base_token,dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -89,6 +93,7 @@ def get( { "duration": duration, "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, trending_pool_get_params.TrendingPoolGetParams, @@ -103,6 +108,7 @@ def get_network( *, duration: Literal["5m", "1h", "6h", "24h"] | Omit = omit, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -121,6 +127,9 @@ def get_network( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -144,6 +153,7 @@ def get_network( { "duration": duration, "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, trending_pool_get_network_params.TrendingPoolGetNetworkParams, @@ -178,6 +188,7 @@ async def get( *, duration: Literal["5m", "1h", "6h", "24h"] | Omit = omit, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -197,6 +208,9 @@ async def get( values: `base_token`, `quote_token`, `dex`, `network`. Example: `base_token` or `base_token,dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -218,6 +232,7 @@ async def get( { "duration": duration, "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, trending_pool_get_params.TrendingPoolGetParams, @@ -232,6 +247,7 @@ async def get_network( *, duration: Literal["5m", "1h", "6h", "24h"] | Omit = omit, include: str | Omit = omit, + include_gt_community_data: bool | Omit = omit, page: int | Omit = omit, # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. # The extra values given here take precedence over values defined on the client or passed to this method. @@ -250,6 +266,9 @@ async def get_network( include: attributes to include, comma-separated if more than one to include Available values: `base_token`, `quote_token`, `dex` + include_gt_community_data: include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + page: page through results Default value: 1 extra_headers: Send extra headers @@ -273,6 +292,7 @@ async def get_network( { "duration": duration, "include": include, + "include_gt_community_data": include_gt_community_data, "page": page, }, trending_pool_get_network_params.TrendingPoolGetNetworkParams, diff --git a/src/coingecko_sdk/resources/onchain/simple/networks/token_price.py b/src/coingecko_sdk/resources/onchain/simple/networks/token_price.py index fc2bc71..43c0a57 100644 --- a/src/coingecko_sdk/resources/onchain/simple/networks/token_price.py +++ b/src/coingecko_sdk/resources/onchain/simple/networks/token_price.py @@ -48,6 +48,7 @@ def get_addresses( network: str, include_24hr_price_change: bool | Omit = omit, include_24hr_vol: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, include_market_cap: bool | Omit = omit, include_total_reserve_in_usd: bool | Omit = omit, mcap_fdv_fallback: bool | Omit = omit, @@ -67,6 +68,9 @@ def get_addresses( include_24hr_vol: include 24hr volume, default: false + include_inactive_source: include token price data from inactive pools using the most recent swap, + default: false + include_market_cap: include market capitalization, default: false include_total_reserve_in_usd: include total reserve in USD, default: false @@ -96,6 +100,7 @@ def get_addresses( { "include_24hr_price_change": include_24hr_price_change, "include_24hr_vol": include_24hr_vol, + "include_inactive_source": include_inactive_source, "include_market_cap": include_market_cap, "include_total_reserve_in_usd": include_total_reserve_in_usd, "mcap_fdv_fallback": mcap_fdv_fallback, @@ -134,6 +139,7 @@ async def get_addresses( network: str, include_24hr_price_change: bool | Omit = omit, include_24hr_vol: bool | Omit = omit, + include_inactive_source: bool | Omit = omit, include_market_cap: bool | Omit = omit, include_total_reserve_in_usd: bool | Omit = omit, mcap_fdv_fallback: bool | Omit = omit, @@ -153,6 +159,9 @@ async def get_addresses( include_24hr_vol: include 24hr volume, default: false + include_inactive_source: include token price data from inactive pools using the most recent swap, + default: false + include_market_cap: include market capitalization, default: false include_total_reserve_in_usd: include total reserve in USD, default: false @@ -182,6 +191,7 @@ async def get_addresses( { "include_24hr_price_change": include_24hr_price_change, "include_24hr_vol": include_24hr_vol, + "include_inactive_source": include_inactive_source, "include_market_cap": include_market_cap, "include_total_reserve_in_usd": include_total_reserve_in_usd, "mcap_fdv_fallback": mcap_fdv_fallback, diff --git a/src/coingecko_sdk/types/coin_get_id_params.py b/src/coingecko_sdk/types/coin_get_id_params.py index 20712d7..c130e52 100644 --- a/src/coingecko_sdk/types/coin_get_id_params.py +++ b/src/coingecko_sdk/types/coin_get_id_params.py @@ -20,6 +20,9 @@ class CoinGetIDParams(TypedDict, total=False): `contract_address` """ + include_categories_details: bool + """include categories details, default: false""" + localization: bool """include all the localized languages in the response, default: true""" diff --git a/src/coingecko_sdk/types/coin_get_id_response.py b/src/coingecko_sdk/types/coin_get_id_response.py index 1cddaf0..82b1d95 100644 --- a/src/coingecko_sdk/types/coin_get_id_response.py +++ b/src/coingecko_sdk/types/coin_get_id_response.py @@ -7,10 +7,12 @@ __all__ = [ "CoinGetIDResponse", + "CategoriesDetail", "CommunityData", "DetailPlatforms", "DeveloperData", "DeveloperDataCodeAdditionsDeletions4Weeks", + "IcoData", "Image", "Links", "LinksReposURL", @@ -44,6 +46,14 @@ ] +class CategoriesDetail(BaseModel): + id: Optional[str] = None + """category ID""" + + name: Optional[str] = None + """category name""" + + class CommunityData(BaseModel): """coin community data""" @@ -116,6 +126,100 @@ class DeveloperData(BaseModel): """coin repository total issues""" +class IcoData(BaseModel): + """coin ICO data""" + + accepting_currencies: Optional[str] = None + """accepting currencies""" + + amount_for_sale: Optional[float] = None + """amount for sale""" + + base_pre_sale_amount: Optional[float] = None + """base pre-sale amount""" + + base_public_sale_amount: Optional[float] = None + """base public sale amount""" + + bounty_detail_url: Optional[str] = None + """bounty detail url""" + + country_origin: Optional[str] = None + """country of origin""" + + description: Optional[str] = None + """detailed description""" + + hardcap_amount: Optional[float] = None + """hardcap amount""" + + hardcap_currency: Optional[str] = None + """hardcap currency""" + + ico_end_date: Optional[datetime] = None + """ICO end date""" + + ico_start_date: Optional[datetime] = None + """ICO start date""" + + kyc_required: Optional[bool] = None + """KYC required""" + + links: Optional[Dict[str, str]] = None + """ICO related links""" + + pre_sale_available: Optional[bool] = None + """pre-sale available""" + + pre_sale_end_date: Optional[datetime] = None + """pre-sale end date""" + + pre_sale_ended: Optional[bool] = None + """pre-sale ended""" + + pre_sale_start_date: Optional[datetime] = None + """pre-sale start date""" + + quote_pre_sale_amount: Optional[float] = None + """quote pre-sale amount""" + + quote_pre_sale_currency: Optional[str] = None + """quote pre-sale currency""" + + quote_public_sale_amount: Optional[float] = None + """quote public sale amount""" + + quote_public_sale_currency: Optional[str] = None + """quote public sale currency""" + + short_desc: Optional[str] = None + """short description""" + + softcap_amount: Optional[float] = None + """softcap amount""" + + softcap_currency: Optional[str] = None + """softcap currency""" + + total_raised: Optional[float] = None + """total raised amount""" + + total_raised_currency: Optional[str] = None + """total raised currency""" + + whitelist_available: Optional[bool] = None + """whitelist available""" + + whitelist_end_date: Optional[datetime] = None + """whitelist end date""" + + whitelist_start_date: Optional[datetime] = None + """whitelist start date""" + + whitelist_url: Optional[str] = None + """whitelist url""" + + class Image(BaseModel): """coin image url""" @@ -634,6 +738,9 @@ class CoinGetIDResponse(BaseModel): categories: Optional[List[str]] = None """coin categories""" + categories_details: Optional[List[CategoriesDetail]] = None + """detailed coin categories""" + community_data: Optional[CommunityData] = None """coin community data""" @@ -655,6 +762,9 @@ class CoinGetIDResponse(BaseModel): hashing_algorithm: Optional[str] = None """blockchain hashing algorithm""" + ico_data: Optional[IcoData] = None + """coin ICO data""" + image: Optional[Image] = None """coin image url""" diff --git a/src/coingecko_sdk/types/coins/circulating_supply_chart_get_params.py b/src/coingecko_sdk/types/coins/circulating_supply_chart_get_params.py index b64ae40..6d4b677 100644 --- a/src/coingecko_sdk/types/coins/circulating_supply_chart_get_params.py +++ b/src/coingecko_sdk/types/coins/circulating_supply_chart_get_params.py @@ -11,5 +11,5 @@ class CirculatingSupplyChartGetParams(TypedDict, total=False): days: Required[str] """data up to number of days ago Valid values: any integer or `max`""" - interval: Literal["daily"] + interval: Literal["5m", "hourly", "daily"] """data interval""" diff --git a/src/coingecko_sdk/types/coins/history_get_params.py b/src/coingecko_sdk/types/coins/history_get_params.py index 817e07e..3356177 100644 --- a/src/coingecko_sdk/types/coins/history_get_params.py +++ b/src/coingecko_sdk/types/coins/history_get_params.py @@ -9,7 +9,7 @@ class HistoryGetParams(TypedDict, total=False): date: Required[str] - """date of data snapshot (`YYYY-MM-DD` or `YYYY-MM-DDTHH:MM`)""" + """date of data snapshot (`YYYY-MM-DD`)""" localization: bool """include all the localized languages in response, default: true""" diff --git a/src/coingecko_sdk/types/onchain/networks/dex_get_pools_params.py b/src/coingecko_sdk/types/onchain/networks/dex_get_pools_params.py index 464f900..54e17cd 100644 --- a/src/coingecko_sdk/types/onchain/networks/dex_get_pools_params.py +++ b/src/coingecko_sdk/types/onchain/networks/dex_get_pools_params.py @@ -16,6 +16,12 @@ class DexGetPoolsParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/dex_get_pools_response.py b/src/coingecko_sdk/types/onchain/networks/dex_get_pools_response.py index acf3123..6a9fb73 100644 --- a/src/coingecko_sdk/types/onchain/networks/dex_get_pools_response.py +++ b/src/coingecko_sdk/types/onchain/networks/dex_get_pools_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_params.py b/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_params.py index fd5bc4a..c7f6994 100644 --- a/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_params.py +++ b/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_params.py @@ -14,5 +14,11 @@ class NewPoolGetNetworkParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_response.py b/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_response.py index 4c2acec..afa6f63 100644 --- a/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_response.py +++ b/src/coingecko_sdk/types/onchain/networks/new_pool_get_network_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/networks/new_pool_get_params.py b/src/coingecko_sdk/types/onchain/networks/new_pool_get_params.py index 2e1688f..82fbf88 100644 --- a/src/coingecko_sdk/types/onchain/networks/new_pool_get_params.py +++ b/src/coingecko_sdk/types/onchain/networks/new_pool_get_params.py @@ -14,5 +14,11 @@ class NewPoolGetParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex`, `network` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/new_pool_get_response.py b/src/coingecko_sdk/types/onchain/networks/new_pool_get_response.py index e5bd308..39a0605 100644 --- a/src/coingecko_sdk/types/onchain/networks/new_pool_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/new_pool_get_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/networks/pool_get_params.py b/src/coingecko_sdk/types/onchain/networks/pool_get_params.py index 91a0e8d..75f0ec2 100644 --- a/src/coingecko_sdk/types/onchain/networks/pool_get_params.py +++ b/src/coingecko_sdk/types/onchain/networks/pool_get_params.py @@ -14,6 +14,12 @@ class PoolGetParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/pool_get_response.py b/src/coingecko_sdk/types/onchain/networks/pool_get_response.py index 269180c..ea17ff8 100644 --- a/src/coingecko_sdk/types/onchain/networks/pool_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/pool_get_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/networks/pools/info_get_response.py b/src/coingecko_sdk/types/onchain/networks/pools/info_get_response.py index ff6f8da..599f359 100644 --- a/src/coingecko_sdk/types/onchain/networks/pools/info_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/pools/info_get_response.py @@ -69,6 +69,8 @@ class DataDataAttributes(BaseModel): discord_url: Optional[str] = None + farcaster_url: Optional[str] = None + freeze_authority: Optional[str] = None gt_categories_id: Optional[List[str]] = None @@ -97,6 +99,8 @@ class DataDataAttributes(BaseModel): websites: Optional[List[str]] = None + zora_url: Optional[str] = None + class DataData(BaseModel): id: Optional[str] = None diff --git a/src/coingecko_sdk/types/onchain/networks/token_get_address_params.py b/src/coingecko_sdk/types/onchain/networks/token_get_address_params.py index 27f9096..73f91bc 100644 --- a/src/coingecko_sdk/types/onchain/networks/token_get_address_params.py +++ b/src/coingecko_sdk/types/onchain/networks/token_get_address_params.py @@ -15,3 +15,9 @@ class TokenGetAddressParams(TypedDict, total=False): include_composition: bool """include pool composition, default: false""" + + include_inactive_source: bool + """ + include token data from inactive pools using the most recent swap, default: + false + """ diff --git a/src/coingecko_sdk/types/onchain/networks/token_get_address_response.py b/src/coingecko_sdk/types/onchain/networks/token_get_address_response.py index c17c634..c05f46b 100644 --- a/src/coingecko_sdk/types/onchain/networks/token_get_address_response.py +++ b/src/coingecko_sdk/types/onchain/networks/token_get_address_response.py @@ -48,6 +48,8 @@ class DataAttributes(BaseModel): image_url: Optional[str] = None + last_trade_timestamp: Optional[int] = None + market_cap_usd: Optional[str] = None name: Optional[str] = None diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/info_get_response.py b/src/coingecko_sdk/types/onchain/networks/tokens/info_get_response.py index a56cb14..f63f9fe 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/info_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/info_get_response.py @@ -66,6 +66,8 @@ class DataAttributes(BaseModel): discord_url: Optional[str] = None + farcaster_url: Optional[str] = None + freeze_authority: Optional[str] = None gt_categories_id: Optional[List[str]] = None @@ -94,6 +96,8 @@ class DataAttributes(BaseModel): websites: Optional[List[str]] = None + zora_url: Optional[str] = None + class Data(BaseModel): id: Optional[str] = None diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_params.py b/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_params.py index a933283..efd682f 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_params.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_params.py @@ -15,3 +15,6 @@ class MultiGetAddressesParams(TypedDict, total=False): include_composition: bool """include pool composition, default: false""" + + include_inactive_source: bool + """include tokens from inactive pools using the most recent swap, default: false""" diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_response.py b/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_response.py index f671dd6..38d7db3 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_response.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/multi_get_addresses_response.py @@ -59,6 +59,8 @@ class DataAttributes(BaseModel): image_url: Optional[str] = None + last_trade_timestamp: Optional[int] = None + launchpad_details: Optional[DataAttributesLaunchpadDetails] = None market_cap_usd: Optional[str] = None diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/ohlcv_get_timeframe_params.py b/src/coingecko_sdk/types/onchain/networks/tokens/ohlcv_get_timeframe_params.py index b17277e..cb99ba9 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/ohlcv_get_timeframe_params.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/ohlcv_get_timeframe_params.py @@ -28,5 +28,11 @@ class OhlcvGetTimeframeParams(TypedDict, total=False): include_empty_intervals: bool """include empty intervals with no trade data, default: false""" + include_inactive_source: bool + """ + include token data from inactive pools using the most recent swap, default: + false + """ + limit: int """number of OHLCV results to return, maximum 1000 Default value: 100""" diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_params.py b/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_params.py index d78f196..28a06e9 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_params.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_params.py @@ -16,6 +16,9 @@ class PoolGetParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex` """ + include_inactive_source: bool + """include tokens from inactive pools using the most recent swap, default: false""" + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_response.py b/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_response.py index bf6f816..65d6538 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/pool_get_response.py @@ -129,6 +129,8 @@ class DataAttributes(BaseModel): fdv_usd: Optional[str] = None + last_trade_timestamp: Optional[int] = None + market_cap_usd: Optional[str] = None name: Optional[str] = None diff --git a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_params.py b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_params.py index 881f726..f052b31 100644 --- a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_params.py +++ b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_params.py @@ -17,5 +17,11 @@ class TrendingPoolGetNetworkParams(TypedDict, total=False): values: `base_token`, `quote_token`, `dex` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_response.py b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_response.py index 78455e5..efbb4f7 100644 --- a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_response.py +++ b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_network_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_params.py b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_params.py index 9449a95..5c32e0a 100644 --- a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_params.py +++ b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_params.py @@ -18,5 +18,11 @@ class TrendingPoolGetParams(TypedDict, total=False): `base_token,dex` """ + include_gt_community_data: bool + """ + include GeckoTerminal community data (Sentiment votes, Suspicious reports) + Default value: false + """ + page: int """page through results Default value: 1""" diff --git a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_response.py b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_response.py index 2de6a0a..2741d9c 100644 --- a/src/coingecko_sdk/types/onchain/networks/trending_pool_get_response.py +++ b/src/coingecko_sdk/types/onchain/networks/trending_pool_get_response.py @@ -127,6 +127,8 @@ class DataAttributes(BaseModel): base_token_price_usd: Optional[str] = None + community_sus_report: Optional[float] = None + fdv_usd: Optional[str] = None market_cap_usd: Optional[str] = None @@ -145,6 +147,10 @@ class DataAttributes(BaseModel): reserve_in_usd: Optional[str] = None + sentiment_vote_negative_percentage: Optional[float] = None + + sentiment_vote_positive_percentage: Optional[float] = None + transactions: Optional[DataAttributesTransactions] = None volume_usd: Optional[DataAttributesVolumeUsd] = None diff --git a/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_params.py b/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_params.py index 2fdd46d..e205f97 100644 --- a/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_params.py +++ b/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_params.py @@ -16,6 +16,12 @@ class TokenPriceGetAddressesParams(TypedDict, total=False): include_24hr_vol: bool """include 24hr volume, default: false""" + include_inactive_source: bool + """ + include token price data from inactive pools using the most recent swap, + default: false + """ + include_market_cap: bool """include market capitalization, default: false""" diff --git a/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_response.py b/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_response.py index f3ac9db..c1b107d 100644 --- a/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_response.py +++ b/src/coingecko_sdk/types/onchain/simple/networks/token_price_get_addresses_response.py @@ -8,8 +8,18 @@ class DataAttributes(BaseModel): + h24_price_change_percentage: Optional[Dict[str, str]] = None + + h24_volume_usd: Optional[Dict[str, str]] = None + + last_trade_timestamp: Optional[Dict[str, int]] = None + + market_cap_usd: Optional[Dict[str, str]] = None + token_prices: Optional[Dict[str, str]] = None + total_reserve_in_usd: Optional[Dict[str, str]] = None + class Data(BaseModel): id: Optional[str] = None diff --git a/tests/api_resources/coins/test_circulating_supply_chart.py b/tests/api_resources/coins/test_circulating_supply_chart.py index 660b1b4..ddaba9c 100644 --- a/tests/api_resources/coins/test_circulating_supply_chart.py +++ b/tests/api_resources/coins/test_circulating_supply_chart.py @@ -35,7 +35,7 @@ def test_method_get_with_all_params(self, client: Coingecko) -> None: circulating_supply_chart = client.coins.circulating_supply_chart.get( id="bitcoin", days="days", - interval="daily", + interval="5m", ) assert_matches_type(CirculatingSupplyChartGetResponse, circulating_supply_chart, path=["response"]) @@ -147,7 +147,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> circulating_supply_chart = await async_client.coins.circulating_supply_chart.get( id="bitcoin", days="days", - interval="daily", + interval="5m", ) assert_matches_type(CirculatingSupplyChartGetResponse, circulating_supply_chart, path=["response"]) diff --git a/tests/api_resources/onchain/networks/test_dexes.py b/tests/api_resources/onchain/networks/test_dexes.py index e9f185b..63225c1 100644 --- a/tests/api_resources/onchain/networks/test_dexes.py +++ b/tests/api_resources/onchain/networks/test_dexes.py @@ -87,6 +87,7 @@ def test_method_get_pools_with_all_params(self, client: Coingecko) -> None: dex="sushiswap", network="eth", include="include", + include_gt_community_data=True, page=0, sort="h24_tx_count_desc", ) @@ -208,6 +209,7 @@ async def test_method_get_pools_with_all_params(self, async_client: AsyncCoingec dex="sushiswap", network="eth", include="include", + include_gt_community_data=True, page=0, sort="h24_tx_count_desc", ) diff --git a/tests/api_resources/onchain/networks/test_new_pools.py b/tests/api_resources/onchain/networks/test_new_pools.py index 290cbbe..14b86ba 100644 --- a/tests/api_resources/onchain/networks/test_new_pools.py +++ b/tests/api_resources/onchain/networks/test_new_pools.py @@ -31,6 +31,7 @@ def test_method_get(self, client: Coingecko) -> None: def test_method_get_with_all_params(self, client: Coingecko) -> None: new_pool = client.onchain.networks.new_pools.get( include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(NewPoolGetResponse, new_pool, path=["response"]) @@ -71,6 +72,7 @@ def test_method_get_network_with_all_params(self, client: Coingecko) -> None: new_pool = client.onchain.networks.new_pools.get_network( network="eth", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(NewPoolGetNetworkResponse, new_pool, path=["response"]) @@ -126,6 +128,7 @@ async def test_method_get(self, async_client: AsyncCoingecko) -> None: async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> None: new_pool = await async_client.onchain.networks.new_pools.get( include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(NewPoolGetResponse, new_pool, path=["response"]) @@ -166,6 +169,7 @@ async def test_method_get_network_with_all_params(self, async_client: AsyncCoing new_pool = await async_client.onchain.networks.new_pools.get_network( network="eth", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(NewPoolGetNetworkResponse, new_pool, path=["response"]) diff --git a/tests/api_resources/onchain/networks/test_pools.py b/tests/api_resources/onchain/networks/test_pools.py index 011a442..1b4f250 100644 --- a/tests/api_resources/onchain/networks/test_pools.py +++ b/tests/api_resources/onchain/networks/test_pools.py @@ -34,6 +34,7 @@ def test_method_get_with_all_params(self, client: Coingecko) -> None: pool = client.onchain.networks.pools.get( network="eth", include="include", + include_gt_community_data=True, page=0, sort="h24_tx_count_desc", ) @@ -157,6 +158,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> pool = await async_client.onchain.networks.pools.get( network="eth", include="include", + include_gt_community_data=True, page=0, sort="h24_tx_count_desc", ) diff --git a/tests/api_resources/onchain/networks/test_tokens.py b/tests/api_resources/onchain/networks/test_tokens.py index 842264b..8981964 100644 --- a/tests/api_resources/onchain/networks/test_tokens.py +++ b/tests/api_resources/onchain/networks/test_tokens.py @@ -34,6 +34,7 @@ def test_method_get_address_with_all_params(self, client: Coingecko) -> None: network="eth", include="top_pools", include_composition=True, + include_inactive_source=True, ) assert_matches_type(TokenGetAddressResponse, token, path=["response"]) @@ -103,6 +104,7 @@ async def test_method_get_address_with_all_params(self, async_client: AsyncCoing network="eth", include="top_pools", include_composition=True, + include_inactive_source=True, ) assert_matches_type(TokenGetAddressResponse, token, path=["response"]) diff --git a/tests/api_resources/onchain/networks/test_trending_pools.py b/tests/api_resources/onchain/networks/test_trending_pools.py index 0217ead..06bcf9d 100644 --- a/tests/api_resources/onchain/networks/test_trending_pools.py +++ b/tests/api_resources/onchain/networks/test_trending_pools.py @@ -32,6 +32,7 @@ def test_method_get_with_all_params(self, client: Coingecko) -> None: trending_pool = client.onchain.networks.trending_pools.get( duration="5m", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(TrendingPoolGetResponse, trending_pool, path=["response"]) @@ -73,6 +74,7 @@ def test_method_get_network_with_all_params(self, client: Coingecko) -> None: network="eth", duration="5m", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(TrendingPoolGetNetworkResponse, trending_pool, path=["response"]) @@ -129,6 +131,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> trending_pool = await async_client.onchain.networks.trending_pools.get( duration="5m", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(TrendingPoolGetResponse, trending_pool, path=["response"]) @@ -170,6 +173,7 @@ async def test_method_get_network_with_all_params(self, async_client: AsyncCoing network="eth", duration="5m", include="include", + include_gt_community_data=True, page=0, ) assert_matches_type(TrendingPoolGetNetworkResponse, trending_pool, path=["response"]) diff --git a/tests/api_resources/onchain/networks/tokens/test_multi.py b/tests/api_resources/onchain/networks/tokens/test_multi.py index 181959c..756ba80 100644 --- a/tests/api_resources/onchain/networks/tokens/test_multi.py +++ b/tests/api_resources/onchain/networks/tokens/test_multi.py @@ -34,6 +34,7 @@ def test_method_get_addresses_with_all_params(self, client: Coingecko) -> None: network="solana", include="top_pools", include_composition=True, + include_inactive_source=True, ) assert_matches_type(MultiGetAddressesResponse, multi, path=["response"]) @@ -103,6 +104,7 @@ async def test_method_get_addresses_with_all_params(self, async_client: AsyncCoi network="solana", include="top_pools", include_composition=True, + include_inactive_source=True, ) assert_matches_type(MultiGetAddressesResponse, multi, path=["response"]) diff --git a/tests/api_resources/onchain/networks/tokens/test_ohlcv.py b/tests/api_resources/onchain/networks/tokens/test_ohlcv.py index 9e2948e..c92e5a7 100644 --- a/tests/api_resources/onchain/networks/tokens/test_ohlcv.py +++ b/tests/api_resources/onchain/networks/tokens/test_ohlcv.py @@ -38,6 +38,7 @@ def test_method_get_timeframe_with_all_params(self, client: Coingecko) -> None: before_timestamp=0, currency="usd", include_empty_intervals=True, + include_inactive_source=True, limit=0, ) assert_matches_type(OhlcvGetTimeframeResponse, ohlcv, path=["response"]) @@ -116,6 +117,7 @@ async def test_method_get_timeframe_with_all_params(self, async_client: AsyncCoi before_timestamp=0, currency="usd", include_empty_intervals=True, + include_inactive_source=True, limit=0, ) assert_matches_type(OhlcvGetTimeframeResponse, ohlcv, path=["response"]) diff --git a/tests/api_resources/onchain/networks/tokens/test_pools.py b/tests/api_resources/onchain/networks/tokens/test_pools.py index acb7288..d569925 100644 --- a/tests/api_resources/onchain/networks/tokens/test_pools.py +++ b/tests/api_resources/onchain/networks/tokens/test_pools.py @@ -33,6 +33,7 @@ def test_method_get_with_all_params(self, client: Coingecko) -> None: token_address="0xdac17f958d2ee523a2206206994597c13d831ec7", network="eth", include="include", + include_inactive_source=True, page=0, sort="h24_volume_usd_liquidity_desc", ) @@ -103,6 +104,7 @@ async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> token_address="0xdac17f958d2ee523a2206206994597c13d831ec7", network="eth", include="include", + include_inactive_source=True, page=0, sort="h24_volume_usd_liquidity_desc", ) diff --git a/tests/api_resources/onchain/simple/networks/test_token_price.py b/tests/api_resources/onchain/simple/networks/test_token_price.py index dfe9466..d8bcc3f 100644 --- a/tests/api_resources/onchain/simple/networks/test_token_price.py +++ b/tests/api_resources/onchain/simple/networks/test_token_price.py @@ -34,6 +34,7 @@ def test_method_get_addresses_with_all_params(self, client: Coingecko) -> None: network="eth", include_24hr_price_change=True, include_24hr_vol=True, + include_inactive_source=True, include_market_cap=True, include_total_reserve_in_usd=True, mcap_fdv_fallback=True, @@ -106,6 +107,7 @@ async def test_method_get_addresses_with_all_params(self, async_client: AsyncCoi network="eth", include_24hr_price_change=True, include_24hr_vol=True, + include_inactive_source=True, include_market_cap=True, include_total_reserve_in_usd=True, mcap_fdv_fallback=True, diff --git a/tests/api_resources/test_coins.py b/tests/api_resources/test_coins.py index 36c40c7..15d63c5 100644 --- a/tests/api_resources/test_coins.py +++ b/tests/api_resources/test_coins.py @@ -33,6 +33,7 @@ def test_method_get_id_with_all_params(self, client: Coingecko) -> None: community_data=True, developer_data=True, dex_pair_format="contract_address", + include_categories_details=True, localization=True, market_data=True, sparkline=True, @@ -96,6 +97,7 @@ async def test_method_get_id_with_all_params(self, async_client: AsyncCoingecko) community_data=True, developer_data=True, dex_pair_format="contract_address", + include_categories_details=True, localization=True, market_data=True, sparkline=True, From 9a717af9715da994018f8fbb9b3199e1bf3929ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:17:35 +0000 Subject: [PATCH 2/3] feat(api): manual updates --- .stats.yml | 4 +- api.md | 21 +- .../onchain/networks/tokens/__init__.py | 14 + .../onchain/networks/tokens/tokens.py | 32 ++ .../onchain/networks/tokens/top_traders.py | 219 ++++++++++++++ .../resources/public_treasury.py | 274 +++++++++++++++++- src/coingecko_sdk/types/__init__.py | 12 + .../types/onchain/networks/tokens/__init__.py | 2 + .../networks/tokens/top_trader_get_params.py | 23 ++ .../tokens/top_trader_get_response.py | 57 ++++ ...ublic_treasury_get_holding_chart_params.py | 17 ++ ...lic_treasury_get_holding_chart_response.py | 13 + ...treasury_get_transaction_history_params.py | 33 +++ ...easury_get_transaction_history_response.py | 38 +++ .../networks/tokens/test_top_traders.py | 152 ++++++++++ tests/api_resources/test_public_treasury.py | 251 +++++++++++++++- 16 files changed, 1157 insertions(+), 5 deletions(-) create mode 100644 src/coingecko_sdk/resources/onchain/networks/tokens/top_traders.py create mode 100644 src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_params.py create mode 100644 src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_response.py create mode 100644 src/coingecko_sdk/types/public_treasury_get_holding_chart_params.py create mode 100644 src/coingecko_sdk/types/public_treasury_get_holding_chart_response.py create mode 100644 src/coingecko_sdk/types/public_treasury_get_transaction_history_params.py create mode 100644 src/coingecko_sdk/types/public_treasury_get_transaction_history_response.py create mode 100644 tests/api_resources/onchain/networks/tokens/test_top_traders.py diff --git a/.stats.yml b/.stats.yml index 43ccdcf..f25cd48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 81 +configured_endpoints: 84 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/coingecko%2Fcoingecko-a23494dedfc230f769076f4022de83a327d642db68ceadedf998921c66ff9310.yml openapi_spec_hash: 0bcc6962d4ee8f39880019986e87e433 -config_hash: 7710c0bb2c0cea0ec5a44596f81188a6 +config_hash: f101f417dba7f9352f7573639dd5938f diff --git a/api.md b/api.md index 8d2beb0..8bd9490 100644 --- a/api.md +++ b/api.md @@ -605,6 +605,18 @@ Methods: - client.onchain.networks.tokens.trades.get(token_address, \*, network, \*\*params) -> TradeGetResponse +#### TopTraders + +Types: + +```python +from coingecko_sdk.types.onchain.networks.tokens import TopTraderGetResponse +``` + +Methods: + +- client.onchain.networks.tokens.top_traders.get(token_address, \*, network_id, \*\*params) -> TopTraderGetResponse + ## Pools ### Megafilter @@ -692,13 +704,20 @@ Methods: Types: ```python -from coingecko_sdk.types import PublicTreasuryGetCoinIDResponse, PublicTreasuryGetEntityIDResponse +from coingecko_sdk.types import ( + PublicTreasuryGetCoinIDResponse, + PublicTreasuryGetEntityIDResponse, + PublicTreasuryGetHoldingChartResponse, + PublicTreasuryGetTransactionHistoryResponse, +) ``` Methods: - client.public_treasury.get_coin_id(coin_id, \*, entity) -> PublicTreasuryGetCoinIDResponse - client.public_treasury.get_entity_id(entity_id) -> PublicTreasuryGetEntityIDResponse +- client.public_treasury.get_holding_chart(coin_id, \*, entity_id, \*\*params) -> PublicTreasuryGetHoldingChartResponse +- client.public_treasury.get_transaction_history(entity_id, \*\*params) -> PublicTreasuryGetTransactionHistoryResponse # Search diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/__init__.py b/src/coingecko_sdk/resources/onchain/networks/tokens/__init__.py index 40814f4..4c1a9b7 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/__init__.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/__init__.py @@ -56,6 +56,14 @@ TopHoldersResourceWithStreamingResponse, AsyncTopHoldersResourceWithStreamingResponse, ) +from .top_traders import ( + TopTradersResource, + AsyncTopTradersResource, + TopTradersResourceWithRawResponse, + AsyncTopTradersResourceWithRawResponse, + TopTradersResourceWithStreamingResponse, + AsyncTopTradersResourceWithStreamingResponse, +) from .holders_chart import ( HoldersChartResource, AsyncHoldersChartResource, @@ -108,6 +116,12 @@ "AsyncTradesResourceWithRawResponse", "TradesResourceWithStreamingResponse", "AsyncTradesResourceWithStreamingResponse", + "TopTradersResource", + "AsyncTopTradersResource", + "TopTradersResourceWithRawResponse", + "AsyncTopTradersResourceWithRawResponse", + "TopTradersResourceWithStreamingResponse", + "AsyncTopTradersResourceWithStreamingResponse", "TokensResource", "AsyncTokensResource", "TokensResourceWithRawResponse", diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py b/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py index 99b7f14..b99a441 100644 --- a/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/tokens.py @@ -57,6 +57,14 @@ TopHoldersResourceWithStreamingResponse, AsyncTopHoldersResourceWithStreamingResponse, ) +from .top_traders import ( + TopTradersResource, + AsyncTopTradersResource, + TopTradersResourceWithRawResponse, + AsyncTopTradersResourceWithRawResponse, + TopTradersResourceWithStreamingResponse, + AsyncTopTradersResourceWithStreamingResponse, +) from ....._resource import SyncAPIResource, AsyncAPIResource from ....._response import ( to_raw_response_wrapper, @@ -108,6 +116,10 @@ def pools(self) -> PoolsResource: def trades(self) -> TradesResource: return TradesResource(self._client) + @cached_property + def top_traders(self) -> TopTradersResource: + return TopTradersResource(self._client) + @cached_property def with_raw_response(self) -> TokensResourceWithRawResponse: """ @@ -216,6 +228,10 @@ def pools(self) -> AsyncPoolsResource: def trades(self) -> AsyncTradesResource: return AsyncTradesResource(self._client) + @cached_property + def top_traders(self) -> AsyncTopTradersResource: + return AsyncTopTradersResource(self._client) + @cached_property def with_raw_response(self) -> AsyncTokensResourceWithRawResponse: """ @@ -331,6 +347,10 @@ def pools(self) -> PoolsResourceWithRawResponse: def trades(self) -> TradesResourceWithRawResponse: return TradesResourceWithRawResponse(self._tokens.trades) + @cached_property + def top_traders(self) -> TopTradersResourceWithRawResponse: + return TopTradersResourceWithRawResponse(self._tokens.top_traders) + class AsyncTokensResourceWithRawResponse: def __init__(self, tokens: AsyncTokensResource) -> None: @@ -368,6 +388,10 @@ def pools(self) -> AsyncPoolsResourceWithRawResponse: def trades(self) -> AsyncTradesResourceWithRawResponse: return AsyncTradesResourceWithRawResponse(self._tokens.trades) + @cached_property + def top_traders(self) -> AsyncTopTradersResourceWithRawResponse: + return AsyncTopTradersResourceWithRawResponse(self._tokens.top_traders) + class TokensResourceWithStreamingResponse: def __init__(self, tokens: TokensResource) -> None: @@ -405,6 +429,10 @@ def pools(self) -> PoolsResourceWithStreamingResponse: def trades(self) -> TradesResourceWithStreamingResponse: return TradesResourceWithStreamingResponse(self._tokens.trades) + @cached_property + def top_traders(self) -> TopTradersResourceWithStreamingResponse: + return TopTradersResourceWithStreamingResponse(self._tokens.top_traders) + class AsyncTokensResourceWithStreamingResponse: def __init__(self, tokens: AsyncTokensResource) -> None: @@ -441,3 +469,7 @@ def pools(self) -> AsyncPoolsResourceWithStreamingResponse: @cached_property def trades(self) -> AsyncTradesResourceWithStreamingResponse: return AsyncTradesResourceWithStreamingResponse(self._tokens.trades) + + @cached_property + def top_traders(self) -> AsyncTopTradersResourceWithStreamingResponse: + return AsyncTopTradersResourceWithStreamingResponse(self._tokens.top_traders) diff --git a/src/coingecko_sdk/resources/onchain/networks/tokens/top_traders.py b/src/coingecko_sdk/resources/onchain/networks/tokens/top_traders.py new file mode 100644 index 0000000..812873e --- /dev/null +++ b/src/coingecko_sdk/resources/onchain/networks/tokens/top_traders.py @@ -0,0 +1,219 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal + +import httpx + +from ....._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from ....._utils import maybe_transform, async_maybe_transform +from ....._compat import cached_property +from ....._resource import SyncAPIResource, AsyncAPIResource +from ....._response import ( + to_raw_response_wrapper, + to_streamed_response_wrapper, + async_to_raw_response_wrapper, + async_to_streamed_response_wrapper, +) +from ....._base_client import make_request_options +from .....types.onchain.networks.tokens import top_trader_get_params +from .....types.onchain.networks.tokens.top_trader_get_response import TopTraderGetResponse + +__all__ = ["TopTradersResource", "AsyncTopTradersResource"] + + +class TopTradersResource(SyncAPIResource): + @cached_property + def with_raw_response(self) -> TopTradersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/coingecko/coingecko-python#accessing-raw-response-data-eg-headers + """ + return TopTradersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> TopTradersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/coingecko/coingecko-python#with_streaming_response + """ + return TopTradersResourceWithStreamingResponse(self) + + def get( + self, + token_address: str, + *, + network_id: str, + include_address_label: bool | Omit = omit, + sort: Literal["realized_pnl_usd_desc", "unrealized_pnl_usd_desc", "total_buy_usd_desc", "total_sell_usd_desc"] + | Omit = omit, + traders: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> TopTraderGetResponse: + """ + This endpoint allows you to **query top token traders based on the provided + token contract address on a network** + + Args: + include_address_label: include address label data, default: false + + sort: sort the traders by field Default value: realized_pnl_usd_desc + + traders: number of top token traders to return, you may use any integer or `max` Default + value: 10 + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not network_id: + raise ValueError(f"Expected a non-empty value for `network_id` but received {network_id!r}") + if not token_address: + raise ValueError(f"Expected a non-empty value for `token_address` but received {token_address!r}") + return self._get( + f"/onchain/networks/{network_id}/tokens/{token_address}/top_traders", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "include_address_label": include_address_label, + "sort": sort, + "traders": traders, + }, + top_trader_get_params.TopTraderGetParams, + ), + ), + cast_to=TopTraderGetResponse, + ) + + +class AsyncTopTradersResource(AsyncAPIResource): + @cached_property + def with_raw_response(self) -> AsyncTopTradersResourceWithRawResponse: + """ + This property can be used as a prefix for any HTTP method call to return + the raw response object instead of the parsed content. + + For more information, see https://www.github.com/coingecko/coingecko-python#accessing-raw-response-data-eg-headers + """ + return AsyncTopTradersResourceWithRawResponse(self) + + @cached_property + def with_streaming_response(self) -> AsyncTopTradersResourceWithStreamingResponse: + """ + An alternative to `.with_raw_response` that doesn't eagerly read the response body. + + For more information, see https://www.github.com/coingecko/coingecko-python#with_streaming_response + """ + return AsyncTopTradersResourceWithStreamingResponse(self) + + async def get( + self, + token_address: str, + *, + network_id: str, + include_address_label: bool | Omit = omit, + sort: Literal["realized_pnl_usd_desc", "unrealized_pnl_usd_desc", "total_buy_usd_desc", "total_sell_usd_desc"] + | Omit = omit, + traders: str | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> TopTraderGetResponse: + """ + This endpoint allows you to **query top token traders based on the provided + token contract address on a network** + + Args: + include_address_label: include address label data, default: false + + sort: sort the traders by field Default value: realized_pnl_usd_desc + + traders: number of top token traders to return, you may use any integer or `max` Default + value: 10 + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not network_id: + raise ValueError(f"Expected a non-empty value for `network_id` but received {network_id!r}") + if not token_address: + raise ValueError(f"Expected a non-empty value for `token_address` but received {token_address!r}") + return await self._get( + f"/onchain/networks/{network_id}/tokens/{token_address}/top_traders", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "include_address_label": include_address_label, + "sort": sort, + "traders": traders, + }, + top_trader_get_params.TopTraderGetParams, + ), + ), + cast_to=TopTraderGetResponse, + ) + + +class TopTradersResourceWithRawResponse: + def __init__(self, top_traders: TopTradersResource) -> None: + self._top_traders = top_traders + + self.get = to_raw_response_wrapper( + top_traders.get, + ) + + +class AsyncTopTradersResourceWithRawResponse: + def __init__(self, top_traders: AsyncTopTradersResource) -> None: + self._top_traders = top_traders + + self.get = async_to_raw_response_wrapper( + top_traders.get, + ) + + +class TopTradersResourceWithStreamingResponse: + def __init__(self, top_traders: TopTradersResource) -> None: + self._top_traders = top_traders + + self.get = to_streamed_response_wrapper( + top_traders.get, + ) + + +class AsyncTopTradersResourceWithStreamingResponse: + def __init__(self, top_traders: AsyncTopTradersResource) -> None: + self._top_traders = top_traders + + self.get = async_to_streamed_response_wrapper( + top_traders.get, + ) diff --git a/src/coingecko_sdk/resources/public_treasury.py b/src/coingecko_sdk/resources/public_treasury.py index 77a6055..9052aff 100644 --- a/src/coingecko_sdk/resources/public_treasury.py +++ b/src/coingecko_sdk/resources/public_treasury.py @@ -6,7 +6,9 @@ import httpx -from .._types import Body, Query, Headers, NotGiven, not_given +from ..types import public_treasury_get_holding_chart_params, public_treasury_get_transaction_history_params +from .._types import Body, Omit, Query, Headers, NotGiven, omit, not_given +from .._utils import maybe_transform, async_maybe_transform from .._compat import cached_property from .._resource import SyncAPIResource, AsyncAPIResource from .._response import ( @@ -18,6 +20,8 @@ from .._base_client import make_request_options from ..types.public_treasury_get_coin_id_response import PublicTreasuryGetCoinIDResponse from ..types.public_treasury_get_entity_id_response import PublicTreasuryGetEntityIDResponse +from ..types.public_treasury_get_holding_chart_response import PublicTreasuryGetHoldingChartResponse +from ..types.public_treasury_get_transaction_history_response import PublicTreasuryGetTransactionHistoryResponse __all__ = ["PublicTreasuryResource", "AsyncPublicTreasuryResource"] @@ -113,6 +117,128 @@ def get_entity_id( cast_to=PublicTreasuryGetEntityIDResponse, ) + def get_holding_chart( + self, + coin_id: str, + *, + entity_id: str, + days: str, + include_empty_intervals: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PublicTreasuryGetHoldingChartResponse: + """ + This endpoint allows you to **query historical cryptocurrency holdings chart of + public companies & governments** by Entity ID and Coin ID + + Args: + days: data up to number of days ago Valid values: `7, 14, 30, 90, 180, 365, 730, max` + + include_empty_intervals: include empty intervals with no transaction data, default: false + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not entity_id: + raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + if not coin_id: + raise ValueError(f"Expected a non-empty value for `coin_id` but received {coin_id!r}") + return self._get( + f"/public_treasury/{entity_id}/{coin_id}/holding_chart", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "days": days, + "include_empty_intervals": include_empty_intervals, + }, + public_treasury_get_holding_chart_params.PublicTreasuryGetHoldingChartParams, + ), + ), + cast_to=PublicTreasuryGetHoldingChartResponse, + ) + + def get_transaction_history( + self, + entity_id: str, + *, + coin_ids: str | Omit = omit, + order: Literal[ + "date_desc", + "date_asc", + "holding_net_change_desc", + "holding_net_change_asc", + "transaction_value_usd_desc", + "transaction_value_usd_asc", + "average_cost_desc", + "average_cost_asc", + ] + | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PublicTreasuryGetTransactionHistoryResponse: + """ + This endpoint allows you **query public companies & governments' cryptocurrency + transaction history** by Entity ID + + Args: + coin_ids: filter transactions by coin IDs, comma-separated if querying more than 1 coin + \\**refers to [`/coins/list`](/reference/coins-list). + + order: use this to sort the order of transactions, default: `date_desc` + + page: page through results, default: `1` + + per_page: total results per page, default: `100` Valid values: 1...250 + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not entity_id: + raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + return self._get( + f"/public_treasury/{entity_id}/transaction_history", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=maybe_transform( + { + "coin_ids": coin_ids, + "order": order, + "page": page, + "per_page": per_page, + }, + public_treasury_get_transaction_history_params.PublicTreasuryGetTransactionHistoryParams, + ), + ), + cast_to=PublicTreasuryGetTransactionHistoryResponse, + ) + class AsyncPublicTreasuryResource(AsyncAPIResource): @cached_property @@ -205,6 +331,128 @@ async def get_entity_id( cast_to=PublicTreasuryGetEntityIDResponse, ) + async def get_holding_chart( + self, + coin_id: str, + *, + entity_id: str, + days: str, + include_empty_intervals: bool | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PublicTreasuryGetHoldingChartResponse: + """ + This endpoint allows you to **query historical cryptocurrency holdings chart of + public companies & governments** by Entity ID and Coin ID + + Args: + days: data up to number of days ago Valid values: `7, 14, 30, 90, 180, 365, 730, max` + + include_empty_intervals: include empty intervals with no transaction data, default: false + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not entity_id: + raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + if not coin_id: + raise ValueError(f"Expected a non-empty value for `coin_id` but received {coin_id!r}") + return await self._get( + f"/public_treasury/{entity_id}/{coin_id}/holding_chart", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "days": days, + "include_empty_intervals": include_empty_intervals, + }, + public_treasury_get_holding_chart_params.PublicTreasuryGetHoldingChartParams, + ), + ), + cast_to=PublicTreasuryGetHoldingChartResponse, + ) + + async def get_transaction_history( + self, + entity_id: str, + *, + coin_ids: str | Omit = omit, + order: Literal[ + "date_desc", + "date_asc", + "holding_net_change_desc", + "holding_net_change_asc", + "transaction_value_usd_desc", + "transaction_value_usd_asc", + "average_cost_desc", + "average_cost_asc", + ] + | Omit = omit, + page: float | Omit = omit, + per_page: float | Omit = omit, + # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. + # The extra values given here take precedence over values defined on the client or passed to this method. + extra_headers: Headers | None = None, + extra_query: Query | None = None, + extra_body: Body | None = None, + timeout: float | httpx.Timeout | None | NotGiven = not_given, + ) -> PublicTreasuryGetTransactionHistoryResponse: + """ + This endpoint allows you **query public companies & governments' cryptocurrency + transaction history** by Entity ID + + Args: + coin_ids: filter transactions by coin IDs, comma-separated if querying more than 1 coin + \\**refers to [`/coins/list`](/reference/coins-list). + + order: use this to sort the order of transactions, default: `date_desc` + + page: page through results, default: `1` + + per_page: total results per page, default: `100` Valid values: 1...250 + + extra_headers: Send extra headers + + extra_query: Add additional query parameters to the request + + extra_body: Add additional JSON properties to the request + + timeout: Override the client-level default timeout for this request, in seconds + """ + if not entity_id: + raise ValueError(f"Expected a non-empty value for `entity_id` but received {entity_id!r}") + return await self._get( + f"/public_treasury/{entity_id}/transaction_history", + options=make_request_options( + extra_headers=extra_headers, + extra_query=extra_query, + extra_body=extra_body, + timeout=timeout, + query=await async_maybe_transform( + { + "coin_ids": coin_ids, + "order": order, + "page": page, + "per_page": per_page, + }, + public_treasury_get_transaction_history_params.PublicTreasuryGetTransactionHistoryParams, + ), + ), + cast_to=PublicTreasuryGetTransactionHistoryResponse, + ) + class PublicTreasuryResourceWithRawResponse: def __init__(self, public_treasury: PublicTreasuryResource) -> None: @@ -216,6 +464,12 @@ def __init__(self, public_treasury: PublicTreasuryResource) -> None: self.get_entity_id = to_raw_response_wrapper( public_treasury.get_entity_id, ) + self.get_holding_chart = to_raw_response_wrapper( + public_treasury.get_holding_chart, + ) + self.get_transaction_history = to_raw_response_wrapper( + public_treasury.get_transaction_history, + ) class AsyncPublicTreasuryResourceWithRawResponse: @@ -228,6 +482,12 @@ def __init__(self, public_treasury: AsyncPublicTreasuryResource) -> None: self.get_entity_id = async_to_raw_response_wrapper( public_treasury.get_entity_id, ) + self.get_holding_chart = async_to_raw_response_wrapper( + public_treasury.get_holding_chart, + ) + self.get_transaction_history = async_to_raw_response_wrapper( + public_treasury.get_transaction_history, + ) class PublicTreasuryResourceWithStreamingResponse: @@ -240,6 +500,12 @@ def __init__(self, public_treasury: PublicTreasuryResource) -> None: self.get_entity_id = to_streamed_response_wrapper( public_treasury.get_entity_id, ) + self.get_holding_chart = to_streamed_response_wrapper( + public_treasury.get_holding_chart, + ) + self.get_transaction_history = to_streamed_response_wrapper( + public_treasury.get_transaction_history, + ) class AsyncPublicTreasuryResourceWithStreamingResponse: @@ -252,3 +518,9 @@ def __init__(self, public_treasury: AsyncPublicTreasuryResource) -> None: self.get_entity_id = async_to_streamed_response_wrapper( public_treasury.get_entity_id, ) + self.get_holding_chart = async_to_streamed_response_wrapper( + public_treasury.get_holding_chart, + ) + self.get_transaction_history = async_to_streamed_response_wrapper( + public_treasury.get_transaction_history, + ) diff --git a/src/coingecko_sdk/types/__init__.py b/src/coingecko_sdk/types/__init__.py index 404fbb1..98b32cd 100644 --- a/src/coingecko_sdk/types/__init__.py +++ b/src/coingecko_sdk/types/__init__.py @@ -31,3 +31,15 @@ from .public_treasury_get_entity_id_response import ( PublicTreasuryGetEntityIDResponse as PublicTreasuryGetEntityIDResponse, ) +from .public_treasury_get_holding_chart_params import ( + PublicTreasuryGetHoldingChartParams as PublicTreasuryGetHoldingChartParams, +) +from .public_treasury_get_holding_chart_response import ( + PublicTreasuryGetHoldingChartResponse as PublicTreasuryGetHoldingChartResponse, +) +from .public_treasury_get_transaction_history_params import ( + PublicTreasuryGetTransactionHistoryParams as PublicTreasuryGetTransactionHistoryParams, +) +from .public_treasury_get_transaction_history_response import ( + PublicTreasuryGetTransactionHistoryResponse as PublicTreasuryGetTransactionHistoryResponse, +) diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/__init__.py b/src/coingecko_sdk/types/onchain/networks/tokens/__init__.py index 1e029e5..316b9ae 100644 --- a/src/coingecko_sdk/types/onchain/networks/tokens/__init__.py +++ b/src/coingecko_sdk/types/onchain/networks/tokens/__init__.py @@ -8,7 +8,9 @@ from .pool_get_response import PoolGetResponse as PoolGetResponse from .trade_get_response import TradeGetResponse as TradeGetResponse from .top_holder_get_params import TopHolderGetParams as TopHolderGetParams +from .top_trader_get_params import TopTraderGetParams as TopTraderGetParams from .top_holder_get_response import TopHolderGetResponse as TopHolderGetResponse +from .top_trader_get_response import TopTraderGetResponse as TopTraderGetResponse from .holders_chart_get_params import HoldersChartGetParams as HoldersChartGetParams from .holders_chart_get_response import HoldersChartGetResponse as HoldersChartGetResponse from .multi_get_addresses_params import MultiGetAddressesParams as MultiGetAddressesParams diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_params.py b/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_params.py new file mode 100644 index 0000000..837013f --- /dev/null +++ b/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_params.py @@ -0,0 +1,23 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, Required, TypedDict + +__all__ = ["TopTraderGetParams"] + + +class TopTraderGetParams(TypedDict, total=False): + network_id: Required[str] + + include_address_label: bool + """include address label data, default: false""" + + sort: Literal["realized_pnl_usd_desc", "unrealized_pnl_usd_desc", "total_buy_usd_desc", "total_sell_usd_desc"] + """sort the traders by field Default value: realized_pnl_usd_desc""" + + traders: str + """ + number of top token traders to return, you may use any integer or `max` Default + value: 10 + """ diff --git a/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_response.py b/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_response.py new file mode 100644 index 0000000..71461a1 --- /dev/null +++ b/src/coingecko_sdk/types/onchain/networks/tokens/top_trader_get_response.py @@ -0,0 +1,57 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from ....._models import BaseModel + +__all__ = ["TopTraderGetResponse", "Data", "DataAttributes", "DataAttributesTrader"] + + +class DataAttributesTrader(BaseModel): + address: Optional[str] = None + + average_buy_price_usd: Optional[str] = None + + average_sell_price_usd: Optional[str] = None + + explorer_url: Optional[str] = None + + label: Optional[str] = None + + name: Optional[str] = None + + realized_pnl_usd: Optional[str] = None + + token_balance: Optional[str] = None + + total_buy_count: Optional[int] = None + + total_buy_token_amount: Optional[str] = None + + total_buy_usd: Optional[str] = None + + total_sell_count: Optional[int] = None + + total_sell_token_amount: Optional[str] = None + + total_sell_usd: Optional[str] = None + + type: Optional[str] = None + + unrealized_pnl_usd: Optional[str] = None + + +class DataAttributes(BaseModel): + traders: Optional[List[DataAttributesTrader]] = None + + +class Data(BaseModel): + id: Optional[str] = None + + attributes: Optional[DataAttributes] = None + + type: Optional[str] = None + + +class TopTraderGetResponse(BaseModel): + data: Optional[Data] = None diff --git a/src/coingecko_sdk/types/public_treasury_get_holding_chart_params.py b/src/coingecko_sdk/types/public_treasury_get_holding_chart_params.py new file mode 100644 index 0000000..3414f11 --- /dev/null +++ b/src/coingecko_sdk/types/public_treasury_get_holding_chart_params.py @@ -0,0 +1,17 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Required, TypedDict + +__all__ = ["PublicTreasuryGetHoldingChartParams"] + + +class PublicTreasuryGetHoldingChartParams(TypedDict, total=False): + entity_id: Required[str] + + days: Required[str] + """data up to number of days ago Valid values: `7, 14, 30, 90, 180, 365, 730, max`""" + + include_empty_intervals: bool + """include empty intervals with no transaction data, default: false""" diff --git a/src/coingecko_sdk/types/public_treasury_get_holding_chart_response.py b/src/coingecko_sdk/types/public_treasury_get_holding_chart_response.py new file mode 100644 index 0000000..1041331 --- /dev/null +++ b/src/coingecko_sdk/types/public_treasury_get_holding_chart_response.py @@ -0,0 +1,13 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional + +from .._models import BaseModel + +__all__ = ["PublicTreasuryGetHoldingChartResponse"] + + +class PublicTreasuryGetHoldingChartResponse(BaseModel): + holding_value_in_usd: Optional[List[List[float]]] = None + + holdings: Optional[List[List[float]]] = None diff --git a/src/coingecko_sdk/types/public_treasury_get_transaction_history_params.py b/src/coingecko_sdk/types/public_treasury_get_transaction_history_params.py new file mode 100644 index 0000000..b52fbae --- /dev/null +++ b/src/coingecko_sdk/types/public_treasury_get_transaction_history_params.py @@ -0,0 +1,33 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +from typing_extensions import Literal, TypedDict + +__all__ = ["PublicTreasuryGetTransactionHistoryParams"] + + +class PublicTreasuryGetTransactionHistoryParams(TypedDict, total=False): + coin_ids: str + """ + filter transactions by coin IDs, comma-separated if querying more than 1 coin + \\**refers to [`/coins/list`](/reference/coins-list). + """ + + order: Literal[ + "date_desc", + "date_asc", + "holding_net_change_desc", + "holding_net_change_asc", + "transaction_value_usd_desc", + "transaction_value_usd_asc", + "average_cost_desc", + "average_cost_asc", + ] + """use this to sort the order of transactions, default: `date_desc`""" + + page: float + """page through results, default: `1`""" + + per_page: float + """total results per page, default: `100` Valid values: 1...250""" diff --git a/src/coingecko_sdk/types/public_treasury_get_transaction_history_response.py b/src/coingecko_sdk/types/public_treasury_get_transaction_history_response.py new file mode 100644 index 0000000..e4a7124 --- /dev/null +++ b/src/coingecko_sdk/types/public_treasury_get_transaction_history_response.py @@ -0,0 +1,38 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from typing import List, Optional +from typing_extensions import Literal + +from .._models import BaseModel + +__all__ = ["PublicTreasuryGetTransactionHistoryResponse", "Transaction"] + + +class Transaction(BaseModel): + average_entry_value_usd: Optional[float] = None + """average entry value in usd after the transaction""" + + coin_id: Optional[str] = None + """coin ID""" + + date: Optional[float] = None + """transaction date in UNIX timestamp""" + + holding_balance: Optional[float] = None + """total holding balance after the transaction""" + + holding_net_change: Optional[float] = None + """net change in holdings after the transaction""" + + source_url: Optional[str] = None + """source document URL""" + + transaction_value_usd: Optional[float] = None + """transaction value in usd""" + + type: Optional[Literal["buy", "sell"]] = None + """transaction type: buy or sell""" + + +class PublicTreasuryGetTransactionHistoryResponse(BaseModel): + transactions: Optional[List[Transaction]] = None diff --git a/tests/api_resources/onchain/networks/tokens/test_top_traders.py b/tests/api_resources/onchain/networks/tokens/test_top_traders.py new file mode 100644 index 0000000..7a42679 --- /dev/null +++ b/tests/api_resources/onchain/networks/tokens/test_top_traders.py @@ -0,0 +1,152 @@ +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. + +from __future__ import annotations + +import os +from typing import Any, cast + +import pytest + +from tests.utils import assert_matches_type +from coingecko_sdk import Coingecko, AsyncCoingecko +from coingecko_sdk.types.onchain.networks.tokens import TopTraderGetResponse + +base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") + + +class TestTopTraders: + parametrize = pytest.mark.parametrize("client", [False, True], indirect=True, ids=["loose", "strict"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get(self, client: Coingecko) -> None: + top_trader = client.onchain.networks.tokens.top_traders.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_with_all_params(self, client: Coingecko) -> None: + top_trader = client.onchain.networks.tokens.top_traders.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + include_address_label=True, + sort="realized_pnl_usd_desc", + traders="traders", + ) + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get(self, client: Coingecko) -> None: + response = client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + top_trader = response.parse() + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get(self, client: Coingecko) -> None: + with client.onchain.networks.tokens.top_traders.with_streaming_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + top_trader = response.parse() + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_get(self, client: Coingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `network_id` but received ''"): + client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_address` but received ''"): + client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="", + network_id="base", + ) + + +class TestAsyncTopTraders: + parametrize = pytest.mark.parametrize( + "async_client", [False, True, {"http_client": "aiohttp"}], indirect=True, ids=["loose", "strict", "aiohttp"] + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get(self, async_client: AsyncCoingecko) -> None: + top_trader = await async_client.onchain.networks.tokens.top_traders.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_with_all_params(self, async_client: AsyncCoingecko) -> None: + top_trader = await async_client.onchain.networks.tokens.top_traders.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + include_address_label=True, + sort="realized_pnl_usd_desc", + traders="traders", + ) + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get(self, async_client: AsyncCoingecko) -> None: + response = await async_client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + top_trader = await response.parse() + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get(self, async_client: AsyncCoingecko) -> None: + async with async_client.onchain.networks.tokens.top_traders.with_streaming_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="base", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + top_trader = await response.parse() + assert_matches_type(TopTraderGetResponse, top_trader, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_get(self, async_client: AsyncCoingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `network_id` but received ''"): + await async_client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="0x6921b130d297cc43754afba22e5eac0fbf8db75b", + network_id="", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `token_address` but received ''"): + await async_client.onchain.networks.tokens.top_traders.with_raw_response.get( + token_address="", + network_id="base", + ) diff --git a/tests/api_resources/test_public_treasury.py b/tests/api_resources/test_public_treasury.py index 9d0db38..51a23c4 100644 --- a/tests/api_resources/test_public_treasury.py +++ b/tests/api_resources/test_public_treasury.py @@ -9,7 +9,12 @@ from tests.utils import assert_matches_type from coingecko_sdk import Coingecko, AsyncCoingecko -from coingecko_sdk.types import PublicTreasuryGetCoinIDResponse, PublicTreasuryGetEntityIDResponse +from coingecko_sdk.types import ( + PublicTreasuryGetCoinIDResponse, + PublicTreasuryGetEntityIDResponse, + PublicTreasuryGetHoldingChartResponse, + PublicTreasuryGetTransactionHistoryResponse, +) base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010") @@ -105,6 +110,128 @@ def test_path_params_get_entity_id(self, client: Coingecko) -> None: "", ) + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_holding_chart(self, client: Coingecko) -> None: + public_treasury = client.public_treasury.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_holding_chart_with_all_params(self, client: Coingecko) -> None: + public_treasury = client.public_treasury.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + include_empty_intervals=True, + ) + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get_holding_chart(self, client: Coingecko) -> None: + response = client.public_treasury.with_raw_response.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public_treasury = response.parse() + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get_holding_chart(self, client: Coingecko) -> None: + with client.public_treasury.with_streaming_response.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public_treasury = response.parse() + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_get_holding_chart(self, client: Coingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): + client.public_treasury.with_raw_response.get_holding_chart( + coin_id="bitcoin", + entity_id="", + days="days", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `coin_id` but received ''"): + client.public_treasury.with_raw_response.get_holding_chart( + coin_id="", + entity_id="strategy", + days="days", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_transaction_history(self, client: Coingecko) -> None: + public_treasury = client.public_treasury.get_transaction_history( + entity_id="strategy", + ) + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_method_get_transaction_history_with_all_params(self, client: Coingecko) -> None: + public_treasury = client.public_treasury.get_transaction_history( + entity_id="strategy", + coin_ids="coin_ids", + order="date_desc", + page=0, + per_page=0, + ) + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_raw_response_get_transaction_history(self, client: Coingecko) -> None: + response = client.public_treasury.with_raw_response.get_transaction_history( + entity_id="strategy", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public_treasury = response.parse() + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_streaming_response_get_transaction_history(self, client: Coingecko) -> None: + with client.public_treasury.with_streaming_response.get_transaction_history( + entity_id="strategy", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public_treasury = response.parse() + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + def test_path_params_get_transaction_history(self, client: Coingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): + client.public_treasury.with_raw_response.get_transaction_history( + entity_id="", + ) + class TestAsyncPublicTreasury: parametrize = pytest.mark.parametrize( @@ -198,3 +325,125 @@ async def test_path_params_get_entity_id(self, async_client: AsyncCoingecko) -> await async_client.public_treasury.with_raw_response.get_entity_id( "", ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_holding_chart(self, async_client: AsyncCoingecko) -> None: + public_treasury = await async_client.public_treasury.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_holding_chart_with_all_params(self, async_client: AsyncCoingecko) -> None: + public_treasury = await async_client.public_treasury.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + include_empty_intervals=True, + ) + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get_holding_chart(self, async_client: AsyncCoingecko) -> None: + response = await async_client.public_treasury.with_raw_response.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public_treasury = await response.parse() + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get_holding_chart(self, async_client: AsyncCoingecko) -> None: + async with async_client.public_treasury.with_streaming_response.get_holding_chart( + coin_id="bitcoin", + entity_id="strategy", + days="days", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public_treasury = await response.parse() + assert_matches_type(PublicTreasuryGetHoldingChartResponse, public_treasury, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_get_holding_chart(self, async_client: AsyncCoingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): + await async_client.public_treasury.with_raw_response.get_holding_chart( + coin_id="bitcoin", + entity_id="", + days="days", + ) + + with pytest.raises(ValueError, match=r"Expected a non-empty value for `coin_id` but received ''"): + await async_client.public_treasury.with_raw_response.get_holding_chart( + coin_id="", + entity_id="strategy", + days="days", + ) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_transaction_history(self, async_client: AsyncCoingecko) -> None: + public_treasury = await async_client.public_treasury.get_transaction_history( + entity_id="strategy", + ) + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_method_get_transaction_history_with_all_params(self, async_client: AsyncCoingecko) -> None: + public_treasury = await async_client.public_treasury.get_transaction_history( + entity_id="strategy", + coin_ids="coin_ids", + order="date_desc", + page=0, + per_page=0, + ) + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_raw_response_get_transaction_history(self, async_client: AsyncCoingecko) -> None: + response = await async_client.public_treasury.with_raw_response.get_transaction_history( + entity_id="strategy", + ) + + assert response.is_closed is True + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + public_treasury = await response.parse() + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_streaming_response_get_transaction_history(self, async_client: AsyncCoingecko) -> None: + async with async_client.public_treasury.with_streaming_response.get_transaction_history( + entity_id="strategy", + ) as response: + assert not response.is_closed + assert response.http_request.headers.get("X-Stainless-Lang") == "python" + + public_treasury = await response.parse() + assert_matches_type(PublicTreasuryGetTransactionHistoryResponse, public_treasury, path=["response"]) + + assert cast(Any, response.is_closed) is True + + @pytest.mark.skip(reason="Prism tests are disabled") + @parametrize + async def test_path_params_get_transaction_history(self, async_client: AsyncCoingecko) -> None: + with pytest.raises(ValueError, match=r"Expected a non-empty value for `entity_id` but received ''"): + await async_client.public_treasury.with_raw_response.get_transaction_history( + entity_id="", + ) From a2597e52dabf6145c2059345328af59d0013d7f1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:17:54 +0000 Subject: [PATCH 3/3] release: 1.12.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ pyproject.toml | 2 +- src/coingecko_sdk/_version.py | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 54d28cb..de0960a 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "1.11.3" + ".": "1.12.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5d0576e..a7d363e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 1.12.0 (2025-12-18) + +Full Changelog: [v1.11.3...v1.12.0](https://github.com/coingecko/coingecko-python/compare/v1.11.3...v1.12.0) + +### Features + +* **api:** api update ([e0bf518](https://github.com/coingecko/coingecko-python/commit/e0bf5186eaaf4a10315c162e71f40a1c7c8bfffc)) +* **api:** manual updates ([9a717af](https://github.com/coingecko/coingecko-python/commit/9a717af9715da994018f8fbb9b3199e1bf3929ad)) + ## 1.11.3 (2025-12-18) Full Changelog: [v1.11.2...v1.11.3](https://github.com/coingecko/coingecko-python/compare/v1.11.2...v1.11.3) diff --git a/pyproject.toml b/pyproject.toml index be9a8ec..9ac0b5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "coingecko_sdk" -version = "1.11.3" +version = "1.12.0" description = "The official Python library for the coingecko API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/coingecko_sdk/_version.py b/src/coingecko_sdk/_version.py index 3ee956f..a618cb5 100644 --- a/src/coingecko_sdk/_version.py +++ b/src/coingecko_sdk/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "coingecko_sdk" -__version__ = "1.11.3" # x-release-please-version +__version__ = "1.12.0" # x-release-please-version