diff --git a/.apigen-state b/.apigen-state index f9025b25..c601944d 100644 --- a/.apigen-state +++ b/.apigen-state @@ -1,18 +1,18 @@ { "version": "1", "algorithm": "sha256", - "generated_at": "2026-09-09T14:38:18.909930Z", + "generated_at": "2026-10-06T10:05:52.734462Z", "spec_files": { "resources/account-data-api.yaml": "ca145d50d48e0f3709130af89cf0feb3416c36adbd54b5ad40740f55217f94af", "resources/auth-api.yaml": "01e54ca1a13d2d6307e0d3a9ea38f816902521e7c85998f0f21a1353cc54fb76", - "resources/bluefin-api.yaml": "fa46dd3fa556baa1d81567b9d21ea81e948dd0e596bfdc368e0eb1e8fdad3fe1", + "resources/bluefin-api.yaml": "5d5bf9a54ce04e4cad3a84f20e83249997d2c418be77505ddda5a141c890d63e", "resources/common.yaml": "760ce6c130e31c3f0eafd692ca5d834499c7f24a15157fb4b43d05bd1043a0c0", "resources/exchange-common-api.yaml": "3c84fcdfa44e689c2465b79dab3dd0d2a2a1777ad207e167c64c457fcba58006", "resources/exchange-pro-api.yaml": "a9b065f87a8c5992667eee65f3680f178de693f0a01c82726f0378547a2b540f", - "resources/rewards-data-api.yaml": "2c715683d080ad11aa7667d81e36b1f36839da5d2af1bd3ce0d164db6f19cb0c", + "resources/rewards-data-api.yaml": "197f9a4cde84c2f34b4fd24334d732031212087172ece0efce6b8aefeb9f9863", "resources/trade-api.yaml": "229ac3d9a7a30b640db928cc5d99cddc4e185e70b76e7c0d7273f94225cd1d37", "resources/vera-api.yaml": "f4c51b5f6614dd4e3b9f5f1f01f945e06d9090849530ecb916ad4ae18d8f61a0", "resources/websocket-api.yaml": "c2c51ceea701bff0b7e911e9afdb0addeb4d7f173b2a25b996d13f5462cb535b" }, - "combined_hash": "b0b202e7b53330f76bc010d30c9c1095bc041f3c328f552ed663d1b844968bb5" + "combined_hash": "42fa552063eca4ebd9ba3a68134674ba515c3ebf7f7c18a934de7956368c5779" } \ No newline at end of file diff --git a/python/sdk/config.yaml b/python/sdk/config.yaml index 670851ed..bc323ccd 100644 --- a/python/sdk/config.yaml +++ b/python/sdk/config.yaml @@ -2,4 +2,4 @@ additionalProperties: library: asyncio generateSourceCodeOnly: true useOneOfDiscriminatorLookup: true - packageVersion: 1.19.0 + packageVersion: 1.20.0 diff --git a/python/sdk/pyproject.toml b/python/sdk/pyproject.toml index efa2f36a..7fad2ad4 100644 --- a/python/sdk/pyproject.toml +++ b/python/sdk/pyproject.toml @@ -21,7 +21,7 @@ description = "Python Boilerplate contains all the boilerplate you need to creat name = "bluefin_pro_sdk" readme = "README.rst" requires-python = ">=3.9.2,<3.14.0" -version = "1.19.0" +version = "1.20.0" [[project.authors]] email = "audreyr@example.com" diff --git a/python/sdk/src/.openapi-generator/FILES b/python/sdk/src/.openapi-generator/FILES index c9f840fe..cd2696d4 100644 --- a/python/sdk/src/.openapi-generator/FILES +++ b/python/sdk/src/.openapi-generator/FILES @@ -80,6 +80,7 @@ openapi_client/docs/GetAccountValueHistoryParamsInterval.md openapi_client/docs/GetAffiliateIntervalOverview200Response.md openapi_client/docs/GetAffiliateLeaderDashboard200Response.md openapi_client/docs/GetAffiliateOverview200Response.md +openapi_client/docs/GetSpotRewardClaims200Response.md openapi_client/docs/IntervalMetadata.md openapi_client/docs/IntervalRewards.md openapi_client/docs/IssBase64Details.md @@ -138,6 +139,8 @@ openapi_client/docs/SigPayload.md openapi_client/docs/SortOrder.md openapi_client/docs/SponsorTxRequest.md openapi_client/docs/SponsorTxResponse.md +openapi_client/docs/SpotRewardClaimCard.md +openapi_client/docs/SpotRewardClaimEntry.md openapi_client/docs/StatsAllTimeResponse.md openapi_client/docs/StatsEntry.md openapi_client/docs/StatsInterval.md @@ -238,6 +241,7 @@ openapi_client/models/get_account_value_history_params_interval.py openapi_client/models/get_affiliate_interval_overview200_response.py openapi_client/models/get_affiliate_leader_dashboard200_response.py openapi_client/models/get_affiliate_overview200_response.py +openapi_client/models/get_spot_reward_claims200_response.py openapi_client/models/interval_metadata.py openapi_client/models/interval_rewards.py openapi_client/models/iss_base64_details.py @@ -295,6 +299,8 @@ openapi_client/models/sig_payload.py openapi_client/models/sort_order.py openapi_client/models/sponsor_tx_request.py openapi_client/models/sponsor_tx_response.py +openapi_client/models/spot_reward_claim_card.py +openapi_client/models/spot_reward_claim_entry.py openapi_client/models/stats_all_time_response.py openapi_client/models/stats_entry.py openapi_client/models/stats_interval.py diff --git a/python/sdk/src/openapi_client/__init__.py b/python/sdk/src/openapi_client/__init__.py index f7a04b80..2a0b4c91 100644 --- a/python/sdk/src/openapi_client/__init__.py +++ b/python/sdk/src/openapi_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "1.17.0" +__version__ = "1.20.0" # import apis into sdk package from openapi_client.api.account_data_api import AccountDataApi @@ -104,6 +104,7 @@ from openapi_client.models.get_affiliate_interval_overview200_response import GetAffiliateIntervalOverview200Response from openapi_client.models.get_affiliate_leader_dashboard200_response import GetAffiliateLeaderDashboard200Response from openapi_client.models.get_affiliate_overview200_response import GetAffiliateOverview200Response +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response from openapi_client.models.interval_metadata import IntervalMetadata from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details @@ -161,6 +162,8 @@ from openapi_client.models.sort_order import SortOrder from openapi_client.models.sponsor_tx_request import SponsorTxRequest from openapi_client.models.sponsor_tx_response import SponsorTxResponse +from openapi_client.models.spot_reward_claim_card import SpotRewardClaimCard +from openapi_client.models.spot_reward_claim_entry import SpotRewardClaimEntry from openapi_client.models.stats_all_time_response import StatsAllTimeResponse from openapi_client.models.stats_entry import StatsEntry from openapi_client.models.stats_interval import StatsInterval diff --git a/python/sdk/src/openapi_client/api/rewards_api.py b/python/sdk/src/openapi_client/api/rewards_api.py index 52e52061..64176012 100644 --- a/python/sdk/src/openapi_client/api/rewards_api.py +++ b/python/sdk/src/openapi_client/api/rewards_api.py @@ -29,6 +29,7 @@ from openapi_client.models.get_affiliate_interval_overview200_response import GetAffiliateIntervalOverview200Response from openapi_client.models.get_affiliate_leader_dashboard200_response import GetAffiliateLeaderDashboard200Response from openapi_client.models.get_affiliate_overview200_response import GetAffiliateOverview200Response +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response from openapi_client.models.interval_metadata import IntervalMetadata from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.mark_as_claimed_request import MarkAsClaimedRequest @@ -3756,6 +3757,305 @@ def _get_rewards_summary_serialize( + @validate_call + async def get_spot_reward_claims( + self, + user_address: Annotated[StrictStr, Field(description="Wallet address whose spot claims to return.")], + cursor: Annotated[Optional[StrictInt], Field(description="Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> GetSpotRewardClaims200Response: + """/spot-rewards/claims + + Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + + :param user_address: Wallet address whose spot claims to return. (required) + :type user_address: str + :param cursor: Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + :type cursor: int + :param page_size: Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_spot_reward_claims_serialize( + user_address=user_address, + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetSpotRewardClaims200Response", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + async def get_spot_reward_claims_with_http_info( + self, + user_address: Annotated[StrictStr, Field(description="Wallet address whose spot claims to return.")], + cursor: Annotated[Optional[StrictInt], Field(description="Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[GetSpotRewardClaims200Response]: + """/spot-rewards/claims + + Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + + :param user_address: Wallet address whose spot claims to return. (required) + :type user_address: str + :param cursor: Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + :type cursor: int + :param page_size: Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_spot_reward_claims_serialize( + user_address=user_address, + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetSpotRewardClaims200Response", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + await response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + async def get_spot_reward_claims_without_preload_content( + self, + user_address: Annotated[StrictStr, Field(description="Wallet address whose spot claims to return.")], + cursor: Annotated[Optional[StrictInt], Field(description="Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page.")] = None, + page_size: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them.")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """/spot-rewards/claims + + Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + + :param user_address: Wallet address whose spot claims to return. (required) + :type user_address: str + :param cursor: Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + :type cursor: int + :param page_size: Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + :type page_size: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_spot_reward_claims_serialize( + user_address=user_address, + cursor=cursor, + page_size=page_size, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "GetSpotRewardClaims200Response", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_spot_reward_claims_serialize( + self, + user_address, + cursor, + page_size, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if user_address is not None: + + _query_params.append(('userAddress', user_address)) + + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if page_size is not None: + + _query_params.append(('pageSize', page_size)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/spot-rewards/claims', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + @validate_call async def mark_as_claimed( self, diff --git a/python/sdk/src/openapi_client/api_client.py b/python/sdk/src/openapi_client/api_client.py index 1cda75ff..beac11dd 100644 --- a/python/sdk/src/openapi_client/api_client.py +++ b/python/sdk/src/openapi_client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.17.0/python' + self.user_agent = 'OpenAPI-Generator/1.20.0/python' self.client_side_validation = configuration.client_side_validation async def __aenter__(self): diff --git a/python/sdk/src/openapi_client/configuration.py b/python/sdk/src/openapi_client/configuration.py index 2fc99d9b..4f3c7f2d 100644 --- a/python/sdk/src/openapi_client/configuration.py +++ b/python/sdk/src/openapi_client/configuration.py @@ -507,7 +507,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.17.0".\ + "SDK Package Version: 1.20.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/python/sdk/src/openapi_client/docs/GetSpotRewardClaims200Response.md b/python/sdk/src/openapi_client/docs/GetSpotRewardClaims200Response.md new file mode 100644 index 00000000..6b50f881 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/GetSpotRewardClaims200Response.md @@ -0,0 +1,31 @@ +# GetSpotRewardClaims200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[SpotRewardClaimCard]**](SpotRewardClaimCard.md) | | +**next_cursor** | **str** | claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows. | +**is_more_data_available** | **bool** | | + +## Example + +```python +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of GetSpotRewardClaims200Response from a JSON string +get_spot_reward_claims200_response_instance = GetSpotRewardClaims200Response.from_json(json) +# print the JSON string representation of the object +print(GetSpotRewardClaims200Response.to_json()) + +# convert the object into a dict +get_spot_reward_claims200_response_dict = get_spot_reward_claims200_response_instance.to_dict() +# create an instance of GetSpotRewardClaims200Response from a dict +get_spot_reward_claims200_response_from_dict = GetSpotRewardClaims200Response.from_dict(get_spot_reward_claims200_response_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/sdk/src/openapi_client/docs/RewardsApi.md b/python/sdk/src/openapi_client/docs/RewardsApi.md index 106774b3..d4ce9dc3 100644 --- a/python/sdk/src/openapi_client/docs/RewardsApi.md +++ b/python/sdk/src/openapi_client/docs/RewardsApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**get_rewards_epoch_metadata**](RewardsApi.md#get_rewards_epoch_metadata) | **GET** /v1/rewards/metadata/epoch | /rewards/metadata/epoch [**get_rewards_interval_metadata**](RewardsApi.md#get_rewards_interval_metadata) | **GET** /v1/rewards/metadata/interval | /rewards/metadata/interval [**get_rewards_summary**](RewardsApi.md#get_rewards_summary) | **GET** /v1/rewards/summary | /rewards/summary +[**get_spot_reward_claims**](RewardsApi.md#get_spot_reward_claims) | **GET** /v1/spot-rewards/claims | /spot-rewards/claims [**mark_as_claimed**](RewardsApi.md#mark_as_claimed) | **POST** /v1/rewards/claims/mark-claimed | /v1/rewards/claims/mark-claimed [**onboard_affiliate**](RewardsApi.md#onboard_affiliate) | **POST** /v1/rewards/affiliate/onboard | /rewards/affiliate/onboard [**onboard_referee**](RewardsApi.md#onboard_referee) | **POST** /v1/rewards/affiliate/onboard/referee | /rewards/affiliate/onboard/referee @@ -969,6 +970,79 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **get_spot_reward_claims** +> GetSpotRewardClaims200Response get_spot_reward_claims(user_address, cursor=cursor, page_size=page_size) + +/spot-rewards/claims + +Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + +### Example + + +```python +import openapi_client +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response +from openapi_client.rest import ApiException +from pprint import pprint + +# Defining the host is optional and defaults to https://api.sui-staging.bluefin.io +# See configuration.py for a list of all supported configuration parameters. +configuration = openapi_client.Configuration( + host = "https://api.sui-staging.bluefin.io" +) + + +# Enter a context with an instance of the API client +async with openapi_client.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = openapi_client.RewardsApi(api_client) + user_address = '0x1234567890abcdef' # str | Wallet address whose spot claims to return. + cursor = 0 # int | Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. (optional) (default to 0) + page_size = 100 # int | Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. (optional) (default to 100) + + try: + # /spot-rewards/claims + api_response = await api_instance.get_spot_reward_claims(user_address, cursor=cursor, page_size=page_size) + print("The response of RewardsApi->get_spot_reward_claims:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RewardsApi->get_spot_reward_claims: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_address** | **str**| Wallet address whose spot claims to return. | + **cursor** | **int**| Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. | [optional] [default to 0] + **page_size** | **int**| Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. | [optional] [default to 100] + +### Return type + +[**GetSpotRewardClaims200Response**](GetSpotRewardClaims200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Paginated list of the user's spot claim cards. | - | +**400** | request missing required parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **mark_as_claimed** > MarkAsClaimedResponse mark_as_claimed(mark_as_claimed_request) diff --git a/python/sdk/src/openapi_client/docs/SpotRewardClaimCard.md b/python/sdk/src/openapi_client/docs/SpotRewardClaimCard.md new file mode 100644 index 00000000..e10f0336 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/SpotRewardClaimCard.md @@ -0,0 +1,34 @@ +# SpotRewardClaimCard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **str** | | +**pool_id** | **str** | On-chain pool object address. | +**pool_name** | **str** | | +**claim_timestamp** | **str** | Claim time in epoch-ms, serialized as a string. | +**tx_digest** | **str** | | +**rewards** | [**List[SpotRewardClaimEntry]**](SpotRewardClaimEntry.md) | | + +## Example + +```python +from openapi_client.models.spot_reward_claim_card import SpotRewardClaimCard + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotRewardClaimCard from a JSON string +spot_reward_claim_card_instance = SpotRewardClaimCard.from_json(json) +# print the JSON string representation of the object +print(SpotRewardClaimCard.to_json()) + +# convert the object into a dict +spot_reward_claim_card_dict = spot_reward_claim_card_instance.to_dict() +# create an instance of SpotRewardClaimCard from a dict +spot_reward_claim_card_from_dict = SpotRewardClaimCard.from_dict(spot_reward_claim_card_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/sdk/src/openapi_client/docs/SpotRewardClaimEntry.md b/python/sdk/src/openapi_client/docs/SpotRewardClaimEntry.md new file mode 100644 index 00000000..0dc97506 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/SpotRewardClaimEntry.md @@ -0,0 +1,30 @@ +# SpotRewardClaimEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reward_type** | **str** | Reward/fee token symbol; a fee and reward of the same symbol are merged. | +**rewarded_amount** | **str** | Claimed amount in the token's own units (decimal string, e.g. \"0.61172\"). | + +## Example + +```python +from openapi_client.models.spot_reward_claim_entry import SpotRewardClaimEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of SpotRewardClaimEntry from a JSON string +spot_reward_claim_entry_instance = SpotRewardClaimEntry.from_json(json) +# print the JSON string representation of the object +print(SpotRewardClaimEntry.to_json()) + +# convert the object into a dict +spot_reward_claim_entry_dict = spot_reward_claim_entry_instance.to_dict() +# create an instance of SpotRewardClaimEntry from a dict +spot_reward_claim_entry_from_dict = SpotRewardClaimEntry.from_dict(spot_reward_claim_entry_dict) +``` +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/python/sdk/src/openapi_client/models/__init__.py b/python/sdk/src/openapi_client/models/__init__.py index fc8ad145..eaa0824f 100644 --- a/python/sdk/src/openapi_client/models/__init__.py +++ b/python/sdk/src/openapi_client/models/__init__.py @@ -81,6 +81,7 @@ from openapi_client.models.get_affiliate_interval_overview200_response import GetAffiliateIntervalOverview200Response from openapi_client.models.get_affiliate_leader_dashboard200_response import GetAffiliateLeaderDashboard200Response from openapi_client.models.get_affiliate_overview200_response import GetAffiliateOverview200Response +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response from openapi_client.models.interval_metadata import IntervalMetadata from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details @@ -138,6 +139,8 @@ from openapi_client.models.sort_order import SortOrder from openapi_client.models.sponsor_tx_request import SponsorTxRequest from openapi_client.models.sponsor_tx_response import SponsorTxResponse +from openapi_client.models.spot_reward_claim_card import SpotRewardClaimCard +from openapi_client.models.spot_reward_claim_entry import SpotRewardClaimEntry from openapi_client.models.stats_all_time_response import StatsAllTimeResponse from openapi_client.models.stats_entry import StatsEntry from openapi_client.models.stats_interval import StatsInterval diff --git a/python/sdk/src/openapi_client/models/get_spot_reward_claims200_response.py b/python/sdk/src/openapi_client/models/get_spot_reward_claims200_response.py new file mode 100644 index 00000000..511fe0fd --- /dev/null +++ b/python/sdk/src/openapi_client/models/get_spot_reward_claims200_response.py @@ -0,0 +1,99 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List +from openapi_client.models.spot_reward_claim_card import SpotRewardClaimCard +from typing import Optional, Set +from typing_extensions import Self + +class GetSpotRewardClaims200Response(BaseModel): + """ + GetSpotRewardClaims200Response + """ # noqa: E501 + data: List[SpotRewardClaimCard] + next_cursor: StrictStr = Field(description="claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows.", alias="nextCursor") + is_more_data_available: StrictBool = Field(alias="isMoreDataAvailable") + __properties: ClassVar[List[str]] = ["data", "nextCursor", "isMoreDataAvailable"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GetSpotRewardClaims200Response from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in data (list) + _items = [] + if self.data: + for _item_data in self.data: + if _item_data: + _items.append(_item_data.to_dict()) + _dict['data'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GetSpotRewardClaims200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [SpotRewardClaimCard.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "nextCursor": obj.get("nextCursor"), + "isMoreDataAvailable": obj.get("isMoreDataAvailable") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/spot_reward_claim_card.py b/python/sdk/src/openapi_client/models/spot_reward_claim_card.py new file mode 100644 index 00000000..f5de18d9 --- /dev/null +++ b/python/sdk/src/openapi_client/models/spot_reward_claim_card.py @@ -0,0 +1,105 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from openapi_client.models.spot_reward_claim_entry import SpotRewardClaimEntry +from typing import Optional, Set +from typing_extensions import Self + +class SpotRewardClaimCard(BaseModel): + """ + SpotRewardClaimCard + """ # noqa: E501 + user_address: StrictStr = Field(alias="userAddress") + pool_id: StrictStr = Field(description="On-chain pool object address.", alias="poolId") + pool_name: StrictStr = Field(alias="poolName") + claim_timestamp: StrictStr = Field(description="Claim time in epoch-ms, serialized as a string.", alias="claimTimestamp") + tx_digest: StrictStr = Field(alias="txDigest") + rewards: List[SpotRewardClaimEntry] + __properties: ClassVar[List[str]] = ["userAddress", "poolId", "poolName", "claimTimestamp", "txDigest", "rewards"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpotRewardClaimCard from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in rewards (list) + _items = [] + if self.rewards: + for _item_rewards in self.rewards: + if _item_rewards: + _items.append(_item_rewards.to_dict()) + _dict['rewards'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotRewardClaimCard from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "userAddress": obj.get("userAddress"), + "poolId": obj.get("poolId"), + "poolName": obj.get("poolName"), + "claimTimestamp": obj.get("claimTimestamp"), + "txDigest": obj.get("txDigest"), + "rewards": [SpotRewardClaimEntry.from_dict(_item) for _item in obj["rewards"]] if obj.get("rewards") is not None else None + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/spot_reward_claim_entry.py b/python/sdk/src/openapi_client/models/spot_reward_claim_entry.py new file mode 100644 index 00000000..53a19159 --- /dev/null +++ b/python/sdk/src/openapi_client/models/spot_reward_claim_entry.py @@ -0,0 +1,89 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class SpotRewardClaimEntry(BaseModel): + """ + SpotRewardClaimEntry + """ # noqa: E501 + reward_type: StrictStr = Field(description="Reward/fee token symbol; a fee and reward of the same symbol are merged.", alias="rewardType") + rewarded_amount: StrictStr = Field(description="Claimed amount in the token's own units (decimal string, e.g. \"0.61172\").", alias="rewardedAmount") + __properties: ClassVar[List[str]] = ["rewardType", "rewardedAmount"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SpotRewardClaimEntry from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SpotRewardClaimEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rewardType": obj.get("rewardType"), + "rewardedAmount": obj.get("rewardedAmount") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/test/test_get_spot_reward_claims200_response.py b/python/sdk/src/openapi_client/test/test_get_spot_reward_claims200_response.py new file mode 100644 index 00000000..54d15ff1 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_get_spot_reward_claims200_response.py @@ -0,0 +1,80 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from openapi_client.models.get_spot_reward_claims200_response import GetSpotRewardClaims200Response + +class TestGetSpotRewardClaims200Response(unittest.TestCase): + """GetSpotRewardClaims200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> GetSpotRewardClaims200Response: + """Test GetSpotRewardClaims200Response + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `GetSpotRewardClaims200Response` + """ + model = GetSpotRewardClaims200Response() + if include_optional: + return GetSpotRewardClaims200Response( + data = [ + openapi_client.models.spot_reward_claim_card.SpotRewardClaimCard( + user_address = '0x1234567890abcdef', + pool_id = '0xd5e3a3c7396702d8f358a63ef921cc7c1951f52c6dfc2051cc8772cf7cb9900c', + pool_name = 'DEEP-USDC', + claim_timestamp = 1791188917719, + tx_digest = '5uo1KT3RN9oM1S4hcXbuksFVAGuzwnb2ZSZS1bLxhUuq', + rewards = [ + openapi_client.models.spot_reward_claim_entry.SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172', ) + ], ) + ], + next_cursor = 1791188909438, + is_more_data_available = True + ) + else: + return GetSpotRewardClaims200Response( + data = [ + openapi_client.models.spot_reward_claim_card.SpotRewardClaimCard( + user_address = '0x1234567890abcdef', + pool_id = '0xd5e3a3c7396702d8f358a63ef921cc7c1951f52c6dfc2051cc8772cf7cb9900c', + pool_name = 'DEEP-USDC', + claim_timestamp = 1791188917719, + tx_digest = '5uo1KT3RN9oM1S4hcXbuksFVAGuzwnb2ZSZS1bLxhUuq', + rewards = [ + openapi_client.models.spot_reward_claim_entry.SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172', ) + ], ) + ], + next_cursor = 1791188909438, + is_more_data_available = True, + ) + """ + + def testGetSpotRewardClaims200Response(self): + """Test GetSpotRewardClaims200Response""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/sdk/src/openapi_client/test/test_spot_reward_claim_card.py b/python/sdk/src/openapi_client/test/test_spot_reward_claim_card.py new file mode 100644 index 00000000..a87562fb --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_spot_reward_claim_card.py @@ -0,0 +1,70 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from openapi_client.models.spot_reward_claim_card import SpotRewardClaimCard + +class TestSpotRewardClaimCard(unittest.TestCase): + """SpotRewardClaimCard unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotRewardClaimCard: + """Test SpotRewardClaimCard + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpotRewardClaimCard` + """ + model = SpotRewardClaimCard() + if include_optional: + return SpotRewardClaimCard( + user_address = '0x1234567890abcdef', + pool_id = '0xd5e3a3c7396702d8f358a63ef921cc7c1951f52c6dfc2051cc8772cf7cb9900c', + pool_name = 'DEEP-USDC', + claim_timestamp = 1791188917719, + tx_digest = '5uo1KT3RN9oM1S4hcXbuksFVAGuzwnb2ZSZS1bLxhUuq', + rewards = [ + openapi_client.models.spot_reward_claim_entry.SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172', ) + ] + ) + else: + return SpotRewardClaimCard( + user_address = '0x1234567890abcdef', + pool_id = '0xd5e3a3c7396702d8f358a63ef921cc7c1951f52c6dfc2051cc8772cf7cb9900c', + pool_name = 'DEEP-USDC', + claim_timestamp = 1791188917719, + tx_digest = '5uo1KT3RN9oM1S4hcXbuksFVAGuzwnb2ZSZS1bLxhUuq', + rewards = [ + openapi_client.models.spot_reward_claim_entry.SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172', ) + ], + ) + """ + + def testSpotRewardClaimCard(self): + """Test SpotRewardClaimCard""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/sdk/src/openapi_client/test/test_spot_reward_claim_entry.py b/python/sdk/src/openapi_client/test/test_spot_reward_claim_entry.py new file mode 100644 index 00000000..030c599a --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_spot_reward_claim_entry.py @@ -0,0 +1,54 @@ +# coding: utf-8 + +""" + Bluefin API + + Bluefin API + + The version of the OpenAPI document: 1.0.0 + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from openapi_client.models.spot_reward_claim_entry import SpotRewardClaimEntry + +class TestSpotRewardClaimEntry(unittest.TestCase): + """SpotRewardClaimEntry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> SpotRewardClaimEntry: + """Test SpotRewardClaimEntry + include_optional is a boolean, when False only required + params are included, when True both required and + optional params are included """ + # uncomment below to create an instance of `SpotRewardClaimEntry` + """ + model = SpotRewardClaimEntry() + if include_optional: + return SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172' + ) + else: + return SpotRewardClaimEntry( + reward_type = 'DEEP', + rewarded_amount = '0.61172', + ) + """ + + def testSpotRewardClaimEntry(self): + """Test SpotRewardClaimEntry""" + # inst_req_only = self.make_instance(include_optional=False) + # inst_req_and_optional = self.make_instance(include_optional=True) + +if __name__ == '__main__': + unittest.main() diff --git a/python/sdk/src/openapi_client_README.md b/python/sdk/src/openapi_client_README.md index d2756155..45ff1dc2 100644 --- a/python/sdk/src/openapi_client_README.md +++ b/python/sdk/src/openapi_client_README.md @@ -4,7 +4,7 @@ Bluefin API The `openapi_client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Package version: 1.17.0 +- Package version: 1.20.0 - Generator version: 7.13.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen @@ -108,6 +108,7 @@ Class | Method | HTTP request | Description *RewardsApi* | [**get_rewards_epoch_metadata**](openapi_client/docs/RewardsApi.md#get_rewards_epoch_metadata) | **GET** /v1/rewards/metadata/epoch | /rewards/metadata/epoch *RewardsApi* | [**get_rewards_interval_metadata**](openapi_client/docs/RewardsApi.md#get_rewards_interval_metadata) | **GET** /v1/rewards/metadata/interval | /rewards/metadata/interval *RewardsApi* | [**get_rewards_summary**](openapi_client/docs/RewardsApi.md#get_rewards_summary) | **GET** /v1/rewards/summary | /rewards/summary +*RewardsApi* | [**get_spot_reward_claims**](openapi_client/docs/RewardsApi.md#get_spot_reward_claims) | **GET** /v1/spot-rewards/claims | /spot-rewards/claims *RewardsApi* | [**mark_as_claimed**](openapi_client/docs/RewardsApi.md#mark_as_claimed) | **POST** /v1/rewards/claims/mark-claimed | /v1/rewards/claims/mark-claimed *RewardsApi* | [**onboard_affiliate**](openapi_client/docs/RewardsApi.md#onboard_affiliate) | **POST** /v1/rewards/affiliate/onboard | /rewards/affiliate/onboard *RewardsApi* | [**onboard_referee**](openapi_client/docs/RewardsApi.md#onboard_referee) | **POST** /v1/rewards/affiliate/onboard/referee | /rewards/affiliate/onboard/referee @@ -201,6 +202,7 @@ Class | Method | HTTP request | Description - [GetAffiliateIntervalOverview200Response](openapi_client/docs/GetAffiliateIntervalOverview200Response.md) - [GetAffiliateLeaderDashboard200Response](openapi_client/docs/GetAffiliateLeaderDashboard200Response.md) - [GetAffiliateOverview200Response](openapi_client/docs/GetAffiliateOverview200Response.md) + - [GetSpotRewardClaims200Response](openapi_client/docs/GetSpotRewardClaims200Response.md) - [IntervalMetadata](openapi_client/docs/IntervalMetadata.md) - [IntervalRewards](openapi_client/docs/IntervalRewards.md) - [IssBase64Details](openapi_client/docs/IssBase64Details.md) @@ -258,6 +260,8 @@ Class | Method | HTTP request | Description - [SortOrder](openapi_client/docs/SortOrder.md) - [SponsorTxRequest](openapi_client/docs/SponsorTxRequest.md) - [SponsorTxResponse](openapi_client/docs/SponsorTxResponse.md) + - [SpotRewardClaimCard](openapi_client/docs/SpotRewardClaimCard.md) + - [SpotRewardClaimEntry](openapi_client/docs/SpotRewardClaimEntry.md) - [StatsAllTimeResponse](openapi_client/docs/StatsAllTimeResponse.md) - [StatsEntry](openapi_client/docs/StatsEntry.md) - [StatsInterval](openapi_client/docs/StatsInterval.md) diff --git a/resources/bluefin-api.yaml b/resources/bluefin-api.yaml index ef32edc2..4c34f5df 100644 --- a/resources/bluefin-api.yaml +++ b/resources/bluefin-api.yaml @@ -258,6 +258,8 @@ paths: /v1/rewards: $ref: "./rewards-data-api.yaml#/paths/~1v1~1rewards" + /v1/spot-rewards/claims: + $ref: "./rewards-data-api.yaml#/paths/~1v1~1spot-rewards~1claims" /v1/rewards/campaign: $ref: "./rewards-data-api.yaml#/paths/~1v1~1rewards~1campaign" /v1/rewards/summary: diff --git a/resources/rewards-data-api.yaml b/resources/rewards-data-api.yaml index 97ae5f99..2dc9580e 100644 --- a/resources/rewards-data-api.yaml +++ b/resources/rewards-data-api.yaml @@ -22,6 +22,51 @@ components: scheme: bearer bearerFormat: JWT schemas: + SpotRewardClaimCard: + type: object + required: + - userAddress + - poolId + - poolName + - claimTimestamp + - txDigest + - rewards + properties: + userAddress: + type: string + example: "0x1234567890abcdef" + poolId: + type: string + description: On-chain pool object address. + example: "0xd5e3a3c7396702d8f358a63ef921cc7c1951f52c6dfc2051cc8772cf7cb9900c" + poolName: + type: string + example: "DEEP-USDC" + claimTimestamp: + type: string + description: Claim time in epoch-ms, serialized as a string. + example: "1791188917719" + txDigest: + type: string + example: "5uo1KT3RN9oM1S4hcXbuksFVAGuzwnb2ZSZS1bLxhUuq" + rewards: + type: array + items: + $ref: "#/components/schemas/SpotRewardClaimEntry" + SpotRewardClaimEntry: + type: object + required: + - rewardType + - rewardedAmount + properties: + rewardType: + type: string + description: Reward/fee token symbol; a fee and reward of the same symbol are merged. + example: "DEEP" + rewardedAmount: + type: string + description: Claimed amount in the token's own units (decimal string, e.g. "0.61172"). + example: "0.61172" ContractConfig: type: object properties: @@ -925,6 +970,73 @@ paths: description: List of epoch rewards objects. items: $ref: "#/components/schemas/IntervalRewards" + /v1/spot-rewards/claims: + get: + tags: + - Rewards + operationId: getSpotRewardClaims + summary: /spot-rewards/claims + description: Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + parameters: + - name: userAddress + in: query + required: true + description: Wallet address whose spot claims to return. + schema: + type: string + example: "0x1234567890abcdef" + - name: cursor + in: query + required: false + description: Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + schema: + type: integer + format: int64 + default: 0 + example: 1791188951248 + - name: pageSize + in: query + required: false + description: >- + Maximum number of claim cards to return. Out-of-range values are coerced: + a value below 1 uses the default (100), and a value above 1000 is capped at + 1000. A page may return a few more than pageSize cards when they share the + boundary claim timestamp, so that pagination never splits or skips them. + schema: + type: integer + default: 100 + minimum: 1 + maximum: 1000 + example: 100 + responses: + "200": + description: Paginated list of the user's spot claim cards. + content: + application/json: + schema: + type: object + required: + - data + - nextCursor + - isMoreDataAvailable + properties: + data: + type: array + items: + $ref: "#/components/schemas/SpotRewardClaimCard" + nextCursor: + type: string + description: claimTimestamp to pass as the next cursor, as a string; "-1" when there are no rows. + example: "1791188909438" + isMoreDataAvailable: + type: boolean + example: true + "400": + description: "request missing required parameters" + content: + application/json: + schema: + $ref: "./common.yaml#/components/schemas/Error" /v1/rewards/campaign: # Get rewards information for the epochs; epochs define how frequent rewards for a campaign are finalized and locked # Epochs are specific to a campaign diff --git a/rust/Cargo.lock b/rust/Cargo.lock index a8a14296..353b594e 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -121,7 +121,7 @@ dependencies = [ [[package]] name = "bluefin-pro" -version = "1.18.0" +version = "1.20.0" dependencies = [ "base64", "bcs", @@ -146,7 +146,7 @@ dependencies = [ [[package]] name = "bluefin_api" -version = "1.18.0" +version = "1.20.0" dependencies = [ "reqwest", "serde", diff --git a/rust/Cargo.toml b/rust/Cargo.toml index bce0544c..c8993b8e 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -9,7 +9,7 @@ sha2 = "0.10.9" [dependencies.bluefin_api] path = "gen/bluefin_api" -version = "1.19.0" +version = "1.20.0" [dependencies.ed25519-dalek] features = ["rand_core"] @@ -93,7 +93,7 @@ keywords = [ license = "Unlicense" name = "bluefin-pro" repository = "https://github.com/fireflyprotocol/pro-sdk" -version = "1.19.0" +version = "1.20.0" [workspace] members = [ diff --git a/rust/gen/bluefin_api/.openapi-generator/FILES b/rust/gen/bluefin_api/.openapi-generator/FILES index 9f5fda1d..eabac3bb 100644 --- a/rust/gen/bluefin_api/.openapi-generator/FILES +++ b/rust/gen/bluefin_api/.openapi-generator/FILES @@ -1,4 +1,5 @@ .gitignore +.openapi-generator-ignore .travis.yml Cargo.toml README.md @@ -72,6 +73,7 @@ docs/GetAccountValueHistoryParamsInterval.md docs/GetAffiliateIntervalOverview200Response.md docs/GetAffiliateLeaderDashboard200Response.md docs/GetAffiliateOverview200Response.md +docs/GetSpotRewardClaims200Response.md docs/IntervalMetadata.md docs/IntervalRewards.md docs/IssBase64Details.md @@ -130,6 +132,8 @@ docs/SigPayload.md docs/SortOrder.md docs/SponsorTxRequest.md docs/SponsorTxResponse.md +docs/SpotRewardClaimCard.md +docs/SpotRewardClaimEntry.md docs/StatsAllTimeResponse.md docs/StatsEntry.md docs/StatsInterval.md @@ -239,6 +243,7 @@ src/models/get_account_value_history_params_interval.rs src/models/get_affiliate_interval_overview_200_response.rs src/models/get_affiliate_leader_dashboard_200_response.rs src/models/get_affiliate_overview_200_response.rs +src/models/get_spot_reward_claims_200_response.rs src/models/interval_metadata.rs src/models/interval_rewards.rs src/models/iss_base64_details.rs @@ -297,6 +302,8 @@ src/models/sig_payload.rs src/models/sort_order.rs src/models/sponsor_tx_request.rs src/models/sponsor_tx_response.rs +src/models/spot_reward_claim_card.rs +src/models/spot_reward_claim_entry.rs src/models/stats_all_time_response.rs src/models/stats_entry.rs src/models/stats_interval.rs diff --git a/rust/gen/bluefin_api/Cargo.toml b/rust/gen/bluefin_api/Cargo.toml index 5f88cb83..a8aa4875 100644 --- a/rust/gen/bluefin_api/Cargo.toml +++ b/rust/gen/bluefin_api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bluefin_api" -version = "1.19.0" +version = "1.20.0" authors = ["OpenAPI Generator team and contributors"] description = "Bluefin API" license = "MIT OR Apache-2.0" diff --git a/rust/gen/bluefin_api/README.md b/rust/gen/bluefin_api/README.md index 73dbf2bd..e53d8252 100644 --- a/rust/gen/bluefin_api/README.md +++ b/rust/gen/bluefin_api/README.md @@ -8,7 +8,7 @@ Bluefin API This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - API version: 1.0.0 -- Package version: 1.17.0 +- Package version: 1.20.0 - Generator version: 7.13.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` @@ -68,6 +68,7 @@ Class | Method | HTTP request | Description *RewardsApi* | [**get_rewards_epoch_metadata**](docs/RewardsApi.md#get_rewards_epoch_metadata) | **GET** /v1/rewards/metadata/epoch | /rewards/metadata/epoch *RewardsApi* | [**get_rewards_interval_metadata**](docs/RewardsApi.md#get_rewards_interval_metadata) | **GET** /v1/rewards/metadata/interval | /rewards/metadata/interval *RewardsApi* | [**get_rewards_summary**](docs/RewardsApi.md#get_rewards_summary) | **GET** /v1/rewards/summary | /rewards/summary +*RewardsApi* | [**get_spot_reward_claims**](docs/RewardsApi.md#get_spot_reward_claims) | **GET** /v1/spot-rewards/claims | /spot-rewards/claims *RewardsApi* | [**mark_as_claimed**](docs/RewardsApi.md#mark_as_claimed) | **POST** /v1/rewards/claims/mark-claimed | /v1/rewards/claims/mark-claimed *RewardsApi* | [**onboard_affiliate**](docs/RewardsApi.md#onboard_affiliate) | **POST** /v1/rewards/affiliate/onboard | /rewards/affiliate/onboard *RewardsApi* | [**onboard_referee**](docs/RewardsApi.md#onboard_referee) | **POST** /v1/rewards/affiliate/onboard/referee | /rewards/affiliate/onboard/referee @@ -161,6 +162,7 @@ Class | Method | HTTP request | Description - [GetAffiliateIntervalOverview200Response](docs/GetAffiliateIntervalOverview200Response.md) - [GetAffiliateLeaderDashboard200Response](docs/GetAffiliateLeaderDashboard200Response.md) - [GetAffiliateOverview200Response](docs/GetAffiliateOverview200Response.md) + - [GetSpotRewardClaims200Response](docs/GetSpotRewardClaims200Response.md) - [IntervalMetadata](docs/IntervalMetadata.md) - [IntervalRewards](docs/IntervalRewards.md) - [IssBase64Details](docs/IssBase64Details.md) @@ -218,6 +220,8 @@ Class | Method | HTTP request | Description - [SortOrder](docs/SortOrder.md) - [SponsorTxRequest](docs/SponsorTxRequest.md) - [SponsorTxResponse](docs/SponsorTxResponse.md) + - [SpotRewardClaimCard](docs/SpotRewardClaimCard.md) + - [SpotRewardClaimEntry](docs/SpotRewardClaimEntry.md) - [StatsAllTimeResponse](docs/StatsAllTimeResponse.md) - [StatsEntry](docs/StatsEntry.md) - [StatsInterval](docs/StatsInterval.md) diff --git a/rust/gen/bluefin_api/docs/GetSpotRewardClaims200Response.md b/rust/gen/bluefin_api/docs/GetSpotRewardClaims200Response.md new file mode 100644 index 00000000..031ffbf0 --- /dev/null +++ b/rust/gen/bluefin_api/docs/GetSpotRewardClaims200Response.md @@ -0,0 +1,13 @@ +# GetSpotRewardClaims200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](SpotRewardClaimCard.md) | | +**next_cursor** | **String** | claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows. | +**is_more_data_available** | **bool** | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rust/gen/bluefin_api/docs/RewardsApi.md b/rust/gen/bluefin_api/docs/RewardsApi.md index b47d3c1c..7e37ada4 100644 --- a/rust/gen/bluefin_api/docs/RewardsApi.md +++ b/rust/gen/bluefin_api/docs/RewardsApi.md @@ -17,6 +17,7 @@ Method | HTTP request | Description [**get_rewards_epoch_metadata**](RewardsApi.md#get_rewards_epoch_metadata) | **GET** /v1/rewards/metadata/epoch | /rewards/metadata/epoch [**get_rewards_interval_metadata**](RewardsApi.md#get_rewards_interval_metadata) | **GET** /v1/rewards/metadata/interval | /rewards/metadata/interval [**get_rewards_summary**](RewardsApi.md#get_rewards_summary) | **GET** /v1/rewards/summary | /rewards/summary +[**get_spot_reward_claims**](RewardsApi.md#get_spot_reward_claims) | **GET** /v1/spot-rewards/claims | /spot-rewards/claims [**mark_as_claimed**](RewardsApi.md#mark_as_claimed) | **POST** /v1/rewards/claims/mark-claimed | /v1/rewards/claims/mark-claimed [**onboard_affiliate**](RewardsApi.md#onboard_affiliate) | **POST** /v1/rewards/affiliate/onboard | /rewards/affiliate/onboard [**onboard_referee**](RewardsApi.md#onboard_referee) | **POST** /v1/rewards/affiliate/onboard/referee | /rewards/affiliate/onboard/referee @@ -425,6 +426,38 @@ This endpoint does not need any parameter. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +## get_spot_reward_claims + +> models::GetSpotRewardClaims200Response get_spot_reward_claims(user_address, cursor, page_size) +/spot-rewards/claims + +Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_address** | **String** | Wallet address whose spot claims to return. | [required] | +**cursor** | Option<**i64**> | Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. | |[default to 0] +**page_size** | Option<**u32**> | Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. | |[default to 100] + +### Return type + +[**models::GetSpotRewardClaims200Response**](getSpotRewardClaims_200_response.md) + +### Authorization + +No authorization required + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + + ## mark_as_claimed > models::MarkAsClaimedResponse mark_as_claimed(mark_as_claimed_request) diff --git a/rust/gen/bluefin_api/docs/SpotRewardClaimCard.md b/rust/gen/bluefin_api/docs/SpotRewardClaimCard.md new file mode 100644 index 00000000..d8b0eadc --- /dev/null +++ b/rust/gen/bluefin_api/docs/SpotRewardClaimCard.md @@ -0,0 +1,16 @@ +# SpotRewardClaimCard + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **String** | | +**pool_id** | **String** | On-chain pool object address. | +**pool_name** | **String** | | +**claim_timestamp** | **String** | Claim time in epoch-ms, serialized as a string. | +**tx_digest** | **String** | | +**rewards** | [**Vec**](SpotRewardClaimEntry.md) | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rust/gen/bluefin_api/docs/SpotRewardClaimEntry.md b/rust/gen/bluefin_api/docs/SpotRewardClaimEntry.md new file mode 100644 index 00000000..05ac0f39 --- /dev/null +++ b/rust/gen/bluefin_api/docs/SpotRewardClaimEntry.md @@ -0,0 +1,12 @@ +# SpotRewardClaimEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reward_type** | **String** | Reward/fee token symbol; a fee and reward of the same symbol are merged. | +**rewarded_amount** | **String** | Claimed amount in the token's own units (decimal string, e.g. \"0.61172\"). | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/rust/gen/bluefin_api/src/apis/rewards_api.rs b/rust/gen/bluefin_api/src/apis/rewards_api.rs index 5f06e12b..2e9a72b4 100644 --- a/rust/gen/bluefin_api/src/apis/rewards_api.rs +++ b/rust/gen/bluefin_api/src/apis/rewards_api.rs @@ -123,6 +123,14 @@ pub enum GetRewardsSummaryError { UnknownValue(serde_json::Value), } +/// struct for typed errors of method [`get_spot_reward_claims`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetSpotRewardClaimsError { + Status400(models::Error), + UnknownValue(serde_json::Value), +} + /// struct for typed errors of method [`mark_as_claimed`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -747,6 +755,52 @@ pub async fn get_rewards_summary(configuration: &configuration::Configuration, ) } } +/// Returns a user's claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. +pub async fn get_spot_reward_claims(configuration: &configuration::Configuration, user_address: &str, cursor: Option, page_size: Option) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_user_address = user_address; + let p_cursor = cursor; + let p_page_size = page_size; + + let uri_str = format!("{}/v1/spot-rewards/claims", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("userAddress", &p_user_address.to_string())]); + if let Some(ref param_value) = p_cursor { + req_builder = req_builder.query(&[("cursor", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_page_size { + req_builder = req_builder.query(&[("pageSize", ¶m_value.to_string())]); + } + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + + let req = req_builder.build()?; + let resp = configuration.client.execute(req).await?; + + let status = resp.status(); + let content_type = resp + .headers() + .get("content-type") + .and_then(|v| v.to_str().ok()) + .unwrap_or("application/octet-stream"); + let content_type = super::ContentType::from(content_type); + + if !status.is_client_error() && !status.is_server_error() { + let content = resp.text().await?; + match content_type { + ContentType::Json => serde_json::from_str(&content).map_err(Error::from), + ContentType::Text => return Err(Error::from(serde_json::Error::custom("Received `text/plain` content type response that cannot be converted to `models::GetSpotRewardClaims200Response`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `models::GetSpotRewardClaims200Response`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + /// Mark user claims as claimed for the specified campaign name and interval number pub async fn mark_as_claimed(configuration: &configuration::Configuration, mark_as_claimed_request: models::MarkAsClaimedRequest) -> Result> { // add a prefix to parameters to efficiently prevent name collisions diff --git a/rust/gen/bluefin_api/src/models/get_spot_reward_claims_200_response.rs b/rust/gen/bluefin_api/src/models/get_spot_reward_claims_200_response.rs new file mode 100644 index 00000000..d3d7ce7e --- /dev/null +++ b/rust/gen/bluefin_api/src/models/get_spot_reward_claims_200_response.rs @@ -0,0 +1,34 @@ +/* + * Bluefin API + * + * Bluefin API + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct GetSpotRewardClaims200Response { + #[serde(rename = "data")] + pub data: Vec, + /// claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows. + #[serde(rename = "nextCursor")] + pub next_cursor: String, + #[serde(rename = "isMoreDataAvailable")] + pub is_more_data_available: bool, +} + +impl GetSpotRewardClaims200Response { + pub fn new(data: Vec, next_cursor: String, is_more_data_available: bool) -> GetSpotRewardClaims200Response { + GetSpotRewardClaims200Response { + data, + next_cursor, + is_more_data_available, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/mod.rs b/rust/gen/bluefin_api/src/models/mod.rs index 11ec4db2..1a6d3c30 100644 --- a/rust/gen/bluefin_api/src/models/mod.rs +++ b/rust/gen/bluefin_api/src/models/mod.rs @@ -132,6 +132,8 @@ pub mod get_affiliate_leader_dashboard_200_response; pub use self::get_affiliate_leader_dashboard_200_response::GetAffiliateLeaderDashboard200Response; pub mod get_affiliate_overview_200_response; pub use self::get_affiliate_overview_200_response::GetAffiliateOverview200Response; +pub mod get_spot_reward_claims_200_response; +pub use self::get_spot_reward_claims_200_response::GetSpotRewardClaims200Response; pub mod interval_metadata; pub use self::interval_metadata::IntervalMetadata; pub mod interval_rewards; @@ -246,6 +248,10 @@ pub mod sponsor_tx_request; pub use self::sponsor_tx_request::SponsorTxRequest; pub mod sponsor_tx_response; pub use self::sponsor_tx_response::SponsorTxResponse; +pub mod spot_reward_claim_card; +pub use self::spot_reward_claim_card::SpotRewardClaimCard; +pub mod spot_reward_claim_entry; +pub use self::spot_reward_claim_entry::SpotRewardClaimEntry; pub mod stats_all_time_response; pub use self::stats_all_time_response::StatsAllTimeResponse; pub mod stats_entry; diff --git a/rust/gen/bluefin_api/src/models/spot_reward_claim_card.rs b/rust/gen/bluefin_api/src/models/spot_reward_claim_card.rs new file mode 100644 index 00000000..2ea60bfd --- /dev/null +++ b/rust/gen/bluefin_api/src/models/spot_reward_claim_card.rs @@ -0,0 +1,44 @@ +/* + * Bluefin API + * + * Bluefin API + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SpotRewardClaimCard { + #[serde(rename = "userAddress")] + pub user_address: String, + /// On-chain pool object address. + #[serde(rename = "poolId")] + pub pool_id: String, + #[serde(rename = "poolName")] + pub pool_name: String, + /// Claim time in epoch-ms, serialized as a string. + #[serde(rename = "claimTimestamp")] + pub claim_timestamp: String, + #[serde(rename = "txDigest")] + pub tx_digest: String, + #[serde(rename = "rewards")] + pub rewards: Vec, +} + +impl SpotRewardClaimCard { + pub fn new(user_address: String, pool_id: String, pool_name: String, claim_timestamp: String, tx_digest: String, rewards: Vec) -> SpotRewardClaimCard { + SpotRewardClaimCard { + user_address, + pool_id, + pool_name, + claim_timestamp, + tx_digest, + rewards, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/spot_reward_claim_entry.rs b/rust/gen/bluefin_api/src/models/spot_reward_claim_entry.rs new file mode 100644 index 00000000..ab141a44 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/spot_reward_claim_entry.rs @@ -0,0 +1,32 @@ +/* + * Bluefin API + * + * Bluefin API + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct SpotRewardClaimEntry { + /// Reward/fee token symbol; a fee and reward of the same symbol are merged. + #[serde(rename = "rewardType")] + pub reward_type: String, + /// Claimed amount in the token's own units (decimal string, e.g. \"0.61172\"). + #[serde(rename = "rewardedAmount")] + pub rewarded_amount: String, +} + +impl SpotRewardClaimEntry { + pub fn new(reward_type: String, rewarded_amount: String) -> SpotRewardClaimEntry { + SpotRewardClaimEntry { + reward_type, + rewarded_amount, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/update_account_preference_request.rs b/rust/gen/bluefin_api/src/models/update_account_preference_request.rs index d360140f..83c3a95e 100644 --- a/rust/gen/bluefin_api/src/models/update_account_preference_request.rs +++ b/rust/gen/bluefin_api/src/models/update_account_preference_request.rs @@ -4,7 +4,7 @@ * Bluefin API * * The version of the OpenAPI document: 1.0.0 - * + * * Generated by: https://openapi-generator.tech */ @@ -13,10 +13,10 @@ use serde::{Deserialize, Serialize}; #[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] pub struct UpdateAccountPreferenceRequest { - /// Favorite market symbols. Send the full array each time; to remove a favorite, send the array without it. + /// Favorite market symbols. Send the full array each time; to remove a favorite, send the array without it. #[serde(rename = "favorites", skip_serializing_if = "Option::is_none")] pub favorites: Option>, - /// Function bar display mode. Note the mixed casing: `all` is lowercase while `Popular` and `Favorites` are capitalized. + /// Function bar display mode. Note the mixed casing: `all` is lowercase while `Popular` and `Favorites` are capitalized. #[serde(rename = "functionBarMode", skip_serializing_if = "Option::is_none")] pub function_bar_mode: Option, /// Whether the user has completed onboarding. @@ -37,7 +37,7 @@ impl UpdateAccountPreferenceRequest { } } } -/// Function bar display mode. Note the mixed casing: `all` is lowercase while `Popular` and `Favorites` are capitalized. +/// Function bar display mode. Note the mixed casing: `all` is lowercase while `Popular` and `Favorites` are capitalized. #[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] pub enum FunctionBarMode { #[serde(rename = "all")] diff --git a/rust/gen/config.yaml b/rust/gen/config.yaml index 8770e524..fc7cb11a 100644 --- a/rust/gen/config.yaml +++ b/rust/gen/config.yaml @@ -2,5 +2,5 @@ additionalProperties: hideGenerationTimestamp: 'true' avoidBoxedModels: 'true' packageName: bluefin_api - packageVersion: 1.19.0 + packageVersion: 1.20.0 preferUnsignedInt: 'true' diff --git a/ts/sdk/openapitools.json b/ts/sdk/openapitools.json index 98579a1c..41ad7fd0 100644 --- a/ts/sdk/openapitools.json +++ b/ts/sdk/openapitools.json @@ -22,4 +22,4 @@ }, "generatorName": "typescript-axios", "spaces": 2 -} +} \ No newline at end of file diff --git a/ts/sdk/package.json b/ts/sdk/package.json index 76463a36..665d9fb5 100644 --- a/ts/sdk/package.json +++ b/ts/sdk/package.json @@ -59,5 +59,5 @@ }, "type": "module", "types": "./dist/index.d.ts", - "version": "2.2.0" + "version": "2.3.0" } \ No newline at end of file diff --git a/ts/sdk/src/.openapi-generator/FILES b/ts/sdk/src/.openapi-generator/FILES index 80232c09..7e2cbf5d 100644 --- a/ts/sdk/src/.openapi-generator/FILES +++ b/ts/sdk/src/.openapi-generator/FILES @@ -74,6 +74,7 @@ docs/GetAccountValueHistoryParamsInterval.md docs/GetAffiliateIntervalOverview200Response.md docs/GetAffiliateLeaderDashboard200Response.md docs/GetAffiliateOverview200Response.md +docs/GetSpotRewardClaims200Response.md docs/IntervalMetadata.md docs/IntervalRewards.md docs/IssBase64Details.md @@ -132,6 +133,8 @@ docs/SigPayload.md docs/SortOrder.md docs/SponsorTxRequest.md docs/SponsorTxResponse.md +docs/SpotRewardClaimCard.md +docs/SpotRewardClaimEntry.md docs/StatsAllTimeResponse.md docs/StatsEntry.md docs/StatsInterval.md diff --git a/ts/sdk/src/api.ts b/ts/sdk/src/api.ts index cc78f03d..f90c34bc 100644 --- a/ts/sdk/src/api.ts +++ b/ts/sdk/src/api.ts @@ -2831,6 +2831,31 @@ export interface GetAffiliateOverview200Response { */ 'page'?: number; } +/** + * + * @export + * @interface GetSpotRewardClaims200Response + */ +export interface GetSpotRewardClaims200Response { + /** + * + * @type {Array} + * @memberof GetSpotRewardClaims200Response + */ + 'data': Array; + /** + * claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows. + * @type {string} + * @memberof GetSpotRewardClaims200Response + */ + 'nextCursor': string; + /** + * + * @type {boolean} + * @memberof GetSpotRewardClaims200Response + */ + 'isMoreDataAvailable': boolean; +} /** * * @export @@ -4874,6 +4899,68 @@ export interface SponsorTxResponse { */ 'expireAtTime': number; } +/** + * + * @export + * @interface SpotRewardClaimCard + */ +export interface SpotRewardClaimCard { + /** + * + * @type {string} + * @memberof SpotRewardClaimCard + */ + 'userAddress': string; + /** + * On-chain pool object address. + * @type {string} + * @memberof SpotRewardClaimCard + */ + 'poolId': string; + /** + * + * @type {string} + * @memberof SpotRewardClaimCard + */ + 'poolName': string; + /** + * Claim time in epoch-ms, serialized as a string. + * @type {string} + * @memberof SpotRewardClaimCard + */ + 'claimTimestamp': string; + /** + * + * @type {string} + * @memberof SpotRewardClaimCard + */ + 'txDigest': string; + /** + * + * @type {Array} + * @memberof SpotRewardClaimCard + */ + 'rewards': Array; +} +/** + * + * @export + * @interface SpotRewardClaimEntry + */ +export interface SpotRewardClaimEntry { + /** + * Reward/fee token symbol; a fee and reward of the same symbol are merged. + * @type {string} + * @memberof SpotRewardClaimEntry + */ + 'rewardType': string; + /** + * Claimed amount in the token\'s own units (decimal string, e.g. \"0.61172\"). + * @type {string} + * @memberof SpotRewardClaimEntry + */ + 'rewardedAmount': string; +} /** * * @export @@ -9192,6 +9279,53 @@ export const RewardsApiAxiosParamCreator = function (configuration?: Configurati + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns a user\'s claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + * @summary /spot-rewards/claims + * @param {string} userAddress Wallet address whose spot claims to return. + * @param {number} [cursor] Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + * @param {number} [pageSize] Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSpotRewardClaims: async (userAddress: string, cursor?: number, pageSize?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'userAddress' is not null or undefined + assertParamExists('getSpotRewardClaims', 'userAddress', userAddress) + const localVarPath = `/v1/spot-rewards/claims`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + if (userAddress !== undefined) { + localVarQueryParameter['userAddress'] = userAddress; + } + + if (cursor !== undefined) { + localVarQueryParameter['cursor'] = cursor; + } + + if (pageSize !== undefined) { + localVarQueryParameter['pageSize'] = pageSize; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -9594,6 +9728,21 @@ export const RewardsApiFp = function(configuration?: Configuration) { const localVarOperationServerBasePath = operationServerMap['RewardsApi.getRewardsSummary']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + /** + * Returns a user\'s claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + * @summary /spot-rewards/claims + * @param {string} userAddress Wallet address whose spot claims to return. + * @param {number} [cursor] Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + * @param {number} [pageSize] Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getSpotRewardClaims(userAddress: string, cursor?: number, pageSize?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getSpotRewardClaims(userAddress, cursor, pageSize, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RewardsApi.getSpotRewardClaims']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, /** * Mark user claims as claimed for the specified campaign name and interval number * @summary /v1/rewards/claims/mark-claimed @@ -9813,6 +9962,18 @@ export const RewardsApiFactory = function (configuration?: Configuration, basePa getRewardsSummary(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getRewardsSummary(options).then((request) => request(axios, basePath)); }, + /** + * Returns a user\'s claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + * @summary /spot-rewards/claims + * @param {string} userAddress Wallet address whose spot claims to return. + * @param {number} [cursor] Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + * @param {number} [pageSize] Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getSpotRewardClaims(userAddress: string, cursor?: number, pageSize?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getSpotRewardClaims(userAddress, cursor, pageSize, options).then((request) => request(axios, basePath)); + }, /** * Mark user claims as claimed for the specified campaign name and interval number * @summary /v1/rewards/claims/mark-claimed @@ -10043,6 +10204,20 @@ export class RewardsApi extends BaseAPI { return RewardsApiFp(this.configuration).getRewardsSummary(options).then((request) => request(this.axios, this.basePath)); } + /** + * Returns a user\'s claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + * @summary /spot-rewards/claims + * @param {string} userAddress Wallet address whose spot claims to return. + * @param {number} [cursor] Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. + * @param {number} [pageSize] Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RewardsApi + */ + public getSpotRewardClaims(userAddress: string, cursor?: number, pageSize?: number, options?: RawAxiosRequestConfig) { + return RewardsApiFp(this.configuration).getSpotRewardClaims(userAddress, cursor, pageSize, options).then((request) => request(this.axios, this.basePath)); + } + /** * Mark user claims as claimed for the specified campaign name and interval number * @summary /v1/rewards/claims/mark-claimed diff --git a/ts/sdk/src/docs/GetSpotRewardClaims200Response.md b/ts/sdk/src/docs/GetSpotRewardClaims200Response.md new file mode 100644 index 00000000..f9fe88a8 --- /dev/null +++ b/ts/sdk/src/docs/GetSpotRewardClaims200Response.md @@ -0,0 +1,24 @@ +# GetSpotRewardClaims200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Array<SpotRewardClaimCard>**](SpotRewardClaimCard.md) | | [default to undefined] +**nextCursor** | **string** | claimTimestamp to pass as the next cursor, as a string; \"-1\" when there are no rows. | [default to undefined] +**isMoreDataAvailable** | **boolean** | | [default to undefined] + +## Example + +```typescript +import { GetSpotRewardClaims200Response } from '@bluefin/api-client'; + +const instance: GetSpotRewardClaims200Response = { + data, + nextCursor, + isMoreDataAvailable, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/ts/sdk/src/docs/RewardsApi.md b/ts/sdk/src/docs/RewardsApi.md index 9091b082..71d1918a 100644 --- a/ts/sdk/src/docs/RewardsApi.md +++ b/ts/sdk/src/docs/RewardsApi.md @@ -17,6 +17,7 @@ All URIs are relative to *https://api.sui-staging.bluefin.io* |[**getRewardsEpochMetadata**](#getrewardsepochmetadata) | **GET** /v1/rewards/metadata/epoch | /rewards/metadata/epoch| |[**getRewardsIntervalMetadata**](#getrewardsintervalmetadata) | **GET** /v1/rewards/metadata/interval | /rewards/metadata/interval| |[**getRewardsSummary**](#getrewardssummary) | **GET** /v1/rewards/summary | /rewards/summary| +|[**getSpotRewardClaims**](#getspotrewardclaims) | **GET** /v1/spot-rewards/claims | /spot-rewards/claims| |[**markAsClaimed**](#markasclaimed) | **POST** /v1/rewards/claims/mark-claimed | /v1/rewards/claims/mark-claimed| |[**onboardAffiliate**](#onboardaffiliate) | **POST** /v1/rewards/affiliate/onboard | /rewards/affiliate/onboard| |[**onboardReferee**](#onboardreferee) | **POST** /v1/rewards/affiliate/onboard/referee | /rewards/affiliate/onboard/referee| @@ -737,6 +738,64 @@ This endpoint does not have any parameters. [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) +# **getSpotRewardClaims** +> GetSpotRewardClaims200Response getSpotRewardClaims() + +Returns a user\'s claimed spot rewards and fees, grouped per claim transaction, with cursor pagination. + +### Example + +```typescript +import { + RewardsApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new RewardsApi(configuration); + +let userAddress: string; //Wallet address whose spot claims to return. (default to undefined) +let cursor: number; //Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. (optional) (default to 0) +let pageSize: number; //Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. (optional) (default to 100) + +const { status, data } = await apiInstance.getSpotRewardClaims( + userAddress, + cursor, + pageSize +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **userAddress** | [**string**] | Wallet address whose spot claims to return. | defaults to undefined| +| **cursor** | [**number**] | Return claims older than this claimTimestamp (epoch-ms). Omit or 0 for the first page. | (optional) defaults to 0| +| **pageSize** | [**number**] | Maximum number of claim cards to return. Out-of-range values are coerced: a value below 1 uses the default (100), and a value above 1000 is capped at 1000. A page may return a few more than pageSize cards when they share the boundary claim timestamp, so that pagination never splits or skips them. | (optional) defaults to 100| + + +### Return type + +**GetSpotRewardClaims200Response** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Paginated list of the user\'s spot claim cards. | - | +|**400** | request missing required parameters | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + # **markAsClaimed** > MarkAsClaimedResponse markAsClaimed(markAsClaimedRequest) diff --git a/ts/sdk/src/docs/SpotRewardClaimCard.md b/ts/sdk/src/docs/SpotRewardClaimCard.md new file mode 100644 index 00000000..a4afd4fa --- /dev/null +++ b/ts/sdk/src/docs/SpotRewardClaimCard.md @@ -0,0 +1,30 @@ +# SpotRewardClaimCard + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAddress** | **string** | | [default to undefined] +**poolId** | **string** | On-chain pool object address. | [default to undefined] +**poolName** | **string** | | [default to undefined] +**claimTimestamp** | **string** | Claim time in epoch-ms, serialized as a string. | [default to undefined] +**txDigest** | **string** | | [default to undefined] +**rewards** | [**Array<SpotRewardClaimEntry>**](SpotRewardClaimEntry.md) | | [default to undefined] + +## Example + +```typescript +import { SpotRewardClaimCard } from '@bluefin/api-client'; + +const instance: SpotRewardClaimCard = { + userAddress, + poolId, + poolName, + claimTimestamp, + txDigest, + rewards, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/ts/sdk/src/docs/SpotRewardClaimEntry.md b/ts/sdk/src/docs/SpotRewardClaimEntry.md new file mode 100644 index 00000000..dd4b2976 --- /dev/null +++ b/ts/sdk/src/docs/SpotRewardClaimEntry.md @@ -0,0 +1,22 @@ +# SpotRewardClaimEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rewardType** | **string** | Reward/fee token symbol; a fee and reward of the same symbol are merged. | [default to undefined] +**rewardedAmount** | **string** | Claimed amount in the token\'s own units (decimal string, e.g. \"0.61172\"). | [default to undefined] + +## Example + +```typescript +import { SpotRewardClaimEntry } from '@bluefin/api-client'; + +const instance: SpotRewardClaimEntry = { + rewardType, + rewardedAmount, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)