From 202cc7aa2f6fcc710a638e3e8bfe665a35a22aa1 Mon Sep 17 00:00:00 2001 From: nidakarimali Date: Tue, 3 Mar 2026 12:03:46 -0500 Subject: [PATCH 1/5] updates for kora rewards api --- python/sdk/src/.openapi-generator/FILES | 28 +- python/sdk/src/openapi_client/__init__.py | 12 + python/sdk/src/openapi_client/api/__init__.py | 1 + python/sdk/src/openapi_client/api/kora_api.py | 2319 +++++ python/sdk/src/openapi_client/docs/KoraApi.md | 588 ++ .../openapi_client/docs/KoraCampaignBonus.md | 32 + .../docs/KoraCampaignMetadata.md | 33 + .../docs/KoraCampaignRewards.md | 47 + .../openapi_client/docs/KoraEpochConfig.md | 38 + .../docs/KoraEpochConfigResponse.md | 31 + .../openapi_client/docs/KoraEpochMetadata.md | 34 + .../docs/KoraHealthCheck200Response.md | 30 + .../docs/KoraIntervalMetadata.md | 34 + .../docs/KoraLeaderboardEntry.md | 41 + .../docs/KoraLeaderboardResponse.md | 32 + .../openapi_client/docs/KoraRewardsSummary.md | 34 + .../sdk/src/openapi_client/models/__init__.py | 11 + .../models/kora_campaign_bonus.py | 93 + .../models/kora_campaign_metadata.py | 102 + .../models/kora_campaign_rewards.py | 148 + .../models/kora_epoch_config.py | 105 + .../models/kora_epoch_config_response.py | 99 + .../models/kora_epoch_metadata.py | 104 + .../models/kora_health_check200_response.py | 89 + .../models/kora_interval_metadata.py | 114 + .../models/kora_leaderboard_entry.py | 111 + .../models/kora_leaderboard_response.py | 101 + .../models/kora_rewards_summary.py | 97 + .../src/openapi_client/test/test_kora_api.py | 87 + .../test/test_kora_campaign_bonus.py | 54 + .../test/test_kora_campaign_metadata.py | 59 + .../test/test_kora_campaign_rewards.py | 80 + .../test/test_kora_epoch_config.py | 64 + .../test/test_kora_epoch_config_response.py | 80 + .../test/test_kora_epoch_metadata.py | 62 + .../test_kora_health_check200_response.py | 52 + .../test/test_kora_interval_metadata.py | 60 + .../test/test_kora_leaderboard_entry.py | 69 + .../test/test_kora_leaderboard_response.py | 88 + .../test/test_kora_rewards_summary.py | 57 + python/sdk/src/openapi_client_README.md | 19 + resources/bluefin-api.yaml | 22 +- resources/kora-rewards-api.yaml | 805 ++ rust/Cargo.lock | 222 +- rust/gen/bluefin_api/.openapi-generator/FILES | 24 + rust/gen/bluefin_api/Cargo.toml | 1 + rust/gen/bluefin_api/README.md | 19 + rust/gen/bluefin_api/docs/KoraApi.md | 262 + .../gen/bluefin_api/docs/KoraCampaignBonus.md | 14 + .../bluefin_api/docs/KoraCampaignMetadata.md | 15 + .../bluefin_api/docs/KoraCampaignRewards.md | 29 + rust/gen/bluefin_api/docs/KoraEpochConfig.md | 20 + .../docs/KoraEpochConfigResponse.md | 13 + .../gen/bluefin_api/docs/KoraEpochMetadata.md | 16 + .../docs/KoraHealthCheck200Response.md | 12 + .../bluefin_api/docs/KoraIntervalMetadata.md | 16 + .../bluefin_api/docs/KoraLeaderboardEntry.md | 23 + .../docs/KoraLeaderboardResponse.md | 14 + .../bluefin_api/docs/KoraRewardsSummary.md | 16 + rust/gen/bluefin_api/src/apis/kora_api.rs | 435 + rust/gen/bluefin_api/src/apis/mod.rs | 1 + .../src/models/kora_campaign_bonus.rs | 40 + .../src/models/kora_campaign_metadata.rs | 57 + .../src/models/kora_campaign_rewards.rs | 135 + .../src/models/kora_epoch_config.rs | 64 + .../src/models/kora_epoch_config_response.rs | 35 + .../src/models/kora_epoch_metadata.rs | 65 + .../models/kora_health_check_200_response.rs | 30 + .../src/models/kora_interval_metadata.rs | 79 + .../src/models/kora_leaderboard_entry.rs | 76 + .../src/models/kora_leaderboard_response.rs | 39 + .../src/models/kora_rewards_summary.rs | 48 + rust/gen/bluefin_api/src/models/mod.rs | 22 + ts/sdk/package.json | 2 +- ts/sdk/src/.openapi-generator/FILES | 12 + ts/sdk/src/api.ts | 7726 ++++++++++------- ts/sdk/src/docs/KoraApi.md | 447 + ts/sdk/src/docs/KoraCampaignBonus.md | 26 + ts/sdk/src/docs/KoraCampaignMetadata.md | 28 + ts/sdk/src/docs/KoraCampaignRewards.md | 56 + ts/sdk/src/docs/KoraEpochConfig.md | 38 + ts/sdk/src/docs/KoraEpochConfigResponse.md | 24 + ts/sdk/src/docs/KoraEpochMetadata.md | 30 + ts/sdk/src/docs/KoraHealthCheck200Response.md | 22 + ts/sdk/src/docs/KoraIntervalMetadata.md | 30 + ts/sdk/src/docs/KoraLeaderboardEntry.md | 44 + ts/sdk/src/docs/KoraLeaderboardResponse.md | 26 + ts/sdk/src/docs/KoraRewardsSummary.md | 30 + 88 files changed, 13341 insertions(+), 3208 deletions(-) create mode 100644 python/sdk/src/openapi_client/api/kora_api.py create mode 100644 python/sdk/src/openapi_client/docs/KoraApi.md create mode 100644 python/sdk/src/openapi_client/docs/KoraCampaignBonus.md create mode 100644 python/sdk/src/openapi_client/docs/KoraCampaignMetadata.md create mode 100644 python/sdk/src/openapi_client/docs/KoraCampaignRewards.md create mode 100644 python/sdk/src/openapi_client/docs/KoraEpochConfig.md create mode 100644 python/sdk/src/openapi_client/docs/KoraEpochConfigResponse.md create mode 100644 python/sdk/src/openapi_client/docs/KoraEpochMetadata.md create mode 100644 python/sdk/src/openapi_client/docs/KoraHealthCheck200Response.md create mode 100644 python/sdk/src/openapi_client/docs/KoraIntervalMetadata.md create mode 100644 python/sdk/src/openapi_client/docs/KoraLeaderboardEntry.md create mode 100644 python/sdk/src/openapi_client/docs/KoraLeaderboardResponse.md create mode 100644 python/sdk/src/openapi_client/docs/KoraRewardsSummary.md create mode 100644 python/sdk/src/openapi_client/models/kora_campaign_bonus.py create mode 100644 python/sdk/src/openapi_client/models/kora_campaign_metadata.py create mode 100644 python/sdk/src/openapi_client/models/kora_campaign_rewards.py create mode 100644 python/sdk/src/openapi_client/models/kora_epoch_config.py create mode 100644 python/sdk/src/openapi_client/models/kora_epoch_config_response.py create mode 100644 python/sdk/src/openapi_client/models/kora_epoch_metadata.py create mode 100644 python/sdk/src/openapi_client/models/kora_health_check200_response.py create mode 100644 python/sdk/src/openapi_client/models/kora_interval_metadata.py create mode 100644 python/sdk/src/openapi_client/models/kora_leaderboard_entry.py create mode 100644 python/sdk/src/openapi_client/models/kora_leaderboard_response.py create mode 100644 python/sdk/src/openapi_client/models/kora_rewards_summary.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_api.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_campaign_bonus.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_campaign_metadata.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_campaign_rewards.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_epoch_config.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_epoch_config_response.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_epoch_metadata.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_health_check200_response.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_interval_metadata.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_leaderboard_entry.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_leaderboard_response.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_rewards_summary.py create mode 100644 resources/kora-rewards-api.yaml create mode 100644 rust/gen/bluefin_api/docs/KoraApi.md create mode 100644 rust/gen/bluefin_api/docs/KoraCampaignBonus.md create mode 100644 rust/gen/bluefin_api/docs/KoraCampaignMetadata.md create mode 100644 rust/gen/bluefin_api/docs/KoraCampaignRewards.md create mode 100644 rust/gen/bluefin_api/docs/KoraEpochConfig.md create mode 100644 rust/gen/bluefin_api/docs/KoraEpochConfigResponse.md create mode 100644 rust/gen/bluefin_api/docs/KoraEpochMetadata.md create mode 100644 rust/gen/bluefin_api/docs/KoraHealthCheck200Response.md create mode 100644 rust/gen/bluefin_api/docs/KoraIntervalMetadata.md create mode 100644 rust/gen/bluefin_api/docs/KoraLeaderboardEntry.md create mode 100644 rust/gen/bluefin_api/docs/KoraLeaderboardResponse.md create mode 100644 rust/gen/bluefin_api/docs/KoraRewardsSummary.md create mode 100644 rust/gen/bluefin_api/src/apis/kora_api.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_campaign_bonus.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_campaign_metadata.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_campaign_rewards.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_epoch_config.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_epoch_config_response.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_epoch_metadata.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_health_check_200_response.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_interval_metadata.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_leaderboard_entry.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_leaderboard_response.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_rewards_summary.rs create mode 100644 ts/sdk/src/docs/KoraApi.md create mode 100644 ts/sdk/src/docs/KoraCampaignBonus.md create mode 100644 ts/sdk/src/docs/KoraCampaignMetadata.md create mode 100644 ts/sdk/src/docs/KoraCampaignRewards.md create mode 100644 ts/sdk/src/docs/KoraEpochConfig.md create mode 100644 ts/sdk/src/docs/KoraEpochConfigResponse.md create mode 100644 ts/sdk/src/docs/KoraEpochMetadata.md create mode 100644 ts/sdk/src/docs/KoraHealthCheck200Response.md create mode 100644 ts/sdk/src/docs/KoraIntervalMetadata.md create mode 100644 ts/sdk/src/docs/KoraLeaderboardEntry.md create mode 100644 ts/sdk/src/docs/KoraLeaderboardResponse.md create mode 100644 ts/sdk/src/docs/KoraRewardsSummary.md diff --git a/python/sdk/src/.openapi-generator/FILES b/python/sdk/src/.openapi-generator/FILES index 15e9747a..58c8e003 100644 --- a/python/sdk/src/.openapi-generator/FILES +++ b/python/sdk/src/.openapi-generator/FILES @@ -3,6 +3,7 @@ openapi_client/api/__init__.py openapi_client/api/account_data_api.py openapi_client/api/auth_api.py openapi_client/api/exchange_api.py +openapi_client/api/kora_api.py openapi_client/api/rewards_api.py openapi_client/api/streams_api.py openapi_client/api/trade_api.py @@ -79,6 +80,18 @@ openapi_client/docs/IntervalMetadata.md openapi_client/docs/IntervalRewards.md openapi_client/docs/IssBase64Details.md openapi_client/docs/KlineInterval.md +openapi_client/docs/KoraApi.md +openapi_client/docs/KoraCampaignBonus.md +openapi_client/docs/KoraCampaignMetadata.md +openapi_client/docs/KoraCampaignRewards.md +openapi_client/docs/KoraEpochConfig.md +openapi_client/docs/KoraEpochConfigResponse.md +openapi_client/docs/KoraEpochMetadata.md +openapi_client/docs/KoraHealthCheck200Response.md +openapi_client/docs/KoraIntervalMetadata.md +openapi_client/docs/KoraLeaderboardEntry.md +openapi_client/docs/KoraLeaderboardResponse.md +openapi_client/docs/KoraRewardsSummary.md openapi_client/docs/LeaderboardEntry.md openapi_client/docs/LeaderboardInterval.md openapi_client/docs/LeaderboardResponse.md @@ -224,6 +237,17 @@ openapi_client/models/interval_metadata.py openapi_client/models/interval_rewards.py openapi_client/models/iss_base64_details.py openapi_client/models/kline_interval.py +openapi_client/models/kora_campaign_bonus.py +openapi_client/models/kora_campaign_metadata.py +openapi_client/models/kora_campaign_rewards.py +openapi_client/models/kora_epoch_config.py +openapi_client/models/kora_epoch_config_response.py +openapi_client/models/kora_epoch_metadata.py +openapi_client/models/kora_health_check200_response.py +openapi_client/models/kora_interval_metadata.py +openapi_client/models/kora_leaderboard_entry.py +openapi_client/models/kora_leaderboard_response.py +openapi_client/models/kora_rewards_summary.py openapi_client/models/leaderboard_entry.py openapi_client/models/leaderboard_interval.py openapi_client/models/leaderboard_response.py @@ -299,8 +323,4 @@ openapi_client/models/zk_login_zkp_request.py openapi_client/models/zk_login_zkp_response.py openapi_client/rest.py openapi_client/test/__init__.py -openapi_client/test/test_leaderboard_entry.py -openapi_client/test/test_leaderboard_interval.py -openapi_client/test/test_leaderboard_response.py -openapi_client/test/test_sort_order.py openapi_client_README.md diff --git a/python/sdk/src/openapi_client/__init__.py b/python/sdk/src/openapi_client/__init__.py index 6fade1b0..f4b2919d 100644 --- a/python/sdk/src/openapi_client/__init__.py +++ b/python/sdk/src/openapi_client/__init__.py @@ -20,6 +20,7 @@ from openapi_client.api.account_data_api import AccountDataApi from openapi_client.api.auth_api import AuthApi from openapi_client.api.exchange_api import ExchangeApi +from openapi_client.api.kora_api import KoraApi from openapi_client.api.rewards_api import RewardsApi from openapi_client.api.streams_api import StreamsApi from openapi_client.api.trade_api import TradeApi @@ -103,6 +104,17 @@ from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details from openapi_client.models.kline_interval import KlineInterval +from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus +from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata +from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards +from openapi_client.models.kora_epoch_config import KoraEpochConfig +from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse +from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata +from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response +from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata +from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry +from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse +from openapi_client.models.kora_rewards_summary import KoraRewardsSummary from openapi_client.models.leaderboard_entry import LeaderboardEntry from openapi_client.models.leaderboard_interval import LeaderboardInterval from openapi_client.models.leaderboard_response import LeaderboardResponse diff --git a/python/sdk/src/openapi_client/api/__init__.py b/python/sdk/src/openapi_client/api/__init__.py index 009c24a7..3fc38353 100644 --- a/python/sdk/src/openapi_client/api/__init__.py +++ b/python/sdk/src/openapi_client/api/__init__.py @@ -4,6 +4,7 @@ from openapi_client.api.account_data_api import AccountDataApi from openapi_client.api.auth_api import AuthApi from openapi_client.api.exchange_api import ExchangeApi +from openapi_client.api.kora_api import KoraApi from openapi_client.api.rewards_api import RewardsApi from openapi_client.api.streams_api import StreamsApi from openapi_client.api.trade_api import TradeApi diff --git a/python/sdk/src/openapi_client/api/kora_api.py b/python/sdk/src/openapi_client/api/kora_api.py new file mode 100644 index 00000000..0561b052 --- /dev/null +++ b/python/sdk/src/openapi_client/api/kora_api.py @@ -0,0 +1,2319 @@ +# 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 warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictInt, StrictStr, field_validator +from typing import List, Optional +from typing_extensions import Annotated +from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata +from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards +from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse +from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata +from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response +from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata +from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse +from openapi_client.models.kora_rewards_summary import KoraRewardsSummary + +from openapi_client.api_client import ApiClient, RequestSerialized +from openapi_client.api_response import ApiResponse +from openapi_client.rest import RESTResponseType + + +class KoraApi: + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None) -> None: + if api_client is None: + api_client = ApiClient.get_default() + self.api_client = api_client + + + @validate_call + async def get_kora_campaign_metadata( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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, + ) -> List[KoraCampaignMetadata]: + """Get Kora campaign metadata + + Returns metadata for Kora rewards campaigns. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param status: Filter by campaign status + :type status: str + :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_kora_campaign_metadata_serialize( + campaign_name=campaign_name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignMetadata]", + } + 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_kora_campaign_metadata_with_http_info( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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[List[KoraCampaignMetadata]]: + """Get Kora campaign metadata + + Returns metadata for Kora rewards campaigns. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param status: Filter by campaign status + :type status: str + :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_kora_campaign_metadata_serialize( + campaign_name=campaign_name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignMetadata]", + } + 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_kora_campaign_metadata_without_preload_content( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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: + """Get Kora campaign metadata + + Returns metadata for Kora rewards campaigns. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param status: Filter by campaign status + :type status: str + :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_kora_campaign_metadata_serialize( + campaign_name=campaign_name, + status=status, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignMetadata]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_campaign_metadata_serialize( + self, + campaign_name, + status, + _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 campaign_name is not None: + + _query_params.append(('campaignName', campaign_name)) + + if status is not None: + + _query_params.append(('status', status)) + + # 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/kora/metadata/campaign', + 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 get_kora_campaign_rewards( + self, + user_address: Annotated[StrictStr, Field(description="Specify wallet address")], + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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, + ) -> List[KoraCampaignRewards]: + """Get Kora campaign rewards + + Returns the rewards earned by users for Kora campaigns. + + :param user_address: Specify wallet address (required) + :type user_address: str + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch_number: Optionally specify epoch number + :type epoch_number: 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_kora_campaign_rewards_serialize( + user_address=user_address, + campaign_name=campaign_name, + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignRewards]", + '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_kora_campaign_rewards_with_http_info( + self, + user_address: Annotated[StrictStr, Field(description="Specify wallet address")], + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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[List[KoraCampaignRewards]]: + """Get Kora campaign rewards + + Returns the rewards earned by users for Kora campaigns. + + :param user_address: Specify wallet address (required) + :type user_address: str + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch_number: Optionally specify epoch number + :type epoch_number: 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_kora_campaign_rewards_serialize( + user_address=user_address, + campaign_name=campaign_name, + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignRewards]", + '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_kora_campaign_rewards_without_preload_content( + self, + user_address: Annotated[StrictStr, Field(description="Specify wallet address")], + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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: + """Get Kora campaign rewards + + Returns the rewards earned by users for Kora campaigns. + + :param user_address: Specify wallet address (required) + :type user_address: str + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch_number: Optionally specify epoch number + :type epoch_number: 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_kora_campaign_rewards_serialize( + user_address=user_address, + campaign_name=campaign_name, + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraCampaignRewards]", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_campaign_rewards_serialize( + self, + user_address, + campaign_name, + epoch_number, + _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 campaign_name is not None: + + _query_params.append(('campaignName', campaign_name)) + + if epoch_number is not None: + + _query_params.append(('epochNumber', epoch_number)) + + if user_address is not None: + + _query_params.append(('userAddress', user_address)) + + # 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/kora/rewards/campaign', + 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 get_kora_epoch_config_metadata( + self, + interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, + campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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, + ) -> KoraEpochConfigResponse: + """Get Kora epoch configuration + + Returns epoch configuration including reward allocations for Kora. + + :param interval_number: Specify the interval number + :type interval_number: int + :param campaign_name: Filter by campaign name + :type campaign_name: str + :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_kora_epoch_config_metadata_serialize( + interval_number=interval_number, + campaign_name=campaign_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraEpochConfigResponse", + } + 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_kora_epoch_config_metadata_with_http_info( + self, + interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, + campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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[KoraEpochConfigResponse]: + """Get Kora epoch configuration + + Returns epoch configuration including reward allocations for Kora. + + :param interval_number: Specify the interval number + :type interval_number: int + :param campaign_name: Filter by campaign name + :type campaign_name: str + :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_kora_epoch_config_metadata_serialize( + interval_number=interval_number, + campaign_name=campaign_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraEpochConfigResponse", + } + 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_kora_epoch_config_metadata_without_preload_content( + self, + interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, + campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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: + """Get Kora epoch configuration + + Returns epoch configuration including reward allocations for Kora. + + :param interval_number: Specify the interval number + :type interval_number: int + :param campaign_name: Filter by campaign name + :type campaign_name: str + :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_kora_epoch_config_metadata_serialize( + interval_number=interval_number, + campaign_name=campaign_name, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraEpochConfigResponse", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_epoch_config_metadata_serialize( + self, + interval_number, + campaign_name, + _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 interval_number is not None: + + _query_params.append(('intervalNumber', interval_number)) + + if campaign_name is not None: + + _query_params.append(('campaignName', campaign_name)) + + # 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/kora/metadata/epoch/configs', + 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 get_kora_epoch_metadata( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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, + ) -> List[KoraEpochMetadata]: + """Get Kora epoch metadata + + Returns the latest or next epoch for a Kora campaign. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch: Specify \"next\" or \"latest\" + :type epoch: str + :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_kora_epoch_metadata_serialize( + campaign_name=campaign_name, + epoch=epoch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraEpochMetadata]", + } + 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_kora_epoch_metadata_with_http_info( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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[List[KoraEpochMetadata]]: + """Get Kora epoch metadata + + Returns the latest or next epoch for a Kora campaign. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch: Specify \"next\" or \"latest\" + :type epoch: str + :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_kora_epoch_metadata_serialize( + campaign_name=campaign_name, + epoch=epoch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraEpochMetadata]", + } + 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_kora_epoch_metadata_without_preload_content( + self, + campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, + epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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: + """Get Kora epoch metadata + + Returns the latest or next epoch for a Kora campaign. + + :param campaign_name: Specify the campaign name + :type campaign_name: str + :param epoch: Specify \"next\" or \"latest\" + :type epoch: str + :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_kora_epoch_metadata_serialize( + campaign_name=campaign_name, + epoch=epoch, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraEpochMetadata]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_epoch_metadata_serialize( + self, + campaign_name, + epoch, + _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 campaign_name is not None: + + _query_params.append(('campaignName', campaign_name)) + + if epoch is not None: + + _query_params.append(('epoch', epoch)) + + # 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/kora/metadata/epoch', + 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 get_kora_interval_metadata( + self, + interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, + protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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, + ) -> List[KoraIntervalMetadata]: + """Get Kora interval metadata + + Returns interval metadata for Kora. + + :param interval: Interval number or \"next\"/\"latest\" + :type interval: str + :param protocol: Filter by protocol + :type protocol: str + :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_kora_interval_metadata_serialize( + interval=interval, + protocol=protocol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraIntervalMetadata]", + } + 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_kora_interval_metadata_with_http_info( + self, + interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, + protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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[List[KoraIntervalMetadata]]: + """Get Kora interval metadata + + Returns interval metadata for Kora. + + :param interval: Interval number or \"next\"/\"latest\" + :type interval: str + :param protocol: Filter by protocol + :type protocol: str + :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_kora_interval_metadata_serialize( + interval=interval, + protocol=protocol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraIntervalMetadata]", + } + 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_kora_interval_metadata_without_preload_content( + self, + interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, + protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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: + """Get Kora interval metadata + + Returns interval metadata for Kora. + + :param interval: Interval number or \"next\"/\"latest\" + :type interval: str + :param protocol: Filter by protocol + :type protocol: str + :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_kora_interval_metadata_serialize( + interval=interval, + protocol=protocol, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraIntervalMetadata]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_interval_metadata_serialize( + self, + interval, + protocol, + _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 interval is not None: + + _query_params.append(('interval', interval)) + + if protocol is not None: + + _query_params.append(('protocol', protocol)) + + # 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/kora/metadata/interval', + 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 get_kora_leaderboard( + self, + epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, + search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, + min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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, + ) -> KoraLeaderboardResponse: + """Get Kora swap leaderboard + + Returns rankings and earnings for Kora swap participants, sorted by the specified category. + + :param epoch_id: Specify epoch ID (defaults to current active epoch) + :type epoch_id: str + :param sort_by: The category to sort rankings by + :type sort_by: str + :param sort_order: The order to sort rankings by + :type sort_order: str + :param page: Page number for pagination + :type page: int + :param limit: Page size for pagination + :type limit: int + :param search: Filter by user address (partial match supported) + :type search: str + :param min_volume_e6: Minimum trading volume filter (e6 format) + :type min_volume_e6: str + :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_kora_leaderboard_serialize( + epoch_id=epoch_id, + sort_by=sort_by, + sort_order=sort_order, + page=page, + limit=limit, + search=search, + min_volume_e6=min_volume_e6, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraLeaderboardResponse", + '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_kora_leaderboard_with_http_info( + self, + epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, + search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, + min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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[KoraLeaderboardResponse]: + """Get Kora swap leaderboard + + Returns rankings and earnings for Kora swap participants, sorted by the specified category. + + :param epoch_id: Specify epoch ID (defaults to current active epoch) + :type epoch_id: str + :param sort_by: The category to sort rankings by + :type sort_by: str + :param sort_order: The order to sort rankings by + :type sort_order: str + :param page: Page number for pagination + :type page: int + :param limit: Page size for pagination + :type limit: int + :param search: Filter by user address (partial match supported) + :type search: str + :param min_volume_e6: Minimum trading volume filter (e6 format) + :type min_volume_e6: str + :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_kora_leaderboard_serialize( + epoch_id=epoch_id, + sort_by=sort_by, + sort_order=sort_order, + page=page, + limit=limit, + search=search, + min_volume_e6=min_volume_e6, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraLeaderboardResponse", + '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_kora_leaderboard_without_preload_content( + self, + epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, + sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, + sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, + page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, + search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, + min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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: + """Get Kora swap leaderboard + + Returns rankings and earnings for Kora swap participants, sorted by the specified category. + + :param epoch_id: Specify epoch ID (defaults to current active epoch) + :type epoch_id: str + :param sort_by: The category to sort rankings by + :type sort_by: str + :param sort_order: The order to sort rankings by + :type sort_order: str + :param page: Page number for pagination + :type page: int + :param limit: Page size for pagination + :type limit: int + :param search: Filter by user address (partial match supported) + :type search: str + :param min_volume_e6: Minimum trading volume filter (e6 format) + :type min_volume_e6: str + :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_kora_leaderboard_serialize( + epoch_id=epoch_id, + sort_by=sort_by, + sort_order=sort_order, + page=page, + limit=limit, + search=search, + min_volume_e6=min_volume_e6, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraLeaderboardResponse", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_leaderboard_serialize( + self, + epoch_id, + sort_by, + sort_order, + page, + limit, + search, + min_volume_e6, + _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 epoch_id is not None: + + _query_params.append(('epochId', epoch_id)) + + if sort_by is not None: + + _query_params.append(('sortBy', sort_by)) + + if sort_order is not None: + + _query_params.append(('sortOrder', sort_order)) + + if page is not None: + + _query_params.append(('page', page)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + if search is not None: + + _query_params.append(('search', search)) + + if min_volume_e6 is not None: + + _query_params.append(('minVolumeE6', min_volume_e6)) + + # 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/kora/leaderboard', + 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 get_kora_rewards_summary( + self, + _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, + ) -> List[KoraRewardsSummary]: + """Get Kora all-time rewards summary + + Returns the all-time rewards earned by users including Kora CC and points. + + :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_kora_rewards_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraRewardsSummary]", + } + 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_kora_rewards_summary_with_http_info( + self, + _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[List[KoraRewardsSummary]]: + """Get Kora all-time rewards summary + + Returns the all-time rewards earned by users including Kora CC and points. + + :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_kora_rewards_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraRewardsSummary]", + } + 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_kora_rewards_summary_without_preload_content( + self, + _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: + """Get Kora all-time rewards summary + + Returns the all-time rewards earned by users including Kora CC and points. + + :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_kora_rewards_summary_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraRewardsSummary]", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_kora_rewards_summary_serialize( + self, + _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 + # 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] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/v1/kora/rewards/summary', + 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 kora_health_check( + self, + _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, + ) -> KoraHealthCheck200Response: + """Kora service health check + + Returns the health status of the Kora rewards service. + + :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._kora_health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraHealthCheck200Response", + } + 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 kora_health_check_with_http_info( + self, + _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[KoraHealthCheck200Response]: + """Kora service health check + + Returns the health status of the Kora rewards service. + + :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._kora_health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraHealthCheck200Response", + } + 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 kora_health_check_without_preload_content( + self, + _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: + """Kora service health check + + Returns the health status of the Kora rewards service. + + :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._kora_health_check_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "KoraHealthCheck200Response", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _kora_health_check_serialize( + self, + _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 + # 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/kora/health', + 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 + ) + + diff --git a/python/sdk/src/openapi_client/docs/KoraApi.md b/python/sdk/src/openapi_client/docs/KoraApi.md new file mode 100644 index 00000000..1b9eea5e --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraApi.md @@ -0,0 +1,588 @@ +# openapi_client.KoraApi + +All URIs are relative to *https://api.sui-staging.bluefin.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_kora_campaign_metadata**](KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata +[**get_kora_campaign_rewards**](KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards +[**get_kora_epoch_config_metadata**](KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration +[**get_kora_epoch_metadata**](KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata +[**get_kora_interval_metadata**](KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata +[**get_kora_leaderboard**](KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard +[**get_kora_rewards_summary**](KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary +[**kora_health_check**](KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check + + +# **get_kora_campaign_metadata** +> List[KoraCampaignMetadata] get_kora_campaign_metadata(campaign_name=campaign_name, status=status) + +Get Kora campaign metadata + +Returns metadata for Kora rewards campaigns. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata +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.KoraApi(api_client) + campaign_name = 'KORA_SWAPS' # str | Specify the campaign name (optional) + status = ACTIVE # str | Filter by campaign status (optional) (default to ACTIVE) + + try: + # Get Kora campaign metadata + api_response = await api_instance.get_kora_campaign_metadata(campaign_name=campaign_name, status=status) + print("The response of KoraApi->get_kora_campaign_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_campaign_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **campaign_name** | **str**| Specify the campaign name | [optional] + **status** | **str**| Filter by campaign status | [optional] [default to ACTIVE] + +### Return type + +[**List[KoraCampaignMetadata]**](KoraCampaignMetadata.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[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_kora_campaign_rewards** +> List[KoraCampaignRewards] get_kora_campaign_rewards(user_address, campaign_name=campaign_name, epoch_number=epoch_number) + +Get Kora campaign rewards + +Returns the rewards earned by users for Kora campaigns. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards +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.KoraApi(api_client) + user_address = '0x1234567890abcdef' # str | Specify wallet address + campaign_name = KORA_SWAPS # str | Specify the campaign name (optional) (default to KORA_SWAPS) + epoch_number = 7 # int | Optionally specify epoch number (optional) + + try: + # Get Kora campaign rewards + api_response = await api_instance.get_kora_campaign_rewards(user_address, campaign_name=campaign_name, epoch_number=epoch_number) + print("The response of KoraApi->get_kora_campaign_rewards:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_campaign_rewards: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **user_address** | **str**| Specify wallet address | + **campaign_name** | **str**| Specify the campaign name | [optional] [default to KORA_SWAPS] + **epoch_number** | **int**| Optionally specify epoch number | [optional] + +### Return type + +[**List[KoraCampaignRewards]**](KoraCampaignRewards.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | 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) + +# **get_kora_epoch_config_metadata** +> KoraEpochConfigResponse get_kora_epoch_config_metadata(interval_number=interval_number, campaign_name=campaign_name) + +Get Kora epoch configuration + +Returns epoch configuration including reward allocations for Kora. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse +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.KoraApi(api_client) + interval_number = 7 # int | Specify the interval number (optional) + campaign_name = 'KORA_SWAPS' # str | Filter by campaign name (optional) + + try: + # Get Kora epoch configuration + api_response = await api_instance.get_kora_epoch_config_metadata(interval_number=interval_number, campaign_name=campaign_name) + print("The response of KoraApi->get_kora_epoch_config_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_epoch_config_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **interval_number** | **int**| Specify the interval number | [optional] + **campaign_name** | **str**| Filter by campaign name | [optional] + +### Return type + +[**KoraEpochConfigResponse**](KoraEpochConfigResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[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_kora_epoch_metadata** +> List[KoraEpochMetadata] get_kora_epoch_metadata(campaign_name=campaign_name, epoch=epoch) + +Get Kora epoch metadata + +Returns the latest or next epoch for a Kora campaign. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata +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.KoraApi(api_client) + campaign_name = 'KORA_SWAPS' # str | Specify the campaign name (optional) + epoch = 'epoch_example' # str | Specify \"next\" or \"latest\" (optional) + + try: + # Get Kora epoch metadata + api_response = await api_instance.get_kora_epoch_metadata(campaign_name=campaign_name, epoch=epoch) + print("The response of KoraApi->get_kora_epoch_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_epoch_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **campaign_name** | **str**| Specify the campaign name | [optional] + **epoch** | **str**| Specify \"next\" or \"latest\" | [optional] + +### Return type + +[**List[KoraEpochMetadata]**](KoraEpochMetadata.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[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_kora_interval_metadata** +> List[KoraIntervalMetadata] get_kora_interval_metadata(interval=interval, protocol=protocol) + +Get Kora interval metadata + +Returns interval metadata for Kora. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata +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.KoraApi(api_client) + interval = 'latest' # str | Interval number or \"next\"/\"latest\" (optional) + protocol = kora # str | Filter by protocol (optional) (default to kora) + + try: + # Get Kora interval metadata + api_response = await api_instance.get_kora_interval_metadata(interval=interval, protocol=protocol) + print("The response of KoraApi->get_kora_interval_metadata:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_interval_metadata: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **interval** | **str**| Interval number or \"next\"/\"latest\" | [optional] + **protocol** | **str**| Filter by protocol | [optional] [default to kora] + +### Return type + +[**List[KoraIntervalMetadata]**](KoraIntervalMetadata.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[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_kora_leaderboard** +> KoraLeaderboardResponse get_kora_leaderboard(epoch_id=epoch_id, sort_by=sort_by, sort_order=sort_order, page=page, limit=limit, search=search, min_volume_e6=min_volume_e6) + +Get Kora swap leaderboard + +Returns rankings and earnings for Kora swap participants, sorted by the specified category. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse +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.KoraApi(api_client) + epoch_id = 'epoch_id_example' # str | Specify epoch ID (defaults to current active epoch) (optional) + sort_by = volumeRank # str | The category to sort rankings by (optional) (default to volumeRank) + sort_order = desc # str | The order to sort rankings by (optional) (default to desc) + page = 1 # int | Page number for pagination (optional) (default to 1) + limit = 50 # int | Page size for pagination (optional) (default to 50) + search = 'search_example' # str | Filter by user address (partial match supported) (optional) + min_volume_e6 = '0' # str | Minimum trading volume filter (e6 format) (optional) (default to '0') + + try: + # Get Kora swap leaderboard + api_response = await api_instance.get_kora_leaderboard(epoch_id=epoch_id, sort_by=sort_by, sort_order=sort_order, page=page, limit=limit, search=search, min_volume_e6=min_volume_e6) + print("The response of KoraApi->get_kora_leaderboard:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_leaderboard: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **epoch_id** | **str**| Specify epoch ID (defaults to current active epoch) | [optional] + **sort_by** | **str**| The category to sort rankings by | [optional] [default to volumeRank] + **sort_order** | **str**| The order to sort rankings by | [optional] [default to desc] + **page** | **int**| Page number for pagination | [optional] [default to 1] + **limit** | **int**| Page size for pagination | [optional] [default to 50] + **search** | **str**| Filter by user address (partial match supported) | [optional] + **min_volume_e6** | **str**| Minimum trading volume filter (e6 format) | [optional] [default to '0'] + +### Return type + +[**KoraLeaderboardResponse**](KoraLeaderboardResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | Invalid request 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) + +# **get_kora_rewards_summary** +> List[KoraRewardsSummary] get_kora_rewards_summary() + +Get Kora all-time rewards summary + +Returns the all-time rewards earned by users including Kora CC and points. + +### Example + +* Bearer (JWT) Authentication (bearerAuth): + +```python +import openapi_client +from openapi_client.models.kora_rewards_summary import KoraRewardsSummary +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" +) + +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure Bearer authorization (JWT): bearerAuth +configuration = openapi_client.Configuration( + access_token = os.environ["BEARER_TOKEN"] +) + +# 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.KoraApi(api_client) + + try: + # Get Kora all-time rewards summary + api_response = await api_instance.get_kora_rewards_summary() + print("The response of KoraApi->get_kora_rewards_summary:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->get_kora_rewards_summary: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**List[KoraRewardsSummary]**](KoraRewardsSummary.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | + +[[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) + +# **kora_health_check** +> KoraHealthCheck200Response kora_health_check() + +Kora service health check + +Returns the health status of the Kora rewards service. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response +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.KoraApi(api_client) + + try: + # Kora service health check + api_response = await api_instance.kora_health_check() + print("The response of KoraApi->kora_health_check:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling KoraApi->kora_health_check: %s\n" % e) +``` + + + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**KoraHealthCheck200Response**](KoraHealthCheck200Response.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Service is healthy | - | + +[[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) + diff --git a/python/sdk/src/openapi_client/docs/KoraCampaignBonus.md b/python/sdk/src/openapi_client/docs/KoraCampaignBonus.md new file mode 100644 index 00000000..17743c50 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraCampaignBonus.md @@ -0,0 +1,32 @@ +# KoraCampaignBonus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bonus_type** | **str** | Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) | [optional] +**bonus_cc_reward** | **str** | CC reward amount for this bonus | [optional] +**bonus_points** | **str** | Points earned for this bonus | [optional] +**bonus_criteria** | **str** | Criteria that was met for earning this bonus | [optional] + +## Example + +```python +from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraCampaignBonus from a JSON string +kora_campaign_bonus_instance = KoraCampaignBonus.from_json(json) +# print the JSON string representation of the object +print(KoraCampaignBonus.to_json()) + +# convert the object into a dict +kora_campaign_bonus_dict = kora_campaign_bonus_instance.to_dict() +# create an instance of KoraCampaignBonus from a dict +kora_campaign_bonus_from_dict = KoraCampaignBonus.from_dict(kora_campaign_bonus_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/KoraCampaignMetadata.md b/python/sdk/src/openapi_client/docs/KoraCampaignMetadata.md new file mode 100644 index 00000000..db7447c2 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraCampaignMetadata.md @@ -0,0 +1,33 @@ +# KoraCampaignMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**campaign_name** | **str** | Name of the campaign | +**parent_campaign_name** | **str** | Name of the parent campaign | [optional] +**start_date** | **int** | Time in milliseconds for campaign start date | +**end_date** | **int** | Time in milliseconds for campaign end date | + +## Example + +```python +from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraCampaignMetadata from a JSON string +kora_campaign_metadata_instance = KoraCampaignMetadata.from_json(json) +# print the JSON string representation of the object +print(KoraCampaignMetadata.to_json()) + +# convert the object into a dict +kora_campaign_metadata_dict = kora_campaign_metadata_instance.to_dict() +# create an instance of KoraCampaignMetadata from a dict +kora_campaign_metadata_from_dict = KoraCampaignMetadata.from_dict(kora_campaign_metadata_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/KoraCampaignRewards.md b/python/sdk/src/openapi_client/docs/KoraCampaignRewards.md new file mode 100644 index 00000000..eae223e3 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraCampaignRewards.md @@ -0,0 +1,47 @@ +# KoraCampaignRewards + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **str** | User address for the rewards earned data | +**campaign_name** | **str** | Name of the campaign | +**epoch_number** | **int** | Epoch number for the rewards earned data | +**interval_number** | **int** | Interval number for the rewards earned data | +**symbol** | **str** | Market Symbol | [optional] +**status** | **str** | | +**blue_rewards** | **str** | Total blue token rewards | [optional] +**sui_rewards** | **str** | Total sui token rewards | [optional] +**wal_rewards** | **str** | Total wal rewards | [optional] +**cash_rewards** | **str** | Total cash rewards | [optional] +**cc_rewards** | **str** | Total CC token rewards | [optional] +**kora_points** | **str** | Total Kora points earned | [optional] +**user_fee_paid** | **str** | Total user fee paid | [optional] +**interval_start_date** | **int** | Time in milliseconds for interval start date | [optional] +**interval_end_date** | **int** | Time in milliseconds for interval end date | [optional] +**is_disbursed** | **bool** | Indicates if rewards have been disbursed | [optional] +**txn_digest** | **str** | Transaction digest of the disbursement | [optional] +**claim_status** | **str** | Status of the claim | [optional] +**bonuses** | [**List[KoraCampaignBonus]**](KoraCampaignBonus.md) | List of bonuses attached to this reward entry | [optional] + +## Example + +```python +from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraCampaignRewards from a JSON string +kora_campaign_rewards_instance = KoraCampaignRewards.from_json(json) +# print the JSON string representation of the object +print(KoraCampaignRewards.to_json()) + +# convert the object into a dict +kora_campaign_rewards_dict = kora_campaign_rewards_instance.to_dict() +# create an instance of KoraCampaignRewards from a dict +kora_campaign_rewards_from_dict = KoraCampaignRewards.from_dict(kora_campaign_rewards_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/KoraEpochConfig.md b/python/sdk/src/openapi_client/docs/KoraEpochConfig.md new file mode 100644 index 00000000..df34d5ee --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraEpochConfig.md @@ -0,0 +1,38 @@ +# KoraEpochConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaign_name** | **str** | The name of the campaign | +**epoch_duration** | **int** | Duration of the epoch in hours | +**sui_rewards_allocation** | **str** | Allocation of Sui rewards for this epoch | [optional] +**blue_rewards_allocation** | **str** | Allocation of Blue rewards for this epoch | [optional] +**wal_rewards_allocation** | **str** | Allocation of Wal rewards for this epoch | [optional] +**cc_rewards_allocation** | **str** | Allocation of CC token rewards for this epoch | [optional] +**kora_points_rewards_allocation** | **str** | Allocation of Kora points rewards for this epoch | [optional] +**interval_number** | **int** | Interval number for the epoch | +**epoch_number** | **int** | Epoch number | +**config** | **Dict[str, object]** | Additional campaign-specific configurations | [optional] + +## Example + +```python +from openapi_client.models.kora_epoch_config import KoraEpochConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraEpochConfig from a JSON string +kora_epoch_config_instance = KoraEpochConfig.from_json(json) +# print the JSON string representation of the object +print(KoraEpochConfig.to_json()) + +# convert the object into a dict +kora_epoch_config_dict = kora_epoch_config_instance.to_dict() +# create an instance of KoraEpochConfig from a dict +kora_epoch_config_from_dict = KoraEpochConfig.from_dict(kora_epoch_config_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/KoraEpochConfigResponse.md b/python/sdk/src/openapi_client/docs/KoraEpochConfigResponse.md new file mode 100644 index 00000000..29188fc5 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraEpochConfigResponse.md @@ -0,0 +1,31 @@ +# KoraEpochConfigResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max_interval_number** | **int** | The maximum interval number available | +**interval_number** | **int** | The current interval number being queried | +**data** | [**List[KoraEpochConfig]**](KoraEpochConfig.md) | | + +## Example + +```python +from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraEpochConfigResponse from a JSON string +kora_epoch_config_response_instance = KoraEpochConfigResponse.from_json(json) +# print the JSON string representation of the object +print(KoraEpochConfigResponse.to_json()) + +# convert the object into a dict +kora_epoch_config_response_dict = kora_epoch_config_response_instance.to_dict() +# create an instance of KoraEpochConfigResponse from a dict +kora_epoch_config_response_from_dict = KoraEpochConfigResponse.from_dict(kora_epoch_config_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/KoraEpochMetadata.md b/python/sdk/src/openapi_client/docs/KoraEpochMetadata.md new file mode 100644 index 00000000..4901114b --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraEpochMetadata.md @@ -0,0 +1,34 @@ +# KoraEpochMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**campaign_name** | **str** | Name of the campaign | +**epoch_id** | **str** | Epoch ID | +**epoch_number** | **int** | Epoch number | +**start_date** | **int** | Time in milliseconds for epoch start date | +**end_date** | **int** | Time in milliseconds for epoch end date | + +## Example + +```python +from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraEpochMetadata from a JSON string +kora_epoch_metadata_instance = KoraEpochMetadata.from_json(json) +# print the JSON string representation of the object +print(KoraEpochMetadata.to_json()) + +# convert the object into a dict +kora_epoch_metadata_dict = kora_epoch_metadata_instance.to_dict() +# create an instance of KoraEpochMetadata from a dict +kora_epoch_metadata_from_dict = KoraEpochMetadata.from_dict(kora_epoch_metadata_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/KoraHealthCheck200Response.md b/python/sdk/src/openapi_client/docs/KoraHealthCheck200Response.md new file mode 100644 index 00000000..16ccd09b --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraHealthCheck200Response.md @@ -0,0 +1,30 @@ +# KoraHealthCheck200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | [optional] +**timestamp** | **int** | | [optional] + +## Example + +```python +from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraHealthCheck200Response from a JSON string +kora_health_check200_response_instance = KoraHealthCheck200Response.from_json(json) +# print the JSON string representation of the object +print(KoraHealthCheck200Response.to_json()) + +# convert the object into a dict +kora_health_check200_response_dict = kora_health_check200_response_instance.to_dict() +# create an instance of KoraHealthCheck200Response from a dict +kora_health_check200_response_from_dict = KoraHealthCheck200Response.from_dict(kora_health_check200_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/KoraIntervalMetadata.md b/python/sdk/src/openapi_client/docs/KoraIntervalMetadata.md new file mode 100644 index 00000000..946a4164 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraIntervalMetadata.md @@ -0,0 +1,34 @@ +# KoraIntervalMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **str** | | +**start_date** | **int** | Time in milliseconds for interval start date | +**end_date** | **int** | Time in milliseconds for interval end date | +**interval_id** | **int** | Interval ID | +**interval_type** | **str** | Type of the interval | [optional] +**protocol** | **str** | Protocol for the interval | [optional] + +## Example + +```python +from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraIntervalMetadata from a JSON string +kora_interval_metadata_instance = KoraIntervalMetadata.from_json(json) +# print the JSON string representation of the object +print(KoraIntervalMetadata.to_json()) + +# convert the object into a dict +kora_interval_metadata_dict = kora_interval_metadata_instance.to_dict() +# create an instance of KoraIntervalMetadata from a dict +kora_interval_metadata_from_dict = KoraIntervalMetadata.from_dict(kora_interval_metadata_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/KoraLeaderboardEntry.md b/python/sdk/src/openapi_client/docs/KoraLeaderboardEntry.md new file mode 100644 index 00000000..a7202dbe --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraLeaderboardEntry.md @@ -0,0 +1,41 @@ +# KoraLeaderboardEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rank** | **int** | Overall ranking position based on sortBy parameter | +**user_address** | **str** | Wallet address of the user | +**total_volume_e6** | **str** | Total swap volume (USD equivalent) | +**total_fee_e6** | **str** | Total fees paid | [optional] +**total_transactions** | **int** | Total number of qualifying swap transactions | +**cc_rewards** | **str** | CC token rewards earned | +**kora_points** | **str** | Kora points earned | +**total_bonus_points** | **str** | Total bonus points earned | [optional] +**total_bonus_cc** | **str** | Total bonus CC tokens earned | [optional] +**volume_rank** | **int** | Ranking based purely on trading volume | [optional] +**transaction_rank** | **int** | Ranking based purely on transaction count | [optional] +**total_earnings_rank** | **int** | Ranking based on combined CC + Kora points value | [optional] +**last_activity_date** | **int** | Timestamp of user's most recent swap (milliseconds) | [optional] + +## Example + +```python +from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraLeaderboardEntry from a JSON string +kora_leaderboard_entry_instance = KoraLeaderboardEntry.from_json(json) +# print the JSON string representation of the object +print(KoraLeaderboardEntry.to_json()) + +# convert the object into a dict +kora_leaderboard_entry_dict = kora_leaderboard_entry_instance.to_dict() +# create an instance of KoraLeaderboardEntry from a dict +kora_leaderboard_entry_from_dict = KoraLeaderboardEntry.from_dict(kora_leaderboard_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/docs/KoraLeaderboardResponse.md b/python/sdk/src/openapi_client/docs/KoraLeaderboardResponse.md new file mode 100644 index 00000000..ed902156 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraLeaderboardResponse.md @@ -0,0 +1,32 @@ +# KoraLeaderboardResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[KoraLeaderboardEntry]**](KoraLeaderboardEntry.md) | | +**total** | **int** | Total number of records | +**limit** | **int** | Page size for pagination | +**page** | **int** | Current page number | + +## Example + +```python +from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraLeaderboardResponse from a JSON string +kora_leaderboard_response_instance = KoraLeaderboardResponse.from_json(json) +# print the JSON string representation of the object +print(KoraLeaderboardResponse.to_json()) + +# convert the object into a dict +kora_leaderboard_response_dict = kora_leaderboard_response_instance.to_dict() +# create an instance of KoraLeaderboardResponse from a dict +kora_leaderboard_response_from_dict = KoraLeaderboardResponse.from_dict(kora_leaderboard_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/KoraRewardsSummary.md b/python/sdk/src/openapi_client/docs/KoraRewardsSummary.md new file mode 100644 index 00000000..5783f331 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraRewardsSummary.md @@ -0,0 +1,34 @@ +# KoraRewardsSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **str** | User address for the rewards earned data | +**blue_rewards** | **str** | Total Blue token rewards earned | [optional] +**sui_rewards** | **str** | Total Sui token rewards earned | [optional] +**wal_rewards** | **str** | Total wal rewards earned | [optional] +**cc_rewards** | **str** | Total CC token rewards earned across all Kora campaigns | [optional] +**kora_points** | **str** | Total Kora points earned across all Kora campaigns | [optional] + +## Example + +```python +from openapi_client.models.kora_rewards_summary import KoraRewardsSummary + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraRewardsSummary from a JSON string +kora_rewards_summary_instance = KoraRewardsSummary.from_json(json) +# print the JSON string representation of the object +print(KoraRewardsSummary.to_json()) + +# convert the object into a dict +kora_rewards_summary_dict = kora_rewards_summary_instance.to_dict() +# create an instance of KoraRewardsSummary from a dict +kora_rewards_summary_from_dict = KoraRewardsSummary.from_dict(kora_rewards_summary_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 22643993..c9fc0991 100644 --- a/python/sdk/src/openapi_client/models/__init__.py +++ b/python/sdk/src/openapi_client/models/__init__.py @@ -81,6 +81,17 @@ from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details from openapi_client.models.kline_interval import KlineInterval +from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus +from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata +from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards +from openapi_client.models.kora_epoch_config import KoraEpochConfig +from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse +from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata +from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response +from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata +from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry +from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse +from openapi_client.models.kora_rewards_summary import KoraRewardsSummary from openapi_client.models.leaderboard_entry import LeaderboardEntry from openapi_client.models.leaderboard_interval import LeaderboardInterval from openapi_client.models.leaderboard_response import LeaderboardResponse diff --git a/python/sdk/src/openapi_client/models/kora_campaign_bonus.py b/python/sdk/src/openapi_client/models/kora_campaign_bonus.py new file mode 100644 index 00000000..4a81a7f8 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_campaign_bonus.py @@ -0,0 +1,93 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraCampaignBonus(BaseModel): + """ + KoraCampaignBonus + """ # noqa: E501 + bonus_type: Optional[StrictStr] = Field(default=None, description="Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS)", alias="bonusType") + bonus_cc_reward: Optional[StrictStr] = Field(default=None, description="CC reward amount for this bonus", alias="bonusCcReward") + bonus_points: Optional[StrictStr] = Field(default=None, description="Points earned for this bonus", alias="bonusPoints") + bonus_criteria: Optional[StrictStr] = Field(default=None, description="Criteria that was met for earning this bonus", alias="bonusCriteria") + __properties: ClassVar[List[str]] = ["bonusType", "bonusCcReward", "bonusPoints", "bonusCriteria"] + + 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 KoraCampaignBonus 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 KoraCampaignBonus from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "bonusType": obj.get("bonusType"), + "bonusCcReward": obj.get("bonusCcReward"), + "bonusPoints": obj.get("bonusPoints"), + "bonusCriteria": obj.get("bonusCriteria") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_campaign_metadata.py b/python/sdk/src/openapi_client/models/kora_campaign_metadata.py new file mode 100644 index 00000000..8f1d6567 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_campaign_metadata.py @@ -0,0 +1,102 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraCampaignMetadata(BaseModel): + """ + KoraCampaignMetadata + """ # noqa: E501 + status: StrictStr + campaign_name: StrictStr = Field(description="Name of the campaign", alias="campaignName") + parent_campaign_name: Optional[StrictStr] = Field(default=None, description="Name of the parent campaign", alias="parentCampaignName") + start_date: StrictInt = Field(description="Time in milliseconds for campaign start date", alias="startDate") + end_date: StrictInt = Field(description="Time in milliseconds for campaign end date", alias="endDate") + __properties: ClassVar[List[str]] = ["status", "campaignName", "parentCampaignName", "startDate", "endDate"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACTIVE', 'INACTIVE']): + raise ValueError("must be one of enum values ('ACTIVE', 'INACTIVE')") + return value + + 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 KoraCampaignMetadata 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 KoraCampaignMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "campaignName": obj.get("campaignName"), + "parentCampaignName": obj.get("parentCampaignName"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_campaign_rewards.py b/python/sdk/src/openapi_client/models/kora_campaign_rewards.py new file mode 100644 index 00000000..0d8eaa73 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_campaign_rewards.py @@ -0,0 +1,148 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus +from typing import Optional, Set +from typing_extensions import Self + +class KoraCampaignRewards(BaseModel): + """ + KoraCampaignRewards + """ # noqa: E501 + user_address: StrictStr = Field(description="User address for the rewards earned data", alias="userAddress") + campaign_name: StrictStr = Field(description="Name of the campaign", alias="campaignName") + epoch_number: StrictInt = Field(description="Epoch number for the rewards earned data", alias="epochNumber") + interval_number: StrictInt = Field(description="Interval number for the rewards earned data", alias="intervalNumber") + symbol: Optional[StrictStr] = Field(default=None, description="Market Symbol") + status: StrictStr + blue_rewards: Optional[StrictStr] = Field(default=None, description="Total blue token rewards", alias="blueRewards") + sui_rewards: Optional[StrictStr] = Field(default=None, description="Total sui token rewards", alias="suiRewards") + wal_rewards: Optional[StrictStr] = Field(default=None, description="Total wal rewards", alias="walRewards") + cash_rewards: Optional[StrictStr] = Field(default=None, description="Total cash rewards", alias="cashRewards") + cc_rewards: Optional[StrictStr] = Field(default=None, description="Total CC token rewards", alias="ccRewards") + kora_points: Optional[StrictStr] = Field(default=None, description="Total Kora points earned", alias="koraPoints") + user_fee_paid: Optional[StrictStr] = Field(default=None, description="Total user fee paid", alias="userFeePaid") + interval_start_date: Optional[StrictInt] = Field(default=None, description="Time in milliseconds for interval start date", alias="intervalStartDate") + interval_end_date: Optional[StrictInt] = Field(default=None, description="Time in milliseconds for interval end date", alias="intervalEndDate") + is_disbursed: Optional[StrictBool] = Field(default=None, description="Indicates if rewards have been disbursed", alias="isDisbursed") + txn_digest: Optional[StrictStr] = Field(default=None, description="Transaction digest of the disbursement", alias="txnDigest") + claim_status: Optional[StrictStr] = Field(default=None, description="Status of the claim", alias="claimStatus") + bonuses: Optional[List[KoraCampaignBonus]] = Field(default=None, description="List of bonuses attached to this reward entry") + __properties: ClassVar[List[str]] = ["userAddress", "campaignName", "epochNumber", "intervalNumber", "symbol", "status", "blueRewards", "suiRewards", "walRewards", "cashRewards", "ccRewards", "koraPoints", "userFeePaid", "intervalStartDate", "intervalEndDate", "isDisbursed", "txnDigest", "claimStatus", "bonuses"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN']): + raise ValueError("must be one of enum values ('ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN')") + return value + + @field_validator('claim_status') + def claim_status_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['CLAIMABLE', 'CLAIMED', 'NOT_YET_CLAIMABLE', 'CLAIM_ENDED']): + raise ValueError("must be one of enum values ('CLAIMABLE', 'CLAIMED', 'NOT_YET_CLAIMABLE', 'CLAIM_ENDED')") + return value + + 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 KoraCampaignRewards 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 bonuses (list) + _items = [] + if self.bonuses: + for _item_bonuses in self.bonuses: + if _item_bonuses: + _items.append(_item_bonuses.to_dict()) + _dict['bonuses'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of KoraCampaignRewards 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"), + "campaignName": obj.get("campaignName"), + "epochNumber": obj.get("epochNumber"), + "intervalNumber": obj.get("intervalNumber"), + "symbol": obj.get("symbol"), + "status": obj.get("status"), + "blueRewards": obj.get("blueRewards"), + "suiRewards": obj.get("suiRewards"), + "walRewards": obj.get("walRewards"), + "cashRewards": obj.get("cashRewards"), + "ccRewards": obj.get("ccRewards"), + "koraPoints": obj.get("koraPoints"), + "userFeePaid": obj.get("userFeePaid"), + "intervalStartDate": obj.get("intervalStartDate"), + "intervalEndDate": obj.get("intervalEndDate"), + "isDisbursed": obj.get("isDisbursed"), + "txnDigest": obj.get("txnDigest"), + "claimStatus": obj.get("claimStatus"), + "bonuses": [KoraCampaignBonus.from_dict(_item) for _item in obj["bonuses"]] if obj.get("bonuses") is not None else None + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_epoch_config.py b/python/sdk/src/openapi_client/models/kora_epoch_config.py new file mode 100644 index 00000000..3db9f2f8 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_epoch_config.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraEpochConfig(BaseModel): + """ + KoraEpochConfig + """ # noqa: E501 + campaign_name: StrictStr = Field(description="The name of the campaign", alias="campaignName") + epoch_duration: StrictInt = Field(description="Duration of the epoch in hours", alias="epochDuration") + sui_rewards_allocation: Optional[StrictStr] = Field(default=None, description="Allocation of Sui rewards for this epoch", alias="suiRewardsAllocation") + blue_rewards_allocation: Optional[StrictStr] = Field(default=None, description="Allocation of Blue rewards for this epoch", alias="blueRewardsAllocation") + wal_rewards_allocation: Optional[StrictStr] = Field(default=None, description="Allocation of Wal rewards for this epoch", alias="walRewardsAllocation") + cc_rewards_allocation: Optional[StrictStr] = Field(default=None, description="Allocation of CC token rewards for this epoch", alias="ccRewardsAllocation") + kora_points_rewards_allocation: Optional[StrictStr] = Field(default=None, description="Allocation of Kora points rewards for this epoch", alias="koraPointsRewardsAllocation") + interval_number: StrictInt = Field(description="Interval number for the epoch", alias="intervalNumber") + epoch_number: StrictInt = Field(description="Epoch number", alias="epochNumber") + config: Optional[Dict[str, Any]] = Field(default=None, description="Additional campaign-specific configurations") + __properties: ClassVar[List[str]] = ["campaignName", "epochDuration", "suiRewardsAllocation", "blueRewardsAllocation", "walRewardsAllocation", "ccRewardsAllocation", "koraPointsRewardsAllocation", "intervalNumber", "epochNumber", "config"] + + 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 KoraEpochConfig 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 KoraEpochConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "campaignName": obj.get("campaignName"), + "epochDuration": obj.get("epochDuration"), + "suiRewardsAllocation": obj.get("suiRewardsAllocation"), + "blueRewardsAllocation": obj.get("blueRewardsAllocation"), + "walRewardsAllocation": obj.get("walRewardsAllocation"), + "ccRewardsAllocation": obj.get("ccRewardsAllocation"), + "koraPointsRewardsAllocation": obj.get("koraPointsRewardsAllocation"), + "intervalNumber": obj.get("intervalNumber"), + "epochNumber": obj.get("epochNumber"), + "config": obj.get("config") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_epoch_config_response.py b/python/sdk/src/openapi_client/models/kora_epoch_config_response.py new file mode 100644 index 00000000..33bfa200 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_epoch_config_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, StrictInt +from typing import Any, ClassVar, Dict, List +from openapi_client.models.kora_epoch_config import KoraEpochConfig +from typing import Optional, Set +from typing_extensions import Self + +class KoraEpochConfigResponse(BaseModel): + """ + KoraEpochConfigResponse + """ # noqa: E501 + max_interval_number: StrictInt = Field(description="The maximum interval number available", alias="maxIntervalNumber") + interval_number: StrictInt = Field(description="The current interval number being queried", alias="intervalNumber") + data: List[KoraEpochConfig] + __properties: ClassVar[List[str]] = ["maxIntervalNumber", "intervalNumber", "data"] + + 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 KoraEpochConfigResponse 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 KoraEpochConfigResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "maxIntervalNumber": obj.get("maxIntervalNumber"), + "intervalNumber": obj.get("intervalNumber"), + "data": [KoraEpochConfig.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_epoch_metadata.py b/python/sdk/src/openapi_client/models/kora_epoch_metadata.py new file mode 100644 index 00000000..bcae4f5b --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_epoch_metadata.py @@ -0,0 +1,104 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class KoraEpochMetadata(BaseModel): + """ + KoraEpochMetadata + """ # noqa: E501 + status: StrictStr + campaign_name: StrictStr = Field(description="Name of the campaign", alias="campaignName") + epoch_id: StrictStr = Field(description="Epoch ID", alias="epochId") + epoch_number: StrictInt = Field(description="Epoch number", alias="epochNumber") + start_date: StrictInt = Field(description="Time in milliseconds for epoch start date", alias="startDate") + end_date: StrictInt = Field(description="Time in milliseconds for epoch end date", alias="endDate") + __properties: ClassVar[List[str]] = ["status", "campaignName", "epochId", "epochNumber", "startDate", "endDate"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN']): + raise ValueError("must be one of enum values ('ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN')") + return value + + 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 KoraEpochMetadata 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 KoraEpochMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "campaignName": obj.get("campaignName"), + "epochId": obj.get("epochId"), + "epochNumber": obj.get("epochNumber"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_health_check200_response.py b/python/sdk/src/openapi_client/models/kora_health_check200_response.py new file mode 100644 index 00000000..ec2ee268 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_health_check200_response.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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraHealthCheck200Response(BaseModel): + """ + KoraHealthCheck200Response + """ # noqa: E501 + status: Optional[StrictStr] = None + timestamp: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["status", "timestamp"] + + 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 KoraHealthCheck200Response 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 KoraHealthCheck200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "timestamp": obj.get("timestamp") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_interval_metadata.py b/python/sdk/src/openapi_client/models/kora_interval_metadata.py new file mode 100644 index 00000000..7baaa241 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_interval_metadata.py @@ -0,0 +1,114 @@ +# 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, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraIntervalMetadata(BaseModel): + """ + KoraIntervalMetadata + """ # noqa: E501 + status: StrictStr + start_date: StrictInt = Field(description="Time in milliseconds for interval start date", alias="startDate") + end_date: StrictInt = Field(description="Time in milliseconds for interval end date", alias="endDate") + interval_id: StrictInt = Field(description="Interval ID", alias="intervalId") + interval_type: Optional[StrictStr] = Field(default=None, description="Type of the interval", alias="intervalType") + protocol: Optional[StrictStr] = Field(default=None, description="Protocol for the interval") + __properties: ClassVar[List[str]] = ["status", "startDate", "endDate", "intervalId", "intervalType", "protocol"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN']): + raise ValueError("must be one of enum values ('ACTIVE', 'NOT_STARTED', 'FINALIZED', 'COOLDOWN')") + return value + + @field_validator('protocol') + def protocol_validate_enum(cls, value): + """Validates the enum""" + if value is None: + return value + + if value not in set(['bluefin', 'kora']): + raise ValueError("must be one of enum values ('bluefin', 'kora')") + return value + + 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 KoraIntervalMetadata 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 KoraIntervalMetadata from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "status": obj.get("status"), + "startDate": obj.get("startDate"), + "endDate": obj.get("endDate"), + "intervalId": obj.get("intervalId"), + "intervalType": obj.get("intervalType"), + "protocol": obj.get("protocol") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_leaderboard_entry.py b/python/sdk/src/openapi_client/models/kora_leaderboard_entry.py new file mode 100644 index 00000000..0c4ae7da --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_leaderboard_entry.py @@ -0,0 +1,111 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraLeaderboardEntry(BaseModel): + """ + KoraLeaderboardEntry + """ # noqa: E501 + rank: StrictInt = Field(description="Overall ranking position based on sortBy parameter") + user_address: StrictStr = Field(description="Wallet address of the user", alias="userAddress") + total_volume_e6: StrictStr = Field(description="Total swap volume (USD equivalent)", alias="totalVolumeE6") + total_fee_e6: Optional[StrictStr] = Field(default=None, description="Total fees paid", alias="totalFeeE6") + total_transactions: StrictInt = Field(description="Total number of qualifying swap transactions", alias="totalTransactions") + cc_rewards: StrictStr = Field(description="CC token rewards earned", alias="ccRewards") + kora_points: StrictStr = Field(description="Kora points earned", alias="koraPoints") + total_bonus_points: Optional[StrictStr] = Field(default=None, description="Total bonus points earned", alias="totalBonusPoints") + total_bonus_cc: Optional[StrictStr] = Field(default=None, description="Total bonus CC tokens earned", alias="totalBonusCC") + volume_rank: Optional[StrictInt] = Field(default=None, description="Ranking based purely on trading volume", alias="volumeRank") + transaction_rank: Optional[StrictInt] = Field(default=None, description="Ranking based purely on transaction count", alias="transactionRank") + total_earnings_rank: Optional[StrictInt] = Field(default=None, description="Ranking based on combined CC + Kora points value", alias="totalEarningsRank") + last_activity_date: Optional[StrictInt] = Field(default=None, description="Timestamp of user's most recent swap (milliseconds)", alias="lastActivityDate") + __properties: ClassVar[List[str]] = ["rank", "userAddress", "totalVolumeE6", "totalFeeE6", "totalTransactions", "ccRewards", "koraPoints", "totalBonusPoints", "totalBonusCC", "volumeRank", "transactionRank", "totalEarningsRank", "lastActivityDate"] + + 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 KoraLeaderboardEntry 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 KoraLeaderboardEntry from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "rank": obj.get("rank"), + "userAddress": obj.get("userAddress"), + "totalVolumeE6": obj.get("totalVolumeE6"), + "totalFeeE6": obj.get("totalFeeE6"), + "totalTransactions": obj.get("totalTransactions"), + "ccRewards": obj.get("ccRewards"), + "koraPoints": obj.get("koraPoints"), + "totalBonusPoints": obj.get("totalBonusPoints"), + "totalBonusCC": obj.get("totalBonusCC"), + "volumeRank": obj.get("volumeRank"), + "transactionRank": obj.get("transactionRank"), + "totalEarningsRank": obj.get("totalEarningsRank"), + "lastActivityDate": obj.get("lastActivityDate") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_leaderboard_response.py b/python/sdk/src/openapi_client/models/kora_leaderboard_response.py new file mode 100644 index 00000000..2d79ff1c --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_leaderboard_response.py @@ -0,0 +1,101 @@ +# 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, StrictInt +from typing import Any, ClassVar, Dict, List +from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry +from typing import Optional, Set +from typing_extensions import Self + +class KoraLeaderboardResponse(BaseModel): + """ + KoraLeaderboardResponse + """ # noqa: E501 + data: List[KoraLeaderboardEntry] + total: StrictInt = Field(description="Total number of records") + limit: StrictInt = Field(description="Page size for pagination") + page: StrictInt = Field(description="Current page number") + __properties: ClassVar[List[str]] = ["data", "total", "limit", "page"] + + 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 KoraLeaderboardResponse 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 KoraLeaderboardResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [KoraLeaderboardEntry.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "total": obj.get("total"), + "limit": obj.get("limit"), + "page": obj.get("page") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_rewards_summary.py b/python/sdk/src/openapi_client/models/kora_rewards_summary.py new file mode 100644 index 00000000..8df573c1 --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_rewards_summary.py @@ -0,0 +1,97 @@ +# 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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraRewardsSummary(BaseModel): + """ + KoraRewardsSummary + """ # noqa: E501 + user_address: StrictStr = Field(description="User address for the rewards earned data", alias="userAddress") + blue_rewards: Optional[StrictStr] = Field(default=None, description="Total Blue token rewards earned", alias="blueRewards") + sui_rewards: Optional[StrictStr] = Field(default=None, description="Total Sui token rewards earned", alias="suiRewards") + wal_rewards: Optional[StrictStr] = Field(default=None, description="Total wal rewards earned", alias="walRewards") + cc_rewards: Optional[StrictStr] = Field(default=None, description="Total CC token rewards earned across all Kora campaigns", alias="ccRewards") + kora_points: Optional[StrictStr] = Field(default=None, description="Total Kora points earned across all Kora campaigns", alias="koraPoints") + __properties: ClassVar[List[str]] = ["userAddress", "blueRewards", "suiRewards", "walRewards", "ccRewards", "koraPoints"] + + 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 KoraRewardsSummary 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 KoraRewardsSummary 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"), + "blueRewards": obj.get("blueRewards"), + "suiRewards": obj.get("suiRewards"), + "walRewards": obj.get("walRewards"), + "ccRewards": obj.get("ccRewards"), + "koraPoints": obj.get("koraPoints") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/test/test_kora_api.py b/python/sdk/src/openapi_client/test/test_kora_api.py new file mode 100644 index 00000000..2418f9d4 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_api.py @@ -0,0 +1,87 @@ +# 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.api.kora_api import KoraApi + + +class TestKoraApi(unittest.IsolatedAsyncioTestCase): + """KoraApi unit test stubs""" + + async def asyncSetUp(self) -> None: + self.api = KoraApi() + + async def asyncTearDown(self) -> None: + await self.api.api_client.close() + + async def test_get_kora_campaign_metadata(self) -> None: + """Test case for get_kora_campaign_metadata + + Get Kora campaign metadata + """ + pass + + async def test_get_kora_campaign_rewards(self) -> None: + """Test case for get_kora_campaign_rewards + + Get Kora campaign rewards + """ + pass + + async def test_get_kora_epoch_config_metadata(self) -> None: + """Test case for get_kora_epoch_config_metadata + + Get Kora epoch configuration + """ + pass + + async def test_get_kora_epoch_metadata(self) -> None: + """Test case for get_kora_epoch_metadata + + Get Kora epoch metadata + """ + pass + + async def test_get_kora_interval_metadata(self) -> None: + """Test case for get_kora_interval_metadata + + Get Kora interval metadata + """ + pass + + async def test_get_kora_leaderboard(self) -> None: + """Test case for get_kora_leaderboard + + Get Kora swap leaderboard + """ + pass + + async def test_get_kora_rewards_summary(self) -> None: + """Test case for get_kora_rewards_summary + + Get Kora all-time rewards summary + """ + pass + + async def test_kora_health_check(self) -> None: + """Test case for kora_health_check + + Kora service health check + """ + pass + + +if __name__ == '__main__': + unittest.main() diff --git a/python/sdk/src/openapi_client/test/test_kora_campaign_bonus.py b/python/sdk/src/openapi_client/test/test_kora_campaign_bonus.py new file mode 100644 index 00000000..f63f1f09 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_campaign_bonus.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.kora_campaign_bonus import KoraCampaignBonus + +class TestKoraCampaignBonus(unittest.TestCase): + """KoraCampaignBonus unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraCampaignBonus: + """Test KoraCampaignBonus + 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 `KoraCampaignBonus` + """ + model = KoraCampaignBonus() + if include_optional: + return KoraCampaignBonus( + bonus_type = 'VOLUME_BONUS', + bonus_cc_reward = '500.5', + bonus_points = '1000.75', + bonus_criteria = 'volume_threshold_100k' + ) + else: + return KoraCampaignBonus( + ) + """ + + def testKoraCampaignBonus(self): + """Test KoraCampaignBonus""" + # 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_kora_campaign_metadata.py b/python/sdk/src/openapi_client/test/test_kora_campaign_metadata.py new file mode 100644 index 00000000..057fb12c --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_campaign_metadata.py @@ -0,0 +1,59 @@ +# 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.kora_campaign_metadata import KoraCampaignMetadata + +class TestKoraCampaignMetadata(unittest.TestCase): + """KoraCampaignMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraCampaignMetadata: + """Test KoraCampaignMetadata + 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 `KoraCampaignMetadata` + """ + model = KoraCampaignMetadata() + if include_optional: + return KoraCampaignMetadata( + status = 'ACTIVE', + campaign_name = 'KORA_SWAPS', + parent_campaign_name = '', + start_date = 1724121094751, + end_date = 1724121094751 + ) + else: + return KoraCampaignMetadata( + status = 'ACTIVE', + campaign_name = 'KORA_SWAPS', + start_date = 1724121094751, + end_date = 1724121094751, + ) + """ + + def testKoraCampaignMetadata(self): + """Test KoraCampaignMetadata""" + # 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_kora_campaign_rewards.py b/python/sdk/src/openapi_client/test/test_kora_campaign_rewards.py new file mode 100644 index 00000000..a2540685 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_campaign_rewards.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.kora_campaign_rewards import KoraCampaignRewards + +class TestKoraCampaignRewards(unittest.TestCase): + """KoraCampaignRewards unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraCampaignRewards: + """Test KoraCampaignRewards + 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 `KoraCampaignRewards` + """ + model = KoraCampaignRewards() + if include_optional: + return KoraCampaignRewards( + user_address = '0x1234567890abcdef', + campaign_name = 'KORA_SWAPS', + epoch_number = 7, + interval_number = 7, + symbol = 'KORA-SWAPS', + status = 'ACTIVE', + blue_rewards = '100.5', + sui_rewards = '200.25', + wal_rewards = '50.75', + cash_rewards = '0', + cc_rewards = '1500.75', + kora_points = '2500.5', + user_fee_paid = '15.25', + interval_start_date = 1724121094751, + interval_end_date = 1724725894751, + is_disbursed = True, + txn_digest = '8Fs9Q4ljB0cc0NhcqSVZRgTxe9KwZeRqjGYYYe4jXgXL', + claim_status = 'CLAIMED', + bonuses = [ + openapi_client.models.kora_campaign_bonus.KoraCampaignBonus( + bonus_type = 'VOLUME_BONUS', + bonus_cc_reward = '500.5', + bonus_points = '1000.75', + bonus_criteria = 'volume_threshold_100k', ) + ] + ) + else: + return KoraCampaignRewards( + user_address = '0x1234567890abcdef', + campaign_name = 'KORA_SWAPS', + epoch_number = 7, + interval_number = 7, + status = 'ACTIVE', + ) + """ + + def testKoraCampaignRewards(self): + """Test KoraCampaignRewards""" + # 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_kora_epoch_config.py b/python/sdk/src/openapi_client/test/test_kora_epoch_config.py new file mode 100644 index 00000000..00e77b97 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_epoch_config.py @@ -0,0 +1,64 @@ +# 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.kora_epoch_config import KoraEpochConfig + +class TestKoraEpochConfig(unittest.TestCase): + """KoraEpochConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraEpochConfig: + """Test KoraEpochConfig + 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 `KoraEpochConfig` + """ + model = KoraEpochConfig() + if include_optional: + return KoraEpochConfig( + campaign_name = 'KORA_SWAPS', + epoch_duration = 168, + sui_rewards_allocation = '1000.5', + blue_rewards_allocation = '2000.25', + wal_rewards_allocation = '500.75', + cc_rewards_allocation = '5000.5', + kora_points_rewards_allocation = '10000.25', + interval_number = 7, + epoch_number = 7, + config = { } + ) + else: + return KoraEpochConfig( + campaign_name = 'KORA_SWAPS', + epoch_duration = 168, + interval_number = 7, + epoch_number = 7, + ) + """ + + def testKoraEpochConfig(self): + """Test KoraEpochConfig""" + # 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_kora_epoch_config_response.py b/python/sdk/src/openapi_client/test/test_kora_epoch_config_response.py new file mode 100644 index 00000000..81d5513e --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_epoch_config_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.kora_epoch_config_response import KoraEpochConfigResponse + +class TestKoraEpochConfigResponse(unittest.TestCase): + """KoraEpochConfigResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraEpochConfigResponse: + """Test KoraEpochConfigResponse + 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 `KoraEpochConfigResponse` + """ + model = KoraEpochConfigResponse() + if include_optional: + return KoraEpochConfigResponse( + max_interval_number = 14, + interval_number = 7, + data = [ + openapi_client.models.kora_epoch_config.KoraEpochConfig( + campaign_name = 'KORA_SWAPS', + epoch_duration = 168, + sui_rewards_allocation = '1000.5', + blue_rewards_allocation = '2000.25', + wal_rewards_allocation = '500.75', + cc_rewards_allocation = '5000.5', + kora_points_rewards_allocation = '10000.25', + interval_number = 7, + epoch_number = 7, + config = { }, ) + ] + ) + else: + return KoraEpochConfigResponse( + max_interval_number = 14, + interval_number = 7, + data = [ + openapi_client.models.kora_epoch_config.KoraEpochConfig( + campaign_name = 'KORA_SWAPS', + epoch_duration = 168, + sui_rewards_allocation = '1000.5', + blue_rewards_allocation = '2000.25', + wal_rewards_allocation = '500.75', + cc_rewards_allocation = '5000.5', + kora_points_rewards_allocation = '10000.25', + interval_number = 7, + epoch_number = 7, + config = { }, ) + ], + ) + """ + + def testKoraEpochConfigResponse(self): + """Test KoraEpochConfigResponse""" + # 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_kora_epoch_metadata.py b/python/sdk/src/openapi_client/test/test_kora_epoch_metadata.py new file mode 100644 index 00000000..3249757d --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_epoch_metadata.py @@ -0,0 +1,62 @@ +# 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.kora_epoch_metadata import KoraEpochMetadata + +class TestKoraEpochMetadata(unittest.TestCase): + """KoraEpochMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraEpochMetadata: + """Test KoraEpochMetadata + 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 `KoraEpochMetadata` + """ + model = KoraEpochMetadata() + if include_optional: + return KoraEpochMetadata( + status = 'ACTIVE', + campaign_name = 'KORA_SWAPS', + epoch_id = '550e8400-e29b-41d4-a716-446655440000', + epoch_number = 7, + start_date = 1724121094751, + end_date = 1724725894751 + ) + else: + return KoraEpochMetadata( + status = 'ACTIVE', + campaign_name = 'KORA_SWAPS', + epoch_id = '550e8400-e29b-41d4-a716-446655440000', + epoch_number = 7, + start_date = 1724121094751, + end_date = 1724725894751, + ) + """ + + def testKoraEpochMetadata(self): + """Test KoraEpochMetadata""" + # 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_kora_health_check200_response.py b/python/sdk/src/openapi_client/test/test_kora_health_check200_response.py new file mode 100644 index 00000000..61ec433a --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_health_check200_response.py @@ -0,0 +1,52 @@ +# 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.kora_health_check200_response import KoraHealthCheck200Response + +class TestKoraHealthCheck200Response(unittest.TestCase): + """KoraHealthCheck200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraHealthCheck200Response: + """Test KoraHealthCheck200Response + 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 `KoraHealthCheck200Response` + """ + model = KoraHealthCheck200Response() + if include_optional: + return KoraHealthCheck200Response( + status = 'ok', + timestamp = 1724725894751 + ) + else: + return KoraHealthCheck200Response( + ) + """ + + def testKoraHealthCheck200Response(self): + """Test KoraHealthCheck200Response""" + # 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_kora_interval_metadata.py b/python/sdk/src/openapi_client/test/test_kora_interval_metadata.py new file mode 100644 index 00000000..dd913da0 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_interval_metadata.py @@ -0,0 +1,60 @@ +# 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.kora_interval_metadata import KoraIntervalMetadata + +class TestKoraIntervalMetadata(unittest.TestCase): + """KoraIntervalMetadata unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraIntervalMetadata: + """Test KoraIntervalMetadata + 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 `KoraIntervalMetadata` + """ + model = KoraIntervalMetadata() + if include_optional: + return KoraIntervalMetadata( + status = 'ACTIVE', + start_date = 1724121094751, + end_date = 1724725894751, + interval_id = 7, + interval_type = 'WEEK', + protocol = 'kora' + ) + else: + return KoraIntervalMetadata( + status = 'ACTIVE', + start_date = 1724121094751, + end_date = 1724725894751, + interval_id = 7, + ) + """ + + def testKoraIntervalMetadata(self): + """Test KoraIntervalMetadata""" + # 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_kora_leaderboard_entry.py b/python/sdk/src/openapi_client/test/test_kora_leaderboard_entry.py new file mode 100644 index 00000000..f188f43c --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_leaderboard_entry.py @@ -0,0 +1,69 @@ +# 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.kora_leaderboard_entry import KoraLeaderboardEntry + +class TestKoraLeaderboardEntry(unittest.TestCase): + """KoraLeaderboardEntry unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraLeaderboardEntry: + """Test KoraLeaderboardEntry + 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 `KoraLeaderboardEntry` + """ + model = KoraLeaderboardEntry() + if include_optional: + return KoraLeaderboardEntry( + rank = 1, + user_address = '0x1234567890abcdef', + total_volume_e6 = '50000.123456', + total_fee_e6 = '150.75', + total_transactions = 1250, + cc_rewards = '1500.75', + kora_points = '2500.5', + total_bonus_points = '500.25', + total_bonus_cc = '200.5', + volume_rank = 1, + transaction_rank = 3, + total_earnings_rank = 1, + last_activity_date = 1724725894751 + ) + else: + return KoraLeaderboardEntry( + rank = 1, + user_address = '0x1234567890abcdef', + total_volume_e6 = '50000.123456', + total_transactions = 1250, + cc_rewards = '1500.75', + kora_points = '2500.5', + ) + """ + + def testKoraLeaderboardEntry(self): + """Test KoraLeaderboardEntry""" + # 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_kora_leaderboard_response.py b/python/sdk/src/openapi_client/test/test_kora_leaderboard_response.py new file mode 100644 index 00000000..075240e9 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_leaderboard_response.py @@ -0,0 +1,88 @@ +# 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.kora_leaderboard_response import KoraLeaderboardResponse + +class TestKoraLeaderboardResponse(unittest.TestCase): + """KoraLeaderboardResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraLeaderboardResponse: + """Test KoraLeaderboardResponse + 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 `KoraLeaderboardResponse` + """ + model = KoraLeaderboardResponse() + if include_optional: + return KoraLeaderboardResponse( + data = [ + openapi_client.models.kora_leaderboard_entry.KoraLeaderboardEntry( + rank = 1, + user_address = '0x1234567890abcdef', + total_volume_e6 = '50000.123456', + total_fee_e6 = '150.75', + total_transactions = 1250, + cc_rewards = '1500.75', + kora_points = '2500.5', + total_bonus_points = '500.25', + total_bonus_cc = '200.5', + volume_rank = 1, + transaction_rank = 3, + total_earnings_rank = 1, + last_activity_date = 1724725894751, ) + ], + total = 2847, + limit = 500, + page = 1 + ) + else: + return KoraLeaderboardResponse( + data = [ + openapi_client.models.kora_leaderboard_entry.KoraLeaderboardEntry( + rank = 1, + user_address = '0x1234567890abcdef', + total_volume_e6 = '50000.123456', + total_fee_e6 = '150.75', + total_transactions = 1250, + cc_rewards = '1500.75', + kora_points = '2500.5', + total_bonus_points = '500.25', + total_bonus_cc = '200.5', + volume_rank = 1, + transaction_rank = 3, + total_earnings_rank = 1, + last_activity_date = 1724725894751, ) + ], + total = 2847, + limit = 500, + page = 1, + ) + """ + + def testKoraLeaderboardResponse(self): + """Test KoraLeaderboardResponse""" + # 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_kora_rewards_summary.py b/python/sdk/src/openapi_client/test/test_kora_rewards_summary.py new file mode 100644 index 00000000..3479c38b --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_rewards_summary.py @@ -0,0 +1,57 @@ +# 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.kora_rewards_summary import KoraRewardsSummary + +class TestKoraRewardsSummary(unittest.TestCase): + """KoraRewardsSummary unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraRewardsSummary: + """Test KoraRewardsSummary + 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 `KoraRewardsSummary` + """ + model = KoraRewardsSummary() + if include_optional: + return KoraRewardsSummary( + user_address = '0x1234567890abcdef', + blue_rewards = '100.5', + sui_rewards = '200.25', + wal_rewards = '50.75', + cc_rewards = '1500.75', + kora_points = '2500.5' + ) + else: + return KoraRewardsSummary( + user_address = '0x1234567890abcdef', + ) + """ + + def testKoraRewardsSummary(self): + """Test KoraRewardsSummary""" + # 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 b1710b98..4c356650 100644 --- a/python/sdk/src/openapi_client_README.md +++ b/python/sdk/src/openapi_client_README.md @@ -92,6 +92,14 @@ Class | Method | HTTP request | Description *ExchangeApi* | [**get_market_ticker**](openapi_client/docs/ExchangeApi.md#get_market_ticker) | **GET** /v1/exchange/ticker | /exchange/ticker *ExchangeApi* | [**get_orderbook_depth**](openapi_client/docs/ExchangeApi.md#get_orderbook_depth) | **GET** /v1/exchange/depth | /exchange/depth *ExchangeApi* | [**get_recent_trades**](openapi_client/docs/ExchangeApi.md#get_recent_trades) | **GET** /v1/exchange/trades | /exchange/trades +*KoraApi* | [**get_kora_campaign_metadata**](openapi_client/docs/KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata +*KoraApi* | [**get_kora_campaign_rewards**](openapi_client/docs/KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards +*KoraApi* | [**get_kora_epoch_config_metadata**](openapi_client/docs/KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration +*KoraApi* | [**get_kora_epoch_metadata**](openapi_client/docs/KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata +*KoraApi* | [**get_kora_interval_metadata**](openapi_client/docs/KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata +*KoraApi* | [**get_kora_leaderboard**](openapi_client/docs/KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard +*KoraApi* | [**get_kora_rewards_summary**](openapi_client/docs/KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary +*KoraApi* | [**kora_health_check**](openapi_client/docs/KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check *RewardsApi* | [**get_affiliate_interval_overview**](openapi_client/docs/RewardsApi.md#get_affiliate_interval_overview) | **GET** /v1/rewards/affiliate/intervalOverview | /rewards/affiliate/intervalOverview *RewardsApi* | [**get_affiliate_leader_dashboard**](openapi_client/docs/RewardsApi.md#get_affiliate_leader_dashboard) | **GET** /v1/rewards/affiliate/leaderDashboard | /rewards/affiliate/leaderDashboard *RewardsApi* | [**get_affiliate_metadata**](openapi_client/docs/RewardsApi.md#get_affiliate_metadata) | **GET** /v1/rewards/affiliate | /rewards/affiliate @@ -193,6 +201,17 @@ Class | Method | HTTP request | Description - [IntervalRewards](openapi_client/docs/IntervalRewards.md) - [IssBase64Details](openapi_client/docs/IssBase64Details.md) - [KlineInterval](openapi_client/docs/KlineInterval.md) + - [KoraCampaignBonus](openapi_client/docs/KoraCampaignBonus.md) + - [KoraCampaignMetadata](openapi_client/docs/KoraCampaignMetadata.md) + - [KoraCampaignRewards](openapi_client/docs/KoraCampaignRewards.md) + - [KoraEpochConfig](openapi_client/docs/KoraEpochConfig.md) + - [KoraEpochConfigResponse](openapi_client/docs/KoraEpochConfigResponse.md) + - [KoraEpochMetadata](openapi_client/docs/KoraEpochMetadata.md) + - [KoraHealthCheck200Response](openapi_client/docs/KoraHealthCheck200Response.md) + - [KoraIntervalMetadata](openapi_client/docs/KoraIntervalMetadata.md) + - [KoraLeaderboardEntry](openapi_client/docs/KoraLeaderboardEntry.md) + - [KoraLeaderboardResponse](openapi_client/docs/KoraLeaderboardResponse.md) + - [KoraRewardsSummary](openapi_client/docs/KoraRewardsSummary.md) - [LeaderboardEntry](openapi_client/docs/LeaderboardEntry.md) - [LeaderboardInterval](openapi_client/docs/LeaderboardInterval.md) - [LeaderboardResponse](openapi_client/docs/LeaderboardResponse.md) diff --git a/resources/bluefin-api.yaml b/resources/bluefin-api.yaml index bbf212ce..5ba1e625 100644 --- a/resources/bluefin-api.yaml +++ b/resources/bluefin-api.yaml @@ -268,9 +268,25 @@ paths: $ref: "./rewards-data-api.yaml#/paths/~1v1~1rewards~1claims~1mark-claimed" /v1/rewards/contract/config: $ref: "./rewards-data-api.yaml#/paths/~1v1~1rewards~1contract~1config" - - - + + # Kora Rewards Endpoints + /v1/kora/leaderboard: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1leaderboard" + /v1/kora/rewards/campaign: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1rewards~1campaign" + /v1/kora/rewards/summary: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1rewards~1summary" + /v1/kora/metadata/campaign: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1campaign" + /v1/kora/metadata/epoch: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1epoch" + /v1/kora/metadata/epoch/configs: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1epoch~1configs" + /v1/kora/metadata/interval: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1interval" + /v1/kora/health: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1health" + /ws/account: $ref: "./websocket-api.yaml#/paths/~1ws~1account" servers: diff --git a/resources/kora-rewards-api.yaml b/resources/kora-rewards-api.yaml new file mode 100644 index 00000000..54579d1b --- /dev/null +++ b/resources/kora-rewards-api.yaml @@ -0,0 +1,805 @@ +openapi: 3.0.3 +info: + title: Kora Rewards API + description: | + API for Kora swap rewards and campaigns. + All numeric quantities are represented as strings in e6 format. + version: 1.0.0 +tags: + - name: Kora + description: Kora swap rewards endpoints +servers: + - url: https://api.{env}.bluefin.io + variables: + env: + default: sui-staging + enum: + - sui-staging + - sui-prod + +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT + + schemas: + # Kora Leaderboard Schemas + KoraLeaderboardEntry: + type: object + required: + - rank + - userAddress + - totalVolumeE6 + - totalTransactions + - ccRewards + - koraPoints + properties: + rank: + type: integer + description: Overall ranking position based on sortBy parameter + example: 1 + userAddress: + type: string + description: Wallet address of the user + example: "0x1234567890abcdef" + totalVolumeE6: + type: string + description: Total swap volume (USD equivalent) + example: "50000.123456" + totalFeeE6: + type: string + description: Total fees paid + example: "150.75" + totalTransactions: + type: integer + description: Total number of qualifying swap transactions + example: 1250 + ccRewards: + type: string + description: CC token rewards earned + example: "1500.75" + koraPoints: + type: string + description: Kora points earned + example: "2500.5" + totalBonusPoints: + type: string + description: Total bonus points earned + example: "500.25" + totalBonusCC: + type: string + description: Total bonus CC tokens earned + example: "200.5" + volumeRank: + type: integer + description: Ranking based purely on trading volume + example: 1 + transactionRank: + type: integer + description: Ranking based purely on transaction count + example: 3 + totalEarningsRank: + type: integer + description: Ranking based on combined CC + Kora points value + example: 1 + lastActivityDate: + type: integer + description: Timestamp of user's most recent swap (milliseconds) + example: 1724725894751 + + KoraLeaderboardResponse: + type: object + required: + - data + - total + - limit + - page + properties: + data: + type: array + items: + $ref: "#/components/schemas/KoraLeaderboardEntry" + total: + type: integer + description: Total number of records + example: 2847 + limit: + type: integer + description: Page size for pagination + example: 500 + page: + type: integer + description: Current page number + example: 1 + + # Kora Bonus Schema + KoraUserBonus: + type: object + required: + - id + - epochId + - userAddress + - bonusType + - bonusCCRewards + - bonusPoints + properties: + id: + type: string + format: uuid + description: Bonus record ID + example: "550e8400-e29b-41d4-a716-446655440000" + epochId: + type: string + format: uuid + description: Epoch ID + example: "550e8400-e29b-41d4-a716-446655440001" + userAddress: + type: string + description: User wallet address + example: "0x1234567890abcdef" + bonusType: + type: string + description: Type of bonus (daily_trader, volume_leader, first_trader, etc.) + example: "daily_trader" + bonusCCRewards: + type: string + description: CC token bonus amount + example: "100.5" + bonusPoints: + type: string + description: Points bonus amount + example: "200.75" + bonusCriteria: + type: object + description: Criteria met for bonus eligibility + additionalProperties: true + createdAt: + type: integer + description: Bonus award timestamp (milliseconds) + example: 1724725894751 + + # Kora Campaign Rewards + KoraCampaignRewards: + type: object + required: + - userAddress + - campaignName + - epochNumber + - intervalNumber + - status + properties: + userAddress: + type: string + description: User address for the rewards earned data + example: "0x1234567890abcdef" + campaignName: + type: string + description: Name of the campaign + example: "KORA_SWAPS" + epochNumber: + type: integer + description: Epoch number for the rewards earned data + example: 7 + intervalNumber: + type: integer + description: Interval number for the rewards earned data + example: 7 + symbol: + type: string + description: Market Symbol + example: "KORA-SWAPS" + status: + type: string + enum: + - ACTIVE + - NOT_STARTED + - FINALIZED + - COOLDOWN + blueRewards: + type: string + description: Total blue token rewards + example: "100.5" + suiRewards: + type: string + description: Total sui token rewards + example: "200.25" + walRewards: + type: string + description: Total wal rewards + example: "50.75" + cashRewards: + type: string + description: Total cash rewards + example: "0" + ccRewards: + type: string + description: Total CC token rewards + example: "1500.75" + koraPoints: + type: string + description: Total Kora points earned + example: "2500.5" + userFeePaid: + type: string + description: Total user fee paid + example: "15.25" + intervalStartDate: + type: integer + description: Time in milliseconds for interval start date + example: 1724121094751 + intervalEndDate: + type: integer + description: Time in milliseconds for interval end date + example: 1724725894751 + isDisbursed: + type: boolean + description: Indicates if rewards have been disbursed + example: true + txnDigest: + type: string + description: Transaction digest of the disbursement + example: "8Fs9Q4ljB0cc0NhcqSVZRgTxe9KwZeRqjGYYYe4jXgXL" + claimStatus: + type: string + enum: + - CLAIMABLE + - CLAIMED + - NOT_YET_CLAIMABLE + - CLAIM_ENDED + description: Status of the claim + example: "CLAIMED" + bonuses: + type: array + description: List of bonuses attached to this reward entry + items: + $ref: "#/components/schemas/KoraCampaignBonus" + + # Bonus attached to campaign rewards + KoraCampaignBonus: + type: object + properties: + bonusType: + type: string + description: Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) + example: "VOLUME_BONUS" + bonusCcReward: + type: string + description: CC reward amount for this bonus + example: "500.5" + bonusPoints: + type: string + description: Points earned for this bonus + example: "1000.75" + bonusCriteria: + type: string + description: Criteria that was met for earning this bonus + example: "volume_threshold_100k" + + # Kora Rewards Summary + KoraRewardsSummary: + type: object + required: + - userAddress + properties: + userAddress: + type: string + description: User address for the rewards earned data + example: "0x1234567890abcdef" + blueRewards: + type: string + description: Total Blue token rewards earned + example: "100.5" + suiRewards: + type: string + description: Total Sui token rewards earned + example: "200.25" + walRewards: + type: string + description: Total wal rewards earned + example: "50.75" + ccRewards: + type: string + description: Total CC token rewards earned across all Kora campaigns + example: "1500.75" + koraPoints: + type: string + description: Total Kora points earned across all Kora campaigns + example: "2500.5" + + # Kora Campaign Metadata + KoraCampaignMetadata: + type: object + required: + - status + - campaignName + - startDate + - endDate + properties: + status: + type: string + enum: + - ACTIVE + - INACTIVE + campaignName: + type: string + description: Name of the campaign + example: "KORA_SWAPS" + parentCampaignName: + type: string + description: Name of the parent campaign + example: "" + startDate: + type: integer + description: Time in milliseconds for campaign start date + example: 1724121094751 + endDate: + type: integer + description: Time in milliseconds for campaign end date + example: 1724121094751 + + # Kora Epoch Metadata + KoraEpochMetadata: + type: object + required: + - status + - campaignName + - epochId + - epochNumber + - startDate + - endDate + properties: + status: + type: string + enum: + - ACTIVE + - NOT_STARTED + - FINALIZED + - COOLDOWN + campaignName: + type: string + description: Name of the campaign + example: "KORA_SWAPS" + epochId: + type: string + format: uuid + description: Epoch ID + example: "550e8400-e29b-41d4-a716-446655440000" + epochNumber: + type: integer + description: Epoch number + example: 7 + startDate: + type: integer + description: Time in milliseconds for epoch start date + example: 1724121094751 + endDate: + type: integer + description: Time in milliseconds for epoch end date + example: 1724725894751 + + # Kora Interval Metadata + KoraIntervalMetadata: + type: object + required: + - status + - startDate + - endDate + - intervalId + properties: + status: + type: string + enum: + - ACTIVE + - NOT_STARTED + - FINALIZED + - COOLDOWN + startDate: + type: integer + description: Time in milliseconds for interval start date + example: 1724121094751 + endDate: + type: integer + description: Time in milliseconds for interval end date + example: 1724725894751 + intervalId: + type: integer + description: Interval ID + example: 7 + intervalType: + type: string + description: Type of the interval + example: "WEEK" + protocol: + type: string + enum: + - bluefin + - kora + description: Protocol for the interval + example: "kora" + + # Kora Epoch Config + KoraEpochConfig: + type: object + required: + - campaignName + - epochDuration + - intervalNumber + - epochNumber + properties: + campaignName: + type: string + description: The name of the campaign + example: "KORA_SWAPS" + epochDuration: + type: integer + description: Duration of the epoch in hours + example: 168 + suiRewardsAllocation: + type: string + description: Allocation of Sui rewards for this epoch + example: "1000.5" + blueRewardsAllocation: + type: string + description: Allocation of Blue rewards for this epoch + example: "2000.25" + walRewardsAllocation: + type: string + description: Allocation of Wal rewards for this epoch + example: "500.75" + ccRewardsAllocation: + type: string + description: Allocation of CC token rewards for this epoch + example: "5000.5" + koraPointsRewardsAllocation: + type: string + description: Allocation of Kora points rewards for this epoch + example: "10000.25" + intervalNumber: + type: integer + description: Interval number for the epoch + example: 7 + epochNumber: + type: integer + description: Epoch number + example: 7 + config: + type: object + description: Additional campaign-specific configurations + additionalProperties: true + + KoraEpochConfigResponse: + type: object + required: + - maxIntervalNumber + - intervalNumber + - data + properties: + maxIntervalNumber: + type: integer + description: The maximum interval number available + example: 14 + intervalNumber: + type: integer + description: The current interval number being queried + example: 7 + data: + type: array + items: + $ref: "#/components/schemas/KoraEpochConfig" + +paths: + # ============================================================================ + # KORA LEADERBOARD ENDPOINT + # ============================================================================ + /v1/kora/leaderboard: + get: + tags: + - Kora + operationId: getKoraLeaderboard + summary: Get Kora swap leaderboard + description: Returns rankings and earnings for Kora swap participants, sorted by the specified category. + parameters: + - name: epochId + in: query + required: false + description: Specify epoch ID (defaults to current active epoch) + schema: + type: string + format: uuid + - name: sortBy + in: query + required: false + description: The category to sort rankings by + schema: + type: string + enum: + - volumeRank + - transactionRank + - totalEarnings + default: volumeRank + - name: sortOrder + in: query + required: false + description: The order to sort rankings by + schema: + type: string + enum: + - asc + - desc + default: desc + - name: page + in: query + required: false + description: Page number for pagination + schema: + type: integer + default: 1 + minimum: 1 + - name: limit + in: query + required: false + description: Page size for pagination + schema: + type: integer + default: 50 + maximum: 100 + minimum: 1 + - name: search + in: query + required: false + description: Filter by user address (partial match supported) + schema: + type: string + - name: minVolumeE6 + in: query + required: false + description: Minimum trading volume filter (e6 format) + schema: + type: string + default: "0" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/KoraLeaderboardResponse" + "400": + description: Invalid request parameters + content: + application/json: + schema: + $ref: "./common.yaml#/components/schemas/Error" + + # ============================================================================ + # KORA REWARDS ENDPOINTS + # ============================================================================ + /v1/kora/rewards/campaign: + get: + tags: + - Kora + operationId: getKoraCampaignRewards + summary: Get Kora campaign rewards + description: Returns the rewards earned by users for Kora campaigns. + parameters: + - name: campaignName + in: query + required: false + description: Specify the campaign name + schema: + type: string + enum: + - KORA_SWAPS + default: KORA_SWAPS + example: "KORA_SWAPS" + - name: epochNumber + in: query + required: false + description: Optionally specify epoch number + schema: + type: integer + example: 7 + - name: userAddress + in: query + required: true + description: Specify wallet address + schema: + type: string + example: "0x1234567890abcdef" + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraCampaignRewards" + "400": + description: Missing required parameters + content: + application/json: + schema: + $ref: "./common.yaml#/components/schemas/Error" + + /v1/kora/rewards/summary: + get: + tags: + - Kora + operationId: getKoraRewardsSummary + summary: Get Kora all-time rewards summary + description: Returns the all-time rewards earned by users including Kora CC and points. + security: + - bearerAuth: [] + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraRewardsSummary" + + # ============================================================================ + # KORA METADATA ENDPOINTS + # ============================================================================ + /v1/kora/metadata/campaign: + get: + tags: + - Kora + operationId: getKoraCampaignMetadata + summary: Get Kora campaign metadata + description: Returns metadata for Kora rewards campaigns. + parameters: + - name: campaignName + in: query + required: false + description: Specify the campaign name + schema: + type: string + example: "KORA_SWAPS" + - name: status + in: query + required: false + description: Filter by campaign status + schema: + type: string + enum: + - ACTIVE + - INACTIVE + default: ACTIVE + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraCampaignMetadata" + + /v1/kora/metadata/epoch: + get: + tags: + - Kora + operationId: getKoraEpochMetadata + summary: Get Kora epoch metadata + description: Returns the latest or next epoch for a Kora campaign. + parameters: + - name: campaignName + in: query + required: false + description: Specify the campaign name + schema: + type: string + example: "KORA_SWAPS" + - name: epoch + in: query + required: false + description: Specify "next" or "latest" + schema: + type: string + enum: ["next", "latest"] + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraEpochMetadata" + + /v1/kora/metadata/epoch/configs: + get: + tags: + - Kora + operationId: getKoraEpochConfigMetadata + summary: Get Kora epoch configuration + description: Returns epoch configuration including reward allocations for Kora. + parameters: + - name: intervalNumber + in: query + required: false + description: Specify the interval number + schema: + type: integer + example: 7 + - name: campaignName + in: query + required: false + description: Filter by campaign name + schema: + type: string + example: "KORA_SWAPS" + responses: + "200": + description: Successful response + content: + application/json: + schema: + $ref: "#/components/schemas/KoraEpochConfigResponse" + + /v1/kora/metadata/interval: + get: + tags: + - Kora + operationId: getKoraIntervalMetadata + summary: Get Kora interval metadata + description: Returns interval metadata for Kora. + parameters: + - name: interval + in: query + required: false + description: Interval number or "next"/"latest" + schema: + type: string + example: "latest" + - name: protocol + in: query + required: false + description: Filter by protocol + schema: + type: string + enum: + - bluefin + - kora + default: kora + example: "kora" + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraIntervalMetadata" + + # ============================================================================ + # KORA HEALTH CHECK + # ============================================================================ + /v1/kora/health: + get: + tags: + - Kora + operationId: koraHealthCheck + summary: Kora service health check + description: Returns the health status of the Kora rewards service. + responses: + "200": + description: Service is healthy + content: + application/json: + schema: + type: object + properties: + status: + type: string + example: "ok" + timestamp: + type: integer + example: 1724725894751 diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 56677cfb..7801395d 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -11,6 +11,12 @@ dependencies = [ "libc", ] +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + [[package]] name = "arrayvec" version = "0.7.6" @@ -131,6 +137,7 @@ dependencies = [ "serde_repr", "serde_with", "url", + "uuid", ] [[package]] @@ -493,6 +500,12 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + [[package]] name = "foreign-types" version = "0.3.2" @@ -603,11 +616,24 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi", + "r-efi 5.3.0", "wasip2", "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi 6.0.0", + "wasip2", + "wasip3", +] + [[package]] name = "group" version = "0.13.0" @@ -644,12 +670,27 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + [[package]] name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hex" version = "0.4.3" @@ -899,6 +940,12 @@ dependencies = [ "zerovec", ] +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + [[package]] name = "ident_case" version = "1.0.1" @@ -993,6 +1040,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + [[package]] name = "libc" version = "0.2.180" @@ -1228,6 +1281,16 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + [[package]] name = "proc-macro2" version = "1.0.105" @@ -1307,6 +1370,12 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "rand" version = "0.8.5" @@ -2222,6 +2291,12 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "untrusted" version = "0.9.0" @@ -2252,6 +2327,18 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" +[[package]] +name = "uuid" +version = "1.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "serde_core", + "wasm-bindgen", +] + [[package]] name = "vcpkg" version = "0.2.15" @@ -2285,7 +2372,16 @@ version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen", + "wit-bindgen 0.46.0", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen 0.51.0", ] [[package]] @@ -2346,6 +2442,40 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap 2.13.0", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap 2.13.0", + "semver", +] + [[package]] name = "web-sys" version = "0.3.83" @@ -2616,6 +2746,94 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap 2.13.0", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap 2.13.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.13.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + [[package]] name = "writeable" version = "0.6.2" diff --git a/rust/gen/bluefin_api/.openapi-generator/FILES b/rust/gen/bluefin_api/.openapi-generator/FILES index 8bcdde36..8f09a93e 100644 --- a/rust/gen/bluefin_api/.openapi-generator/FILES +++ b/rust/gen/bluefin_api/.openapi-generator/FILES @@ -72,6 +72,18 @@ docs/IntervalMetadata.md docs/IntervalRewards.md docs/IssBase64Details.md docs/KlineInterval.md +docs/KoraApi.md +docs/KoraCampaignBonus.md +docs/KoraCampaignMetadata.md +docs/KoraCampaignRewards.md +docs/KoraEpochConfig.md +docs/KoraEpochConfigResponse.md +docs/KoraEpochMetadata.md +docs/KoraHealthCheck200Response.md +docs/KoraIntervalMetadata.md +docs/KoraLeaderboardEntry.md +docs/KoraLeaderboardResponse.md +docs/KoraRewardsSummary.md docs/LeaderboardEntry.md docs/LeaderboardInterval.md docs/LeaderboardResponse.md @@ -153,6 +165,7 @@ src/apis/account_data_api.rs src/apis/auth_api.rs src/apis/configuration.rs src/apis/exchange_api.rs +src/apis/kora_api.rs src/apis/mod.rs src/apis/rewards_api.rs src/apis/streams_api.rs @@ -225,6 +238,17 @@ src/models/interval_metadata.rs src/models/interval_rewards.rs src/models/iss_base64_details.rs src/models/kline_interval.rs +src/models/kora_campaign_bonus.rs +src/models/kora_campaign_metadata.rs +src/models/kora_campaign_rewards.rs +src/models/kora_epoch_config.rs +src/models/kora_epoch_config_response.rs +src/models/kora_epoch_metadata.rs +src/models/kora_health_check_200_response.rs +src/models/kora_interval_metadata.rs +src/models/kora_leaderboard_entry.rs +src/models/kora_leaderboard_response.rs +src/models/kora_rewards_summary.rs src/models/leaderboard_entry.rs src/models/leaderboard_interval.rs src/models/leaderboard_response.rs diff --git a/rust/gen/bluefin_api/Cargo.toml b/rust/gen/bluefin_api/Cargo.toml index ceb8608b..9f68bcfd 100644 --- a/rust/gen/bluefin_api/Cargo.toml +++ b/rust/gen/bluefin_api/Cargo.toml @@ -12,4 +12,5 @@ serde_with = { version = "^3.8", default-features = false, features = ["base64", serde_json = "^1.0" serde_repr = "^0.1" url = "^2.5" +uuid = { version = "^1.8", features = ["serde", "v4"] } reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } diff --git a/rust/gen/bluefin_api/README.md b/rust/gen/bluefin_api/README.md index 6bad89ea..51972bf7 100644 --- a/rust/gen/bluefin_api/README.md +++ b/rust/gen/bluefin_api/README.md @@ -52,6 +52,14 @@ Class | Method | HTTP request | Description *ExchangeApi* | [**get_market_ticker**](docs/ExchangeApi.md#get_market_ticker) | **GET** /v1/exchange/ticker | /exchange/ticker *ExchangeApi* | [**get_orderbook_depth**](docs/ExchangeApi.md#get_orderbook_depth) | **GET** /v1/exchange/depth | /exchange/depth *ExchangeApi* | [**get_recent_trades**](docs/ExchangeApi.md#get_recent_trades) | **GET** /v1/exchange/trades | /exchange/trades +*KoraApi* | [**get_kora_campaign_metadata**](docs/KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata +*KoraApi* | [**get_kora_campaign_rewards**](docs/KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards +*KoraApi* | [**get_kora_epoch_config_metadata**](docs/KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration +*KoraApi* | [**get_kora_epoch_metadata**](docs/KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata +*KoraApi* | [**get_kora_interval_metadata**](docs/KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata +*KoraApi* | [**get_kora_leaderboard**](docs/KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard +*KoraApi* | [**get_kora_rewards_summary**](docs/KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary +*KoraApi* | [**kora_health_check**](docs/KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check *RewardsApi* | [**get_affiliate_interval_overview**](docs/RewardsApi.md#get_affiliate_interval_overview) | **GET** /v1/rewards/affiliate/intervalOverview | /rewards/affiliate/intervalOverview *RewardsApi* | [**get_affiliate_leader_dashboard**](docs/RewardsApi.md#get_affiliate_leader_dashboard) | **GET** /v1/rewards/affiliate/leaderDashboard | /rewards/affiliate/leaderDashboard *RewardsApi* | [**get_affiliate_metadata**](docs/RewardsApi.md#get_affiliate_metadata) | **GET** /v1/rewards/affiliate | /rewards/affiliate @@ -153,6 +161,17 @@ Class | Method | HTTP request | Description - [IntervalRewards](docs/IntervalRewards.md) - [IssBase64Details](docs/IssBase64Details.md) - [KlineInterval](docs/KlineInterval.md) + - [KoraCampaignBonus](docs/KoraCampaignBonus.md) + - [KoraCampaignMetadata](docs/KoraCampaignMetadata.md) + - [KoraCampaignRewards](docs/KoraCampaignRewards.md) + - [KoraEpochConfig](docs/KoraEpochConfig.md) + - [KoraEpochConfigResponse](docs/KoraEpochConfigResponse.md) + - [KoraEpochMetadata](docs/KoraEpochMetadata.md) + - [KoraHealthCheck200Response](docs/KoraHealthCheck200Response.md) + - [KoraIntervalMetadata](docs/KoraIntervalMetadata.md) + - [KoraLeaderboardEntry](docs/KoraLeaderboardEntry.md) + - [KoraLeaderboardResponse](docs/KoraLeaderboardResponse.md) + - [KoraRewardsSummary](docs/KoraRewardsSummary.md) - [LeaderboardEntry](docs/LeaderboardEntry.md) - [LeaderboardInterval](docs/LeaderboardInterval.md) - [LeaderboardResponse](docs/LeaderboardResponse.md) diff --git a/rust/gen/bluefin_api/docs/KoraApi.md b/rust/gen/bluefin_api/docs/KoraApi.md new file mode 100644 index 00000000..d77061d7 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraApi.md @@ -0,0 +1,262 @@ +# \KoraApi + +All URIs are relative to *https://api.sui-staging.bluefin.io* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**get_kora_campaign_metadata**](KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata +[**get_kora_campaign_rewards**](KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards +[**get_kora_epoch_config_metadata**](KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration +[**get_kora_epoch_metadata**](KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata +[**get_kora_interval_metadata**](KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata +[**get_kora_leaderboard**](KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard +[**get_kora_rewards_summary**](KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary +[**kora_health_check**](KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check + + + +## get_kora_campaign_metadata + +> Vec get_kora_campaign_metadata(campaign_name, status) +Get Kora campaign metadata + +Returns metadata for Kora rewards campaigns. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**campaign_name** | Option<**String**> | Specify the campaign name | | +**status** | Option<**String**> | Filter by campaign status | |[default to ACTIVE] + +### Return type + +[**Vec**](KoraCampaignMetadata.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) + + +## get_kora_campaign_rewards + +> Vec get_kora_campaign_rewards(user_address, campaign_name, epoch_number) +Get Kora campaign rewards + +Returns the rewards earned by users for Kora campaigns. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**user_address** | **String** | Specify wallet address | [required] | +**campaign_name** | Option<**String**> | Specify the campaign name | |[default to KORA_SWAPS] +**epoch_number** | Option<**i32**> | Optionally specify epoch number | | + +### Return type + +[**Vec**](KoraCampaignRewards.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) + + +## get_kora_epoch_config_metadata + +> models::KoraEpochConfigResponse get_kora_epoch_config_metadata(interval_number, campaign_name) +Get Kora epoch configuration + +Returns epoch configuration including reward allocations for Kora. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**interval_number** | Option<**i32**> | Specify the interval number | | +**campaign_name** | Option<**String**> | Filter by campaign name | | + +### Return type + +[**models::KoraEpochConfigResponse**](KoraEpochConfigResponse.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) + + +## get_kora_epoch_metadata + +> Vec get_kora_epoch_metadata(campaign_name, epoch) +Get Kora epoch metadata + +Returns the latest or next epoch for a Kora campaign. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**campaign_name** | Option<**String**> | Specify the campaign name | | +**epoch** | Option<**String**> | Specify \"next\" or \"latest\" | | + +### Return type + +[**Vec**](KoraEpochMetadata.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) + + +## get_kora_interval_metadata + +> Vec get_kora_interval_metadata(interval, protocol) +Get Kora interval metadata + +Returns interval metadata for Kora. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**interval** | Option<**String**> | Interval number or \"next\"/\"latest\" | | +**protocol** | Option<**String**> | Filter by protocol | |[default to kora] + +### Return type + +[**Vec**](KoraIntervalMetadata.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) + + +## get_kora_leaderboard + +> models::KoraLeaderboardResponse get_kora_leaderboard(epoch_id, sort_by, sort_order, page, limit, search, min_volume_e6) +Get Kora swap leaderboard + +Returns rankings and earnings for Kora swap participants, sorted by the specified category. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**epoch_id** | Option<**uuid::Uuid**> | Specify epoch ID (defaults to current active epoch) | | +**sort_by** | Option<**String**> | The category to sort rankings by | |[default to volumeRank] +**sort_order** | Option<**String**> | The order to sort rankings by | |[default to desc] +**page** | Option<**u32**> | Page number for pagination | |[default to 1] +**limit** | Option<**u32**> | Page size for pagination | |[default to 50] +**search** | Option<**String**> | Filter by user address (partial match supported) | | +**min_volume_e6** | Option<**String**> | Minimum trading volume filter (e6 format) | |[default to 0] + +### Return type + +[**models::KoraLeaderboardResponse**](KoraLeaderboardResponse.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) + + +## get_kora_rewards_summary + +> Vec get_kora_rewards_summary() +Get Kora all-time rewards summary + +Returns the all-time rewards earned by users including Kora CC and points. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**Vec**](KoraRewardsSummary.md) + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### 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) + + +## kora_health_check + +> models::KoraHealthCheck200Response kora_health_check() +Kora service health check + +Returns the health status of the Kora rewards service. + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**models::KoraHealthCheck200Response**](koraHealthCheck_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) + diff --git a/rust/gen/bluefin_api/docs/KoraCampaignBonus.md b/rust/gen/bluefin_api/docs/KoraCampaignBonus.md new file mode 100644 index 00000000..a01a8ba5 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraCampaignBonus.md @@ -0,0 +1,14 @@ +# KoraCampaignBonus + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bonus_type** | Option<**String**> | Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) | [optional] +**bonus_cc_reward** | Option<**String**> | CC reward amount for this bonus | [optional] +**bonus_points** | Option<**String**> | Points earned for this bonus | [optional] +**bonus_criteria** | Option<**String**> | Criteria that was met for earning this bonus | [optional] + +[[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/KoraCampaignMetadata.md b/rust/gen/bluefin_api/docs/KoraCampaignMetadata.md new file mode 100644 index 00000000..fc0354a7 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraCampaignMetadata.md @@ -0,0 +1,15 @@ +# KoraCampaignMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | +**campaign_name** | **String** | Name of the campaign | +**parent_campaign_name** | Option<**String**> | Name of the parent campaign | [optional] +**start_date** | **i32** | Time in milliseconds for campaign start date | +**end_date** | **i32** | Time in milliseconds for campaign end date | + +[[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/KoraCampaignRewards.md b/rust/gen/bluefin_api/docs/KoraCampaignRewards.md new file mode 100644 index 00000000..8b15c551 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraCampaignRewards.md @@ -0,0 +1,29 @@ +# KoraCampaignRewards + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **String** | User address for the rewards earned data | +**campaign_name** | **String** | Name of the campaign | +**epoch_number** | **i32** | Epoch number for the rewards earned data | +**interval_number** | **i32** | Interval number for the rewards earned data | +**symbol** | Option<**String**> | Market Symbol | [optional] +**status** | **String** | | +**blue_rewards** | Option<**String**> | Total blue token rewards | [optional] +**sui_rewards** | Option<**String**> | Total sui token rewards | [optional] +**wal_rewards** | Option<**String**> | Total wal rewards | [optional] +**cash_rewards** | Option<**String**> | Total cash rewards | [optional] +**cc_rewards** | Option<**String**> | Total CC token rewards | [optional] +**kora_points** | Option<**String**> | Total Kora points earned | [optional] +**user_fee_paid** | Option<**String**> | Total user fee paid | [optional] +**interval_start_date** | Option<**i32**> | Time in milliseconds for interval start date | [optional] +**interval_end_date** | Option<**i32**> | Time in milliseconds for interval end date | [optional] +**is_disbursed** | Option<**bool**> | Indicates if rewards have been disbursed | [optional] +**txn_digest** | Option<**String**> | Transaction digest of the disbursement | [optional] +**claim_status** | Option<**String**> | Status of the claim | [optional] +**bonuses** | Option<[**Vec**](KoraCampaignBonus.md)> | List of bonuses attached to this reward entry | [optional] + +[[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/KoraEpochConfig.md b/rust/gen/bluefin_api/docs/KoraEpochConfig.md new file mode 100644 index 00000000..5cbec5d2 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraEpochConfig.md @@ -0,0 +1,20 @@ +# KoraEpochConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaign_name** | **String** | The name of the campaign | +**epoch_duration** | **i32** | Duration of the epoch in hours | +**sui_rewards_allocation** | Option<**String**> | Allocation of Sui rewards for this epoch | [optional] +**blue_rewards_allocation** | Option<**String**> | Allocation of Blue rewards for this epoch | [optional] +**wal_rewards_allocation** | Option<**String**> | Allocation of Wal rewards for this epoch | [optional] +**cc_rewards_allocation** | Option<**String**> | Allocation of CC token rewards for this epoch | [optional] +**kora_points_rewards_allocation** | Option<**String**> | Allocation of Kora points rewards for this epoch | [optional] +**interval_number** | **i32** | Interval number for the epoch | +**epoch_number** | **i32** | Epoch number | +**config** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Additional campaign-specific configurations | [optional] + +[[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/KoraEpochConfigResponse.md b/rust/gen/bluefin_api/docs/KoraEpochConfigResponse.md new file mode 100644 index 00000000..af528296 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraEpochConfigResponse.md @@ -0,0 +1,13 @@ +# KoraEpochConfigResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**max_interval_number** | **i32** | The maximum interval number available | +**interval_number** | **i32** | The current interval number being queried | +**data** | [**Vec**](KoraEpochConfig.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/KoraEpochMetadata.md b/rust/gen/bluefin_api/docs/KoraEpochMetadata.md new file mode 100644 index 00000000..629cee37 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraEpochMetadata.md @@ -0,0 +1,16 @@ +# KoraEpochMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | +**campaign_name** | **String** | Name of the campaign | +**epoch_id** | [**uuid::Uuid**](uuid::Uuid.md) | Epoch ID | +**epoch_number** | **i32** | Epoch number | +**start_date** | **i32** | Time in milliseconds for epoch start date | +**end_date** | **i32** | Time in milliseconds for epoch end date | + +[[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/KoraHealthCheck200Response.md b/rust/gen/bluefin_api/docs/KoraHealthCheck200Response.md new file mode 100644 index 00000000..d7d8453b --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraHealthCheck200Response.md @@ -0,0 +1,12 @@ +# KoraHealthCheck200Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | Option<**String**> | | [optional] +**timestamp** | Option<**i32**> | | [optional] + +[[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/KoraIntervalMetadata.md b/rust/gen/bluefin_api/docs/KoraIntervalMetadata.md new file mode 100644 index 00000000..f539a50d --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraIntervalMetadata.md @@ -0,0 +1,16 @@ +# KoraIntervalMetadata + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | +**start_date** | **i32** | Time in milliseconds for interval start date | +**end_date** | **i32** | Time in milliseconds for interval end date | +**interval_id** | **i32** | Interval ID | +**interval_type** | Option<**String**> | Type of the interval | [optional] +**protocol** | Option<**String**> | Protocol for the interval | [optional] + +[[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/KoraLeaderboardEntry.md b/rust/gen/bluefin_api/docs/KoraLeaderboardEntry.md new file mode 100644 index 00000000..c97fdd30 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraLeaderboardEntry.md @@ -0,0 +1,23 @@ +# KoraLeaderboardEntry + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rank** | **i32** | Overall ranking position based on sortBy parameter | +**user_address** | **String** | Wallet address of the user | +**total_volume_e6** | **String** | Total swap volume (USD equivalent) | +**total_fee_e6** | Option<**String**> | Total fees paid | [optional] +**total_transactions** | **i32** | Total number of qualifying swap transactions | +**cc_rewards** | **String** | CC token rewards earned | +**kora_points** | **String** | Kora points earned | +**total_bonus_points** | Option<**String**> | Total bonus points earned | [optional] +**total_bonus_cc** | Option<**String**> | Total bonus CC tokens earned | [optional] +**volume_rank** | Option<**i32**> | Ranking based purely on trading volume | [optional] +**transaction_rank** | Option<**i32**> | Ranking based purely on transaction count | [optional] +**total_earnings_rank** | Option<**i32**> | Ranking based on combined CC + Kora points value | [optional] +**last_activity_date** | Option<**i32**> | Timestamp of user's most recent swap (milliseconds) | [optional] + +[[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/KoraLeaderboardResponse.md b/rust/gen/bluefin_api/docs/KoraLeaderboardResponse.md new file mode 100644 index 00000000..27243d8c --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraLeaderboardResponse.md @@ -0,0 +1,14 @@ +# KoraLeaderboardResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Vec**](KoraLeaderboardEntry.md) | | +**total** | **i32** | Total number of records | +**limit** | **i32** | Page size for pagination | +**page** | **i32** | Current page number | + +[[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/KoraRewardsSummary.md b/rust/gen/bluefin_api/docs/KoraRewardsSummary.md new file mode 100644 index 00000000..9104f48d --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraRewardsSummary.md @@ -0,0 +1,16 @@ +# KoraRewardsSummary + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **String** | User address for the rewards earned data | +**blue_rewards** | Option<**String**> | Total Blue token rewards earned | [optional] +**sui_rewards** | Option<**String**> | Total Sui token rewards earned | [optional] +**wal_rewards** | Option<**String**> | Total wal rewards earned | [optional] +**cc_rewards** | Option<**String**> | Total CC token rewards earned across all Kora campaigns | [optional] +**kora_points** | Option<**String**> | Total Kora points earned across all Kora campaigns | [optional] + +[[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/kora_api.rs b/rust/gen/bluefin_api/src/apis/kora_api.rs new file mode 100644 index 00000000..c78c50b1 --- /dev/null +++ b/rust/gen/bluefin_api/src/apis/kora_api.rs @@ -0,0 +1,435 @@ +/* + * Bluefin API + * + * Bluefin API + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + + +use reqwest; +use serde::{Deserialize, Serialize, de::Error as _}; +use crate::{apis::ResponseContent, models}; +use super::{Error, configuration, ContentType}; + + +/// struct for typed errors of method [`get_kora_campaign_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraCampaignMetadataError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_campaign_rewards`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraCampaignRewardsError { + Status400(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_epoch_config_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraEpochConfigMetadataError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_epoch_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraEpochMetadataError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_interval_metadata`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraIntervalMetadataError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_leaderboard`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraLeaderboardError { + Status400(models::Error), + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`get_kora_rewards_summary`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetKoraRewardsSummaryError { + UnknownValue(serde_json::Value), +} + +/// struct for typed errors of method [`kora_health_check`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum KoraHealthCheckError { + UnknownValue(serde_json::Value), +} + + +/// Returns metadata for Kora rewards campaigns. +pub async fn get_kora_campaign_metadata(configuration: &configuration::Configuration, campaign_name: Option<&str>, status: Option<&str>) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_campaign_name = campaign_name; + let p_status = status; + + let uri_str = format!("{}/v1/kora/metadata/campaign", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_campaign_name { + req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_status { + req_builder = req_builder.query(&[("status", ¶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 `Vec<models::KoraCampaignMetadata>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraCampaignMetadata>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns the rewards earned by users for Kora campaigns. +pub async fn get_kora_campaign_rewards(configuration: &configuration::Configuration, user_address: &str, campaign_name: Option<&str>, epoch_number: Option) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_user_address = user_address; + let p_campaign_name = campaign_name; + let p_epoch_number = epoch_number; + + let uri_str = format!("{}/v1/kora/rewards/campaign", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_campaign_name { + req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_epoch_number { + req_builder = req_builder.query(&[("epochNumber", ¶m_value.to_string())]); + } + req_builder = req_builder.query(&[("userAddress", &p_user_address.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 `Vec<models::KoraCampaignRewards>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraCampaignRewards>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns epoch configuration including reward allocations for Kora. +pub async fn get_kora_epoch_config_metadata(configuration: &configuration::Configuration, interval_number: Option, campaign_name: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_interval_number = interval_number; + let p_campaign_name = campaign_name; + + let uri_str = format!("{}/v1/kora/metadata/epoch/configs", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_interval_number { + req_builder = req_builder.query(&[("intervalNumber", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_campaign_name { + req_builder = req_builder.query(&[("campaignName", ¶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::KoraEpochConfigResponse`"))), + 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::KoraEpochConfigResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns the latest or next epoch for a Kora campaign. +pub async fn get_kora_epoch_metadata(configuration: &configuration::Configuration, campaign_name: Option<&str>, epoch: Option<&str>) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_campaign_name = campaign_name; + let p_epoch = epoch; + + let uri_str = format!("{}/v1/kora/metadata/epoch", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_campaign_name { + req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_epoch { + req_builder = req_builder.query(&[("epoch", ¶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 `Vec<models::KoraEpochMetadata>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraEpochMetadata>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns interval metadata for Kora. +pub async fn get_kora_interval_metadata(configuration: &configuration::Configuration, interval: Option<&str>, protocol: Option<&str>) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_interval = interval; + let p_protocol = protocol; + + let uri_str = format!("{}/v1/kora/metadata/interval", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_interval { + req_builder = req_builder.query(&[("interval", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_protocol { + req_builder = req_builder.query(&[("protocol", ¶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 `Vec<models::KoraIntervalMetadata>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraIntervalMetadata>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns rankings and earnings for Kora swap participants, sorted by the specified category. +pub async fn get_kora_leaderboard(configuration: &configuration::Configuration, epoch_id: Option<&str>, sort_by: Option<&str>, sort_order: Option<&str>, page: Option, limit: Option, search: Option<&str>, min_volume_e6: Option<&str>) -> Result> { + // add a prefix to parameters to efficiently prevent name collisions + let p_epoch_id = epoch_id; + let p_sort_by = sort_by; + let p_sort_order = sort_order; + let p_page = page; + let p_limit = limit; + let p_search = search; + let p_min_volume_e6 = min_volume_e6; + + let uri_str = format!("{}/v1/kora/leaderboard", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref param_value) = p_epoch_id { + req_builder = req_builder.query(&[("epochId", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_sort_by { + req_builder = req_builder.query(&[("sortBy", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_sort_order { + req_builder = req_builder.query(&[("sortOrder", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_page { + req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_limit { + req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_search { + req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); + } + if let Some(ref param_value) = p_min_volume_e6 { + req_builder = req_builder.query(&[("minVolumeE6", ¶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::KoraLeaderboardResponse`"))), + 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::KoraLeaderboardResponse`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns the all-time rewards earned by users including Kora CC and points. +pub async fn get_kora_rewards_summary(configuration: &configuration::Configuration, ) -> Result, Error> { + + let uri_str = format!("{}/v1/kora/rewards/summary", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + if let Some(ref user_agent) = configuration.user_agent { + req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); + } + if let Some(ref token) = configuration.bearer_access_token { + req_builder = req_builder.bearer_auth(token.to_owned()); + }; + + 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 `Vec<models::KoraRewardsSummary>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraRewardsSummary>`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + +/// Returns the health status of the Kora rewards service. +pub async fn kora_health_check(configuration: &configuration::Configuration, ) -> Result> { + + let uri_str = format!("{}/v1/kora/health", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + 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::KoraHealthCheck200Response`"))), + 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::KoraHealthCheck200Response`")))), + } + } else { + let content = resp.text().await?; + let entity: Option = serde_json::from_str(&content).ok(); + Err(Error::ResponseError(ResponseContent { status, content, entity })) + } +} + diff --git a/rust/gen/bluefin_api/src/apis/mod.rs b/rust/gen/bluefin_api/src/apis/mod.rs index ac5de8d9..46f31a69 100644 --- a/rust/gen/bluefin_api/src/apis/mod.rs +++ b/rust/gen/bluefin_api/src/apis/mod.rs @@ -114,6 +114,7 @@ impl From<&str> for ContentType { pub mod account_data_api; pub mod auth_api; pub mod exchange_api; +pub mod kora_api; pub mod rewards_api; pub mod streams_api; pub mod trade_api; diff --git a/rust/gen/bluefin_api/src/models/kora_campaign_bonus.rs b/rust/gen/bluefin_api/src/models/kora_campaign_bonus.rs new file mode 100644 index 00000000..3a42ab37 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_campaign_bonus.rs @@ -0,0 +1,40 @@ +/* + * 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 KoraCampaignBonus { + /// Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) + #[serde(rename = "bonusType", skip_serializing_if = "Option::is_none")] + pub bonus_type: Option, + /// CC reward amount for this bonus + #[serde(rename = "bonusCcReward", skip_serializing_if = "Option::is_none")] + pub bonus_cc_reward: Option, + /// Points earned for this bonus + #[serde(rename = "bonusPoints", skip_serializing_if = "Option::is_none")] + pub bonus_points: Option, + /// Criteria that was met for earning this bonus + #[serde(rename = "bonusCriteria", skip_serializing_if = "Option::is_none")] + pub bonus_criteria: Option, +} + +impl KoraCampaignBonus { + pub fn new() -> KoraCampaignBonus { + KoraCampaignBonus { + bonus_type: None, + bonus_cc_reward: None, + bonus_points: None, + bonus_criteria: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_campaign_metadata.rs b/rust/gen/bluefin_api/src/models/kora_campaign_metadata.rs new file mode 100644 index 00000000..2ecdd03a --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_campaign_metadata.rs @@ -0,0 +1,57 @@ +/* + * 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 KoraCampaignMetadata { + #[serde(rename = "status")] + pub status: Status, + /// Name of the campaign + #[serde(rename = "campaignName")] + pub campaign_name: String, + /// Name of the parent campaign + #[serde(rename = "parentCampaignName", skip_serializing_if = "Option::is_none")] + pub parent_campaign_name: Option, + /// Time in milliseconds for campaign start date + #[serde(rename = "startDate")] + pub start_date: i32, + /// Time in milliseconds for campaign end date + #[serde(rename = "endDate")] + pub end_date: i32, +} + +impl KoraCampaignMetadata { + pub fn new(status: Status, campaign_name: String, start_date: i32, end_date: i32) -> KoraCampaignMetadata { + KoraCampaignMetadata { + status, + campaign_name, + parent_campaign_name: None, + start_date, + end_date, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "INACTIVE")] + Inactive, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_campaign_rewards.rs b/rust/gen/bluefin_api/src/models/kora_campaign_rewards.rs new file mode 100644 index 00000000..ad2ce9d0 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_campaign_rewards.rs @@ -0,0 +1,135 @@ +/* + * 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 KoraCampaignRewards { + /// User address for the rewards earned data + #[serde(rename = "userAddress")] + pub user_address: String, + /// Name of the campaign + #[serde(rename = "campaignName")] + pub campaign_name: String, + /// Epoch number for the rewards earned data + #[serde(rename = "epochNumber")] + pub epoch_number: i32, + /// Interval number for the rewards earned data + #[serde(rename = "intervalNumber")] + pub interval_number: i32, + /// Market Symbol + #[serde(rename = "symbol", skip_serializing_if = "Option::is_none")] + pub symbol: Option, + #[serde(rename = "status")] + pub status: Status, + /// Total blue token rewards + #[serde(rename = "blueRewards", skip_serializing_if = "Option::is_none")] + pub blue_rewards: Option, + /// Total sui token rewards + #[serde(rename = "suiRewards", skip_serializing_if = "Option::is_none")] + pub sui_rewards: Option, + /// Total wal rewards + #[serde(rename = "walRewards", skip_serializing_if = "Option::is_none")] + pub wal_rewards: Option, + /// Total cash rewards + #[serde(rename = "cashRewards", skip_serializing_if = "Option::is_none")] + pub cash_rewards: Option, + /// Total CC token rewards + #[serde(rename = "ccRewards", skip_serializing_if = "Option::is_none")] + pub cc_rewards: Option, + /// Total Kora points earned + #[serde(rename = "koraPoints", skip_serializing_if = "Option::is_none")] + pub kora_points: Option, + /// Total user fee paid + #[serde(rename = "userFeePaid", skip_serializing_if = "Option::is_none")] + pub user_fee_paid: Option, + /// Time in milliseconds for interval start date + #[serde(rename = "intervalStartDate", skip_serializing_if = "Option::is_none")] + pub interval_start_date: Option, + /// Time in milliseconds for interval end date + #[serde(rename = "intervalEndDate", skip_serializing_if = "Option::is_none")] + pub interval_end_date: Option, + /// Indicates if rewards have been disbursed + #[serde(rename = "isDisbursed", skip_serializing_if = "Option::is_none")] + pub is_disbursed: Option, + /// Transaction digest of the disbursement + #[serde(rename = "txnDigest", skip_serializing_if = "Option::is_none")] + pub txn_digest: Option, + /// Status of the claim + #[serde(rename = "claimStatus", skip_serializing_if = "Option::is_none")] + pub claim_status: Option, + /// List of bonuses attached to this reward entry + #[serde(rename = "bonuses", skip_serializing_if = "Option::is_none")] + pub bonuses: Option>, +} + +impl KoraCampaignRewards { + pub fn new(user_address: String, campaign_name: String, epoch_number: i32, interval_number: i32, status: Status) -> KoraCampaignRewards { + KoraCampaignRewards { + user_address, + campaign_name, + epoch_number, + interval_number, + symbol: None, + status, + blue_rewards: None, + sui_rewards: None, + wal_rewards: None, + cash_rewards: None, + cc_rewards: None, + kora_points: None, + user_fee_paid: None, + interval_start_date: None, + interval_end_date: None, + is_disbursed: None, + txn_digest: None, + claim_status: None, + bonuses: None, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "FINALIZED")] + Finalized, + #[serde(rename = "COOLDOWN")] + Cooldown, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} +/// Status of the claim +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum ClaimStatus { + #[serde(rename = "CLAIMABLE")] + Claimable, + #[serde(rename = "CLAIMED")] + Claimed, + #[serde(rename = "NOT_YET_CLAIMABLE")] + NotYetClaimable, + #[serde(rename = "CLAIM_ENDED")] + ClaimEnded, +} + +impl Default for ClaimStatus { + fn default() -> ClaimStatus { + Self::Claimable + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_epoch_config.rs b/rust/gen/bluefin_api/src/models/kora_epoch_config.rs new file mode 100644 index 00000000..12b1e484 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_epoch_config.rs @@ -0,0 +1,64 @@ +/* + * 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 KoraEpochConfig { + /// The name of the campaign + #[serde(rename = "campaignName")] + pub campaign_name: String, + /// Duration of the epoch in hours + #[serde(rename = "epochDuration")] + pub epoch_duration: i32, + /// Allocation of Sui rewards for this epoch + #[serde(rename = "suiRewardsAllocation", skip_serializing_if = "Option::is_none")] + pub sui_rewards_allocation: Option, + /// Allocation of Blue rewards for this epoch + #[serde(rename = "blueRewardsAllocation", skip_serializing_if = "Option::is_none")] + pub blue_rewards_allocation: Option, + /// Allocation of Wal rewards for this epoch + #[serde(rename = "walRewardsAllocation", skip_serializing_if = "Option::is_none")] + pub wal_rewards_allocation: Option, + /// Allocation of CC token rewards for this epoch + #[serde(rename = "ccRewardsAllocation", skip_serializing_if = "Option::is_none")] + pub cc_rewards_allocation: Option, + /// Allocation of Kora points rewards for this epoch + #[serde(rename = "koraPointsRewardsAllocation", skip_serializing_if = "Option::is_none")] + pub kora_points_rewards_allocation: Option, + /// Interval number for the epoch + #[serde(rename = "intervalNumber")] + pub interval_number: i32, + /// Epoch number + #[serde(rename = "epochNumber")] + pub epoch_number: i32, + /// Additional campaign-specific configurations + #[serde(rename = "config", skip_serializing_if = "Option::is_none")] + pub config: Option>, +} + +impl KoraEpochConfig { + pub fn new(campaign_name: String, epoch_duration: i32, interval_number: i32, epoch_number: i32) -> KoraEpochConfig { + KoraEpochConfig { + campaign_name, + epoch_duration, + sui_rewards_allocation: None, + blue_rewards_allocation: None, + wal_rewards_allocation: None, + cc_rewards_allocation: None, + kora_points_rewards_allocation: None, + interval_number, + epoch_number, + config: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_epoch_config_response.rs b/rust/gen/bluefin_api/src/models/kora_epoch_config_response.rs new file mode 100644 index 00000000..2a2d1e1f --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_epoch_config_response.rs @@ -0,0 +1,35 @@ +/* + * 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 KoraEpochConfigResponse { + /// The maximum interval number available + #[serde(rename = "maxIntervalNumber")] + pub max_interval_number: i32, + /// The current interval number being queried + #[serde(rename = "intervalNumber")] + pub interval_number: i32, + #[serde(rename = "data")] + pub data: Vec, +} + +impl KoraEpochConfigResponse { + pub fn new(max_interval_number: i32, interval_number: i32, data: Vec) -> KoraEpochConfigResponse { + KoraEpochConfigResponse { + max_interval_number, + interval_number, + data, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_epoch_metadata.rs b/rust/gen/bluefin_api/src/models/kora_epoch_metadata.rs new file mode 100644 index 00000000..aa53d27f --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_epoch_metadata.rs @@ -0,0 +1,65 @@ +/* + * 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 KoraEpochMetadata { + #[serde(rename = "status")] + pub status: Status, + /// Name of the campaign + #[serde(rename = "campaignName")] + pub campaign_name: String, + /// Epoch ID + #[serde(rename = "epochId")] + pub epoch_id: uuid::Uuid, + /// Epoch number + #[serde(rename = "epochNumber")] + pub epoch_number: i32, + /// Time in milliseconds for epoch start date + #[serde(rename = "startDate")] + pub start_date: i32, + /// Time in milliseconds for epoch end date + #[serde(rename = "endDate")] + pub end_date: i32, +} + +impl KoraEpochMetadata { + pub fn new(status: Status, campaign_name: String, epoch_id: uuid::Uuid, epoch_number: i32, start_date: i32, end_date: i32) -> KoraEpochMetadata { + KoraEpochMetadata { + status, + campaign_name, + epoch_id, + epoch_number, + start_date, + end_date, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "FINALIZED")] + Finalized, + #[serde(rename = "COOLDOWN")] + Cooldown, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_health_check_200_response.rs b/rust/gen/bluefin_api/src/models/kora_health_check_200_response.rs new file mode 100644 index 00000000..3606f987 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_health_check_200_response.rs @@ -0,0 +1,30 @@ +/* + * 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 KoraHealthCheck200Response { + #[serde(rename = "status", skip_serializing_if = "Option::is_none")] + pub status: Option, + #[serde(rename = "timestamp", skip_serializing_if = "Option::is_none")] + pub timestamp: Option, +} + +impl KoraHealthCheck200Response { + pub fn new() -> KoraHealthCheck200Response { + KoraHealthCheck200Response { + status: None, + timestamp: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_interval_metadata.rs b/rust/gen/bluefin_api/src/models/kora_interval_metadata.rs new file mode 100644 index 00000000..ea0b60b5 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_interval_metadata.rs @@ -0,0 +1,79 @@ +/* + * 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 KoraIntervalMetadata { + #[serde(rename = "status")] + pub status: Status, + /// Time in milliseconds for interval start date + #[serde(rename = "startDate")] + pub start_date: i32, + /// Time in milliseconds for interval end date + #[serde(rename = "endDate")] + pub end_date: i32, + /// Interval ID + #[serde(rename = "intervalId")] + pub interval_id: i32, + /// Type of the interval + #[serde(rename = "intervalType", skip_serializing_if = "Option::is_none")] + pub interval_type: Option, + /// Protocol for the interval + #[serde(rename = "protocol", skip_serializing_if = "Option::is_none")] + pub protocol: Option, +} + +impl KoraIntervalMetadata { + pub fn new(status: Status, start_date: i32, end_date: i32, interval_id: i32) -> KoraIntervalMetadata { + KoraIntervalMetadata { + status, + start_date, + end_date, + interval_id, + interval_type: None, + protocol: None, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "ACTIVE")] + Active, + #[serde(rename = "NOT_STARTED")] + NotStarted, + #[serde(rename = "FINALIZED")] + Finalized, + #[serde(rename = "COOLDOWN")] + Cooldown, +} + +impl Default for Status { + fn default() -> Status { + Self::Active + } +} +/// Protocol for the interval +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Protocol { + #[serde(rename = "bluefin")] + Bluefin, + #[serde(rename = "kora")] + Kora, +} + +impl Default for Protocol { + fn default() -> Protocol { + Self::Bluefin + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_leaderboard_entry.rs b/rust/gen/bluefin_api/src/models/kora_leaderboard_entry.rs new file mode 100644 index 00000000..de05972a --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_leaderboard_entry.rs @@ -0,0 +1,76 @@ +/* + * 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 KoraLeaderboardEntry { + /// Overall ranking position based on sortBy parameter + #[serde(rename = "rank")] + pub rank: i32, + /// Wallet address of the user + #[serde(rename = "userAddress")] + pub user_address: String, + /// Total swap volume (USD equivalent) + #[serde(rename = "totalVolumeE6")] + pub total_volume_e6: String, + /// Total fees paid + #[serde(rename = "totalFeeE6", skip_serializing_if = "Option::is_none")] + pub total_fee_e6: Option, + /// Total number of qualifying swap transactions + #[serde(rename = "totalTransactions")] + pub total_transactions: i32, + /// CC token rewards earned + #[serde(rename = "ccRewards")] + pub cc_rewards: String, + /// Kora points earned + #[serde(rename = "koraPoints")] + pub kora_points: String, + /// Total bonus points earned + #[serde(rename = "totalBonusPoints", skip_serializing_if = "Option::is_none")] + pub total_bonus_points: Option, + /// Total bonus CC tokens earned + #[serde(rename = "totalBonusCC", skip_serializing_if = "Option::is_none")] + pub total_bonus_cc: Option, + /// Ranking based purely on trading volume + #[serde(rename = "volumeRank", skip_serializing_if = "Option::is_none")] + pub volume_rank: Option, + /// Ranking based purely on transaction count + #[serde(rename = "transactionRank", skip_serializing_if = "Option::is_none")] + pub transaction_rank: Option, + /// Ranking based on combined CC + Kora points value + #[serde(rename = "totalEarningsRank", skip_serializing_if = "Option::is_none")] + pub total_earnings_rank: Option, + /// Timestamp of user's most recent swap (milliseconds) + #[serde(rename = "lastActivityDate", skip_serializing_if = "Option::is_none")] + pub last_activity_date: Option, +} + +impl KoraLeaderboardEntry { + pub fn new(rank: i32, user_address: String, total_volume_e6: String, total_transactions: i32, cc_rewards: String, kora_points: String) -> KoraLeaderboardEntry { + KoraLeaderboardEntry { + rank, + user_address, + total_volume_e6, + total_fee_e6: None, + total_transactions, + cc_rewards, + kora_points, + total_bonus_points: None, + total_bonus_cc: None, + volume_rank: None, + transaction_rank: None, + total_earnings_rank: None, + last_activity_date: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_leaderboard_response.rs b/rust/gen/bluefin_api/src/models/kora_leaderboard_response.rs new file mode 100644 index 00000000..36dea29d --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_leaderboard_response.rs @@ -0,0 +1,39 @@ +/* + * 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 KoraLeaderboardResponse { + #[serde(rename = "data")] + pub data: Vec, + /// Total number of records + #[serde(rename = "total")] + pub total: i32, + /// Page size for pagination + #[serde(rename = "limit")] + pub limit: i32, + /// Current page number + #[serde(rename = "page")] + pub page: i32, +} + +impl KoraLeaderboardResponse { + pub fn new(data: Vec, total: i32, limit: i32, page: i32) -> KoraLeaderboardResponse { + KoraLeaderboardResponse { + data, + total, + limit, + page, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_rewards_summary.rs b/rust/gen/bluefin_api/src/models/kora_rewards_summary.rs new file mode 100644 index 00000000..80f84cbb --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_rewards_summary.rs @@ -0,0 +1,48 @@ +/* + * 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 KoraRewardsSummary { + /// User address for the rewards earned data + #[serde(rename = "userAddress")] + pub user_address: String, + /// Total Blue token rewards earned + #[serde(rename = "blueRewards", skip_serializing_if = "Option::is_none")] + pub blue_rewards: Option, + /// Total Sui token rewards earned + #[serde(rename = "suiRewards", skip_serializing_if = "Option::is_none")] + pub sui_rewards: Option, + /// Total wal rewards earned + #[serde(rename = "walRewards", skip_serializing_if = "Option::is_none")] + pub wal_rewards: Option, + /// Total CC token rewards earned across all Kora campaigns + #[serde(rename = "ccRewards", skip_serializing_if = "Option::is_none")] + pub cc_rewards: Option, + /// Total Kora points earned across all Kora campaigns + #[serde(rename = "koraPoints", skip_serializing_if = "Option::is_none")] + pub kora_points: Option, +} + +impl KoraRewardsSummary { + pub fn new(user_address: String) -> KoraRewardsSummary { + KoraRewardsSummary { + user_address, + blue_rewards: None, + sui_rewards: None, + wal_rewards: None, + cc_rewards: None, + kora_points: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/mod.rs b/rust/gen/bluefin_api/src/models/mod.rs index bf58f9c6..27795151 100644 --- a/rust/gen/bluefin_api/src/models/mod.rs +++ b/rust/gen/bluefin_api/src/models/mod.rs @@ -132,6 +132,28 @@ pub mod iss_base64_details; pub use self::iss_base64_details::IssBase64Details; pub mod kline_interval; pub use self::kline_interval::KlineInterval; +pub mod kora_campaign_bonus; +pub use self::kora_campaign_bonus::KoraCampaignBonus; +pub mod kora_campaign_metadata; +pub use self::kora_campaign_metadata::KoraCampaignMetadata; +pub mod kora_campaign_rewards; +pub use self::kora_campaign_rewards::KoraCampaignRewards; +pub mod kora_epoch_config; +pub use self::kora_epoch_config::KoraEpochConfig; +pub mod kora_epoch_config_response; +pub use self::kora_epoch_config_response::KoraEpochConfigResponse; +pub mod kora_epoch_metadata; +pub use self::kora_epoch_metadata::KoraEpochMetadata; +pub mod kora_health_check_200_response; +pub use self::kora_health_check_200_response::KoraHealthCheck200Response; +pub mod kora_interval_metadata; +pub use self::kora_interval_metadata::KoraIntervalMetadata; +pub mod kora_leaderboard_entry; +pub use self::kora_leaderboard_entry::KoraLeaderboardEntry; +pub mod kora_leaderboard_response; +pub use self::kora_leaderboard_response::KoraLeaderboardResponse; +pub mod kora_rewards_summary; +pub use self::kora_rewards_summary::KoraRewardsSummary; pub mod leaderboard_entry; pub use self::leaderboard_entry::LeaderboardEntry; pub mod leaderboard_interval; diff --git a/ts/sdk/package.json b/ts/sdk/package.json index a167a442..8e18c5ab 100644 --- a/ts/sdk/package.json +++ b/ts/sdk/package.json @@ -51,5 +51,5 @@ "prepare": "npm run build" }, "types": "./dist/types/index.d.ts", - "version": "1.10.0" + "version": "1.11.0" } \ No newline at end of file diff --git a/ts/sdk/src/.openapi-generator/FILES b/ts/sdk/src/.openapi-generator/FILES index 51d10d9b..1056bb94 100644 --- a/ts/sdk/src/.openapi-generator/FILES +++ b/ts/sdk/src/.openapi-generator/FILES @@ -74,6 +74,18 @@ docs/IntervalMetadata.md docs/IntervalRewards.md docs/IssBase64Details.md docs/KlineInterval.md +docs/KoraApi.md +docs/KoraCampaignBonus.md +docs/KoraCampaignMetadata.md +docs/KoraCampaignRewards.md +docs/KoraEpochConfig.md +docs/KoraEpochConfigResponse.md +docs/KoraEpochMetadata.md +docs/KoraHealthCheck200Response.md +docs/KoraIntervalMetadata.md +docs/KoraLeaderboardEntry.md +docs/KoraLeaderboardResponse.md +docs/KoraRewardsSummary.md docs/LeaderboardEntry.md docs/LeaderboardInterval.md docs/LeaderboardResponse.md diff --git a/ts/sdk/src/api.ts b/ts/sdk/src/api.ts index 300fa006..23b5158c 100644 --- a/ts/sdk/src/api.ts +++ b/ts/sdk/src/api.ts @@ -2816,2928 +2816,4092 @@ export type KlineInterval = typeof KlineInterval[keyof typeof KlineInterval]; /** * * @export - * @interface LeaderboardEntry + * @interface KoraCampaignBonus */ -export interface LeaderboardEntry { - /** - * Rank of the trader in the leaderboard. - * @type {number} - * @memberof LeaderboardEntry - */ - 'rank': number; +export interface KoraCampaignBonus { /** - * The address of the account. + * Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) * @type {string} - * @memberof LeaderboardEntry + * @memberof KoraCampaignBonus */ - 'accountAddress': string; + 'bonusType'?: string; /** - * Total account value of the trader in e9 format. + * CC reward amount for this bonus * @type {string} - * @memberof LeaderboardEntry + * @memberof KoraCampaignBonus */ - 'accountValueE9': string; + 'bonusCcReward'?: string; /** - * Total profit and loss of the trader in e9 format. + * Points earned for this bonus * @type {string} - * @memberof LeaderboardEntry + * @memberof KoraCampaignBonus */ - 'pnlE9': string; + 'bonusPoints'?: string; /** - * Total trading volume of the trader in e9 format. + * Criteria that was met for earning this bonus * @type {string} - * @memberof LeaderboardEntry + * @memberof KoraCampaignBonus */ - 'volumeE9': string; + 'bonusCriteria'?: string; } /** * * @export - * @enum {string} + * @interface KoraCampaignMetadata */ +export interface KoraCampaignMetadata { + /** + * + * @type {string} + * @memberof KoraCampaignMetadata + */ + 'status': KoraCampaignMetadataStatusEnum; + /** + * Name of the campaign + * @type {string} + * @memberof KoraCampaignMetadata + */ + 'campaignName': string; + /** + * Name of the parent campaign + * @type {string} + * @memberof KoraCampaignMetadata + */ + 'parentCampaignName'?: string; + /** + * Time in milliseconds for campaign start date + * @type {number} + * @memberof KoraCampaignMetadata + */ + 'startDate': number; + /** + * Time in milliseconds for campaign end date + * @type {number} + * @memberof KoraCampaignMetadata + */ + 'endDate': number; +} -export const LeaderboardInterval = { - LeaderboardIntervalN1d: '1d', - LeaderboardIntervalN7d: '7d', - LeaderboardIntervalN30d: '30d', - LeaderboardIntervalALLTIME: 'ALL_TIME', - LeaderboardIntervalUNSPECIFIED: 'UNSPECIFIED' +export const KoraCampaignMetadataStatusEnum = { + Active: 'ACTIVE', + Inactive: 'INACTIVE' } as const; -export type LeaderboardInterval = typeof LeaderboardInterval[keyof typeof LeaderboardInterval]; - +export type KoraCampaignMetadataStatusEnum = typeof KoraCampaignMetadataStatusEnum[keyof typeof KoraCampaignMetadataStatusEnum]; /** * * @export - * @interface LeaderboardResponse + * @interface KoraCampaignRewards */ -export interface LeaderboardResponse { +export interface KoraCampaignRewards { /** - * - * @type {Array} - * @memberof LeaderboardResponse + * User address for the rewards earned data + * @type {string} + * @memberof KoraCampaignRewards */ - 'data': Array; -} -/** - * User is expected to sign this payload and sends is signature in login api as header and payload itself in request body - * @export - * @interface LoginRequest - */ -export interface LoginRequest { + 'userAddress': string; /** - * The address of the account. + * Name of the campaign * @type {string} - * @memberof LoginRequest + * @memberof KoraCampaignRewards */ - 'accountAddress': string; + 'campaignName': string; /** - * The timestamp in millis when the login was signed. + * Epoch number for the rewards earned data * @type {number} - * @memberof LoginRequest + * @memberof KoraCampaignRewards */ - 'signedAtMillis': number; + 'epochNumber': number; /** - * The intended audience of the login request. + * Interval number for the rewards earned data + * @type {number} + * @memberof KoraCampaignRewards + */ + 'intervalNumber': number; + /** + * Market Symbol * @type {string} - * @memberof LoginRequest + * @memberof KoraCampaignRewards */ - 'audience': string; -} -/** - * - * @export - * @interface LoginResponse - */ -export interface LoginResponse { + 'symbol'?: string; /** * * @type {string} - * @memberof LoginResponse + * @memberof KoraCampaignRewards */ - 'accessToken': string; + 'status': KoraCampaignRewardsStatusEnum; /** - * - * @type {number} - * @memberof LoginResponse + * Total blue token rewards + * @type {string} + * @memberof KoraCampaignRewards */ - 'accessTokenValidForSeconds': number; + 'blueRewards'?: string; /** - * + * Total sui token rewards * @type {string} - * @memberof LoginResponse + * @memberof KoraCampaignRewards */ - 'refreshToken': string; + 'suiRewards'?: string; /** - * + * Total wal rewards + * @type {string} + * @memberof KoraCampaignRewards + */ + 'walRewards'?: string; + /** + * Total cash rewards + * @type {string} + * @memberof KoraCampaignRewards + */ + 'cashRewards'?: string; + /** + * Total CC token rewards + * @type {string} + * @memberof KoraCampaignRewards + */ + 'ccRewards'?: string; + /** + * Total Kora points earned + * @type {string} + * @memberof KoraCampaignRewards + */ + 'koraPoints'?: string; + /** + * Total user fee paid + * @type {string} + * @memberof KoraCampaignRewards + */ + 'userFeePaid'?: string; + /** + * Time in milliseconds for interval start date * @type {number} - * @memberof LoginResponse + * @memberof KoraCampaignRewards */ - 'refreshTokenValidForSeconds': number; + 'intervalStartDate'?: number; + /** + * Time in milliseconds for interval end date + * @type {number} + * @memberof KoraCampaignRewards + */ + 'intervalEndDate'?: number; + /** + * Indicates if rewards have been disbursed + * @type {boolean} + * @memberof KoraCampaignRewards + */ + 'isDisbursed'?: boolean; + /** + * Transaction digest of the disbursement + * @type {string} + * @memberof KoraCampaignRewards + */ + 'txnDigest'?: string; + /** + * Status of the claim + * @type {string} + * @memberof KoraCampaignRewards + */ + 'claimStatus'?: KoraCampaignRewardsClaimStatusEnum; + /** + * List of bonuses attached to this reward entry + * @type {Array} + * @memberof KoraCampaignRewards + */ + 'bonuses'?: Array; } -/** - * Margin type. - * @export - * @enum {string} - */ -export const MarginType = { - Cross: 'CROSS', - Isolated: 'ISOLATED', - Unspecified: 'UNSPECIFIED' +export const KoraCampaignRewardsStatusEnum = { + Active: 'ACTIVE', + NotStarted: 'NOT_STARTED', + Finalized: 'FINALIZED', + Cooldown: 'COOLDOWN' } as const; -export type MarginType = typeof MarginType[keyof typeof MarginType]; +export type KoraCampaignRewardsStatusEnum = typeof KoraCampaignRewardsStatusEnum[keyof typeof KoraCampaignRewardsStatusEnum]; +export const KoraCampaignRewardsClaimStatusEnum = { + Claimable: 'CLAIMABLE', + Claimed: 'CLAIMED', + NotYetClaimable: 'NOT_YET_CLAIMABLE', + ClaimEnded: 'CLAIM_ENDED' +} as const; +export type KoraCampaignRewardsClaimStatusEnum = typeof KoraCampaignRewardsClaimStatusEnum[keyof typeof KoraCampaignRewardsClaimStatusEnum]; /** * * @export - * @interface MarkAsClaimedRequest + * @interface KoraEpochConfig */ -export interface MarkAsClaimedRequest { +export interface KoraEpochConfig { /** - * The interval number + * The name of the campaign + * @type {string} + * @memberof KoraEpochConfig + */ + 'campaignName': string; + /** + * Duration of the epoch in hours * @type {number} - * @memberof MarkAsClaimedRequest + * @memberof KoraEpochConfig */ - 'intervalNumber': number; + 'epochDuration': number; /** - * The campaign name + * Allocation of Sui rewards for this epoch * @type {string} - * @memberof MarkAsClaimedRequest + * @memberof KoraEpochConfig */ - 'campaignName': MarkAsClaimedRequestCampaignNameEnum; + 'suiRewardsAllocation'?: string; /** - * The transaction digest of the claim + * Allocation of Blue rewards for this epoch * @type {string} - * @memberof MarkAsClaimedRequest + * @memberof KoraEpochConfig */ - 'txnDigest': string; + 'blueRewardsAllocation'?: string; + /** + * Allocation of Wal rewards for this epoch + * @type {string} + * @memberof KoraEpochConfig + */ + 'walRewardsAllocation'?: string; + /** + * Allocation of CC token rewards for this epoch + * @type {string} + * @memberof KoraEpochConfig + */ + 'ccRewardsAllocation'?: string; + /** + * Allocation of Kora points rewards for this epoch + * @type {string} + * @memberof KoraEpochConfig + */ + 'koraPointsRewardsAllocation'?: string; + /** + * Interval number for the epoch + * @type {number} + * @memberof KoraEpochConfig + */ + 'intervalNumber': number; + /** + * Epoch number + * @type {number} + * @memberof KoraEpochConfig + */ + 'epochNumber': number; + /** + * Additional campaign-specific configurations + * @type {{ [key: string]: any | undefined; }} + * @memberof KoraEpochConfig + */ + 'config'?: { [key: string]: any | undefined; }; } - -export const MarkAsClaimedRequestCampaignNameEnum = { - TradeAndEarn: 'TRADE_AND_EARN', - WalTradeAndEarn: 'WAL_TRADE_AND_EARN', - Affiliate: 'AFFILIATE' -} as const; - -export type MarkAsClaimedRequestCampaignNameEnum = typeof MarkAsClaimedRequestCampaignNameEnum[keyof typeof MarkAsClaimedRequestCampaignNameEnum]; - /** * * @export - * @interface MarkAsClaimedResponse + * @interface KoraEpochConfigResponse */ -export interface MarkAsClaimedResponse { +export interface KoraEpochConfigResponse { /** - * Response message indicating if the claim was marked as claimed successfully - * @type {string} - * @memberof MarkAsClaimedResponse + * The maximum interval number available + * @type {number} + * @memberof KoraEpochConfigResponse */ - 'message': string; + 'maxIntervalNumber': number; /** - * Status of the claim - * @type {string} - * @memberof MarkAsClaimedResponse + * The current interval number being queried + * @type {number} + * @memberof KoraEpochConfigResponse */ - 'status': MarkAsClaimedResponseStatusEnum; + 'intervalNumber': number; + /** + * + * @type {Array} + * @memberof KoraEpochConfigResponse + */ + 'data': Array; } - -export const MarkAsClaimedResponseStatusEnum = { - Claimed: 'CLAIMED', - Claimable: 'CLAIMABLE' -} as const; - -export type MarkAsClaimedResponseStatusEnum = typeof MarkAsClaimedResponseStatusEnum[keyof typeof MarkAsClaimedResponseStatusEnum]; - /** * * @export - * @interface MarkPriceUpdate + * @interface KoraEpochMetadata */ -export interface MarkPriceUpdate { +export interface KoraEpochMetadata { /** - * The symbol of the market. + * * @type {string} - * @memberof MarkPriceUpdate + * @memberof KoraEpochMetadata */ - 'symbol': string; + 'status': KoraEpochMetadataStatusEnum; /** - * The price in scientific notation with 9 decimal places of precision. + * Name of the campaign * @type {string} - * @memberof MarkPriceUpdate + * @memberof KoraEpochMetadata */ - 'priceE9': string; + 'campaignName': string; /** - * + * Epoch ID * @type {string} - * @memberof MarkPriceUpdate + * @memberof KoraEpochMetadata */ - 'source': MarkPriceUpdateSourceEnum; + 'epochId': string; /** - * The timestamp of the price update. + * Epoch number * @type {number} - * @memberof MarkPriceUpdate + * @memberof KoraEpochMetadata */ - 'updatedAtMillis': number; + 'epochNumber': number; + /** + * Time in milliseconds for epoch start date + * @type {number} + * @memberof KoraEpochMetadata + */ + 'startDate': number; + /** + * Time in milliseconds for epoch end date + * @type {number} + * @memberof KoraEpochMetadata + */ + 'endDate': number; } -export const MarkPriceUpdateSourceEnum = { - Mark: 'Mark' +export const KoraEpochMetadataStatusEnum = { + Active: 'ACTIVE', + NotStarted: 'NOT_STARTED', + Finalized: 'FINALIZED', + Cooldown: 'COOLDOWN' } as const; -export type MarkPriceUpdateSourceEnum = typeof MarkPriceUpdateSourceEnum[keyof typeof MarkPriceUpdateSourceEnum]; +export type KoraEpochMetadataStatusEnum = typeof KoraEpochMetadataStatusEnum[keyof typeof KoraEpochMetadataStatusEnum]; /** * * @export - * @interface Market + * @interface KoraHealthCheck200Response */ -export interface Market { +export interface KoraHealthCheck200Response { /** - * Symbol of the market. + * * @type {string} - * @memberof Market + * @memberof KoraHealthCheck200Response */ - 'symbol': string; + 'status'?: string; /** - * Market address. - * @type {string} - * @memberof Market + * + * @type {number} + * @memberof KoraHealthCheck200Response */ - 'marketAddress': string; + 'timestamp'?: number; +} +/** + * + * @export + * @interface KoraIntervalMetadata + */ +export interface KoraIntervalMetadata { /** * - * @type {MarketStatus} - * @memberof Market + * @type {string} + * @memberof KoraIntervalMetadata */ - 'status': MarketStatus; + 'status': KoraIntervalMetadataStatusEnum; /** - * Base asset symbol. - * @type {string} - * @memberof Market + * Time in milliseconds for interval start date + * @type {number} + * @memberof KoraIntervalMetadata */ - 'baseAssetSymbol': string; + 'startDate': number; /** - * Base asset name. - * @type {string} - * @memberof Market + * Time in milliseconds for interval end date + * @type {number} + * @memberof KoraIntervalMetadata */ - 'baseAssetName': string; + 'endDate': number; /** - * Precision of the base asset. + * Interval ID * @type {number} - * @memberof Market + * @memberof KoraIntervalMetadata */ - 'baseAssetDecimals': number; + 'intervalId': number; /** - * Step size for the quantity (e9 format). + * Type of the interval * @type {string} - * @memberof Market + * @memberof KoraIntervalMetadata */ - 'stepSizeE9': string; + 'intervalType'?: string; /** - * Price increment size (e9 format). + * Protocol for the interval * @type {string} - * @memberof Market + * @memberof KoraIntervalMetadata */ - 'tickSizeE9': string; + 'protocol'?: KoraIntervalMetadataProtocolEnum; +} + +export const KoraIntervalMetadataStatusEnum = { + Active: 'ACTIVE', + NotStarted: 'NOT_STARTED', + Finalized: 'FINALIZED', + Cooldown: 'COOLDOWN' +} as const; + +export type KoraIntervalMetadataStatusEnum = typeof KoraIntervalMetadataStatusEnum[keyof typeof KoraIntervalMetadataStatusEnum]; +export const KoraIntervalMetadataProtocolEnum = { + Bluefin: 'bluefin', + Kora: 'kora' +} as const; + +export type KoraIntervalMetadataProtocolEnum = typeof KoraIntervalMetadataProtocolEnum[keyof typeof KoraIntervalMetadataProtocolEnum]; + +/** + * + * @export + * @interface KoraLeaderboardEntry + */ +export interface KoraLeaderboardEntry { /** - * Minimum order size (e9 format). - * @type {string} - * @memberof Market + * Overall ranking position based on sortBy parameter + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'minOrderQuantityE9': string; + 'rank': number; /** - * Maximum limit order size (e9 format). + * Wallet address of the user * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'maxLimitOrderQuantityE9': string; + 'userAddress': string; /** - * Maximum market order size (e9 format). + * Total swap volume (USD equivalent) * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'maxMarketOrderQuantityE9': string; + 'totalVolumeE6': string; /** - * Minimum order price (e9 format). + * Total fees paid * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'minOrderPriceE9': string; + 'totalFeeE6'?: string; /** - * Maximum order price (e9 format). - * @type {string} - * @memberof Market + * Total number of qualifying swap transactions + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'maxOrderPriceE9': string; + 'totalTransactions': number; /** - * Maintenance margin ratio (MMR, e9 format). + * CC token rewards earned * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'maintenanceMarginRatioE9': string; + 'ccRewards': string; /** - * Initial margin ratio (IMR), e9 format). + * Kora points earned * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'initialMarginRatioE9': string; + 'koraPoints': string; /** - * Insurance pool ratio (e9 format). + * Total bonus points earned * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'insurancePoolRatioE9': string; + 'totalBonusPoints'?: string; /** - * Default leverage (e9 format). + * Total bonus CC tokens earned * @type {string} - * @memberof Market + * @memberof KoraLeaderboardEntry */ - 'defaultLeverageE9': string; + 'totalBonusCC'?: string; /** - * Maximum notional value at current leverage. Index 0 is max notional value for leverage set to 1x, index 1 is for leverage 2x, etc... - * @type {Array} - * @memberof Market + * Ranking based purely on trading volume + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'maxNotionalAtOpenE9': Array; + 'volumeRank'?: number; /** - * Minimum trade quantity allowed (e9 format). - * @type {string} - * @memberof Market + * Ranking based purely on transaction count + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'minTradeQuantityE9': string; + 'transactionRank'?: number; /** - * Max trade quantity allowed (e9 format). - * @type {string} - * @memberof Market + * Ranking based on combined CC + Kora points value + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'maxTradeQuantityE9': string; + 'totalEarningsRank'?: number; /** - * Minimum trade price allowed (e9 format). - * @type {string} - * @memberof Market + * Timestamp of user\'s most recent swap (milliseconds) + * @type {number} + * @memberof KoraLeaderboardEntry */ - 'minTradePriceE9': string; + 'lastActivityDate'?: number; +} +/** + * + * @export + * @interface KoraLeaderboardResponse + */ +export interface KoraLeaderboardResponse { /** - * Maximum trade price allowed (e9 format). - * @type {string} - * @memberof Market + * + * @type {Array} + * @memberof KoraLeaderboardResponse */ - 'maxTradePriceE9': string; + 'data': Array; /** - * Maximum allowed funding rate (e9 format). + * Total number of records + * @type {number} + * @memberof KoraLeaderboardResponse + */ + 'total': number; + /** + * Page size for pagination + * @type {number} + * @memberof KoraLeaderboardResponse + */ + 'limit': number; + /** + * Current page number + * @type {number} + * @memberof KoraLeaderboardResponse + */ + 'page': number; +} +/** + * + * @export + * @interface KoraRewardsSummary + */ +export interface KoraRewardsSummary { + /** + * User address for the rewards earned data * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'maxFundingRateE9': string; + 'userAddress': string; /** - * Default maker fee (e9 format). + * Total Blue token rewards earned * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'defaultMakerFeeE9': string; + 'blueRewards'?: string; /** - * Default taker fee (e9 format). + * Total Sui token rewards earned * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'defaultTakerFeeE9': string; + 'suiRewards'?: string; /** - * Insurance pool address. + * Total wal rewards earned * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'insurancePoolAddress': string; + 'walRewards'?: string; /** - * Fee pool address. + * Total CC token rewards earned across all Kora campaigns * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'feePoolAddress': string; + 'ccRewards'?: string; /** - * The time when trading will start/have started on the market. + * Total Kora points earned across all Kora campaigns * @type {string} - * @memberof Market + * @memberof KoraRewardsSummary */ - 'tradingStartTimeAtMillis': string; + 'koraPoints'?: string; +} +/** + * + * @export + * @interface LeaderboardEntry + */ +export interface LeaderboardEntry { /** - * Maximum take bound for long positions (e9 format). + * Rank of the trader in the leaderboard. + * @type {number} + * @memberof LeaderboardEntry + */ + 'rank': number; + /** + * The address of the account. * @type {string} - * @memberof Market + * @memberof LeaderboardEntry */ - 'mtbLongE9': string; + 'accountAddress': string; /** - * Maximum take bound for short positions (e9 format). + * Total account value of the trader in e9 format. * @type {string} - * @memberof Market + * @memberof LeaderboardEntry */ - 'mtbShortE9': string; + 'accountValueE9': string; /** - * Delisting price (e9 format). + * Total profit and loss of the trader in e9 format. * @type {string} - * @memberof Market + * @memberof LeaderboardEntry */ - 'delistingPriceE9': string; + 'pnlE9': string; /** - * Indicates whether the market only allows isolated margin. - * @type {boolean} - * @memberof Market + * Total trading volume of the trader in e9 format. + * @type {string} + * @memberof LeaderboardEntry */ - 'isolatedOnly': boolean; + 'volumeE9': string; } - - /** * * @export * @enum {string} */ -export const MarketDataStreamName = { - RecentTrade: 'Recent_Trade', - Ticker: 'Ticker', - TickerAll: 'Ticker_All', - DiffDepth10Ms: 'Diff_Depth_10_ms', - DiffDepth200Ms: 'Diff_Depth_200_ms', - DiffDepth500Ms: 'Diff_Depth_500_ms', - PartialDepth5: 'Partial_Depth_5', - PartialDepth10: 'Partial_Depth_10', - PartialDepth20: 'Partial_Depth_20', - OraclePrice: 'Oracle_Price', - MarkPrice: 'Mark_Price', - MarketPrice: 'Market_Price', - Candlestick1mLast: 'Candlestick_1m_Last', - Candlestick3mLast: 'Candlestick_3m_Last', - Candlestick5mLast: 'Candlestick_5m_Last', - Candlestick15mLast: 'Candlestick_15m_Last', - Candlestick30mLast: 'Candlestick_30m_Last', - Candlestick1hLast: 'Candlestick_1h_Last', - Candlestick2hLast: 'Candlestick_2h_Last', - Candlestick4hLast: 'Candlestick_4h_Last', - Candlestick6hLast: 'Candlestick_6h_Last', - Candlestick8hLast: 'Candlestick_8h_Last', - Candlestick12hLast: 'Candlestick_12h_Last', - Candlestick1dLast: 'Candlestick_1d_Last', - Candlestick1wLast: 'Candlestick_1w_Last', - Candlestick1MoLast: 'Candlestick_1Mo_Last', - Candlestick1mOracle: 'Candlestick_1m_Oracle', - Candlestick3mOracle: 'Candlestick_3m_Oracle', - Candlestick5mOracle: 'Candlestick_5m_Oracle', - Candlestick15mOracle: 'Candlestick_15m_Oracle', - Candlestick30mOracle: 'Candlestick_30m_Oracle', - Candlestick1hOracle: 'Candlestick_1h_Oracle', - Candlestick2hOracle: 'Candlestick_2h_Oracle', - Candlestick4hOracle: 'Candlestick_4h_Oracle', - Candlestick6hOracle: 'Candlestick_6h_Oracle', - Candlestick8hOracle: 'Candlestick_8h_Oracle', - Candlestick12hOracle: 'Candlestick_12h_Oracle', - Candlestick1dOracle: 'Candlestick_1d_Oracle', - Candlestick1wOracle: 'Candlestick_1w_Oracle', - Candlestick1MoOracle: 'Candlestick_1Mo_Oracle', - Candlestick1mMark: 'Candlestick_1m_Mark', - Candlestick3mMark: 'Candlestick_3m_Mark', - Candlestick5mMark: 'Candlestick_5m_Mark', - Candlestick15mMark: 'Candlestick_15m_Mark', - Candlestick30mMark: 'Candlestick_30m_Mark', - Candlestick1hMark: 'Candlestick_1h_Mark', - Candlestick2hMark: 'Candlestick_2h_Mark', - Candlestick4hMark: 'Candlestick_4h_Mark', - Candlestick6hMark: 'Candlestick_6h_Mark', - Candlestick8hMark: 'Candlestick_8h_Mark', - Candlestick12hMark: 'Candlestick_12h_Mark', - Candlestick1dMark: 'Candlestick_1d_Mark', - Candlestick1wMark: 'Candlestick_1w_Mark', - Candlestick1MoMark: 'Candlestick_1Mo_Mark', - Candlestick1mMarket: 'Candlestick_1m_Market', - Candlestick3mMarket: 'Candlestick_3m_Market', - Candlestick5mMarket: 'Candlestick_5m_Market', - Candlestick15mMarket: 'Candlestick_15m_Market', - Candlestick30mMarket: 'Candlestick_30m_Market', - Candlestick1hMarket: 'Candlestick_1h_Market', - Candlestick2hMarket: 'Candlestick_2h_Market', - Candlestick4hMarket: 'Candlestick_4h_Market', - Candlestick6hMarket: 'Candlestick_6h_Market', - Candlestick8hMarket: 'Candlestick_8h_Market', - Candlestick12hMarket: 'Candlestick_12h_Market', - Candlestick1dMarket: 'Candlestick_1d_Market', - Candlestick1wMarket: 'Candlestick_1w_Market', - Candlestick1MoMarket: 'Candlestick_1Mo_Market' +export const LeaderboardInterval = { + LeaderboardIntervalN1d: '1d', + LeaderboardIntervalN7d: '7d', + LeaderboardIntervalN30d: '30d', + LeaderboardIntervalALLTIME: 'ALL_TIME', + LeaderboardIntervalUNSPECIFIED: 'UNSPECIFIED' } as const; -export type MarketDataStreamName = typeof MarketDataStreamName[keyof typeof MarketDataStreamName]; +export type LeaderboardInterval = typeof LeaderboardInterval[keyof typeof LeaderboardInterval]; /** - * The type of event communicated in the WebSocket message. + * * @export - * @enum {string} + * @interface LeaderboardResponse */ - -export const MarketEventType = { - RecentTradesUpdates: 'RecentTradesUpdates', - TickerUpdate: 'TickerUpdate', - TickerAllUpdate: 'TickerAllUpdate', - OraclePriceUpdate: 'OraclePriceUpdate', - MarkPriceUpdate: 'MarkPriceUpdate', - MarketPriceUpdate: 'MarketPriceUpdate', - CandlestickUpdate: 'CandlestickUpdate', - OrderbookDiffDepthUpdate: 'OrderbookDiffDepthUpdate', - OrderbookPartialDepthUpdate: 'OrderbookPartialDepthUpdate' -} as const; - -export type MarketEventType = typeof MarketEventType[keyof typeof MarketEventType]; - - +export interface LeaderboardResponse { + /** + * + * @type {Array} + * @memberof LeaderboardResponse + */ + 'data': Array; +} /** - * + * User is expected to sign this payload and sends is signature in login api as header and payload itself in request body * @export - * @interface MarketPriceUpdate + * @interface LoginRequest */ -export interface MarketPriceUpdate { +export interface LoginRequest { /** - * The symbol of the market. + * The address of the account. * @type {string} - * @memberof MarketPriceUpdate + * @memberof LoginRequest */ - 'symbol': string; + 'accountAddress': string; /** - * The price in scientific notation with 9 decimal places of precision. + * The timestamp in millis when the login was signed. + * @type {number} + * @memberof LoginRequest + */ + 'signedAtMillis': number; + /** + * The intended audience of the login request. * @type {string} - * @memberof MarketPriceUpdate + * @memberof LoginRequest */ - 'priceE9': string; + 'audience': string; +} +/** + * + * @export + * @interface LoginResponse + */ +export interface LoginResponse { /** * * @type {string} - * @memberof MarketPriceUpdate + * @memberof LoginResponse */ - 'source': MarketPriceUpdateSourceEnum; + 'accessToken': string; /** - * The timestamp of the price update. + * * @type {number} - * @memberof MarketPriceUpdate + * @memberof LoginResponse */ - 'updatedAtMillis': number; + 'accessTokenValidForSeconds': number; + /** + * + * @type {string} + * @memberof LoginResponse + */ + 'refreshToken': string; + /** + * + * @type {number} + * @memberof LoginResponse + */ + 'refreshTokenValidForSeconds': number; } - -export const MarketPriceUpdateSourceEnum = { - Market: 'Market' -} as const; - -export type MarketPriceUpdateSourceEnum = typeof MarketPriceUpdateSourceEnum[keyof typeof MarketPriceUpdateSourceEnum]; - /** - * + * Margin type. * @export * @enum {string} */ -export const MarketStatus = { - Active: 'ACTIVE', - Beta: 'BETA', - Maintenance: 'MAINTENANCE', - Delisted: 'DELISTED', +export const MarginType = { + Cross: 'CROSS', + Isolated: 'ISOLATED', Unspecified: 'UNSPECIFIED' } as const; -export type MarketStatus = typeof MarketStatus[keyof typeof MarketStatus]; +export type MarginType = typeof MarginType[keyof typeof MarginType]; /** - * A market stream message containing an event type and a payload. The payload structure depends on the event type. + * * @export - * @interface MarketStreamMessage + * @interface MarkAsClaimedRequest */ -export interface MarketStreamMessage { +export interface MarkAsClaimedRequest { /** - * - * @type {MarketEventType} - * @memberof MarketStreamMessage + * The interval number + * @type {number} + * @memberof MarkAsClaimedRequest */ - 'event': MarketEventType; + 'intervalNumber': number; /** - * - * @type {MarketStreamMessagePayload} - * @memberof MarketStreamMessage + * The campaign name + * @type {string} + * @memberof MarkAsClaimedRequest */ - 'payload': MarketStreamMessagePayload; + 'campaignName': MarkAsClaimedRequestCampaignNameEnum; + /** + * The transaction digest of the claim + * @type {string} + * @memberof MarkAsClaimedRequest + */ + 'txnDigest': string; } +export const MarkAsClaimedRequestCampaignNameEnum = { + TradeAndEarn: 'TRADE_AND_EARN', + WalTradeAndEarn: 'WAL_TRADE_AND_EARN', + Affiliate: 'AFFILIATE' +} as const; -/** - * @type MarketStreamMessagePayload - * The payload of the message, which varies based on the event type. - * @export - */ -export type MarketStreamMessagePayload = CandlestickUpdate | MarkPriceUpdate | MarketPriceUpdate | OraclePriceUpdate | OrderbookDiffDepthUpdate | OrderbookPartialDepthUpdate | RecentTradesUpdates | TickerAllUpdate | TickerUpdate; +export type MarkAsClaimedRequestCampaignNameEnum = typeof MarkAsClaimedRequestCampaignNameEnum[keyof typeof MarkAsClaimedRequestCampaignNameEnum]; /** - * Subscription message for market data streams. + * * @export - * @interface MarketSubscriptionMessage + * @interface MarkAsClaimedResponse */ -export interface MarketSubscriptionMessage { +export interface MarkAsClaimedResponse { /** - * - * @type {SubscriptionType} - * @memberof MarketSubscriptionMessage + * Response message indicating if the claim was marked as claimed successfully + * @type {string} + * @memberof MarkAsClaimedResponse */ - 'method': SubscriptionType; + 'message': string; /** - * List of market data streams to subscribe or unsubscribe from. - * @type {Array} - * @memberof MarketSubscriptionMessage + * Status of the claim + * @type {string} + * @memberof MarkAsClaimedResponse */ - 'dataStreams': Array; + 'status': MarkAsClaimedResponseStatusEnum; } +export const MarkAsClaimedResponseStatusEnum = { + Claimed: 'CLAIMED', + Claimable: 'CLAIMABLE' +} as const; + +export type MarkAsClaimedResponseStatusEnum = typeof MarkAsClaimedResponseStatusEnum[keyof typeof MarkAsClaimedResponseStatusEnum]; /** - * Represents the type of market data stream and its parameters. + * * @export - * @interface MarketSubscriptionStreams + * @interface MarkPriceUpdate */ -export interface MarketSubscriptionStreams { +export interface MarkPriceUpdate { /** - * The symbol of the market stream to subscribe to (Leave empty for TickerAll stream) + * The symbol of the market. * @type {string} - * @memberof MarketSubscriptionStreams + * @memberof MarkPriceUpdate */ 'symbol': string; /** - * - * @type {Array} - * @memberof MarketSubscriptionStreams - */ - 'streams': Array; -} -/** - * - * @export - * @interface ModelError - */ -export interface ModelError { - /** - * A code representing the type of error. + * The price in scientific notation with 9 decimal places of precision. * @type {string} - * @memberof ModelError + * @memberof MarkPriceUpdate */ - 'errorCode'?: string; + 'priceE9': string; /** - * A human-readable message describing the error. + * * @type {string} - * @memberof ModelError + * @memberof MarkPriceUpdate */ - 'message': string; + 'source': MarkPriceUpdateSourceEnum; /** - * Additional structured details about the error. - * @type {{ [key: string]: any | undefined; }} - * @memberof ModelError + * The timestamp of the price update. + * @type {number} + * @memberof MarkPriceUpdate */ - 'details'?: { [key: string]: any | undefined; }; + 'updatedAtMillis': number; } + +export const MarkPriceUpdateSourceEnum = { + Mark: 'Mark' +} as const; + +export type MarkPriceUpdateSourceEnum = typeof MarkPriceUpdateSourceEnum[keyof typeof MarkPriceUpdateSourceEnum]; + /** * * @export - * @interface OnboardAffiliateRequest + * @interface Market */ -export interface OnboardAffiliateRequest { +export interface Market { /** - * Referral code of the parent affiliate + * Symbol of the market. * @type {string} - * @memberof OnboardAffiliateRequest + * @memberof Market */ - 'parentReferralCode'?: string | null; + 'symbol': string; /** - * Name of the applicant + * Market address. * @type {string} - * @memberof OnboardAffiliateRequest + * @memberof Market */ - 'name': string; + 'marketAddress': string; /** - * Email address of the applicant - * @type {string} - * @memberof OnboardAffiliateRequest + * + * @type {MarketStatus} + * @memberof Market */ - 'email': string; + 'status': MarketStatus; /** - * - * @type {OnboardAffiliateRequestSocialUserNames} - * @memberof OnboardAffiliateRequest + * Base asset symbol. + * @type {string} + * @memberof Market */ - 'socialUserNames'?: OnboardAffiliateRequestSocialUserNames; -} -/** - * Map of social media usernames - * @export - * @interface OnboardAffiliateRequestSocialUserNames - */ -export interface OnboardAffiliateRequestSocialUserNames { + 'baseAssetSymbol': string; /** - * Twitter username + * Base asset name. * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof Market */ - 'twitter'?: string; + 'baseAssetName': string; /** - * Instagram username - * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * Precision of the base asset. + * @type {number} + * @memberof Market */ - 'instagram'?: string; + 'baseAssetDecimals': number; /** - * YouTube channel name + * Step size for the quantity (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof Market */ - 'youtube'?: string; + 'stepSizeE9': string; /** - * TikTok username + * Price increment size (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof Market */ - 'tiktok'?: string; -} -/** - * - * @export - * @interface OnboardRefereeRequest - */ -export interface OnboardRefereeRequest { + 'tickSizeE9': string; /** - * Referral code of the parent affiliate + * Minimum order size (e9 format). * @type {string} - * @memberof OnboardRefereeRequest + * @memberof Market */ - 'code': string; -} -/** - * - * @export - * @interface OpenOrderResponse - */ -export interface OpenOrderResponse { + 'minOrderQuantityE9': string; /** - * The Order Hash, which is the default way to uniquely identify an order in the system + * Maximum limit order size (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'orderHash': string; + 'maxLimitOrderQuantityE9': string; /** - * The Client Order ID, which is used a unique identifier for an order, provided by the client, in case of proprietary order management systems + * Maximum market order size (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'clientOrderId'?: string; + 'maxMarketOrderQuantityE9': string; /** - * The market symbol + * Minimum order price (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'symbol': string; + 'minOrderPriceE9': string; /** - * The account address of the order. May be an account user is authorized for. + * Maximum order price (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'accountAddress': string; + 'maxOrderPriceE9': string; /** - * The signer address of the order. May be an account user is authorized for. + * Maintenance margin ratio (MMR, e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'signerAddress': string; + 'maintenanceMarginRatioE9': string; /** - * The price in base e9 of the asset to be traded. Should always be a number + * Initial margin ratio (IMR), e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'priceE9': string; + 'initialMarginRatioE9': string; /** - * The quantity in base e9 of the asset to be traded. Should always be a number + * Insurance pool ratio (e9 format). * @type {string} - * @memberof OpenOrderResponse - */ - 'quantityE9': string; - /** - * - * @type {OrderSide} - * @memberof OpenOrderResponse + * @memberof Market */ - 'side': OrderSide; + 'insurancePoolRatioE9': string; /** - * The leverage in base e9 of the order to be traded. Should always be a number + * Default leverage (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'leverageE9': string; + 'defaultLeverageE9': string; /** - * Is this order isolated or cross margin. Note market must be set to the same mode. - * @type {boolean} - * @memberof OpenOrderResponse + * Maximum notional value at current leverage. Index 0 is max notional value for leverage set to 1x, index 1 is for leverage 2x, etc... + * @type {Array} + * @memberof Market */ - 'isIsolated': boolean; + 'maxNotionalAtOpenE9': Array; /** - * The random generated SALT. Should always be a number + * Minimum trade quantity allowed (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'salt': string; + 'minTradeQuantityE9': string; /** - * Unix timestamp in millis at which order will expire. Defaults to 1 month for LIMIT orders if not provided - * @type {number} - * @memberof OpenOrderResponse + * Max trade quantity allowed (e9 format). + * @type {string} + * @memberof Market */ - 'expiresAtMillis': number; + 'maxTradeQuantityE9': string; /** - * The timestamp in millis at which the request was signed - * @type {number} - * @memberof OpenOrderResponse + * Minimum trade price allowed (e9 format). + * @type {string} + * @memberof Market */ - 'signedAtMillis': number; + 'minTradePriceE9': string; /** - * - * @type {OrderType} - * @memberof OpenOrderResponse + * Maximum trade price allowed (e9 format). + * @type {string} + * @memberof Market */ - 'type': OrderType; + 'maxTradePriceE9': string; /** - * Is this order to only reduce a position? Default false - * @type {boolean} - * @memberof OpenOrderResponse + * Maximum allowed funding rate (e9 format). + * @type {string} + * @memberof Market */ - 'reduceOnly': boolean; + 'maxFundingRateE9': string; /** - * If set to TRUE, the order can only be a maker order - * @type {boolean} - * @memberof OpenOrderResponse + * Default maker fee (e9 format). + * @type {string} + * @memberof Market */ - 'postOnly': boolean; + 'defaultMakerFeeE9': string; /** - * - * @type {OrderTimeInForce} - * @memberof OpenOrderResponse + * Default taker fee (e9 format). + * @type {string} + * @memberof Market */ - 'timeInForce': OrderTimeInForce; + 'defaultTakerFeeE9': string; /** - * Trigger price in base e9 for stop orders. This should always be a number + * Insurance pool address. * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'triggerPriceE9'?: string; + 'insurancePoolAddress': string; /** - * The quantity in base e9 of the asset currently filled. This should always be a number + * Fee pool address. * @type {string} - * @memberof OpenOrderResponse + * @memberof Market */ - 'filledQuantityE9': string; + 'feePoolAddress': string; /** - * - * @type {OrderStatus} - * @memberof OpenOrderResponse + * The time when trading will start/have started on the market. + * @type {string} + * @memberof Market */ - 'status': OrderStatus; + 'tradingStartTimeAtMillis': string; /** - * - * @type {SelfTradePreventionType} - * @memberof OpenOrderResponse + * Maximum take bound for long positions (e9 format). + * @type {string} + * @memberof Market */ - 'selfTradePreventionType': SelfTradePreventionType; + 'mtbLongE9': string; /** - * - * @type {OrderTwapConfig} - * @memberof OpenOrderResponse + * Maximum take bound for short positions (e9 format). + * @type {string} + * @memberof Market */ - 'twapConfig'?: OrderTwapConfig; + 'mtbShortE9': string; /** - * The timestamp in millis when the order was opened - * @type {number} - * @memberof OpenOrderResponse + * Delisting price (e9 format). + * @type {string} + * @memberof Market */ - 'orderTimeAtMillis': number; + 'delistingPriceE9': string; /** - * The timestamp in millis that this order was last updated (including status updates) - * @type {number} - * @memberof OpenOrderResponse + * Indicates whether the market only allows isolated margin. + * @type {boolean} + * @memberof Market */ - 'updatedAtMillis': number; + 'isolatedOnly': boolean; } /** * * @export - * @interface Operators + * @enum {string} */ -export interface Operators { - /** - * Admin operator address - * @type {string} - * @memberof Operators - */ - 'admin': string; - /** - * General operator address; AKA Guardian - * @type {string} - * @memberof Operators - * @deprecated - */ - 'operator': string; - /** - * Sequencer operator address - * @type {string} - * @memberof Operators - */ - 'sequencer': string; - /** - * Funding operator address - * @type {string} - * @memberof Operators - * @deprecated - */ - 'funding': string; - /** - * Fee operator address - * @type {string} - * @memberof Operators - * @deprecated - */ - 'fee': string; -} + +export const MarketDataStreamName = { + RecentTrade: 'Recent_Trade', + Ticker: 'Ticker', + TickerAll: 'Ticker_All', + DiffDepth10Ms: 'Diff_Depth_10_ms', + DiffDepth200Ms: 'Diff_Depth_200_ms', + DiffDepth500Ms: 'Diff_Depth_500_ms', + PartialDepth5: 'Partial_Depth_5', + PartialDepth10: 'Partial_Depth_10', + PartialDepth20: 'Partial_Depth_20', + OraclePrice: 'Oracle_Price', + MarkPrice: 'Mark_Price', + MarketPrice: 'Market_Price', + Candlestick1mLast: 'Candlestick_1m_Last', + Candlestick3mLast: 'Candlestick_3m_Last', + Candlestick5mLast: 'Candlestick_5m_Last', + Candlestick15mLast: 'Candlestick_15m_Last', + Candlestick30mLast: 'Candlestick_30m_Last', + Candlestick1hLast: 'Candlestick_1h_Last', + Candlestick2hLast: 'Candlestick_2h_Last', + Candlestick4hLast: 'Candlestick_4h_Last', + Candlestick6hLast: 'Candlestick_6h_Last', + Candlestick8hLast: 'Candlestick_8h_Last', + Candlestick12hLast: 'Candlestick_12h_Last', + Candlestick1dLast: 'Candlestick_1d_Last', + Candlestick1wLast: 'Candlestick_1w_Last', + Candlestick1MoLast: 'Candlestick_1Mo_Last', + Candlestick1mOracle: 'Candlestick_1m_Oracle', + Candlestick3mOracle: 'Candlestick_3m_Oracle', + Candlestick5mOracle: 'Candlestick_5m_Oracle', + Candlestick15mOracle: 'Candlestick_15m_Oracle', + Candlestick30mOracle: 'Candlestick_30m_Oracle', + Candlestick1hOracle: 'Candlestick_1h_Oracle', + Candlestick2hOracle: 'Candlestick_2h_Oracle', + Candlestick4hOracle: 'Candlestick_4h_Oracle', + Candlestick6hOracle: 'Candlestick_6h_Oracle', + Candlestick8hOracle: 'Candlestick_8h_Oracle', + Candlestick12hOracle: 'Candlestick_12h_Oracle', + Candlestick1dOracle: 'Candlestick_1d_Oracle', + Candlestick1wOracle: 'Candlestick_1w_Oracle', + Candlestick1MoOracle: 'Candlestick_1Mo_Oracle', + Candlestick1mMark: 'Candlestick_1m_Mark', + Candlestick3mMark: 'Candlestick_3m_Mark', + Candlestick5mMark: 'Candlestick_5m_Mark', + Candlestick15mMark: 'Candlestick_15m_Mark', + Candlestick30mMark: 'Candlestick_30m_Mark', + Candlestick1hMark: 'Candlestick_1h_Mark', + Candlestick2hMark: 'Candlestick_2h_Mark', + Candlestick4hMark: 'Candlestick_4h_Mark', + Candlestick6hMark: 'Candlestick_6h_Mark', + Candlestick8hMark: 'Candlestick_8h_Mark', + Candlestick12hMark: 'Candlestick_12h_Mark', + Candlestick1dMark: 'Candlestick_1d_Mark', + Candlestick1wMark: 'Candlestick_1w_Mark', + Candlestick1MoMark: 'Candlestick_1Mo_Mark', + Candlestick1mMarket: 'Candlestick_1m_Market', + Candlestick3mMarket: 'Candlestick_3m_Market', + Candlestick5mMarket: 'Candlestick_5m_Market', + Candlestick15mMarket: 'Candlestick_15m_Market', + Candlestick30mMarket: 'Candlestick_30m_Market', + Candlestick1hMarket: 'Candlestick_1h_Market', + Candlestick2hMarket: 'Candlestick_2h_Market', + Candlestick4hMarket: 'Candlestick_4h_Market', + Candlestick6hMarket: 'Candlestick_6h_Market', + Candlestick8hMarket: 'Candlestick_8h_Market', + Candlestick12hMarket: 'Candlestick_12h_Market', + Candlestick1dMarket: 'Candlestick_1d_Market', + Candlestick1wMarket: 'Candlestick_1w_Market', + Candlestick1MoMarket: 'Candlestick_1Mo_Market' +} as const; + +export type MarketDataStreamName = typeof MarketDataStreamName[keyof typeof MarketDataStreamName]; + + +/** + * The type of event communicated in the WebSocket message. + * @export + * @enum {string} + */ + +export const MarketEventType = { + RecentTradesUpdates: 'RecentTradesUpdates', + TickerUpdate: 'TickerUpdate', + TickerAllUpdate: 'TickerAllUpdate', + OraclePriceUpdate: 'OraclePriceUpdate', + MarkPriceUpdate: 'MarkPriceUpdate', + MarketPriceUpdate: 'MarketPriceUpdate', + CandlestickUpdate: 'CandlestickUpdate', + OrderbookDiffDepthUpdate: 'OrderbookDiffDepthUpdate', + OrderbookPartialDepthUpdate: 'OrderbookPartialDepthUpdate' +} as const; + +export type MarketEventType = typeof MarketEventType[keyof typeof MarketEventType]; + + /** * * @export - * @interface OraclePriceUpdate + * @interface MarketPriceUpdate */ -export interface OraclePriceUpdate { +export interface MarketPriceUpdate { /** * The symbol of the market. * @type {string} - * @memberof OraclePriceUpdate + * @memberof MarketPriceUpdate */ 'symbol': string; /** * The price in scientific notation with 9 decimal places of precision. * @type {string} - * @memberof OraclePriceUpdate + * @memberof MarketPriceUpdate */ 'priceE9': string; /** * * @type {string} - * @memberof OraclePriceUpdate + * @memberof MarketPriceUpdate */ - 'source': OraclePriceUpdateSourceEnum; + 'source': MarketPriceUpdateSourceEnum; /** * The timestamp of the price update. * @type {number} - * @memberof OraclePriceUpdate + * @memberof MarketPriceUpdate */ 'updatedAtMillis': number; } -export const OraclePriceUpdateSourceEnum = { - Oracle: 'Oracle' +export const MarketPriceUpdateSourceEnum = { + Market: 'Market' } as const; -export type OraclePriceUpdateSourceEnum = typeof OraclePriceUpdateSourceEnum[keyof typeof OraclePriceUpdateSourceEnum]; +export type MarketPriceUpdateSourceEnum = typeof MarketPriceUpdateSourceEnum[keyof typeof MarketPriceUpdateSourceEnum]; /** - * The reason for an order cancellation. + * * @export * @enum {string} */ -export const OrderCancelReason = { - Unspecified: 'UNSPECIFIED', - InsufficientMargin: 'INSUFFICIENT_MARGIN', - DuplicateOrder: 'DUPLICATE_ORDER', - PostOnlyWouldTrade: 'POST_ONLY_WOULD_TRADE', - InvalidSymbol: 'INVALID_SYMBOL', - SignedAtTooOld: 'SIGNED_AT_TOO_OLD', - OrderExpired: 'ORDER_EXPIRED', - InvalidLeverage: 'INVALID_LEVERAGE', - InvalidInput: 'INVALID_INPUT', - PriceOutOfBound: 'PRICE_OUT_OF_BOUND', - QuantityOutOfBound: 'QUANTITY_OUT_OF_BOUND', - PriceOutOfTickSize: 'PRICE_OUT_OF_TICK_SIZE', - QuantityOutOfStepSize: 'QUANTITY_OUT_OF_STEP_SIZE', - ReduceOnlyWouldOpen: 'REDUCE_ONLY_WOULD_OPEN', - TooManyOpenOrdersOnMarket: 'TOO_MANY_OPEN_ORDERS_ON_MARKET', - UserCancelled: 'USER_CANCELLED', - UserCancelledAllOnMarket: 'USER_CANCELLED_ALL_ON_MARKET', - SelfTradePrevention: 'SELF_TRADE_PREVENTION', - LeverageUpdate: 'LEVERAGE_UPDATE', - AccountNotFound: 'ACCOUNT_NOT_FOUND', - MarketNotTrading: 'MARKET_NOT_TRADING', - InsufficientLiquidity: 'INSUFFICIENT_LIQUIDITY', - PositionNotFound: 'POSITION_NOT_FOUND', - LiquidationOutOfOrder: 'LIQUIDATION_OUT_OF_ORDER', - AccountNotLiquidatable: 'ACCOUNT_NOT_LIQUIDATABLE', - OrderNotReducingPosition: 'ORDER_NOT_REDUCING_POSITION', - UserCancelledAllStandbyOnMarket: 'USER_CANCELLED_ALL_STANDBY_ON_MARKET', - PositionExceedsMaxOpenInterest: 'POSITION_EXCEEDS_MAX_OPEN_INTEREST', - AccountDeauthorized: 'ACCOUNT_DEAUTHORIZED', - TooManyMatches: 'TOO_MANY_MATCHES', - MarginCall: 'MARGIN_CALL', - InsufficientBalance: 'INSUFFICIENT_BALANCE', - TradeQuantityOutOfBound: 'TRADE_QUANTITY_OUT_OF_BOUND', - MarketTakeBoundBreached: 'MARKET_TAKE_BOUND_BREACHED', - OrdersExceedMaxOpenInterest: 'ORDERS_EXCEED_MAX_OPEN_INTEREST' +export const MarketStatus = { + Active: 'ACTIVE', + Beta: 'BETA', + Maintenance: 'MAINTENANCE', + Delisted: 'DELISTED', + Unspecified: 'UNSPECIFIED' } as const; -export type OrderCancelReason = typeof OrderCancelReason[keyof typeof OrderCancelReason]; +export type MarketStatus = typeof MarketStatus[keyof typeof MarketStatus]; /** - * The reason for failure to cancel an order. + * A market stream message containing an event type and a payload. The payload structure depends on the event type. * @export - * @enum {string} + * @interface MarketStreamMessage */ +export interface MarketStreamMessage { + /** + * + * @type {MarketEventType} + * @memberof MarketStreamMessage + */ + 'event': MarketEventType; + /** + * + * @type {MarketStreamMessagePayload} + * @memberof MarketStreamMessage + */ + 'payload': MarketStreamMessagePayload; +} -export const OrderCancellationFailureReason = { - OrderNotFound: 'ORDER_NOT_FOUND', - MarketNotFound: 'MARKET_NOT_FOUND', - AccountNotFound: 'ACCOUNT_NOT_FOUND', - NoOpenOrdersOnMarket: 'NO_OPEN_ORDERS_ON_MARKET', - NoFailure: 'NO_FAILURE', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderCancellationFailureReason = typeof OrderCancellationFailureReason[keyof typeof OrderCancellationFailureReason]; +/** + * @type MarketStreamMessagePayload + * The payload of the message, which varies based on the event type. + * @export + */ +export type MarketStreamMessagePayload = CandlestickUpdate | MarkPriceUpdate | MarketPriceUpdate | OraclePriceUpdate | OrderbookDiffDepthUpdate | OrderbookPartialDepthUpdate | RecentTradesUpdates | TickerAllUpdate | TickerUpdate; /** - * Details of an order cancellation. + * Subscription message for market data streams. * @export - * @interface OrderCancellationUpdate + * @interface MarketSubscriptionMessage */ -export interface OrderCancellationUpdate { +export interface MarketSubscriptionMessage { /** - * The unique hash of the order. - * @type {string} - * @memberof OrderCancellationUpdate + * + * @type {SubscriptionType} + * @memberof MarketSubscriptionMessage */ - 'orderHash': string; + 'method': SubscriptionType; /** - * The client-provided order ID. - * @type {string} - * @memberof OrderCancellationUpdate + * List of market data streams to subscribe or unsubscribe from. + * @type {Array} + * @memberof MarketSubscriptionMessage */ - 'clientOrderId'?: string; + 'dataStreams': Array; +} + + +/** + * Represents the type of market data stream and its parameters. + * @export + * @interface MarketSubscriptionStreams + */ +export interface MarketSubscriptionStreams { /** - * The symbol of the market. + * The symbol of the market stream to subscribe to (Leave empty for TickerAll stream) * @type {string} - * @memberof OrderCancellationUpdate + * @memberof MarketSubscriptionStreams */ 'symbol': string; /** - * The address of the account. - * @type {string} - * @memberof OrderCancellationUpdate + * + * @type {Array} + * @memberof MarketSubscriptionStreams */ - 'accountAddress': string; + 'streams': Array; +} +/** + * + * @export + * @interface ModelError + */ +export interface ModelError { /** - * The timestamp of the order creation in milliseconds. - * @type {number} - * @memberof OrderCancellationUpdate + * A code representing the type of error. + * @type {string} + * @memberof ModelError */ - 'createdAtMillis': number; - /** - * - * @type {OrderCancelReason} - * @memberof OrderCancellationUpdate - */ - 'cancellationReason': OrderCancelReason; + 'errorCode'?: string; /** - * - * @type {OrderCancellationFailureReason} - * @memberof OrderCancellationUpdate + * A human-readable message describing the error. + * @type {string} + * @memberof ModelError */ - 'failureToCancelReason'?: OrderCancellationFailureReason; + 'message': string; /** - * The remaining quantity of the order. - * @type {string} - * @memberof OrderCancellationUpdate + * Additional structured details about the error. + * @type {{ [key: string]: any | undefined; }} + * @memberof ModelError */ - 'remainingQuantityE9': string; + 'details'?: { [key: string]: any | undefined; }; } - - -/** - * Side of the order - * @export - * @enum {string} - */ - -export const OrderSide = { - Long: 'LONG', - Short: 'SHORT', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderSide = typeof OrderSide[keyof typeof OrderSide]; - - -/** - * The current status of the order. - * @export - * @enum {string} - */ - -export const OrderStatus = { - Standby: 'STANDBY', - Open: 'OPEN', - PartiallyFilledOpen: 'PARTIALLY_FILLED_OPEN', - PartiallyFilledCanceled: 'PARTIALLY_FILLED_CANCELED', - Filled: 'FILLED', - Cancelled: 'CANCELLED', - Expired: 'EXPIRED', - PartiallyFilledExpired: 'PARTIALLY_FILLED_EXPIRED', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderStatus = typeof OrderStatus[keyof typeof OrderStatus]; - - -/** - * The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill - * @export - * @enum {string} - */ - -export const OrderTimeInForce = { - Gtt: 'GTT', - Ioc: 'IOC', - Fok: 'FOK', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderTimeInForce = typeof OrderTimeInForce[keyof typeof OrderTimeInForce]; - - /** - * Configuration for Time-Weighted Average Price orders + * * @export - * @interface OrderTwapConfig + * @interface OnboardAffiliateRequest */ -export interface OrderTwapConfig { +export interface OnboardAffiliateRequest { /** - * Number of sub-orders to split the total quantity into + * Referral code of the parent affiliate * @type {string} - * @memberof OrderTwapConfig + * @memberof OnboardAffiliateRequest */ - 'subOrdersCount'?: string; + 'parentReferralCode'?: string | null; /** - * Total time in minutes over which to execute the TWAP order + * Name of the applicant * @type {string} - * @memberof OrderTwapConfig + * @memberof OnboardAffiliateRequest */ - 'runningTimeInMinutes'?: string; + 'name': string; + /** + * Email address of the applicant + * @type {string} + * @memberof OnboardAffiliateRequest + */ + 'email': string; + /** + * + * @type {OnboardAffiliateRequestSocialUserNames} + * @memberof OnboardAffiliateRequest + */ + 'socialUserNames'?: OnboardAffiliateRequestSocialUserNames; } /** - * The type of order. (BANKRUPTCY_LIQUIDATION is deprecated) - * @export - * @enum {string} - */ - -export const OrderType = { - Limit: 'LIMIT', - Market: 'MARKET', - StopLimit: 'STOP_LIMIT', - StopMarket: 'STOP_MARKET', - Liquidation: 'LIQUIDATION', - StopLossMarket: 'STOP_LOSS_MARKET', - TakeProfitMarket: 'TAKE_PROFIT_MARKET', - StopLossLimit: 'STOP_LOSS_LIMIT', - TakeProfitLimit: 'TAKE_PROFIT_LIMIT', - BankruptcyLiquidation: 'BANKRUPTCY_LIQUIDATION', - TimeWeightedAveragePrice: 'TIME_WEIGHTED_AVERAGE_PRICE', - Adl: 'ADL', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderType = typeof OrderType[keyof typeof OrderType]; - - -/** - * + * Map of social media usernames * @export - * @interface OrderbookDepthResponse + * @interface OnboardAffiliateRequestSocialUserNames */ -export interface OrderbookDepthResponse { +export interface OnboardAffiliateRequestSocialUserNames { /** - * Market symbol. + * Twitter username * @type {string} - * @memberof OrderbookDepthResponse + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'symbol': string; + 'twitter'?: string; /** - * Count indicating the number of changes in orderbook state. - * @type {number} - * @memberof OrderbookDepthResponse + * Instagram username + * @type {string} + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'lastUpdateId': number; + 'instagram'?: string; /** - * Timestamp at which the last change in orderbook state took place, in milliseconds. - * @type {number} - * @memberof OrderbookDepthResponse + * YouTube channel name + * @type {string} + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'updatedAtMillis': number; + 'youtube'?: string; /** - * The time at which the orderbook server sent the response, in milliseconds. - * @type {number} - * @memberof OrderbookDepthResponse + * TikTok username + * @type {string} + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'responseSentAtMillis': number; + 'tiktok'?: string; +} +/** + * + * @export + * @interface OnboardRefereeRequest + */ +export interface OnboardRefereeRequest { /** - * The best bid price on orderbook at the moment (e9 format). + * Referral code of the parent affiliate * @type {string} - * @memberof OrderbookDepthResponse + * @memberof OnboardRefereeRequest */ - 'bestBidPriceE9': string; + 'code': string; +} +/** + * + * @export + * @interface OpenOrderResponse + */ +export interface OpenOrderResponse { /** - * The best bid quantity on orderbook at the moment (e9 format). + * The Order Hash, which is the default way to uniquely identify an order in the system * @type {string} - * @memberof OrderbookDepthResponse + * @memberof OpenOrderResponse */ - 'bestBidQuantityE9': string; + 'orderHash': string; /** - * The best ask price on orderbook at the moment (e9 format). + * The Client Order ID, which is used a unique identifier for an order, provided by the client, in case of proprietary order management systems * @type {string} - * @memberof OrderbookDepthResponse + * @memberof OpenOrderResponse */ - 'bestAskPriceE9': string; + 'clientOrderId'?: string; /** - * The best ask quantity on orderbook at the moment (e9 format). + * The market symbol * @type {string} - * @memberof OrderbookDepthResponse + * @memberof OpenOrderResponse */ - 'bestAskQuantityE9': string; + 'symbol': string; /** - * Bids to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. - * @type {Array>} - * @memberof OrderbookDepthResponse + * The account address of the order. May be an account user is authorized for. + * @type {string} + * @memberof OpenOrderResponse */ - 'bidsE9': Array>; + 'accountAddress': string; /** - * Asks to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. - * @type {Array>} - * @memberof OrderbookDepthResponse + * The signer address of the order. May be an account user is authorized for. + * @type {string} + * @memberof OpenOrderResponse */ - 'asksE9': Array>; -} -/** - * - * @export - * @interface OrderbookDiffDepthUpdate - */ -export interface OrderbookDiffDepthUpdate { + 'signerAddress': string; /** - * The timestamp of the orderbook update. - * @type {number} - * @memberof OrderbookDiffDepthUpdate + * The price in base e9 of the asset to be traded. Should always be a number + * @type {string} + * @memberof OpenOrderResponse */ - 'updatedAtMillis': number; + 'priceE9': string; /** - * The symbol of the market for the orderbook update. + * The quantity in base e9 of the asset to be traded. Should always be a number * @type {string} - * @memberof OrderbookDiffDepthUpdate + * @memberof OpenOrderResponse */ - 'symbol': string; + 'quantityE9': string; /** * - * @type {Array>} - * @memberof OrderbookDiffDepthUpdate + * @type {OrderSide} + * @memberof OpenOrderResponse */ - 'bidsE9': Array>; + 'side': OrderSide; /** - * - * @type {Array>} - * @memberof OrderbookDiffDepthUpdate + * The leverage in base e9 of the order to be traded. Should always be a number + * @type {string} + * @memberof OpenOrderResponse */ - 'asksE9': Array>; + 'leverageE9': string; /** - * The ID of the first update in this batch. - * @type {number} - * @memberof OrderbookDiffDepthUpdate + * Is this order isolated or cross margin. Note market must be set to the same mode. + * @type {boolean} + * @memberof OpenOrderResponse */ - 'firstUpdateId': number; + 'isIsolated': boolean; /** - * The ID of the last update in this batch. - * @type {number} - * @memberof OrderbookDiffDepthUpdate + * The random generated SALT. Should always be a number + * @type {string} + * @memberof OpenOrderResponse */ - 'lastUpdateId': number; -} -/** - * - * @export - * @interface OrderbookPartialDepthUpdate - */ -export interface OrderbookPartialDepthUpdate { + 'salt': string; /** - * The timestamp of the partial depth update. + * Unix timestamp in millis at which order will expire. Defaults to 1 month for LIMIT orders if not provided * @type {number} - * @memberof OrderbookPartialDepthUpdate + * @memberof OpenOrderResponse */ - 'updatedAtMillis': number; + 'expiresAtMillis': number; /** - * The symbol of the market for the partial depth update. - * @type {string} - * @memberof OrderbookPartialDepthUpdate + * The timestamp in millis at which the request was signed + * @type {number} + * @memberof OpenOrderResponse */ - 'symbol': string; + 'signedAtMillis': number; /** * - * @type {Array>} - * @memberof OrderbookPartialDepthUpdate + * @type {OrderType} + * @memberof OpenOrderResponse */ - 'bidsE9': Array>; + 'type': OrderType; /** - * - * @type {Array>} - * @memberof OrderbookPartialDepthUpdate + * Is this order to only reduce a position? Default false + * @type {boolean} + * @memberof OpenOrderResponse */ - 'asksE9': Array>; + 'reduceOnly': boolean; /** - * The unique identifier for the orderbook update. - * @type {number} - * @memberof OrderbookPartialDepthUpdate + * If set to TRUE, the order can only be a maker order + * @type {boolean} + * @memberof OpenOrderResponse */ - 'orderbookUpdateId': number; + 'postOnly': boolean; /** - * The depth level of the orderbook snapshot. - * @type {string} - * @memberof OrderbookPartialDepthUpdate + * + * @type {OrderTimeInForce} + * @memberof OpenOrderResponse */ - 'depthLevel': OrderbookPartialDepthUpdateDepthLevelEnum; -} - -export const OrderbookPartialDepthUpdateDepthLevelEnum = { - _5: '5', - _10: '10', - _20: '20' -} as const; - -export type OrderbookPartialDepthUpdateDepthLevelEnum = typeof OrderbookPartialDepthUpdateDepthLevelEnum[keyof typeof OrderbookPartialDepthUpdateDepthLevelEnum]; - -/** - * - * @export - * @interface Position - */ -export interface Position { + 'timeInForce': OrderTimeInForce; /** - * Market address. + * Trigger price in base e9 for stop orders. This should always be a number * @type {string} - * @memberof Position + * @memberof OpenOrderResponse */ - 'symbol': string; + 'triggerPriceE9'?: string; /** - * Average entry price determined by a simple average of all entry prices resulting in this position size (e9 format). + * The quantity in base e9 of the asset currently filled. This should always be a number * @type {string} - * @memberof Position + * @memberof OpenOrderResponse */ - 'avgEntryPriceE9': string; + 'filledQuantityE9': string; /** - * Isolated position leverage (e9 format). - * @type {string} - * @memberof Position + * + * @type {OrderStatus} + * @memberof OpenOrderResponse */ - 'clientSetLeverageE9': string; + 'status': OrderStatus; /** - * Liquidation price (e9 format). - * @type {string} - * @memberof Position + * + * @type {SelfTradePreventionType} + * @memberof OpenOrderResponse */ - 'liquidationPriceE9': string; + 'selfTradePreventionType': SelfTradePreventionType; /** - * Mark price (e9 format). - * @type {string} - * @memberof Position + * + * @type {OrderTwapConfig} + * @memberof OpenOrderResponse */ - 'markPriceE9': string; + 'twapConfig'?: OrderTwapConfig; /** - * Notional value (e9 format). - * @type {string} - * @memberof Position + * The timestamp in millis when the order was opened + * @type {number} + * @memberof OpenOrderResponse */ - 'notionalValueE9': string; + 'orderTimeAtMillis': number; /** - * Position size (e9 format). - * @type {string} - * @memberof Position + * The timestamp in millis that this order was last updated (including status updates) + * @type {number} + * @memberof OpenOrderResponse */ - 'sizeE9': string; + 'updatedAtMillis': number; +} + + +/** + * + * @export + * @interface Operators + */ +export interface Operators { /** - * Unrealized profit (e9 format). + * Admin operator address * @type {string} - * @memberof Position - */ - 'unrealizedPnlE9': string; - /** - * - * @type {PositionSide} - * @memberof Position + * @memberof Operators */ - 'side': PositionSide; + 'admin': string; /** - * Initial margin required with current mark price (e9 format). + * General operator address; AKA Guardian * @type {string} - * @memberof Position + * @memberof Operators + * @deprecated */ - 'marginRequiredE9': string; + 'operator': string; /** - * Maintenance margin required with current mark price (e9 format). + * Sequencer operator address * @type {string} - * @memberof Position + * @memberof Operators */ - 'maintenanceMarginE9': string; + 'sequencer': string; /** - * If the position is isolated. - * @type {boolean} - * @memberof Position + * Funding operator address + * @type {string} + * @memberof Operators + * @deprecated */ - 'isIsolated': boolean; + 'funding': string; /** - * Margin value present if margin type is isolated (e9 format). + * Fee operator address * @type {string} - * @memberof Position + * @memberof Operators + * @deprecated */ - 'isolatedMarginE9': string; + 'fee': string; +} +/** + * + * @export + * @interface OraclePriceUpdate + */ +export interface OraclePriceUpdate { /** - * Last update time. - * @type {number} - * @memberof Position + * The symbol of the market. + * @type {string} + * @memberof OraclePriceUpdate */ - 'updatedAtMillis': number; + 'symbol': string; /** - * Total funding rate payment (e9 format). + * The price in scientific notation with 9 decimal places of precision. * @type {string} - * @memberof Position + * @memberof OraclePriceUpdate */ - 'fundingRatePaymentAllTimeE9': string; + 'priceE9': string; /** - * Funding rate payment since last position change (e9 format). + * * @type {string} - * @memberof Position + * @memberof OraclePriceUpdate */ - 'fundingRatePaymentSinceChangeE9': string; + 'source': OraclePriceUpdateSourceEnum; /** - * Funding rate payment since position opened (e9 format). - * @type {string} - * @memberof Position + * The timestamp of the price update. + * @type {number} + * @memberof OraclePriceUpdate */ - 'fundingRatePaymentSinceOpenedE9': string; + 'updatedAtMillis': number; } - -/** - * The side of the position, either long or short - * @export - * @enum {string} - */ - -export const PositionSide = { - Long: 'LONG', - Short: 'SHORT', - Unspecified: 'UNSPECIFIED' +export const OraclePriceUpdateSourceEnum = { + Oracle: 'Oracle' } as const; -export type PositionSide = typeof PositionSide[keyof typeof PositionSide]; - +export type OraclePriceUpdateSourceEnum = typeof OraclePriceUpdateSourceEnum[keyof typeof OraclePriceUpdateSourceEnum]; /** - * The generated zero-knowledge proof points. + * The reason for an order cancellation. * @export - * @interface ProofPoints + * @enum {string} */ -export interface ProofPoints { - /** - * Point A of the proof. - * @type {Array} - * @memberof ProofPoints - */ - 'a': Array; - /** - * Point B of the proof. - * @type {Array>} - * @memberof ProofPoints - */ - 'b': Array>; - /** - * Point C of the proof. - * @type {Array} - * @memberof ProofPoints - */ - 'c': Array; -} + +export const OrderCancelReason = { + Unspecified: 'UNSPECIFIED', + InsufficientMargin: 'INSUFFICIENT_MARGIN', + DuplicateOrder: 'DUPLICATE_ORDER', + PostOnlyWouldTrade: 'POST_ONLY_WOULD_TRADE', + InvalidSymbol: 'INVALID_SYMBOL', + SignedAtTooOld: 'SIGNED_AT_TOO_OLD', + OrderExpired: 'ORDER_EXPIRED', + InvalidLeverage: 'INVALID_LEVERAGE', + InvalidInput: 'INVALID_INPUT', + PriceOutOfBound: 'PRICE_OUT_OF_BOUND', + QuantityOutOfBound: 'QUANTITY_OUT_OF_BOUND', + PriceOutOfTickSize: 'PRICE_OUT_OF_TICK_SIZE', + QuantityOutOfStepSize: 'QUANTITY_OUT_OF_STEP_SIZE', + ReduceOnlyWouldOpen: 'REDUCE_ONLY_WOULD_OPEN', + TooManyOpenOrdersOnMarket: 'TOO_MANY_OPEN_ORDERS_ON_MARKET', + UserCancelled: 'USER_CANCELLED', + UserCancelledAllOnMarket: 'USER_CANCELLED_ALL_ON_MARKET', + SelfTradePrevention: 'SELF_TRADE_PREVENTION', + LeverageUpdate: 'LEVERAGE_UPDATE', + AccountNotFound: 'ACCOUNT_NOT_FOUND', + MarketNotTrading: 'MARKET_NOT_TRADING', + InsufficientLiquidity: 'INSUFFICIENT_LIQUIDITY', + PositionNotFound: 'POSITION_NOT_FOUND', + LiquidationOutOfOrder: 'LIQUIDATION_OUT_OF_ORDER', + AccountNotLiquidatable: 'ACCOUNT_NOT_LIQUIDATABLE', + OrderNotReducingPosition: 'ORDER_NOT_REDUCING_POSITION', + UserCancelledAllStandbyOnMarket: 'USER_CANCELLED_ALL_STANDBY_ON_MARKET', + PositionExceedsMaxOpenInterest: 'POSITION_EXCEEDS_MAX_OPEN_INTEREST', + AccountDeauthorized: 'ACCOUNT_DEAUTHORIZED', + TooManyMatches: 'TOO_MANY_MATCHES', + MarginCall: 'MARGIN_CALL', + InsufficientBalance: 'INSUFFICIENT_BALANCE', + TradeQuantityOutOfBound: 'TRADE_QUANTITY_OUT_OF_BOUND', + MarketTakeBoundBreached: 'MARKET_TAKE_BOUND_BREACHED', + OrdersExceedMaxOpenInterest: 'ORDERS_EXCEED_MAX_OPEN_INTEREST' +} as const; + +export type OrderCancelReason = typeof OrderCancelReason[keyof typeof OrderCancelReason]; + + /** - * + * The reason for failure to cancel an order. * @export - * @interface RecentTradesUpdates + * @enum {string} */ -export interface RecentTradesUpdates { - /** - * - * @type {Array} - * @memberof RecentTradesUpdates - */ - 'trades': Array; -} + +export const OrderCancellationFailureReason = { + OrderNotFound: 'ORDER_NOT_FOUND', + MarketNotFound: 'MARKET_NOT_FOUND', + AccountNotFound: 'ACCOUNT_NOT_FOUND', + NoOpenOrdersOnMarket: 'NO_OPEN_ORDERS_ON_MARKET', + NoFailure: 'NO_FAILURE', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderCancellationFailureReason = typeof OrderCancellationFailureReason[keyof typeof OrderCancellationFailureReason]; + + /** - * + * Details of an order cancellation. * @export - * @interface RefereeOnboardResponse + * @interface OrderCancellationUpdate */ -export interface RefereeOnboardResponse { +export interface OrderCancellationUpdate { /** - * Response message indicating if the referral code exists + * The unique hash of the order. * @type {string} - * @memberof RefereeOnboardResponse + * @memberof OrderCancellationUpdate */ - 'message': string; -} -/** - * - * @export - * @interface RefreshTokenRequest - */ -export interface RefreshTokenRequest { + 'orderHash': string; /** - * + * The client-provided order ID. * @type {string} - * @memberof RefreshTokenRequest + * @memberof OrderCancellationUpdate */ - 'refreshToken': string; -} -/** - * - * @export - * @interface RefreshTokenResponse - */ -export interface RefreshTokenResponse { + 'clientOrderId'?: string; /** - * + * The symbol of the market. * @type {string} - * @memberof RefreshTokenResponse - */ - 'accessToken': string; - /** - * - * @type {number} - * @memberof RefreshTokenResponse + * @memberof OrderCancellationUpdate */ - 'accessTokenValidForSeconds': number; + 'symbol': string; /** - * + * The address of the account. * @type {string} - * @memberof RefreshTokenResponse + * @memberof OrderCancellationUpdate */ - 'refreshToken': string; + 'accountAddress': string; /** - * + * The timestamp of the order creation in milliseconds. * @type {number} - * @memberof RefreshTokenResponse + * @memberof OrderCancellationUpdate */ - 'refreshTokenValidForSeconds': number; -} -/** - * - * @export - * @interface RewardsPoolEntry - */ -export interface RewardsPoolEntry { + 'createdAtMillis': number; /** * - * @type {string} - * @memberof RewardsPoolEntry + * @type {OrderCancelReason} + * @memberof OrderCancellationUpdate */ - 'id'?: string; + 'cancellationReason': OrderCancelReason; /** * - * @type {string} - * @memberof RewardsPoolEntry - */ - 'coin'?: string; -} -/** - * - * @export - * @interface RewardsSummary - */ -export interface RewardsSummary { - /** - * User address for the rewards earned data. - * @type {string} - * @memberof RewardsSummary - */ - 'UserAddress': string; - /** - * Total Blue token rewards earned by the user (e9 format). - * @type {string} - * @memberof RewardsSummary - */ - 'BlueRewardsE9': string; - /** - * Total Sui token rewards earned by the user (e9 format). - * @type {string} - * @memberof RewardsSummary + * @type {OrderCancellationFailureReason} + * @memberof OrderCancellationUpdate */ - 'SuiRewardsE9': string; + 'failureToCancelReason'?: OrderCancellationFailureReason; /** - * Total wal rewards earned by the user (e9 format). + * The remaining quantity of the order. * @type {string} - * @memberof RewardsSummary + * @memberof OrderCancellationUpdate */ - 'WalRewardsE9': string; + 'remainingQuantityE9': string; } + + /** - * The strategy used to resolve self trades. TAKER: On a self trade, the taker order will be cancelled MAKER: On a self trade, the maker order will be cancelled BOTH: On a self trade, both the taker and the maker order will be cancelled UNSPECIFIED: set to default value + * Side of the order * @export * @enum {string} */ -export const SelfTradePreventionType = { - Taker: 'TAKER', - Maker: 'MAKER', - Both: 'BOTH', +export const OrderSide = { + Long: 'LONG', + Short: 'SHORT', Unspecified: 'UNSPECIFIED' } as const; -export type SelfTradePreventionType = typeof SelfTradePreventionType[keyof typeof SelfTradePreventionType]; +export type OrderSide = typeof OrderSide[keyof typeof OrderSide]; /** - * - * @export - * @interface SigPayload - */ -export interface SigPayload { - /** - * Target address for the claim. - * @type {string} - * @memberof SigPayload - */ - 'target': string; - /** - * Receiver address for the claim. - * @type {string} - * @memberof SigPayload - */ - 'receiver': string; - /** - * Amount to be claimed. - * @type {string} - * @memberof SigPayload - */ - 'amount': string; - /** - * Expiry timestamp for the claim. - * @type {string} - * @memberof SigPayload - */ - 'expiry': string; - /** - * Nonce for the claim. - * @type {string} - * @memberof SigPayload - */ - 'nonce': string; - /** - * Type identifier for the claim. - * @type {number} - * @memberof SigPayload - */ - 'type': number; -} -/** - * The order in which results should be sorted. + * The current status of the order. * @export * @enum {string} */ -export const SortOrder = { - Asc: 'ASC', - Desc: 'DESC', +export const OrderStatus = { + Standby: 'STANDBY', + Open: 'OPEN', + PartiallyFilledOpen: 'PARTIALLY_FILLED_OPEN', + PartiallyFilledCanceled: 'PARTIALLY_FILLED_CANCELED', + Filled: 'FILLED', + Cancelled: 'CANCELLED', + Expired: 'EXPIRED', + PartiallyFilledExpired: 'PARTIALLY_FILLED_EXPIRED', Unspecified: 'UNSPECIFIED' } as const; -export type SortOrder = typeof SortOrder[keyof typeof SortOrder]; +export type OrderStatus = typeof OrderStatus[keyof typeof OrderStatus]; /** - * + * The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill * @export - * @interface SponsorTxRequest + * @enum {string} */ -export interface SponsorTxRequest { + +export const OrderTimeInForce = { + Gtt: 'GTT', + Ioc: 'IOC', + Fok: 'FOK', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderTimeInForce = typeof OrderTimeInForce[keyof typeof OrderTimeInForce]; + + +/** + * Configuration for Time-Weighted Average Price orders + * @export + * @interface OrderTwapConfig + */ +export interface OrderTwapConfig { /** - * Base64 encoded transaction bytes to be sponsored. To create txBytes: 1. Create a TransactionBlock with move calls (e.g., deposit_to_asset_bank) 2. Serialize the TransactionBlock to bytes using BCS (Binary Canonical Serialization) 3. Encode the bytes to base64 string Reference implementation: https://github.com/fireflyprotocol/library-sui/blob/1412fff4d4fe7cf6b7ec04d700e777628c57c70a/src/classes/SuiBlocks.ts#L220 + * Number of sub-orders to split the total quantity into * @type {string} - * @memberof SponsorTxRequest + * @memberof OrderTwapConfig */ - 'txBytes': string; + 'subOrdersCount'?: string; + /** + * Total time in minutes over which to execute the TWAP order + * @type {string} + * @memberof OrderTwapConfig + */ + 'runningTimeInMinutes'?: string; } +/** + * The type of order. (BANKRUPTCY_LIQUIDATION is deprecated) + * @export + * @enum {string} + */ + +export const OrderType = { + Limit: 'LIMIT', + Market: 'MARKET', + StopLimit: 'STOP_LIMIT', + StopMarket: 'STOP_MARKET', + Liquidation: 'LIQUIDATION', + StopLossMarket: 'STOP_LOSS_MARKET', + TakeProfitMarket: 'TAKE_PROFIT_MARKET', + StopLossLimit: 'STOP_LOSS_LIMIT', + TakeProfitLimit: 'TAKE_PROFIT_LIMIT', + BankruptcyLiquidation: 'BANKRUPTCY_LIQUIDATION', + TimeWeightedAveragePrice: 'TIME_WEIGHTED_AVERAGE_PRICE', + Adl: 'ADL', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderType = typeof OrderType[keyof typeof OrderType]; + + /** * * @export - * @interface SponsorTxResponse + * @interface OrderbookDepthResponse */ -export interface SponsorTxResponse { +export interface OrderbookDepthResponse { /** - * Base64 encoded sponsored transaction bytes + * Market symbol. * @type {string} - * @memberof SponsorTxResponse + * @memberof OrderbookDepthResponse */ - 'txBytes': string; + 'symbol': string; /** - * Transaction digest + * Count indicating the number of changes in orderbook state. + * @type {number} + * @memberof OrderbookDepthResponse + */ + 'lastUpdateId': number; + /** + * Timestamp at which the last change in orderbook state took place, in milliseconds. + * @type {number} + * @memberof OrderbookDepthResponse + */ + 'updatedAtMillis': number; + /** + * The time at which the orderbook server sent the response, in milliseconds. + * @type {number} + * @memberof OrderbookDepthResponse + */ + 'responseSentAtMillis': number; + /** + * The best bid price on orderbook at the moment (e9 format). * @type {string} - * @memberof SponsorTxResponse + * @memberof OrderbookDepthResponse */ - 'txDigest': string; + 'bestBidPriceE9': string; /** - * Transaction signature + * The best bid quantity on orderbook at the moment (e9 format). * @type {string} - * @memberof SponsorTxResponse + * @memberof OrderbookDepthResponse */ - 'signature': string; + 'bestBidQuantityE9': string; /** - * Transaction expiration time in milliseconds since Unix epoch - * @type {number} - * @memberof SponsorTxResponse + * The best ask price on orderbook at the moment (e9 format). + * @type {string} + * @memberof OrderbookDepthResponse */ - 'expireAtTime': number; + 'bestAskPriceE9': string; + /** + * The best ask quantity on orderbook at the moment (e9 format). + * @type {string} + * @memberof OrderbookDepthResponse + */ + 'bestAskQuantityE9': string; + /** + * Bids to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. + * @type {Array>} + * @memberof OrderbookDepthResponse + */ + 'bidsE9': Array>; + /** + * Asks to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. + * @type {Array>} + * @memberof OrderbookDepthResponse + */ + 'asksE9': Array>; } /** * * @export - * @interface StatsAllTimeResponse + * @interface OrderbookDiffDepthUpdate */ -export interface StatsAllTimeResponse { +export interface OrderbookDiffDepthUpdate { /** - * Timestamp in milliseconds when the statistics period starts. + * The timestamp of the orderbook update. * @type {number} - * @memberof StatsAllTimeResponse + * @memberof OrderbookDiffDepthUpdate */ - 'startTimeAtMillis': number; + 'updatedAtMillis': number; /** - * Total value locked in the legacy exchange in e9 format. + * The symbol of the market for the orderbook update. * @type {string} - * @memberof StatsAllTimeResponse + * @memberof OrderbookDiffDepthUpdate */ - 'legacyTvlE9': string; + 'symbol': string; /** - * Total value locked in the exchange in e9 format. - * @type {string} - * @memberof StatsAllTimeResponse + * + * @type {Array>} + * @memberof OrderbookDiffDepthUpdate */ - 'tvlE9': string; + 'bidsE9': Array>; /** - * Total quote asset volume in the legacy exchange in e9 format. - * @type {string} - * @memberof StatsAllTimeResponse + * + * @type {Array>} + * @memberof OrderbookDiffDepthUpdate */ - 'totalLegacyQuoteAssetVolumeE9': string; + 'asksE9': Array>; /** - * Total quote asset volume in the exchange in e9 format. - * @type {string} - * @memberof StatsAllTimeResponse + * The ID of the first update in this batch. + * @type {number} + * @memberof OrderbookDiffDepthUpdate */ - 'totalQuoteAssetVolumeE9': string; + 'firstUpdateId': number; /** - * Timestamp in milliseconds when the statistics period ends. + * The ID of the last update in this batch. * @type {number} - * @memberof StatsAllTimeResponse + * @memberof OrderbookDiffDepthUpdate */ - 'endTimeAtMillis': number; + 'lastUpdateId': number; } /** * * @export - * @interface StatsEntry + * @interface OrderbookPartialDepthUpdate */ -export interface StatsEntry { +export interface OrderbookPartialDepthUpdate { /** - * Timestamp in milliseconds when the statistics period starts. + * The timestamp of the partial depth update. * @type {number} - * @memberof StatsEntry + * @memberof OrderbookPartialDepthUpdate */ - 'startTimeAtMillis': number; + 'updatedAtMillis': number; /** - * Total value locked in the legacy exchange in e9 format. + * The symbol of the market for the partial depth update. * @type {string} - * @memberof StatsEntry + * @memberof OrderbookPartialDepthUpdate */ - 'legacyTvlE9': string; + 'symbol': string; /** - * Total value locked in the exchange in e9 format. - * @type {string} - * @memberof StatsEntry + * + * @type {Array>} + * @memberof OrderbookPartialDepthUpdate */ - 'tvlE9': string; + 'bidsE9': Array>; /** - * Total quote asset volume in the legacy exchange in e9 format. - * @type {string} - * @memberof StatsEntry + * + * @type {Array>} + * @memberof OrderbookPartialDepthUpdate */ - 'totalLegacyQuoteAssetVolumeE9': string; + 'asksE9': Array>; /** - * Total quote asset volume in the exchange in e9 format. - * @type {string} - * @memberof StatsEntry + * The unique identifier for the orderbook update. + * @type {number} + * @memberof OrderbookPartialDepthUpdate */ - 'totalQuoteAssetVolumeE9': string; + 'orderbookUpdateId': number; /** - * Timestamp in milliseconds when the statistics period ends. - * @type {number} - * @memberof StatsEntry + * The depth level of the orderbook snapshot. + * @type {string} + * @memberof OrderbookPartialDepthUpdate */ - 'endTimeAtMillis': number; + 'depthLevel': OrderbookPartialDepthUpdateDepthLevelEnum; } -/** - * - * @export - * @enum {string} - */ -export const StatsInterval = { - _1d: '1d', - _1w: '1w', - _1Mo: '1Mo', - Unspecified: 'UNSPECIFIED' +export const OrderbookPartialDepthUpdateDepthLevelEnum = { + _5: '5', + _10: '10', + _20: '20' } as const; -export type StatsInterval = typeof StatsInterval[keyof typeof StatsInterval]; - +export type OrderbookPartialDepthUpdateDepthLevelEnum = typeof OrderbookPartialDepthUpdateDepthLevelEnum[keyof typeof OrderbookPartialDepthUpdateDepthLevelEnum]; /** * * @export - * @interface StatsResponse + * @interface Position */ -export interface StatsResponse { +export interface Position { /** - * - * @type {Array} - * @memberof StatsResponse + * Market address. + * @type {string} + * @memberof Position */ - 'data': Array; -} -/** - * Response message indicating the success or failure of a subscription operation. - * @export - * @interface SubscriptionResponseMessage - */ -export interface SubscriptionResponseMessage { + 'symbol': string; /** - * Indicates if the subscription operation was successful. - * @type {boolean} - * @memberof SubscriptionResponseMessage + * Average entry price determined by a simple average of all entry prices resulting in this position size (e9 format). + * @type {string} + * @memberof Position */ - 'success': boolean; + 'avgEntryPriceE9': string; /** - * Additional information about the subscription operation. + * Isolated position leverage (e9 format). * @type {string} - * @memberof SubscriptionResponseMessage - */ - 'message': string; -} -/** - * Indicates the type of subscription action. - * @export - * @enum {string} - */ - -export const SubscriptionType = { - Subscribe: 'Subscribe', - Unsubscribe: 'Unsubscribe' -} as const; - -export type SubscriptionType = typeof SubscriptionType[keyof typeof SubscriptionType]; - - -/** - * - * @export - * @interface TickerAllUpdate - */ -export interface TickerAllUpdate { - /** - * Array of detailed market ticker information for all markets. - * @type {Array} - * @memberof TickerAllUpdate + * @memberof Position */ - 'tickerAll': Array; -} -/** - * - * @export - * @interface TickerResponse - */ -export interface TickerResponse { + 'clientSetLeverageE9': string; /** - * Market symbol. + * Liquidation price (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'symbol': string; + 'liquidationPriceE9': string; /** - * Last trade quantity (e9 format). + * Mark price (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'lastQuantityE9': string; + 'markPriceE9': string; /** - * Last trade time in milliseconds. - * @type {number} - * @memberof TickerResponse + * Notional value (e9 format). + * @type {string} + * @memberof Position */ - 'lastTimeAtMillis': number; + 'notionalValueE9': string; /** - * Last trade price (e9 format). + * Position size (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'lastPriceE9': string; + 'sizeE9': string; /** - * Funding rate value (e9 format). + * Unrealized profit (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'lastFundingRateE9': string; + 'unrealizedPnlE9': string; /** - * Time in milliseconds of next funding rate update. - * @type {number} - * @memberof TickerResponse + * + * @type {PositionSide} + * @memberof Position */ - 'nextFundingTimeAtMillis': number; + 'side': PositionSide; /** - * 8 hr average funding rate (e9 format). + * Initial margin required with current mark price (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'avgFundingRate8hrE9': string; + 'marginRequiredE9': string; /** - * Oracle price of the asset (e9 format). + * Maintenance margin required with current mark price (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'oraclePriceE9': string; + 'maintenanceMarginE9': string; /** - * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). - * @type {number} - * @memberof TickerResponse + * If the position is isolated. + * @type {boolean} + * @memberof Position */ - 'oraclePriceDirection': number; + 'isIsolated': boolean; /** - * Mark price on the exchange (e9 format). + * Margin value present if margin type is isolated (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'markPriceE9': string; + 'isolatedMarginE9': string; /** - * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * Last update time. * @type {number} - * @memberof TickerResponse + * @memberof Position */ - 'markPriceDirection': number; + 'updatedAtMillis': number; /** - * Simple average of bestBid and bestAsk. lastPrice if either is not present (e9 format). + * Total funding rate payment (e9 format). * @type {string} - * @memberof TickerResponse - */ - 'marketPriceE9': string; - /** - * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). - * @type {number} - * @memberof TickerResponse + * @memberof Position */ - 'marketPriceDirection': number; + 'fundingRatePaymentAllTimeE9': string; /** - * Best bid price (e9 format). + * Funding rate payment since last position change (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'bestBidPriceE9': string; + 'fundingRatePaymentSinceChangeE9': string; /** - * Best bid quantity (e9 format). + * Funding rate payment since position opened (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Position */ - 'bestBidQuantityE9': string; + 'fundingRatePaymentSinceOpenedE9': string; +} + + +/** + * The side of the position, either long or short + * @export + * @enum {string} + */ + +export const PositionSide = { + Long: 'LONG', + Short: 'SHORT', + Unspecified: 'UNSPECIFIED' +} as const; + +export type PositionSide = typeof PositionSide[keyof typeof PositionSide]; + + +/** + * The generated zero-knowledge proof points. + * @export + * @interface ProofPoints + */ +export interface ProofPoints { /** - * Best ask price (e9 format). - * @type {string} - * @memberof TickerResponse + * Point A of the proof. + * @type {Array} + * @memberof ProofPoints */ - 'bestAskPriceE9': string; + 'a': Array; /** - * Best ask quantity (e9 format). - * @type {string} - * @memberof TickerResponse + * Point B of the proof. + * @type {Array>} + * @memberof ProofPoints */ - 'bestAskQuantityE9': string; + 'b': Array>; /** - * Open interest value (e9 format). - * @type {string} - * @memberof TickerResponse + * Point C of the proof. + * @type {Array} + * @memberof ProofPoints */ - 'openInterestE9': string; + 'c': Array; +} +/** + * + * @export + * @interface RecentTradesUpdates + */ +export interface RecentTradesUpdates { /** - * Highest Price in the last 24hrs (e9 format). - * @type {string} - * @memberof TickerResponse + * + * @type {Array} + * @memberof RecentTradesUpdates */ - 'highPrice24hrE9': string; + 'trades': Array; +} +/** + * + * @export + * @interface RefereeOnboardResponse + */ +export interface RefereeOnboardResponse { /** - * Lowest Price in the last 24hrs (e9 format). + * Response message indicating if the referral code exists * @type {string} - * @memberof TickerResponse + * @memberof RefereeOnboardResponse */ - 'lowPrice24hrE9': string; + 'message': string; +} +/** + * + * @export + * @interface RefreshTokenRequest + */ +export interface RefreshTokenRequest { /** - * Total market volume in last 24hrs of asset (e9 format). + * * @type {string} - * @memberof TickerResponse + * @memberof RefreshTokenRequest */ - 'volume24hrE9': string; + 'refreshToken': string; +} +/** + * + * @export + * @interface RefreshTokenResponse + */ +export interface RefreshTokenResponse { /** - * Total market volume in last 24hrs in USDC (e9 format). + * * @type {string} - * @memberof TickerResponse + * @memberof RefreshTokenResponse */ - 'quoteVolume24hrE9': string; + 'accessToken': string; /** - * Close price 24hrs ago (e9 format). - * @type {string} - * @memberof TickerResponse + * + * @type {number} + * @memberof RefreshTokenResponse */ - 'closePrice24hrE9': string; + 'accessTokenValidForSeconds': number; /** - * Open price in the last 24hrs (e9 format). + * * @type {string} - * @memberof TickerResponse + * @memberof RefreshTokenResponse */ - 'openPrice24hrE9': string; + 'refreshToken': string; /** - * 24 hour close time in milliseconds. + * * @type {number} - * @memberof TickerResponse - */ - 'closeTime24hrAtMillis': number; - /** - * 24 hour open time in milliseconds. - * @type {number} - * @memberof TickerResponse - */ - 'openTime24hrAtMillis': number; - /** - * First trade id in 24hr. - * @type {number} - * @memberof TickerResponse + * @memberof RefreshTokenResponse */ - 'firstId24hr': number; + 'refreshTokenValidForSeconds': number; +} +/** + * + * @export + * @interface RewardsPoolEntry + */ +export interface RewardsPoolEntry { /** - * Last trade id in 24hr. - * @type {number} - * @memberof TickerResponse + * + * @type {string} + * @memberof RewardsPoolEntry */ - 'lastId24hr': number; + 'id'?: string; /** - * Total number of trades in 24hr. + * * @type {string} - * @memberof TickerResponse + * @memberof RewardsPoolEntry */ - 'count24hr': string; + 'coin'?: string; +} +/** + * + * @export + * @interface RewardsSummary + */ +export interface RewardsSummary { /** - * 24hr Market price change (e9 format). + * User address for the rewards earned data. * @type {string} - * @memberof TickerResponse + * @memberof RewardsSummary */ - 'priceChange24hrE9': string; + 'UserAddress': string; /** - * 24hr Market price change in percentage (e9 format). + * Total Blue token rewards earned by the user (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof RewardsSummary */ - 'priceChangePercent24hrE9': string; + 'BlueRewardsE9': string; /** - * Last update time in milliseconds. - * @type {number} - * @memberof TickerResponse + * Total Sui token rewards earned by the user (e9 format). + * @type {string} + * @memberof RewardsSummary */ - 'updatedAtMillis': number; + 'SuiRewardsE9': string; /** - * Live estimated funding rate based on current hour\'s average market and oracle prices (e9 format). + * Total wal rewards earned by the user (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof RewardsSummary */ - 'estimatedFundingRateE9': string; + 'WalRewardsE9': string; } /** - * Represents detailed market ticker information. + * The strategy used to resolve self trades. TAKER: On a self trade, the taker order will be cancelled MAKER: On a self trade, the maker order will be cancelled BOTH: On a self trade, both the taker and the maker order will be cancelled UNSPECIFIED: set to default value * @export - * @interface TickerUpdate + * @enum {string} */ -export interface TickerUpdate { + +export const SelfTradePreventionType = { + Taker: 'TAKER', + Maker: 'MAKER', + Both: 'BOTH', + Unspecified: 'UNSPECIFIED' +} as const; + +export type SelfTradePreventionType = typeof SelfTradePreventionType[keyof typeof SelfTradePreventionType]; + + +/** + * + * @export + * @interface SigPayload + */ +export interface SigPayload { /** - * Market symbol. + * Target address for the claim. * @type {string} - * @memberof TickerUpdate + * @memberof SigPayload */ - 'symbol': string; + 'target': string; /** - * Last trade quantity (e9 format). + * Receiver address for the claim. * @type {string} - * @memberof TickerUpdate + * @memberof SigPayload */ - 'lastQuantityE9': string; + 'receiver': string; /** - * Last trade time in milliseconds. - * @type {number} - * @memberof TickerUpdate + * Amount to be claimed. + * @type {string} + * @memberof SigPayload */ - 'lastTimeAtMillis': number; + 'amount': string; /** - * Last trade price (e9 format). + * Expiry timestamp for the claim. * @type {string} - * @memberof TickerUpdate + * @memberof SigPayload */ - 'lastPriceE9': string; + 'expiry': string; /** - * Funding rate value (e9 format). + * Nonce for the claim. * @type {string} - * @memberof TickerUpdate + * @memberof SigPayload */ - 'lastFundingRateE9': string; + 'nonce': string; /** - * Time in milliseconds of next funding rate update. + * Type identifier for the claim. * @type {number} - * @memberof TickerUpdate + * @memberof SigPayload */ - 'nextFundingTimeAtMillis': number; + 'type': number; +} +/** + * The order in which results should be sorted. + * @export + * @enum {string} + */ + +export const SortOrder = { + Asc: 'ASC', + Desc: 'DESC', + Unspecified: 'UNSPECIFIED' +} as const; + +export type SortOrder = typeof SortOrder[keyof typeof SortOrder]; + + +/** + * + * @export + * @interface SponsorTxRequest + */ +export interface SponsorTxRequest { /** - * 8 hr average funding rate (e9 format). + * Base64 encoded transaction bytes to be sponsored. To create txBytes: 1. Create a TransactionBlock with move calls (e.g., deposit_to_asset_bank) 2. Serialize the TransactionBlock to bytes using BCS (Binary Canonical Serialization) 3. Encode the bytes to base64 string Reference implementation: https://github.com/fireflyprotocol/library-sui/blob/1412fff4d4fe7cf6b7ec04d700e777628c57c70a/src/classes/SuiBlocks.ts#L220 * @type {string} - * @memberof TickerUpdate + * @memberof SponsorTxRequest */ - 'avgFundingRate8hrE9': string; + 'txBytes': string; +} +/** + * + * @export + * @interface SponsorTxResponse + */ +export interface SponsorTxResponse { /** - * Oracle price of the asset (e9 format). + * Base64 encoded sponsored transaction bytes * @type {string} - * @memberof TickerUpdate + * @memberof SponsorTxResponse */ - 'oraclePriceE9': string; + 'txBytes': string; /** - * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). - * @type {number} - * @memberof TickerUpdate + * Transaction digest + * @type {string} + * @memberof SponsorTxResponse */ - 'oraclePriceDirection': number; + 'txDigest': string; /** - * Mark price on the exchange (e9 format). + * Transaction signature * @type {string} - * @memberof TickerUpdate + * @memberof SponsorTxResponse */ - 'markPriceE9': string; + 'signature': string; /** - * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * Transaction expiration time in milliseconds since Unix epoch * @type {number} - * @memberof TickerUpdate - */ - 'markPriceDirection': number; - /** - * Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format). - * @type {string} - * @memberof TickerUpdate + * @memberof SponsorTxResponse */ - 'marketPriceE9': string; + 'expireAtTime': number; +} +/** + * + * @export + * @interface StatsAllTimeResponse + */ +export interface StatsAllTimeResponse { /** - * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * Timestamp in milliseconds when the statistics period starts. * @type {number} - * @memberof TickerUpdate + * @memberof StatsAllTimeResponse */ - 'marketPriceDirection': number; + 'startTimeAtMillis': number; /** - * Best bid price (e9 format). + * Total value locked in the legacy exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsAllTimeResponse */ - 'bestBidPriceE9': string; + 'legacyTvlE9': string; /** - * Best bid quantity (e9 format). + * Total value locked in the exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsAllTimeResponse */ - 'bestBidQuantityE9': string; + 'tvlE9': string; /** - * Best ask price (e9 format). + * Total quote asset volume in the legacy exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsAllTimeResponse */ - 'bestAskPriceE9': string; + 'totalLegacyQuoteAssetVolumeE9': string; /** - * Best ask quantity (e9 format). + * Total quote asset volume in the exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsAllTimeResponse */ - 'bestAskQuantityE9': string; + 'totalQuoteAssetVolumeE9': string; /** - * Open interest value (e9 format). - * @type {string} - * @memberof TickerUpdate + * Timestamp in milliseconds when the statistics period ends. + * @type {number} + * @memberof StatsAllTimeResponse */ - 'openInterestE9': string; + 'endTimeAtMillis': number; +} +/** + * + * @export + * @interface StatsEntry + */ +export interface StatsEntry { /** - * Highest Price in the last 24 hours (e9 format). - * @type {string} - * @memberof TickerUpdate + * Timestamp in milliseconds when the statistics period starts. + * @type {number} + * @memberof StatsEntry */ - 'highPrice24hrE9': string; - /** - * Lowest Price in the last 24 hours (e9 format). - * @type {string} - * @memberof TickerUpdate - */ - 'lowPrice24hrE9': string; + 'startTimeAtMillis': number; /** - * Total market volume in last 24 hours of asset (e9 format). + * Total value locked in the legacy exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsEntry */ - 'volume24hrE9': string; + 'legacyTvlE9': string; /** - * Total market volume in last 24 hours in USDC (e9 format). + * Total value locked in the exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsEntry */ - 'quoteVolume24hrE9': string; + 'tvlE9': string; /** - * Close price 24 hours ago (e9 format). + * Total quote asset volume in the legacy exchange in e9 format. * @type {string} - * @memberof TickerUpdate + * @memberof StatsEntry */ - 'closePrice24hrE9': string; + 'totalLegacyQuoteAssetVolumeE9': string; /** - * Open price in the last 24 hours (e9 format). + * Total quote asset volume in the exchange in e9 format. * @type {string} - * @memberof TickerUpdate - */ - 'openPrice24hrE9': string; - /** - * 24 hour close timestamp in milliseconds. - * @type {number} - * @memberof TickerUpdate - */ - 'closeTime24hrAtMillis': number; - /** - * 24 hour open timetamp in milliseconds. - * @type {number} - * @memberof TickerUpdate - */ - 'openTime24hrAtMillis': number; - /** - * First trade ID in the last 24 hours. - * @type {number} - * @memberof TickerUpdate + * @memberof StatsEntry */ - 'firstId24hr': number; + 'totalQuoteAssetVolumeE9': string; /** - * Last trade ID in the last 24 hours. + * Timestamp in milliseconds when the statistics period ends. * @type {number} - * @memberof TickerUpdate + * @memberof StatsEntry */ - 'lastId24hr': number; + 'endTimeAtMillis': number; +} +/** + * + * @export + * @enum {string} + */ + +export const StatsInterval = { + _1d: '1d', + _1w: '1w', + _1Mo: '1Mo', + Unspecified: 'UNSPECIFIED' +} as const; + +export type StatsInterval = typeof StatsInterval[keyof typeof StatsInterval]; + + +/** + * + * @export + * @interface StatsResponse + */ +export interface StatsResponse { /** - * Total number of trades in the last 24 hours. - * @type {string} - * @memberof TickerUpdate + * + * @type {Array} + * @memberof StatsResponse */ - 'count24hr': string; + 'data': Array; +} +/** + * Response message indicating the success or failure of a subscription operation. + * @export + * @interface SubscriptionResponseMessage + */ +export interface SubscriptionResponseMessage { /** - * 24 hour Market price change (e9 format). - * @type {string} - * @memberof TickerUpdate + * Indicates if the subscription operation was successful. + * @type {boolean} + * @memberof SubscriptionResponseMessage */ - 'priceChange24hrE9': string; + 'success': boolean; /** - * 24 hour Market price change as a percentage (e9 format). + * Additional information about the subscription operation. * @type {string} - * @memberof TickerUpdate + * @memberof SubscriptionResponseMessage */ - 'priceChangePercent24hrE9': string; + 'message': string; +} +/** + * Indicates the type of subscription action. + * @export + * @enum {string} + */ + +export const SubscriptionType = { + Subscribe: 'Subscribe', + Unsubscribe: 'Unsubscribe' +} as const; + +export type SubscriptionType = typeof SubscriptionType[keyof typeof SubscriptionType]; + + +/** + * + * @export + * @interface TickerAllUpdate + */ +export interface TickerAllUpdate { /** - * Last update timestamp in milliseconds. - * @type {number} - * @memberof TickerUpdate + * Array of detailed market ticker information for all markets. + * @type {Array} + * @memberof TickerAllUpdate */ - 'updatedAtMillis': number; + 'tickerAll': Array; } /** * * @export - * @interface Trade + * @interface TickerResponse */ -export interface Trade { +export interface TickerResponse { /** - * Trade ID + * Market symbol. * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'id': string; + 'symbol': string; /** - * Client order ID. + * Last trade quantity (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'clientOrderId'?: string; + 'lastQuantityE9': string; /** - * Market address. - * @type {string} - * @memberof Trade + * Last trade time in milliseconds. + * @type {number} + * @memberof TickerResponse */ - 'symbol'?: string; + 'lastTimeAtMillis': number; /** - * Order hash. + * Last trade price (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'orderHash'?: string; + 'lastPriceE9': string; /** - * - * @type {OrderType} - * @memberof Trade + * Funding rate value (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'orderType'?: OrderType; + 'lastFundingRateE9': string; /** - * - * @type {TradeType} - * @memberof Trade + * Time in milliseconds of next funding rate update. + * @type {number} + * @memberof TickerResponse */ - 'tradeType'?: TradeType; + 'nextFundingTimeAtMillis': number; /** - * - * @type {TradeSide} - * @memberof Trade + * 8 hr average funding rate (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'side': TradeSide; + 'avgFundingRate8hrE9': string; /** - * Indicates if the user was a maker to the trade. - * @type {boolean} - * @memberof Trade + * Oracle price of the asset (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'isMaker'?: boolean; + 'oraclePriceE9': string; /** - * Trade price (e9 format). - * @type {string} - * @memberof Trade + * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * @type {number} + * @memberof TickerResponse */ - 'priceE9': string; + 'oraclePriceDirection': number; /** - * Trade quantity (e9 format). + * Mark price on the exchange (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'quantityE9': string; + 'markPriceE9': string; /** - * Quote quantity (e9 format). - * @type {string} - * @memberof Trade + * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * @type {number} + * @memberof TickerResponse */ - 'quoteQuantityE9': string; + 'markPriceDirection': number; /** - * Realized profit and loss (e9 format). + * Simple average of bestBid and bestAsk. lastPrice if either is not present (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'realizedPnlE9'?: string; + 'marketPriceE9': string; /** - * - * @type {PositionSide} - * @memberof Trade + * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * @type {number} + * @memberof TickerResponse */ - 'positionSide'?: PositionSide; + 'marketPriceDirection': number; /** - * Trading fee (e9 format). + * Best bid price (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'tradingFeeE9'?: string; + 'bestBidPriceE9': string; /** - * Asset used for trading fee. + * Best bid quantity (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'tradingFeeAsset'?: string; + 'bestBidQuantityE9': string; /** - * Gas fee. + * Best ask price (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'gasFeeE9'?: string; + 'bestAskPriceE9': string; /** - * Asset used for gas fee. + * Best ask quantity (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'gasFeeAsset'?: string; + 'bestAskQuantityE9': string; /** - * Mark price at the time of trade execution (e9 format). + * Open interest value (e9 format). * @type {string} - * @memberof Trade + * @memberof TickerResponse */ - 'markPriceE9'?: string; + 'openInterestE9': string; /** - * Oracle price at the time of trade execution (e9 format). + * Highest Price in the last 24hrs (e9 format). * @type {string} - * @memberof Trade - */ - 'oraclePriceE9'?: string; - /** - * Trade timestamp in milliseconds since Unix epoch. - * @type {number} - * @memberof Trade + * @memberof TickerResponse */ - 'executedAtMillis': number; -} - - -/** - * Trade side based on the user order in this trade. - * @export - * @enum {string} - */ - -export const TradeSide = { - Long: 'LONG', - Short: 'SHORT', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TradeSide = typeof TradeSide[keyof typeof TradeSide]; - - -/** - * Type of trade. - * @export - * @enum {string} - */ - -export const TradeType = { - Order: 'ORDER', - Liquidation: 'LIQUIDATION', - Deleverage: 'DELEVERAGE', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TradeType = typeof TradeType[keyof typeof TradeType]; - - -/** - * - * @export - * @interface TradingFees - */ -export interface TradingFees { + 'highPrice24hrE9': string; /** - * The Account Maker Fee (e9 format). + * Lowest Price in the last 24hrs (e9 format). * @type {string} - * @memberof TradingFees + * @memberof TickerResponse */ - 'makerFeeE9': string; + 'lowPrice24hrE9': string; /** - * The Account Taker Fee (e9 format). + * Total market volume in last 24hrs of asset (e9 format). * @type {string} - * @memberof TradingFees - */ - 'takerFeeE9': string; - /** - * Are the fees applied on the account? - * @type {boolean} - * @memberof TradingFees + * @memberof TickerResponse */ - 'isApplied': boolean; -} -/** - * - * @export - * @interface Transaction - */ -export interface Transaction { + 'volume24hrE9': string; /** - * Transaction ID. + * Total market volume in last 24hrs in USDC (e9 format). * @type {string} - * @memberof Transaction + * @memberof TickerResponse */ - 'id': string; + 'quoteVolume24hrE9': string; /** - * Market address. + * Close price 24hrs ago (e9 format). * @type {string} - * @memberof Transaction - */ - 'symbol'?: string; - /** - * - * @type {TransactionType} - * @memberof Transaction + * @memberof TickerResponse */ - 'type': TransactionType; + 'closePrice24hrE9': string; /** - * Amount in e9 format (positive or negative). + * Open price in the last 24hrs (e9 format). * @type {string} - * @memberof Transaction + * @memberof TickerResponse */ - 'amountE9': string; + 'openPrice24hrE9': string; /** - * Transaction status (SUCCESS, REJECTED). - * @type {string} - * @memberof Transaction + * 24 hour close time in milliseconds. + * @type {number} + * @memberof TickerResponse */ - 'status'?: string; + 'closeTime24hrAtMillis': number; /** - * Asset bank address. - * @type {string} - * @memberof Transaction + * 24 hour open time in milliseconds. + * @type {number} + * @memberof TickerResponse */ - 'assetSymbol': string; + 'openTime24hrAtMillis': number; /** - * Trade ID - * @type {string} - * @memberof Transaction + * First trade id in 24hr. + * @type {number} + * @memberof TickerResponse */ - 'tradeId'?: string; + 'firstId24hr': number; /** - * Transaction timestamp in milliseconds since Unix epoch. + * Last trade id in 24hr. * @type {number} - * @memberof Transaction + * @memberof TickerResponse */ - 'executedAtMillis': number; -} - - -/** - * Transaction type (what caused the change in the asset balance). - * @export - * @enum {string} - */ - -export const TransactionType = { - Transfer: 'TRANSFER', - Deposit: 'DEPOSIT', - Withdraw: 'WITHDRAW', - RealizedPnl: 'REALIZED_PNL', - FundingFee: 'FUNDING_FEE', - TradingFee: 'TRADING_FEE', - TradingGasFee: 'TRADING_GAS_FEE', - Bonus: 'BONUS', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TransactionType = typeof TransactionType[keyof typeof TransactionType]; - - -/** - * - * @export - * @interface UpdateAccountPreferenceRequest - */ -export interface UpdateAccountPreferenceRequest { - [key: string]: any; - + 'lastId24hr': number; /** - * User preferred language. + * Total number of trades in 24hr. * @type {string} - * @memberof UpdateAccountPreferenceRequest + * @memberof TickerResponse */ - 'language'?: string; + 'count24hr': string; /** - * User preferred theme. + * 24hr Market price change (e9 format). * @type {string} - * @memberof UpdateAccountPreferenceRequest + * @memberof TickerResponse */ - 'theme'?: string; + 'priceChange24hrE9': string; /** - * - * @type {Array} - * @memberof UpdateAccountPreferenceRequest + * 24hr Market price change in percentage (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'market'?: Array; -} -/** - * - * @export - * @interface UpdateAffiliateEmberRefferalShareRequest - */ -export interface UpdateAffiliateEmberRefferalShareRequest { + 'priceChangePercent24hrE9': string; /** - * Ember refferal share for an affiliate. + * Last update time in milliseconds. * @type {number} - * @memberof UpdateAffiliateEmberRefferalShareRequest + * @memberof TickerResponse */ - 'emberRefferalShare': number; -} -/** - * - * @export - * @interface UpdateAffiliateFeeConfigRequest - */ -export interface UpdateAffiliateFeeConfigRequest { + 'updatedAtMillis': number; /** - * Cashback amount to give to the referees - * @type {number} - * @memberof UpdateAffiliateFeeConfigRequest + * Live estimated funding rate based on current hour\'s average market and oracle prices (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'cashback': number; + 'estimatedFundingRateE9': string; } /** - * + * Represents detailed market ticker information. * @export - * @interface UserCampaignRewards + * @interface TickerUpdate */ -export interface UserCampaignRewards { +export interface TickerUpdate { /** - * User address for the rewards earned data. + * Market symbol. * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'userAddress': string; + 'symbol': string; /** - * Name of the campaign. + * Last trade quantity (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'campaignName': string; + 'lastQuantityE9': string; /** - * Epoch number for the rewards earned data. + * Last trade time in milliseconds. * @type {number} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'epochNumber': number; + 'lastTimeAtMillis': number; /** - * Interval number for the rewards earned data. - * @type {number} - * @memberof UserCampaignRewards + * Last trade price (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'intervalNumber': number; + 'lastPriceE9': string; /** - * Market Symbol. + * Funding rate value (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'symbol': string; + 'lastFundingRateE9': string; /** - * - * @type {string} - * @memberof UserCampaignRewards + * Time in milliseconds of next funding rate update. + * @type {number} + * @memberof TickerUpdate */ - 'status': UserCampaignRewardsStatusEnum; + 'nextFundingTimeAtMillis': number; /** - * Total blue-perp token rewards earned in the epoch (e9 format). + * 8 hr average funding rate (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'blueRewardsE9': string; + 'avgFundingRate8hrE9': string; /** - * Total sui-perp token rewards earned in the epoch (e9 format). + * Oracle price of the asset (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'suiRewardsE9': string; + 'oraclePriceE9': string; /** - * Total wal-perp rewards earned in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards + * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * @type {number} + * @memberof TickerUpdate */ - 'walRewardsE9': string; + 'oraclePriceDirection': number; /** - * Total cash rewards earned in the epoch (e9 format). + * Mark price on the exchange (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'cashRewardsE9': string; + 'markPriceE9': string; /** - * Total user fee paid in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards + * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * @type {number} + * @memberof TickerUpdate */ - 'userFeePaidE9': string; + 'markPriceDirection': number; /** - * Time in milliseconds for interval start date. - * @type {number} - * @memberof UserCampaignRewards + * Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'intervalStartDate': number; + 'marketPriceE9': string; /** - * Time in milliseconds for interval end date. + * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). * @type {number} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'intervalEndDate': number; + 'marketPriceDirection': number; /** - * Indicates if the rewards have been disbursed. - * @type {boolean} - * @memberof UserCampaignRewards + * Best bid price (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'isDisbursed': boolean; + 'bestBidPriceE9': string; /** - * Transaction digest of the disbursement. + * Best bid quantity (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'txnDigest': string; + 'bestBidQuantityE9': string; /** - * Array of claim signatures for different reward types. - * @type {Array} - * @memberof UserCampaignRewards + * Best ask price (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'claimSignature'?: Array; + 'bestAskPriceE9': string; /** - * Status of the claim. + * Best ask quantity (e9 format). * @type {string} - * @memberof UserCampaignRewards + * @memberof TickerUpdate */ - 'claimStatus'?: UserCampaignRewardsClaimStatusEnum; -} - -export const UserCampaignRewardsStatusEnum = { - Active: 'ACTIVE', - NotStarted: 'NOT_STARTED', - Finalized: 'FINALIZED', - Cooldown: 'COOLDOWN' -} as const; - -export type UserCampaignRewardsStatusEnum = typeof UserCampaignRewardsStatusEnum[keyof typeof UserCampaignRewardsStatusEnum]; -export const UserCampaignRewardsClaimStatusEnum = { - Claimable: 'CLAIMABLE', - Claimed: 'CLAIMED', - NotYetClaimable: 'NOT_YET_CLAIMABLE', - ClaimEnded: 'CLAIM_ENDED' -} as const; - -export type UserCampaignRewardsClaimStatusEnum = typeof UserCampaignRewardsClaimStatusEnum[keyof typeof UserCampaignRewardsClaimStatusEnum]; - -/** - * - * @export - * @interface WithdrawRequest - */ -export interface WithdrawRequest { + 'bestAskQuantityE9': string; /** - * - * @type {WithdrawRequestSignedFields} - * @memberof WithdrawRequest + * Open interest value (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'signedFields': WithdrawRequestSignedFields; + 'openInterestE9': string; /** - * The signature of the request, encoded from the signedFields + * Highest Price in the last 24 hours (e9 format). * @type {string} - * @memberof WithdrawRequest + * @memberof TickerUpdate */ - 'signature': string; -} -/** - * - * @export - * @interface WithdrawRequestSignedFields - */ -export interface WithdrawRequestSignedFields { + 'highPrice24hrE9': string; /** - * Asset symbol of the withdrawn asset + * Lowest Price in the last 24 hours (e9 format). * @type {string} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'assetSymbol': string; + 'lowPrice24hrE9': string; /** - * The Account Address from which to withdraw assets + * Total market volume in last 24 hours of asset (e9 format). * @type {string} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'accountAddress': string; + 'volume24hrE9': string; /** - * The amount in e9 of the asset that the User will withdraw from their account + * Total market volume in last 24 hours in USDC (e9 format). * @type {string} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'amountE9': string; + 'quoteVolume24hrE9': string; /** - * A uniqueness modifier for the request. This is added to guarantee uniqueness of the request. Usually a mix of timestamp and a random number + * Close price 24 hours ago (e9 format). * @type {string} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'salt': string; + 'closePrice24hrE9': string; /** - * the ID of the external datastore for the target network + * Open price in the last 24 hours (e9 format). * @type {string} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'edsId': string; + 'openPrice24hrE9': string; /** - * The timestamp in milliseconds when the HTTP Request payload has been signed + * 24 hour close timestamp in milliseconds. * @type {number} - * @memberof WithdrawRequestSignedFields + * @memberof TickerUpdate */ - 'signedAtMillis': number; -} -/** - * - * @export - * @interface ZKLoginUserDetailsResponse - */ -export interface ZKLoginUserDetailsResponse { + 'closeTime24hrAtMillis': number; /** - * The zkLogin user salt. - * @type {string} - * @memberof ZKLoginUserDetailsResponse + * 24 hour open timetamp in milliseconds. + * @type {number} + * @memberof TickerUpdate */ - 'salt': string; + 'openTime24hrAtMillis': number; /** - * The zkLogin user\'s address. - * @type {string} - * @memberof ZKLoginUserDetailsResponse + * First trade ID in the last 24 hours. + * @type {number} + * @memberof TickerUpdate */ - 'address': string; + 'firstId24hr': number; /** - * The zkLogin user\'s public key. - * @type {string} - * @memberof ZKLoginUserDetailsResponse + * Last trade ID in the last 24 hours. + * @type {number} + * @memberof TickerUpdate */ - 'publicKey': string; -} -/** - * - * @export - * @interface ZKLoginZKPRequest - */ -export interface ZKLoginZKPRequest { + 'lastId24hr': number; /** - * The network to use (e.g., \"mainnet\", \"testnet\"). + * Total number of trades in the last 24 hours. * @type {string} - * @memberof ZKLoginZKPRequest + * @memberof TickerUpdate */ - 'network'?: string; + 'count24hr': string; /** - * The ephemeral public key for the ZK proof. + * 24 hour Market price change (e9 format). * @type {string} - * @memberof ZKLoginZKPRequest + * @memberof TickerUpdate */ - 'ephemeralPublicKey': string; + 'priceChange24hrE9': string; /** - * The maximum epoch for the ZK proof. - * @type {number} - * @memberof ZKLoginZKPRequest + * 24 hour Market price change as a percentage (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'maxEpoch': number; + 'priceChangePercent24hrE9': string; /** - * Randomness value for the ZK proof. - * @type {string} - * @memberof ZKLoginZKPRequest + * Last update timestamp in milliseconds. + * @type {number} + * @memberof TickerUpdate */ - 'randomness': string; + 'updatedAtMillis': number; } /** * * @export - * @interface ZKLoginZKPResponse + * @interface Trade */ -export interface ZKLoginZKPResponse { +export interface Trade { /** - * - * @type {ProofPoints} - * @memberof ZKLoginZKPResponse + * Trade ID + * @type {string} + * @memberof Trade */ - 'proofPoints'?: ProofPoints; + 'id': string; /** - * - * @type {IssBase64Details} - * @memberof ZKLoginZKPResponse + * Client order ID. + * @type {string} + * @memberof Trade */ - 'issBase64Details'?: IssBase64Details; + 'clientOrderId'?: string; /** - * Base64 encoded header information. + * Market address. * @type {string} - * @memberof ZKLoginZKPResponse + * @memberof Trade */ - 'headerBase64'?: string; + 'symbol'?: string; /** - * The address seed used in the proof. + * Order hash. * @type {string} - * @memberof ZKLoginZKPResponse + * @memberof Trade */ - 'addressSeed': string; + 'orderHash'?: string; + /** + * + * @type {OrderType} + * @memberof Trade + */ + 'orderType'?: OrderType; + /** + * + * @type {TradeType} + * @memberof Trade + */ + 'tradeType'?: TradeType; + /** + * + * @type {TradeSide} + * @memberof Trade + */ + 'side': TradeSide; + /** + * Indicates if the user was a maker to the trade. + * @type {boolean} + * @memberof Trade + */ + 'isMaker'?: boolean; + /** + * Trade price (e9 format). + * @type {string} + * @memberof Trade + */ + 'priceE9': string; + /** + * Trade quantity (e9 format). + * @type {string} + * @memberof Trade + */ + 'quantityE9': string; + /** + * Quote quantity (e9 format). + * @type {string} + * @memberof Trade + */ + 'quoteQuantityE9': string; + /** + * Realized profit and loss (e9 format). + * @type {string} + * @memberof Trade + */ + 'realizedPnlE9'?: string; + /** + * + * @type {PositionSide} + * @memberof Trade + */ + 'positionSide'?: PositionSide; + /** + * Trading fee (e9 format). + * @type {string} + * @memberof Trade + */ + 'tradingFeeE9'?: string; + /** + * Asset used for trading fee. + * @type {string} + * @memberof Trade + */ + 'tradingFeeAsset'?: string; + /** + * Gas fee. + * @type {string} + * @memberof Trade + */ + 'gasFeeE9'?: string; + /** + * Asset used for gas fee. + * @type {string} + * @memberof Trade + */ + 'gasFeeAsset'?: string; + /** + * Mark price at the time of trade execution (e9 format). + * @type {string} + * @memberof Trade + */ + 'markPriceE9'?: string; + /** + * Oracle price at the time of trade execution (e9 format). + * @type {string} + * @memberof Trade + */ + 'oraclePriceE9'?: string; + /** + * Trade timestamp in milliseconds since Unix epoch. + * @type {number} + * @memberof Trade + */ + 'executedAtMillis': number; +} + + +/** + * Trade side based on the user order in this trade. + * @export + * @enum {string} + */ + +export const TradeSide = { + Long: 'LONG', + Short: 'SHORT', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TradeSide = typeof TradeSide[keyof typeof TradeSide]; + + +/** + * Type of trade. + * @export + * @enum {string} + */ + +export const TradeType = { + Order: 'ORDER', + Liquidation: 'LIQUIDATION', + Deleverage: 'DELEVERAGE', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TradeType = typeof TradeType[keyof typeof TradeType]; + + +/** + * + * @export + * @interface TradingFees + */ +export interface TradingFees { + /** + * The Account Maker Fee (e9 format). + * @type {string} + * @memberof TradingFees + */ + 'makerFeeE9': string; + /** + * The Account Taker Fee (e9 format). + * @type {string} + * @memberof TradingFees + */ + 'takerFeeE9': string; + /** + * Are the fees applied on the account? + * @type {boolean} + * @memberof TradingFees + */ + 'isApplied': boolean; +} +/** + * + * @export + * @interface Transaction + */ +export interface Transaction { + /** + * Transaction ID. + * @type {string} + * @memberof Transaction + */ + 'id': string; + /** + * Market address. + * @type {string} + * @memberof Transaction + */ + 'symbol'?: string; + /** + * + * @type {TransactionType} + * @memberof Transaction + */ + 'type': TransactionType; + /** + * Amount in e9 format (positive or negative). + * @type {string} + * @memberof Transaction + */ + 'amountE9': string; + /** + * Transaction status (SUCCESS, REJECTED). + * @type {string} + * @memberof Transaction + */ + 'status'?: string; + /** + * Asset bank address. + * @type {string} + * @memberof Transaction + */ + 'assetSymbol': string; + /** + * Trade ID + * @type {string} + * @memberof Transaction + */ + 'tradeId'?: string; + /** + * Transaction timestamp in milliseconds since Unix epoch. + * @type {number} + * @memberof Transaction + */ + 'executedAtMillis': number; } + +/** + * Transaction type (what caused the change in the asset balance). + * @export + * @enum {string} + */ + +export const TransactionType = { + Transfer: 'TRANSFER', + Deposit: 'DEPOSIT', + Withdraw: 'WITHDRAW', + RealizedPnl: 'REALIZED_PNL', + FundingFee: 'FUNDING_FEE', + TradingFee: 'TRADING_FEE', + TradingGasFee: 'TRADING_GAS_FEE', + Bonus: 'BONUS', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TransactionType = typeof TransactionType[keyof typeof TransactionType]; + + +/** + * + * @export + * @interface UpdateAccountPreferenceRequest + */ +export interface UpdateAccountPreferenceRequest { + [key: string]: any; + + /** + * User preferred language. + * @type {string} + * @memberof UpdateAccountPreferenceRequest + */ + 'language'?: string; + /** + * User preferred theme. + * @type {string} + * @memberof UpdateAccountPreferenceRequest + */ + 'theme'?: string; + /** + * + * @type {Array} + * @memberof UpdateAccountPreferenceRequest + */ + 'market'?: Array; +} +/** + * + * @export + * @interface UpdateAffiliateEmberRefferalShareRequest + */ +export interface UpdateAffiliateEmberRefferalShareRequest { + /** + * Ember refferal share for an affiliate. + * @type {number} + * @memberof UpdateAffiliateEmberRefferalShareRequest + */ + 'emberRefferalShare': number; +} +/** + * + * @export + * @interface UpdateAffiliateFeeConfigRequest + */ +export interface UpdateAffiliateFeeConfigRequest { + /** + * Cashback amount to give to the referees + * @type {number} + * @memberof UpdateAffiliateFeeConfigRequest + */ + 'cashback': number; +} +/** + * + * @export + * @interface UserCampaignRewards + */ +export interface UserCampaignRewards { + /** + * User address for the rewards earned data. + * @type {string} + * @memberof UserCampaignRewards + */ + 'userAddress': string; + /** + * Name of the campaign. + * @type {string} + * @memberof UserCampaignRewards + */ + 'campaignName': string; + /** + * Epoch number for the rewards earned data. + * @type {number} + * @memberof UserCampaignRewards + */ + 'epochNumber': number; + /** + * Interval number for the rewards earned data. + * @type {number} + * @memberof UserCampaignRewards + */ + 'intervalNumber': number; + /** + * Market Symbol. + * @type {string} + * @memberof UserCampaignRewards + */ + 'symbol': string; + /** + * + * @type {string} + * @memberof UserCampaignRewards + */ + 'status': UserCampaignRewardsStatusEnum; + /** + * Total blue-perp token rewards earned in the epoch (e9 format). + * @type {string} + * @memberof UserCampaignRewards + */ + 'blueRewardsE9': string; + /** + * Total sui-perp token rewards earned in the epoch (e9 format). + * @type {string} + * @memberof UserCampaignRewards + */ + 'suiRewardsE9': string; + /** + * Total wal-perp rewards earned in the epoch (e9 format). + * @type {string} + * @memberof UserCampaignRewards + */ + 'walRewardsE9': string; + /** + * Total cash rewards earned in the epoch (e9 format). + * @type {string} + * @memberof UserCampaignRewards + */ + 'cashRewardsE9': string; + /** + * Total user fee paid in the epoch (e9 format). + * @type {string} + * @memberof UserCampaignRewards + */ + 'userFeePaidE9': string; + /** + * Time in milliseconds for interval start date. + * @type {number} + * @memberof UserCampaignRewards + */ + 'intervalStartDate': number; + /** + * Time in milliseconds for interval end date. + * @type {number} + * @memberof UserCampaignRewards + */ + 'intervalEndDate': number; + /** + * Indicates if the rewards have been disbursed. + * @type {boolean} + * @memberof UserCampaignRewards + */ + 'isDisbursed': boolean; + /** + * Transaction digest of the disbursement. + * @type {string} + * @memberof UserCampaignRewards + */ + 'txnDigest': string; + /** + * Array of claim signatures for different reward types. + * @type {Array} + * @memberof UserCampaignRewards + */ + 'claimSignature'?: Array; + /** + * Status of the claim. + * @type {string} + * @memberof UserCampaignRewards + */ + 'claimStatus'?: UserCampaignRewardsClaimStatusEnum; +} + +export const UserCampaignRewardsStatusEnum = { + Active: 'ACTIVE', + NotStarted: 'NOT_STARTED', + Finalized: 'FINALIZED', + Cooldown: 'COOLDOWN' +} as const; + +export type UserCampaignRewardsStatusEnum = typeof UserCampaignRewardsStatusEnum[keyof typeof UserCampaignRewardsStatusEnum]; +export const UserCampaignRewardsClaimStatusEnum = { + Claimable: 'CLAIMABLE', + Claimed: 'CLAIMED', + NotYetClaimable: 'NOT_YET_CLAIMABLE', + ClaimEnded: 'CLAIM_ENDED' +} as const; + +export type UserCampaignRewardsClaimStatusEnum = typeof UserCampaignRewardsClaimStatusEnum[keyof typeof UserCampaignRewardsClaimStatusEnum]; + +/** + * + * @export + * @interface WithdrawRequest + */ +export interface WithdrawRequest { + /** + * + * @type {WithdrawRequestSignedFields} + * @memberof WithdrawRequest + */ + 'signedFields': WithdrawRequestSignedFields; + /** + * The signature of the request, encoded from the signedFields + * @type {string} + * @memberof WithdrawRequest + */ + 'signature': string; +} +/** + * + * @export + * @interface WithdrawRequestSignedFields + */ +export interface WithdrawRequestSignedFields { + /** + * Asset symbol of the withdrawn asset + * @type {string} + * @memberof WithdrawRequestSignedFields + */ + 'assetSymbol': string; + /** + * The Account Address from which to withdraw assets + * @type {string} + * @memberof WithdrawRequestSignedFields + */ + 'accountAddress': string; + /** + * The amount in e9 of the asset that the User will withdraw from their account + * @type {string} + * @memberof WithdrawRequestSignedFields + */ + 'amountE9': string; + /** + * A uniqueness modifier for the request. This is added to guarantee uniqueness of the request. Usually a mix of timestamp and a random number + * @type {string} + * @memberof WithdrawRequestSignedFields + */ + 'salt': string; + /** + * the ID of the external datastore for the target network + * @type {string} + * @memberof WithdrawRequestSignedFields + */ + 'edsId': string; + /** + * The timestamp in milliseconds when the HTTP Request payload has been signed + * @type {number} + * @memberof WithdrawRequestSignedFields + */ + 'signedAtMillis': number; +} +/** + * + * @export + * @interface ZKLoginUserDetailsResponse + */ +export interface ZKLoginUserDetailsResponse { + /** + * The zkLogin user salt. + * @type {string} + * @memberof ZKLoginUserDetailsResponse + */ + 'salt': string; + /** + * The zkLogin user\'s address. + * @type {string} + * @memberof ZKLoginUserDetailsResponse + */ + 'address': string; + /** + * The zkLogin user\'s public key. + * @type {string} + * @memberof ZKLoginUserDetailsResponse + */ + 'publicKey': string; +} +/** + * + * @export + * @interface ZKLoginZKPRequest + */ +export interface ZKLoginZKPRequest { + /** + * The network to use (e.g., \"mainnet\", \"testnet\"). + * @type {string} + * @memberof ZKLoginZKPRequest + */ + 'network'?: string; + /** + * The ephemeral public key for the ZK proof. + * @type {string} + * @memberof ZKLoginZKPRequest + */ + 'ephemeralPublicKey': string; + /** + * The maximum epoch for the ZK proof. + * @type {number} + * @memberof ZKLoginZKPRequest + */ + 'maxEpoch': number; + /** + * Randomness value for the ZK proof. + * @type {string} + * @memberof ZKLoginZKPRequest + */ + 'randomness': string; +} +/** + * + * @export + * @interface ZKLoginZKPResponse + */ +export interface ZKLoginZKPResponse { + /** + * + * @type {ProofPoints} + * @memberof ZKLoginZKPResponse + */ + 'proofPoints'?: ProofPoints; + /** + * + * @type {IssBase64Details} + * @memberof ZKLoginZKPResponse + */ + 'issBase64Details'?: IssBase64Details; + /** + * Base64 encoded header information. + * @type {string} + * @memberof ZKLoginZKPResponse + */ + 'headerBase64'?: string; + /** + * The address seed used in the proof. + * @type {string} + * @memberof ZKLoginZKPResponse + */ + 'addressSeed': string; +} + +/** + * AccountDataApi - axios parameter creator + * @export + */ +export const AccountDataApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Retrieves the user\'s account details. + * @summary /account + * @param {string} [accountAddress] Account address to fetch account details by. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountDetails: async (accountAddress?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account`; + // 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 (accountAddress !== undefined) { + localVarQueryParameter['accountAddress'] = accountAddress; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the funding rate history for a specific account. + * @summary /account/fundingRateHistory + * @param {string} [accountAddress] Account address to filter funding rate history by. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountFundingRateHistory: async (accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account/fundingRateHistory`; + // 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; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (accountAddress !== undefined) { + localVarQueryParameter['accountAddress'] = accountAddress; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the user\'s account preferences. + * @summary /account/preferences + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountPreferences: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account/preferences`; + // 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; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the user\'s trade history. + * @summary /account/trades + * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountTrades: async (symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account/trades`; + // 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; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (tradeType !== undefined) { + localVarQueryParameter['tradeType'] = tradeType; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the user\'s transaction history (any change in balance). + * @summary /account/transactions + * @param {Array} [types] Optional query parameter to filter transactions by type. + * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountTransactionHistory: async (types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account/transactions`; + // 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; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (types) { + localVarQueryParameter['types'] = types; + } + + if (assetSymbol !== undefined) { + localVarQueryParameter['assetSymbol'] = assetSymbol; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the account value history for a specific account over a given time interval. + * @summary /account/valueHistory + * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountValueHistory: async (interval: GetAccountValueHistoryParamsInterval, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'interval' is not null or undefined + assertParamExists('getAccountValueHistory', 'interval', interval) + const localVarPath = `/api/v1/account/valueHistory`; + // 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; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + if (interval !== undefined) { + localVarQueryParameter['interval'] = interval; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. + * @summary Set the group ID for an account. + * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchAccountGroupID: async (accountGroupIdPatch: AccountGroupIdPatch, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'accountGroupIdPatch' is not null or undefined + assertParamExists('patchAccountGroupID', 'accountGroupIdPatch', accountGroupIdPatch) + const localVarPath = `/api/v1/account/groupId`; + // 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: 'PATCH', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(accountGroupIdPatch, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. + * @summary /account/preferences + * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putAccountPreferences: async (updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'updateAccountPreferenceRequest' is not null or undefined + assertParamExists('putAccountPreferences', 'updateAccountPreferenceRequest', updateAccountPreferenceRequest) + const localVarPath = `/api/v1/account/preferences`; + // 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: 'PUT', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(updateAccountPreferenceRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. + * @summary /account/sponsorTx + * @param {SponsorTxRequest} sponsorTxRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sponsorTx: async (sponsorTxRequest: SponsorTxRequest, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'sponsorTxRequest' is not null or undefined + assertParamExists('sponsorTx', 'sponsorTxRequest', sponsorTxRequest) + const localVarPath = `/api/v1/account/sponsorTx`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(sponsorTxRequest, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * AccountDataApi - functional programming interface + * @export + */ +export const AccountDataApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AccountDataApiAxiosParamCreator(configuration) + return { + /** + * Retrieves the user\'s account details. + * @summary /account + * @param {string} [accountAddress] Account address to fetch account details by. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountDetails(accountAddress, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountDetails']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the funding rate history for a specific account. + * @summary /account/fundingRateHistory + * @param {string} [accountAddress] Account address to filter funding rate history by. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountFundingRateHistory']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the user\'s account preferences. + * @summary /account/preferences + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountPreferences(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountPreferences(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountPreferences']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the user\'s trade history. + * @summary /account/trades + * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountTrades']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the user\'s transaction history (any change in balance). + * @summary /account/transactions + * @param {Array} [types] Optional query parameter to filter transactions by type. + * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountTransactionHistory']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the account value history for a specific account over a given time interval. + * @summary /account/valueHistory + * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountValueHistory(interval, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountValueHistory']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. + * @summary Set the group ID for an account. + * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.patchAccountGroupID(accountGroupIdPatch, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.patchAccountGroupID']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. + * @summary /account/preferences + * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.putAccountPreferences(updateAccountPreferenceRequest, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.putAccountPreferences']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. + * @summary /account/sponsorTx + * @param {SponsorTxRequest} sponsorTxRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.sponsorTx(sponsorTxRequest, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['AccountDataApi.sponsorTx']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + /** - * AccountDataApi - axios parameter creator + * AccountDataApi - factory interface * @export */ -export const AccountDataApiAxiosParamCreator = function (configuration?: Configuration) { +export const AccountDataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AccountDataApiFp(configuration) return { /** * Retrieves the user\'s account details. @@ -5746,33 +6910,8 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountDetails: async (accountAddress?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account`; - // 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 (accountAddress !== undefined) { - localVarQueryParameter['accountAddress'] = accountAddress; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getAccountDetails(accountAddress, options).then((request) => request(axios, basePath)); }, /** * Retrieves the funding rate history for a specific account. @@ -5785,62 +6924,235 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountFundingRateHistory: async (accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account/fundingRateHistory`; - // 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; - } + getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves the user\'s account preferences. + * @summary /account/preferences + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountPreferences(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getAccountPreferences(options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves the user\'s trade history. + * @summary /account/trades + * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves the user\'s transaction history (any change in balance). + * @summary /account/transactions + * @param {Array} [types] Optional query parameter to filter transactions by type. + * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves the account value history for a specific account over a given time interval. + * @summary /account/valueHistory + * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getAccountValueHistory(interval, options).then((request) => request(axios, basePath)); + }, + /** + * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. + * @summary Set the group ID for an account. + * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.patchAccountGroupID(accountGroupIdPatch, options).then((request) => request(axios, basePath)); + }, + /** + * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. + * @summary /account/preferences + * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.putAccountPreferences(updateAccountPreferenceRequest, options).then((request) => request(axios, basePath)); + }, + /** + * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. + * @summary /account/sponsorTx + * @param {SponsorTxRequest} sponsorTxRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.sponsorTx(sponsorTxRequest, options).then((request) => request(axios, basePath)); + }, + }; +}; - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; +/** + * AccountDataApi - object-oriented interface + * @export + * @class AccountDataApi + * @extends {BaseAPI} + */ +export class AccountDataApi extends BaseAPI { + /** + * Retrieves the user\'s account details. + * @summary /account + * @param {string} [accountAddress] Account address to fetch account details by. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountDetails(accountAddress, options).then((request) => request(this.axios, this.basePath)); + } - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) + /** + * Retrieves the funding rate history for a specific account. + * @summary /account/fundingRateHistory + * @param {string} [accountAddress] Account address to filter funding rate history by. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options).then((request) => request(this.axios, this.basePath)); + } - if (accountAddress !== undefined) { - localVarQueryParameter['accountAddress'] = accountAddress; - } + /** + * Retrieves the user\'s account preferences. + * @summary /account/preferences + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountPreferences(options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountPreferences(options).then((request) => request(this.axios, this.basePath)); + } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } + /** + * Retrieves the user\'s trade history. + * @summary /account/trades + * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieves the user\'s transaction history (any change in balance). + * @summary /account/transactions + * @param {Array} [types] Optional query parameter to filter transactions by type. + * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. + * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. + * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieves the account value history for a specific account over a given time interval. + * @summary /account/valueHistory + * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).getAccountValueHistory(interval, options).then((request) => request(this.axios, this.basePath)); + } - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } + /** + * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. + * @summary Set the group ID for an account. + * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).patchAccountGroupID(accountGroupIdPatch, options).then((request) => request(this.axios, this.basePath)); + } - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } + /** + * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. + * @summary /account/preferences + * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).putAccountPreferences(updateAccountPreferenceRequest, options).then((request) => request(this.axios, this.basePath)); + } - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; - } + /** + * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. + * @summary /account/sponsorTx + * @param {SponsorTxRequest} sponsorTxRequest + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AccountDataApi + */ + public sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig) { + return AccountDataApiFp(this.configuration).sponsorTx(sponsorTxRequest, options).then((request) => request(this.axios, this.basePath)); + } +} - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * AuthApi - axios parameter creator + * @export + */ +export const AuthApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** - * Retrieves the user\'s account preferences. - * @summary /account/preferences + * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountPreferences: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account/preferences`; + authJwksGet: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/auth/jwks`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5852,10 +7164,6 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -5868,19 +7176,20 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu }; }, /** - * Retrieves the user\'s trade history. - * @summary /account/trades - * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. - * @param {number} [page] The page number to retrieve in a paginated response. + * login with token + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountTrades: async (symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account/trades`; + authTokenPost: async (payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'payloadSignature' is not null or undefined + assertParamExists('authTokenPost', 'payloadSignature', payloadSignature) + // verify required parameter 'loginRequest' is not null or undefined + assertParamExists('authTokenPost', 'loginRequest', loginRequest) + const localVarPath = `/auth/token`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5888,43 +7197,29 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + if (refreshTokenValidForSeconds !== undefined) { + localVarQueryParameter['refreshTokenValidForSeconds'] = refreshTokenValidForSeconds; } - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + if (readOnly !== undefined) { + localVarQueryParameter['readOnly'] = readOnly; } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - if (tradeType !== undefined) { - localVarQueryParameter['tradeType'] = tradeType; - } + + localVarHeaderParameter['Content-Type'] = 'application/json'; - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (payloadSignature != null) { + localVarHeaderParameter['payloadSignature'] = String(payloadSignature); } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(loginRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -5932,19 +7227,15 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu }; }, /** - * Retrieves the user\'s transaction history (any change in balance). - * @summary /account/transactions - * @param {Array} [types] Optional query parameter to filter transactions by type. - * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * Retrieves a new auth token for an account. Expiry is set to 5 min. + * @param {RefreshTokenRequest} refreshTokenRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountTransactionHistory: async (types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account/transactions`; + authTokenRefreshPut: async (refreshTokenRequest: RefreshTokenRequest, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'refreshTokenRequest' is not null or undefined + assertParamExists('authTokenRefreshPut', 'refreshTokenRequest', refreshTokenRequest) + const localVarPath = `/auth/token/refresh`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -5952,43 +7243,18 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (types) { - localVarQueryParameter['types'] = types; - } - - if (assetSymbol !== undefined) { - localVarQueryParameter['assetSymbol'] = assetSymbol; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } - - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - + localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -5996,16 +7262,20 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu }; }, /** - * Retrieves the account value history for a specific account over a given time interval. - * @summary /account/valueHistory - * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * login compatible with BCS payload with intent bytes + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountValueHistory: async (interval: GetAccountValueHistoryParamsInterval, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'interval' is not null or undefined - assertParamExists('getAccountValueHistory', 'interval', interval) - const localVarPath = `/api/v1/account/valueHistory`; + authV2TokenPost: async (payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'payloadSignature' is not null or undefined + assertParamExists('authV2TokenPost', 'payloadSignature', payloadSignature) + // verify required parameter 'loginRequest' is not null or undefined + assertParamExists('authV2TokenPost', 'loginRequest', loginRequest) + const localVarPath = `/auth/v2/token`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6013,80 +7283,46 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - if (interval !== undefined) { - localVarQueryParameter['interval'] = interval; + if (refreshTokenValidForSeconds !== undefined) { + localVarQueryParameter['refreshTokenValidForSeconds'] = refreshTokenValidForSeconds; } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. - * @summary Set the group ID for an account. - * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - patchAccountGroupID: async (accountGroupIdPatch: AccountGroupIdPatch, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'accountGroupIdPatch' is not null or undefined - assertParamExists('patchAccountGroupID', 'accountGroupIdPatch', accountGroupIdPatch) - const localVarPath = `/api/v1/account/groupId`; - // 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; + if (readOnly !== undefined) { + localVarQueryParameter['readOnly'] = readOnly; } - const localVarRequestOptions = { method: 'PATCH', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (payloadSignature != null) { + localVarHeaderParameter['payloadSignature'] = String(payloadSignature); + } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(accountGroupIdPatch, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(loginRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, - /** - * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. - * @summary /account/preferences - * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + /** + * ZK Login User Details + * @summary /auth/zklogin + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - putAccountPreferences: async (updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'updateAccountPreferenceRequest' is not null or undefined - assertParamExists('putAccountPreferences', 'updateAccountPreferenceRequest', updateAccountPreferenceRequest) - const localVarPath = `/api/v1/account/preferences`; + getZkLoginUserDetails: async (zkloginJwt: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'zkloginJwt' is not null or undefined + assertParamExists('getZkLoginUserDetails', 'zkloginJwt', zkloginJwt) + const localVarPath = `/auth/zklogin`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6094,22 +7330,18 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - - localVarHeaderParameter['Content-Type'] = 'application/json'; - + if (zkloginJwt != null) { + localVarHeaderParameter['zklogin-jwt'] = String(zkloginJwt); + } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(updateAccountPreferenceRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6117,16 +7349,19 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu }; }, /** - * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. - * @summary /account/sponsorTx - * @param {SponsorTxRequest} sponsorTxRequest + * + * @summary /auth/zklogin/zkp + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * @param {ZKLoginZKPRequest} zKLoginZKPRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - sponsorTx: async (sponsorTxRequest: SponsorTxRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'sponsorTxRequest' is not null or undefined - assertParamExists('sponsorTx', 'sponsorTxRequest', sponsorTxRequest) - const localVarPath = `/api/v1/account/sponsorTx`; + postZkLoginZkp: async (zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'zkloginJwt' is not null or undefined + assertParamExists('postZkLoginZkp', 'zkloginJwt', zkloginJwt) + // verify required parameter 'zKLoginZKPRequest' is not null or undefined + assertParamExists('postZkLoginZkp', 'zKLoginZKPRequest', zKLoginZKPRequest) + const localVarPath = `/auth/zklogin/zkp`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6138,18 +7373,17 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (zkloginJwt != null) { + localVarHeaderParameter['zklogin-jwt'] = String(zkloginJwt); + } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(sponsorTxRequest, localVarRequestOptions, configuration) + localVarRequestOptions.data = serializeDataIfNeeded(zKLoginZKPRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6160,402 +7394,396 @@ export const AccountDataApiAxiosParamCreator = function (configuration?: Configu }; /** - * AccountDataApi - functional programming interface + * AuthApi - functional programming interface * @export */ -export const AccountDataApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = AccountDataApiAxiosParamCreator(configuration) +export const AuthApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration) return { /** - * Retrieves the user\'s account details. - * @summary /account - * @param {string} [accountAddress] Account address to fetch account details by. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountDetails(accountAddress, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountDetails']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves the funding rate history for a specific account. - * @summary /account/fundingRateHistory - * @param {string} [accountAddress] Account address to filter funding rate history by. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountFundingRateHistory']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves the user\'s account preferences. - * @summary /account/preferences - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAccountPreferences(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountPreferences(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountPreferences']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves the user\'s trade history. - * @summary /account/trades - * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. - * @param {number} [page] The page number to retrieve in a paginated response. + * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options); + async authJwksGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any | undefined; }>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.authJwksGet(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountTrades']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.authJwksGet']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves the user\'s transaction history (any change in balance). - * @summary /account/transactions - * @param {Array} [types] Optional query parameter to filter transactions by type. - * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * login with token + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options); + async authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountTransactionHistory']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.authTokenPost']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves the account value history for a specific account over a given time interval. - * @summary /account/valueHistory - * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * Retrieves a new auth token for an account. Expiry is set to 5 min. + * @param {RefreshTokenRequest} refreshTokenRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAccountValueHistory(interval, options); + async authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.authTokenRefreshPut(refreshTokenRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.getAccountValueHistory']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.authTokenRefreshPut']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. - * @summary Set the group ID for an account. - * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * login compatible with BCS payload with intent bytes + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.patchAccountGroupID(accountGroupIdPatch, options); + async authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.patchAccountGroupID']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.authV2TokenPost']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. - * @summary /account/preferences - * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * ZK Login User Details + * @summary /auth/zklogin + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.putAccountPreferences(updateAccountPreferenceRequest, options); + async getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getZkLoginUserDetails(zkloginJwt, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.putAccountPreferences']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.getZkLoginUserDetails']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. - * @summary /account/sponsorTx - * @param {SponsorTxRequest} sponsorTxRequest + * + * @summary /auth/zklogin/zkp + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * @param {ZKLoginZKPRequest} zKLoginZKPRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.sponsorTx(sponsorTxRequest, options); + async postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AccountDataApi.sponsorTx']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['AuthApi.postZkLoginZkp']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, } }; /** - * AccountDataApi - factory interface + * AuthApi - factory interface * @export */ -export const AccountDataApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = AccountDataApiFp(configuration) +export const AuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AuthApiFp(configuration) return { /** - * Retrieves the user\'s account details. - * @summary /account - * @param {string} [accountAddress] Account address to fetch account details by. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getAccountDetails(accountAddress, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieves the funding rate history for a specific account. - * @summary /account/fundingRateHistory - * @param {string} [accountAddress] Account address to filter funding rate history by. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieves the user\'s account preferences. - * @summary /account/preferences - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAccountPreferences(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getAccountPreferences(options).then((request) => request(axios, basePath)); - }, - /** - * Retrieves the user\'s trade history. - * @summary /account/trades - * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. - * @param {number} [page] The page number to retrieve in a paginated response. + * * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options).then((request) => request(axios, basePath)); + authJwksGet(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any | undefined; }> { + return localVarFp.authJwksGet(options).then((request) => request(axios, basePath)); }, /** - * Retrieves the user\'s transaction history (any change in balance). - * @summary /account/transactions - * @param {Array} [types] Optional query parameter to filter transactions by type. - * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * login with token + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(axios, basePath)); }, /** - * Retrieves the account value history for a specific account over a given time interval. - * @summary /account/valueHistory - * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * Retrieves a new auth token for an account. Expiry is set to 5 min. + * @param {RefreshTokenRequest} refreshTokenRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getAccountValueHistory(interval, options).then((request) => request(axios, basePath)); + authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.authTokenRefreshPut(refreshTokenRequest, options).then((request) => request(axios, basePath)); }, /** - * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. - * @summary Set the group ID for an account. - * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. + * login compatible with BCS payload with intent bytes + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} */ - patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.patchAccountGroupID(accountGroupIdPatch, options).then((request) => request(axios, basePath)); + authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(axios, basePath)); }, /** - * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. - * @summary /account/preferences - * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest + * ZK Login User Details + * @summary /auth/zklogin + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.putAccountPreferences(updateAccountPreferenceRequest, options).then((request) => request(axios, basePath)); + getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getZkLoginUserDetails(zkloginJwt, options).then((request) => request(axios, basePath)); }, /** - * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. - * @summary /account/sponsorTx - * @param {SponsorTxRequest} sponsorTxRequest + * + * @summary /auth/zklogin/zkp + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * @param {ZKLoginZKPRequest} zKLoginZKPRequest * @param {*} [options] Override http request option. * @throws {RequiredError} */ - sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.sponsorTx(sponsorTxRequest, options).then((request) => request(axios, basePath)); + postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options).then((request) => request(axios, basePath)); }, }; }; /** - * AccountDataApi - object-oriented interface + * AuthApi - object-oriented interface * @export - * @class AccountDataApi + * @class AuthApi * @extends {BaseAPI} */ -export class AccountDataApi extends BaseAPI { +export class AuthApi extends BaseAPI { /** - * Retrieves the user\'s account details. - * @summary /account - * @param {string} [accountAddress] Account address to fetch account details by. + * * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountDetails(accountAddress?: string, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountDetails(accountAddress, options).then((request) => request(this.axios, this.basePath)); + public authJwksGet(options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).authJwksGet(options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the funding rate history for a specific account. - * @summary /account/fundingRateHistory - * @param {string} [accountAddress] Account address to filter funding rate history by. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. + * login with token + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountFundingRateHistory(accountAddress?: string, limit?: number, page?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountFundingRateHistory(accountAddress, limit, page, startTimeAtMillis, endTimeAtMillis, options).then((request) => request(this.axios, this.basePath)); + public authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the user\'s account preferences. - * @summary /account/preferences + * Retrieves a new auth token for an account. Expiry is set to 5 min. + * @param {RefreshTokenRequest} refreshTokenRequest * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountPreferences(options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountPreferences(options).then((request) => request(this.axios, this.basePath)); + public authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).authTokenRefreshPut(refreshTokenRequest, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the user\'s trade history. - * @summary /account/trades - * @param {string} [symbol] Market address to filter trades by. If not specified, returns trades for all markets. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {TradeType} [tradeType] Type of trade. By default returns all. UNSPECIFIED returns all. - * @param {number} [page] The page number to retrieve in a paginated response. + * login compatible with BCS payload with intent bytes + * @param {string} payloadSignature + * @param {LoginRequest} loginRequest + * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. + * @param {boolean} [readOnly] * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountTrades(symbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, tradeType?: TradeType, page?: number, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountTrades(symbol, startTimeAtMillis, endTimeAtMillis, limit, tradeType, page, options).then((request) => request(this.axios, this.basePath)); + public authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the user\'s transaction history (any change in balance). - * @summary /account/transactions - * @param {Array} [types] Optional query parameter to filter transactions by type. - * @param {string} [assetSymbol] Optional query parameter to filter transactions by asset bank address. - * @param {number} [startTimeAtMillis] Start time in milliseconds. Defaults to 7 days ago if not specified. - * @param {number} [endTimeAtMillis] End time in milliseconds. Defaults to now if not specified. Must be greater than start time and must be less than 90 days apart. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * ZK Login User Details + * @summary /auth/zklogin + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountTransactionHistory(types?: Array, assetSymbol?: string, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountTransactionHistory(types, assetSymbol, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + public getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).getZkLoginUserDetails(zkloginJwt, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the account value history for a specific account over a given time interval. - * @summary /account/valueHistory - * @param {GetAccountValueHistoryParamsInterval} interval Time interval for the value history. Options are 24h, 7d, 30d, 90d, or all. + * + * @summary /auth/zklogin/zkp + * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * @param {ZKLoginZKPRequest} zKLoginZKPRequest * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AccountDataApi + * @memberof AuthApi */ - public getAccountValueHistory(interval: GetAccountValueHistoryParamsInterval, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).getAccountValueHistory(interval, options).then((request) => request(this.axios, this.basePath)); + public postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig) { + return AuthApiFp(this.configuration).postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options).then((request) => request(this.axios, this.basePath)); } +} - /** - * Sets or updates the group ID for a specific account. Accounts belonging to the same group cannot trade against each other. If the groupId is not set, the account will be removed from its group. Only the first 6 characters of the groupID are guaranteed to be respected, longer group IDs may be rejected. - * @summary Set the group ID for an account. - * @param {AccountGroupIdPatch} accountGroupIdPatch Account group ID update. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AccountDataApi - */ - public patchAccountGroupID(accountGroupIdPatch: AccountGroupIdPatch, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).patchAccountGroupID(accountGroupIdPatch, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Update user\'s account preferences. This will overwrite the preferences, so always send the full object. - * @summary /account/preferences - * @param {UpdateAccountPreferenceRequest} updateAccountPreferenceRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AccountDataApi - */ - public putAccountPreferences(updateAccountPreferenceRequest: UpdateAccountPreferenceRequest, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).putAccountPreferences(updateAccountPreferenceRequest, options).then((request) => request(this.axios, this.basePath)); - } - /** - * Sponsors a transaction if it\'s eligible for sponsorship based on allowlisted methods and kinds. - * @summary /account/sponsorTx - * @param {SponsorTxRequest} sponsorTxRequest - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof AccountDataApi - */ - public sponsorTx(sponsorTxRequest: SponsorTxRequest, options?: RawAxiosRequestConfig) { - return AccountDataApiFp(this.configuration).sponsorTx(sponsorTxRequest, options).then((request) => request(this.axios, this.basePath)); - } -} +/** + * ExchangeApi - axios parameter creator + * @export + */ +export const ExchangeApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Retrieves all market ticker information. + * @summary /exchange/tickers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAllMarketTicker: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/exchange/tickers`; + // 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; + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCandlestickData: async (symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'symbol' is not null or undefined + assertParamExists('getCandlestickData', 'symbol', symbol) + // verify required parameter 'interval' is not null or undefined + assertParamExists('getCandlestickData', 'interval', interval) + // verify required parameter 'type' is not null or undefined + assertParamExists('getCandlestickData', 'type', type) + const localVarPath = `/v1/exchange/candlesticks`; + // 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 (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; + } + + if (interval !== undefined) { + localVarQueryParameter['interval'] = interval; + } + + if (type !== undefined) { + localVarQueryParameter['type'] = type; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Check if the country is geo restricted. + * @summary /exchange/country + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getCountry: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/exchange/country`; + // 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; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; -/** - * AuthApi - axios parameter creator - * @export - */ -export const AuthApiAxiosParamCreator = function (configuration?: Configuration) { - return { + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, /** - * + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authJwksGet: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/auth/jwks`; + getExchangeInfo: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/exchange/info`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6579,20 +7807,18 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * login with token - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authTokenPost: async (payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'payloadSignature' is not null or undefined - assertParamExists('authTokenPost', 'payloadSignature', payloadSignature) - // verify required parameter 'loginRequest' is not null or undefined - assertParamExists('authTokenPost', 'loginRequest', loginRequest) - const localVarPath = `/auth/token`; + getExchangeStats: async (interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/exchange/stats`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6600,29 +7826,35 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (refreshTokenValidForSeconds !== undefined) { - localVarQueryParameter['refreshTokenValidForSeconds'] = refreshTokenValidForSeconds; + if (interval !== undefined) { + localVarQueryParameter['interval'] = interval; } - if (readOnly !== undefined) { - localVarQueryParameter['readOnly'] = readOnly; + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; } + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } - if (payloadSignature != null) { - localVarHeaderParameter['payloadSignature'] = String(payloadSignature); + if (page !== undefined) { + localVarQueryParameter['page'] = page; } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(loginRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6630,15 +7862,13 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * Retrieves a new auth token for an account. Expiry is set to 5 min. - * @param {RefreshTokenRequest} refreshTokenRequest + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authTokenRefreshPut: async (refreshTokenRequest: RefreshTokenRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'refreshTokenRequest' is not null or undefined - assertParamExists('authTokenRefreshPut', 'refreshTokenRequest', refreshTokenRequest) - const localVarPath = `/auth/token/refresh`; + getExchangeStatsAllTime: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/exchange/stats/allTime`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6646,18 +7876,15 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - localVarHeaderParameter['Content-Type'] = 'application/json'; - setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(refreshTokenRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6665,20 +7892,20 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * login compatible with BCS payload with intent bytes - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authV2TokenPost: async (payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'payloadSignature' is not null or undefined - assertParamExists('authV2TokenPost', 'payloadSignature', payloadSignature) - // verify required parameter 'loginRequest' is not null or undefined - assertParamExists('authV2TokenPost', 'loginRequest', loginRequest) - const localVarPath = `/auth/v2/token`; + getFundingRateHistory: async (symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'symbol' is not null or undefined + assertParamExists('getFundingRateHistory', 'symbol', symbol) + const localVarPath = `/v1/exchange/fundingRateHistory`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6686,29 +7913,90 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (refreshTokenValidForSeconds !== undefined) { - localVarQueryParameter['refreshTokenValidForSeconds'] = refreshTokenValidForSeconds; + if (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; } - if (readOnly !== undefined) { - localVarQueryParameter['readOnly'] = readOnly; + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; } - localVarHeaderParameter['Content-Type'] = 'application/json'; + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - if (payloadSignature != null) { - localVarHeaderParameter['payloadSignature'] = String(payloadSignature); + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLeaderboard: async (interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/accounts/leaderboard`; + // 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 (interval !== undefined) { + localVarQueryParameter['interval'] = interval; + } + + if (sortBy !== undefined) { + localVarQueryParameter['sortBy'] = sortBy; + } + + if (sortOrder !== undefined) { + localVarQueryParameter['sortOrder'] = sortOrder; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(loginRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6716,16 +8004,54 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * ZK Login User Details - * @summary /auth/zklogin - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getMarketTicker: async (symbol: string, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'symbol' is not null or undefined + assertParamExists('getMarketTicker', 'symbol', symbol) + const localVarPath = `/v1/exchange/ticker`; + // 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 (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; + } + + + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getZkLoginUserDetails: async (zkloginJwt: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'zkloginJwt' is not null or undefined - assertParamExists('getZkLoginUserDetails', 'zkloginJwt', zkloginJwt) - const localVarPath = `/auth/zklogin`; + getOrderbookDepth: async (symbol: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'symbol' is not null or undefined + assertParamExists('getOrderbookDepth', 'symbol', symbol) + const localVarPath = `/v1/exchange/depth`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6737,11 +8063,16 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + - if (zkloginJwt != null) { - localVarHeaderParameter['zklogin-jwt'] = String(zkloginJwt); - } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -6752,19 +8083,21 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; }, /** - * - * @summary /auth/zklogin/zkp - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. - * @param {ZKLoginZKPRequest} zKLoginZKPRequest + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - postZkLoginZkp: async (zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'zkloginJwt' is not null or undefined - assertParamExists('postZkLoginZkp', 'zkloginJwt', zkloginJwt) - // verify required parameter 'zKLoginZKPRequest' is not null or undefined - assertParamExists('postZkLoginZkp', 'zKLoginZKPRequest', zKLoginZKPRequest) - const localVarPath = `/auth/zklogin/zkp`; + getRecentTrades: async (symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'symbol' is not null or undefined + assertParamExists('getRecentTrades', 'symbol', symbol) + const localVarPath = `/v1/exchange/trades`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -6772,21 +8105,39 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) baseOptions = configuration.baseOptions; } - const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (symbol !== undefined) { + localVarQueryParameter['symbol'] = symbol; + } - - localVarHeaderParameter['Content-Type'] = 'application/json'; + if (tradeType !== undefined) { + localVarQueryParameter['tradeType'] = tradeType; + } - if (zkloginJwt != null) { - localVarHeaderParameter['zklogin-jwt'] = String(zkloginJwt); + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (startTimeAtMillis !== undefined) { + localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; + } + + if (endTimeAtMillis !== undefined) { + localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - localVarRequestOptions.data = serializeDataIfNeeded(zKLoginZKPRequest, localVarRequestOptions, configuration) return { url: toPathString(localVarUrlObj), @@ -6797,308 +8148,506 @@ export const AuthApiAxiosParamCreator = function (configuration?: Configuration) }; /** - * AuthApi - functional programming interface + * ExchangeApi - functional programming interface * @export */ -export const AuthApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = AuthApiAxiosParamCreator(configuration) +export const ExchangeApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ExchangeApiAxiosParamCreator(configuration) return { /** - * + * Retrieves all market ticker information. + * @summary /exchange/tickers * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async authJwksGet(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<{ [key: string]: any | undefined; }>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authJwksGet(options); + async getAllMarketTicker(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAllMarketTicker(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.authJwksGet']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getAllMarketTicker']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * login with token - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCandlestickData']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Check if the country is geo restricted. + * @summary /exchange/country + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getCountry(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCountry(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCountry']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getExchangeInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeInfo(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStats']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getExchangeStatsAllTime(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStatsAllTime(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStatsAllTime']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getFundingRateHistory']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeaderboard(interval, sortBy, sortOrder, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getLeaderboard']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketTicker(symbol, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getMarketTicker']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderbookDepth(symbol, limit, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getOrderbookDepth']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getRecentTrades']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + } +}; + +/** + * ExchangeApi - factory interface + * @export + */ +export const ExchangeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ExchangeApiFp(configuration) + return { + /** + * Retrieves all market ticker information. + * @summary /exchange/tickers * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.authTokenPost']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + getAllMarketTicker(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getAllMarketTicker(options).then((request) => request(axios, basePath)); }, /** - * Retrieves a new auth token for an account. Expiry is set to 5 min. - * @param {RefreshTokenRequest} refreshTokenRequest + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authTokenRefreshPut(refreshTokenRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.authTokenRefreshPut']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise>> { + return localVarFp.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); }, /** - * login compatible with BCS payload with intent bytes - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Check if the country is geo restricted. + * @summary /exchange/country * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.authV2TokenPost']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + getCountry(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getCountry(options).then((request) => request(axios, basePath)); }, /** - * ZK Login User Details - * @summary /auth/zklogin - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getZkLoginUserDetails(zkloginJwt, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.getZkLoginUserDetails']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + getExchangeInfo(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeInfo(options).then((request) => request(axios, basePath)); }, /** - * - * @summary /auth/zklogin/zkp - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. - * @param {ZKLoginZKPRequest} zKLoginZKPRequest + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['AuthApi.postZkLoginZkp']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); }, - } -}; - -/** - * AuthApi - factory interface - * @export - */ -export const AuthApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = AuthApiFp(configuration) - return { /** - * + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authJwksGet(options?: RawAxiosRequestConfig): AxiosPromise<{ [key: string]: any | undefined; }> { - return localVarFp.authJwksGet(options).then((request) => request(axios, basePath)); + getExchangeStatsAllTime(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeStatsAllTime(options).then((request) => request(axios, basePath)); }, /** - * login with token - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(axios, basePath)); + getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); }, /** - * Retrieves a new auth token for an account. Expiry is set to 5 min. - * @param {RefreshTokenRequest} refreshTokenRequest + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.authTokenRefreshPut(refreshTokenRequest, options).then((request) => request(axios, basePath)); + getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(axios, basePath)); }, /** - * login compatible with BCS payload with intent bytes - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(axios, basePath)); + getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getMarketTicker(symbol, options).then((request) => request(axios, basePath)); }, /** - * ZK Login User Details - * @summary /auth/zklogin - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getZkLoginUserDetails(zkloginJwt, options).then((request) => request(axios, basePath)); + getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrderbookDepth(symbol, limit, options).then((request) => request(axios, basePath)); }, /** - * - * @summary /auth/zklogin/zkp - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. - * @param {ZKLoginZKPRequest} zKLoginZKPRequest + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options).then((request) => request(axios, basePath)); + getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); }, }; }; /** - * AuthApi - object-oriented interface + * ExchangeApi - object-oriented interface * @export - * @class AuthApi + * @class ExchangeApi * @extends {BaseAPI} */ -export class AuthApi extends BaseAPI { +export class ExchangeApi extends BaseAPI { /** - * + * Retrieves all market ticker information. + * @summary /exchange/tickers * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public authJwksGet(options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).authJwksGet(options).then((request) => request(this.axios, this.basePath)); + public getAllMarketTicker(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getAllMarketTicker(options).then((request) => request(this.axios, this.basePath)); } /** - * login with token - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public authTokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).authTokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(this.axios, this.basePath)); + public getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Check if the country is geo restricted. + * @summary /exchange/country + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getCountry(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getCountry(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeInfo(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeInfo(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeStatsAllTime(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeStatsAllTime(options).then((request) => request(this.axios, this.basePath)); + } + + /** + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves a new auth token for an account. Expiry is set to 5 min. - * @param {RefreshTokenRequest} refreshTokenRequest + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public authTokenRefreshPut(refreshTokenRequest: RefreshTokenRequest, options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).authTokenRefreshPut(refreshTokenRequest, options).then((request) => request(this.axios, this.basePath)); + public getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(this.axios, this.basePath)); } /** - * login compatible with BCS payload with intent bytes - * @param {string} payloadSignature - * @param {LoginRequest} loginRequest - * @param {number} [refreshTokenValidForSeconds] The number of seconds the refresh token is valid for. If not provided, the default is 30 days. - * @param {boolean} [readOnly] + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public authV2TokenPost(payloadSignature: string, loginRequest: LoginRequest, refreshTokenValidForSeconds?: number, readOnly?: boolean, options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).authV2TokenPost(payloadSignature, loginRequest, refreshTokenValidForSeconds, readOnly, options).then((request) => request(this.axios, this.basePath)); + public getMarketTicker(symbol: string, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getMarketTicker(symbol, options).then((request) => request(this.axios, this.basePath)); } /** - * ZK Login User Details - * @summary /auth/zklogin - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public getZkLoginUserDetails(zkloginJwt: string, options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).getZkLoginUserDetails(zkloginJwt, options).then((request) => request(this.axios, this.basePath)); + public getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getOrderbookDepth(symbol, limit, options).then((request) => request(this.axios, this.basePath)); } /** - * - * @summary /auth/zklogin/zkp - * @param {string} zkloginJwt The JWT of the user signed in with zkLogin. - * @param {ZKLoginZKPRequest} zKLoginZKPRequest + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof AuthApi + * @memberof ExchangeApi */ - public postZkLoginZkp(zkloginJwt: string, zKLoginZKPRequest: ZKLoginZKPRequest, options?: RawAxiosRequestConfig) { - return AuthApiFp(this.configuration).postZkLoginZkp(zkloginJwt, zKLoginZKPRequest, options).then((request) => request(this.axios, this.basePath)); + public getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); } } +/** + * @export + */ +export const GetLeaderboardSortByEnum = { + GetLeaderboardSortByAccountValue: 'accountValue', + GetLeaderboardSortByPnL: 'pnl', + GetLeaderboardSortByVolume: 'volume', + GetLeaderboardSortByUNSPECIFIED: 'UNSPECIFIED' +} as const; +export type GetLeaderboardSortByEnum = typeof GetLeaderboardSortByEnum[keyof typeof GetLeaderboardSortByEnum]; /** - * ExchangeApi - axios parameter creator + * KoraApi - axios parameter creator * @export */ -export const ExchangeApiAxiosParamCreator = function (configuration?: Configuration) { +export const KoraApiAxiosParamCreator = function (configuration?: Configuration) { return { /** - * Retrieves all market ticker information. - * @summary /exchange/tickers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAllMarketTicker: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/exchange/tickers`; - // 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; - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns metadata for Kora rewards campaigns. + * @summary Get Kora campaign metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCandlestickData: async (symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'symbol' is not null or undefined - assertParamExists('getCandlestickData', 'symbol', symbol) - // verify required parameter 'interval' is not null or undefined - assertParamExists('getCandlestickData', 'interval', interval) - // verify required parameter 'type' is not null or undefined - assertParamExists('getCandlestickData', 'type', type) - const localVarPath = `/v1/exchange/candlesticks`; + getKoraCampaignMetadata: async (campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/metadata/campaign`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7110,32 +8659,12 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; - } - - if (interval !== undefined) { - localVarQueryParameter['interval'] = interval; - } - - if (type !== undefined) { - localVarQueryParameter['type'] = type; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } - - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; + if (campaignName !== undefined) { + localVarQueryParameter['campaignName'] = campaignName; } - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (status !== undefined) { + localVarQueryParameter['status'] = status; } @@ -7150,13 +8679,18 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Check if the country is geo restricted. - * @summary /exchange/country + * Returns the rewards earned by users for Kora campaigns. + * @summary Get Kora campaign rewards + * @param {string} userAddress Specify wallet address + * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name + * @param {number} [epochNumber] Optionally specify epoch number * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCountry: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/exchange/country`; + getKoraCampaignRewards: async (userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'userAddress' is not null or undefined + assertParamExists('getKoraCampaignRewards', 'userAddress', userAddress) + const localVarPath = `/v1/kora/rewards/campaign`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7168,35 +8702,17 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; + if (campaignName !== undefined) { + localVarQueryParameter['campaignName'] = campaignName; + } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getExchangeInfo: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/exchange/info`; - // 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; + if (epochNumber !== undefined) { + localVarQueryParameter['epochNumber'] = epochNumber; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + if (userAddress !== undefined) { + localVarQueryParameter['userAddress'] = userAddress; + } @@ -7210,18 +8726,15 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns epoch configuration including reward allocations for Kora. + * @summary Get Kora epoch configuration + * @param {number} [intervalNumber] Specify the interval number + * @param {string} [campaignName] Filter by campaign name * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeStats: async (interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/exchange/stats`; + getKoraEpochConfigMetadata: async (intervalNumber?: number, campaignName?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/metadata/epoch/configs`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7233,56 +8746,14 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (interval !== undefined) { - localVarQueryParameter['interval'] = interval; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } - - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (intervalNumber !== undefined) { + localVarQueryParameter['intervalNumber'] = intervalNumber; } - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getExchangeStatsAllTime: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/exchange/stats/allTime`; - // 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; + if (campaignName !== undefined) { + localVarQueryParameter['campaignName'] = campaignName; } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -7294,21 +8765,16 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat options: localVarRequestOptions, }; }, - /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + /** + * Returns the latest or next epoch for a Kora campaign. + * @summary Get Kora epoch metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getFundingRateHistory: async (symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'symbol' is not null or undefined - assertParamExists('getFundingRateHistory', 'symbol', symbol) - const localVarPath = `/v1/exchange/fundingRateHistory`; + getKoraEpochMetadata: async (campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/metadata/epoch`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7320,24 +8786,12 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } - - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; + if (campaignName !== undefined) { + localVarQueryParameter['campaignName'] = campaignName; } - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (epoch !== undefined) { + localVarQueryParameter['epoch'] = epoch; } @@ -7352,18 +8806,15 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns interval metadata for Kora. + * @summary Get Kora interval metadata + * @param {string} [interval] Interval number or \"next\"/\"latest\" + * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getLeaderboard: async (interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/accounts/leaderboard`; + getKoraIntervalMetadata: async (interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/metadata/interval`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7379,20 +8830,8 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat localVarQueryParameter['interval'] = interval; } - if (sortBy !== undefined) { - localVarQueryParameter['sortBy'] = sortBy; - } - - if (sortOrder !== undefined) { - localVarQueryParameter['sortOrder'] = sortOrder; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; + if (protocol !== undefined) { + localVarQueryParameter['protocol'] = protocol; } @@ -7407,16 +8846,20 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. + * Returns rankings and earnings for Kora swap participants, sorted by the specified category. + * @summary Get Kora swap leaderboard + * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) + * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by + * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by + * @param {number} [page] Page number for pagination + * @param {number} [limit] Page size for pagination + * @param {string} [search] Filter by user address (partial match supported) + * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getMarketTicker: async (symbol: string, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'symbol' is not null or undefined - assertParamExists('getMarketTicker', 'symbol', symbol) - const localVarPath = `/v1/exchange/ticker`; + getKoraLeaderboard: async (epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/leaderboard`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7428,8 +8871,32 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; + if (epochId !== undefined) { + localVarQueryParameter['epochId'] = epochId; + } + + if (sortBy !== undefined) { + localVarQueryParameter['sortBy'] = sortBy; + } + + if (sortOrder !== undefined) { + localVarQueryParameter['sortOrder'] = sortOrder; + } + + if (page !== undefined) { + localVarQueryParameter['page'] = page; + } + + if (limit !== undefined) { + localVarQueryParameter['limit'] = limit; + } + + if (search !== undefined) { + localVarQueryParameter['search'] = search; + } + + if (minVolumeE6 !== undefined) { + localVarQueryParameter['minVolumeE6'] = minVolumeE6; } @@ -7444,17 +8911,13 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * Returns the all-time rewards earned by users including Kora CC and points. + * @summary Get Kora all-time rewards summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderbookDepth: async (symbol: string, limit?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'symbol' is not null or undefined - assertParamExists('getOrderbookDepth', 'symbol', symbol) - const localVarPath = `/v1/exchange/depth`; + getKoraRewardsSummary: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/rewards/summary`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7466,13 +8929,9 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } + // authentication bearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) @@ -7486,21 +8945,13 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; }, /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the health status of the Kora rewards service. + * @summary Kora service health check * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getRecentTrades: async (symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'symbol' is not null or undefined - assertParamExists('getRecentTrades', 'symbol', symbol) - const localVarPath = `/v1/exchange/trades`; + koraHealthCheck: async (options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/v1/kora/health`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; @@ -7512,30 +8963,6 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; - if (symbol !== undefined) { - localVarQueryParameter['symbol'] = symbol; - } - - if (tradeType !== undefined) { - localVarQueryParameter['tradeType'] = tradeType; - } - - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } - - if (startTimeAtMillis !== undefined) { - localVarQueryParameter['startTimeAtMillis'] = startTimeAtMillis; - } - - if (endTimeAtMillis !== undefined) { - localVarQueryParameter['endTimeAtMillis'] = endTimeAtMillis; - } - - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } - setSearchParams(localVarUrlObj, localVarQueryParameter); @@ -7551,488 +8978,391 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat }; /** - * ExchangeApi - functional programming interface + * KoraApi - functional programming interface * @export */ -export const ExchangeApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ExchangeApiAxiosParamCreator(configuration) +export const KoraApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = KoraApiAxiosParamCreator(configuration) return { /** - * Retrieves all market ticker information. - * @summary /exchange/tickers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAllMarketTicker(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAllMarketTicker(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getAllMarketTicker']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCandlestickData']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Check if the country is geo restricted. - * @summary /exchange/country - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getCountry(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getCountry(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCountry']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeInfo(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeInfo']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStats']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeStatsAllTime(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStatsAllTime(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStatsAllTime']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns metadata for Kora rewards campaigns. + * @summary Get Kora campaign metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options); + async getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraCampaignMetadata(campaignName, status, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getFundingRateHistory']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraCampaignMetadata']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the rewards earned by users for Kora campaigns. + * @summary Get Kora campaign rewards + * @param {string} userAddress Specify wallet address + * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name + * @param {number} [epochNumber] Optionally specify epoch number * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getLeaderboard(interval, sortBy, sortOrder, limit, page, options); + async getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraCampaignRewards(userAddress, campaignName, epochNumber, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getLeaderboard']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraCampaignRewards']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. + * Returns epoch configuration including reward allocations for Kora. + * @summary Get Kora epoch configuration + * @param {number} [intervalNumber] Specify the interval number + * @param {string} [campaignName] Filter by campaign name * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketTicker(symbol, options); + async getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraEpochConfigMetadata(intervalNumber, campaignName, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getMarketTicker']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraEpochConfigMetadata']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * Returns the latest or next epoch for a Kora campaign. + * @summary Get Kora epoch metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderbookDepth(symbol, limit, options); + async getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraEpochMetadata(campaignName, epoch, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getOrderbookDepth']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraEpochMetadata']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns interval metadata for Kora. + * @summary Get Kora interval metadata + * @param {string} [interval] Interval number or \"next\"/\"latest\" + * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options); + async getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraIntervalMetadata(interval, protocol, options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getRecentTrades']?.[localVarOperationServerIndex]?.url; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraIntervalMetadata']?.[localVarOperationServerIndex]?.url; return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, - } -}; - -/** - * ExchangeApi - factory interface - * @export - */ -export const ExchangeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ExchangeApiFp(configuration) - return { /** - * Retrieves all market ticker information. - * @summary /exchange/tickers + * Returns rankings and earnings for Kora swap participants, sorted by the specified category. + * @summary Get Kora swap leaderboard + * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) + * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by + * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by + * @param {number} [page] Page number for pagination + * @param {number} [limit] Page size for pagination + * @param {string} [search] Filter by user address (partial match supported) + * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllMarketTicker(options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getAllMarketTicker(options).then((request) => request(axios, basePath)); + async getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraLeaderboard']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the all-time rewards earned by users including Kora CC and points. + * @summary Get Kora all-time rewards summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise>> { - return localVarFp.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + async getKoraRewardsSummary(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraRewardsSummary(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraRewardsSummary']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** - * Check if the country is geo restricted. - * @summary /exchange/country + * Returns the health status of the Kora rewards service. + * @summary Kora service health check * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCountry(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getCountry(options).then((request) => request(axios, basePath)); + async koraHealthCheck(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.koraHealthCheck(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['KoraApi.koraHealthCheck']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, + } +}; + +/** + * KoraApi - factory interface + * @export + */ +export const KoraApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = KoraApiFp(configuration) + return { /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info + * Returns metadata for Kora rewards campaigns. + * @summary Get Kora campaign metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeInfo(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeInfo(options).then((request) => request(axios, basePath)); + getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getKoraCampaignMetadata(campaignName, status, options).then((request) => request(axios, basePath)); }, /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the rewards earned by users for Kora campaigns. + * @summary Get Kora campaign rewards + * @param {string} userAddress Specify wallet address + * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name + * @param {number} [epochNumber] Optionally specify epoch number * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getKoraCampaignRewards(userAddress, campaignName, epochNumber, options).then((request) => request(axios, basePath)); }, /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime + * Returns epoch configuration including reward allocations for Kora. + * @summary Get Kora epoch configuration + * @param {number} [intervalNumber] Specify the interval number + * @param {string} [campaignName] Filter by campaign name * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeStatsAllTime(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeStatsAllTime(options).then((request) => request(axios, basePath)); + getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getKoraEpochConfigMetadata(intervalNumber, campaignName, options).then((request) => request(axios, basePath)); }, /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the latest or next epoch for a Kora campaign. + * @summary Get Kora epoch metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); + getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getKoraEpochMetadata(campaignName, epoch, options).then((request) => request(axios, basePath)); }, /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns interval metadata for Kora. + * @summary Get Kora interval metadata + * @param {string} [interval] Interval number or \"next\"/\"latest\" + * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(axios, basePath)); + getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getKoraIntervalMetadata(interval, protocol, options).then((request) => request(axios, basePath)); }, /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. + * Returns rankings and earnings for Kora swap participants, sorted by the specified category. + * @summary Get Kora swap leaderboard + * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) + * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by + * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by + * @param {number} [page] Page number for pagination + * @param {number} [limit] Page size for pagination + * @param {string} [search] Filter by user address (partial match supported) + * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getMarketTicker(symbol, options).then((request) => request(axios, basePath)); + getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options).then((request) => request(axios, basePath)); }, /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * Returns the all-time rewards earned by users including Kora CC and points. + * @summary Get Kora all-time rewards summary * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getOrderbookDepth(symbol, limit, options).then((request) => request(axios, basePath)); + getKoraRewardsSummary(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getKoraRewardsSummary(options).then((request) => request(axios, basePath)); }, /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the health status of the Kora rewards service. + * @summary Kora service health check * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); + koraHealthCheck(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.koraHealthCheck(options).then((request) => request(axios, basePath)); }, }; }; /** - * ExchangeApi - object-oriented interface + * KoraApi - object-oriented interface * @export - * @class ExchangeApi + * @class KoraApi * @extends {BaseAPI} */ -export class ExchangeApi extends BaseAPI { - /** - * Retrieves all market ticker information. - * @summary /exchange/tickers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getAllMarketTicker(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getAllMarketTicker(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Check if the country is geo restricted. - * @summary /exchange/country - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getCountry(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getCountry(options).then((request) => request(this.axios, this.basePath)); - } - +export class KoraApi extends BaseAPI { /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info + * Returns metadata for Kora rewards campaigns. + * @summary Get Kora campaign metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getExchangeInfo(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeInfo(options).then((request) => request(this.axios, this.basePath)); + public getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraCampaignMetadata(campaignName, status, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the rewards earned by users for Kora campaigns. + * @summary Get Kora campaign rewards + * @param {string} userAddress Specify wallet address + * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name + * @param {number} [epochNumber] Optionally specify epoch number * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + public getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraCampaignRewards(userAddress, campaignName, epochNumber, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime + * Returns epoch configuration including reward allocations for Kora. + * @summary Get Kora epoch configuration + * @param {number} [intervalNumber] Specify the interval number + * @param {string} [campaignName] Filter by campaign name * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getExchangeStatsAllTime(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeStatsAllTime(options).then((request) => request(this.axios, this.basePath)); + public getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraEpochConfigMetadata(intervalNumber, campaignName, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the latest or next epoch for a Kora campaign. + * @summary Get Kora epoch metadata + * @param {string} [campaignName] Specify the campaign name + * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); + public getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraEpochMetadata(campaignName, epoch, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns interval metadata for Kora. + * @summary Get Kora interval metadata + * @param {string} [interval] Interval number or \"next\"/\"latest\" + * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(this.axios, this.basePath)); + public getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraIntervalMetadata(interval, protocol, options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. + * Returns rankings and earnings for Kora swap participants, sorted by the specified category. + * @summary Get Kora swap leaderboard + * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) + * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by + * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by + * @param {number} [page] Page number for pagination + * @param {number} [limit] Page size for pagination + * @param {string} [search] Filter by user address (partial match supported) + * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getMarketTicker(symbol: string, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getMarketTicker(symbol, options).then((request) => request(this.axios, this.basePath)); + public getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options).then((request) => request(this.axios, this.basePath)); } /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * Returns the all-time rewards earned by users including Kora CC and points. + * @summary Get Kora all-time rewards summary * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getOrderbookDepth(symbol, limit, options).then((request) => request(this.axios, this.basePath)); + public getKoraRewardsSummary(options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).getKoraRewardsSummary(options).then((request) => request(this.axios, this.basePath)); } /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. + * Returns the health status of the Kora rewards service. + * @summary Kora service health check * @param {*} [options] Override http request option. * @throws {RequiredError} - * @memberof ExchangeApi + * @memberof KoraApi */ - public getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); + public koraHealthCheck(options?: RawAxiosRequestConfig) { + return KoraApiFp(this.configuration).koraHealthCheck(options).then((request) => request(this.axios, this.basePath)); } } /** * @export */ -export const GetLeaderboardSortByEnum = { - GetLeaderboardSortByAccountValue: 'accountValue', - GetLeaderboardSortByPnL: 'pnl', - GetLeaderboardSortByVolume: 'volume', - GetLeaderboardSortByUNSPECIFIED: 'UNSPECIFIED' +export const GetKoraCampaignMetadataStatusEnum = { + Active: 'ACTIVE', + Inactive: 'INACTIVE' } as const; -export type GetLeaderboardSortByEnum = typeof GetLeaderboardSortByEnum[keyof typeof GetLeaderboardSortByEnum]; +export type GetKoraCampaignMetadataStatusEnum = typeof GetKoraCampaignMetadataStatusEnum[keyof typeof GetKoraCampaignMetadataStatusEnum]; +/** + * @export + */ +export const GetKoraCampaignRewardsCampaignNameEnum = { + KoraSwaps: 'KORA_SWAPS' +} as const; +export type GetKoraCampaignRewardsCampaignNameEnum = typeof GetKoraCampaignRewardsCampaignNameEnum[keyof typeof GetKoraCampaignRewardsCampaignNameEnum]; +/** + * @export + */ +export const GetKoraEpochMetadataEpochEnum = { + Next: 'next', + Latest: 'latest' +} as const; +export type GetKoraEpochMetadataEpochEnum = typeof GetKoraEpochMetadataEpochEnum[keyof typeof GetKoraEpochMetadataEpochEnum]; +/** + * @export + */ +export const GetKoraIntervalMetadataProtocolEnum = { + Bluefin: 'bluefin', + Kora: 'kora' +} as const; +export type GetKoraIntervalMetadataProtocolEnum = typeof GetKoraIntervalMetadataProtocolEnum[keyof typeof GetKoraIntervalMetadataProtocolEnum]; +/** + * @export + */ +export const GetKoraLeaderboardSortByEnum = { + VolumeRank: 'volumeRank', + TransactionRank: 'transactionRank', + TotalEarnings: 'totalEarnings' +} as const; +export type GetKoraLeaderboardSortByEnum = typeof GetKoraLeaderboardSortByEnum[keyof typeof GetKoraLeaderboardSortByEnum]; +/** + * @export + */ +export const GetKoraLeaderboardSortOrderEnum = { + Asc: 'asc', + Desc: 'desc' +} as const; +export type GetKoraLeaderboardSortOrderEnum = typeof GetKoraLeaderboardSortOrderEnum[keyof typeof GetKoraLeaderboardSortOrderEnum]; /** diff --git a/ts/sdk/src/docs/KoraApi.md b/ts/sdk/src/docs/KoraApi.md new file mode 100644 index 00000000..73982b60 --- /dev/null +++ b/ts/sdk/src/docs/KoraApi.md @@ -0,0 +1,447 @@ +# KoraApi + +All URIs are relative to *https://api.sui-staging.bluefin.io* + +|Method | HTTP request | Description| +|------------- | ------------- | -------------| +|[**getKoraCampaignMetadata**](#getkoracampaignmetadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata| +|[**getKoraCampaignRewards**](#getkoracampaignrewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards| +|[**getKoraEpochConfigMetadata**](#getkoraepochconfigmetadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration| +|[**getKoraEpochMetadata**](#getkoraepochmetadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata| +|[**getKoraIntervalMetadata**](#getkoraintervalmetadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata| +|[**getKoraLeaderboard**](#getkoraleaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard| +|[**getKoraRewardsSummary**](#getkorarewardssummary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary| +|[**koraHealthCheck**](#korahealthcheck) | **GET** /v1/kora/health | Kora service health check| + +# **getKoraCampaignMetadata** +> Array getKoraCampaignMetadata() + +Returns metadata for Kora rewards campaigns. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let campaignName: string; //Specify the campaign name (optional) (default to undefined) +let status: 'ACTIVE' | 'INACTIVE'; //Filter by campaign status (optional) (default to 'ACTIVE') + +const { status, data } = await apiInstance.getKoraCampaignMetadata( + campaignName, + status +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **campaignName** | [**string**] | Specify the campaign name | (optional) defaults to undefined| +| **status** | [**'ACTIVE' | 'INACTIVE'**]**Array<'ACTIVE' | 'INACTIVE'>** | Filter by campaign status | (optional) defaults to 'ACTIVE'| + + +### Return type + +**Array** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | + +[[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) + +# **getKoraCampaignRewards** +> Array getKoraCampaignRewards() + +Returns the rewards earned by users for Kora campaigns. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let userAddress: string; //Specify wallet address (default to undefined) +let campaignName: 'KORA_SWAPS'; //Specify the campaign name (optional) (default to 'KORA_SWAPS') +let epochNumber: number; //Optionally specify epoch number (optional) (default to undefined) + +const { status, data } = await apiInstance.getKoraCampaignRewards( + userAddress, + campaignName, + epochNumber +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **userAddress** | [**string**] | Specify wallet address | defaults to undefined| +| **campaignName** | [**'KORA_SWAPS'**]**Array<'KORA_SWAPS'>** | Specify the campaign name | (optional) defaults to 'KORA_SWAPS'| +| **epochNumber** | [**number**] | Optionally specify epoch number | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | +|**400** | 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) + +# **getKoraEpochConfigMetadata** +> KoraEpochConfigResponse getKoraEpochConfigMetadata() + +Returns epoch configuration including reward allocations for Kora. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let intervalNumber: number; //Specify the interval number (optional) (default to undefined) +let campaignName: string; //Filter by campaign name (optional) (default to undefined) + +const { status, data } = await apiInstance.getKoraEpochConfigMetadata( + intervalNumber, + campaignName +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **intervalNumber** | [**number**] | Specify the interval number | (optional) defaults to undefined| +| **campaignName** | [**string**] | Filter by campaign name | (optional) defaults to undefined| + + +### Return type + +**KoraEpochConfigResponse** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | + +[[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) + +# **getKoraEpochMetadata** +> Array getKoraEpochMetadata() + +Returns the latest or next epoch for a Kora campaign. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let campaignName: string; //Specify the campaign name (optional) (default to undefined) +let epoch: 'next' | 'latest'; //Specify \"next\" or \"latest\" (optional) (default to undefined) + +const { status, data } = await apiInstance.getKoraEpochMetadata( + campaignName, + epoch +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **campaignName** | [**string**] | Specify the campaign name | (optional) defaults to undefined| +| **epoch** | [**'next' | 'latest'**]**Array<'next' | 'latest'>** | Specify \"next\" or \"latest\" | (optional) defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | + +[[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) + +# **getKoraIntervalMetadata** +> Array getKoraIntervalMetadata() + +Returns interval metadata for Kora. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let interval: string; //Interval number or \"next\"/\"latest\" (optional) (default to undefined) +let protocol: 'bluefin' | 'kora'; //Filter by protocol (optional) (default to 'kora') + +const { status, data } = await apiInstance.getKoraIntervalMetadata( + interval, + protocol +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **interval** | [**string**] | Interval number or \"next\"/\"latest\" | (optional) defaults to undefined| +| **protocol** | [**'bluefin' | 'kora'**]**Array<'bluefin' | 'kora'>** | Filter by protocol | (optional) defaults to 'kora'| + + +### Return type + +**Array** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | + +[[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) + +# **getKoraLeaderboard** +> KoraLeaderboardResponse getKoraLeaderboard() + +Returns rankings and earnings for Kora swap participants, sorted by the specified category. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +let epochId: string; //Specify epoch ID (defaults to current active epoch) (optional) (default to undefined) +let sortBy: 'volumeRank' | 'transactionRank' | 'totalEarnings'; //The category to sort rankings by (optional) (default to 'volumeRank') +let sortOrder: 'asc' | 'desc'; //The order to sort rankings by (optional) (default to 'desc') +let page: number; //Page number for pagination (optional) (default to 1) +let limit: number; //Page size for pagination (optional) (default to 50) +let search: string; //Filter by user address (partial match supported) (optional) (default to undefined) +let minVolumeE6: string; //Minimum trading volume filter (e6 format) (optional) (default to '0') + +const { status, data } = await apiInstance.getKoraLeaderboard( + epochId, + sortBy, + sortOrder, + page, + limit, + search, + minVolumeE6 +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **epochId** | [**string**] | Specify epoch ID (defaults to current active epoch) | (optional) defaults to undefined| +| **sortBy** | [**'volumeRank' | 'transactionRank' | 'totalEarnings'**]**Array<'volumeRank' | 'transactionRank' | 'totalEarnings'>** | The category to sort rankings by | (optional) defaults to 'volumeRank'| +| **sortOrder** | [**'asc' | 'desc'**]**Array<'asc' | 'desc'>** | The order to sort rankings by | (optional) defaults to 'desc'| +| **page** | [**number**] | Page number for pagination | (optional) defaults to 1| +| **limit** | [**number**] | Page size for pagination | (optional) defaults to 50| +| **search** | [**string**] | Filter by user address (partial match supported) | (optional) defaults to undefined| +| **minVolumeE6** | [**string**] | Minimum trading volume filter (e6 format) | (optional) defaults to '0'| + + +### Return type + +**KoraLeaderboardResponse** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | +|**400** | Invalid request 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) + +# **getKoraRewardsSummary** +> Array getKoraRewardsSummary() + +Returns the all-time rewards earned by users including Kora CC and points. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +const { status, data } = await apiInstance.getKoraRewardsSummary(); +``` + +### Parameters +This endpoint does not have any parameters. + + +### Return type + +**Array** + +### Authorization + +[bearerAuth](../README.md#bearerAuth) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | + +[[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) + +# **koraHealthCheck** +> KoraHealthCheck200Response koraHealthCheck() + +Returns the health status of the Kora rewards service. + +### Example + +```typescript +import { + KoraApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new KoraApi(configuration); + +const { status, data } = await apiInstance.koraHealthCheck(); +``` + +### Parameters +This endpoint does not have any parameters. + + +### Return type + +**KoraHealthCheck200Response** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Service is healthy | - | + +[[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) + diff --git a/ts/sdk/src/docs/KoraCampaignBonus.md b/ts/sdk/src/docs/KoraCampaignBonus.md new file mode 100644 index 00000000..bf20f122 --- /dev/null +++ b/ts/sdk/src/docs/KoraCampaignBonus.md @@ -0,0 +1,26 @@ +# KoraCampaignBonus + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**bonusType** | **string** | Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) | [optional] [default to undefined] +**bonusCcReward** | **string** | CC reward amount for this bonus | [optional] [default to undefined] +**bonusPoints** | **string** | Points earned for this bonus | [optional] [default to undefined] +**bonusCriteria** | **string** | Criteria that was met for earning this bonus | [optional] [default to undefined] + +## Example + +```typescript +import { KoraCampaignBonus } from '@bluefin/api-client'; + +const instance: KoraCampaignBonus = { + bonusType, + bonusCcReward, + bonusPoints, + bonusCriteria, +}; +``` + +[[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/KoraCampaignMetadata.md b/ts/sdk/src/docs/KoraCampaignMetadata.md new file mode 100644 index 00000000..a773a2d9 --- /dev/null +++ b/ts/sdk/src/docs/KoraCampaignMetadata.md @@ -0,0 +1,28 @@ +# KoraCampaignMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | [default to undefined] +**campaignName** | **string** | Name of the campaign | [default to undefined] +**parentCampaignName** | **string** | Name of the parent campaign | [optional] [default to undefined] +**startDate** | **number** | Time in milliseconds for campaign start date | [default to undefined] +**endDate** | **number** | Time in milliseconds for campaign end date | [default to undefined] + +## Example + +```typescript +import { KoraCampaignMetadata } from '@bluefin/api-client'; + +const instance: KoraCampaignMetadata = { + status, + campaignName, + parentCampaignName, + startDate, + endDate, +}; +``` + +[[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/KoraCampaignRewards.md b/ts/sdk/src/docs/KoraCampaignRewards.md new file mode 100644 index 00000000..564d7e49 --- /dev/null +++ b/ts/sdk/src/docs/KoraCampaignRewards.md @@ -0,0 +1,56 @@ +# KoraCampaignRewards + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAddress** | **string** | User address for the rewards earned data | [default to undefined] +**campaignName** | **string** | Name of the campaign | [default to undefined] +**epochNumber** | **number** | Epoch number for the rewards earned data | [default to undefined] +**intervalNumber** | **number** | Interval number for the rewards earned data | [default to undefined] +**symbol** | **string** | Market Symbol | [optional] [default to undefined] +**status** | **string** | | [default to undefined] +**blueRewards** | **string** | Total blue token rewards | [optional] [default to undefined] +**suiRewards** | **string** | Total sui token rewards | [optional] [default to undefined] +**walRewards** | **string** | Total wal rewards | [optional] [default to undefined] +**cashRewards** | **string** | Total cash rewards | [optional] [default to undefined] +**ccRewards** | **string** | Total CC token rewards | [optional] [default to undefined] +**koraPoints** | **string** | Total Kora points earned | [optional] [default to undefined] +**userFeePaid** | **string** | Total user fee paid | [optional] [default to undefined] +**intervalStartDate** | **number** | Time in milliseconds for interval start date | [optional] [default to undefined] +**intervalEndDate** | **number** | Time in milliseconds for interval end date | [optional] [default to undefined] +**isDisbursed** | **boolean** | Indicates if rewards have been disbursed | [optional] [default to undefined] +**txnDigest** | **string** | Transaction digest of the disbursement | [optional] [default to undefined] +**claimStatus** | **string** | Status of the claim | [optional] [default to undefined] +**bonuses** | [**Array<KoraCampaignBonus>**](KoraCampaignBonus.md) | List of bonuses attached to this reward entry | [optional] [default to undefined] + +## Example + +```typescript +import { KoraCampaignRewards } from '@bluefin/api-client'; + +const instance: KoraCampaignRewards = { + userAddress, + campaignName, + epochNumber, + intervalNumber, + symbol, + status, + blueRewards, + suiRewards, + walRewards, + cashRewards, + ccRewards, + koraPoints, + userFeePaid, + intervalStartDate, + intervalEndDate, + isDisbursed, + txnDigest, + claimStatus, + bonuses, +}; +``` + +[[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/KoraEpochConfig.md b/ts/sdk/src/docs/KoraEpochConfig.md new file mode 100644 index 00000000..a3851e1c --- /dev/null +++ b/ts/sdk/src/docs/KoraEpochConfig.md @@ -0,0 +1,38 @@ +# KoraEpochConfig + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**campaignName** | **string** | The name of the campaign | [default to undefined] +**epochDuration** | **number** | Duration of the epoch in hours | [default to undefined] +**suiRewardsAllocation** | **string** | Allocation of Sui rewards for this epoch | [optional] [default to undefined] +**blueRewardsAllocation** | **string** | Allocation of Blue rewards for this epoch | [optional] [default to undefined] +**walRewardsAllocation** | **string** | Allocation of Wal rewards for this epoch | [optional] [default to undefined] +**ccRewardsAllocation** | **string** | Allocation of CC token rewards for this epoch | [optional] [default to undefined] +**koraPointsRewardsAllocation** | **string** | Allocation of Kora points rewards for this epoch | [optional] [default to undefined] +**intervalNumber** | **number** | Interval number for the epoch | [default to undefined] +**epochNumber** | **number** | Epoch number | [default to undefined] +**config** | **{ [key: string]: any | undefined; }** | Additional campaign-specific configurations | [optional] [default to undefined] + +## Example + +```typescript +import { KoraEpochConfig } from '@bluefin/api-client'; + +const instance: KoraEpochConfig = { + campaignName, + epochDuration, + suiRewardsAllocation, + blueRewardsAllocation, + walRewardsAllocation, + ccRewardsAllocation, + koraPointsRewardsAllocation, + intervalNumber, + epochNumber, + config, +}; +``` + +[[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/KoraEpochConfigResponse.md b/ts/sdk/src/docs/KoraEpochConfigResponse.md new file mode 100644 index 00000000..3533230d --- /dev/null +++ b/ts/sdk/src/docs/KoraEpochConfigResponse.md @@ -0,0 +1,24 @@ +# KoraEpochConfigResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**maxIntervalNumber** | **number** | The maximum interval number available | [default to undefined] +**intervalNumber** | **number** | The current interval number being queried | [default to undefined] +**data** | [**Array<KoraEpochConfig>**](KoraEpochConfig.md) | | [default to undefined] + +## Example + +```typescript +import { KoraEpochConfigResponse } from '@bluefin/api-client'; + +const instance: KoraEpochConfigResponse = { + maxIntervalNumber, + intervalNumber, + data, +}; +``` + +[[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/KoraEpochMetadata.md b/ts/sdk/src/docs/KoraEpochMetadata.md new file mode 100644 index 00000000..f2eb293d --- /dev/null +++ b/ts/sdk/src/docs/KoraEpochMetadata.md @@ -0,0 +1,30 @@ +# KoraEpochMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | [default to undefined] +**campaignName** | **string** | Name of the campaign | [default to undefined] +**epochId** | **string** | Epoch ID | [default to undefined] +**epochNumber** | **number** | Epoch number | [default to undefined] +**startDate** | **number** | Time in milliseconds for epoch start date | [default to undefined] +**endDate** | **number** | Time in milliseconds for epoch end date | [default to undefined] + +## Example + +```typescript +import { KoraEpochMetadata } from '@bluefin/api-client'; + +const instance: KoraEpochMetadata = { + status, + campaignName, + epochId, + epochNumber, + startDate, + endDate, +}; +``` + +[[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/KoraHealthCheck200Response.md b/ts/sdk/src/docs/KoraHealthCheck200Response.md new file mode 100644 index 00000000..de3de091 --- /dev/null +++ b/ts/sdk/src/docs/KoraHealthCheck200Response.md @@ -0,0 +1,22 @@ +# KoraHealthCheck200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | [optional] [default to undefined] +**timestamp** | **number** | | [optional] [default to undefined] + +## Example + +```typescript +import { KoraHealthCheck200Response } from '@bluefin/api-client'; + +const instance: KoraHealthCheck200Response = { + status, + timestamp, +}; +``` + +[[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/KoraIntervalMetadata.md b/ts/sdk/src/docs/KoraIntervalMetadata.md new file mode 100644 index 00000000..be57eb48 --- /dev/null +++ b/ts/sdk/src/docs/KoraIntervalMetadata.md @@ -0,0 +1,30 @@ +# KoraIntervalMetadata + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | [default to undefined] +**startDate** | **number** | Time in milliseconds for interval start date | [default to undefined] +**endDate** | **number** | Time in milliseconds for interval end date | [default to undefined] +**intervalId** | **number** | Interval ID | [default to undefined] +**intervalType** | **string** | Type of the interval | [optional] [default to undefined] +**protocol** | **string** | Protocol for the interval | [optional] [default to undefined] + +## Example + +```typescript +import { KoraIntervalMetadata } from '@bluefin/api-client'; + +const instance: KoraIntervalMetadata = { + status, + startDate, + endDate, + intervalId, + intervalType, + protocol, +}; +``` + +[[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/KoraLeaderboardEntry.md b/ts/sdk/src/docs/KoraLeaderboardEntry.md new file mode 100644 index 00000000..91373d74 --- /dev/null +++ b/ts/sdk/src/docs/KoraLeaderboardEntry.md @@ -0,0 +1,44 @@ +# KoraLeaderboardEntry + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rank** | **number** | Overall ranking position based on sortBy parameter | [default to undefined] +**userAddress** | **string** | Wallet address of the user | [default to undefined] +**totalVolumeE6** | **string** | Total swap volume (USD equivalent) | [default to undefined] +**totalFeeE6** | **string** | Total fees paid | [optional] [default to undefined] +**totalTransactions** | **number** | Total number of qualifying swap transactions | [default to undefined] +**ccRewards** | **string** | CC token rewards earned | [default to undefined] +**koraPoints** | **string** | Kora points earned | [default to undefined] +**totalBonusPoints** | **string** | Total bonus points earned | [optional] [default to undefined] +**totalBonusCC** | **string** | Total bonus CC tokens earned | [optional] [default to undefined] +**volumeRank** | **number** | Ranking based purely on trading volume | [optional] [default to undefined] +**transactionRank** | **number** | Ranking based purely on transaction count | [optional] [default to undefined] +**totalEarningsRank** | **number** | Ranking based on combined CC + Kora points value | [optional] [default to undefined] +**lastActivityDate** | **number** | Timestamp of user\'s most recent swap (milliseconds) | [optional] [default to undefined] + +## Example + +```typescript +import { KoraLeaderboardEntry } from '@bluefin/api-client'; + +const instance: KoraLeaderboardEntry = { + rank, + userAddress, + totalVolumeE6, + totalFeeE6, + totalTransactions, + ccRewards, + koraPoints, + totalBonusPoints, + totalBonusCC, + volumeRank, + transactionRank, + totalEarningsRank, + lastActivityDate, +}; +``` + +[[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/KoraLeaderboardResponse.md b/ts/sdk/src/docs/KoraLeaderboardResponse.md new file mode 100644 index 00000000..daadf7e2 --- /dev/null +++ b/ts/sdk/src/docs/KoraLeaderboardResponse.md @@ -0,0 +1,26 @@ +# KoraLeaderboardResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**Array<KoraLeaderboardEntry>**](KoraLeaderboardEntry.md) | | [default to undefined] +**total** | **number** | Total number of records | [default to undefined] +**limit** | **number** | Page size for pagination | [default to undefined] +**page** | **number** | Current page number | [default to undefined] + +## Example + +```typescript +import { KoraLeaderboardResponse } from '@bluefin/api-client'; + +const instance: KoraLeaderboardResponse = { + data, + total, + limit, + page, +}; +``` + +[[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/KoraRewardsSummary.md b/ts/sdk/src/docs/KoraRewardsSummary.md new file mode 100644 index 00000000..bef2f415 --- /dev/null +++ b/ts/sdk/src/docs/KoraRewardsSummary.md @@ -0,0 +1,30 @@ +# KoraRewardsSummary + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAddress** | **string** | User address for the rewards earned data | [default to undefined] +**blueRewards** | **string** | Total Blue token rewards earned | [optional] [default to undefined] +**suiRewards** | **string** | Total Sui token rewards earned | [optional] [default to undefined] +**walRewards** | **string** | Total wal rewards earned | [optional] [default to undefined] +**ccRewards** | **string** | Total CC token rewards earned across all Kora campaigns | [optional] [default to undefined] +**koraPoints** | **string** | Total Kora points earned across all Kora campaigns | [optional] [default to undefined] + +## Example + +```typescript +import { KoraRewardsSummary } from '@bluefin/api-client'; + +const instance: KoraRewardsSummary = { + userAddress, + blueRewards, + suiRewards, + walRewards, + ccRewards, + koraPoints, +}; +``` + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) From 8a913e3ed4ff61e562d8afcb04c86936bd3ec8ad Mon Sep 17 00:00:00 2001 From: nidakarimali Date: Tue, 3 Mar 2026 23:20:53 -0500 Subject: [PATCH 2/5] updated pro-sdk --- python/sdk/src/.openapi-generator/FILES | 26 +- python/sdk/src/openapi_client/__init__.py | 12 +- python/sdk/src/openapi_client/api/kora_api.py | 2038 ------ .../sdk/src/openapi_client/api/rewards_api.py | 266 + python/sdk/src/openapi_client/docs/Error1.md | 30 + python/sdk/src/openapi_client/docs/KoraApi.md | 515 -- .../docs/KoraUserBonusResponse.md | 33 + .../sdk/src/openapi_client/docs/RewardsApi.md | 70 + .../sdk/src/openapi_client/models/__init__.py | 12 +- .../sdk/src/openapi_client/models/error1.py | 89 + .../models/kora_user_bonus_response.py | 95 + .../src/openapi_client/test/test_error1.py | 52 + .../test/test_kora_user_bonus_response.py | 59 + python/sdk/src/openapi_client_README.md | 20 +- resources/bluefin-api.yaml | 16 +- resources/kora-rewards-api.yaml | 500 +- rust/Cargo.lock | 222 +- rust/gen/bluefin_api/.openapi-generator/FILES | 24 +- rust/gen/bluefin_api/Cargo.toml | 1 - rust/gen/bluefin_api/README.md | 20 +- rust/gen/bluefin_api/docs/Error1.md | 12 + rust/gen/bluefin_api/docs/KoraApi.md | 226 - .../bluefin_api/docs/KoraUserBonusResponse.md | 15 + rust/gen/bluefin_api/docs/RewardsApi.md | 31 + rust/gen/bluefin_api/src/apis/kora_api.rs | 375 -- rust/gen/bluefin_api/src/apis/rewards_api.rs | 46 + rust/gen/bluefin_api/src/models/error_1.rs | 32 + .../src/models/kora_user_bonus_response.rs | 44 + rust/gen/bluefin_api/src/models/mod.rs | 24 +- ts/sdk/src/.openapi-generator/FILES | 12 +- ts/sdk/src/api.ts | 5882 +++++++---------- ts/sdk/src/docs/Error1.md | 22 + ts/sdk/src/docs/KoraApi.md | 395 -- ts/sdk/src/docs/KoraUserBonusResponse.md | 28 + ts/sdk/src/docs/RewardsApi.md | 53 + 35 files changed, 3563 insertions(+), 7734 deletions(-) create mode 100644 python/sdk/src/openapi_client/docs/Error1.md create mode 100644 python/sdk/src/openapi_client/docs/KoraUserBonusResponse.md create mode 100644 python/sdk/src/openapi_client/models/error1.py create mode 100644 python/sdk/src/openapi_client/models/kora_user_bonus_response.py create mode 100644 python/sdk/src/openapi_client/test/test_error1.py create mode 100644 python/sdk/src/openapi_client/test/test_kora_user_bonus_response.py create mode 100644 rust/gen/bluefin_api/docs/Error1.md create mode 100644 rust/gen/bluefin_api/docs/KoraUserBonusResponse.md create mode 100644 rust/gen/bluefin_api/src/models/error_1.rs create mode 100644 rust/gen/bluefin_api/src/models/kora_user_bonus_response.rs create mode 100644 ts/sdk/src/docs/Error1.md create mode 100644 ts/sdk/src/docs/KoraUserBonusResponse.md diff --git a/python/sdk/src/.openapi-generator/FILES b/python/sdk/src/.openapi-generator/FILES index 58c8e003..fb3a3510 100644 --- a/python/sdk/src/.openapi-generator/FILES +++ b/python/sdk/src/.openapi-generator/FILES @@ -67,6 +67,7 @@ openapi_client/docs/EpochConfigs.md openapi_client/docs/EpochConfigsResponse.md openapi_client/docs/EpochMetadata.md openapi_client/docs/Error.md +openapi_client/docs/Error1.md openapi_client/docs/ExchangeApi.md openapi_client/docs/ExchangeInfoResponse.md openapi_client/docs/FailedCommandType.md @@ -81,17 +82,8 @@ openapi_client/docs/IntervalRewards.md openapi_client/docs/IssBase64Details.md openapi_client/docs/KlineInterval.md openapi_client/docs/KoraApi.md -openapi_client/docs/KoraCampaignBonus.md -openapi_client/docs/KoraCampaignMetadata.md -openapi_client/docs/KoraCampaignRewards.md -openapi_client/docs/KoraEpochConfig.md -openapi_client/docs/KoraEpochConfigResponse.md -openapi_client/docs/KoraEpochMetadata.md openapi_client/docs/KoraHealthCheck200Response.md -openapi_client/docs/KoraIntervalMetadata.md -openapi_client/docs/KoraLeaderboardEntry.md -openapi_client/docs/KoraLeaderboardResponse.md -openapi_client/docs/KoraRewardsSummary.md +openapi_client/docs/KoraUserBonusResponse.md openapi_client/docs/LeaderboardEntry.md openapi_client/docs/LeaderboardInterval.md openapi_client/docs/LeaderboardResponse.md @@ -225,6 +217,7 @@ openapi_client/models/epoch_configs.py openapi_client/models/epoch_configs_response.py openapi_client/models/epoch_metadata.py openapi_client/models/error.py +openapi_client/models/error1.py openapi_client/models/exchange_info_response.py openapi_client/models/failed_command_type.py openapi_client/models/fee_configs.py @@ -237,17 +230,8 @@ openapi_client/models/interval_metadata.py openapi_client/models/interval_rewards.py openapi_client/models/iss_base64_details.py openapi_client/models/kline_interval.py -openapi_client/models/kora_campaign_bonus.py -openapi_client/models/kora_campaign_metadata.py -openapi_client/models/kora_campaign_rewards.py -openapi_client/models/kora_epoch_config.py -openapi_client/models/kora_epoch_config_response.py -openapi_client/models/kora_epoch_metadata.py openapi_client/models/kora_health_check200_response.py -openapi_client/models/kora_interval_metadata.py -openapi_client/models/kora_leaderboard_entry.py -openapi_client/models/kora_leaderboard_response.py -openapi_client/models/kora_rewards_summary.py +openapi_client/models/kora_user_bonus_response.py openapi_client/models/leaderboard_entry.py openapi_client/models/leaderboard_interval.py openapi_client/models/leaderboard_response.py @@ -323,4 +307,6 @@ openapi_client/models/zk_login_zkp_request.py openapi_client/models/zk_login_zkp_response.py openapi_client/rest.py openapi_client/test/__init__.py +openapi_client/test/test_error1.py +openapi_client/test/test_kora_user_bonus_response.py openapi_client_README.md diff --git a/python/sdk/src/openapi_client/__init__.py b/python/sdk/src/openapi_client/__init__.py index f4b2919d..48ede19c 100644 --- a/python/sdk/src/openapi_client/__init__.py +++ b/python/sdk/src/openapi_client/__init__.py @@ -92,6 +92,7 @@ from openapi_client.models.epoch_configs_response import EpochConfigsResponse from openapi_client.models.epoch_metadata import EpochMetadata from openapi_client.models.error import Error +from openapi_client.models.error1 import Error1 from openapi_client.models.exchange_info_response import ExchangeInfoResponse from openapi_client.models.failed_command_type import FailedCommandType from openapi_client.models.fee_configs import FeeConfigs @@ -104,17 +105,8 @@ from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details from openapi_client.models.kline_interval import KlineInterval -from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus -from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata -from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards -from openapi_client.models.kora_epoch_config import KoraEpochConfig -from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse -from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response -from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata -from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry -from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse -from openapi_client.models.kora_rewards_summary import KoraRewardsSummary +from openapi_client.models.kora_user_bonus_response import KoraUserBonusResponse from openapi_client.models.leaderboard_entry import LeaderboardEntry from openapi_client.models.leaderboard_interval import LeaderboardInterval from openapi_client.models.leaderboard_response import LeaderboardResponse diff --git a/python/sdk/src/openapi_client/api/kora_api.py b/python/sdk/src/openapi_client/api/kora_api.py index 0561b052..8c09ad68 100644 --- a/python/sdk/src/openapi_client/api/kora_api.py +++ b/python/sdk/src/openapi_client/api/kora_api.py @@ -16,17 +16,7 @@ from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr, field_validator -from typing import List, Optional -from typing_extensions import Annotated -from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata -from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards -from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse -from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response -from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata -from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse -from openapi_client.models.kora_rewards_summary import KoraRewardsSummary from openapi_client.api_client import ApiClient, RequestSerialized from openapi_client.api_response import ApiResponse @@ -46,2034 +36,6 @@ def __init__(self, api_client=None) -> None: self.api_client = api_client - @validate_call - async def get_kora_campaign_metadata( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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, - ) -> List[KoraCampaignMetadata]: - """Get Kora campaign metadata - - Returns metadata for Kora rewards campaigns. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param status: Filter by campaign status - :type status: str - :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_kora_campaign_metadata_serialize( - campaign_name=campaign_name, - status=status, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignMetadata]", - } - 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_kora_campaign_metadata_with_http_info( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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[List[KoraCampaignMetadata]]: - """Get Kora campaign metadata - - Returns metadata for Kora rewards campaigns. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param status: Filter by campaign status - :type status: str - :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_kora_campaign_metadata_serialize( - campaign_name=campaign_name, - status=status, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignMetadata]", - } - 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_kora_campaign_metadata_without_preload_content( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - status: Annotated[Optional[StrictStr], Field(description="Filter by campaign status")] = 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: - """Get Kora campaign metadata - - Returns metadata for Kora rewards campaigns. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param status: Filter by campaign status - :type status: str - :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_kora_campaign_metadata_serialize( - campaign_name=campaign_name, - status=status, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignMetadata]", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_campaign_metadata_serialize( - self, - campaign_name, - status, - _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 campaign_name is not None: - - _query_params.append(('campaignName', campaign_name)) - - if status is not None: - - _query_params.append(('status', status)) - - # 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/kora/metadata/campaign', - 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 get_kora_campaign_rewards( - self, - user_address: Annotated[StrictStr, Field(description="Specify wallet address")], - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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, - ) -> List[KoraCampaignRewards]: - """Get Kora campaign rewards - - Returns the rewards earned by users for Kora campaigns. - - :param user_address: Specify wallet address (required) - :type user_address: str - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch_number: Optionally specify epoch number - :type epoch_number: 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_kora_campaign_rewards_serialize( - user_address=user_address, - campaign_name=campaign_name, - epoch_number=epoch_number, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignRewards]", - '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_kora_campaign_rewards_with_http_info( - self, - user_address: Annotated[StrictStr, Field(description="Specify wallet address")], - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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[List[KoraCampaignRewards]]: - """Get Kora campaign rewards - - Returns the rewards earned by users for Kora campaigns. - - :param user_address: Specify wallet address (required) - :type user_address: str - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch_number: Optionally specify epoch number - :type epoch_number: 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_kora_campaign_rewards_serialize( - user_address=user_address, - campaign_name=campaign_name, - epoch_number=epoch_number, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignRewards]", - '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_kora_campaign_rewards_without_preload_content( - self, - user_address: Annotated[StrictStr, Field(description="Specify wallet address")], - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch_number: Annotated[Optional[StrictInt], Field(description="Optionally specify epoch number")] = 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: - """Get Kora campaign rewards - - Returns the rewards earned by users for Kora campaigns. - - :param user_address: Specify wallet address (required) - :type user_address: str - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch_number: Optionally specify epoch number - :type epoch_number: 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_kora_campaign_rewards_serialize( - user_address=user_address, - campaign_name=campaign_name, - epoch_number=epoch_number, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraCampaignRewards]", - '400': "Error", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_campaign_rewards_serialize( - self, - user_address, - campaign_name, - epoch_number, - _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 campaign_name is not None: - - _query_params.append(('campaignName', campaign_name)) - - if epoch_number is not None: - - _query_params.append(('epochNumber', epoch_number)) - - if user_address is not None: - - _query_params.append(('userAddress', user_address)) - - # 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/kora/rewards/campaign', - 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 get_kora_epoch_config_metadata( - self, - interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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, - ) -> KoraEpochConfigResponse: - """Get Kora epoch configuration - - Returns epoch configuration including reward allocations for Kora. - - :param interval_number: Specify the interval number - :type interval_number: int - :param campaign_name: Filter by campaign name - :type campaign_name: str - :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_kora_epoch_config_metadata_serialize( - interval_number=interval_number, - campaign_name=campaign_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraEpochConfigResponse", - } - 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_kora_epoch_config_metadata_with_http_info( - self, - interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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[KoraEpochConfigResponse]: - """Get Kora epoch configuration - - Returns epoch configuration including reward allocations for Kora. - - :param interval_number: Specify the interval number - :type interval_number: int - :param campaign_name: Filter by campaign name - :type campaign_name: str - :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_kora_epoch_config_metadata_serialize( - interval_number=interval_number, - campaign_name=campaign_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraEpochConfigResponse", - } - 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_kora_epoch_config_metadata_without_preload_content( - self, - interval_number: Annotated[Optional[StrictInt], Field(description="Specify the interval number")] = None, - campaign_name: Annotated[Optional[StrictStr], Field(description="Filter by campaign name")] = 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: - """Get Kora epoch configuration - - Returns epoch configuration including reward allocations for Kora. - - :param interval_number: Specify the interval number - :type interval_number: int - :param campaign_name: Filter by campaign name - :type campaign_name: str - :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_kora_epoch_config_metadata_serialize( - interval_number=interval_number, - campaign_name=campaign_name, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraEpochConfigResponse", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_epoch_config_metadata_serialize( - self, - interval_number, - campaign_name, - _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 interval_number is not None: - - _query_params.append(('intervalNumber', interval_number)) - - if campaign_name is not None: - - _query_params.append(('campaignName', campaign_name)) - - # 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/kora/metadata/epoch/configs', - 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 get_kora_epoch_metadata( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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, - ) -> List[KoraEpochMetadata]: - """Get Kora epoch metadata - - Returns the latest or next epoch for a Kora campaign. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch: Specify \"next\" or \"latest\" - :type epoch: str - :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_kora_epoch_metadata_serialize( - campaign_name=campaign_name, - epoch=epoch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraEpochMetadata]", - } - 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_kora_epoch_metadata_with_http_info( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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[List[KoraEpochMetadata]]: - """Get Kora epoch metadata - - Returns the latest or next epoch for a Kora campaign. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch: Specify \"next\" or \"latest\" - :type epoch: str - :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_kora_epoch_metadata_serialize( - campaign_name=campaign_name, - epoch=epoch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraEpochMetadata]", - } - 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_kora_epoch_metadata_without_preload_content( - self, - campaign_name: Annotated[Optional[StrictStr], Field(description="Specify the campaign name")] = None, - epoch: Annotated[Optional[StrictStr], Field(description="Specify \"next\" or \"latest\"")] = 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: - """Get Kora epoch metadata - - Returns the latest or next epoch for a Kora campaign. - - :param campaign_name: Specify the campaign name - :type campaign_name: str - :param epoch: Specify \"next\" or \"latest\" - :type epoch: str - :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_kora_epoch_metadata_serialize( - campaign_name=campaign_name, - epoch=epoch, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraEpochMetadata]", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_epoch_metadata_serialize( - self, - campaign_name, - epoch, - _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 campaign_name is not None: - - _query_params.append(('campaignName', campaign_name)) - - if epoch is not None: - - _query_params.append(('epoch', epoch)) - - # 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/kora/metadata/epoch', - 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 get_kora_interval_metadata( - self, - interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, - protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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, - ) -> List[KoraIntervalMetadata]: - """Get Kora interval metadata - - Returns interval metadata for Kora. - - :param interval: Interval number or \"next\"/\"latest\" - :type interval: str - :param protocol: Filter by protocol - :type protocol: str - :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_kora_interval_metadata_serialize( - interval=interval, - protocol=protocol, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraIntervalMetadata]", - } - 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_kora_interval_metadata_with_http_info( - self, - interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, - protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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[List[KoraIntervalMetadata]]: - """Get Kora interval metadata - - Returns interval metadata for Kora. - - :param interval: Interval number or \"next\"/\"latest\" - :type interval: str - :param protocol: Filter by protocol - :type protocol: str - :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_kora_interval_metadata_serialize( - interval=interval, - protocol=protocol, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraIntervalMetadata]", - } - 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_kora_interval_metadata_without_preload_content( - self, - interval: Annotated[Optional[StrictStr], Field(description="Interval number or \"next\"/\"latest\"")] = None, - protocol: Annotated[Optional[StrictStr], Field(description="Filter by protocol")] = 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: - """Get Kora interval metadata - - Returns interval metadata for Kora. - - :param interval: Interval number or \"next\"/\"latest\" - :type interval: str - :param protocol: Filter by protocol - :type protocol: str - :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_kora_interval_metadata_serialize( - interval=interval, - protocol=protocol, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraIntervalMetadata]", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_interval_metadata_serialize( - self, - interval, - protocol, - _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 interval is not None: - - _query_params.append(('interval', interval)) - - if protocol is not None: - - _query_params.append(('protocol', protocol)) - - # 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/kora/metadata/interval', - 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 get_kora_leaderboard( - self, - epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, - search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, - min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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, - ) -> KoraLeaderboardResponse: - """Get Kora swap leaderboard - - Returns rankings and earnings for Kora swap participants, sorted by the specified category. - - :param epoch_id: Specify epoch ID (defaults to current active epoch) - :type epoch_id: str - :param sort_by: The category to sort rankings by - :type sort_by: str - :param sort_order: The order to sort rankings by - :type sort_order: str - :param page: Page number for pagination - :type page: int - :param limit: Page size for pagination - :type limit: int - :param search: Filter by user address (partial match supported) - :type search: str - :param min_volume_e6: Minimum trading volume filter (e6 format) - :type min_volume_e6: str - :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_kora_leaderboard_serialize( - epoch_id=epoch_id, - sort_by=sort_by, - sort_order=sort_order, - page=page, - limit=limit, - search=search, - min_volume_e6=min_volume_e6, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraLeaderboardResponse", - '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_kora_leaderboard_with_http_info( - self, - epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, - search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, - min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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[KoraLeaderboardResponse]: - """Get Kora swap leaderboard - - Returns rankings and earnings for Kora swap participants, sorted by the specified category. - - :param epoch_id: Specify epoch ID (defaults to current active epoch) - :type epoch_id: str - :param sort_by: The category to sort rankings by - :type sort_by: str - :param sort_order: The order to sort rankings by - :type sort_order: str - :param page: Page number for pagination - :type page: int - :param limit: Page size for pagination - :type limit: int - :param search: Filter by user address (partial match supported) - :type search: str - :param min_volume_e6: Minimum trading volume filter (e6 format) - :type min_volume_e6: str - :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_kora_leaderboard_serialize( - epoch_id=epoch_id, - sort_by=sort_by, - sort_order=sort_order, - page=page, - limit=limit, - search=search, - min_volume_e6=min_volume_e6, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraLeaderboardResponse", - '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_kora_leaderboard_without_preload_content( - self, - epoch_id: Annotated[Optional[StrictStr], Field(description="Specify epoch ID (defaults to current active epoch)")] = None, - sort_by: Annotated[Optional[StrictStr], Field(description="The category to sort rankings by")] = None, - sort_order: Annotated[Optional[StrictStr], Field(description="The order to sort rankings by")] = None, - page: Annotated[Optional[Annotated[int, Field(strict=True, ge=1)]], Field(description="Page number for pagination")] = None, - limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Page size for pagination")] = None, - search: Annotated[Optional[StrictStr], Field(description="Filter by user address (partial match supported)")] = None, - min_volume_e6: Annotated[Optional[StrictStr], Field(description="Minimum trading volume filter (e6 format)")] = 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: - """Get Kora swap leaderboard - - Returns rankings and earnings for Kora swap participants, sorted by the specified category. - - :param epoch_id: Specify epoch ID (defaults to current active epoch) - :type epoch_id: str - :param sort_by: The category to sort rankings by - :type sort_by: str - :param sort_order: The order to sort rankings by - :type sort_order: str - :param page: Page number for pagination - :type page: int - :param limit: Page size for pagination - :type limit: int - :param search: Filter by user address (partial match supported) - :type search: str - :param min_volume_e6: Minimum trading volume filter (e6 format) - :type min_volume_e6: str - :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_kora_leaderboard_serialize( - epoch_id=epoch_id, - sort_by=sort_by, - sort_order=sort_order, - page=page, - limit=limit, - search=search, - min_volume_e6=min_volume_e6, - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "KoraLeaderboardResponse", - '400': "Error", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_leaderboard_serialize( - self, - epoch_id, - sort_by, - sort_order, - page, - limit, - search, - min_volume_e6, - _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 epoch_id is not None: - - _query_params.append(('epochId', epoch_id)) - - if sort_by is not None: - - _query_params.append(('sortBy', sort_by)) - - if sort_order is not None: - - _query_params.append(('sortOrder', sort_order)) - - if page is not None: - - _query_params.append(('page', page)) - - if limit is not None: - - _query_params.append(('limit', limit)) - - if search is not None: - - _query_params.append(('search', search)) - - if min_volume_e6 is not None: - - _query_params.append(('minVolumeE6', min_volume_e6)) - - # 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/kora/leaderboard', - 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 get_kora_rewards_summary( - self, - _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, - ) -> List[KoraRewardsSummary]: - """Get Kora all-time rewards summary - - Returns the all-time rewards earned by users including Kora CC and points. - - :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_kora_rewards_summary_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraRewardsSummary]", - } - 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_kora_rewards_summary_with_http_info( - self, - _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[List[KoraRewardsSummary]]: - """Get Kora all-time rewards summary - - Returns the all-time rewards earned by users including Kora CC and points. - - :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_kora_rewards_summary_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraRewardsSummary]", - } - 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_kora_rewards_summary_without_preload_content( - self, - _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: - """Get Kora all-time rewards summary - - Returns the all-time rewards earned by users including Kora CC and points. - - :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_kora_rewards_summary_serialize( - _request_auth=_request_auth, - _content_type=_content_type, - _headers=_headers, - _host_index=_host_index - ) - - _response_types_map: Dict[str, Optional[str]] = { - '200': "List[KoraRewardsSummary]", - } - response_data = await self.api_client.call_api( - *_param, - _request_timeout=_request_timeout - ) - return response_data.response - - - def _get_kora_rewards_summary_serialize( - self, - _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 - # 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] = [ - 'bearerAuth' - ] - - return self.api_client.param_serialize( - method='GET', - resource_path='/v1/kora/rewards/summary', - 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 kora_health_check( self, diff --git a/python/sdk/src/openapi_client/api/rewards_api.py b/python/sdk/src/openapi_client/api/rewards_api.py index 52e52061..c6368b71 100644 --- a/python/sdk/src/openapi_client/api/rewards_api.py +++ b/python/sdk/src/openapi_client/api/rewards_api.py @@ -31,6 +31,7 @@ from openapi_client.models.get_affiliate_overview200_response import GetAffiliateOverview200Response from openapi_client.models.interval_metadata import IntervalMetadata from openapi_client.models.interval_rewards import IntervalRewards +from openapi_client.models.kora_user_bonus_response import KoraUserBonusResponse from openapi_client.models.mark_as_claimed_request import MarkAsClaimedRequest from openapi_client.models.mark_as_claimed_response import MarkAsClaimedResponse from openapi_client.models.onboard_affiliate_request import OnboardAffiliateRequest @@ -3756,6 +3757,271 @@ def _get_rewards_summary_serialize( + @validate_call + async def get_user_bonuses( + self, + epoch_number: Annotated[StrictInt, Field(description="Specify the epoch number")], + _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, + ) -> List[KoraUserBonusResponse]: + """Get all user bonuses by epoch + + Returns the bonuses earned by all users for a specific epoch number. + + :param epoch_number: Specify the epoch number (required) + :type epoch_number: 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_user_bonuses_serialize( + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraUserBonusResponse]", + '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_user_bonuses_with_http_info( + self, + epoch_number: Annotated[StrictInt, Field(description="Specify the epoch number")], + _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[List[KoraUserBonusResponse]]: + """Get all user bonuses by epoch + + Returns the bonuses earned by all users for a specific epoch number. + + :param epoch_number: Specify the epoch number (required) + :type epoch_number: 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_user_bonuses_serialize( + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraUserBonusResponse]", + '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_user_bonuses_without_preload_content( + self, + epoch_number: Annotated[StrictInt, Field(description="Specify the epoch number")], + _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: + """Get all user bonuses by epoch + + Returns the bonuses earned by all users for a specific epoch number. + + :param epoch_number: Specify the epoch number (required) + :type epoch_number: 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_user_bonuses_serialize( + epoch_number=epoch_number, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[KoraUserBonusResponse]", + '400': "Error", + } + response_data = await self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_user_bonuses_serialize( + self, + epoch_number, + _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 epoch_number is not None: + + _query_params.append(('epochNumber', epoch_number)) + + # 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/rewards/bonuses', + 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/docs/Error1.md b/python/sdk/src/openapi_client/docs/Error1.md new file mode 100644 index 00000000..a05bfdbc --- /dev/null +++ b/python/sdk/src/openapi_client/docs/Error1.md @@ -0,0 +1,30 @@ +# Error1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | Error message | [optional] +**code** | **str** | Error code | [optional] + +## Example + +```python +from openapi_client.models.error1 import Error1 + +# TODO update the JSON string below +json = "{}" +# create an instance of Error1 from a JSON string +error1_instance = Error1.from_json(json) +# print the JSON string representation of the object +print(Error1.to_json()) + +# convert the object into a dict +error1_dict = error1_instance.to_dict() +# create an instance of Error1 from a dict +error1_from_dict = Error1.from_dict(error1_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/KoraApi.md b/python/sdk/src/openapi_client/docs/KoraApi.md index 1b9eea5e..b4ac1a44 100644 --- a/python/sdk/src/openapi_client/docs/KoraApi.md +++ b/python/sdk/src/openapi_client/docs/KoraApi.md @@ -4,524 +4,9 @@ All URIs are relative to *https://api.sui-staging.bluefin.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_kora_campaign_metadata**](KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata -[**get_kora_campaign_rewards**](KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards -[**get_kora_epoch_config_metadata**](KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration -[**get_kora_epoch_metadata**](KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata -[**get_kora_interval_metadata**](KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata -[**get_kora_leaderboard**](KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard -[**get_kora_rewards_summary**](KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary [**kora_health_check**](KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check -# **get_kora_campaign_metadata** -> List[KoraCampaignMetadata] get_kora_campaign_metadata(campaign_name=campaign_name, status=status) - -Get Kora campaign metadata - -Returns metadata for Kora rewards campaigns. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata -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.KoraApi(api_client) - campaign_name = 'KORA_SWAPS' # str | Specify the campaign name (optional) - status = ACTIVE # str | Filter by campaign status (optional) (default to ACTIVE) - - try: - # Get Kora campaign metadata - api_response = await api_instance.get_kora_campaign_metadata(campaign_name=campaign_name, status=status) - print("The response of KoraApi->get_kora_campaign_metadata:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_campaign_metadata: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_name** | **str**| Specify the campaign name | [optional] - **status** | **str**| Filter by campaign status | [optional] [default to ACTIVE] - -### Return type - -[**List[KoraCampaignMetadata]**](KoraCampaignMetadata.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | - -[[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_kora_campaign_rewards** -> List[KoraCampaignRewards] get_kora_campaign_rewards(user_address, campaign_name=campaign_name, epoch_number=epoch_number) - -Get Kora campaign rewards - -Returns the rewards earned by users for Kora campaigns. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards -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.KoraApi(api_client) - user_address = '0x1234567890abcdef' # str | Specify wallet address - campaign_name = KORA_SWAPS # str | Specify the campaign name (optional) (default to KORA_SWAPS) - epoch_number = 7 # int | Optionally specify epoch number (optional) - - try: - # Get Kora campaign rewards - api_response = await api_instance.get_kora_campaign_rewards(user_address, campaign_name=campaign_name, epoch_number=epoch_number) - print("The response of KoraApi->get_kora_campaign_rewards:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_campaign_rewards: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **user_address** | **str**| Specify wallet address | - **campaign_name** | **str**| Specify the campaign name | [optional] [default to KORA_SWAPS] - **epoch_number** | **int**| Optionally specify epoch number | [optional] - -### Return type - -[**List[KoraCampaignRewards]**](KoraCampaignRewards.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | -**400** | 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) - -# **get_kora_epoch_config_metadata** -> KoraEpochConfigResponse get_kora_epoch_config_metadata(interval_number=interval_number, campaign_name=campaign_name) - -Get Kora epoch configuration - -Returns epoch configuration including reward allocations for Kora. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse -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.KoraApi(api_client) - interval_number = 7 # int | Specify the interval number (optional) - campaign_name = 'KORA_SWAPS' # str | Filter by campaign name (optional) - - try: - # Get Kora epoch configuration - api_response = await api_instance.get_kora_epoch_config_metadata(interval_number=interval_number, campaign_name=campaign_name) - print("The response of KoraApi->get_kora_epoch_config_metadata:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_epoch_config_metadata: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **interval_number** | **int**| Specify the interval number | [optional] - **campaign_name** | **str**| Filter by campaign name | [optional] - -### Return type - -[**KoraEpochConfigResponse**](KoraEpochConfigResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | - -[[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_kora_epoch_metadata** -> List[KoraEpochMetadata] get_kora_epoch_metadata(campaign_name=campaign_name, epoch=epoch) - -Get Kora epoch metadata - -Returns the latest or next epoch for a Kora campaign. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata -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.KoraApi(api_client) - campaign_name = 'KORA_SWAPS' # str | Specify the campaign name (optional) - epoch = 'epoch_example' # str | Specify \"next\" or \"latest\" (optional) - - try: - # Get Kora epoch metadata - api_response = await api_instance.get_kora_epoch_metadata(campaign_name=campaign_name, epoch=epoch) - print("The response of KoraApi->get_kora_epoch_metadata:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_epoch_metadata: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **campaign_name** | **str**| Specify the campaign name | [optional] - **epoch** | **str**| Specify \"next\" or \"latest\" | [optional] - -### Return type - -[**List[KoraEpochMetadata]**](KoraEpochMetadata.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | - -[[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_kora_interval_metadata** -> List[KoraIntervalMetadata] get_kora_interval_metadata(interval=interval, protocol=protocol) - -Get Kora interval metadata - -Returns interval metadata for Kora. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata -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.KoraApi(api_client) - interval = 'latest' # str | Interval number or \"next\"/\"latest\" (optional) - protocol = kora # str | Filter by protocol (optional) (default to kora) - - try: - # Get Kora interval metadata - api_response = await api_instance.get_kora_interval_metadata(interval=interval, protocol=protocol) - print("The response of KoraApi->get_kora_interval_metadata:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_interval_metadata: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **interval** | **str**| Interval number or \"next\"/\"latest\" | [optional] - **protocol** | **str**| Filter by protocol | [optional] [default to kora] - -### Return type - -[**List[KoraIntervalMetadata]**](KoraIntervalMetadata.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | - -[[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_kora_leaderboard** -> KoraLeaderboardResponse get_kora_leaderboard(epoch_id=epoch_id, sort_by=sort_by, sort_order=sort_order, page=page, limit=limit, search=search, min_volume_e6=min_volume_e6) - -Get Kora swap leaderboard - -Returns rankings and earnings for Kora swap participants, sorted by the specified category. - -### Example - - -```python -import openapi_client -from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse -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.KoraApi(api_client) - epoch_id = 'epoch_id_example' # str | Specify epoch ID (defaults to current active epoch) (optional) - sort_by = volumeRank # str | The category to sort rankings by (optional) (default to volumeRank) - sort_order = desc # str | The order to sort rankings by (optional) (default to desc) - page = 1 # int | Page number for pagination (optional) (default to 1) - limit = 50 # int | Page size for pagination (optional) (default to 50) - search = 'search_example' # str | Filter by user address (partial match supported) (optional) - min_volume_e6 = '0' # str | Minimum trading volume filter (e6 format) (optional) (default to '0') - - try: - # Get Kora swap leaderboard - api_response = await api_instance.get_kora_leaderboard(epoch_id=epoch_id, sort_by=sort_by, sort_order=sort_order, page=page, limit=limit, search=search, min_volume_e6=min_volume_e6) - print("The response of KoraApi->get_kora_leaderboard:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_leaderboard: %s\n" % e) -``` - - - -### Parameters - - -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **epoch_id** | **str**| Specify epoch ID (defaults to current active epoch) | [optional] - **sort_by** | **str**| The category to sort rankings by | [optional] [default to volumeRank] - **sort_order** | **str**| The order to sort rankings by | [optional] [default to desc] - **page** | **int**| Page number for pagination | [optional] [default to 1] - **limit** | **int**| Page size for pagination | [optional] [default to 50] - **search** | **str**| Filter by user address (partial match supported) | [optional] - **min_volume_e6** | **str**| Minimum trading volume filter (e6 format) | [optional] [default to '0'] - -### Return type - -[**KoraLeaderboardResponse**](KoraLeaderboardResponse.md) - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | -**400** | Invalid request 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) - -# **get_kora_rewards_summary** -> List[KoraRewardsSummary] get_kora_rewards_summary() - -Get Kora all-time rewards summary - -Returns the all-time rewards earned by users including Kora CC and points. - -### Example - -* Bearer (JWT) Authentication (bearerAuth): - -```python -import openapi_client -from openapi_client.models.kora_rewards_summary import KoraRewardsSummary -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" -) - -# The client must configure the authentication and authorization parameters -# in accordance with the API server security policy. -# Examples for each auth method are provided below, use the example that -# satisfies your auth use case. - -# Configure Bearer authorization (JWT): bearerAuth -configuration = openapi_client.Configuration( - access_token = os.environ["BEARER_TOKEN"] -) - -# 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.KoraApi(api_client) - - try: - # Get Kora all-time rewards summary - api_response = await api_instance.get_kora_rewards_summary() - print("The response of KoraApi->get_kora_rewards_summary:\n") - pprint(api_response) - except Exception as e: - print("Exception when calling KoraApi->get_kora_rewards_summary: %s\n" % e) -``` - - - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**List[KoraRewardsSummary]**](KoraRewardsSummary.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - -### HTTP response details - -| Status code | Description | Response headers | -|-------------|-------------|------------------| -**200** | Successful response | - | - -[[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) - # **kora_health_check** > KoraHealthCheck200Response kora_health_check() diff --git a/python/sdk/src/openapi_client/docs/KoraUserBonusResponse.md b/python/sdk/src/openapi_client/docs/KoraUserBonusResponse.md new file mode 100644 index 00000000..fc8a5441 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/KoraUserBonusResponse.md @@ -0,0 +1,33 @@ +# KoraUserBonusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **str** | User wallet address | +**epoch_number** | **int** | Epoch number for the bonus | +**bonus_points** | **str** | Total bonus points earned | +**bonus_cc_rewards** | **str** | Total bonus CC rewards earned | +**criteria** | **str** | Criteria for earning the bonus | [optional] + +## Example + +```python +from openapi_client.models.kora_user_bonus_response import KoraUserBonusResponse + +# TODO update the JSON string below +json = "{}" +# create an instance of KoraUserBonusResponse from a JSON string +kora_user_bonus_response_instance = KoraUserBonusResponse.from_json(json) +# print the JSON string representation of the object +print(KoraUserBonusResponse.to_json()) + +# convert the object into a dict +kora_user_bonus_response_dict = kora_user_bonus_response_instance.to_dict() +# create an instance of KoraUserBonusResponse from a dict +kora_user_bonus_response_from_dict = KoraUserBonusResponse.from_dict(kora_user_bonus_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..541aad05 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_user_bonuses**](RewardsApi.md#get_user_bonuses) | **GET** /v1/rewards/bonuses | Get all user bonuses by epoch [**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,75 @@ 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_user_bonuses** +> List[KoraUserBonusResponse] get_user_bonuses(epoch_number) + +Get all user bonuses by epoch + +Returns the bonuses earned by all users for a specific epoch number. + +### Example + + +```python +import openapi_client +from openapi_client.models.kora_user_bonus_response import KoraUserBonusResponse +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) + epoch_number = 7 # int | Specify the epoch number + + try: + # Get all user bonuses by epoch + api_response = await api_instance.get_user_bonuses(epoch_number) + print("The response of RewardsApi->get_user_bonuses:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling RewardsApi->get_user_bonuses: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **epoch_number** | **int**| Specify the epoch number | + +### Return type + +[**List[KoraUserBonusResponse]**](KoraUserBonusResponse.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful response | - | +**400** | 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/models/__init__.py b/python/sdk/src/openapi_client/models/__init__.py index c9fc0991..ac55e65c 100644 --- a/python/sdk/src/openapi_client/models/__init__.py +++ b/python/sdk/src/openapi_client/models/__init__.py @@ -69,6 +69,7 @@ from openapi_client.models.epoch_configs_response import EpochConfigsResponse from openapi_client.models.epoch_metadata import EpochMetadata from openapi_client.models.error import Error +from openapi_client.models.error1 import Error1 from openapi_client.models.exchange_info_response import ExchangeInfoResponse from openapi_client.models.failed_command_type import FailedCommandType from openapi_client.models.fee_configs import FeeConfigs @@ -81,17 +82,8 @@ from openapi_client.models.interval_rewards import IntervalRewards from openapi_client.models.iss_base64_details import IssBase64Details from openapi_client.models.kline_interval import KlineInterval -from openapi_client.models.kora_campaign_bonus import KoraCampaignBonus -from openapi_client.models.kora_campaign_metadata import KoraCampaignMetadata -from openapi_client.models.kora_campaign_rewards import KoraCampaignRewards -from openapi_client.models.kora_epoch_config import KoraEpochConfig -from openapi_client.models.kora_epoch_config_response import KoraEpochConfigResponse -from openapi_client.models.kora_epoch_metadata import KoraEpochMetadata from openapi_client.models.kora_health_check200_response import KoraHealthCheck200Response -from openapi_client.models.kora_interval_metadata import KoraIntervalMetadata -from openapi_client.models.kora_leaderboard_entry import KoraLeaderboardEntry -from openapi_client.models.kora_leaderboard_response import KoraLeaderboardResponse -from openapi_client.models.kora_rewards_summary import KoraRewardsSummary +from openapi_client.models.kora_user_bonus_response import KoraUserBonusResponse from openapi_client.models.leaderboard_entry import LeaderboardEntry from openapi_client.models.leaderboard_interval import LeaderboardInterval from openapi_client.models.leaderboard_response import LeaderboardResponse diff --git a/python/sdk/src/openapi_client/models/error1.py b/python/sdk/src/openapi_client/models/error1.py new file mode 100644 index 00000000..05a4f17a --- /dev/null +++ b/python/sdk/src/openapi_client/models/error1.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, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Error1(BaseModel): + """ + Error1 + """ # noqa: E501 + error: Optional[StrictStr] = Field(default=None, description="Error message") + code: Optional[StrictStr] = Field(default=None, description="Error code") + __properties: ClassVar[List[str]] = ["error", "code"] + + 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 Error1 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 Error1 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": obj.get("error"), + "code": obj.get("code") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/models/kora_user_bonus_response.py b/python/sdk/src/openapi_client/models/kora_user_bonus_response.py new file mode 100644 index 00000000..3b38c65d --- /dev/null +++ b/python/sdk/src/openapi_client/models/kora_user_bonus_response.py @@ -0,0 +1,95 @@ +# 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, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class KoraUserBonusResponse(BaseModel): + """ + KoraUserBonusResponse + """ # noqa: E501 + user_address: StrictStr = Field(description="User wallet address", alias="userAddress") + epoch_number: StrictInt = Field(description="Epoch number for the bonus", alias="epochNumber") + bonus_points: StrictStr = Field(description="Total bonus points earned", alias="bonusPoints") + bonus_cc_rewards: StrictStr = Field(description="Total bonus CC rewards earned", alias="bonusCcRewards") + criteria: Optional[StrictStr] = Field(default=None, description="Criteria for earning the bonus") + __properties: ClassVar[List[str]] = ["userAddress", "epochNumber", "bonusPoints", "bonusCcRewards", "criteria"] + + 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 KoraUserBonusResponse 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 KoraUserBonusResponse 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"), + "epochNumber": obj.get("epochNumber"), + "bonusPoints": obj.get("bonusPoints"), + "bonusCcRewards": obj.get("bonusCcRewards"), + "criteria": obj.get("criteria") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/test/test_error1.py b/python/sdk/src/openapi_client/test/test_error1.py new file mode 100644 index 00000000..f3d5e202 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_error1.py @@ -0,0 +1,52 @@ +# 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.error1 import Error1 + +class TestError1(unittest.TestCase): + """Error1 unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> Error1: + """Test Error1 + 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 `Error1` + """ + model = Error1() + if include_optional: + return Error1( + error = 'Invalid request parameters', + code = 'INVALID_PARAMS' + ) + else: + return Error1( + ) + """ + + def testError1(self): + """Test Error1""" + # 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_kora_user_bonus_response.py b/python/sdk/src/openapi_client/test/test_kora_user_bonus_response.py new file mode 100644 index 00000000..58364624 --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_kora_user_bonus_response.py @@ -0,0 +1,59 @@ +# 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.kora_user_bonus_response import KoraUserBonusResponse + +class TestKoraUserBonusResponse(unittest.TestCase): + """KoraUserBonusResponse unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> KoraUserBonusResponse: + """Test KoraUserBonusResponse + 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 `KoraUserBonusResponse` + """ + model = KoraUserBonusResponse() + if include_optional: + return KoraUserBonusResponse( + user_address = '0x1234567890abcdef', + epoch_number = 7, + bonus_points = '1000.75', + bonus_cc_rewards = '500.5', + criteria = 'volume_threshold_100k' + ) + else: + return KoraUserBonusResponse( + user_address = '0x1234567890abcdef', + epoch_number = 7, + bonus_points = '1000.75', + bonus_cc_rewards = '500.5', + ) + """ + + def testKoraUserBonusResponse(self): + """Test KoraUserBonusResponse""" + # 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 4c356650..a4bc8fbd 100644 --- a/python/sdk/src/openapi_client_README.md +++ b/python/sdk/src/openapi_client_README.md @@ -92,13 +92,6 @@ Class | Method | HTTP request | Description *ExchangeApi* | [**get_market_ticker**](openapi_client/docs/ExchangeApi.md#get_market_ticker) | **GET** /v1/exchange/ticker | /exchange/ticker *ExchangeApi* | [**get_orderbook_depth**](openapi_client/docs/ExchangeApi.md#get_orderbook_depth) | **GET** /v1/exchange/depth | /exchange/depth *ExchangeApi* | [**get_recent_trades**](openapi_client/docs/ExchangeApi.md#get_recent_trades) | **GET** /v1/exchange/trades | /exchange/trades -*KoraApi* | [**get_kora_campaign_metadata**](openapi_client/docs/KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata -*KoraApi* | [**get_kora_campaign_rewards**](openapi_client/docs/KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards -*KoraApi* | [**get_kora_epoch_config_metadata**](openapi_client/docs/KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration -*KoraApi* | [**get_kora_epoch_metadata**](openapi_client/docs/KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata -*KoraApi* | [**get_kora_interval_metadata**](openapi_client/docs/KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata -*KoraApi* | [**get_kora_leaderboard**](openapi_client/docs/KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard -*KoraApi* | [**get_kora_rewards_summary**](openapi_client/docs/KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary *KoraApi* | [**kora_health_check**](openapi_client/docs/KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check *RewardsApi* | [**get_affiliate_interval_overview**](openapi_client/docs/RewardsApi.md#get_affiliate_interval_overview) | **GET** /v1/rewards/affiliate/intervalOverview | /rewards/affiliate/intervalOverview *RewardsApi* | [**get_affiliate_leader_dashboard**](openapi_client/docs/RewardsApi.md#get_affiliate_leader_dashboard) | **GET** /v1/rewards/affiliate/leaderDashboard | /rewards/affiliate/leaderDashboard @@ -113,6 +106,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_user_bonuses**](openapi_client/docs/RewardsApi.md#get_user_bonuses) | **GET** /v1/rewards/bonuses | Get all user bonuses by epoch *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 @@ -189,6 +183,7 @@ Class | Method | HTTP request | Description - [EpochConfigsResponse](openapi_client/docs/EpochConfigsResponse.md) - [EpochMetadata](openapi_client/docs/EpochMetadata.md) - [Error](openapi_client/docs/Error.md) + - [Error1](openapi_client/docs/Error1.md) - [ExchangeInfoResponse](openapi_client/docs/ExchangeInfoResponse.md) - [FailedCommandType](openapi_client/docs/FailedCommandType.md) - [FeeConfigs](openapi_client/docs/FeeConfigs.md) @@ -201,17 +196,8 @@ Class | Method | HTTP request | Description - [IntervalRewards](openapi_client/docs/IntervalRewards.md) - [IssBase64Details](openapi_client/docs/IssBase64Details.md) - [KlineInterval](openapi_client/docs/KlineInterval.md) - - [KoraCampaignBonus](openapi_client/docs/KoraCampaignBonus.md) - - [KoraCampaignMetadata](openapi_client/docs/KoraCampaignMetadata.md) - - [KoraCampaignRewards](openapi_client/docs/KoraCampaignRewards.md) - - [KoraEpochConfig](openapi_client/docs/KoraEpochConfig.md) - - [KoraEpochConfigResponse](openapi_client/docs/KoraEpochConfigResponse.md) - - [KoraEpochMetadata](openapi_client/docs/KoraEpochMetadata.md) - [KoraHealthCheck200Response](openapi_client/docs/KoraHealthCheck200Response.md) - - [KoraIntervalMetadata](openapi_client/docs/KoraIntervalMetadata.md) - - [KoraLeaderboardEntry](openapi_client/docs/KoraLeaderboardEntry.md) - - [KoraLeaderboardResponse](openapi_client/docs/KoraLeaderboardResponse.md) - - [KoraRewardsSummary](openapi_client/docs/KoraRewardsSummary.md) + - [KoraUserBonusResponse](openapi_client/docs/KoraUserBonusResponse.md) - [LeaderboardEntry](openapi_client/docs/LeaderboardEntry.md) - [LeaderboardInterval](openapi_client/docs/LeaderboardInterval.md) - [LeaderboardResponse](openapi_client/docs/LeaderboardResponse.md) diff --git a/resources/bluefin-api.yaml b/resources/bluefin-api.yaml index 5ba1e625..de847645 100644 --- a/resources/bluefin-api.yaml +++ b/resources/bluefin-api.yaml @@ -270,20 +270,8 @@ paths: $ref: "./rewards-data-api.yaml#/paths/~1v1~1rewards~1contract~1config" # Kora Rewards Endpoints - /v1/kora/leaderboard: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1leaderboard" - /v1/kora/rewards/campaign: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1rewards~1campaign" - /v1/kora/rewards/summary: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1rewards~1summary" - /v1/kora/metadata/campaign: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1campaign" - /v1/kora/metadata/epoch: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1epoch" - /v1/kora/metadata/epoch/configs: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1epoch~1configs" - /v1/kora/metadata/interval: - $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1metadata~1interval" + /v1/rewards/bonuses: + $ref: "./kora-rewards-api.yaml#/paths/~1v1~1rewards~1bonuses" /v1/kora/health: $ref: "./kora-rewards-api.yaml#/paths/~1v1~1kora~1health" diff --git a/resources/kora-rewards-api.yaml b/resources/kora-rewards-api.yaml index 54579d1b..c9e2c193 100644 --- a/resources/kora-rewards-api.yaml +++ b/resources/kora-rewards-api.yaml @@ -3,11 +3,14 @@ info: title: Kora Rewards API description: | API for Kora swap rewards and campaigns. - All numeric quantities are represented as strings in e6 format. + All numeric quantities are represented as strings in their original decimal format (e0). + For example: "123.456789" represents the actual token amount, not a scaled integer. version: 1.0.0 tags: - name: Kora description: Kora swap rewards endpoints + - name: Rewards + description: General rewards endpoints extended for Kora servers: - url: https://api.{env}.bluefin.io variables: @@ -25,142 +28,19 @@ components: bearerFormat: JWT schemas: - # Kora Leaderboard Schemas - KoraLeaderboardEntry: + Error: type: object - required: - - rank - - userAddress - - totalVolumeE6 - - totalTransactions - - ccRewards - - koraPoints properties: - rank: - type: integer - description: Overall ranking position based on sortBy parameter - example: 1 - userAddress: - type: string - description: Wallet address of the user - example: "0x1234567890abcdef" - totalVolumeE6: - type: string - description: Total swap volume (USD equivalent) - example: "50000.123456" - totalFeeE6: + error: type: string - description: Total fees paid - example: "150.75" - totalTransactions: - type: integer - description: Total number of qualifying swap transactions - example: 1250 - ccRewards: - type: string - description: CC token rewards earned - example: "1500.75" - koraPoints: + description: Error message + example: "Invalid request parameters" + code: type: string - description: Kora points earned - example: "2500.5" - totalBonusPoints: - type: string - description: Total bonus points earned - example: "500.25" - totalBonusCC: - type: string - description: Total bonus CC tokens earned - example: "200.5" - volumeRank: - type: integer - description: Ranking based purely on trading volume - example: 1 - transactionRank: - type: integer - description: Ranking based purely on transaction count - example: 3 - totalEarningsRank: - type: integer - description: Ranking based on combined CC + Kora points value - example: 1 - lastActivityDate: - type: integer - description: Timestamp of user's most recent swap (milliseconds) - example: 1724725894751 + description: Error code + example: "INVALID_PARAMS" - KoraLeaderboardResponse: - type: object - required: - - data - - total - - limit - - page - properties: - data: - type: array - items: - $ref: "#/components/schemas/KoraLeaderboardEntry" - total: - type: integer - description: Total number of records - example: 2847 - limit: - type: integer - description: Page size for pagination - example: 500 - page: - type: integer - description: Current page number - example: 1 - - # Kora Bonus Schema - KoraUserBonus: - type: object - required: - - id - - epochId - - userAddress - - bonusType - - bonusCCRewards - - bonusPoints - properties: - id: - type: string - format: uuid - description: Bonus record ID - example: "550e8400-e29b-41d4-a716-446655440000" - epochId: - type: string - format: uuid - description: Epoch ID - example: "550e8400-e29b-41d4-a716-446655440001" - userAddress: - type: string - description: User wallet address - example: "0x1234567890abcdef" - bonusType: - type: string - description: Type of bonus (daily_trader, volume_leader, first_trader, etc.) - example: "daily_trader" - bonusCCRewards: - type: string - description: CC token bonus amount - example: "100.5" - bonusPoints: - type: string - description: Points bonus amount - example: "200.75" - bonusCriteria: - type: object - description: Criteria met for bonus eligibility - additionalProperties: true - createdAt: - type: integer - description: Bonus award timestamp (milliseconds) - example: 1724725894751 - - # Kora Campaign Rewards + # Campaign Rewards (extended for Kora) KoraCampaignRewards: type: object required: @@ -197,22 +77,6 @@ components: - NOT_STARTED - FINALIZED - COOLDOWN - blueRewards: - type: string - description: Total blue token rewards - example: "100.5" - suiRewards: - type: string - description: Total sui token rewards - example: "200.25" - walRewards: - type: string - description: Total wal rewards - example: "50.75" - cashRewards: - type: string - description: Total cash rewards - example: "0" ccRewards: type: string description: Total CC token rewards @@ -221,10 +85,6 @@ components: type: string description: Total Kora points earned example: "2500.5" - userFeePaid: - type: string - description: Total user fee paid - example: "15.25" intervalStartDate: type: integer description: Time in milliseconds for interval start date @@ -250,34 +110,28 @@ components: - CLAIM_ENDED description: Status of the claim example: "CLAIMED" - bonuses: - type: array - description: List of bonuses attached to this reward entry - items: - $ref: "#/components/schemas/KoraCampaignBonus" - - # Bonus attached to campaign rewards - KoraCampaignBonus: - type: object - properties: - bonusType: - type: string - description: Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) - example: "VOLUME_BONUS" bonusCcReward: type: string - description: CC reward amount for this bonus + description: Total CC reward amount from bonuses example: "500.5" bonusPoints: type: string - description: Points earned for this bonus + description: Total points earned from bonuses example: "1000.75" bonusCriteria: type: string - description: Criteria that was met for earning this bonus + description: Criteria for earning bonuses example: "volume_threshold_100k" + isEligible: + type: boolean + description: Indicates if the user is eligible for rewards + example: true + hasCompleted: + type: boolean + description: Indicates if the user has completed the required criteria + example: false - # Kora Rewards Summary + # Rewards Summary (extended for Kora) KoraRewardsSummary: type: object required: @@ -287,18 +141,6 @@ components: type: string description: User address for the rewards earned data example: "0x1234567890abcdef" - blueRewards: - type: string - description: Total Blue token rewards earned - example: "100.5" - suiRewards: - type: string - description: Total Sui token rewards earned - example: "200.25" - walRewards: - type: string - description: Total wal rewards earned - example: "50.75" ccRewards: type: string description: Total CC token rewards earned across all Kora campaigns @@ -307,9 +149,47 @@ components: type: string description: Total Kora points earned across all Kora campaigns example: "2500.5" + totalTransactions: + type: integer + description: Total number of transactions across all Kora campaigns + example: 150 + allTimeVolume: + type: string + description: All time trading volume across all Kora campaigns + example: "500000.75" + + # User Bonus Response (simplified) + KoraUserBonusResponse: + type: object + required: + - userAddress + - epochNumber + - bonusPoints + - bonusCcRewards + properties: + userAddress: + type: string + description: User wallet address + example: "0x1234567890abcdef" + epochNumber: + type: integer + description: Epoch number for the bonus + example: 7 + bonusPoints: + type: string + description: Total bonus points earned + example: "1000.75" + bonusCcRewards: + type: string + description: Total bonus CC rewards earned + example: "500.5" + criteria: + type: string + description: Criteria for earning the bonus + example: "volume_threshold_100k" - # Kora Campaign Metadata - KoraCampaignMetadata: + # Campaign Metadata + CampaignMetadata: type: object required: - status @@ -339,8 +219,8 @@ components: description: Time in milliseconds for campaign end date example: 1724121094751 - # Kora Epoch Metadata - KoraEpochMetadata: + # Epoch Metadata + EpochMetadata: type: object required: - status @@ -379,8 +259,8 @@ components: description: Time in milliseconds for epoch end date example: 1724725894751 - # Kora Interval Metadata - KoraIntervalMetadata: + # Interval Metadata + IntervalMetadata: type: object required: - status @@ -419,8 +299,8 @@ components: description: Protocol for the interval example: "kora" - # Kora Epoch Config - KoraEpochConfig: + # Epoch Config + EpochConfig: type: object required: - campaignName @@ -436,18 +316,6 @@ components: type: integer description: Duration of the epoch in hours example: 168 - suiRewardsAllocation: - type: string - description: Allocation of Sui rewards for this epoch - example: "1000.5" - blueRewardsAllocation: - type: string - description: Allocation of Blue rewards for this epoch - example: "2000.25" - walRewardsAllocation: - type: string - description: Allocation of Wal rewards for this epoch - example: "500.75" ccRewardsAllocation: type: string description: Allocation of CC token rewards for this epoch @@ -468,131 +336,32 @@ components: type: object description: Additional campaign-specific configurations additionalProperties: true - - KoraEpochConfigResponse: - type: object - required: - - maxIntervalNumber - - intervalNumber - - data - properties: - maxIntervalNumber: - type: integer - description: The maximum interval number available - example: 14 - intervalNumber: - type: integer - description: The current interval number being queried - example: 7 - data: - type: array - items: - $ref: "#/components/schemas/KoraEpochConfig" + bonusCriteria: + type: string + description: Criteria for earning bonuses in this epoch + example: "volume_threshold_100k" paths: # ============================================================================ - # KORA LEADERBOARD ENDPOINT + # REWARDS ENDPOINTS (Extended for Kora) # ============================================================================ - /v1/kora/leaderboard: - get: - tags: - - Kora - operationId: getKoraLeaderboard - summary: Get Kora swap leaderboard - description: Returns rankings and earnings for Kora swap participants, sorted by the specified category. - parameters: - - name: epochId - in: query - required: false - description: Specify epoch ID (defaults to current active epoch) - schema: - type: string - format: uuid - - name: sortBy - in: query - required: false - description: The category to sort rankings by - schema: - type: string - enum: - - volumeRank - - transactionRank - - totalEarnings - default: volumeRank - - name: sortOrder - in: query - required: false - description: The order to sort rankings by - schema: - type: string - enum: - - asc - - desc - default: desc - - name: page - in: query - required: false - description: Page number for pagination - schema: - type: integer - default: 1 - minimum: 1 - - name: limit - in: query - required: false - description: Page size for pagination - schema: - type: integer - default: 50 - maximum: 100 - minimum: 1 - - name: search - in: query - required: false - description: Filter by user address (partial match supported) - schema: - type: string - - name: minVolumeE6 - in: query - required: false - description: Minimum trading volume filter (e6 format) - schema: - type: string - default: "0" - responses: - "200": - description: Successful response - content: - application/json: - schema: - $ref: "#/components/schemas/KoraLeaderboardResponse" - "400": - description: Invalid request parameters - content: - application/json: - schema: - $ref: "./common.yaml#/components/schemas/Error" - # ============================================================================ - # KORA REWARDS ENDPOINTS - # ============================================================================ - /v1/kora/rewards/campaign: + /v1/rewards/campaign: get: tags: - - Kora - operationId: getKoraCampaignRewards - summary: Get Kora campaign rewards - description: Returns the rewards earned by users for Kora campaigns. + - Rewards + operationId: getCampaignRewards + summary: Get campaign rewards + description: Returns the rewards earned by users for a specific campaign (including KORA_SWAPS). parameters: - name: campaignName in: query - required: false + required: true description: Specify the campaign name schema: type: string enum: - KORA_SWAPS - default: KORA_SWAPS example: "KORA_SWAPS" - name: epochNumber in: query @@ -622,14 +391,14 @@ paths: content: application/json: schema: - $ref: "./common.yaml#/components/schemas/Error" + $ref: "#/components/schemas/Error" - /v1/kora/rewards/summary: + /v1/rewards/summary: get: tags: - - Kora - operationId: getKoraRewardsSummary - summary: Get Kora all-time rewards summary + - Rewards + operationId: getRewardsSummary + summary: Get all-time rewards summary description: Returns the all-time rewards earned by users including Kora CC and points. security: - bearerAuth: [] @@ -643,16 +412,48 @@ paths: items: $ref: "#/components/schemas/KoraRewardsSummary" + /v1/rewards/bonuses: + get: + tags: + - Rewards + operationId: getUserBonuses + summary: Get all user bonuses by epoch + description: Returns the bonuses earned by all users for a specific epoch number. + parameters: + - name: epochNumber + in: query + required: true + description: Specify the epoch number + schema: + type: integer + example: 7 + responses: + "200": + description: Successful response + content: + application/json: + schema: + type: array + items: + $ref: "#/components/schemas/KoraUserBonusResponse" + "400": + description: Missing required parameters + content: + application/json: + schema: + $ref: "#/components/schemas/Error" + # ============================================================================ - # KORA METADATA ENDPOINTS + # METADATA ENDPOINTS # ============================================================================ - /v1/kora/metadata/campaign: + + /v1/rewards/metadata/campaign: get: tags: - - Kora - operationId: getKoraCampaignMetadata - summary: Get Kora campaign metadata - description: Returns metadata for Kora rewards campaigns. + - Rewards + operationId: getCampaignMetadata + summary: Get campaign metadata + description: Returns metadata for rewards campaigns including Kora campaigns. parameters: - name: campaignName in: query @@ -679,15 +480,15 @@ paths: schema: type: array items: - $ref: "#/components/schemas/KoraCampaignMetadata" + $ref: "#/components/schemas/CampaignMetadata" - /v1/kora/metadata/epoch: + /v1/rewards/metadata/epoch: get: tags: - - Kora - operationId: getKoraEpochMetadata - summary: Get Kora epoch metadata - description: Returns the latest or next epoch for a Kora campaign. + - Rewards + operationId: getEpochMetadata + summary: Get epoch metadata + description: Returns the latest or next epoch for a campaign. parameters: - name: campaignName in: query @@ -711,15 +512,15 @@ paths: schema: type: array items: - $ref: "#/components/schemas/KoraEpochMetadata" + $ref: "#/components/schemas/EpochMetadata" - /v1/kora/metadata/epoch/configs: + /v1/rewards/metadata/epoch/configs: get: tags: - - Kora - operationId: getKoraEpochConfigMetadata - summary: Get Kora epoch configuration - description: Returns epoch configuration including reward allocations for Kora. + - Rewards + operationId: getEpochConfigMetadata + summary: Get epoch configuration + description: Returns epoch configuration including reward allocations. parameters: - name: intervalNumber in: query @@ -741,15 +542,26 @@ paths: content: application/json: schema: - $ref: "#/components/schemas/KoraEpochConfigResponse" + type: object + properties: + maxIntervalNumber: + type: integer + example: 14 + intervalNumber: + type: integer + example: 7 + data: + type: array + items: + $ref: "#/components/schemas/EpochConfig" - /v1/kora/metadata/interval: + /v1/rewards/metadata/interval: get: tags: - - Kora - operationId: getKoraIntervalMetadata - summary: Get Kora interval metadata - description: Returns interval metadata for Kora. + - Rewards + operationId: getIntervalMetadata + summary: Get interval metadata + description: Returns interval metadata with protocol filtering support. parameters: - name: interval in: query @@ -767,7 +579,6 @@ paths: enum: - bluefin - kora - default: kora example: "kora" responses: "200": @@ -777,11 +588,12 @@ paths: schema: type: array items: - $ref: "#/components/schemas/KoraIntervalMetadata" + $ref: "#/components/schemas/IntervalMetadata" # ============================================================================ - # KORA HEALTH CHECK + # HEALTH CHECK # ============================================================================ + /v1/kora/health: get: tags: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 7801395d..56677cfb 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -11,12 +11,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anyhow" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" - [[package]] name = "arrayvec" version = "0.7.6" @@ -137,7 +131,6 @@ dependencies = [ "serde_repr", "serde_with", "url", - "uuid", ] [[package]] @@ -500,12 +493,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foldhash" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" - [[package]] name = "foreign-types" version = "0.3.2" @@ -616,24 +603,11 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "r-efi 5.3.0", + "r-efi", "wasip2", "wasm-bindgen", ] -[[package]] -name = "getrandom" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" -dependencies = [ - "cfg-if", - "libc", - "r-efi 6.0.0", - "wasip2", - "wasip3", -] - [[package]] name = "group" version = "0.13.0" @@ -670,27 +644,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.15.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" -dependencies = [ - "foldhash", -] - [[package]] name = "hashbrown" version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" -[[package]] -name = "heck" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" - [[package]] name = "hex" version = "0.4.3" @@ -940,12 +899,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "id-arena" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" - [[package]] name = "ident_case" version = "1.0.1" @@ -1040,12 +993,6 @@ dependencies = [ "sha2", ] -[[package]] -name = "leb128fmt" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" - [[package]] name = "libc" version = "0.2.180" @@ -1281,16 +1228,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "prettyplease" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro2" version = "1.0.105" @@ -1370,12 +1307,6 @@ version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" -[[package]] -name = "r-efi" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" - [[package]] name = "rand" version = "0.8.5" @@ -2291,12 +2222,6 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9312f7c4f6ff9069b165498234ce8be658059c6728633667c526e27dc2cf1df5" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "untrusted" version = "0.9.0" @@ -2327,18 +2252,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" -[[package]] -name = "uuid" -version = "1.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" -dependencies = [ - "getrandom 0.4.2", - "js-sys", - "serde_core", - "wasm-bindgen", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -2372,16 +2285,7 @@ version = "1.0.1+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0562428422c63773dad2c345a1882263bbf4d65cf3f42e90921f787ef5ad58e7" dependencies = [ - "wit-bindgen 0.46.0", -] - -[[package]] -name = "wasip3" -version = "0.4.0+wasi-0.3.0-rc-2026-01-06" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" -dependencies = [ - "wit-bindgen 0.51.0", + "wit-bindgen", ] [[package]] @@ -2442,40 +2346,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "wasm-encoder" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" -dependencies = [ - "leb128fmt", - "wasmparser", -] - -[[package]] -name = "wasm-metadata" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" -dependencies = [ - "anyhow", - "indexmap 2.13.0", - "wasm-encoder", - "wasmparser", -] - -[[package]] -name = "wasmparser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" -dependencies = [ - "bitflags", - "hashbrown 0.15.5", - "indexmap 2.13.0", - "semver", -] - [[package]] name = "web-sys" version = "0.3.83" @@ -2746,94 +2616,6 @@ version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f17a85883d4e6d00e8a97c586de764dabcc06133f7f1d55dce5cdc070ad7fe59" -[[package]] -name = "wit-bindgen" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" -dependencies = [ - "wit-bindgen-rust-macro", -] - -[[package]] -name = "wit-bindgen-core" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" -dependencies = [ - "anyhow", - "heck", - "wit-parser", -] - -[[package]] -name = "wit-bindgen-rust" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" -dependencies = [ - "anyhow", - "heck", - "indexmap 2.13.0", - "prettyplease", - "syn", - "wasm-metadata", - "wit-bindgen-core", - "wit-component", -] - -[[package]] -name = "wit-bindgen-rust-macro" -version = "0.51.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" -dependencies = [ - "anyhow", - "prettyplease", - "proc-macro2", - "quote", - "syn", - "wit-bindgen-core", - "wit-bindgen-rust", -] - -[[package]] -name = "wit-component" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" -dependencies = [ - "anyhow", - "bitflags", - "indexmap 2.13.0", - "log", - "serde", - "serde_derive", - "serde_json", - "wasm-encoder", - "wasm-metadata", - "wasmparser", - "wit-parser", -] - -[[package]] -name = "wit-parser" -version = "0.244.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" -dependencies = [ - "anyhow", - "id-arena", - "indexmap 2.13.0", - "log", - "semver", - "serde", - "serde_derive", - "serde_json", - "unicode-xid", - "wasmparser", -] - [[package]] name = "writeable" version = "0.6.2" diff --git a/rust/gen/bluefin_api/.openapi-generator/FILES b/rust/gen/bluefin_api/.openapi-generator/FILES index 8f09a93e..ad0c26f5 100644 --- a/rust/gen/bluefin_api/.openapi-generator/FILES +++ b/rust/gen/bluefin_api/.openapi-generator/FILES @@ -59,6 +59,7 @@ docs/EpochConfigs.md docs/EpochConfigsResponse.md docs/EpochMetadata.md docs/Error.md +docs/Error1.md docs/ExchangeApi.md docs/ExchangeInfoResponse.md docs/FailedCommandType.md @@ -73,17 +74,8 @@ docs/IntervalRewards.md docs/IssBase64Details.md docs/KlineInterval.md docs/KoraApi.md -docs/KoraCampaignBonus.md -docs/KoraCampaignMetadata.md -docs/KoraCampaignRewards.md -docs/KoraEpochConfig.md -docs/KoraEpochConfigResponse.md -docs/KoraEpochMetadata.md docs/KoraHealthCheck200Response.md -docs/KoraIntervalMetadata.md -docs/KoraLeaderboardEntry.md -docs/KoraLeaderboardResponse.md -docs/KoraRewardsSummary.md +docs/KoraUserBonusResponse.md docs/LeaderboardEntry.md docs/LeaderboardInterval.md docs/LeaderboardResponse.md @@ -226,6 +218,7 @@ src/models/epoch_configs.rs src/models/epoch_configs_response.rs src/models/epoch_metadata.rs src/models/error.rs +src/models/error_1.rs src/models/exchange_info_response.rs src/models/failed_command_type.rs src/models/fee_configs.rs @@ -238,17 +231,8 @@ src/models/interval_metadata.rs src/models/interval_rewards.rs src/models/iss_base64_details.rs src/models/kline_interval.rs -src/models/kora_campaign_bonus.rs -src/models/kora_campaign_metadata.rs -src/models/kora_campaign_rewards.rs -src/models/kora_epoch_config.rs -src/models/kora_epoch_config_response.rs -src/models/kora_epoch_metadata.rs src/models/kora_health_check_200_response.rs -src/models/kora_interval_metadata.rs -src/models/kora_leaderboard_entry.rs -src/models/kora_leaderboard_response.rs -src/models/kora_rewards_summary.rs +src/models/kora_user_bonus_response.rs src/models/leaderboard_entry.rs src/models/leaderboard_interval.rs src/models/leaderboard_response.rs diff --git a/rust/gen/bluefin_api/Cargo.toml b/rust/gen/bluefin_api/Cargo.toml index 9f68bcfd..ceb8608b 100644 --- a/rust/gen/bluefin_api/Cargo.toml +++ b/rust/gen/bluefin_api/Cargo.toml @@ -12,5 +12,4 @@ serde_with = { version = "^3.8", default-features = false, features = ["base64", serde_json = "^1.0" serde_repr = "^0.1" url = "^2.5" -uuid = { version = "^1.8", features = ["serde", "v4"] } reqwest = { version = "^0.12", default-features = false, features = ["json", "multipart"] } diff --git a/rust/gen/bluefin_api/README.md b/rust/gen/bluefin_api/README.md index 51972bf7..75b0ad80 100644 --- a/rust/gen/bluefin_api/README.md +++ b/rust/gen/bluefin_api/README.md @@ -52,13 +52,6 @@ Class | Method | HTTP request | Description *ExchangeApi* | [**get_market_ticker**](docs/ExchangeApi.md#get_market_ticker) | **GET** /v1/exchange/ticker | /exchange/ticker *ExchangeApi* | [**get_orderbook_depth**](docs/ExchangeApi.md#get_orderbook_depth) | **GET** /v1/exchange/depth | /exchange/depth *ExchangeApi* | [**get_recent_trades**](docs/ExchangeApi.md#get_recent_trades) | **GET** /v1/exchange/trades | /exchange/trades -*KoraApi* | [**get_kora_campaign_metadata**](docs/KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata -*KoraApi* | [**get_kora_campaign_rewards**](docs/KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards -*KoraApi* | [**get_kora_epoch_config_metadata**](docs/KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration -*KoraApi* | [**get_kora_epoch_metadata**](docs/KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata -*KoraApi* | [**get_kora_interval_metadata**](docs/KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata -*KoraApi* | [**get_kora_leaderboard**](docs/KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard -*KoraApi* | [**get_kora_rewards_summary**](docs/KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary *KoraApi* | [**kora_health_check**](docs/KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check *RewardsApi* | [**get_affiliate_interval_overview**](docs/RewardsApi.md#get_affiliate_interval_overview) | **GET** /v1/rewards/affiliate/intervalOverview | /rewards/affiliate/intervalOverview *RewardsApi* | [**get_affiliate_leader_dashboard**](docs/RewardsApi.md#get_affiliate_leader_dashboard) | **GET** /v1/rewards/affiliate/leaderDashboard | /rewards/affiliate/leaderDashboard @@ -73,6 +66,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_user_bonuses**](docs/RewardsApi.md#get_user_bonuses) | **GET** /v1/rewards/bonuses | Get all user bonuses by epoch *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 @@ -149,6 +143,7 @@ Class | Method | HTTP request | Description - [EpochConfigsResponse](docs/EpochConfigsResponse.md) - [EpochMetadata](docs/EpochMetadata.md) - [Error](docs/Error.md) + - [Error1](docs/Error1.md) - [ExchangeInfoResponse](docs/ExchangeInfoResponse.md) - [FailedCommandType](docs/FailedCommandType.md) - [FeeConfigs](docs/FeeConfigs.md) @@ -161,17 +156,8 @@ Class | Method | HTTP request | Description - [IntervalRewards](docs/IntervalRewards.md) - [IssBase64Details](docs/IssBase64Details.md) - [KlineInterval](docs/KlineInterval.md) - - [KoraCampaignBonus](docs/KoraCampaignBonus.md) - - [KoraCampaignMetadata](docs/KoraCampaignMetadata.md) - - [KoraCampaignRewards](docs/KoraCampaignRewards.md) - - [KoraEpochConfig](docs/KoraEpochConfig.md) - - [KoraEpochConfigResponse](docs/KoraEpochConfigResponse.md) - - [KoraEpochMetadata](docs/KoraEpochMetadata.md) - [KoraHealthCheck200Response](docs/KoraHealthCheck200Response.md) - - [KoraIntervalMetadata](docs/KoraIntervalMetadata.md) - - [KoraLeaderboardEntry](docs/KoraLeaderboardEntry.md) - - [KoraLeaderboardResponse](docs/KoraLeaderboardResponse.md) - - [KoraRewardsSummary](docs/KoraRewardsSummary.md) + - [KoraUserBonusResponse](docs/KoraUserBonusResponse.md) - [LeaderboardEntry](docs/LeaderboardEntry.md) - [LeaderboardInterval](docs/LeaderboardInterval.md) - [LeaderboardResponse](docs/LeaderboardResponse.md) diff --git a/rust/gen/bluefin_api/docs/Error1.md b/rust/gen/bluefin_api/docs/Error1.md new file mode 100644 index 00000000..c4b05c63 --- /dev/null +++ b/rust/gen/bluefin_api/docs/Error1.md @@ -0,0 +1,12 @@ +# Error1 + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | Option<**String**> | Error message | [optional] +**code** | Option<**String**> | Error code | [optional] + +[[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/KoraApi.md b/rust/gen/bluefin_api/docs/KoraApi.md index d77061d7..fc9578bc 100644 --- a/rust/gen/bluefin_api/docs/KoraApi.md +++ b/rust/gen/bluefin_api/docs/KoraApi.md @@ -4,236 +4,10 @@ All URIs are relative to *https://api.sui-staging.bluefin.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_kora_campaign_metadata**](KoraApi.md#get_kora_campaign_metadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata -[**get_kora_campaign_rewards**](KoraApi.md#get_kora_campaign_rewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards -[**get_kora_epoch_config_metadata**](KoraApi.md#get_kora_epoch_config_metadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration -[**get_kora_epoch_metadata**](KoraApi.md#get_kora_epoch_metadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata -[**get_kora_interval_metadata**](KoraApi.md#get_kora_interval_metadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata -[**get_kora_leaderboard**](KoraApi.md#get_kora_leaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard -[**get_kora_rewards_summary**](KoraApi.md#get_kora_rewards_summary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary [**kora_health_check**](KoraApi.md#kora_health_check) | **GET** /v1/kora/health | Kora service health check -## get_kora_campaign_metadata - -> Vec get_kora_campaign_metadata(campaign_name, status) -Get Kora campaign metadata - -Returns metadata for Kora rewards campaigns. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**campaign_name** | Option<**String**> | Specify the campaign name | | -**status** | Option<**String**> | Filter by campaign status | |[default to ACTIVE] - -### Return type - -[**Vec**](KoraCampaignMetadata.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) - - -## get_kora_campaign_rewards - -> Vec get_kora_campaign_rewards(user_address, campaign_name, epoch_number) -Get Kora campaign rewards - -Returns the rewards earned by users for Kora campaigns. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**user_address** | **String** | Specify wallet address | [required] | -**campaign_name** | Option<**String**> | Specify the campaign name | |[default to KORA_SWAPS] -**epoch_number** | Option<**i32**> | Optionally specify epoch number | | - -### Return type - -[**Vec**](KoraCampaignRewards.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) - - -## get_kora_epoch_config_metadata - -> models::KoraEpochConfigResponse get_kora_epoch_config_metadata(interval_number, campaign_name) -Get Kora epoch configuration - -Returns epoch configuration including reward allocations for Kora. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**interval_number** | Option<**i32**> | Specify the interval number | | -**campaign_name** | Option<**String**> | Filter by campaign name | | - -### Return type - -[**models::KoraEpochConfigResponse**](KoraEpochConfigResponse.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) - - -## get_kora_epoch_metadata - -> Vec get_kora_epoch_metadata(campaign_name, epoch) -Get Kora epoch metadata - -Returns the latest or next epoch for a Kora campaign. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**campaign_name** | Option<**String**> | Specify the campaign name | | -**epoch** | Option<**String**> | Specify \"next\" or \"latest\" | | - -### Return type - -[**Vec**](KoraEpochMetadata.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) - - -## get_kora_interval_metadata - -> Vec get_kora_interval_metadata(interval, protocol) -Get Kora interval metadata - -Returns interval metadata for Kora. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**interval** | Option<**String**> | Interval number or \"next\"/\"latest\" | | -**protocol** | Option<**String**> | Filter by protocol | |[default to kora] - -### Return type - -[**Vec**](KoraIntervalMetadata.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) - - -## get_kora_leaderboard - -> models::KoraLeaderboardResponse get_kora_leaderboard(epoch_id, sort_by, sort_order, page, limit, search, min_volume_e6) -Get Kora swap leaderboard - -Returns rankings and earnings for Kora swap participants, sorted by the specified category. - -### Parameters - - -Name | Type | Description | Required | Notes -------------- | ------------- | ------------- | ------------- | ------------- -**epoch_id** | Option<**uuid::Uuid**> | Specify epoch ID (defaults to current active epoch) | | -**sort_by** | Option<**String**> | The category to sort rankings by | |[default to volumeRank] -**sort_order** | Option<**String**> | The order to sort rankings by | |[default to desc] -**page** | Option<**u32**> | Page number for pagination | |[default to 1] -**limit** | Option<**u32**> | Page size for pagination | |[default to 50] -**search** | Option<**String**> | Filter by user address (partial match supported) | | -**min_volume_e6** | Option<**String**> | Minimum trading volume filter (e6 format) | |[default to 0] - -### Return type - -[**models::KoraLeaderboardResponse**](KoraLeaderboardResponse.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) - - -## get_kora_rewards_summary - -> Vec get_kora_rewards_summary() -Get Kora all-time rewards summary - -Returns the all-time rewards earned by users including Kora CC and points. - -### Parameters - -This endpoint does not need any parameter. - -### Return type - -[**Vec**](KoraRewardsSummary.md) - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### 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) - - ## kora_health_check > models::KoraHealthCheck200Response kora_health_check() diff --git a/rust/gen/bluefin_api/docs/KoraUserBonusResponse.md b/rust/gen/bluefin_api/docs/KoraUserBonusResponse.md new file mode 100644 index 00000000..c0e03487 --- /dev/null +++ b/rust/gen/bluefin_api/docs/KoraUserBonusResponse.md @@ -0,0 +1,15 @@ +# KoraUserBonusResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_address** | **String** | User wallet address | +**epoch_number** | **i32** | Epoch number for the bonus | +**bonus_points** | **String** | Total bonus points earned | +**bonus_cc_rewards** | **String** | Total bonus CC rewards earned | +**criteria** | Option<**String**> | Criteria for earning the bonus | [optional] + +[[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..62eef63c 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_user_bonuses**](RewardsApi.md#get_user_bonuses) | **GET** /v1/rewards/bonuses | Get all user bonuses by epoch [**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,36 @@ 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_user_bonuses + +> Vec get_user_bonuses(epoch_number) +Get all user bonuses by epoch + +Returns the bonuses earned by all users for a specific epoch number. + +### Parameters + + +Name | Type | Description | Required | Notes +------------- | ------------- | ------------- | ------------- | ------------- +**epoch_number** | **i32** | Specify the epoch number | [required] | + +### Return type + +[**Vec**](KoraUserBonusResponse.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/src/apis/kora_api.rs b/rust/gen/bluefin_api/src/apis/kora_api.rs index c78c50b1..9f4e01fe 100644 --- a/rust/gen/bluefin_api/src/apis/kora_api.rs +++ b/rust/gen/bluefin_api/src/apis/kora_api.rs @@ -15,57 +15,6 @@ use crate::{apis::ResponseContent, models}; use super::{Error, configuration, ContentType}; -/// struct for typed errors of method [`get_kora_campaign_metadata`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraCampaignMetadataError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_campaign_rewards`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraCampaignRewardsError { - Status400(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_epoch_config_metadata`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraEpochConfigMetadataError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_epoch_metadata`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraEpochMetadataError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_interval_metadata`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraIntervalMetadataError { - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_leaderboard`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraLeaderboardError { - Status400(models::Error), - UnknownValue(serde_json::Value), -} - -/// struct for typed errors of method [`get_kora_rewards_summary`] -#[derive(Debug, Clone, Serialize, Deserialize)] -#[serde(untagged)] -pub enum GetKoraRewardsSummaryError { - UnknownValue(serde_json::Value), -} - /// struct for typed errors of method [`kora_health_check`] #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(untagged)] @@ -74,330 +23,6 @@ pub enum KoraHealthCheckError { } -/// Returns metadata for Kora rewards campaigns. -pub async fn get_kora_campaign_metadata(configuration: &configuration::Configuration, campaign_name: Option<&str>, status: Option<&str>) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_campaign_name = campaign_name; - let p_status = status; - - let uri_str = format!("{}/v1/kora/metadata/campaign", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_campaign_name { - req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_status { - req_builder = req_builder.query(&[("status", ¶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 `Vec<models::KoraCampaignMetadata>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraCampaignMetadata>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns the rewards earned by users for Kora campaigns. -pub async fn get_kora_campaign_rewards(configuration: &configuration::Configuration, user_address: &str, campaign_name: Option<&str>, epoch_number: Option) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_user_address = user_address; - let p_campaign_name = campaign_name; - let p_epoch_number = epoch_number; - - let uri_str = format!("{}/v1/kora/rewards/campaign", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_campaign_name { - req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_epoch_number { - req_builder = req_builder.query(&[("epochNumber", ¶m_value.to_string())]); - } - req_builder = req_builder.query(&[("userAddress", &p_user_address.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 `Vec<models::KoraCampaignRewards>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraCampaignRewards>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns epoch configuration including reward allocations for Kora. -pub async fn get_kora_epoch_config_metadata(configuration: &configuration::Configuration, interval_number: Option, campaign_name: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_interval_number = interval_number; - let p_campaign_name = campaign_name; - - let uri_str = format!("{}/v1/kora/metadata/epoch/configs", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_interval_number { - req_builder = req_builder.query(&[("intervalNumber", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_campaign_name { - req_builder = req_builder.query(&[("campaignName", ¶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::KoraEpochConfigResponse`"))), - 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::KoraEpochConfigResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns the latest or next epoch for a Kora campaign. -pub async fn get_kora_epoch_metadata(configuration: &configuration::Configuration, campaign_name: Option<&str>, epoch: Option<&str>) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_campaign_name = campaign_name; - let p_epoch = epoch; - - let uri_str = format!("{}/v1/kora/metadata/epoch", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_campaign_name { - req_builder = req_builder.query(&[("campaignName", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_epoch { - req_builder = req_builder.query(&[("epoch", ¶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 `Vec<models::KoraEpochMetadata>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraEpochMetadata>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns interval metadata for Kora. -pub async fn get_kora_interval_metadata(configuration: &configuration::Configuration, interval: Option<&str>, protocol: Option<&str>) -> Result, Error> { - // add a prefix to parameters to efficiently prevent name collisions - let p_interval = interval; - let p_protocol = protocol; - - let uri_str = format!("{}/v1/kora/metadata/interval", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_interval { - req_builder = req_builder.query(&[("interval", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_protocol { - req_builder = req_builder.query(&[("protocol", ¶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 `Vec<models::KoraIntervalMetadata>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraIntervalMetadata>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns rankings and earnings for Kora swap participants, sorted by the specified category. -pub async fn get_kora_leaderboard(configuration: &configuration::Configuration, epoch_id: Option<&str>, sort_by: Option<&str>, sort_order: Option<&str>, page: Option, limit: Option, search: Option<&str>, min_volume_e6: Option<&str>) -> Result> { - // add a prefix to parameters to efficiently prevent name collisions - let p_epoch_id = epoch_id; - let p_sort_by = sort_by; - let p_sort_order = sort_order; - let p_page = page; - let p_limit = limit; - let p_search = search; - let p_min_volume_e6 = min_volume_e6; - - let uri_str = format!("{}/v1/kora/leaderboard", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref param_value) = p_epoch_id { - req_builder = req_builder.query(&[("epochId", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_sort_by { - req_builder = req_builder.query(&[("sortBy", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_sort_order { - req_builder = req_builder.query(&[("sortOrder", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_page { - req_builder = req_builder.query(&[("page", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_limit { - req_builder = req_builder.query(&[("limit", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_search { - req_builder = req_builder.query(&[("search", ¶m_value.to_string())]); - } - if let Some(ref param_value) = p_min_volume_e6 { - req_builder = req_builder.query(&[("minVolumeE6", ¶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::KoraLeaderboardResponse`"))), - 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::KoraLeaderboardResponse`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - -/// Returns the all-time rewards earned by users including Kora CC and points. -pub async fn get_kora_rewards_summary(configuration: &configuration::Configuration, ) -> Result, Error> { - - let uri_str = format!("{}/v1/kora/rewards/summary", configuration.base_path); - let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); - - if let Some(ref user_agent) = configuration.user_agent { - req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone()); - } - if let Some(ref token) = configuration.bearer_access_token { - req_builder = req_builder.bearer_auth(token.to_owned()); - }; - - 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 `Vec<models::KoraRewardsSummary>`"))), - ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraRewardsSummary>`")))), - } - } else { - let content = resp.text().await?; - let entity: Option = serde_json::from_str(&content).ok(); - Err(Error::ResponseError(ResponseContent { status, content, entity })) - } -} - /// Returns the health status of the Kora rewards service. pub async fn kora_health_check(configuration: &configuration::Configuration, ) -> Result> { diff --git a/rust/gen/bluefin_api/src/apis/rewards_api.rs b/rust/gen/bluefin_api/src/apis/rewards_api.rs index 5f06e12b..4d39fd10 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_user_bonuses`] +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetUserBonusesError { + 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,44 @@ pub async fn get_rewards_summary(configuration: &configuration::Configuration, ) } } +/// Returns the bonuses earned by all users for a specific epoch number. +pub async fn get_user_bonuses(configuration: &configuration::Configuration, epoch_number: i32) -> Result, Error> { + // add a prefix to parameters to efficiently prevent name collisions + let p_epoch_number = epoch_number; + + let uri_str = format!("{}/v1/rewards/bonuses", configuration.base_path); + let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str); + + req_builder = req_builder.query(&[("epochNumber", &p_epoch_number.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 `Vec<models::KoraUserBonusResponse>`"))), + ContentType::Unsupported(unknown_type) => return Err(Error::from(serde_json::Error::custom(format!("Received `{unknown_type}` content type response that cannot be converted to `Vec<models::KoraUserBonusResponse>`")))), + } + } 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/error_1.rs b/rust/gen/bluefin_api/src/models/error_1.rs new file mode 100644 index 00000000..9bc913e4 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/error_1.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 Error1 { + /// Error message + #[serde(rename = "error", skip_serializing_if = "Option::is_none")] + pub error: Option, + /// Error code + #[serde(rename = "code", skip_serializing_if = "Option::is_none")] + pub code: Option, +} + +impl Error1 { + pub fn new() -> Error1 { + Error1 { + error: None, + code: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/kora_user_bonus_response.rs b/rust/gen/bluefin_api/src/models/kora_user_bonus_response.rs new file mode 100644 index 00000000..f1dd0c87 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/kora_user_bonus_response.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 KoraUserBonusResponse { + /// User wallet address + #[serde(rename = "userAddress")] + pub user_address: String, + /// Epoch number for the bonus + #[serde(rename = "epochNumber")] + pub epoch_number: i32, + /// Total bonus points earned + #[serde(rename = "bonusPoints")] + pub bonus_points: String, + /// Total bonus CC rewards earned + #[serde(rename = "bonusCcRewards")] + pub bonus_cc_rewards: String, + /// Criteria for earning the bonus + #[serde(rename = "criteria", skip_serializing_if = "Option::is_none")] + pub criteria: Option, +} + +impl KoraUserBonusResponse { + pub fn new(user_address: String, epoch_number: i32, bonus_points: String, bonus_cc_rewards: String) -> KoraUserBonusResponse { + KoraUserBonusResponse { + user_address, + epoch_number, + bonus_points, + bonus_cc_rewards, + criteria: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/mod.rs b/rust/gen/bluefin_api/src/models/mod.rs index 27795151..9628a5ee 100644 --- a/rust/gen/bluefin_api/src/models/mod.rs +++ b/rust/gen/bluefin_api/src/models/mod.rs @@ -108,6 +108,8 @@ pub mod epoch_metadata; pub use self::epoch_metadata::EpochMetadata; pub mod error; pub use self::error::Error; +pub mod error_1; +pub use self::error_1::Error1; pub mod exchange_info_response; pub use self::exchange_info_response::ExchangeInfoResponse; pub mod failed_command_type; @@ -132,28 +134,10 @@ pub mod iss_base64_details; pub use self::iss_base64_details::IssBase64Details; pub mod kline_interval; pub use self::kline_interval::KlineInterval; -pub mod kora_campaign_bonus; -pub use self::kora_campaign_bonus::KoraCampaignBonus; -pub mod kora_campaign_metadata; -pub use self::kora_campaign_metadata::KoraCampaignMetadata; -pub mod kora_campaign_rewards; -pub use self::kora_campaign_rewards::KoraCampaignRewards; -pub mod kora_epoch_config; -pub use self::kora_epoch_config::KoraEpochConfig; -pub mod kora_epoch_config_response; -pub use self::kora_epoch_config_response::KoraEpochConfigResponse; -pub mod kora_epoch_metadata; -pub use self::kora_epoch_metadata::KoraEpochMetadata; pub mod kora_health_check_200_response; pub use self::kora_health_check_200_response::KoraHealthCheck200Response; -pub mod kora_interval_metadata; -pub use self::kora_interval_metadata::KoraIntervalMetadata; -pub mod kora_leaderboard_entry; -pub use self::kora_leaderboard_entry::KoraLeaderboardEntry; -pub mod kora_leaderboard_response; -pub use self::kora_leaderboard_response::KoraLeaderboardResponse; -pub mod kora_rewards_summary; -pub use self::kora_rewards_summary::KoraRewardsSummary; +pub mod kora_user_bonus_response; +pub use self::kora_user_bonus_response::KoraUserBonusResponse; pub mod leaderboard_entry; pub use self::leaderboard_entry::LeaderboardEntry; pub mod leaderboard_interval; diff --git a/ts/sdk/src/.openapi-generator/FILES b/ts/sdk/src/.openapi-generator/FILES index 1056bb94..3160a7ac 100644 --- a/ts/sdk/src/.openapi-generator/FILES +++ b/ts/sdk/src/.openapi-generator/FILES @@ -61,6 +61,7 @@ docs/EpochConfigs.md docs/EpochConfigsResponse.md docs/EpochMetadata.md docs/Error.md +docs/Error1.md docs/ExchangeApi.md docs/ExchangeInfoResponse.md docs/FailedCommandType.md @@ -75,17 +76,8 @@ docs/IntervalRewards.md docs/IssBase64Details.md docs/KlineInterval.md docs/KoraApi.md -docs/KoraCampaignBonus.md -docs/KoraCampaignMetadata.md -docs/KoraCampaignRewards.md -docs/KoraEpochConfig.md -docs/KoraEpochConfigResponse.md -docs/KoraEpochMetadata.md docs/KoraHealthCheck200Response.md -docs/KoraIntervalMetadata.md -docs/KoraLeaderboardEntry.md -docs/KoraLeaderboardResponse.md -docs/KoraRewardsSummary.md +docs/KoraUserBonusResponse.md docs/LeaderboardEntry.md docs/LeaderboardInterval.md docs/LeaderboardResponse.md diff --git a/ts/sdk/src/api.ts b/ts/sdk/src/api.ts index 23b5158c..418ecf93 100644 --- a/ts/sdk/src/api.ts +++ b/ts/sdk/src/api.ts @@ -2413,6 +2413,25 @@ export const EpochMetadataStatusEnum = { export type EpochMetadataStatusEnum = typeof EpochMetadataStatusEnum[keyof typeof EpochMetadataStatusEnum]; +/** + * + * @export + * @interface Error1 + */ +export interface Error1 { + /** + * Error message + * @type {string} + * @memberof Error1 + */ + 'error'?: string; + /** + * Error code + * @type {string} + * @memberof Error1 + */ + 'code'?: string; +} /** * * @export @@ -2816,3545 +2835,3004 @@ export type KlineInterval = typeof KlineInterval[keyof typeof KlineInterval]; /** * * @export - * @interface KoraCampaignBonus + * @interface KoraHealthCheck200Response */ -export interface KoraCampaignBonus { - /** - * Type of bonus (e.g., VOLUME_BONUS, REFERRAL_BONUS) - * @type {string} - * @memberof KoraCampaignBonus - */ - 'bonusType'?: string; - /** - * CC reward amount for this bonus - * @type {string} - * @memberof KoraCampaignBonus - */ - 'bonusCcReward'?: string; +export interface KoraHealthCheck200Response { /** - * Points earned for this bonus + * * @type {string} - * @memberof KoraCampaignBonus + * @memberof KoraHealthCheck200Response */ - 'bonusPoints'?: string; + 'status'?: string; /** - * Criteria that was met for earning this bonus - * @type {string} - * @memberof KoraCampaignBonus + * + * @type {number} + * @memberof KoraHealthCheck200Response */ - 'bonusCriteria'?: string; + 'timestamp'?: number; } /** * * @export - * @interface KoraCampaignMetadata + * @interface KoraUserBonusResponse */ -export interface KoraCampaignMetadata { +export interface KoraUserBonusResponse { /** - * + * User wallet address * @type {string} - * @memberof KoraCampaignMetadata + * @memberof KoraUserBonusResponse */ - 'status': KoraCampaignMetadataStatusEnum; + 'userAddress': string; /** - * Name of the campaign - * @type {string} - * @memberof KoraCampaignMetadata + * Epoch number for the bonus + * @type {number} + * @memberof KoraUserBonusResponse */ - 'campaignName': string; + 'epochNumber': number; /** - * Name of the parent campaign + * Total bonus points earned * @type {string} - * @memberof KoraCampaignMetadata + * @memberof KoraUserBonusResponse */ - 'parentCampaignName'?: string; + 'bonusPoints': string; /** - * Time in milliseconds for campaign start date - * @type {number} - * @memberof KoraCampaignMetadata + * Total bonus CC rewards earned + * @type {string} + * @memberof KoraUserBonusResponse */ - 'startDate': number; + 'bonusCcRewards': string; /** - * Time in milliseconds for campaign end date - * @type {number} - * @memberof KoraCampaignMetadata + * Criteria for earning the bonus + * @type {string} + * @memberof KoraUserBonusResponse */ - 'endDate': number; + 'criteria'?: string; } - -export const KoraCampaignMetadataStatusEnum = { - Active: 'ACTIVE', - Inactive: 'INACTIVE' -} as const; - -export type KoraCampaignMetadataStatusEnum = typeof KoraCampaignMetadataStatusEnum[keyof typeof KoraCampaignMetadataStatusEnum]; - /** * * @export - * @interface KoraCampaignRewards + * @interface LeaderboardEntry */ -export interface KoraCampaignRewards { - /** - * User address for the rewards earned data - * @type {string} - * @memberof KoraCampaignRewards - */ - 'userAddress': string; - /** - * Name of the campaign - * @type {string} - * @memberof KoraCampaignRewards - */ - 'campaignName': string; - /** - * Epoch number for the rewards earned data - * @type {number} - * @memberof KoraCampaignRewards - */ - 'epochNumber': number; +export interface LeaderboardEntry { /** - * Interval number for the rewards earned data + * Rank of the trader in the leaderboard. * @type {number} - * @memberof KoraCampaignRewards + * @memberof LeaderboardEntry */ - 'intervalNumber': number; + 'rank': number; /** - * Market Symbol + * The address of the account. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LeaderboardEntry */ - 'symbol'?: string; + 'accountAddress': string; /** - * + * Total account value of the trader in e9 format. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LeaderboardEntry */ - 'status': KoraCampaignRewardsStatusEnum; + 'accountValueE9': string; /** - * Total blue token rewards + * Total profit and loss of the trader in e9 format. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LeaderboardEntry */ - 'blueRewards'?: string; + 'pnlE9': string; /** - * Total sui token rewards + * Total trading volume of the trader in e9 format. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LeaderboardEntry */ - 'suiRewards'?: string; + 'volumeE9': string; +} +/** + * + * @export + * @enum {string} + */ + +export const LeaderboardInterval = { + LeaderboardIntervalN1d: '1d', + LeaderboardIntervalN7d: '7d', + LeaderboardIntervalN30d: '30d', + LeaderboardIntervalALLTIME: 'ALL_TIME', + LeaderboardIntervalUNSPECIFIED: 'UNSPECIFIED' +} as const; + +export type LeaderboardInterval = typeof LeaderboardInterval[keyof typeof LeaderboardInterval]; + + +/** + * + * @export + * @interface LeaderboardResponse + */ +export interface LeaderboardResponse { /** - * Total wal rewards - * @type {string} - * @memberof KoraCampaignRewards + * + * @type {Array} + * @memberof LeaderboardResponse */ - 'walRewards'?: string; + 'data': Array; +} +/** + * User is expected to sign this payload and sends is signature in login api as header and payload itself in request body + * @export + * @interface LoginRequest + */ +export interface LoginRequest { /** - * Total cash rewards + * The address of the account. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LoginRequest */ - 'cashRewards'?: string; + 'accountAddress': string; /** - * Total CC token rewards - * @type {string} - * @memberof KoraCampaignRewards + * The timestamp in millis when the login was signed. + * @type {number} + * @memberof LoginRequest */ - 'ccRewards'?: string; + 'signedAtMillis': number; /** - * Total Kora points earned + * The intended audience of the login request. * @type {string} - * @memberof KoraCampaignRewards + * @memberof LoginRequest */ - 'koraPoints'?: string; + 'audience': string; +} +/** + * + * @export + * @interface LoginResponse + */ +export interface LoginResponse { /** - * Total user fee paid + * * @type {string} - * @memberof KoraCampaignRewards - */ - 'userFeePaid'?: string; - /** - * Time in milliseconds for interval start date - * @type {number} - * @memberof KoraCampaignRewards + * @memberof LoginResponse */ - 'intervalStartDate'?: number; + 'accessToken': string; /** - * Time in milliseconds for interval end date + * * @type {number} - * @memberof KoraCampaignRewards - */ - 'intervalEndDate'?: number; - /** - * Indicates if rewards have been disbursed - * @type {boolean} - * @memberof KoraCampaignRewards - */ - 'isDisbursed'?: boolean; - /** - * Transaction digest of the disbursement - * @type {string} - * @memberof KoraCampaignRewards + * @memberof LoginResponse */ - 'txnDigest'?: string; + 'accessTokenValidForSeconds': number; /** - * Status of the claim + * * @type {string} - * @memberof KoraCampaignRewards + * @memberof LoginResponse */ - 'claimStatus'?: KoraCampaignRewardsClaimStatusEnum; + 'refreshToken': string; /** - * List of bonuses attached to this reward entry - * @type {Array} - * @memberof KoraCampaignRewards + * + * @type {number} + * @memberof LoginResponse */ - 'bonuses'?: Array; + 'refreshTokenValidForSeconds': number; } +/** + * Margin type. + * @export + * @enum {string} + */ -export const KoraCampaignRewardsStatusEnum = { - Active: 'ACTIVE', - NotStarted: 'NOT_STARTED', - Finalized: 'FINALIZED', - Cooldown: 'COOLDOWN' +export const MarginType = { + Cross: 'CROSS', + Isolated: 'ISOLATED', + Unspecified: 'UNSPECIFIED' } as const; -export type KoraCampaignRewardsStatusEnum = typeof KoraCampaignRewardsStatusEnum[keyof typeof KoraCampaignRewardsStatusEnum]; -export const KoraCampaignRewardsClaimStatusEnum = { - Claimable: 'CLAIMABLE', - Claimed: 'CLAIMED', - NotYetClaimable: 'NOT_YET_CLAIMABLE', - ClaimEnded: 'CLAIM_ENDED' -} as const; +export type MarginType = typeof MarginType[keyof typeof MarginType]; -export type KoraCampaignRewardsClaimStatusEnum = typeof KoraCampaignRewardsClaimStatusEnum[keyof typeof KoraCampaignRewardsClaimStatusEnum]; /** * * @export - * @interface KoraEpochConfig + * @interface MarkAsClaimedRequest */ -export interface KoraEpochConfig { - /** - * The name of the campaign - * @type {string} - * @memberof KoraEpochConfig - */ - 'campaignName': string; +export interface MarkAsClaimedRequest { /** - * Duration of the epoch in hours + * The interval number * @type {number} - * @memberof KoraEpochConfig - */ - 'epochDuration': number; - /** - * Allocation of Sui rewards for this epoch - * @type {string} - * @memberof KoraEpochConfig - */ - 'suiRewardsAllocation'?: string; - /** - * Allocation of Blue rewards for this epoch - * @type {string} - * @memberof KoraEpochConfig - */ - 'blueRewardsAllocation'?: string; - /** - * Allocation of Wal rewards for this epoch - * @type {string} - * @memberof KoraEpochConfig + * @memberof MarkAsClaimedRequest */ - 'walRewardsAllocation'?: string; + 'intervalNumber': number; /** - * Allocation of CC token rewards for this epoch + * The campaign name * @type {string} - * @memberof KoraEpochConfig + * @memberof MarkAsClaimedRequest */ - 'ccRewardsAllocation'?: string; + 'campaignName': MarkAsClaimedRequestCampaignNameEnum; /** - * Allocation of Kora points rewards for this epoch + * The transaction digest of the claim * @type {string} - * @memberof KoraEpochConfig - */ - 'koraPointsRewardsAllocation'?: string; - /** - * Interval number for the epoch - * @type {number} - * @memberof KoraEpochConfig - */ - 'intervalNumber': number; - /** - * Epoch number - * @type {number} - * @memberof KoraEpochConfig - */ - 'epochNumber': number; - /** - * Additional campaign-specific configurations - * @type {{ [key: string]: any | undefined; }} - * @memberof KoraEpochConfig + * @memberof MarkAsClaimedRequest */ - 'config'?: { [key: string]: any | undefined; }; + 'txnDigest': string; } + +export const MarkAsClaimedRequestCampaignNameEnum = { + TradeAndEarn: 'TRADE_AND_EARN', + WalTradeAndEarn: 'WAL_TRADE_AND_EARN', + Affiliate: 'AFFILIATE' +} as const; + +export type MarkAsClaimedRequestCampaignNameEnum = typeof MarkAsClaimedRequestCampaignNameEnum[keyof typeof MarkAsClaimedRequestCampaignNameEnum]; + /** * * @export - * @interface KoraEpochConfigResponse + * @interface MarkAsClaimedResponse */ -export interface KoraEpochConfigResponse { - /** - * The maximum interval number available - * @type {number} - * @memberof KoraEpochConfigResponse - */ - 'maxIntervalNumber': number; +export interface MarkAsClaimedResponse { /** - * The current interval number being queried - * @type {number} - * @memberof KoraEpochConfigResponse + * Response message indicating if the claim was marked as claimed successfully + * @type {string} + * @memberof MarkAsClaimedResponse */ - 'intervalNumber': number; + 'message': string; /** - * - * @type {Array} - * @memberof KoraEpochConfigResponse + * Status of the claim + * @type {string} + * @memberof MarkAsClaimedResponse */ - 'data': Array; + 'status': MarkAsClaimedResponseStatusEnum; } + +export const MarkAsClaimedResponseStatusEnum = { + Claimed: 'CLAIMED', + Claimable: 'CLAIMABLE' +} as const; + +export type MarkAsClaimedResponseStatusEnum = typeof MarkAsClaimedResponseStatusEnum[keyof typeof MarkAsClaimedResponseStatusEnum]; + /** * * @export - * @interface KoraEpochMetadata + * @interface MarkPriceUpdate */ -export interface KoraEpochMetadata { +export interface MarkPriceUpdate { /** - * + * The symbol of the market. * @type {string} - * @memberof KoraEpochMetadata + * @memberof MarkPriceUpdate */ - 'status': KoraEpochMetadataStatusEnum; + 'symbol': string; /** - * Name of the campaign + * The price in scientific notation with 9 decimal places of precision. * @type {string} - * @memberof KoraEpochMetadata + * @memberof MarkPriceUpdate */ - 'campaignName': string; + 'priceE9': string; /** - * Epoch ID + * * @type {string} - * @memberof KoraEpochMetadata + * @memberof MarkPriceUpdate */ - 'epochId': string; + 'source': MarkPriceUpdateSourceEnum; /** - * Epoch number + * The timestamp of the price update. * @type {number} - * @memberof KoraEpochMetadata - */ - 'epochNumber': number; - /** - * Time in milliseconds for epoch start date - * @type {number} - * @memberof KoraEpochMetadata - */ - 'startDate': number; - /** - * Time in milliseconds for epoch end date - * @type {number} - * @memberof KoraEpochMetadata + * @memberof MarkPriceUpdate */ - 'endDate': number; + 'updatedAtMillis': number; } -export const KoraEpochMetadataStatusEnum = { - Active: 'ACTIVE', - NotStarted: 'NOT_STARTED', - Finalized: 'FINALIZED', - Cooldown: 'COOLDOWN' +export const MarkPriceUpdateSourceEnum = { + Mark: 'Mark' } as const; -export type KoraEpochMetadataStatusEnum = typeof KoraEpochMetadataStatusEnum[keyof typeof KoraEpochMetadataStatusEnum]; +export type MarkPriceUpdateSourceEnum = typeof MarkPriceUpdateSourceEnum[keyof typeof MarkPriceUpdateSourceEnum]; /** * * @export - * @interface KoraHealthCheck200Response + * @interface Market */ -export interface KoraHealthCheck200Response { +export interface Market { /** - * + * Symbol of the market. * @type {string} - * @memberof KoraHealthCheck200Response - */ - 'status'?: string; - /** - * - * @type {number} - * @memberof KoraHealthCheck200Response + * @memberof Market */ - 'timestamp'?: number; -} -/** - * - * @export - * @interface KoraIntervalMetadata - */ -export interface KoraIntervalMetadata { + 'symbol': string; /** - * + * Market address. * @type {string} - * @memberof KoraIntervalMetadata - */ - 'status': KoraIntervalMetadataStatusEnum; - /** - * Time in milliseconds for interval start date - * @type {number} - * @memberof KoraIntervalMetadata - */ - 'startDate': number; - /** - * Time in milliseconds for interval end date - * @type {number} - * @memberof KoraIntervalMetadata + * @memberof Market */ - 'endDate': number; + 'marketAddress': string; /** - * Interval ID - * @type {number} - * @memberof KoraIntervalMetadata + * + * @type {MarketStatus} + * @memberof Market */ - 'intervalId': number; + 'status': MarketStatus; /** - * Type of the interval + * Base asset symbol. * @type {string} - * @memberof KoraIntervalMetadata + * @memberof Market */ - 'intervalType'?: string; + 'baseAssetSymbol': string; /** - * Protocol for the interval + * Base asset name. * @type {string} - * @memberof KoraIntervalMetadata + * @memberof Market */ - 'protocol'?: KoraIntervalMetadataProtocolEnum; -} - -export const KoraIntervalMetadataStatusEnum = { - Active: 'ACTIVE', - NotStarted: 'NOT_STARTED', - Finalized: 'FINALIZED', - Cooldown: 'COOLDOWN' -} as const; - -export type KoraIntervalMetadataStatusEnum = typeof KoraIntervalMetadataStatusEnum[keyof typeof KoraIntervalMetadataStatusEnum]; -export const KoraIntervalMetadataProtocolEnum = { - Bluefin: 'bluefin', - Kora: 'kora' -} as const; - -export type KoraIntervalMetadataProtocolEnum = typeof KoraIntervalMetadataProtocolEnum[keyof typeof KoraIntervalMetadataProtocolEnum]; - -/** - * - * @export - * @interface KoraLeaderboardEntry - */ -export interface KoraLeaderboardEntry { + 'baseAssetName': string; /** - * Overall ranking position based on sortBy parameter + * Precision of the base asset. * @type {number} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'rank': number; + 'baseAssetDecimals': number; /** - * Wallet address of the user + * Step size for the quantity (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'userAddress': string; + 'stepSizeE9': string; /** - * Total swap volume (USD equivalent) + * Price increment size (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'totalVolumeE6': string; + 'tickSizeE9': string; /** - * Total fees paid + * Minimum order size (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry - */ - 'totalFeeE6'?: string; - /** - * Total number of qualifying swap transactions - * @type {number} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'totalTransactions': number; + 'minOrderQuantityE9': string; /** - * CC token rewards earned + * Maximum limit order size (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'ccRewards': string; + 'maxLimitOrderQuantityE9': string; /** - * Kora points earned + * Maximum market order size (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'koraPoints': string; + 'maxMarketOrderQuantityE9': string; /** - * Total bonus points earned + * Minimum order price (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'totalBonusPoints'?: string; + 'minOrderPriceE9': string; /** - * Total bonus CC tokens earned + * Maximum order price (e9 format). * @type {string} - * @memberof KoraLeaderboardEntry + * @memberof Market */ - 'totalBonusCC'?: string; + 'maxOrderPriceE9': string; /** - * Ranking based purely on trading volume - * @type {number} - * @memberof KoraLeaderboardEntry + * Maintenance margin ratio (MMR, e9 format). + * @type {string} + * @memberof Market */ - 'volumeRank'?: number; + 'maintenanceMarginRatioE9': string; /** - * Ranking based purely on transaction count - * @type {number} - * @memberof KoraLeaderboardEntry + * Initial margin ratio (IMR), e9 format). + * @type {string} + * @memberof Market */ - 'transactionRank'?: number; + 'initialMarginRatioE9': string; /** - * Ranking based on combined CC + Kora points value - * @type {number} - * @memberof KoraLeaderboardEntry + * Insurance pool ratio (e9 format). + * @type {string} + * @memberof Market */ - 'totalEarningsRank'?: number; + 'insurancePoolRatioE9': string; /** - * Timestamp of user\'s most recent swap (milliseconds) - * @type {number} - * @memberof KoraLeaderboardEntry + * Default leverage (e9 format). + * @type {string} + * @memberof Market */ - 'lastActivityDate'?: number; -} -/** - * - * @export - * @interface KoraLeaderboardResponse - */ -export interface KoraLeaderboardResponse { + 'defaultLeverageE9': string; /** - * - * @type {Array} - * @memberof KoraLeaderboardResponse + * Maximum notional value at current leverage. Index 0 is max notional value for leverage set to 1x, index 1 is for leverage 2x, etc... + * @type {Array} + * @memberof Market */ - 'data': Array; + 'maxNotionalAtOpenE9': Array; /** - * Total number of records - * @type {number} - * @memberof KoraLeaderboardResponse + * Minimum trade quantity allowed (e9 format). + * @type {string} + * @memberof Market */ - 'total': number; + 'minTradeQuantityE9': string; /** - * Page size for pagination - * @type {number} - * @memberof KoraLeaderboardResponse + * Max trade quantity allowed (e9 format). + * @type {string} + * @memberof Market */ - 'limit': number; + 'maxTradeQuantityE9': string; /** - * Current page number - * @type {number} - * @memberof KoraLeaderboardResponse + * Minimum trade price allowed (e9 format). + * @type {string} + * @memberof Market */ - 'page': number; -} -/** - * - * @export - * @interface KoraRewardsSummary - */ -export interface KoraRewardsSummary { + 'minTradePriceE9': string; /** - * User address for the rewards earned data + * Maximum trade price allowed (e9 format). * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'userAddress': string; + 'maxTradePriceE9': string; /** - * Total Blue token rewards earned + * Maximum allowed funding rate (e9 format). * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'blueRewards'?: string; + 'maxFundingRateE9': string; /** - * Total Sui token rewards earned + * Default maker fee (e9 format). * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'suiRewards'?: string; + 'defaultMakerFeeE9': string; /** - * Total wal rewards earned + * Default taker fee (e9 format). * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'walRewards'?: string; + 'defaultTakerFeeE9': string; /** - * Total CC token rewards earned across all Kora campaigns + * Insurance pool address. * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'ccRewards'?: string; + 'insurancePoolAddress': string; /** - * Total Kora points earned across all Kora campaigns + * Fee pool address. * @type {string} - * @memberof KoraRewardsSummary + * @memberof Market */ - 'koraPoints'?: string; -} -/** - * - * @export - * @interface LeaderboardEntry - */ -export interface LeaderboardEntry { + 'feePoolAddress': string; /** - * Rank of the trader in the leaderboard. - * @type {number} - * @memberof LeaderboardEntry + * The time when trading will start/have started on the market. + * @type {string} + * @memberof Market */ - 'rank': number; + 'tradingStartTimeAtMillis': string; /** - * The address of the account. + * Maximum take bound for long positions (e9 format). * @type {string} - * @memberof LeaderboardEntry + * @memberof Market */ - 'accountAddress': string; + 'mtbLongE9': string; /** - * Total account value of the trader in e9 format. + * Maximum take bound for short positions (e9 format). * @type {string} - * @memberof LeaderboardEntry + * @memberof Market */ - 'accountValueE9': string; + 'mtbShortE9': string; /** - * Total profit and loss of the trader in e9 format. + * Delisting price (e9 format). * @type {string} - * @memberof LeaderboardEntry + * @memberof Market */ - 'pnlE9': string; + 'delistingPriceE9': string; /** - * Total trading volume of the trader in e9 format. - * @type {string} - * @memberof LeaderboardEntry + * Indicates whether the market only allows isolated margin. + * @type {boolean} + * @memberof Market */ - 'volumeE9': string; + 'isolatedOnly': boolean; } -/** - * - * @export - * @enum {string} - */ - -export const LeaderboardInterval = { - LeaderboardIntervalN1d: '1d', - LeaderboardIntervalN7d: '7d', - LeaderboardIntervalN30d: '30d', - LeaderboardIntervalALLTIME: 'ALL_TIME', - LeaderboardIntervalUNSPECIFIED: 'UNSPECIFIED' -} as const; - -export type LeaderboardInterval = typeof LeaderboardInterval[keyof typeof LeaderboardInterval]; /** * * @export - * @interface LeaderboardResponse - */ -export interface LeaderboardResponse { - /** - * - * @type {Array} - * @memberof LeaderboardResponse - */ - 'data': Array; -} -/** - * User is expected to sign this payload and sends is signature in login api as header and payload itself in request body - * @export - * @interface LoginRequest + * @enum {string} */ -export interface LoginRequest { - /** - * The address of the account. - * @type {string} - * @memberof LoginRequest - */ - 'accountAddress': string; - /** - * The timestamp in millis when the login was signed. - * @type {number} - * @memberof LoginRequest - */ - 'signedAtMillis': number; - /** - * The intended audience of the login request. - * @type {string} - * @memberof LoginRequest - */ - 'audience': string; -} + +export const MarketDataStreamName = { + RecentTrade: 'Recent_Trade', + Ticker: 'Ticker', + TickerAll: 'Ticker_All', + DiffDepth10Ms: 'Diff_Depth_10_ms', + DiffDepth200Ms: 'Diff_Depth_200_ms', + DiffDepth500Ms: 'Diff_Depth_500_ms', + PartialDepth5: 'Partial_Depth_5', + PartialDepth10: 'Partial_Depth_10', + PartialDepth20: 'Partial_Depth_20', + OraclePrice: 'Oracle_Price', + MarkPrice: 'Mark_Price', + MarketPrice: 'Market_Price', + Candlestick1mLast: 'Candlestick_1m_Last', + Candlestick3mLast: 'Candlestick_3m_Last', + Candlestick5mLast: 'Candlestick_5m_Last', + Candlestick15mLast: 'Candlestick_15m_Last', + Candlestick30mLast: 'Candlestick_30m_Last', + Candlestick1hLast: 'Candlestick_1h_Last', + Candlestick2hLast: 'Candlestick_2h_Last', + Candlestick4hLast: 'Candlestick_4h_Last', + Candlestick6hLast: 'Candlestick_6h_Last', + Candlestick8hLast: 'Candlestick_8h_Last', + Candlestick12hLast: 'Candlestick_12h_Last', + Candlestick1dLast: 'Candlestick_1d_Last', + Candlestick1wLast: 'Candlestick_1w_Last', + Candlestick1MoLast: 'Candlestick_1Mo_Last', + Candlestick1mOracle: 'Candlestick_1m_Oracle', + Candlestick3mOracle: 'Candlestick_3m_Oracle', + Candlestick5mOracle: 'Candlestick_5m_Oracle', + Candlestick15mOracle: 'Candlestick_15m_Oracle', + Candlestick30mOracle: 'Candlestick_30m_Oracle', + Candlestick1hOracle: 'Candlestick_1h_Oracle', + Candlestick2hOracle: 'Candlestick_2h_Oracle', + Candlestick4hOracle: 'Candlestick_4h_Oracle', + Candlestick6hOracle: 'Candlestick_6h_Oracle', + Candlestick8hOracle: 'Candlestick_8h_Oracle', + Candlestick12hOracle: 'Candlestick_12h_Oracle', + Candlestick1dOracle: 'Candlestick_1d_Oracle', + Candlestick1wOracle: 'Candlestick_1w_Oracle', + Candlestick1MoOracle: 'Candlestick_1Mo_Oracle', + Candlestick1mMark: 'Candlestick_1m_Mark', + Candlestick3mMark: 'Candlestick_3m_Mark', + Candlestick5mMark: 'Candlestick_5m_Mark', + Candlestick15mMark: 'Candlestick_15m_Mark', + Candlestick30mMark: 'Candlestick_30m_Mark', + Candlestick1hMark: 'Candlestick_1h_Mark', + Candlestick2hMark: 'Candlestick_2h_Mark', + Candlestick4hMark: 'Candlestick_4h_Mark', + Candlestick6hMark: 'Candlestick_6h_Mark', + Candlestick8hMark: 'Candlestick_8h_Mark', + Candlestick12hMark: 'Candlestick_12h_Mark', + Candlestick1dMark: 'Candlestick_1d_Mark', + Candlestick1wMark: 'Candlestick_1w_Mark', + Candlestick1MoMark: 'Candlestick_1Mo_Mark', + Candlestick1mMarket: 'Candlestick_1m_Market', + Candlestick3mMarket: 'Candlestick_3m_Market', + Candlestick5mMarket: 'Candlestick_5m_Market', + Candlestick15mMarket: 'Candlestick_15m_Market', + Candlestick30mMarket: 'Candlestick_30m_Market', + Candlestick1hMarket: 'Candlestick_1h_Market', + Candlestick2hMarket: 'Candlestick_2h_Market', + Candlestick4hMarket: 'Candlestick_4h_Market', + Candlestick6hMarket: 'Candlestick_6h_Market', + Candlestick8hMarket: 'Candlestick_8h_Market', + Candlestick12hMarket: 'Candlestick_12h_Market', + Candlestick1dMarket: 'Candlestick_1d_Market', + Candlestick1wMarket: 'Candlestick_1w_Market', + Candlestick1MoMarket: 'Candlestick_1Mo_Market' +} as const; + +export type MarketDataStreamName = typeof MarketDataStreamName[keyof typeof MarketDataStreamName]; + + +/** + * The type of event communicated in the WebSocket message. + * @export + * @enum {string} + */ + +export const MarketEventType = { + RecentTradesUpdates: 'RecentTradesUpdates', + TickerUpdate: 'TickerUpdate', + TickerAllUpdate: 'TickerAllUpdate', + OraclePriceUpdate: 'OraclePriceUpdate', + MarkPriceUpdate: 'MarkPriceUpdate', + MarketPriceUpdate: 'MarketPriceUpdate', + CandlestickUpdate: 'CandlestickUpdate', + OrderbookDiffDepthUpdate: 'OrderbookDiffDepthUpdate', + OrderbookPartialDepthUpdate: 'OrderbookPartialDepthUpdate' +} as const; + +export type MarketEventType = typeof MarketEventType[keyof typeof MarketEventType]; + + /** * * @export - * @interface LoginResponse + * @interface MarketPriceUpdate */ -export interface LoginResponse { +export interface MarketPriceUpdate { /** - * + * The symbol of the market. * @type {string} - * @memberof LoginResponse + * @memberof MarketPriceUpdate */ - 'accessToken': string; + 'symbol': string; /** - * - * @type {number} - * @memberof LoginResponse + * The price in scientific notation with 9 decimal places of precision. + * @type {string} + * @memberof MarketPriceUpdate */ - 'accessTokenValidForSeconds': number; + 'priceE9': string; /** * * @type {string} - * @memberof LoginResponse + * @memberof MarketPriceUpdate */ - 'refreshToken': string; + 'source': MarketPriceUpdateSourceEnum; /** - * + * The timestamp of the price update. * @type {number} - * @memberof LoginResponse + * @memberof MarketPriceUpdate */ - 'refreshTokenValidForSeconds': number; + 'updatedAtMillis': number; } + +export const MarketPriceUpdateSourceEnum = { + Market: 'Market' +} as const; + +export type MarketPriceUpdateSourceEnum = typeof MarketPriceUpdateSourceEnum[keyof typeof MarketPriceUpdateSourceEnum]; + /** - * Margin type. + * * @export * @enum {string} */ -export const MarginType = { - Cross: 'CROSS', - Isolated: 'ISOLATED', +export const MarketStatus = { + Active: 'ACTIVE', + Beta: 'BETA', + Maintenance: 'MAINTENANCE', + Delisted: 'DELISTED', Unspecified: 'UNSPECIFIED' } as const; -export type MarginType = typeof MarginType[keyof typeof MarginType]; +export type MarketStatus = typeof MarketStatus[keyof typeof MarketStatus]; /** - * + * A market stream message containing an event type and a payload. The payload structure depends on the event type. * @export - * @interface MarkAsClaimedRequest + * @interface MarketStreamMessage */ -export interface MarkAsClaimedRequest { - /** - * The interval number - * @type {number} - * @memberof MarkAsClaimedRequest - */ - 'intervalNumber': number; +export interface MarketStreamMessage { /** - * The campaign name - * @type {string} - * @memberof MarkAsClaimedRequest + * + * @type {MarketEventType} + * @memberof MarketStreamMessage */ - 'campaignName': MarkAsClaimedRequestCampaignNameEnum; + 'event': MarketEventType; /** - * The transaction digest of the claim - * @type {string} - * @memberof MarkAsClaimedRequest + * + * @type {MarketStreamMessagePayload} + * @memberof MarketStreamMessage */ - 'txnDigest': string; + 'payload': MarketStreamMessagePayload; } -export const MarkAsClaimedRequestCampaignNameEnum = { - TradeAndEarn: 'TRADE_AND_EARN', - WalTradeAndEarn: 'WAL_TRADE_AND_EARN', - Affiliate: 'AFFILIATE' -} as const; -export type MarkAsClaimedRequestCampaignNameEnum = typeof MarkAsClaimedRequestCampaignNameEnum[keyof typeof MarkAsClaimedRequestCampaignNameEnum]; +/** + * @type MarketStreamMessagePayload + * The payload of the message, which varies based on the event type. + * @export + */ +export type MarketStreamMessagePayload = CandlestickUpdate | MarkPriceUpdate | MarketPriceUpdate | OraclePriceUpdate | OrderbookDiffDepthUpdate | OrderbookPartialDepthUpdate | RecentTradesUpdates | TickerAllUpdate | TickerUpdate; /** - * + * Subscription message for market data streams. * @export - * @interface MarkAsClaimedResponse + * @interface MarketSubscriptionMessage */ -export interface MarkAsClaimedResponse { +export interface MarketSubscriptionMessage { /** - * Response message indicating if the claim was marked as claimed successfully - * @type {string} - * @memberof MarkAsClaimedResponse + * + * @type {SubscriptionType} + * @memberof MarketSubscriptionMessage */ - 'message': string; + 'method': SubscriptionType; /** - * Status of the claim - * @type {string} - * @memberof MarkAsClaimedResponse + * List of market data streams to subscribe or unsubscribe from. + * @type {Array} + * @memberof MarketSubscriptionMessage */ - 'status': MarkAsClaimedResponseStatusEnum; + 'dataStreams': Array; } -export const MarkAsClaimedResponseStatusEnum = { - Claimed: 'CLAIMED', - Claimable: 'CLAIMABLE' -} as const; - -export type MarkAsClaimedResponseStatusEnum = typeof MarkAsClaimedResponseStatusEnum[keyof typeof MarkAsClaimedResponseStatusEnum]; /** - * + * Represents the type of market data stream and its parameters. * @export - * @interface MarkPriceUpdate + * @interface MarketSubscriptionStreams */ -export interface MarkPriceUpdate { +export interface MarketSubscriptionStreams { /** - * The symbol of the market. + * The symbol of the market stream to subscribe to (Leave empty for TickerAll stream) * @type {string} - * @memberof MarkPriceUpdate + * @memberof MarketSubscriptionStreams */ 'symbol': string; - /** - * The price in scientific notation with 9 decimal places of precision. - * @type {string} - * @memberof MarkPriceUpdate - */ - 'priceE9': string; /** * - * @type {string} - * @memberof MarkPriceUpdate - */ - 'source': MarkPriceUpdateSourceEnum; - /** - * The timestamp of the price update. - * @type {number} - * @memberof MarkPriceUpdate + * @type {Array} + * @memberof MarketSubscriptionStreams */ - 'updatedAtMillis': number; + 'streams': Array; } - -export const MarkPriceUpdateSourceEnum = { - Mark: 'Mark' -} as const; - -export type MarkPriceUpdateSourceEnum = typeof MarkPriceUpdateSourceEnum[keyof typeof MarkPriceUpdateSourceEnum]; - /** * * @export - * @interface Market + * @interface ModelError */ -export interface Market { +export interface ModelError { /** - * Symbol of the market. + * A code representing the type of error. * @type {string} - * @memberof Market + * @memberof ModelError */ - 'symbol': string; + 'errorCode'?: string; /** - * Market address. + * A human-readable message describing the error. * @type {string} - * @memberof Market + * @memberof ModelError */ - 'marketAddress': string; + 'message': string; /** - * - * @type {MarketStatus} - * @memberof Market + * Additional structured details about the error. + * @type {{ [key: string]: any | undefined; }} + * @memberof ModelError */ - 'status': MarketStatus; + 'details'?: { [key: string]: any | undefined; }; +} +/** + * + * @export + * @interface OnboardAffiliateRequest + */ +export interface OnboardAffiliateRequest { /** - * Base asset symbol. + * Referral code of the parent affiliate * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequest */ - 'baseAssetSymbol': string; + 'parentReferralCode'?: string | null; /** - * Base asset name. + * Name of the applicant * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequest */ - 'baseAssetName': string; + 'name': string; /** - * Precision of the base asset. - * @type {number} - * @memberof Market + * Email address of the applicant + * @type {string} + * @memberof OnboardAffiliateRequest */ - 'baseAssetDecimals': number; + 'email': string; /** - * Step size for the quantity (e9 format). - * @type {string} - * @memberof Market + * + * @type {OnboardAffiliateRequestSocialUserNames} + * @memberof OnboardAffiliateRequest */ - 'stepSizeE9': string; + 'socialUserNames'?: OnboardAffiliateRequestSocialUserNames; +} +/** + * Map of social media usernames + * @export + * @interface OnboardAffiliateRequestSocialUserNames + */ +export interface OnboardAffiliateRequestSocialUserNames { /** - * Price increment size (e9 format). + * Twitter username * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'tickSizeE9': string; + 'twitter'?: string; /** - * Minimum order size (e9 format). + * Instagram username * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'minOrderQuantityE9': string; + 'instagram'?: string; /** - * Maximum limit order size (e9 format). + * YouTube channel name * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'maxLimitOrderQuantityE9': string; + 'youtube'?: string; /** - * Maximum market order size (e9 format). + * TikTok username * @type {string} - * @memberof Market + * @memberof OnboardAffiliateRequestSocialUserNames */ - 'maxMarketOrderQuantityE9': string; + 'tiktok'?: string; +} +/** + * + * @export + * @interface OnboardRefereeRequest + */ +export interface OnboardRefereeRequest { /** - * Minimum order price (e9 format). + * Referral code of the parent affiliate * @type {string} - * @memberof Market + * @memberof OnboardRefereeRequest */ - 'minOrderPriceE9': string; + 'code': string; +} +/** + * + * @export + * @interface OpenOrderResponse + */ +export interface OpenOrderResponse { /** - * Maximum order price (e9 format). + * The Order Hash, which is the default way to uniquely identify an order in the system * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'maxOrderPriceE9': string; + 'orderHash': string; /** - * Maintenance margin ratio (MMR, e9 format). + * The Client Order ID, which is used a unique identifier for an order, provided by the client, in case of proprietary order management systems * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'maintenanceMarginRatioE9': string; + 'clientOrderId'?: string; /** - * Initial margin ratio (IMR), e9 format). + * The market symbol * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'initialMarginRatioE9': string; + 'symbol': string; /** - * Insurance pool ratio (e9 format). + * The account address of the order. May be an account user is authorized for. * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'insurancePoolRatioE9': string; + 'accountAddress': string; /** - * Default leverage (e9 format). + * The signer address of the order. May be an account user is authorized for. * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'defaultLeverageE9': string; + 'signerAddress': string; /** - * Maximum notional value at current leverage. Index 0 is max notional value for leverage set to 1x, index 1 is for leverage 2x, etc... - * @type {Array} - * @memberof Market + * The price in base e9 of the asset to be traded. Should always be a number + * @type {string} + * @memberof OpenOrderResponse */ - 'maxNotionalAtOpenE9': Array; + 'priceE9': string; /** - * Minimum trade quantity allowed (e9 format). + * The quantity in base e9 of the asset to be traded. Should always be a number * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'minTradeQuantityE9': string; + 'quantityE9': string; /** - * Max trade quantity allowed (e9 format). - * @type {string} - * @memberof Market + * + * @type {OrderSide} + * @memberof OpenOrderResponse */ - 'maxTradeQuantityE9': string; + 'side': OrderSide; /** - * Minimum trade price allowed (e9 format). + * The leverage in base e9 of the order to be traded. Should always be a number * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'minTradePriceE9': string; + 'leverageE9': string; /** - * Maximum trade price allowed (e9 format). - * @type {string} - * @memberof Market + * Is this order isolated or cross margin. Note market must be set to the same mode. + * @type {boolean} + * @memberof OpenOrderResponse */ - 'maxTradePriceE9': string; + 'isIsolated': boolean; /** - * Maximum allowed funding rate (e9 format). + * The random generated SALT. Should always be a number * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'maxFundingRateE9': string; + 'salt': string; /** - * Default maker fee (e9 format). - * @type {string} - * @memberof Market + * Unix timestamp in millis at which order will expire. Defaults to 1 month for LIMIT orders if not provided + * @type {number} + * @memberof OpenOrderResponse */ - 'defaultMakerFeeE9': string; + 'expiresAtMillis': number; /** - * Default taker fee (e9 format). - * @type {string} - * @memberof Market + * The timestamp in millis at which the request was signed + * @type {number} + * @memberof OpenOrderResponse */ - 'defaultTakerFeeE9': string; + 'signedAtMillis': number; /** - * Insurance pool address. - * @type {string} - * @memberof Market + * + * @type {OrderType} + * @memberof OpenOrderResponse */ - 'insurancePoolAddress': string; + 'type': OrderType; /** - * Fee pool address. - * @type {string} - * @memberof Market + * Is this order to only reduce a position? Default false + * @type {boolean} + * @memberof OpenOrderResponse */ - 'feePoolAddress': string; + 'reduceOnly': boolean; /** - * The time when trading will start/have started on the market. - * @type {string} - * @memberof Market + * If set to TRUE, the order can only be a maker order + * @type {boolean} + * @memberof OpenOrderResponse */ - 'tradingStartTimeAtMillis': string; + 'postOnly': boolean; /** - * Maximum take bound for long positions (e9 format). - * @type {string} - * @memberof Market + * + * @type {OrderTimeInForce} + * @memberof OpenOrderResponse */ - 'mtbLongE9': string; + 'timeInForce': OrderTimeInForce; /** - * Maximum take bound for short positions (e9 format). + * Trigger price in base e9 for stop orders. This should always be a number * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'mtbShortE9': string; + 'triggerPriceE9'?: string; /** - * Delisting price (e9 format). + * The quantity in base e9 of the asset currently filled. This should always be a number * @type {string} - * @memberof Market + * @memberof OpenOrderResponse */ - 'delistingPriceE9': string; + 'filledQuantityE9': string; /** - * Indicates whether the market only allows isolated margin. - * @type {boolean} - * @memberof Market + * + * @type {OrderStatus} + * @memberof OpenOrderResponse */ - 'isolatedOnly': boolean; -} - - -/** - * - * @export - * @enum {string} - */ - -export const MarketDataStreamName = { - RecentTrade: 'Recent_Trade', - Ticker: 'Ticker', - TickerAll: 'Ticker_All', - DiffDepth10Ms: 'Diff_Depth_10_ms', - DiffDepth200Ms: 'Diff_Depth_200_ms', - DiffDepth500Ms: 'Diff_Depth_500_ms', - PartialDepth5: 'Partial_Depth_5', - PartialDepth10: 'Partial_Depth_10', - PartialDepth20: 'Partial_Depth_20', - OraclePrice: 'Oracle_Price', - MarkPrice: 'Mark_Price', - MarketPrice: 'Market_Price', - Candlestick1mLast: 'Candlestick_1m_Last', - Candlestick3mLast: 'Candlestick_3m_Last', - Candlestick5mLast: 'Candlestick_5m_Last', - Candlestick15mLast: 'Candlestick_15m_Last', - Candlestick30mLast: 'Candlestick_30m_Last', - Candlestick1hLast: 'Candlestick_1h_Last', - Candlestick2hLast: 'Candlestick_2h_Last', - Candlestick4hLast: 'Candlestick_4h_Last', - Candlestick6hLast: 'Candlestick_6h_Last', - Candlestick8hLast: 'Candlestick_8h_Last', - Candlestick12hLast: 'Candlestick_12h_Last', - Candlestick1dLast: 'Candlestick_1d_Last', - Candlestick1wLast: 'Candlestick_1w_Last', - Candlestick1MoLast: 'Candlestick_1Mo_Last', - Candlestick1mOracle: 'Candlestick_1m_Oracle', - Candlestick3mOracle: 'Candlestick_3m_Oracle', - Candlestick5mOracle: 'Candlestick_5m_Oracle', - Candlestick15mOracle: 'Candlestick_15m_Oracle', - Candlestick30mOracle: 'Candlestick_30m_Oracle', - Candlestick1hOracle: 'Candlestick_1h_Oracle', - Candlestick2hOracle: 'Candlestick_2h_Oracle', - Candlestick4hOracle: 'Candlestick_4h_Oracle', - Candlestick6hOracle: 'Candlestick_6h_Oracle', - Candlestick8hOracle: 'Candlestick_8h_Oracle', - Candlestick12hOracle: 'Candlestick_12h_Oracle', - Candlestick1dOracle: 'Candlestick_1d_Oracle', - Candlestick1wOracle: 'Candlestick_1w_Oracle', - Candlestick1MoOracle: 'Candlestick_1Mo_Oracle', - Candlestick1mMark: 'Candlestick_1m_Mark', - Candlestick3mMark: 'Candlestick_3m_Mark', - Candlestick5mMark: 'Candlestick_5m_Mark', - Candlestick15mMark: 'Candlestick_15m_Mark', - Candlestick30mMark: 'Candlestick_30m_Mark', - Candlestick1hMark: 'Candlestick_1h_Mark', - Candlestick2hMark: 'Candlestick_2h_Mark', - Candlestick4hMark: 'Candlestick_4h_Mark', - Candlestick6hMark: 'Candlestick_6h_Mark', - Candlestick8hMark: 'Candlestick_8h_Mark', - Candlestick12hMark: 'Candlestick_12h_Mark', - Candlestick1dMark: 'Candlestick_1d_Mark', - Candlestick1wMark: 'Candlestick_1w_Mark', - Candlestick1MoMark: 'Candlestick_1Mo_Mark', - Candlestick1mMarket: 'Candlestick_1m_Market', - Candlestick3mMarket: 'Candlestick_3m_Market', - Candlestick5mMarket: 'Candlestick_5m_Market', - Candlestick15mMarket: 'Candlestick_15m_Market', - Candlestick30mMarket: 'Candlestick_30m_Market', - Candlestick1hMarket: 'Candlestick_1h_Market', - Candlestick2hMarket: 'Candlestick_2h_Market', - Candlestick4hMarket: 'Candlestick_4h_Market', - Candlestick6hMarket: 'Candlestick_6h_Market', - Candlestick8hMarket: 'Candlestick_8h_Market', - Candlestick12hMarket: 'Candlestick_12h_Market', - Candlestick1dMarket: 'Candlestick_1d_Market', - Candlestick1wMarket: 'Candlestick_1w_Market', - Candlestick1MoMarket: 'Candlestick_1Mo_Market' -} as const; - -export type MarketDataStreamName = typeof MarketDataStreamName[keyof typeof MarketDataStreamName]; + 'status': OrderStatus; + /** + * + * @type {SelfTradePreventionType} + * @memberof OpenOrderResponse + */ + 'selfTradePreventionType': SelfTradePreventionType; + /** + * + * @type {OrderTwapConfig} + * @memberof OpenOrderResponse + */ + 'twapConfig'?: OrderTwapConfig; + /** + * The timestamp in millis when the order was opened + * @type {number} + * @memberof OpenOrderResponse + */ + 'orderTimeAtMillis': number; + /** + * The timestamp in millis that this order was last updated (including status updates) + * @type {number} + * @memberof OpenOrderResponse + */ + 'updatedAtMillis': number; +} /** - * The type of event communicated in the WebSocket message. + * * @export - * @enum {string} + * @interface Operators */ - -export const MarketEventType = { - RecentTradesUpdates: 'RecentTradesUpdates', - TickerUpdate: 'TickerUpdate', - TickerAllUpdate: 'TickerAllUpdate', - OraclePriceUpdate: 'OraclePriceUpdate', - MarkPriceUpdate: 'MarkPriceUpdate', - MarketPriceUpdate: 'MarketPriceUpdate', - CandlestickUpdate: 'CandlestickUpdate', - OrderbookDiffDepthUpdate: 'OrderbookDiffDepthUpdate', - OrderbookPartialDepthUpdate: 'OrderbookPartialDepthUpdate' -} as const; - -export type MarketEventType = typeof MarketEventType[keyof typeof MarketEventType]; - - +export interface Operators { + /** + * Admin operator address + * @type {string} + * @memberof Operators + */ + 'admin': string; + /** + * General operator address; AKA Guardian + * @type {string} + * @memberof Operators + * @deprecated + */ + 'operator': string; + /** + * Sequencer operator address + * @type {string} + * @memberof Operators + */ + 'sequencer': string; + /** + * Funding operator address + * @type {string} + * @memberof Operators + * @deprecated + */ + 'funding': string; + /** + * Fee operator address + * @type {string} + * @memberof Operators + * @deprecated + */ + 'fee': string; +} /** * * @export - * @interface MarketPriceUpdate + * @interface OraclePriceUpdate */ -export interface MarketPriceUpdate { +export interface OraclePriceUpdate { /** * The symbol of the market. * @type {string} - * @memberof MarketPriceUpdate + * @memberof OraclePriceUpdate */ 'symbol': string; /** * The price in scientific notation with 9 decimal places of precision. * @type {string} - * @memberof MarketPriceUpdate + * @memberof OraclePriceUpdate */ 'priceE9': string; /** * * @type {string} - * @memberof MarketPriceUpdate + * @memberof OraclePriceUpdate */ - 'source': MarketPriceUpdateSourceEnum; + 'source': OraclePriceUpdateSourceEnum; /** * The timestamp of the price update. * @type {number} - * @memberof MarketPriceUpdate + * @memberof OraclePriceUpdate */ 'updatedAtMillis': number; } -export const MarketPriceUpdateSourceEnum = { - Market: 'Market' +export const OraclePriceUpdateSourceEnum = { + Oracle: 'Oracle' } as const; -export type MarketPriceUpdateSourceEnum = typeof MarketPriceUpdateSourceEnum[keyof typeof MarketPriceUpdateSourceEnum]; +export type OraclePriceUpdateSourceEnum = typeof OraclePriceUpdateSourceEnum[keyof typeof OraclePriceUpdateSourceEnum]; /** - * + * The reason for an order cancellation. * @export * @enum {string} */ -export const MarketStatus = { - Active: 'ACTIVE', - Beta: 'BETA', - Maintenance: 'MAINTENANCE', - Delisted: 'DELISTED', - Unspecified: 'UNSPECIFIED' +export const OrderCancelReason = { + Unspecified: 'UNSPECIFIED', + InsufficientMargin: 'INSUFFICIENT_MARGIN', + DuplicateOrder: 'DUPLICATE_ORDER', + PostOnlyWouldTrade: 'POST_ONLY_WOULD_TRADE', + InvalidSymbol: 'INVALID_SYMBOL', + SignedAtTooOld: 'SIGNED_AT_TOO_OLD', + OrderExpired: 'ORDER_EXPIRED', + InvalidLeverage: 'INVALID_LEVERAGE', + InvalidInput: 'INVALID_INPUT', + PriceOutOfBound: 'PRICE_OUT_OF_BOUND', + QuantityOutOfBound: 'QUANTITY_OUT_OF_BOUND', + PriceOutOfTickSize: 'PRICE_OUT_OF_TICK_SIZE', + QuantityOutOfStepSize: 'QUANTITY_OUT_OF_STEP_SIZE', + ReduceOnlyWouldOpen: 'REDUCE_ONLY_WOULD_OPEN', + TooManyOpenOrdersOnMarket: 'TOO_MANY_OPEN_ORDERS_ON_MARKET', + UserCancelled: 'USER_CANCELLED', + UserCancelledAllOnMarket: 'USER_CANCELLED_ALL_ON_MARKET', + SelfTradePrevention: 'SELF_TRADE_PREVENTION', + LeverageUpdate: 'LEVERAGE_UPDATE', + AccountNotFound: 'ACCOUNT_NOT_FOUND', + MarketNotTrading: 'MARKET_NOT_TRADING', + InsufficientLiquidity: 'INSUFFICIENT_LIQUIDITY', + PositionNotFound: 'POSITION_NOT_FOUND', + LiquidationOutOfOrder: 'LIQUIDATION_OUT_OF_ORDER', + AccountNotLiquidatable: 'ACCOUNT_NOT_LIQUIDATABLE', + OrderNotReducingPosition: 'ORDER_NOT_REDUCING_POSITION', + UserCancelledAllStandbyOnMarket: 'USER_CANCELLED_ALL_STANDBY_ON_MARKET', + PositionExceedsMaxOpenInterest: 'POSITION_EXCEEDS_MAX_OPEN_INTEREST', + AccountDeauthorized: 'ACCOUNT_DEAUTHORIZED', + TooManyMatches: 'TOO_MANY_MATCHES', + MarginCall: 'MARGIN_CALL', + InsufficientBalance: 'INSUFFICIENT_BALANCE', + TradeQuantityOutOfBound: 'TRADE_QUANTITY_OUT_OF_BOUND', + MarketTakeBoundBreached: 'MARKET_TAKE_BOUND_BREACHED', + OrdersExceedMaxOpenInterest: 'ORDERS_EXCEED_MAX_OPEN_INTEREST' } as const; -export type MarketStatus = typeof MarketStatus[keyof typeof MarketStatus]; +export type OrderCancelReason = typeof OrderCancelReason[keyof typeof OrderCancelReason]; /** - * A market stream message containing an event type and a payload. The payload structure depends on the event type. + * The reason for failure to cancel an order. * @export - * @interface MarketStreamMessage + * @enum {string} */ -export interface MarketStreamMessage { - /** - * - * @type {MarketEventType} - * @memberof MarketStreamMessage - */ - 'event': MarketEventType; - /** - * - * @type {MarketStreamMessagePayload} - * @memberof MarketStreamMessage - */ - 'payload': MarketStreamMessagePayload; -} +export const OrderCancellationFailureReason = { + OrderNotFound: 'ORDER_NOT_FOUND', + MarketNotFound: 'MARKET_NOT_FOUND', + AccountNotFound: 'ACCOUNT_NOT_FOUND', + NoOpenOrdersOnMarket: 'NO_OPEN_ORDERS_ON_MARKET', + NoFailure: 'NO_FAILURE', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderCancellationFailureReason = typeof OrderCancellationFailureReason[keyof typeof OrderCancellationFailureReason]; -/** - * @type MarketStreamMessagePayload - * The payload of the message, which varies based on the event type. - * @export - */ -export type MarketStreamMessagePayload = CandlestickUpdate | MarkPriceUpdate | MarketPriceUpdate | OraclePriceUpdate | OrderbookDiffDepthUpdate | OrderbookPartialDepthUpdate | RecentTradesUpdates | TickerAllUpdate | TickerUpdate; /** - * Subscription message for market data streams. + * Details of an order cancellation. * @export - * @interface MarketSubscriptionMessage + * @interface OrderCancellationUpdate */ -export interface MarketSubscriptionMessage { +export interface OrderCancellationUpdate { /** - * - * @type {SubscriptionType} - * @memberof MarketSubscriptionMessage + * The unique hash of the order. + * @type {string} + * @memberof OrderCancellationUpdate */ - 'method': SubscriptionType; + 'orderHash': string; /** - * List of market data streams to subscribe or unsubscribe from. - * @type {Array} - * @memberof MarketSubscriptionMessage + * The client-provided order ID. + * @type {string} + * @memberof OrderCancellationUpdate */ - 'dataStreams': Array; -} - - -/** - * Represents the type of market data stream and its parameters. - * @export - * @interface MarketSubscriptionStreams - */ -export interface MarketSubscriptionStreams { + 'clientOrderId'?: string; /** - * The symbol of the market stream to subscribe to (Leave empty for TickerAll stream) + * The symbol of the market. * @type {string} - * @memberof MarketSubscriptionStreams + * @memberof OrderCancellationUpdate */ 'symbol': string; + /** + * The address of the account. + * @type {string} + * @memberof OrderCancellationUpdate + */ + 'accountAddress': string; + /** + * The timestamp of the order creation in milliseconds. + * @type {number} + * @memberof OrderCancellationUpdate + */ + 'createdAtMillis': number; /** * - * @type {Array} - * @memberof MarketSubscriptionStreams + * @type {OrderCancelReason} + * @memberof OrderCancellationUpdate */ - 'streams': Array; + 'cancellationReason': OrderCancelReason; + /** + * + * @type {OrderCancellationFailureReason} + * @memberof OrderCancellationUpdate + */ + 'failureToCancelReason'?: OrderCancellationFailureReason; + /** + * The remaining quantity of the order. + * @type {string} + * @memberof OrderCancellationUpdate + */ + 'remainingQuantityE9': string; } + + /** - * + * Side of the order * @export - * @interface ModelError + * @enum {string} */ -export interface ModelError { + +export const OrderSide = { + Long: 'LONG', + Short: 'SHORT', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderSide = typeof OrderSide[keyof typeof OrderSide]; + + +/** + * The current status of the order. + * @export + * @enum {string} + */ + +export const OrderStatus = { + Standby: 'STANDBY', + Open: 'OPEN', + PartiallyFilledOpen: 'PARTIALLY_FILLED_OPEN', + PartiallyFilledCanceled: 'PARTIALLY_FILLED_CANCELED', + Filled: 'FILLED', + Cancelled: 'CANCELLED', + Expired: 'EXPIRED', + PartiallyFilledExpired: 'PARTIALLY_FILLED_EXPIRED', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderStatus = typeof OrderStatus[keyof typeof OrderStatus]; + + +/** + * The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill + * @export + * @enum {string} + */ + +export const OrderTimeInForce = { + Gtt: 'GTT', + Ioc: 'IOC', + Fok: 'FOK', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderTimeInForce = typeof OrderTimeInForce[keyof typeof OrderTimeInForce]; + + +/** + * Configuration for Time-Weighted Average Price orders + * @export + * @interface OrderTwapConfig + */ +export interface OrderTwapConfig { /** - * A code representing the type of error. + * Number of sub-orders to split the total quantity into * @type {string} - * @memberof ModelError + * @memberof OrderTwapConfig */ - 'errorCode'?: string; + 'subOrdersCount'?: string; /** - * A human-readable message describing the error. + * Total time in minutes over which to execute the TWAP order * @type {string} - * @memberof ModelError - */ - 'message': string; - /** - * Additional structured details about the error. - * @type {{ [key: string]: any | undefined; }} - * @memberof ModelError + * @memberof OrderTwapConfig */ - 'details'?: { [key: string]: any | undefined; }; + 'runningTimeInMinutes'?: string; } +/** + * The type of order. (BANKRUPTCY_LIQUIDATION is deprecated) + * @export + * @enum {string} + */ + +export const OrderType = { + Limit: 'LIMIT', + Market: 'MARKET', + StopLimit: 'STOP_LIMIT', + StopMarket: 'STOP_MARKET', + Liquidation: 'LIQUIDATION', + StopLossMarket: 'STOP_LOSS_MARKET', + TakeProfitMarket: 'TAKE_PROFIT_MARKET', + StopLossLimit: 'STOP_LOSS_LIMIT', + TakeProfitLimit: 'TAKE_PROFIT_LIMIT', + BankruptcyLiquidation: 'BANKRUPTCY_LIQUIDATION', + TimeWeightedAveragePrice: 'TIME_WEIGHTED_AVERAGE_PRICE', + Adl: 'ADL', + Unspecified: 'UNSPECIFIED' +} as const; + +export type OrderType = typeof OrderType[keyof typeof OrderType]; + + /** * * @export - * @interface OnboardAffiliateRequest + * @interface OrderbookDepthResponse */ -export interface OnboardAffiliateRequest { +export interface OrderbookDepthResponse { /** - * Referral code of the parent affiliate + * Market symbol. * @type {string} - * @memberof OnboardAffiliateRequest + * @memberof OrderbookDepthResponse */ - 'parentReferralCode'?: string | null; + 'symbol': string; /** - * Name of the applicant - * @type {string} - * @memberof OnboardAffiliateRequest + * Count indicating the number of changes in orderbook state. + * @type {number} + * @memberof OrderbookDepthResponse */ - 'name': string; + 'lastUpdateId': number; /** - * Email address of the applicant - * @type {string} - * @memberof OnboardAffiliateRequest + * Timestamp at which the last change in orderbook state took place, in milliseconds. + * @type {number} + * @memberof OrderbookDepthResponse */ - 'email': string; + 'updatedAtMillis': number; /** - * - * @type {OnboardAffiliateRequestSocialUserNames} - * @memberof OnboardAffiliateRequest + * The time at which the orderbook server sent the response, in milliseconds. + * @type {number} + * @memberof OrderbookDepthResponse */ - 'socialUserNames'?: OnboardAffiliateRequestSocialUserNames; -} -/** - * Map of social media usernames - * @export - * @interface OnboardAffiliateRequestSocialUserNames - */ -export interface OnboardAffiliateRequestSocialUserNames { + 'responseSentAtMillis': number; /** - * Twitter username + * The best bid price on orderbook at the moment (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof OrderbookDepthResponse */ - 'twitter'?: string; + 'bestBidPriceE9': string; /** - * Instagram username + * The best bid quantity on orderbook at the moment (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof OrderbookDepthResponse */ - 'instagram'?: string; + 'bestBidQuantityE9': string; /** - * YouTube channel name + * The best ask price on orderbook at the moment (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof OrderbookDepthResponse */ - 'youtube'?: string; + 'bestAskPriceE9': string; /** - * TikTok username + * The best ask quantity on orderbook at the moment (e9 format). * @type {string} - * @memberof OnboardAffiliateRequestSocialUserNames + * @memberof OrderbookDepthResponse */ - 'tiktok'?: string; -} -/** - * - * @export - * @interface OnboardRefereeRequest - */ -export interface OnboardRefereeRequest { + 'bestAskQuantityE9': string; /** - * Referral code of the parent affiliate - * @type {string} - * @memberof OnboardRefereeRequest + * Bids to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. + * @type {Array>} + * @memberof OrderbookDepthResponse */ - 'code': string; + 'bidsE9': Array>; + /** + * Asks to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. + * @type {Array>} + * @memberof OrderbookDepthResponse + */ + 'asksE9': Array>; } /** * * @export - * @interface OpenOrderResponse + * @interface OrderbookDiffDepthUpdate */ -export interface OpenOrderResponse { +export interface OrderbookDiffDepthUpdate { /** - * The Order Hash, which is the default way to uniquely identify an order in the system - * @type {string} - * @memberof OpenOrderResponse - */ - 'orderHash': string; - /** - * The Client Order ID, which is used a unique identifier for an order, provided by the client, in case of proprietary order management systems - * @type {string} - * @memberof OpenOrderResponse + * The timestamp of the orderbook update. + * @type {number} + * @memberof OrderbookDiffDepthUpdate */ - 'clientOrderId'?: string; + 'updatedAtMillis': number; /** - * The market symbol + * The symbol of the market for the orderbook update. * @type {string} - * @memberof OpenOrderResponse + * @memberof OrderbookDiffDepthUpdate */ 'symbol': string; /** - * The account address of the order. May be an account user is authorized for. - * @type {string} - * @memberof OpenOrderResponse + * + * @type {Array>} + * @memberof OrderbookDiffDepthUpdate */ - 'accountAddress': string; + 'bidsE9': Array>; /** - * The signer address of the order. May be an account user is authorized for. - * @type {string} - * @memberof OpenOrderResponse + * + * @type {Array>} + * @memberof OrderbookDiffDepthUpdate */ - 'signerAddress': string; + 'asksE9': Array>; /** - * The price in base e9 of the asset to be traded. Should always be a number - * @type {string} - * @memberof OpenOrderResponse + * The ID of the first update in this batch. + * @type {number} + * @memberof OrderbookDiffDepthUpdate */ - 'priceE9': string; + 'firstUpdateId': number; /** - * The quantity in base e9 of the asset to be traded. Should always be a number - * @type {string} - * @memberof OpenOrderResponse + * The ID of the last update in this batch. + * @type {number} + * @memberof OrderbookDiffDepthUpdate */ - 'quantityE9': string; + 'lastUpdateId': number; +} +/** + * + * @export + * @interface OrderbookPartialDepthUpdate + */ +export interface OrderbookPartialDepthUpdate { /** - * - * @type {OrderSide} - * @memberof OpenOrderResponse + * The timestamp of the partial depth update. + * @type {number} + * @memberof OrderbookPartialDepthUpdate */ - 'side': OrderSide; + 'updatedAtMillis': number; /** - * The leverage in base e9 of the order to be traded. Should always be a number + * The symbol of the market for the partial depth update. * @type {string} - * @memberof OpenOrderResponse + * @memberof OrderbookPartialDepthUpdate */ - 'leverageE9': string; + 'symbol': string; /** - * Is this order isolated or cross margin. Note market must be set to the same mode. - * @type {boolean} - * @memberof OpenOrderResponse + * + * @type {Array>} + * @memberof OrderbookPartialDepthUpdate */ - 'isIsolated': boolean; + 'bidsE9': Array>; /** - * The random generated SALT. Should always be a number - * @type {string} - * @memberof OpenOrderResponse + * + * @type {Array>} + * @memberof OrderbookPartialDepthUpdate */ - 'salt': string; + 'asksE9': Array>; /** - * Unix timestamp in millis at which order will expire. Defaults to 1 month for LIMIT orders if not provided + * The unique identifier for the orderbook update. * @type {number} - * @memberof OpenOrderResponse + * @memberof OrderbookPartialDepthUpdate */ - 'expiresAtMillis': number; + 'orderbookUpdateId': number; /** - * The timestamp in millis at which the request was signed - * @type {number} - * @memberof OpenOrderResponse + * The depth level of the orderbook snapshot. + * @type {string} + * @memberof OrderbookPartialDepthUpdate */ - 'signedAtMillis': number; + 'depthLevel': OrderbookPartialDepthUpdateDepthLevelEnum; +} + +export const OrderbookPartialDepthUpdateDepthLevelEnum = { + _5: '5', + _10: '10', + _20: '20' +} as const; + +export type OrderbookPartialDepthUpdateDepthLevelEnum = typeof OrderbookPartialDepthUpdateDepthLevelEnum[keyof typeof OrderbookPartialDepthUpdateDepthLevelEnum]; + +/** + * + * @export + * @interface Position + */ +export interface Position { /** - * - * @type {OrderType} - * @memberof OpenOrderResponse + * Market address. + * @type {string} + * @memberof Position */ - 'type': OrderType; + 'symbol': string; /** - * Is this order to only reduce a position? Default false - * @type {boolean} - * @memberof OpenOrderResponse + * Average entry price determined by a simple average of all entry prices resulting in this position size (e9 format). + * @type {string} + * @memberof Position */ - 'reduceOnly': boolean; + 'avgEntryPriceE9': string; /** - * If set to TRUE, the order can only be a maker order - * @type {boolean} - * @memberof OpenOrderResponse + * Isolated position leverage (e9 format). + * @type {string} + * @memberof Position */ - 'postOnly': boolean; + 'clientSetLeverageE9': string; /** - * - * @type {OrderTimeInForce} - * @memberof OpenOrderResponse + * Liquidation price (e9 format). + * @type {string} + * @memberof Position */ - 'timeInForce': OrderTimeInForce; + 'liquidationPriceE9': string; /** - * Trigger price in base e9 for stop orders. This should always be a number + * Mark price (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Position */ - 'triggerPriceE9'?: string; + 'markPriceE9': string; /** - * The quantity in base e9 of the asset currently filled. This should always be a number + * Notional value (e9 format). * @type {string} - * @memberof OpenOrderResponse + * @memberof Position */ - 'filledQuantityE9': string; + 'notionalValueE9': string; /** - * - * @type {OrderStatus} - * @memberof OpenOrderResponse + * Position size (e9 format). + * @type {string} + * @memberof Position */ - 'status': OrderStatus; + 'sizeE9': string; /** - * - * @type {SelfTradePreventionType} - * @memberof OpenOrderResponse + * Unrealized profit (e9 format). + * @type {string} + * @memberof Position */ - 'selfTradePreventionType': SelfTradePreventionType; + 'unrealizedPnlE9': string; /** * - * @type {OrderTwapConfig} - * @memberof OpenOrderResponse + * @type {PositionSide} + * @memberof Position */ - 'twapConfig'?: OrderTwapConfig; + 'side': PositionSide; /** - * The timestamp in millis when the order was opened - * @type {number} - * @memberof OpenOrderResponse + * Initial margin required with current mark price (e9 format). + * @type {string} + * @memberof Position */ - 'orderTimeAtMillis': number; + 'marginRequiredE9': string; /** - * The timestamp in millis that this order was last updated (including status updates) - * @type {number} - * @memberof OpenOrderResponse + * Maintenance margin required with current mark price (e9 format). + * @type {string} + * @memberof Position */ - 'updatedAtMillis': number; -} - - -/** - * - * @export - * @interface Operators - */ -export interface Operators { + 'maintenanceMarginE9': string; /** - * Admin operator address - * @type {string} - * @memberof Operators + * If the position is isolated. + * @type {boolean} + * @memberof Position */ - 'admin': string; + 'isIsolated': boolean; /** - * General operator address; AKA Guardian + * Margin value present if margin type is isolated (e9 format). * @type {string} - * @memberof Operators - * @deprecated + * @memberof Position */ - 'operator': string; + 'isolatedMarginE9': string; /** - * Sequencer operator address + * Last update time. + * @type {number} + * @memberof Position + */ + 'updatedAtMillis': number; + /** + * Total funding rate payment (e9 format). * @type {string} - * @memberof Operators + * @memberof Position */ - 'sequencer': string; + 'fundingRatePaymentAllTimeE9': string; /** - * Funding operator address + * Funding rate payment since last position change (e9 format). * @type {string} - * @memberof Operators - * @deprecated + * @memberof Position */ - 'funding': string; + 'fundingRatePaymentSinceChangeE9': string; /** - * Fee operator address + * Funding rate payment since position opened (e9 format). * @type {string} - * @memberof Operators - * @deprecated + * @memberof Position */ - 'fee': string; + 'fundingRatePaymentSinceOpenedE9': string; } + + /** - * + * The side of the position, either long or short * @export - * @interface OraclePriceUpdate + * @enum {string} */ -export interface OraclePriceUpdate { - /** - * The symbol of the market. - * @type {string} - * @memberof OraclePriceUpdate - */ - 'symbol': string; + +export const PositionSide = { + Long: 'LONG', + Short: 'SHORT', + Unspecified: 'UNSPECIFIED' +} as const; + +export type PositionSide = typeof PositionSide[keyof typeof PositionSide]; + + +/** + * The generated zero-knowledge proof points. + * @export + * @interface ProofPoints + */ +export interface ProofPoints { /** - * The price in scientific notation with 9 decimal places of precision. - * @type {string} - * @memberof OraclePriceUpdate + * Point A of the proof. + * @type {Array} + * @memberof ProofPoints */ - 'priceE9': string; + 'a': Array; /** - * - * @type {string} - * @memberof OraclePriceUpdate + * Point B of the proof. + * @type {Array>} + * @memberof ProofPoints */ - 'source': OraclePriceUpdateSourceEnum; + 'b': Array>; /** - * The timestamp of the price update. - * @type {number} - * @memberof OraclePriceUpdate + * Point C of the proof. + * @type {Array} + * @memberof ProofPoints */ - 'updatedAtMillis': number; + 'c': Array; } - -export const OraclePriceUpdateSourceEnum = { - Oracle: 'Oracle' -} as const; - -export type OraclePriceUpdateSourceEnum = typeof OraclePriceUpdateSourceEnum[keyof typeof OraclePriceUpdateSourceEnum]; - /** - * The reason for an order cancellation. + * * @export - * @enum {string} + * @interface RecentTradesUpdates */ - -export const OrderCancelReason = { - Unspecified: 'UNSPECIFIED', - InsufficientMargin: 'INSUFFICIENT_MARGIN', - DuplicateOrder: 'DUPLICATE_ORDER', - PostOnlyWouldTrade: 'POST_ONLY_WOULD_TRADE', - InvalidSymbol: 'INVALID_SYMBOL', - SignedAtTooOld: 'SIGNED_AT_TOO_OLD', - OrderExpired: 'ORDER_EXPIRED', - InvalidLeverage: 'INVALID_LEVERAGE', - InvalidInput: 'INVALID_INPUT', - PriceOutOfBound: 'PRICE_OUT_OF_BOUND', - QuantityOutOfBound: 'QUANTITY_OUT_OF_BOUND', - PriceOutOfTickSize: 'PRICE_OUT_OF_TICK_SIZE', - QuantityOutOfStepSize: 'QUANTITY_OUT_OF_STEP_SIZE', - ReduceOnlyWouldOpen: 'REDUCE_ONLY_WOULD_OPEN', - TooManyOpenOrdersOnMarket: 'TOO_MANY_OPEN_ORDERS_ON_MARKET', - UserCancelled: 'USER_CANCELLED', - UserCancelledAllOnMarket: 'USER_CANCELLED_ALL_ON_MARKET', - SelfTradePrevention: 'SELF_TRADE_PREVENTION', - LeverageUpdate: 'LEVERAGE_UPDATE', - AccountNotFound: 'ACCOUNT_NOT_FOUND', - MarketNotTrading: 'MARKET_NOT_TRADING', - InsufficientLiquidity: 'INSUFFICIENT_LIQUIDITY', - PositionNotFound: 'POSITION_NOT_FOUND', - LiquidationOutOfOrder: 'LIQUIDATION_OUT_OF_ORDER', - AccountNotLiquidatable: 'ACCOUNT_NOT_LIQUIDATABLE', - OrderNotReducingPosition: 'ORDER_NOT_REDUCING_POSITION', - UserCancelledAllStandbyOnMarket: 'USER_CANCELLED_ALL_STANDBY_ON_MARKET', - PositionExceedsMaxOpenInterest: 'POSITION_EXCEEDS_MAX_OPEN_INTEREST', - AccountDeauthorized: 'ACCOUNT_DEAUTHORIZED', - TooManyMatches: 'TOO_MANY_MATCHES', - MarginCall: 'MARGIN_CALL', - InsufficientBalance: 'INSUFFICIENT_BALANCE', - TradeQuantityOutOfBound: 'TRADE_QUANTITY_OUT_OF_BOUND', - MarketTakeBoundBreached: 'MARKET_TAKE_BOUND_BREACHED', - OrdersExceedMaxOpenInterest: 'ORDERS_EXCEED_MAX_OPEN_INTEREST' -} as const; - -export type OrderCancelReason = typeof OrderCancelReason[keyof typeof OrderCancelReason]; - - +export interface RecentTradesUpdates { + /** + * + * @type {Array} + * @memberof RecentTradesUpdates + */ + 'trades': Array; +} /** - * The reason for failure to cancel an order. + * * @export - * @enum {string} + * @interface RefereeOnboardResponse */ - -export const OrderCancellationFailureReason = { - OrderNotFound: 'ORDER_NOT_FOUND', - MarketNotFound: 'MARKET_NOT_FOUND', - AccountNotFound: 'ACCOUNT_NOT_FOUND', - NoOpenOrdersOnMarket: 'NO_OPEN_ORDERS_ON_MARKET', - NoFailure: 'NO_FAILURE', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderCancellationFailureReason = typeof OrderCancellationFailureReason[keyof typeof OrderCancellationFailureReason]; - - +export interface RefereeOnboardResponse { + /** + * Response message indicating if the referral code exists + * @type {string} + * @memberof RefereeOnboardResponse + */ + 'message': string; +} /** - * Details of an order cancellation. + * * @export - * @interface OrderCancellationUpdate + * @interface RefreshTokenRequest */ -export interface OrderCancellationUpdate { +export interface RefreshTokenRequest { /** - * The unique hash of the order. + * * @type {string} - * @memberof OrderCancellationUpdate + * @memberof RefreshTokenRequest */ - 'orderHash': string; + 'refreshToken': string; +} +/** + * + * @export + * @interface RefreshTokenResponse + */ +export interface RefreshTokenResponse { /** - * The client-provided order ID. + * * @type {string} - * @memberof OrderCancellationUpdate + * @memberof RefreshTokenResponse */ - 'clientOrderId'?: string; + 'accessToken': string; /** - * The symbol of the market. - * @type {string} - * @memberof OrderCancellationUpdate + * + * @type {number} + * @memberof RefreshTokenResponse */ - 'symbol': string; + 'accessTokenValidForSeconds': number; /** - * The address of the account. + * * @type {string} - * @memberof OrderCancellationUpdate + * @memberof RefreshTokenResponse */ - 'accountAddress': string; + 'refreshToken': string; /** - * The timestamp of the order creation in milliseconds. + * * @type {number} - * @memberof OrderCancellationUpdate + * @memberof RefreshTokenResponse */ - 'createdAtMillis': number; + 'refreshTokenValidForSeconds': number; +} +/** + * + * @export + * @interface RewardsPoolEntry + */ +export interface RewardsPoolEntry { /** * - * @type {OrderCancelReason} - * @memberof OrderCancellationUpdate + * @type {string} + * @memberof RewardsPoolEntry */ - 'cancellationReason': OrderCancelReason; + 'id'?: string; /** * - * @type {OrderCancellationFailureReason} - * @memberof OrderCancellationUpdate + * @type {string} + * @memberof RewardsPoolEntry */ - 'failureToCancelReason'?: OrderCancellationFailureReason; + 'coin'?: string; +} +/** + * + * @export + * @interface RewardsSummary + */ +export interface RewardsSummary { /** - * The remaining quantity of the order. + * User address for the rewards earned data. * @type {string} - * @memberof OrderCancellationUpdate + * @memberof RewardsSummary */ - 'remainingQuantityE9': string; + 'UserAddress': string; + /** + * Total Blue token rewards earned by the user (e9 format). + * @type {string} + * @memberof RewardsSummary + */ + 'BlueRewardsE9': string; + /** + * Total Sui token rewards earned by the user (e9 format). + * @type {string} + * @memberof RewardsSummary + */ + 'SuiRewardsE9': string; + /** + * Total wal rewards earned by the user (e9 format). + * @type {string} + * @memberof RewardsSummary + */ + 'WalRewardsE9': string; } - - /** - * Side of the order + * The strategy used to resolve self trades. TAKER: On a self trade, the taker order will be cancelled MAKER: On a self trade, the maker order will be cancelled BOTH: On a self trade, both the taker and the maker order will be cancelled UNSPECIFIED: set to default value * @export * @enum {string} */ -export const OrderSide = { - Long: 'LONG', - Short: 'SHORT', +export const SelfTradePreventionType = { + Taker: 'TAKER', + Maker: 'MAKER', + Both: 'BOTH', Unspecified: 'UNSPECIFIED' } as const; -export type OrderSide = typeof OrderSide[keyof typeof OrderSide]; +export type SelfTradePreventionType = typeof SelfTradePreventionType[keyof typeof SelfTradePreventionType]; /** - * The current status of the order. + * * @export - * @enum {string} + * @interface SigPayload */ - -export const OrderStatus = { - Standby: 'STANDBY', - Open: 'OPEN', - PartiallyFilledOpen: 'PARTIALLY_FILLED_OPEN', - PartiallyFilledCanceled: 'PARTIALLY_FILLED_CANCELED', - Filled: 'FILLED', - Cancelled: 'CANCELLED', - Expired: 'EXPIRED', - PartiallyFilledExpired: 'PARTIALLY_FILLED_EXPIRED', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderStatus = typeof OrderStatus[keyof typeof OrderStatus]; - - -/** - * The time-in-force policy for the order. By default, all orders are GTT. UNSPECIFIED is set to default. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill - * @export - * @enum {string} - */ - -export const OrderTimeInForce = { - Gtt: 'GTT', - Ioc: 'IOC', - Fok: 'FOK', - Unspecified: 'UNSPECIFIED' -} as const; - -export type OrderTimeInForce = typeof OrderTimeInForce[keyof typeof OrderTimeInForce]; - - -/** - * Configuration for Time-Weighted Average Price orders - * @export - * @interface OrderTwapConfig - */ -export interface OrderTwapConfig { +export interface SigPayload { /** - * Number of sub-orders to split the total quantity into + * Target address for the claim. * @type {string} - * @memberof OrderTwapConfig + * @memberof SigPayload */ - 'subOrdersCount'?: string; + 'target': string; /** - * Total time in minutes over which to execute the TWAP order + * Receiver address for the claim. * @type {string} - * @memberof OrderTwapConfig + * @memberof SigPayload */ - 'runningTimeInMinutes'?: string; + 'receiver': string; + /** + * Amount to be claimed. + * @type {string} + * @memberof SigPayload + */ + 'amount': string; + /** + * Expiry timestamp for the claim. + * @type {string} + * @memberof SigPayload + */ + 'expiry': string; + /** + * Nonce for the claim. + * @type {string} + * @memberof SigPayload + */ + 'nonce': string; + /** + * Type identifier for the claim. + * @type {number} + * @memberof SigPayload + */ + 'type': number; } /** - * The type of order. (BANKRUPTCY_LIQUIDATION is deprecated) + * The order in which results should be sorted. * @export * @enum {string} */ -export const OrderType = { - Limit: 'LIMIT', - Market: 'MARKET', - StopLimit: 'STOP_LIMIT', - StopMarket: 'STOP_MARKET', - Liquidation: 'LIQUIDATION', - StopLossMarket: 'STOP_LOSS_MARKET', - TakeProfitMarket: 'TAKE_PROFIT_MARKET', - StopLossLimit: 'STOP_LOSS_LIMIT', - TakeProfitLimit: 'TAKE_PROFIT_LIMIT', - BankruptcyLiquidation: 'BANKRUPTCY_LIQUIDATION', - TimeWeightedAveragePrice: 'TIME_WEIGHTED_AVERAGE_PRICE', - Adl: 'ADL', +export const SortOrder = { + Asc: 'ASC', + Desc: 'DESC', Unspecified: 'UNSPECIFIED' } as const; -export type OrderType = typeof OrderType[keyof typeof OrderType]; +export type SortOrder = typeof SortOrder[keyof typeof SortOrder]; /** * * @export - * @interface OrderbookDepthResponse + * @interface SponsorTxRequest */ -export interface OrderbookDepthResponse { - /** - * Market symbol. - * @type {string} - * @memberof OrderbookDepthResponse - */ - 'symbol': string; - /** - * Count indicating the number of changes in orderbook state. - * @type {number} - * @memberof OrderbookDepthResponse - */ - 'lastUpdateId': number; - /** - * Timestamp at which the last change in orderbook state took place, in milliseconds. - * @type {number} - * @memberof OrderbookDepthResponse - */ - 'updatedAtMillis': number; - /** - * The time at which the orderbook server sent the response, in milliseconds. - * @type {number} - * @memberof OrderbookDepthResponse - */ - 'responseSentAtMillis': number; +export interface SponsorTxRequest { /** - * The best bid price on orderbook at the moment (e9 format). + * Base64 encoded transaction bytes to be sponsored. To create txBytes: 1. Create a TransactionBlock with move calls (e.g., deposit_to_asset_bank) 2. Serialize the TransactionBlock to bytes using BCS (Binary Canonical Serialization) 3. Encode the bytes to base64 string Reference implementation: https://github.com/fireflyprotocol/library-sui/blob/1412fff4d4fe7cf6b7ec04d700e777628c57c70a/src/classes/SuiBlocks.ts#L220 * @type {string} - * @memberof OrderbookDepthResponse + * @memberof SponsorTxRequest */ - 'bestBidPriceE9': string; + 'txBytes': string; +} +/** + * + * @export + * @interface SponsorTxResponse + */ +export interface SponsorTxResponse { /** - * The best bid quantity on orderbook at the moment (e9 format). + * Base64 encoded sponsored transaction bytes * @type {string} - * @memberof OrderbookDepthResponse + * @memberof SponsorTxResponse */ - 'bestBidQuantityE9': string; + 'txBytes': string; /** - * The best ask price on orderbook at the moment (e9 format). + * Transaction digest * @type {string} - * @memberof OrderbookDepthResponse + * @memberof SponsorTxResponse */ - 'bestAskPriceE9': string; + 'txDigest': string; /** - * The best ask quantity on orderbook at the moment (e9 format). + * Transaction signature * @type {string} - * @memberof OrderbookDepthResponse - */ - 'bestAskQuantityE9': string; - /** - * Bids to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. - * @type {Array>} - * @memberof OrderbookDepthResponse + * @memberof SponsorTxResponse */ - 'bidsE9': Array>; + 'signature': string; /** - * Asks to be filled. Index 0 is price, index 1 is quantity at price bin. Prices are in e9 format. - * @type {Array>} - * @memberof OrderbookDepthResponse + * Transaction expiration time in milliseconds since Unix epoch + * @type {number} + * @memberof SponsorTxResponse */ - 'asksE9': Array>; + 'expireAtTime': number; } /** * * @export - * @interface OrderbookDiffDepthUpdate + * @interface StatsAllTimeResponse */ -export interface OrderbookDiffDepthUpdate { +export interface StatsAllTimeResponse { /** - * The timestamp of the orderbook update. + * Timestamp in milliseconds when the statistics period starts. * @type {number} - * @memberof OrderbookDiffDepthUpdate + * @memberof StatsAllTimeResponse */ - 'updatedAtMillis': number; + 'startTimeAtMillis': number; /** - * The symbol of the market for the orderbook update. + * Total value locked in the legacy exchange in e9 format. * @type {string} - * @memberof OrderbookDiffDepthUpdate + * @memberof StatsAllTimeResponse */ - 'symbol': string; + 'legacyTvlE9': string; /** - * - * @type {Array>} - * @memberof OrderbookDiffDepthUpdate + * Total value locked in the exchange in e9 format. + * @type {string} + * @memberof StatsAllTimeResponse */ - 'bidsE9': Array>; + 'tvlE9': string; /** - * - * @type {Array>} - * @memberof OrderbookDiffDepthUpdate + * Total quote asset volume in the legacy exchange in e9 format. + * @type {string} + * @memberof StatsAllTimeResponse */ - 'asksE9': Array>; + 'totalLegacyQuoteAssetVolumeE9': string; /** - * The ID of the first update in this batch. - * @type {number} - * @memberof OrderbookDiffDepthUpdate + * Total quote asset volume in the exchange in e9 format. + * @type {string} + * @memberof StatsAllTimeResponse */ - 'firstUpdateId': number; + 'totalQuoteAssetVolumeE9': string; /** - * The ID of the last update in this batch. + * Timestamp in milliseconds when the statistics period ends. * @type {number} - * @memberof OrderbookDiffDepthUpdate + * @memberof StatsAllTimeResponse */ - 'lastUpdateId': number; + 'endTimeAtMillis': number; } /** * * @export - * @interface OrderbookPartialDepthUpdate + * @interface StatsEntry */ -export interface OrderbookPartialDepthUpdate { +export interface StatsEntry { /** - * The timestamp of the partial depth update. + * Timestamp in milliseconds when the statistics period starts. * @type {number} - * @memberof OrderbookPartialDepthUpdate + * @memberof StatsEntry */ - 'updatedAtMillis': number; + 'startTimeAtMillis': number; /** - * The symbol of the market for the partial depth update. + * Total value locked in the legacy exchange in e9 format. * @type {string} - * @memberof OrderbookPartialDepthUpdate + * @memberof StatsEntry */ - 'symbol': string; + 'legacyTvlE9': string; /** - * - * @type {Array>} - * @memberof OrderbookPartialDepthUpdate + * Total value locked in the exchange in e9 format. + * @type {string} + * @memberof StatsEntry */ - 'bidsE9': Array>; + 'tvlE9': string; /** - * - * @type {Array>} - * @memberof OrderbookPartialDepthUpdate + * Total quote asset volume in the legacy exchange in e9 format. + * @type {string} + * @memberof StatsEntry */ - 'asksE9': Array>; + 'totalLegacyQuoteAssetVolumeE9': string; /** - * The unique identifier for the orderbook update. - * @type {number} - * @memberof OrderbookPartialDepthUpdate + * Total quote asset volume in the exchange in e9 format. + * @type {string} + * @memberof StatsEntry */ - 'orderbookUpdateId': number; + 'totalQuoteAssetVolumeE9': string; /** - * The depth level of the orderbook snapshot. - * @type {string} - * @memberof OrderbookPartialDepthUpdate + * Timestamp in milliseconds when the statistics period ends. + * @type {number} + * @memberof StatsEntry */ - 'depthLevel': OrderbookPartialDepthUpdateDepthLevelEnum; + 'endTimeAtMillis': number; } +/** + * + * @export + * @enum {string} + */ -export const OrderbookPartialDepthUpdateDepthLevelEnum = { - _5: '5', - _10: '10', - _20: '20' +export const StatsInterval = { + _1d: '1d', + _1w: '1w', + _1Mo: '1Mo', + Unspecified: 'UNSPECIFIED' } as const; -export type OrderbookPartialDepthUpdateDepthLevelEnum = typeof OrderbookPartialDepthUpdateDepthLevelEnum[keyof typeof OrderbookPartialDepthUpdateDepthLevelEnum]; +export type StatsInterval = typeof StatsInterval[keyof typeof StatsInterval]; + /** * * @export - * @interface Position + * @interface StatsResponse */ -export interface Position { +export interface StatsResponse { /** - * Market address. - * @type {string} - * @memberof Position + * + * @type {Array} + * @memberof StatsResponse */ - 'symbol': string; + 'data': Array; +} +/** + * Response message indicating the success or failure of a subscription operation. + * @export + * @interface SubscriptionResponseMessage + */ +export interface SubscriptionResponseMessage { /** - * Average entry price determined by a simple average of all entry prices resulting in this position size (e9 format). - * @type {string} - * @memberof Position + * Indicates if the subscription operation was successful. + * @type {boolean} + * @memberof SubscriptionResponseMessage */ - 'avgEntryPriceE9': string; + 'success': boolean; /** - * Isolated position leverage (e9 format). + * Additional information about the subscription operation. * @type {string} - * @memberof Position + * @memberof SubscriptionResponseMessage */ - 'clientSetLeverageE9': string; + 'message': string; +} +/** + * Indicates the type of subscription action. + * @export + * @enum {string} + */ + +export const SubscriptionType = { + Subscribe: 'Subscribe', + Unsubscribe: 'Unsubscribe' +} as const; + +export type SubscriptionType = typeof SubscriptionType[keyof typeof SubscriptionType]; + + +/** + * + * @export + * @interface TickerAllUpdate + */ +export interface TickerAllUpdate { /** - * Liquidation price (e9 format). - * @type {string} - * @memberof Position + * Array of detailed market ticker information for all markets. + * @type {Array} + * @memberof TickerAllUpdate */ - 'liquidationPriceE9': string; + 'tickerAll': Array; +} +/** + * + * @export + * @interface TickerResponse + */ +export interface TickerResponse { /** - * Mark price (e9 format). + * Market symbol. * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'markPriceE9': string; + 'symbol': string; /** - * Notional value (e9 format). + * Last trade quantity (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'notionalValueE9': string; + 'lastQuantityE9': string; /** - * Position size (e9 format). + * Last trade time in milliseconds. + * @type {number} + * @memberof TickerResponse + */ + 'lastTimeAtMillis': number; + /** + * Last trade price (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'sizeE9': string; + 'lastPriceE9': string; /** - * Unrealized profit (e9 format). + * Funding rate value (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'unrealizedPnlE9': string; + 'lastFundingRateE9': string; /** - * - * @type {PositionSide} - * @memberof Position + * Time in milliseconds of next funding rate update. + * @type {number} + * @memberof TickerResponse */ - 'side': PositionSide; + 'nextFundingTimeAtMillis': number; /** - * Initial margin required with current mark price (e9 format). + * 8 hr average funding rate (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'marginRequiredE9': string; + 'avgFundingRate8hrE9': string; /** - * Maintenance margin required with current mark price (e9 format). + * Oracle price of the asset (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'maintenanceMarginE9': string; + 'oraclePriceE9': string; /** - * If the position is isolated. - * @type {boolean} - * @memberof Position + * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * @type {number} + * @memberof TickerResponse */ - 'isIsolated': boolean; + 'oraclePriceDirection': number; /** - * Margin value present if margin type is isolated (e9 format). + * Mark price on the exchange (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'isolatedMarginE9': string; + 'markPriceE9': string; /** - * Last update time. + * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). * @type {number} - * @memberof Position + * @memberof TickerResponse */ - 'updatedAtMillis': number; + 'markPriceDirection': number; /** - * Total funding rate payment (e9 format). + * Simple average of bestBid and bestAsk. lastPrice if either is not present (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'fundingRatePaymentAllTimeE9': string; + 'marketPriceE9': string; /** - * Funding rate payment since last position change (e9 format). - * @type {string} - * @memberof Position + * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). + * @type {number} + * @memberof TickerResponse */ - 'fundingRatePaymentSinceChangeE9': string; + 'marketPriceDirection': number; /** - * Funding rate payment since position opened (e9 format). + * Best bid price (e9 format). * @type {string} - * @memberof Position + * @memberof TickerResponse */ - 'fundingRatePaymentSinceOpenedE9': string; -} - - -/** - * The side of the position, either long or short - * @export - * @enum {string} - */ - -export const PositionSide = { - Long: 'LONG', - Short: 'SHORT', - Unspecified: 'UNSPECIFIED' -} as const; - -export type PositionSide = typeof PositionSide[keyof typeof PositionSide]; - - -/** - * The generated zero-knowledge proof points. - * @export - * @interface ProofPoints - */ -export interface ProofPoints { + 'bestBidPriceE9': string; /** - * Point A of the proof. - * @type {Array} - * @memberof ProofPoints + * Best bid quantity (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'a': Array; + 'bestBidQuantityE9': string; /** - * Point B of the proof. - * @type {Array>} - * @memberof ProofPoints + * Best ask price (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'b': Array>; + 'bestAskPriceE9': string; /** - * Point C of the proof. - * @type {Array} - * @memberof ProofPoints + * Best ask quantity (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'c': Array; -} -/** - * - * @export - * @interface RecentTradesUpdates - */ -export interface RecentTradesUpdates { + 'bestAskQuantityE9': string; /** - * - * @type {Array} - * @memberof RecentTradesUpdates + * Open interest value (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'trades': Array; -} -/** - * - * @export - * @interface RefereeOnboardResponse - */ -export interface RefereeOnboardResponse { + 'openInterestE9': string; /** - * Response message indicating if the referral code exists + * Highest Price in the last 24hrs (e9 format). * @type {string} - * @memberof RefereeOnboardResponse + * @memberof TickerResponse */ - 'message': string; -} -/** - * - * @export - * @interface RefreshTokenRequest - */ -export interface RefreshTokenRequest { + 'highPrice24hrE9': string; /** - * + * Lowest Price in the last 24hrs (e9 format). * @type {string} - * @memberof RefreshTokenRequest + * @memberof TickerResponse */ - 'refreshToken': string; -} -/** - * - * @export - * @interface RefreshTokenResponse - */ -export interface RefreshTokenResponse { + 'lowPrice24hrE9': string; /** - * + * Total market volume in last 24hrs of asset (e9 format). * @type {string} - * @memberof RefreshTokenResponse + * @memberof TickerResponse */ - 'accessToken': string; + 'volume24hrE9': string; /** - * - * @type {number} - * @memberof RefreshTokenResponse + * Total market volume in last 24hrs in USDC (e9 format). + * @type {string} + * @memberof TickerResponse */ - 'accessTokenValidForSeconds': number; + 'quoteVolume24hrE9': string; /** - * + * Close price 24hrs ago (e9 format). * @type {string} - * @memberof RefreshTokenResponse + * @memberof TickerResponse */ - 'refreshToken': string; + 'closePrice24hrE9': string; /** - * + * Open price in the last 24hrs (e9 format). + * @type {string} + * @memberof TickerResponse + */ + 'openPrice24hrE9': string; + /** + * 24 hour close time in milliseconds. * @type {number} - * @memberof RefreshTokenResponse + * @memberof TickerResponse */ - 'refreshTokenValidForSeconds': number; -} -/** - * - * @export - * @interface RewardsPoolEntry - */ -export interface RewardsPoolEntry { + 'closeTime24hrAtMillis': number; /** - * - * @type {string} - * @memberof RewardsPoolEntry + * 24 hour open time in milliseconds. + * @type {number} + * @memberof TickerResponse */ - 'id'?: string; + 'openTime24hrAtMillis': number; /** - * - * @type {string} - * @memberof RewardsPoolEntry + * First trade id in 24hr. + * @type {number} + * @memberof TickerResponse */ - 'coin'?: string; -} -/** - * - * @export - * @interface RewardsSummary - */ -export interface RewardsSummary { + 'firstId24hr': number; /** - * User address for the rewards earned data. + * Last trade id in 24hr. + * @type {number} + * @memberof TickerResponse + */ + 'lastId24hr': number; + /** + * Total number of trades in 24hr. * @type {string} - * @memberof RewardsSummary + * @memberof TickerResponse */ - 'UserAddress': string; + 'count24hr': string; /** - * Total Blue token rewards earned by the user (e9 format). + * 24hr Market price change (e9 format). * @type {string} - * @memberof RewardsSummary + * @memberof TickerResponse */ - 'BlueRewardsE9': string; + 'priceChange24hrE9': string; /** - * Total Sui token rewards earned by the user (e9 format). + * 24hr Market price change in percentage (e9 format). * @type {string} - * @memberof RewardsSummary + * @memberof TickerResponse */ - 'SuiRewardsE9': string; + 'priceChangePercent24hrE9': string; /** - * Total wal rewards earned by the user (e9 format). + * Last update time in milliseconds. + * @type {number} + * @memberof TickerResponse + */ + 'updatedAtMillis': number; + /** + * Live estimated funding rate based on current hour\'s average market and oracle prices (e9 format). * @type {string} - * @memberof RewardsSummary + * @memberof TickerResponse */ - 'WalRewardsE9': string; + 'estimatedFundingRateE9': string; } /** - * The strategy used to resolve self trades. TAKER: On a self trade, the taker order will be cancelled MAKER: On a self trade, the maker order will be cancelled BOTH: On a self trade, both the taker and the maker order will be cancelled UNSPECIFIED: set to default value - * @export - * @enum {string} - */ - -export const SelfTradePreventionType = { - Taker: 'TAKER', - Maker: 'MAKER', - Both: 'BOTH', - Unspecified: 'UNSPECIFIED' -} as const; - -export type SelfTradePreventionType = typeof SelfTradePreventionType[keyof typeof SelfTradePreventionType]; - - -/** - * + * Represents detailed market ticker information. * @export - * @interface SigPayload + * @interface TickerUpdate */ -export interface SigPayload { +export interface TickerUpdate { /** - * Target address for the claim. + * Market symbol. * @type {string} - * @memberof SigPayload + * @memberof TickerUpdate */ - 'target': string; + 'symbol': string; /** - * Receiver address for the claim. + * Last trade quantity (e9 format). * @type {string} - * @memberof SigPayload + * @memberof TickerUpdate */ - 'receiver': string; + 'lastQuantityE9': string; /** - * Amount to be claimed. - * @type {string} - * @memberof SigPayload + * Last trade time in milliseconds. + * @type {number} + * @memberof TickerUpdate */ - 'amount': string; + 'lastTimeAtMillis': number; /** - * Expiry timestamp for the claim. + * Last trade price (e9 format). * @type {string} - * @memberof SigPayload + * @memberof TickerUpdate */ - 'expiry': string; + 'lastPriceE9': string; /** - * Nonce for the claim. + * Funding rate value (e9 format). * @type {string} - * @memberof SigPayload + * @memberof TickerUpdate */ - 'nonce': string; + 'lastFundingRateE9': string; /** - * Type identifier for the claim. + * Time in milliseconds of next funding rate update. * @type {number} - * @memberof SigPayload + * @memberof TickerUpdate */ - 'type': number; -} -/** - * The order in which results should be sorted. - * @export - * @enum {string} - */ - -export const SortOrder = { - Asc: 'ASC', - Desc: 'DESC', - Unspecified: 'UNSPECIFIED' -} as const; - -export type SortOrder = typeof SortOrder[keyof typeof SortOrder]; - - -/** - * - * @export - * @interface SponsorTxRequest - */ -export interface SponsorTxRequest { + 'nextFundingTimeAtMillis': number; /** - * Base64 encoded transaction bytes to be sponsored. To create txBytes: 1. Create a TransactionBlock with move calls (e.g., deposit_to_asset_bank) 2. Serialize the TransactionBlock to bytes using BCS (Binary Canonical Serialization) 3. Encode the bytes to base64 string Reference implementation: https://github.com/fireflyprotocol/library-sui/blob/1412fff4d4fe7cf6b7ec04d700e777628c57c70a/src/classes/SuiBlocks.ts#L220 + * 8 hr average funding rate (e9 format). * @type {string} - * @memberof SponsorTxRequest + * @memberof TickerUpdate */ - 'txBytes': string; -} -/** - * - * @export - * @interface SponsorTxResponse - */ -export interface SponsorTxResponse { + 'avgFundingRate8hrE9': string; /** - * Base64 encoded sponsored transaction bytes + * Oracle price of the asset (e9 format). * @type {string} - * @memberof SponsorTxResponse + * @memberof TickerUpdate */ - 'txBytes': string; + 'oraclePriceE9': string; /** - * Transaction digest - * @type {string} - * @memberof SponsorTxResponse + * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * @type {number} + * @memberof TickerUpdate */ - 'txDigest': string; + 'oraclePriceDirection': number; /** - * Transaction signature + * Mark price on the exchange (e9 format). * @type {string} - * @memberof SponsorTxResponse + * @memberof TickerUpdate */ - 'signature': string; + 'markPriceE9': string; /** - * Transaction expiration time in milliseconds since Unix epoch + * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). * @type {number} - * @memberof SponsorTxResponse + * @memberof TickerUpdate */ - 'expireAtTime': number; -} -/** - * - * @export - * @interface StatsAllTimeResponse - */ -export interface StatsAllTimeResponse { + 'markPriceDirection': number; /** - * Timestamp in milliseconds when the statistics period starts. + * Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format). + * @type {string} + * @memberof TickerUpdate + */ + 'marketPriceE9': string; + /** + * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). * @type {number} - * @memberof StatsAllTimeResponse + * @memberof TickerUpdate */ - 'startTimeAtMillis': number; + 'marketPriceDirection': number; /** - * Total value locked in the legacy exchange in e9 format. + * Best bid price (e9 format). * @type {string} - * @memberof StatsAllTimeResponse + * @memberof TickerUpdate */ - 'legacyTvlE9': string; + 'bestBidPriceE9': string; /** - * Total value locked in the exchange in e9 format. + * Best bid quantity (e9 format). * @type {string} - * @memberof StatsAllTimeResponse + * @memberof TickerUpdate */ - 'tvlE9': string; + 'bestBidQuantityE9': string; /** - * Total quote asset volume in the legacy exchange in e9 format. + * Best ask price (e9 format). * @type {string} - * @memberof StatsAllTimeResponse + * @memberof TickerUpdate */ - 'totalLegacyQuoteAssetVolumeE9': string; + 'bestAskPriceE9': string; /** - * Total quote asset volume in the exchange in e9 format. + * Best ask quantity (e9 format). * @type {string} - * @memberof StatsAllTimeResponse + * @memberof TickerUpdate */ - 'totalQuoteAssetVolumeE9': string; + 'bestAskQuantityE9': string; /** - * Timestamp in milliseconds when the statistics period ends. - * @type {number} - * @memberof StatsAllTimeResponse + * Open interest value (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'endTimeAtMillis': number; -} -/** - * - * @export - * @interface StatsEntry - */ -export interface StatsEntry { + 'openInterestE9': string; /** - * Timestamp in milliseconds when the statistics period starts. - * @type {number} - * @memberof StatsEntry + * Highest Price in the last 24 hours (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'startTimeAtMillis': number; + 'highPrice24hrE9': string; /** - * Total value locked in the legacy exchange in e9 format. + * Lowest Price in the last 24 hours (e9 format). * @type {string} - * @memberof StatsEntry + * @memberof TickerUpdate */ - 'legacyTvlE9': string; + 'lowPrice24hrE9': string; /** - * Total value locked in the exchange in e9 format. + * Total market volume in last 24 hours of asset (e9 format). * @type {string} - * @memberof StatsEntry + * @memberof TickerUpdate */ - 'tvlE9': string; + 'volume24hrE9': string; /** - * Total quote asset volume in the legacy exchange in e9 format. + * Total market volume in last 24 hours in USDC (e9 format). * @type {string} - * @memberof StatsEntry + * @memberof TickerUpdate */ - 'totalLegacyQuoteAssetVolumeE9': string; + 'quoteVolume24hrE9': string; /** - * Total quote asset volume in the exchange in e9 format. + * Close price 24 hours ago (e9 format). * @type {string} - * @memberof StatsEntry + * @memberof TickerUpdate */ - 'totalQuoteAssetVolumeE9': string; + 'closePrice24hrE9': string; /** - * Timestamp in milliseconds when the statistics period ends. + * Open price in the last 24 hours (e9 format). + * @type {string} + * @memberof TickerUpdate + */ + 'openPrice24hrE9': string; + /** + * 24 hour close timestamp in milliseconds. * @type {number} - * @memberof StatsEntry + * @memberof TickerUpdate */ - 'endTimeAtMillis': number; -} -/** - * - * @export - * @enum {string} - */ - -export const StatsInterval = { - _1d: '1d', - _1w: '1w', - _1Mo: '1Mo', - Unspecified: 'UNSPECIFIED' -} as const; - -export type StatsInterval = typeof StatsInterval[keyof typeof StatsInterval]; - - -/** - * - * @export - * @interface StatsResponse - */ -export interface StatsResponse { + 'closeTime24hrAtMillis': number; /** - * - * @type {Array} - * @memberof StatsResponse + * 24 hour open timetamp in milliseconds. + * @type {number} + * @memberof TickerUpdate */ - 'data': Array; -} -/** - * Response message indicating the success or failure of a subscription operation. - * @export - * @interface SubscriptionResponseMessage - */ -export interface SubscriptionResponseMessage { + 'openTime24hrAtMillis': number; /** - * Indicates if the subscription operation was successful. - * @type {boolean} - * @memberof SubscriptionResponseMessage + * First trade ID in the last 24 hours. + * @type {number} + * @memberof TickerUpdate */ - 'success': boolean; + 'firstId24hr': number; /** - * Additional information about the subscription operation. + * Last trade ID in the last 24 hours. + * @type {number} + * @memberof TickerUpdate + */ + 'lastId24hr': number; + /** + * Total number of trades in the last 24 hours. * @type {string} - * @memberof SubscriptionResponseMessage + * @memberof TickerUpdate */ - 'message': string; -} -/** - * Indicates the type of subscription action. - * @export - * @enum {string} - */ - -export const SubscriptionType = { - Subscribe: 'Subscribe', - Unsubscribe: 'Unsubscribe' -} as const; - -export type SubscriptionType = typeof SubscriptionType[keyof typeof SubscriptionType]; - - -/** - * - * @export - * @interface TickerAllUpdate - */ -export interface TickerAllUpdate { + 'count24hr': string; /** - * Array of detailed market ticker information for all markets. - * @type {Array} - * @memberof TickerAllUpdate + * 24 hour Market price change (e9 format). + * @type {string} + * @memberof TickerUpdate */ - 'tickerAll': Array; + 'priceChange24hrE9': string; + /** + * 24 hour Market price change as a percentage (e9 format). + * @type {string} + * @memberof TickerUpdate + */ + 'priceChangePercent24hrE9': string; + /** + * Last update timestamp in milliseconds. + * @type {number} + * @memberof TickerUpdate + */ + 'updatedAtMillis': number; } /** * * @export - * @interface TickerResponse + * @interface Trade */ -export interface TickerResponse { +export interface Trade { /** - * Market symbol. + * Trade ID * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'symbol': string; + 'id': string; /** - * Last trade quantity (e9 format). + * Client order ID. * @type {string} - * @memberof TickerResponse - */ - 'lastQuantityE9': string; - /** - * Last trade time in milliseconds. - * @type {number} - * @memberof TickerResponse + * @memberof Trade */ - 'lastTimeAtMillis': number; + 'clientOrderId'?: string; /** - * Last trade price (e9 format). + * Market address. * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'lastPriceE9': string; + 'symbol'?: string; /** - * Funding rate value (e9 format). + * Order hash. * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'lastFundingRateE9': string; + 'orderHash'?: string; /** - * Time in milliseconds of next funding rate update. - * @type {number} - * @memberof TickerResponse + * + * @type {OrderType} + * @memberof Trade */ - 'nextFundingTimeAtMillis': number; + 'orderType'?: OrderType; /** - * 8 hr average funding rate (e9 format). - * @type {string} - * @memberof TickerResponse + * + * @type {TradeType} + * @memberof Trade */ - 'avgFundingRate8hrE9': string; + 'tradeType'?: TradeType; /** - * Oracle price of the asset (e9 format). - * @type {string} - * @memberof TickerResponse + * + * @type {TradeSide} + * @memberof Trade */ - 'oraclePriceE9': string; + 'side': TradeSide; /** - * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). - * @type {number} - * @memberof TickerResponse + * Indicates if the user was a maker to the trade. + * @type {boolean} + * @memberof Trade */ - 'oraclePriceDirection': number; + 'isMaker'?: boolean; /** - * Mark price on the exchange (e9 format). + * Trade price (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'markPriceE9': string; + 'priceE9': string; /** - * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). - * @type {number} - * @memberof TickerResponse + * Trade quantity (e9 format). + * @type {string} + * @memberof Trade */ - 'markPriceDirection': number; + 'quantityE9': string; /** - * Simple average of bestBid and bestAsk. lastPrice if either is not present (e9 format). + * Quote quantity (e9 format). * @type {string} - * @memberof TickerResponse - */ - 'marketPriceE9': string; - /** - * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 positive trend (current > last). - * @type {number} - * @memberof TickerResponse + * @memberof Trade */ - 'marketPriceDirection': number; + 'quoteQuantityE9': string; /** - * Best bid price (e9 format). + * Realized profit and loss (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'bestBidPriceE9': string; + 'realizedPnlE9'?: string; /** - * Best bid quantity (e9 format). - * @type {string} - * @memberof TickerResponse + * + * @type {PositionSide} + * @memberof Trade */ - 'bestBidQuantityE9': string; + 'positionSide'?: PositionSide; /** - * Best ask price (e9 format). + * Trading fee (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'bestAskPriceE9': string; + 'tradingFeeE9'?: string; /** - * Best ask quantity (e9 format). + * Asset used for trading fee. * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'bestAskQuantityE9': string; + 'tradingFeeAsset'?: string; /** - * Open interest value (e9 format). + * Gas fee. * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'openInterestE9': string; + 'gasFeeE9'?: string; /** - * Highest Price in the last 24hrs (e9 format). + * Asset used for gas fee. * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'highPrice24hrE9': string; + 'gasFeeAsset'?: string; /** - * Lowest Price in the last 24hrs (e9 format). + * Mark price at the time of trade execution (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'lowPrice24hrE9': string; + 'markPriceE9'?: string; /** - * Total market volume in last 24hrs of asset (e9 format). + * Oracle price at the time of trade execution (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof Trade */ - 'volume24hrE9': string; + 'oraclePriceE9'?: string; /** - * Total market volume in last 24hrs in USDC (e9 format). - * @type {string} - * @memberof TickerResponse + * Trade timestamp in milliseconds since Unix epoch. + * @type {number} + * @memberof Trade */ - 'quoteVolume24hrE9': string; + 'executedAtMillis': number; +} + + +/** + * Trade side based on the user order in this trade. + * @export + * @enum {string} + */ + +export const TradeSide = { + Long: 'LONG', + Short: 'SHORT', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TradeSide = typeof TradeSide[keyof typeof TradeSide]; + + +/** + * Type of trade. + * @export + * @enum {string} + */ + +export const TradeType = { + Order: 'ORDER', + Liquidation: 'LIQUIDATION', + Deleverage: 'DELEVERAGE', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TradeType = typeof TradeType[keyof typeof TradeType]; + + +/** + * + * @export + * @interface TradingFees + */ +export interface TradingFees { /** - * Close price 24hrs ago (e9 format). + * The Account Maker Fee (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof TradingFees */ - 'closePrice24hrE9': string; + 'makerFeeE9': string; /** - * Open price in the last 24hrs (e9 format). + * The Account Taker Fee (e9 format). * @type {string} - * @memberof TickerResponse + * @memberof TradingFees */ - 'openPrice24hrE9': string; + 'takerFeeE9': string; /** - * 24 hour close time in milliseconds. - * @type {number} - * @memberof TickerResponse + * Are the fees applied on the account? + * @type {boolean} + * @memberof TradingFees */ - 'closeTime24hrAtMillis': number; + 'isApplied': boolean; +} +/** + * + * @export + * @interface Transaction + */ +export interface Transaction { /** - * 24 hour open time in milliseconds. - * @type {number} - * @memberof TickerResponse + * Transaction ID. + * @type {string} + * @memberof Transaction */ - 'openTime24hrAtMillis': number; + 'id': string; /** - * First trade id in 24hr. - * @type {number} - * @memberof TickerResponse + * Market address. + * @type {string} + * @memberof Transaction */ - 'firstId24hr': number; + 'symbol'?: string; /** - * Last trade id in 24hr. - * @type {number} - * @memberof TickerResponse + * + * @type {TransactionType} + * @memberof Transaction */ - 'lastId24hr': number; + 'type': TransactionType; /** - * Total number of trades in 24hr. + * Amount in e9 format (positive or negative). * @type {string} - * @memberof TickerResponse + * @memberof Transaction */ - 'count24hr': string; + 'amountE9': string; /** - * 24hr Market price change (e9 format). + * Transaction status (SUCCESS, REJECTED). * @type {string} - * @memberof TickerResponse + * @memberof Transaction */ - 'priceChange24hrE9': string; + 'status'?: string; /** - * 24hr Market price change in percentage (e9 format). + * Asset bank address. * @type {string} - * @memberof TickerResponse + * @memberof Transaction */ - 'priceChangePercent24hrE9': string; + 'assetSymbol': string; /** - * Last update time in milliseconds. - * @type {number} - * @memberof TickerResponse + * Trade ID + * @type {string} + * @memberof Transaction */ - 'updatedAtMillis': number; + 'tradeId'?: string; /** - * Live estimated funding rate based on current hour\'s average market and oracle prices (e9 format). - * @type {string} - * @memberof TickerResponse + * Transaction timestamp in milliseconds since Unix epoch. + * @type {number} + * @memberof Transaction */ - 'estimatedFundingRateE9': string; + 'executedAtMillis': number; } + + /** - * Represents detailed market ticker information. + * Transaction type (what caused the change in the asset balance). * @export - * @interface TickerUpdate + * @enum {string} */ -export interface TickerUpdate { + +export const TransactionType = { + Transfer: 'TRANSFER', + Deposit: 'DEPOSIT', + Withdraw: 'WITHDRAW', + RealizedPnl: 'REALIZED_PNL', + FundingFee: 'FUNDING_FEE', + TradingFee: 'TRADING_FEE', + TradingGasFee: 'TRADING_GAS_FEE', + Bonus: 'BONUS', + Unspecified: 'UNSPECIFIED' +} as const; + +export type TransactionType = typeof TransactionType[keyof typeof TransactionType]; + + +/** + * + * @export + * @interface UpdateAccountPreferenceRequest + */ +export interface UpdateAccountPreferenceRequest { + [key: string]: any; + /** - * Market symbol. + * User preferred language. * @type {string} - * @memberof TickerUpdate + * @memberof UpdateAccountPreferenceRequest */ - 'symbol': string; + 'language'?: string; /** - * Last trade quantity (e9 format). + * User preferred theme. * @type {string} - * @memberof TickerUpdate + * @memberof UpdateAccountPreferenceRequest */ - 'lastQuantityE9': string; + 'theme'?: string; /** - * Last trade time in milliseconds. - * @type {number} - * @memberof TickerUpdate + * + * @type {Array} + * @memberof UpdateAccountPreferenceRequest */ - 'lastTimeAtMillis': number; + 'market'?: Array; +} +/** + * + * @export + * @interface UpdateAffiliateEmberRefferalShareRequest + */ +export interface UpdateAffiliateEmberRefferalShareRequest { /** - * Last trade price (e9 format). - * @type {string} - * @memberof TickerUpdate + * Ember refferal share for an affiliate. + * @type {number} + * @memberof UpdateAffiliateEmberRefferalShareRequest */ - 'lastPriceE9': string; - /** - * Funding rate value (e9 format). - * @type {string} - * @memberof TickerUpdate - */ - 'lastFundingRateE9': string; + 'emberRefferalShare': number; +} +/** + * + * @export + * @interface UpdateAffiliateFeeConfigRequest + */ +export interface UpdateAffiliateFeeConfigRequest { /** - * Time in milliseconds of next funding rate update. + * Cashback amount to give to the referees * @type {number} - * @memberof TickerUpdate + * @memberof UpdateAffiliateFeeConfigRequest */ - 'nextFundingTimeAtMillis': number; + 'cashback': number; +} +/** + * + * @export + * @interface UserCampaignRewards + */ +export interface UserCampaignRewards { /** - * 8 hr average funding rate (e9 format). + * User address for the rewards earned data. * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'avgFundingRate8hrE9': string; + 'userAddress': string; /** - * Oracle price of the asset (e9 format). + * Name of the campaign. * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'oraclePriceE9': string; + 'campaignName': string; /** - * Direction of oracle price computed by comparing current oracle price to last oracle price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * Epoch number for the rewards earned data. * @type {number} - * @memberof TickerUpdate - */ - 'oraclePriceDirection': number; - /** - * Mark price on the exchange (e9 format). - * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'markPriceE9': string; + 'epochNumber': number; /** - * Direction of mark price computed by comparing current mark price to last mark price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). + * Interval number for the rewards earned data. * @type {number} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'markPriceDirection': number; + 'intervalNumber': number; /** - * Simple average of bestBid and bestAsk, or lastPrice if either is not present (e9 format). + * Market Symbol. * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'marketPriceE9': string; + 'symbol': string; /** - * Direction of market price computed by comparing current market price to last market price. 0 = no change, -1 = negative trend (current < last), 1 = positive trend (current > last). - * @type {number} - * @memberof TickerUpdate + * + * @type {string} + * @memberof UserCampaignRewards */ - 'marketPriceDirection': number; + 'status': UserCampaignRewardsStatusEnum; /** - * Best bid price (e9 format). + * Total blue-perp token rewards earned in the epoch (e9 format). * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'bestBidPriceE9': string; + 'blueRewardsE9': string; /** - * Best bid quantity (e9 format). + * Total sui-perp token rewards earned in the epoch (e9 format). * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'bestBidQuantityE9': string; + 'suiRewardsE9': string; /** - * Best ask price (e9 format). + * Total wal-perp rewards earned in the epoch (e9 format). * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'bestAskPriceE9': string; + 'walRewardsE9': string; /** - * Best ask quantity (e9 format). + * Total cash rewards earned in the epoch (e9 format). * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'bestAskQuantityE9': string; + 'cashRewardsE9': string; /** - * Open interest value (e9 format). + * Total user fee paid in the epoch (e9 format). * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'openInterestE9': string; + 'userFeePaidE9': string; /** - * Highest Price in the last 24 hours (e9 format). - * @type {string} - * @memberof TickerUpdate + * Time in milliseconds for interval start date. + * @type {number} + * @memberof UserCampaignRewards */ - 'highPrice24hrE9': string; + 'intervalStartDate': number; /** - * Lowest Price in the last 24 hours (e9 format). - * @type {string} - * @memberof TickerUpdate + * Time in milliseconds for interval end date. + * @type {number} + * @memberof UserCampaignRewards */ - 'lowPrice24hrE9': string; + 'intervalEndDate': number; /** - * Total market volume in last 24 hours of asset (e9 format). - * @type {string} - * @memberof TickerUpdate + * Indicates if the rewards have been disbursed. + * @type {boolean} + * @memberof UserCampaignRewards */ - 'volume24hrE9': string; + 'isDisbursed': boolean; /** - * Total market volume in last 24 hours in USDC (e9 format). + * Transaction digest of the disbursement. * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'quoteVolume24hrE9': string; + 'txnDigest': string; /** - * Close price 24 hours ago (e9 format). - * @type {string} - * @memberof TickerUpdate + * Array of claim signatures for different reward types. + * @type {Array} + * @memberof UserCampaignRewards */ - 'closePrice24hrE9': string; + 'claimSignature'?: Array; /** - * Open price in the last 24 hours (e9 format). + * Status of the claim. * @type {string} - * @memberof TickerUpdate + * @memberof UserCampaignRewards */ - 'openPrice24hrE9': string; + 'claimStatus'?: UserCampaignRewardsClaimStatusEnum; +} + +export const UserCampaignRewardsStatusEnum = { + Active: 'ACTIVE', + NotStarted: 'NOT_STARTED', + Finalized: 'FINALIZED', + Cooldown: 'COOLDOWN' +} as const; + +export type UserCampaignRewardsStatusEnum = typeof UserCampaignRewardsStatusEnum[keyof typeof UserCampaignRewardsStatusEnum]; +export const UserCampaignRewardsClaimStatusEnum = { + Claimable: 'CLAIMABLE', + Claimed: 'CLAIMED', + NotYetClaimable: 'NOT_YET_CLAIMABLE', + ClaimEnded: 'CLAIM_ENDED' +} as const; + +export type UserCampaignRewardsClaimStatusEnum = typeof UserCampaignRewardsClaimStatusEnum[keyof typeof UserCampaignRewardsClaimStatusEnum]; + +/** + * + * @export + * @interface WithdrawRequest + */ +export interface WithdrawRequest { /** - * 24 hour close timestamp in milliseconds. - * @type {number} - * @memberof TickerUpdate + * + * @type {WithdrawRequestSignedFields} + * @memberof WithdrawRequest */ - 'closeTime24hrAtMillis': number; + 'signedFields': WithdrawRequestSignedFields; /** - * 24 hour open timetamp in milliseconds. - * @type {number} - * @memberof TickerUpdate + * The signature of the request, encoded from the signedFields + * @type {string} + * @memberof WithdrawRequest */ - 'openTime24hrAtMillis': number; + 'signature': string; +} +/** + * + * @export + * @interface WithdrawRequestSignedFields + */ +export interface WithdrawRequestSignedFields { /** - * First trade ID in the last 24 hours. - * @type {number} - * @memberof TickerUpdate + * Asset symbol of the withdrawn asset + * @type {string} + * @memberof WithdrawRequestSignedFields */ - 'firstId24hr': number; + 'assetSymbol': string; /** - * Last trade ID in the last 24 hours. - * @type {number} - * @memberof TickerUpdate + * The Account Address from which to withdraw assets + * @type {string} + * @memberof WithdrawRequestSignedFields */ - 'lastId24hr': number; + 'accountAddress': string; /** - * Total number of trades in the last 24 hours. + * The amount in e9 of the asset that the User will withdraw from their account * @type {string} - * @memberof TickerUpdate + * @memberof WithdrawRequestSignedFields */ - 'count24hr': string; + 'amountE9': string; /** - * 24 hour Market price change (e9 format). + * A uniqueness modifier for the request. This is added to guarantee uniqueness of the request. Usually a mix of timestamp and a random number * @type {string} - * @memberof TickerUpdate + * @memberof WithdrawRequestSignedFields */ - 'priceChange24hrE9': string; + 'salt': string; /** - * 24 hour Market price change as a percentage (e9 format). + * the ID of the external datastore for the target network * @type {string} - * @memberof TickerUpdate + * @memberof WithdrawRequestSignedFields */ - 'priceChangePercent24hrE9': string; + 'edsId': string; /** - * Last update timestamp in milliseconds. + * The timestamp in milliseconds when the HTTP Request payload has been signed * @type {number} - * @memberof TickerUpdate + * @memberof WithdrawRequestSignedFields */ - 'updatedAtMillis': number; + 'signedAtMillis': number; } /** * * @export - * @interface Trade + * @interface ZKLoginUserDetailsResponse */ -export interface Trade { +export interface ZKLoginUserDetailsResponse { /** - * Trade ID + * The zkLogin user salt. * @type {string} - * @memberof Trade + * @memberof ZKLoginUserDetailsResponse */ - 'id': string; + 'salt': string; /** - * Client order ID. + * The zkLogin user\'s address. * @type {string} - * @memberof Trade + * @memberof ZKLoginUserDetailsResponse */ - 'clientOrderId'?: string; + 'address': string; /** - * Market address. + * The zkLogin user\'s public key. * @type {string} - * @memberof Trade + * @memberof ZKLoginUserDetailsResponse */ - 'symbol'?: string; - /** - * Order hash. - * @type {string} - * @memberof Trade - */ - 'orderHash'?: string; - /** - * - * @type {OrderType} - * @memberof Trade - */ - 'orderType'?: OrderType; - /** - * - * @type {TradeType} - * @memberof Trade - */ - 'tradeType'?: TradeType; - /** - * - * @type {TradeSide} - * @memberof Trade - */ - 'side': TradeSide; - /** - * Indicates if the user was a maker to the trade. - * @type {boolean} - * @memberof Trade - */ - 'isMaker'?: boolean; - /** - * Trade price (e9 format). - * @type {string} - * @memberof Trade - */ - 'priceE9': string; - /** - * Trade quantity (e9 format). - * @type {string} - * @memberof Trade - */ - 'quantityE9': string; - /** - * Quote quantity (e9 format). - * @type {string} - * @memberof Trade - */ - 'quoteQuantityE9': string; - /** - * Realized profit and loss (e9 format). - * @type {string} - * @memberof Trade - */ - 'realizedPnlE9'?: string; - /** - * - * @type {PositionSide} - * @memberof Trade - */ - 'positionSide'?: PositionSide; - /** - * Trading fee (e9 format). - * @type {string} - * @memberof Trade - */ - 'tradingFeeE9'?: string; - /** - * Asset used for trading fee. - * @type {string} - * @memberof Trade - */ - 'tradingFeeAsset'?: string; - /** - * Gas fee. - * @type {string} - * @memberof Trade - */ - 'gasFeeE9'?: string; - /** - * Asset used for gas fee. - * @type {string} - * @memberof Trade - */ - 'gasFeeAsset'?: string; - /** - * Mark price at the time of trade execution (e9 format). - * @type {string} - * @memberof Trade - */ - 'markPriceE9'?: string; - /** - * Oracle price at the time of trade execution (e9 format). - * @type {string} - * @memberof Trade - */ - 'oraclePriceE9'?: string; - /** - * Trade timestamp in milliseconds since Unix epoch. - * @type {number} - * @memberof Trade - */ - 'executedAtMillis': number; + 'publicKey': string; } - - -/** - * Trade side based on the user order in this trade. - * @export - * @enum {string} - */ - -export const TradeSide = { - Long: 'LONG', - Short: 'SHORT', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TradeSide = typeof TradeSide[keyof typeof TradeSide]; - - -/** - * Type of trade. - * @export - * @enum {string} - */ - -export const TradeType = { - Order: 'ORDER', - Liquidation: 'LIQUIDATION', - Deleverage: 'DELEVERAGE', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TradeType = typeof TradeType[keyof typeof TradeType]; - - /** * * @export - * @interface TradingFees + * @interface ZKLoginZKPRequest */ -export interface TradingFees { +export interface ZKLoginZKPRequest { /** - * The Account Maker Fee (e9 format). + * The network to use (e.g., \"mainnet\", \"testnet\"). * @type {string} - * @memberof TradingFees + * @memberof ZKLoginZKPRequest */ - 'makerFeeE9': string; + 'network'?: string; /** - * The Account Taker Fee (e9 format). + * The ephemeral public key for the ZK proof. * @type {string} - * @memberof TradingFees + * @memberof ZKLoginZKPRequest */ - 'takerFeeE9': string; + 'ephemeralPublicKey': string; /** - * Are the fees applied on the account? - * @type {boolean} - * @memberof TradingFees + * The maximum epoch for the ZK proof. + * @type {number} + * @memberof ZKLoginZKPRequest */ - 'isApplied': boolean; + 'maxEpoch': number; + /** + * Randomness value for the ZK proof. + * @type {string} + * @memberof ZKLoginZKPRequest + */ + 'randomness': string; } /** * * @export - * @interface Transaction + * @interface ZKLoginZKPResponse */ -export interface Transaction { - /** - * Transaction ID. - * @type {string} - * @memberof Transaction - */ - 'id': string; - /** - * Market address. - * @type {string} - * @memberof Transaction - */ - 'symbol'?: string; +export interface ZKLoginZKPResponse { /** * - * @type {TransactionType} - * @memberof Transaction - */ - 'type': TransactionType; - /** - * Amount in e9 format (positive or negative). - * @type {string} - * @memberof Transaction + * @type {ProofPoints} + * @memberof ZKLoginZKPResponse */ - 'amountE9': string; + 'proofPoints'?: ProofPoints; /** - * Transaction status (SUCCESS, REJECTED). - * @type {string} - * @memberof Transaction + * + * @type {IssBase64Details} + * @memberof ZKLoginZKPResponse */ - 'status'?: string; + 'issBase64Details'?: IssBase64Details; /** - * Asset bank address. + * Base64 encoded header information. * @type {string} - * @memberof Transaction + * @memberof ZKLoginZKPResponse */ - 'assetSymbol': string; + 'headerBase64'?: string; /** - * Trade ID + * The address seed used in the proof. * @type {string} - * @memberof Transaction - */ - 'tradeId'?: string; - /** - * Transaction timestamp in milliseconds since Unix epoch. - * @type {number} - * @memberof Transaction + * @memberof ZKLoginZKPResponse */ - 'executedAtMillis': number; + 'addressSeed': string; } - /** - * Transaction type (what caused the change in the asset balance). + * AccountDataApi - axios parameter creator * @export - * @enum {string} */ +export const AccountDataApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * Retrieves the user\'s account details. + * @summary /account + * @param {string} [accountAddress] Account address to fetch account details by. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getAccountDetails: async (accountAddress?: string, options: RawAxiosRequestConfig = {}): Promise => { + const localVarPath = `/api/v1/account`; + // 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; + } -export const TransactionType = { - Transfer: 'TRANSFER', - Deposit: 'DEPOSIT', - Withdraw: 'WITHDRAW', - RealizedPnl: 'REALIZED_PNL', - FundingFee: 'FUNDING_FEE', - TradingFee: 'TRADING_FEE', - TradingGasFee: 'TRADING_GAS_FEE', - Bonus: 'BONUS', - Unspecified: 'UNSPECIFIED' -} as const; - -export type TransactionType = typeof TransactionType[keyof typeof TransactionType]; - - -/** - * - * @export - * @interface UpdateAccountPreferenceRequest - */ -export interface UpdateAccountPreferenceRequest { - [key: string]: any; - - /** - * User preferred language. - * @type {string} - * @memberof UpdateAccountPreferenceRequest - */ - 'language'?: string; - /** - * User preferred theme. - * @type {string} - * @memberof UpdateAccountPreferenceRequest - */ - 'theme'?: string; - /** - * - * @type {Array} - * @memberof UpdateAccountPreferenceRequest - */ - 'market'?: Array; -} -/** - * - * @export - * @interface UpdateAffiliateEmberRefferalShareRequest - */ -export interface UpdateAffiliateEmberRefferalShareRequest { - /** - * Ember refferal share for an affiliate. - * @type {number} - * @memberof UpdateAffiliateEmberRefferalShareRequest - */ - 'emberRefferalShare': number; -} -/** - * - * @export - * @interface UpdateAffiliateFeeConfigRequest - */ -export interface UpdateAffiliateFeeConfigRequest { - /** - * Cashback amount to give to the referees - * @type {number} - * @memberof UpdateAffiliateFeeConfigRequest - */ - 'cashback': number; -} -/** - * - * @export - * @interface UserCampaignRewards - */ -export interface UserCampaignRewards { - /** - * User address for the rewards earned data. - * @type {string} - * @memberof UserCampaignRewards - */ - 'userAddress': string; - /** - * Name of the campaign. - * @type {string} - * @memberof UserCampaignRewards - */ - 'campaignName': string; - /** - * Epoch number for the rewards earned data. - * @type {number} - * @memberof UserCampaignRewards - */ - 'epochNumber': number; - /** - * Interval number for the rewards earned data. - * @type {number} - * @memberof UserCampaignRewards - */ - 'intervalNumber': number; - /** - * Market Symbol. - * @type {string} - * @memberof UserCampaignRewards - */ - 'symbol': string; - /** - * - * @type {string} - * @memberof UserCampaignRewards - */ - 'status': UserCampaignRewardsStatusEnum; - /** - * Total blue-perp token rewards earned in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards - */ - 'blueRewardsE9': string; - /** - * Total sui-perp token rewards earned in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards - */ - 'suiRewardsE9': string; - /** - * Total wal-perp rewards earned in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards - */ - 'walRewardsE9': string; - /** - * Total cash rewards earned in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards - */ - 'cashRewardsE9': string; - /** - * Total user fee paid in the epoch (e9 format). - * @type {string} - * @memberof UserCampaignRewards - */ - 'userFeePaidE9': string; - /** - * Time in milliseconds for interval start date. - * @type {number} - * @memberof UserCampaignRewards - */ - 'intervalStartDate': number; - /** - * Time in milliseconds for interval end date. - * @type {number} - * @memberof UserCampaignRewards - */ - 'intervalEndDate': number; - /** - * Indicates if the rewards have been disbursed. - * @type {boolean} - * @memberof UserCampaignRewards - */ - 'isDisbursed': boolean; - /** - * Transaction digest of the disbursement. - * @type {string} - * @memberof UserCampaignRewards - */ - 'txnDigest': string; - /** - * Array of claim signatures for different reward types. - * @type {Array} - * @memberof UserCampaignRewards - */ - 'claimSignature'?: Array; - /** - * Status of the claim. - * @type {string} - * @memberof UserCampaignRewards - */ - 'claimStatus'?: UserCampaignRewardsClaimStatusEnum; -} - -export const UserCampaignRewardsStatusEnum = { - Active: 'ACTIVE', - NotStarted: 'NOT_STARTED', - Finalized: 'FINALIZED', - Cooldown: 'COOLDOWN' -} as const; - -export type UserCampaignRewardsStatusEnum = typeof UserCampaignRewardsStatusEnum[keyof typeof UserCampaignRewardsStatusEnum]; -export const UserCampaignRewardsClaimStatusEnum = { - Claimable: 'CLAIMABLE', - Claimed: 'CLAIMED', - NotYetClaimable: 'NOT_YET_CLAIMABLE', - ClaimEnded: 'CLAIM_ENDED' -} as const; - -export type UserCampaignRewardsClaimStatusEnum = typeof UserCampaignRewardsClaimStatusEnum[keyof typeof UserCampaignRewardsClaimStatusEnum]; - -/** - * - * @export - * @interface WithdrawRequest - */ -export interface WithdrawRequest { - /** - * - * @type {WithdrawRequestSignedFields} - * @memberof WithdrawRequest - */ - 'signedFields': WithdrawRequestSignedFields; - /** - * The signature of the request, encoded from the signedFields - * @type {string} - * @memberof WithdrawRequest - */ - 'signature': string; -} -/** - * - * @export - * @interface WithdrawRequestSignedFields - */ -export interface WithdrawRequestSignedFields { - /** - * Asset symbol of the withdrawn asset - * @type {string} - * @memberof WithdrawRequestSignedFields - */ - 'assetSymbol': string; - /** - * The Account Address from which to withdraw assets - * @type {string} - * @memberof WithdrawRequestSignedFields - */ - 'accountAddress': string; - /** - * The amount in e9 of the asset that the User will withdraw from their account - * @type {string} - * @memberof WithdrawRequestSignedFields - */ - 'amountE9': string; - /** - * A uniqueness modifier for the request. This is added to guarantee uniqueness of the request. Usually a mix of timestamp and a random number - * @type {string} - * @memberof WithdrawRequestSignedFields - */ - 'salt': string; - /** - * the ID of the external datastore for the target network - * @type {string} - * @memberof WithdrawRequestSignedFields - */ - 'edsId': string; - /** - * The timestamp in milliseconds when the HTTP Request payload has been signed - * @type {number} - * @memberof WithdrawRequestSignedFields - */ - 'signedAtMillis': number; -} -/** - * - * @export - * @interface ZKLoginUserDetailsResponse - */ -export interface ZKLoginUserDetailsResponse { - /** - * The zkLogin user salt. - * @type {string} - * @memberof ZKLoginUserDetailsResponse - */ - 'salt': string; - /** - * The zkLogin user\'s address. - * @type {string} - * @memberof ZKLoginUserDetailsResponse - */ - 'address': string; - /** - * The zkLogin user\'s public key. - * @type {string} - * @memberof ZKLoginUserDetailsResponse - */ - 'publicKey': string; -} -/** - * - * @export - * @interface ZKLoginZKPRequest - */ -export interface ZKLoginZKPRequest { - /** - * The network to use (e.g., \"mainnet\", \"testnet\"). - * @type {string} - * @memberof ZKLoginZKPRequest - */ - 'network'?: string; - /** - * The ephemeral public key for the ZK proof. - * @type {string} - * @memberof ZKLoginZKPRequest - */ - 'ephemeralPublicKey': string; - /** - * The maximum epoch for the ZK proof. - * @type {number} - * @memberof ZKLoginZKPRequest - */ - 'maxEpoch': number; - /** - * Randomness value for the ZK proof. - * @type {string} - * @memberof ZKLoginZKPRequest - */ - 'randomness': string; -} -/** - * - * @export - * @interface ZKLoginZKPResponse - */ -export interface ZKLoginZKPResponse { - /** - * - * @type {ProofPoints} - * @memberof ZKLoginZKPResponse - */ - 'proofPoints'?: ProofPoints; - /** - * - * @type {IssBase64Details} - * @memberof ZKLoginZKPResponse - */ - 'issBase64Details'?: IssBase64Details; - /** - * Base64 encoded header information. - * @type {string} - * @memberof ZKLoginZKPResponse - */ - 'headerBase64'?: string; - /** - * The address seed used in the proof. - * @type {string} - * @memberof ZKLoginZKPResponse - */ - 'addressSeed': string; -} - -/** - * AccountDataApi - axios parameter creator - * @export - */ -export const AccountDataApiAxiosParamCreator = function (configuration?: Configuration) { - return { - /** - * Retrieves the user\'s account details. - * @summary /account - * @param {string} [accountAddress] Account address to fetch account details by. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getAccountDetails: async (accountAddress?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/api/v1/account`; - // 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; + const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; if (accountAddress !== undefined) { localVarQueryParameter['accountAddress'] = accountAddress; @@ -8151,181 +7629,8 @@ export const ExchangeApiAxiosParamCreator = function (configuration?: Configurat * ExchangeApi - functional programming interface * @export */ -export const ExchangeApiFp = function(configuration?: Configuration) { - const localVarAxiosParamCreator = ExchangeApiAxiosParamCreator(configuration) - return { - /** - * Retrieves all market ticker information. - * @summary /exchange/tickers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getAllMarketTicker(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getAllMarketTicker(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getAllMarketTicker']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCandlestickData']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Check if the country is geo restricted. - * @summary /exchange/country - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getCountry(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getCountry(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCountry']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeInfo(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeInfo']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStats']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getExchangeStatsAllTime(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStatsAllTime(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStatsAllTime']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getFundingRateHistory']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getLeaderboard(interval, sortBy, sortOrder, limit, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getLeaderboard']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketTicker(symbol, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getMarketTicker']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderbookDepth(symbol, limit, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getOrderbookDepth']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getRecentTrades']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - } -}; - -/** - * ExchangeApi - factory interface - * @export - */ -export const ExchangeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { - const localVarFp = ExchangeApiFp(configuration) +export const ExchangeApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = ExchangeApiAxiosParamCreator(configuration) return { /** * Retrieves all market ticker information. @@ -8333,8 +7638,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getAllMarketTicker(options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getAllMarketTicker(options).then((request) => request(axios, basePath)); + async getAllMarketTicker(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getAllMarketTicker(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getAllMarketTicker']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieves candle stick data for a market. @@ -8349,8 +7657,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise>> { - return localVarFp.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + async getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCandlestickData']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Check if the country is geo restricted. @@ -8358,8 +7669,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getCountry(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getCountry(options).then((request) => request(axios, basePath)); + async getCountry(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getCountry(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getCountry']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Returns the current exchange information including available margin assets, markets, and rules. @@ -8367,8 +7681,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeInfo(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeInfo(options).then((request) => request(axios, basePath)); + async getExchangeInfo(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeInfo(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeInfo']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieves exchange statistics. @@ -8381,8 +7698,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + async getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStats']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieves all time exchange statistics. @@ -8390,8 +7710,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getExchangeStatsAllTime(options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getExchangeStatsAllTime(options).then((request) => request(axios, basePath)); + async getExchangeStatsAllTime(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getExchangeStatsAllTime(options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getExchangeStatsAllTime']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieve the funding rate history for a specific market address. @@ -8404,8 +7727,11 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); + async getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getFundingRateHistory']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); }, /** * Retrieves the leaderboard of traders based on their performance. @@ -8418,532 +7744,378 @@ export const ExchangeApiFactory = function (configuration?: Configuration, baseP * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getMarketTicker(symbol, options).then((request) => request(axios, basePath)); - }, - /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getOrderbookDepth(symbol, limit, options).then((request) => request(axios, basePath)); - }, - /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); - }, - }; -}; - -/** - * ExchangeApi - object-oriented interface - * @export - * @class ExchangeApi - * @extends {BaseAPI} - */ -export class ExchangeApi extends BaseAPI { - /** - * Retrieves all market ticker information. - * @summary /exchange/tickers - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getAllMarketTicker(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getAllMarketTicker(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves candle stick data for a market. - * @summary /exchange/candlesticks - * @param {string} symbol The market symbol to get the klines for. - * @param {KlineInterval} interval The interval to get the klines for. - * @param {CandlePriceType} type Candle price type (last price, market price or oracle). - * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. - * @param {number} [limit] Default 50; max 1000. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Check if the country is geo restricted. - * @summary /exchange/country - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getCountry(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getCountry(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the current exchange information including available margin assets, markets, and rules. - * @summary /exchange/info - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getExchangeInfo(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeInfo(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves exchange statistics. - * @summary /exchange/stats - * @param {StatsInterval} [interval] - * @param {number} [startTimeAtMillis] Timestamp in milliseconds. - * @param {number} [endTimeAtMillis] Timestamp in milliseconds. - * @param {number} [limit] Number of records to return. Default is 30; max is 200. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves all time exchange statistics. - * @summary /v1/exchange/stats/allTime - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getExchangeStatsAllTime(options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getExchangeStatsAllTime(options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieve the funding rate history for a specific market address. - * @summary /exchange/fundingRateHistory - * @param {string} symbol The market symbol to get funding rate history for - * @param {number} [limit] Number of records to return. Default is 100; max is 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves the leaderboard of traders based on their performance. - * @summary /accounts/leaderboard - * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. - * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. - * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. - * @param {number} [limit] Default 50; max 100. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves aggregated ticker data for a market. - * @summary /exchange/ticker - * @param {string} symbol Market symbol. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getMarketTicker(symbol: string, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getMarketTicker(symbol, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the current state of the orderbook. - * @summary /exchange/depth - * @param {string} symbol Market symbol to get the orderbook depth for. - * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getOrderbookDepth(symbol, limit, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Retrieves recent trades executed on a market. - * @summary /exchange/trades - * @param {string} symbol The market symbol to get the trades for. - * @param {TradeType} [tradeType] Type of trade. - * @param {number} [limit] Default 500; max 1000. - * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. - * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. - * @param {number} [page] The page number to retrieve in a paginated response. - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof ExchangeApi - */ - public getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { - return ExchangeApiFp(this.configuration).getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); + async getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getLeaderboard(interval, sortBy, sortOrder, limit, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getLeaderboard']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getMarketTicker(symbol, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getMarketTicker']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getOrderbookDepth(symbol, limit, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getOrderbookDepth']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, + /** + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['ExchangeApi.getRecentTrades']?.[localVarOperationServerIndex]?.url; + return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); + }, } -} - -/** - * @export - */ -export const GetLeaderboardSortByEnum = { - GetLeaderboardSortByAccountValue: 'accountValue', - GetLeaderboardSortByPnL: 'pnl', - GetLeaderboardSortByVolume: 'volume', - GetLeaderboardSortByUNSPECIFIED: 'UNSPECIFIED' -} as const; -export type GetLeaderboardSortByEnum = typeof GetLeaderboardSortByEnum[keyof typeof GetLeaderboardSortByEnum]; - +}; /** - * KoraApi - axios parameter creator + * ExchangeApi - factory interface * @export */ -export const KoraApiAxiosParamCreator = function (configuration?: Configuration) { +export const ExchangeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = ExchangeApiFp(configuration) return { /** - * Returns metadata for Kora rewards campaigns. - * @summary Get Kora campaign metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status + * Retrieves all market ticker information. + * @summary /exchange/tickers * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraCampaignMetadata: async (campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/metadata/campaign`; - // 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 (campaignName !== undefined) { - localVarQueryParameter['campaignName'] = campaignName; - } - - if (status !== undefined) { - localVarQueryParameter['status'] = status; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getAllMarketTicker(options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getAllMarketTicker(options).then((request) => request(axios, basePath)); }, /** - * Returns the rewards earned by users for Kora campaigns. - * @summary Get Kora campaign rewards - * @param {string} userAddress Specify wallet address - * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name - * @param {number} [epochNumber] Optionally specify epoch number + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraCampaignRewards: async (userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options: RawAxiosRequestConfig = {}): Promise => { - // verify required parameter 'userAddress' is not null or undefined - assertParamExists('getKoraCampaignRewards', 'userAddress', userAddress) - const localVarPath = `/v1/kora/rewards/campaign`; - // 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 (campaignName !== undefined) { - localVarQueryParameter['campaignName'] = campaignName; - } - - if (epochNumber !== undefined) { - localVarQueryParameter['epochNumber'] = epochNumber; - } - - if (userAddress !== undefined) { - localVarQueryParameter['userAddress'] = userAddress; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise>> { + return localVarFp.getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); }, /** - * Returns epoch configuration including reward allocations for Kora. - * @summary Get Kora epoch configuration - * @param {number} [intervalNumber] Specify the interval number - * @param {string} [campaignName] Filter by campaign name + * Check if the country is geo restricted. + * @summary /exchange/country * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraEpochConfigMetadata: async (intervalNumber?: number, campaignName?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/metadata/epoch/configs`; - // 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 (intervalNumber !== undefined) { - localVarQueryParameter['intervalNumber'] = intervalNumber; - } - - if (campaignName !== undefined) { - localVarQueryParameter['campaignName'] = campaignName; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getCountry(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getCountry(options).then((request) => request(axios, basePath)); }, /** - * Returns the latest or next epoch for a Kora campaign. - * @summary Get Kora epoch metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraEpochMetadata: async (campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/metadata/epoch`; - // 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 (campaignName !== undefined) { - localVarQueryParameter['campaignName'] = campaignName; - } - - if (epoch !== undefined) { - localVarQueryParameter['epoch'] = epoch; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getExchangeInfo(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeInfo(options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getExchangeStatsAllTime(options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getExchangeStatsAllTime(options).then((request) => request(axios, basePath)); + }, + /** + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(axios, basePath)); }, /** - * Returns interval metadata for Kora. - * @summary Get Kora interval metadata - * @param {string} [interval] Interval number or \"next\"/\"latest\" - * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraIntervalMetadata: async (interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/metadata/interval`; - // 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 (interval !== undefined) { - localVarQueryParameter['interval'] = interval; - } - - if (protocol !== undefined) { - localVarQueryParameter['protocol'] = protocol; - } - - - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; + getMarketTicker(symbol: string, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getMarketTicker(symbol, options).then((request) => request(axios, basePath)); }, /** - * Returns rankings and earnings for Kora swap participants, sorted by the specified category. - * @summary Get Kora swap leaderboard - * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) - * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by - * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by - * @param {number} [page] Page number for pagination - * @param {number} [limit] Page size for pagination - * @param {string} [search] Filter by user address (partial match supported) - * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. * @param {*} [options] Override http request option. * @throws {RequiredError} */ - getKoraLeaderboard: async (epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/leaderboard`; - // 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 (epochId !== undefined) { - localVarQueryParameter['epochId'] = epochId; - } + getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig): AxiosPromise { + return localVarFp.getOrderbookDepth(symbol, limit, options).then((request) => request(axios, basePath)); + }, + /** + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(axios, basePath)); + }, + }; +}; - if (sortBy !== undefined) { - localVarQueryParameter['sortBy'] = sortBy; - } +/** + * ExchangeApi - object-oriented interface + * @export + * @class ExchangeApi + * @extends {BaseAPI} + */ +export class ExchangeApi extends BaseAPI { + /** + * Retrieves all market ticker information. + * @summary /exchange/tickers + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getAllMarketTicker(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getAllMarketTicker(options).then((request) => request(this.axios, this.basePath)); + } - if (sortOrder !== undefined) { - localVarQueryParameter['sortOrder'] = sortOrder; - } + /** + * Retrieves candle stick data for a market. + * @summary /exchange/candlesticks + * @param {string} symbol The market symbol to get the klines for. + * @param {KlineInterval} interval The interval to get the klines for. + * @param {CandlePriceType} type Candle price type (last price, market price or oracle). + * @param {number} [startTimeAtMillis] Timestamp in milliseconds in ms to get klines from. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds in ms to get klines until. + * @param {number} [limit] Default 50; max 1000. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getCandlestickData(symbol: string, interval: KlineInterval, type: CandlePriceType, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getCandlestickData(symbol, interval, type, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + } - if (page !== undefined) { - localVarQueryParameter['page'] = page; - } + /** + * Check if the country is geo restricted. + * @summary /exchange/country + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getCountry(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getCountry(options).then((request) => request(this.axios, this.basePath)); + } - if (limit !== undefined) { - localVarQueryParameter['limit'] = limit; - } + /** + * Returns the current exchange information including available margin assets, markets, and rules. + * @summary /exchange/info + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeInfo(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeInfo(options).then((request) => request(this.axios, this.basePath)); + } - if (search !== undefined) { - localVarQueryParameter['search'] = search; - } + /** + * Retrieves exchange statistics. + * @summary /exchange/stats + * @param {StatsInterval} [interval] + * @param {number} [startTimeAtMillis] Timestamp in milliseconds. + * @param {number} [endTimeAtMillis] Timestamp in milliseconds. + * @param {number} [limit] Number of records to return. Default is 30; max is 200. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeStats(interval?: StatsInterval, startTimeAtMillis?: number, endTimeAtMillis?: number, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeStats(interval, startTimeAtMillis, endTimeAtMillis, limit, page, options).then((request) => request(this.axios, this.basePath)); + } - if (minVolumeE6 !== undefined) { - localVarQueryParameter['minVolumeE6'] = minVolumeE6; - } + /** + * Retrieves all time exchange statistics. + * @summary /v1/exchange/stats/allTime + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getExchangeStatsAllTime(options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getExchangeStatsAllTime(options).then((request) => request(this.axios, this.basePath)); + } + /** + * Retrieve the funding rate history for a specific market address. + * @summary /exchange/fundingRateHistory + * @param {string} symbol The market symbol to get funding rate history for + * @param {number} [limit] Number of records to return. Default is 100; max is 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getFundingRateHistory(symbol: string, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getFundingRateHistory(symbol, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); + } - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + /** + * Retrieves the leaderboard of traders based on their performance. + * @summary /accounts/leaderboard + * @param {LeaderboardInterval} [interval] The interval to get the leaderboard for. Default or Unspecified is 7d. + * @param {GetLeaderboardSortByEnum} [sortBy] The field to sort by. Default or Unspecified is accountValue. + * @param {SortOrder} [sortOrder] The sort order, either ascending (ASC) or descending (DESC). Default or UNSPECIFIED is DESC. + * @param {number} [limit] Default 50; max 100. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getLeaderboard(interval?: LeaderboardInterval, sortBy?: GetLeaderboardSortByEnum, sortOrder?: SortOrder, limit?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getLeaderboard(interval, sortBy, sortOrder, limit, page, options).then((request) => request(this.axios, this.basePath)); + } - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, - /** - * Returns the all-time rewards earned by users including Kora CC and points. - * @summary Get Kora all-time rewards summary - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraRewardsSummary: async (options: RawAxiosRequestConfig = {}): Promise => { - const localVarPath = `/v1/kora/rewards/summary`; - // 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; - } + /** + * Retrieves aggregated ticker data for a market. + * @summary /exchange/ticker + * @param {string} symbol Market symbol. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getMarketTicker(symbol: string, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getMarketTicker(symbol, options).then((request) => request(this.axios, this.basePath)); + } - const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options}; - const localVarHeaderParameter = {} as any; - const localVarQueryParameter = {} as any; + /** + * Returns the current state of the orderbook. + * @summary /exchange/depth + * @param {string} symbol Market symbol to get the orderbook depth for. + * @param {number} [limit] Maximum number of bids and asks to return. Default 500; max 1000. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getOrderbookDepth(symbol: string, limit?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getOrderbookDepth(symbol, limit, options).then((request) => request(this.axios, this.basePath)); + } - // authentication bearerAuth required - // http bearer authentication required - await setBearerAuthToObject(localVarHeaderParameter, configuration) + /** + * Retrieves recent trades executed on a market. + * @summary /exchange/trades + * @param {string} symbol The market symbol to get the trades for. + * @param {TradeType} [tradeType] Type of trade. + * @param {number} [limit] Default 500; max 1000. + * @param {number} [startTimeAtMillis] The timestamp specifies the earliest point in time for which data should be returned. The value is not included. + * @param {number} [endTimeAtMillis] The timestamp specifies the latest point in time for which data should be returned. The value is included. + * @param {number} [page] The page number to retrieve in a paginated response. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof ExchangeApi + */ + public getRecentTrades(symbol: string, tradeType?: TradeType, limit?: number, startTimeAtMillis?: number, endTimeAtMillis?: number, page?: number, options?: RawAxiosRequestConfig) { + return ExchangeApiFp(this.configuration).getRecentTrades(symbol, tradeType, limit, startTimeAtMillis, endTimeAtMillis, page, options).then((request) => request(this.axios, this.basePath)); + } +} +/** + * @export + */ +export const GetLeaderboardSortByEnum = { + GetLeaderboardSortByAccountValue: 'accountValue', + GetLeaderboardSortByPnL: 'pnl', + GetLeaderboardSortByVolume: 'volume', + GetLeaderboardSortByUNSPECIFIED: 'UNSPECIFIED' +} as const; +export type GetLeaderboardSortByEnum = typeof GetLeaderboardSortByEnum[keyof typeof GetLeaderboardSortByEnum]; - - setSearchParams(localVarUrlObj, localVarQueryParameter); - let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; - localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; - return { - url: toPathString(localVarUrlObj), - options: localVarRequestOptions, - }; - }, +/** + * KoraApi - axios parameter creator + * @export + */ +export const KoraApiAxiosParamCreator = function (configuration?: Configuration) { + return { /** * Returns the health status of the Kora rewards service. * @summary Kora service health check @@ -8984,108 +8156,6 @@ export const KoraApiAxiosParamCreator = function (configuration?: Configuration) export const KoraApiFp = function(configuration?: Configuration) { const localVarAxiosParamCreator = KoraApiAxiosParamCreator(configuration) return { - /** - * Returns metadata for Kora rewards campaigns. - * @summary Get Kora campaign metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraCampaignMetadata(campaignName, status, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraCampaignMetadata']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the rewards earned by users for Kora campaigns. - * @summary Get Kora campaign rewards - * @param {string} userAddress Specify wallet address - * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name - * @param {number} [epochNumber] Optionally specify epoch number - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraCampaignRewards(userAddress, campaignName, epochNumber, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraCampaignRewards']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns epoch configuration including reward allocations for Kora. - * @summary Get Kora epoch configuration - * @param {number} [intervalNumber] Specify the interval number - * @param {string} [campaignName] Filter by campaign name - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraEpochConfigMetadata(intervalNumber, campaignName, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraEpochConfigMetadata']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the latest or next epoch for a Kora campaign. - * @summary Get Kora epoch metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraEpochMetadata(campaignName, epoch, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraEpochMetadata']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns interval metadata for Kora. - * @summary Get Kora interval metadata - * @param {string} [interval] Interval number or \"next\"/\"latest\" - * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraIntervalMetadata(interval, protocol, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraIntervalMetadata']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns rankings and earnings for Kora swap participants, sorted by the specified category. - * @summary Get Kora swap leaderboard - * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) - * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by - * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by - * @param {number} [page] Page number for pagination - * @param {number} [limit] Page size for pagination - * @param {string} [search] Filter by user address (partial match supported) - * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraLeaderboard']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, - /** - * Returns the all-time rewards earned by users including Kora CC and points. - * @summary Get Kora all-time rewards summary - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - async getKoraRewardsSummary(options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { - const localVarAxiosArgs = await localVarAxiosParamCreator.getKoraRewardsSummary(options); - const localVarOperationServerIndex = configuration?.serverIndex ?? 0; - const localVarOperationServerBasePath = operationServerMap['KoraApi.getKoraRewardsSummary']?.[localVarOperationServerIndex]?.url; - return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath); - }, /** * Returns the health status of the Kora rewards service. * @summary Kora service health check @@ -9108,87 +8178,6 @@ export const KoraApiFp = function(configuration?: Configuration) { export const KoraApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { const localVarFp = KoraApiFp(configuration) return { - /** - * Returns metadata for Kora rewards campaigns. - * @summary Get Kora campaign metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getKoraCampaignMetadata(campaignName, status, options).then((request) => request(axios, basePath)); - }, - /** - * Returns the rewards earned by users for Kora campaigns. - * @summary Get Kora campaign rewards - * @param {string} userAddress Specify wallet address - * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name - * @param {number} [epochNumber] Optionally specify epoch number - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getKoraCampaignRewards(userAddress, campaignName, epochNumber, options).then((request) => request(axios, basePath)); - }, - /** - * Returns epoch configuration including reward allocations for Kora. - * @summary Get Kora epoch configuration - * @param {number} [intervalNumber] Specify the interval number - * @param {string} [campaignName] Filter by campaign name - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getKoraEpochConfigMetadata(intervalNumber, campaignName, options).then((request) => request(axios, basePath)); - }, - /** - * Returns the latest or next epoch for a Kora campaign. - * @summary Get Kora epoch metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getKoraEpochMetadata(campaignName, epoch, options).then((request) => request(axios, basePath)); - }, - /** - * Returns interval metadata for Kora. - * @summary Get Kora interval metadata - * @param {string} [interval] Interval number or \"next\"/\"latest\" - * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getKoraIntervalMetadata(interval, protocol, options).then((request) => request(axios, basePath)); - }, - /** - * Returns rankings and earnings for Kora swap participants, sorted by the specified category. - * @summary Get Kora swap leaderboard - * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) - * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by - * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by - * @param {number} [page] Page number for pagination - * @param {number} [limit] Page size for pagination - * @param {string} [search] Filter by user address (partial match supported) - * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig): AxiosPromise { - return localVarFp.getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options).then((request) => request(axios, basePath)); - }, - /** - * Returns the all-time rewards earned by users including Kora CC and points. - * @summary Get Kora all-time rewards summary - * @param {*} [options] Override http request option. - * @throws {RequiredError} - */ - getKoraRewardsSummary(options?: RawAxiosRequestConfig): AxiosPromise> { - return localVarFp.getKoraRewardsSummary(options).then((request) => request(axios, basePath)); - }, /** * Returns the health status of the Kora rewards service. * @summary Kora service health check @@ -9208,101 +8197,6 @@ export const KoraApiFactory = function (configuration?: Configuration, basePath? * @extends {BaseAPI} */ export class KoraApi extends BaseAPI { - /** - * Returns metadata for Kora rewards campaigns. - * @summary Get Kora campaign metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraCampaignMetadataStatusEnum} [status] Filter by campaign status - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraCampaignMetadata(campaignName?: string, status?: GetKoraCampaignMetadataStatusEnum, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraCampaignMetadata(campaignName, status, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the rewards earned by users for Kora campaigns. - * @summary Get Kora campaign rewards - * @param {string} userAddress Specify wallet address - * @param {GetKoraCampaignRewardsCampaignNameEnum} [campaignName] Specify the campaign name - * @param {number} [epochNumber] Optionally specify epoch number - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraCampaignRewards(userAddress: string, campaignName?: GetKoraCampaignRewardsCampaignNameEnum, epochNumber?: number, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraCampaignRewards(userAddress, campaignName, epochNumber, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns epoch configuration including reward allocations for Kora. - * @summary Get Kora epoch configuration - * @param {number} [intervalNumber] Specify the interval number - * @param {string} [campaignName] Filter by campaign name - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraEpochConfigMetadata(intervalNumber?: number, campaignName?: string, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraEpochConfigMetadata(intervalNumber, campaignName, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the latest or next epoch for a Kora campaign. - * @summary Get Kora epoch metadata - * @param {string} [campaignName] Specify the campaign name - * @param {GetKoraEpochMetadataEpochEnum} [epoch] Specify \"next\" or \"latest\" - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraEpochMetadata(campaignName?: string, epoch?: GetKoraEpochMetadataEpochEnum, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraEpochMetadata(campaignName, epoch, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns interval metadata for Kora. - * @summary Get Kora interval metadata - * @param {string} [interval] Interval number or \"next\"/\"latest\" - * @param {GetKoraIntervalMetadataProtocolEnum} [protocol] Filter by protocol - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraIntervalMetadata(interval?: string, protocol?: GetKoraIntervalMetadataProtocolEnum, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraIntervalMetadata(interval, protocol, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns rankings and earnings for Kora swap participants, sorted by the specified category. - * @summary Get Kora swap leaderboard - * @param {string} [epochId] Specify epoch ID (defaults to current active epoch) - * @param {GetKoraLeaderboardSortByEnum} [sortBy] The category to sort rankings by - * @param {GetKoraLeaderboardSortOrderEnum} [sortOrder] The order to sort rankings by - * @param {number} [page] Page number for pagination - * @param {number} [limit] Page size for pagination - * @param {string} [search] Filter by user address (partial match supported) - * @param {string} [minVolumeE6] Minimum trading volume filter (e6 format) - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraLeaderboard(epochId?: string, sortBy?: GetKoraLeaderboardSortByEnum, sortOrder?: GetKoraLeaderboardSortOrderEnum, page?: number, limit?: number, search?: string, minVolumeE6?: string, options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraLeaderboard(epochId, sortBy, sortOrder, page, limit, search, minVolumeE6, options).then((request) => request(this.axios, this.basePath)); - } - - /** - * Returns the all-time rewards earned by users including Kora CC and points. - * @summary Get Kora all-time rewards summary - * @param {*} [options] Override http request option. - * @throws {RequiredError} - * @memberof KoraApi - */ - public getKoraRewardsSummary(options?: RawAxiosRequestConfig) { - return KoraApiFp(this.configuration).getKoraRewardsSummary(options).then((request) => request(this.axios, this.basePath)); - } - /** * Returns the health status of the Kora rewards service. * @summary Kora service health check @@ -9315,54 +8209,6 @@ export class KoraApi extends BaseAPI { } } -/** - * @export - */ -export const GetKoraCampaignMetadataStatusEnum = { - Active: 'ACTIVE', - Inactive: 'INACTIVE' -} as const; -export type GetKoraCampaignMetadataStatusEnum = typeof GetKoraCampaignMetadataStatusEnum[keyof typeof GetKoraCampaignMetadataStatusEnum]; -/** - * @export - */ -export const GetKoraCampaignRewardsCampaignNameEnum = { - KoraSwaps: 'KORA_SWAPS' -} as const; -export type GetKoraCampaignRewardsCampaignNameEnum = typeof GetKoraCampaignRewardsCampaignNameEnum[keyof typeof GetKoraCampaignRewardsCampaignNameEnum]; -/** - * @export - */ -export const GetKoraEpochMetadataEpochEnum = { - Next: 'next', - Latest: 'latest' -} as const; -export type GetKoraEpochMetadataEpochEnum = typeof GetKoraEpochMetadataEpochEnum[keyof typeof GetKoraEpochMetadataEpochEnum]; -/** - * @export - */ -export const GetKoraIntervalMetadataProtocolEnum = { - Bluefin: 'bluefin', - Kora: 'kora' -} as const; -export type GetKoraIntervalMetadataProtocolEnum = typeof GetKoraIntervalMetadataProtocolEnum[keyof typeof GetKoraIntervalMetadataProtocolEnum]; -/** - * @export - */ -export const GetKoraLeaderboardSortByEnum = { - VolumeRank: 'volumeRank', - TransactionRank: 'transactionRank', - TotalEarnings: 'totalEarnings' -} as const; -export type GetKoraLeaderboardSortByEnum = typeof GetKoraLeaderboardSortByEnum[keyof typeof GetKoraLeaderboardSortByEnum]; -/** - * @export - */ -export const GetKoraLeaderboardSortOrderEnum = { - Asc: 'asc', - Desc: 'desc' -} as const; -export type GetKoraLeaderboardSortOrderEnum = typeof GetKoraLeaderboardSortOrderEnum[keyof typeof GetKoraLeaderboardSortOrderEnum]; /** @@ -9907,6 +8753,43 @@ 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 the bonuses earned by all users for a specific epoch number. + * @summary Get all user bonuses by epoch + * @param {number} epochNumber Specify the epoch number + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserBonuses: async (epochNumber: number, options: RawAxiosRequestConfig = {}): Promise => { + // verify required parameter 'epochNumber' is not null or undefined + assertParamExists('getUserBonuses', 'epochNumber', epochNumber) + const localVarPath = `/v1/rewards/bonuses`; + // 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 (epochNumber !== undefined) { + localVarQueryParameter['epochNumber'] = epochNumber; + } + + + setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; @@ -10309,6 +9192,19 @@ 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 the bonuses earned by all users for a specific epoch number. + * @summary Get all user bonuses by epoch + * @param {number} epochNumber Specify the epoch number + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async getUserBonuses(epochNumber: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise>> { + const localVarAxiosArgs = await localVarAxiosParamCreator.getUserBonuses(epochNumber, options); + const localVarOperationServerIndex = configuration?.serverIndex ?? 0; + const localVarOperationServerBasePath = operationServerMap['RewardsApi.getUserBonuses']?.[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 @@ -10528,6 +9424,16 @@ export const RewardsApiFactory = function (configuration?: Configuration, basePa getRewardsSummary(options?: RawAxiosRequestConfig): AxiosPromise> { return localVarFp.getRewardsSummary(options).then((request) => request(axios, basePath)); }, + /** + * Returns the bonuses earned by all users for a specific epoch number. + * @summary Get all user bonuses by epoch + * @param {number} epochNumber Specify the epoch number + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + getUserBonuses(epochNumber: number, options?: RawAxiosRequestConfig): AxiosPromise> { + return localVarFp.getUserBonuses(epochNumber, 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 @@ -10758,6 +9664,18 @@ export class RewardsApi extends BaseAPI { return RewardsApiFp(this.configuration).getRewardsSummary(options).then((request) => request(this.axios, this.basePath)); } + /** + * Returns the bonuses earned by all users for a specific epoch number. + * @summary Get all user bonuses by epoch + * @param {number} epochNumber Specify the epoch number + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof RewardsApi + */ + public getUserBonuses(epochNumber: number, options?: RawAxiosRequestConfig) { + return RewardsApiFp(this.configuration).getUserBonuses(epochNumber, 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/Error1.md b/ts/sdk/src/docs/Error1.md new file mode 100644 index 00000000..21ad6901 --- /dev/null +++ b/ts/sdk/src/docs/Error1.md @@ -0,0 +1,22 @@ +# Error1 + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **string** | Error message | [optional] [default to undefined] +**code** | **string** | Error code | [optional] [default to undefined] + +## Example + +```typescript +import { Error1 } from '@bluefin/api-client'; + +const instance: Error1 = { + error, + code, +}; +``` + +[[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/KoraApi.md b/ts/sdk/src/docs/KoraApi.md index 73982b60..7192aaf2 100644 --- a/ts/sdk/src/docs/KoraApi.md +++ b/ts/sdk/src/docs/KoraApi.md @@ -4,403 +4,8 @@ All URIs are relative to *https://api.sui-staging.bluefin.io* |Method | HTTP request | Description| |------------- | ------------- | -------------| -|[**getKoraCampaignMetadata**](#getkoracampaignmetadata) | **GET** /v1/kora/metadata/campaign | Get Kora campaign metadata| -|[**getKoraCampaignRewards**](#getkoracampaignrewards) | **GET** /v1/kora/rewards/campaign | Get Kora campaign rewards| -|[**getKoraEpochConfigMetadata**](#getkoraepochconfigmetadata) | **GET** /v1/kora/metadata/epoch/configs | Get Kora epoch configuration| -|[**getKoraEpochMetadata**](#getkoraepochmetadata) | **GET** /v1/kora/metadata/epoch | Get Kora epoch metadata| -|[**getKoraIntervalMetadata**](#getkoraintervalmetadata) | **GET** /v1/kora/metadata/interval | Get Kora interval metadata| -|[**getKoraLeaderboard**](#getkoraleaderboard) | **GET** /v1/kora/leaderboard | Get Kora swap leaderboard| -|[**getKoraRewardsSummary**](#getkorarewardssummary) | **GET** /v1/kora/rewards/summary | Get Kora all-time rewards summary| |[**koraHealthCheck**](#korahealthcheck) | **GET** /v1/kora/health | Kora service health check| -# **getKoraCampaignMetadata** -> Array getKoraCampaignMetadata() - -Returns metadata for Kora rewards campaigns. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let campaignName: string; //Specify the campaign name (optional) (default to undefined) -let status: 'ACTIVE' | 'INACTIVE'; //Filter by campaign status (optional) (default to 'ACTIVE') - -const { status, data } = await apiInstance.getKoraCampaignMetadata( - campaignName, - status -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **campaignName** | [**string**] | Specify the campaign name | (optional) defaults to undefined| -| **status** | [**'ACTIVE' | 'INACTIVE'**]**Array<'ACTIVE' | 'INACTIVE'>** | Filter by campaign status | (optional) defaults to 'ACTIVE'| - - -### Return type - -**Array** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | - -[[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) - -# **getKoraCampaignRewards** -> Array getKoraCampaignRewards() - -Returns the rewards earned by users for Kora campaigns. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let userAddress: string; //Specify wallet address (default to undefined) -let campaignName: 'KORA_SWAPS'; //Specify the campaign name (optional) (default to 'KORA_SWAPS') -let epochNumber: number; //Optionally specify epoch number (optional) (default to undefined) - -const { status, data } = await apiInstance.getKoraCampaignRewards( - userAddress, - campaignName, - epochNumber -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **userAddress** | [**string**] | Specify wallet address | defaults to undefined| -| **campaignName** | [**'KORA_SWAPS'**]**Array<'KORA_SWAPS'>** | Specify the campaign name | (optional) defaults to 'KORA_SWAPS'| -| **epochNumber** | [**number**] | Optionally specify epoch number | (optional) defaults to undefined| - - -### Return type - -**Array** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | -|**400** | 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) - -# **getKoraEpochConfigMetadata** -> KoraEpochConfigResponse getKoraEpochConfigMetadata() - -Returns epoch configuration including reward allocations for Kora. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let intervalNumber: number; //Specify the interval number (optional) (default to undefined) -let campaignName: string; //Filter by campaign name (optional) (default to undefined) - -const { status, data } = await apiInstance.getKoraEpochConfigMetadata( - intervalNumber, - campaignName -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **intervalNumber** | [**number**] | Specify the interval number | (optional) defaults to undefined| -| **campaignName** | [**string**] | Filter by campaign name | (optional) defaults to undefined| - - -### Return type - -**KoraEpochConfigResponse** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | - -[[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) - -# **getKoraEpochMetadata** -> Array getKoraEpochMetadata() - -Returns the latest or next epoch for a Kora campaign. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let campaignName: string; //Specify the campaign name (optional) (default to undefined) -let epoch: 'next' | 'latest'; //Specify \"next\" or \"latest\" (optional) (default to undefined) - -const { status, data } = await apiInstance.getKoraEpochMetadata( - campaignName, - epoch -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **campaignName** | [**string**] | Specify the campaign name | (optional) defaults to undefined| -| **epoch** | [**'next' | 'latest'**]**Array<'next' | 'latest'>** | Specify \"next\" or \"latest\" | (optional) defaults to undefined| - - -### Return type - -**Array** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | - -[[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) - -# **getKoraIntervalMetadata** -> Array getKoraIntervalMetadata() - -Returns interval metadata for Kora. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let interval: string; //Interval number or \"next\"/\"latest\" (optional) (default to undefined) -let protocol: 'bluefin' | 'kora'; //Filter by protocol (optional) (default to 'kora') - -const { status, data } = await apiInstance.getKoraIntervalMetadata( - interval, - protocol -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **interval** | [**string**] | Interval number or \"next\"/\"latest\" | (optional) defaults to undefined| -| **protocol** | [**'bluefin' | 'kora'**]**Array<'bluefin' | 'kora'>** | Filter by protocol | (optional) defaults to 'kora'| - - -### Return type - -**Array** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | - -[[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) - -# **getKoraLeaderboard** -> KoraLeaderboardResponse getKoraLeaderboard() - -Returns rankings and earnings for Kora swap participants, sorted by the specified category. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -let epochId: string; //Specify epoch ID (defaults to current active epoch) (optional) (default to undefined) -let sortBy: 'volumeRank' | 'transactionRank' | 'totalEarnings'; //The category to sort rankings by (optional) (default to 'volumeRank') -let sortOrder: 'asc' | 'desc'; //The order to sort rankings by (optional) (default to 'desc') -let page: number; //Page number for pagination (optional) (default to 1) -let limit: number; //Page size for pagination (optional) (default to 50) -let search: string; //Filter by user address (partial match supported) (optional) (default to undefined) -let minVolumeE6: string; //Minimum trading volume filter (e6 format) (optional) (default to '0') - -const { status, data } = await apiInstance.getKoraLeaderboard( - epochId, - sortBy, - sortOrder, - page, - limit, - search, - minVolumeE6 -); -``` - -### Parameters - -|Name | Type | Description | Notes| -|------------- | ------------- | ------------- | -------------| -| **epochId** | [**string**] | Specify epoch ID (defaults to current active epoch) | (optional) defaults to undefined| -| **sortBy** | [**'volumeRank' | 'transactionRank' | 'totalEarnings'**]**Array<'volumeRank' | 'transactionRank' | 'totalEarnings'>** | The category to sort rankings by | (optional) defaults to 'volumeRank'| -| **sortOrder** | [**'asc' | 'desc'**]**Array<'asc' | 'desc'>** | The order to sort rankings by | (optional) defaults to 'desc'| -| **page** | [**number**] | Page number for pagination | (optional) defaults to 1| -| **limit** | [**number**] | Page size for pagination | (optional) defaults to 50| -| **search** | [**string**] | Filter by user address (partial match supported) | (optional) defaults to undefined| -| **minVolumeE6** | [**string**] | Minimum trading volume filter (e6 format) | (optional) defaults to '0'| - - -### Return type - -**KoraLeaderboardResponse** - -### Authorization - -No authorization required - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | -|**400** | Invalid request 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) - -# **getKoraRewardsSummary** -> Array getKoraRewardsSummary() - -Returns the all-time rewards earned by users including Kora CC and points. - -### Example - -```typescript -import { - KoraApi, - Configuration -} from '@bluefin/api-client'; - -const configuration = new Configuration(); -const apiInstance = new KoraApi(configuration); - -const { status, data } = await apiInstance.getKoraRewardsSummary(); -``` - -### Parameters -This endpoint does not have any parameters. - - -### Return type - -**Array** - -### Authorization - -[bearerAuth](../README.md#bearerAuth) - -### HTTP request headers - - - **Content-Type**: Not defined - - **Accept**: application/json - - -### HTTP response details -| Status code | Description | Response headers | -|-------------|-------------|------------------| -|**200** | Successful response | - | - -[[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) - # **koraHealthCheck** > KoraHealthCheck200Response koraHealthCheck() diff --git a/ts/sdk/src/docs/KoraUserBonusResponse.md b/ts/sdk/src/docs/KoraUserBonusResponse.md new file mode 100644 index 00000000..c3a5f402 --- /dev/null +++ b/ts/sdk/src/docs/KoraUserBonusResponse.md @@ -0,0 +1,28 @@ +# KoraUserBonusResponse + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**userAddress** | **string** | User wallet address | [default to undefined] +**epochNumber** | **number** | Epoch number for the bonus | [default to undefined] +**bonusPoints** | **string** | Total bonus points earned | [default to undefined] +**bonusCcRewards** | **string** | Total bonus CC rewards earned | [default to undefined] +**criteria** | **string** | Criteria for earning the bonus | [optional] [default to undefined] + +## Example + +```typescript +import { KoraUserBonusResponse } from '@bluefin/api-client'; + +const instance: KoraUserBonusResponse = { + userAddress, + epochNumber, + bonusPoints, + bonusCcRewards, + criteria, +}; +``` + +[[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..0097dea7 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| +|[**getUserBonuses**](#getuserbonuses) | **GET** /v1/rewards/bonuses | Get all user bonuses by epoch| |[**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,58 @@ 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) +# **getUserBonuses** +> Array getUserBonuses() + +Returns the bonuses earned by all users for a specific epoch number. + +### Example + +```typescript +import { + RewardsApi, + Configuration +} from '@bluefin/api-client'; + +const configuration = new Configuration(); +const apiInstance = new RewardsApi(configuration); + +let epochNumber: number; //Specify the epoch number (default to undefined) + +const { status, data } = await apiInstance.getUserBonuses( + epochNumber +); +``` + +### Parameters + +|Name | Type | Description | Notes| +|------------- | ------------- | ------------- | -------------| +| **epochNumber** | [**number**] | Specify the epoch number | defaults to undefined| + + +### Return type + +**Array** + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +|**200** | Successful response | - | +|**400** | 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) From 0c1f42d0027ee2a862d7a9b667c83c7d675a16ba Mon Sep 17 00:00:00 2001 From: nidakarimali Date: Tue, 3 Mar 2026 23:48:46 -0500 Subject: [PATCH 3/5] updated URL --- resources/kora-rewards-api.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/kora-rewards-api.yaml b/resources/kora-rewards-api.yaml index c9e2c193..fbfe77fd 100644 --- a/resources/kora-rewards-api.yaml +++ b/resources/kora-rewards-api.yaml @@ -12,7 +12,7 @@ tags: - name: Rewards description: General rewards endpoints extended for Kora servers: - - url: https://api.{env}.bluefin.io + - url: https://api.{env}.kora.so variables: env: default: sui-staging From 0e7246a0adac32695cb8f9350f13ad58236dc8e5 Mon Sep 17 00:00:00 2001 From: nidakarimali Date: Wed, 4 Mar 2026 10:14:20 -0500 Subject: [PATCH 4/5] removed auth from kora rewards summary endpoint --- python/sdk/src/.openapi-generator/FILES | 2 -- resources/kora-rewards-api.yaml | 10 ++++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/python/sdk/src/.openapi-generator/FILES b/python/sdk/src/.openapi-generator/FILES index fb3a3510..a0340d52 100644 --- a/python/sdk/src/.openapi-generator/FILES +++ b/python/sdk/src/.openapi-generator/FILES @@ -307,6 +307,4 @@ openapi_client/models/zk_login_zkp_request.py openapi_client/models/zk_login_zkp_response.py openapi_client/rest.py openapi_client/test/__init__.py -openapi_client/test/test_error1.py -openapi_client/test/test_kora_user_bonus_response.py openapi_client_README.md diff --git a/resources/kora-rewards-api.yaml b/resources/kora-rewards-api.yaml index fbfe77fd..9a7e279a 100644 --- a/resources/kora-rewards-api.yaml +++ b/resources/kora-rewards-api.yaml @@ -400,8 +400,14 @@ paths: operationId: getRewardsSummary summary: Get all-time rewards summary description: Returns the all-time rewards earned by users including Kora CC and points. - security: - - bearerAuth: [] + parameters: + - name: userAddress + in: query + required: true + description: Specify wallet address + schema: + type: string + example: "0x1234567890abcdef" responses: "200": description: Successful response From e13f07101564b3de2d4eae54e761c50a48c88847 Mon Sep 17 00:00:00 2001 From: nidakarimali Date: Wed, 4 Mar 2026 12:51:09 -0500 Subject: [PATCH 5/5] removed sui from kora url --- resources/kora-rewards-api.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/kora-rewards-api.yaml b/resources/kora-rewards-api.yaml index 9a7e279a..03741c5a 100644 --- a/resources/kora-rewards-api.yaml +++ b/resources/kora-rewards-api.yaml @@ -15,10 +15,10 @@ servers: - url: https://api.{env}.kora.so variables: env: - default: sui-staging + default: staging enum: - - sui-staging - - sui-prod + - staging + - prod components: securitySchemes: