From 830c1d7fed95c741fea74c597b52de9eb1b7a819 Mon Sep 17 00:00:00 2001 From: Nikita Date: Thu, 19 Mar 2026 13:04:30 -0500 Subject: [PATCH] Revert "update auth openapi spec" --- .apigen-state | 9 +- .gitignore | 2 - Makefile | 40 ---- python/sdk/config.yaml | 2 +- python/sdk/pyproject.toml | 2 +- python/sdk/src/.openapi-generator-ignore | 6 - python/sdk/src/openapi_client/__init__.py | 2 +- python/sdk/src/openapi_client/api_client.py | 2 +- .../sdk/src/openapi_client/configuration.py | 2 +- python/sdk/src/openapi_client_README.md | 2 +- resources/auth-api.yaml | 41 +++- resources/auth-common.yaml | 34 --- rust/Cargo.toml | 2 +- rust/gen/bluefin_api/.openapi-generator/FILES | 1 - rust/gen/bluefin_api/Cargo.toml | 2 +- rust/gen/bluefin_api/README.md | 2 +- .../bluefin_api/docs/AffiliateMetadataFees.md | 16 ++ rust/gen/bluefin_api/docs/CampaignRewards.md | 11 + .../docs/CreateOrderRequestTwapConfig.md | 12 + ...ewardsIntervalMetadataIntervalParameter.md | 12 + rust/gen/bluefin_api/docs/PingRequest.md | 11 + rust/gen/bluefin_api/docs/PingResponse.md | 11 + .../docs/PostCreateOrder202Response.md | 11 + .../src/models/affiliate_metadata_fees.rs | 50 ++++ .../src/models/campaign_rewards.rs | 27 +++ .../create_order_request_twap_config.rs | 34 +++ ...ds_interval_metadata_interval_parameter.rs | 26 +++ .../bluefin_api/src/models/ping_request.rs | 28 +++ .../bluefin_api/src/models/ping_response.rs | 39 ++++ .../models/post_create_order_202_response.rs | 28 +++ rust/gen/config.yaml | 2 +- scripts/version_bump.py | 218 ------------------ ts/sdk/openapitools.json | 4 +- ts/sdk/package.json | 4 +- ts/sdk/src/.openapi-generator-ignore | 6 +- 35 files changed, 369 insertions(+), 332 deletions(-) delete mode 100644 Makefile delete mode 100644 resources/auth-common.yaml create mode 100644 rust/gen/bluefin_api/docs/AffiliateMetadataFees.md create mode 100644 rust/gen/bluefin_api/docs/CampaignRewards.md create mode 100644 rust/gen/bluefin_api/docs/CreateOrderRequestTwapConfig.md create mode 100644 rust/gen/bluefin_api/docs/GetRewardsIntervalMetadataIntervalParameter.md create mode 100644 rust/gen/bluefin_api/docs/PingRequest.md create mode 100644 rust/gen/bluefin_api/docs/PingResponse.md create mode 100644 rust/gen/bluefin_api/docs/PostCreateOrder202Response.md create mode 100644 rust/gen/bluefin_api/src/models/affiliate_metadata_fees.rs create mode 100644 rust/gen/bluefin_api/src/models/campaign_rewards.rs create mode 100644 rust/gen/bluefin_api/src/models/create_order_request_twap_config.rs create mode 100644 rust/gen/bluefin_api/src/models/get_rewards_interval_metadata_interval_parameter.rs create mode 100644 rust/gen/bluefin_api/src/models/ping_request.rs create mode 100644 rust/gen/bluefin_api/src/models/ping_response.rs create mode 100644 rust/gen/bluefin_api/src/models/post_create_order_202_response.rs delete mode 100644 scripts/version_bump.py diff --git a/.apigen-state b/.apigen-state index 9b4f8430..21f0d141 100644 --- a/.apigen-state +++ b/.apigen-state @@ -1,11 +1,10 @@ { "version": "1", "algorithm": "sha256", - "generated_at": "2026-03-18T22:53:13.035771Z", + "generated_at": "2026-03-13T22:19:43.014785Z", "spec_files": { "resources/account-data-api.yaml": "2d366acf63b1412c3b49583b22aea07829f297332ebd1b0680954d0d248f2998", - "resources/auth-api.yaml": "7fa07edd6586d00e8fd1e23fc81c83698800aa9cbfd3fa107072952d96bbf99a", - "resources/auth-common.yaml": "dbc5d97472a5051fe79a4fef919bc3e4c4d5d2e4751d0aab65c051be56174e1f", + "resources/auth-api.yaml": "0d6fcdb4ed69131adc765b20ea0e6dc4ef735a0a579c3e44e62ed23dde4a0d84", "resources/bluefin-api.yaml": "b81cebbb70822b4806a9c56e819d6dd1b52453f4b37d63a95a14dae7cf0edb9c", "resources/common.yaml": "71dc565fccebcc9e71b49b48448d2583903aec7e2d16ef1d69972b50f2e4250f", "resources/exchange-api.yaml": "a309b3a5c29fb71dcc26d6f8018883ec51b42db43c29fee7b7ed4f0997146f77", @@ -14,5 +13,5 @@ "resources/vera-api.yaml": "f4c51b5f6614dd4e3b9f5f1f01f945e06d9090849530ecb916ad4ae18d8f61a0", "resources/websocket-api.yaml": "c2c51ceea701bff0b7e911e9afdb0addeb4d7f173b2a25b996d13f5462cb535b" }, - "combined_hash": "752605421bfad83cb0424a9a943d7430a3b34bf812412955da279ac70e7df15e" -} + "combined_hash": "84124ae2265b7acb3be586b12a4f7a848f85abb212120f7b29c9ab6989ef55fc" +} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 8781a73f..547ca4fd 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,6 @@ /target/ .idea/ .vscode/ -.zed .venv /ts/dist /ts/sdk/node_modules @@ -10,4 +9,3 @@ **/openapitools.json out tools/**/target -.DS_Store diff --git a/Makefile b/Makefile deleted file mode 100644 index 5913c16f..00000000 --- a/Makefile +++ /dev/null @@ -1,40 +0,0 @@ -OPENAPI_GEN_VERSION := 7.13.0 -OPENAPI_GEN_IMAGE := openapitools/openapi-generator-cli:v$(OPENAPI_GEN_VERSION) - -SPEC := resources/bluefin-api.yaml - -DOCKER_RUN := docker run --rm -v $(CURDIR):/work -w /work $(OPENAPI_GEN_IMAGE) generate \ - --input-spec /work/$(SPEC) - -.PHONY: generate generate-ts generate-py generate-rs version-bump help - -# --- Code Generation --- - -version-bump: ## Detect spec changes and bump SDK versions - python3 scripts/version_bump.py - -generate: generate-ts generate-py generate-rs version-bump ## Generate all SDK clients - -generate-ts: ## Generate TypeScript client - $(DOCKER_RUN) \ - --config /work/ts/sdk/openapitools.json \ - --generator-name typescript-axios \ - --output /work/ts/sdk/src - -generate-py: ## Generate Python client - $(DOCKER_RUN) \ - --config /work/python/sdk/config.yaml \ - --generator-name python \ - --output /work/python/sdk/src - -generate-rs: ## Generate Rust client - rm -rf rust/gen/bluefin_api - $(DOCKER_RUN) \ - --config /work/rust/gen/config.yaml \ - --generator-name rust \ - --output /work/rust/gen/bluefin_api - -# --- Help --- - -help: ## Show this help - @grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-20s\033[0m %s\n", $$1, $$2}' diff --git a/python/sdk/config.yaml b/python/sdk/config.yaml index 070bb1ab..a09e4acc 100644 --- a/python/sdk/config.yaml +++ b/python/sdk/config.yaml @@ -2,4 +2,4 @@ additionalProperties: library: asyncio generateSourceCodeOnly: true useOneOfDiscriminatorLookup: true - packageVersion: 1.16.0 + packageVersion: 1.15.0 diff --git a/python/sdk/pyproject.toml b/python/sdk/pyproject.toml index eaa22e69..c6a5aeb5 100644 --- a/python/sdk/pyproject.toml +++ b/python/sdk/pyproject.toml @@ -21,7 +21,7 @@ description = "Python Boilerplate contains all the boilerplate you need to creat name = "bluefin_pro_sdk" readme = "README.rst" requires-python = ">=3.9.2,<3.14.0" -version = "1.16.0" +version = "1.15.0" [[project.authors]] email = "audreyr@example.com" diff --git a/python/sdk/src/.openapi-generator-ignore b/python/sdk/src/.openapi-generator-ignore index 86a31eb3..7484ee59 100644 --- a/python/sdk/src/.openapi-generator-ignore +++ b/python/sdk/src/.openapi-generator-ignore @@ -21,9 +21,3 @@ #docs/*.md # Then explicitly reverse the ignore rule for a single file: #!docs/README.md - -# Hand-written SDK files -__init__.py -bluefin_pro_sdk.py -crypto_helpers/** -websocket/** diff --git a/python/sdk/src/openapi_client/__init__.py b/python/sdk/src/openapi_client/__init__.py index d58eeb6b..df1f1a1b 100644 --- a/python/sdk/src/openapi_client/__init__.py +++ b/python/sdk/src/openapi_client/__init__.py @@ -14,7 +14,7 @@ """ # noqa: E501 -__version__ = "1.16.0" +__version__ = "1.15.0" # import apis into sdk package from openapi_client.api.account_data_api import AccountDataApi diff --git a/python/sdk/src/openapi_client/api_client.py b/python/sdk/src/openapi_client/api_client.py index d8159605..a0e8e59c 100644 --- a/python/sdk/src/openapi_client/api_client.py +++ b/python/sdk/src/openapi_client/api_client.py @@ -90,7 +90,7 @@ def __init__( self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/1.16.0/python' + self.user_agent = 'OpenAPI-Generator/1.15.0/python' self.client_side_validation = configuration.client_side_validation async def __aenter__(self): diff --git a/python/sdk/src/openapi_client/configuration.py b/python/sdk/src/openapi_client/configuration.py index 7d88564f..96c9ac01 100644 --- a/python/sdk/src/openapi_client/configuration.py +++ b/python/sdk/src/openapi_client/configuration.py @@ -507,7 +507,7 @@ def to_debug_report(self) -> str: "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 1.0.0\n"\ - "SDK Package Version: 1.16.0".\ + "SDK Package Version: 1.15.0".\ format(env=sys.platform, pyversion=sys.version) def get_host_settings(self) -> List[HostSetting]: diff --git a/python/sdk/src/openapi_client_README.md b/python/sdk/src/openapi_client_README.md index 2b9095d6..05b7d367 100644 --- a/python/sdk/src/openapi_client_README.md +++ b/python/sdk/src/openapi_client_README.md @@ -4,7 +4,7 @@ Bluefin API The `openapi_client` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: 1.0.0 -- Package version: 1.16.0 +- Package version: 1.15.0 - Generator version: 7.13.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen diff --git a/resources/auth-api.yaml b/resources/auth-api.yaml index d481ae86..343361e4 100644 --- a/resources/auth-api.yaml +++ b/resources/auth-api.yaml @@ -16,6 +16,13 @@ servers: - sui-prod components: + responses: + DefaultError: + description: Unexpected error + content: + application/json: + schema: + $ref: './common.yaml#/components/schemas/Error' schemas: JwksResponse: type: object @@ -75,6 +82,26 @@ components: - accountAddress - signedAtMillis - audience + LoginResponse: + type: object + required: + - accessToken + - accessTokenValidForSeconds + - refreshToken + - refreshTokenValidForSeconds + properties: + accessToken: + type: string + accessTokenValidForSeconds: + type: integer + format: int64 + x-go-type: int64 + refreshToken: + type: string + refreshTokenValidForSeconds: + type: integer + format: int64 + x-go-type: int64 RefreshTokenRequest: type: object required: @@ -245,7 +272,7 @@ paths: schema: $ref: '#/components/schemas/OpenIDConfigurationResponse' default: - $ref: './auth-common.yaml#/components/responses/DefaultError' + $ref: '#/components/responses/DefaultError' /auth/zklogin: get: tags: @@ -332,7 +359,7 @@ paths: schema: $ref: '#/components/schemas/JwksResponse' default: - $ref: './auth-common.yaml#/components/responses/DefaultError' + $ref: '#/components/responses/DefaultError' /auth/token: post: tags: @@ -378,7 +405,7 @@ paths: content: application/json: schema: - $ref: './auth-common.yaml#/components/schemas/LoginResponse' + $ref: '#/components/schemas/LoginResponse' '400': description: "bad signature" content: @@ -404,7 +431,7 @@ paths: schema: $ref: "./common.yaml#/components/schemas/Error" default: - $ref: './auth-common.yaml#/components/responses/DefaultError' + $ref: '#/components/responses/DefaultError' /auth/v2/token: post: tags: @@ -450,7 +477,7 @@ paths: content: application/json: schema: - $ref: './auth-common.yaml#/components/schemas/LoginResponse' + $ref: '#/components/schemas/LoginResponse' '400': description: "bad signature" content: @@ -476,7 +503,7 @@ paths: schema: $ref: "./common.yaml#/components/schemas/Error" default: - $ref: './auth-common.yaml#/components/responses/DefaultError' + $ref: '#/components/responses/DefaultError' /auth/token/refresh: put: tags: @@ -514,7 +541,7 @@ paths: schema: $ref: "./common.yaml#/components/schemas/Error" default: - $ref: './auth-common.yaml#/components/responses/DefaultError' + $ref: '#/components/responses/DefaultError' /auth/client-credentials: post: diff --git a/resources/auth-common.yaml b/resources/auth-common.yaml deleted file mode 100644 index c2284cda..00000000 --- a/resources/auth-common.yaml +++ /dev/null @@ -1,34 +0,0 @@ -openapi: 3.0.3 -info: - title: Auth Common Schemas - version: v1 - description: Shared authentication schemas. -components: - responses: - DefaultError: - description: Unexpected error - content: - application/json: - schema: - $ref: "./common.yaml#/components/schemas/Error" - schemas: - LoginResponse: - type: object - required: - - accessToken - - accessTokenValidForSeconds - - refreshToken - - refreshTokenValidForSeconds - properties: - accessToken: - type: string - accessTokenValidForSeconds: - type: integer - format: int64 - x-go-type: int64 - refreshToken: - type: string - refreshTokenValidForSeconds: - type: integer - format: int64 - x-go-type: int64 diff --git a/rust/Cargo.toml b/rust/Cargo.toml index d2eb0b71..457c4d81 100644 --- a/rust/Cargo.toml +++ b/rust/Cargo.toml @@ -9,7 +9,7 @@ sha2 = "0.10.9" [dependencies.bluefin_api] path = "gen/bluefin_api" -version = "1.16.0" +version = "1.15.0" [dependencies.ed25519-dalek] features = ["rand_core"] diff --git a/rust/gen/bluefin_api/.openapi-generator/FILES b/rust/gen/bluefin_api/.openapi-generator/FILES index d05adada..9f5fda1d 100644 --- a/rust/gen/bluefin_api/.openapi-generator/FILES +++ b/rust/gen/bluefin_api/.openapi-generator/FILES @@ -1,5 +1,4 @@ .gitignore -.openapi-generator-ignore .travis.yml Cargo.toml README.md diff --git a/rust/gen/bluefin_api/Cargo.toml b/rust/gen/bluefin_api/Cargo.toml index 7ea6ff14..812dee9b 100644 --- a/rust/gen/bluefin_api/Cargo.toml +++ b/rust/gen/bluefin_api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bluefin_api" -version = "1.16.0" +version = "1.15.0" authors = ["OpenAPI Generator team and contributors"] description = "Bluefin API" license = "MIT OR Apache-2.0" diff --git a/rust/gen/bluefin_api/README.md b/rust/gen/bluefin_api/README.md index 9ee06512..f7b5a752 100644 --- a/rust/gen/bluefin_api/README.md +++ b/rust/gen/bluefin_api/README.md @@ -8,7 +8,7 @@ Bluefin API This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client. - API version: 1.0.0 -- Package version: 1.16.0 +- Package version: 1.15.0 - Generator version: 7.13.0 - Build package: `org.openapitools.codegen.languages.RustClientCodegen` diff --git a/rust/gen/bluefin_api/docs/AffiliateMetadataFees.md b/rust/gen/bluefin_api/docs/AffiliateMetadataFees.md new file mode 100644 index 00000000..8a6ecfec --- /dev/null +++ b/rust/gen/bluefin_api/docs/AffiliateMetadataFees.md @@ -0,0 +1,16 @@ +# AffiliateMetadataFees + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**referral_perps_fee** | Option<**String**> | Earnings from referral perps fees (e9 format) | [optional] +**subaffiliate_perps_earnings** | Option<**String**> | Earnings from subaffiliate perps (e9 format) | [optional] +**spot_lp_fee** | Option<**String**> | Earnings from spot LP fees (e9 format) | [optional] +**referral_spot_lp_fee** | Option<**String**> | Earnings from referral spot LP fees (e9 format) | [optional] +**referral_lending_rewards** | Option<**String**> | Earnings from referral lending rewards (e9 format) | [optional] +**perps_fee_cashback** | Option<**String**> | Cashback from perps fees (e9 format) | [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/CampaignRewards.md b/rust/gen/bluefin_api/docs/CampaignRewards.md new file mode 100644 index 00000000..061f1e30 --- /dev/null +++ b/rust/gen/bluefin_api/docs/CampaignRewards.md @@ -0,0 +1,11 @@ +# CampaignRewards + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**rewards** | Option<[**models::UserCampaignRewards**](UserCampaignRewards.md)> | | [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/CreateOrderRequestTwapConfig.md b/rust/gen/bluefin_api/docs/CreateOrderRequestTwapConfig.md new file mode 100644 index 00000000..c67fefb4 --- /dev/null +++ b/rust/gen/bluefin_api/docs/CreateOrderRequestTwapConfig.md @@ -0,0 +1,12 @@ +# CreateOrderRequestTwapConfig + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sub_orders_count** | Option<**String**> | Number of sub-orders to split the total quantity into | [optional] +**running_time_in_minutes** | Option<**String**> | Total time in minutes over which to execute the TWAP order | [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/GetRewardsIntervalMetadataIntervalParameter.md b/rust/gen/bluefin_api/docs/GetRewardsIntervalMetadataIntervalParameter.md new file mode 100644 index 00000000..581b7609 --- /dev/null +++ b/rust/gen/bluefin_api/docs/GetRewardsIntervalMetadataIntervalParameter.md @@ -0,0 +1,12 @@ +# GetRewardsIntervalMetadataIntervalParameter + +## Enum Variants + +| Name | Description | +|---- | -----| +| String | | +| i32 | | + +[[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/PingRequest.md b/rust/gen/bluefin_api/docs/PingRequest.md new file mode 100644 index 00000000..c4140658 --- /dev/null +++ b/rust/gen/bluefin_api/docs/PingRequest.md @@ -0,0 +1,11 @@ +# PingRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**client** | Option<**String**> | Optional client identifier (e.g. mobile, web). | [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/PingResponse.md b/rust/gen/bluefin_api/docs/PingResponse.md new file mode 100644 index 00000000..d0439fee --- /dev/null +++ b/rust/gen/bluefin_api/docs/PingResponse.md @@ -0,0 +1,11 @@ +# PingResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **String** | | + +[[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/PostCreateOrder202Response.md b/rust/gen/bluefin_api/docs/PostCreateOrder202Response.md new file mode 100644 index 00000000..426cf989 --- /dev/null +++ b/rust/gen/bluefin_api/docs/PostCreateOrder202Response.md @@ -0,0 +1,11 @@ +# PostCreateOrder202Response + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**order_hash** | **String** | The unique identifier of this order, to be used as a lookup key | + +[[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/models/affiliate_metadata_fees.rs b/rust/gen/bluefin_api/src/models/affiliate_metadata_fees.rs new file mode 100644 index 00000000..dd1414d1 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/affiliate_metadata_fees.rs @@ -0,0 +1,50 @@ +/* + * 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}; + +/// AffiliateMetadataFees : Map of various fee-related configurations +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct AffiliateMetadataFees { + /// Earnings from referral perps fees (e9 format) + #[serde(rename = "referralPerpsFee", skip_serializing_if = "Option::is_none")] + pub referral_perps_fee: Option, + /// Earnings from subaffiliate perps (e9 format) + #[serde(rename = "subaffiliatePerpsEarnings", skip_serializing_if = "Option::is_none")] + pub subaffiliate_perps_earnings: Option, + /// Earnings from spot LP fees (e9 format) + #[serde(rename = "spotLPFee", skip_serializing_if = "Option::is_none")] + pub spot_lp_fee: Option, + /// Earnings from referral spot LP fees (e9 format) + #[serde(rename = "referralSpotLPFee", skip_serializing_if = "Option::is_none")] + pub referral_spot_lp_fee: Option, + /// Earnings from referral lending rewards (e9 format) + #[serde(rename = "referralLendingRewards", skip_serializing_if = "Option::is_none")] + pub referral_lending_rewards: Option, + /// Cashback from perps fees (e9 format) + #[serde(rename = "perpsFeeCashback", skip_serializing_if = "Option::is_none")] + pub perps_fee_cashback: Option, +} + +impl AffiliateMetadataFees { + /// Map of various fee-related configurations + pub fn new() -> AffiliateMetadataFees { + AffiliateMetadataFees { + referral_perps_fee: None, + subaffiliate_perps_earnings: None, + spot_lp_fee: None, + referral_spot_lp_fee: None, + referral_lending_rewards: None, + perps_fee_cashback: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/campaign_rewards.rs b/rust/gen/bluefin_api/src/models/campaign_rewards.rs new file mode 100644 index 00000000..bf1c154a --- /dev/null +++ b/rust/gen/bluefin_api/src/models/campaign_rewards.rs @@ -0,0 +1,27 @@ +/* + * 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 CampaignRewards { + #[serde(rename = "rewards", skip_serializing_if = "Option::is_none")] + pub rewards: Option, +} + +impl CampaignRewards { + pub fn new() -> CampaignRewards { + CampaignRewards { + rewards: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/create_order_request_twap_config.rs b/rust/gen/bluefin_api/src/models/create_order_request_twap_config.rs new file mode 100644 index 00000000..4e9ceb4a --- /dev/null +++ b/rust/gen/bluefin_api/src/models/create_order_request_twap_config.rs @@ -0,0 +1,34 @@ +/* + * Bluefin API + * + * Bluefin API + * + * The version of the OpenAPI document: 1.0.0 + * + * Generated by: https://openapi-generator.tech + */ + +use crate::models; +use serde::{Deserialize, Serialize}; + +/// CreateOrderRequestTwapConfig : Configuration for Time-Weighted Average Price orders +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct CreateOrderRequestTwapConfig { + /// Number of sub-orders to split the total quantity into + #[serde(rename = "subOrdersCount", skip_serializing_if = "Option::is_none")] + pub sub_orders_count: Option, + /// Total time in minutes over which to execute the TWAP order + #[serde(rename = "runningTimeInMinutes", skip_serializing_if = "Option::is_none")] + pub running_time_in_minutes: Option, +} + +impl CreateOrderRequestTwapConfig { + /// Configuration for Time-Weighted Average Price orders + pub fn new() -> CreateOrderRequestTwapConfig { + CreateOrderRequestTwapConfig { + sub_orders_count: None, + running_time_in_minutes: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/get_rewards_interval_metadata_interval_parameter.rs b/rust/gen/bluefin_api/src/models/get_rewards_interval_metadata_interval_parameter.rs new file mode 100644 index 00000000..61b88f57 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/get_rewards_interval_metadata_interval_parameter.rs @@ -0,0 +1,26 @@ +/* + * 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, Debug, PartialEq, Serialize, Deserialize)] +#[serde(untagged)] +pub enum GetRewardsIntervalMetadataIntervalParameter { + Integer(i32), + String(String), +} + +impl Default for GetRewardsIntervalMetadataIntervalParameter { + fn default() -> Self { + Self::Integer(Default::default()) + } +} + diff --git a/rust/gen/bluefin_api/src/models/ping_request.rs b/rust/gen/bluefin_api/src/models/ping_request.rs new file mode 100644 index 00000000..d7e58fe1 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/ping_request.rs @@ -0,0 +1,28 @@ +/* + * 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 PingRequest { + /// Optional client identifier (e.g. mobile, web). + #[serde(rename = "client", skip_serializing_if = "Option::is_none")] + pub client: Option, +} + +impl PingRequest { + pub fn new() -> PingRequest { + PingRequest { + client: None, + } + } +} + diff --git a/rust/gen/bluefin_api/src/models/ping_response.rs b/rust/gen/bluefin_api/src/models/ping_response.rs new file mode 100644 index 00000000..f726271f --- /dev/null +++ b/rust/gen/bluefin_api/src/models/ping_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 PingResponse { + #[serde(rename = "status")] + pub status: Status, +} + +impl PingResponse { + pub fn new(status: Status) -> PingResponse { + PingResponse { + status, + } + } +} +/// +#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)] +pub enum Status { + #[serde(rename = "ok")] + Ok, +} + +impl Default for Status { + fn default() -> Status { + Self::Ok + } +} + diff --git a/rust/gen/bluefin_api/src/models/post_create_order_202_response.rs b/rust/gen/bluefin_api/src/models/post_create_order_202_response.rs new file mode 100644 index 00000000..9f9a8323 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/post_create_order_202_response.rs @@ -0,0 +1,28 @@ +/* + * 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 PostCreateOrder202Response { + /// The unique identifier of this order, to be used as a lookup key + #[serde(rename = "orderHash")] + pub order_hash: String, +} + +impl PostCreateOrder202Response { + pub fn new(order_hash: String) -> PostCreateOrder202Response { + PostCreateOrder202Response { + order_hash, + } + } +} + diff --git a/rust/gen/config.yaml b/rust/gen/config.yaml index 3adf8537..3a136233 100644 --- a/rust/gen/config.yaml +++ b/rust/gen/config.yaml @@ -2,5 +2,5 @@ additionalProperties: hideGenerationTimestamp: 'true' avoidBoxedModels: 'true' packageName: bluefin_api - packageVersion: 1.16.0 + packageVersion: 1.15.0 preferUnsignedInt: 'true' diff --git a/scripts/version_bump.py b/scripts/version_bump.py deleted file mode 100644 index 368a05d2..00000000 --- a/scripts/version_bump.py +++ /dev/null @@ -1,218 +0,0 @@ -#!/usr/bin/env python3 -""" -Version bump script for pro-sdk. - -Detects OpenAPI spec changes via SHA-256 hashing and bumps SDK versions -in the generator config files. - -Usage: - python3 scripts/version_bump.py [--no-bump] [--major] -""" - -from __future__ import annotations - -import hashlib -import json -import os -import re -import sys -from datetime import datetime, timezone -from pathlib import Path -from typing import Any - -STATE_FILE = ".apigen-state" -RESOURCES_DIR = "resources" - -# --- Hashing --- - - -def hash_file(path: Path) -> str: - return hashlib.sha256(path.read_bytes()).hexdigest() - - -def hash_spec_bundle(resources_dir: Path) -> tuple[dict[str, str], str]: - spec_files = sorted(resources_dir.glob("*.yaml")) - if not spec_files: - return {}, "" - - file_hashes: dict[str, str] = {} - for f in spec_files: - file_hashes[str(f)] = hash_file(f) - - combined = "".join(file_hashes[k] for k in sorted(file_hashes)) - combined_hash = hashlib.sha256(combined.encode()).hexdigest() - return file_hashes, combined_hash - - -# --- State --- - - -def load_state(path: Path) -> dict[str, Any] | None: - if not path.exists(): - return None - state: dict[str, Any] = json.loads(path.read_text()) - return state - - -def save_state(path: Path, file_hashes: dict[str, str], combined_hash: str) -> None: - state: dict[str, Any] = { - "version": "1", - "algorithm": "sha256", - "generated_at": datetime.now(timezone.utc).isoformat().replace("+00:00", "Z"), - "spec_files": file_hashes, - "combined_hash": combined_hash, - } - path.write_text(json.dumps(state, indent=2) + "\n") - - -# --- Version bumping --- - - -def bump_major(version: str) -> str: - major, _minor, _patch = version.split(".") - return f"{int(major) + 1}.0.0" - - -def bump_minor(version: str) -> str: - major, minor, _patch = version.split(".") - return f"{major}.{int(minor) + 1}.0" - - -def read_yaml_version(path: Path) -> str: - """Read packageVersion from a YAML config.""" - for line in path.read_text().splitlines(): - m = re.match(r"\s*packageVersion:\s*['\"]?([0-9.]+)['\"]?", line) - if m: - return m.group(1) - raise ValueError(f"packageVersion not found in {path}") - - -def write_yaml_version(path: Path, new_version: str) -> None: - """Write packageVersion in a YAML config.""" - text = path.read_text() - text = re.sub( - r"(packageVersion:\s*)['\"]?[0-9.]+['\"]?", - rf"\g<1>{new_version}", - text, - ) - path.write_text(text) - - -def write_json_version(path: Path, new_version: str) -> None: - """Write version fields in a JSON generator config.""" - data: dict[str, Any] = json.loads(path.read_text()) - props = data.get("additionalProperties") - if isinstance(props, dict): - props["npmVersion"] = new_version - if "packageVersion" in props: - props["packageVersion"] = new_version - path.write_text(json.dumps(data, indent=2) + "\n") - - -def write_toml_version(path: Path, new_version: str) -> None: - """Write version in a TOML file (pyproject.toml or Cargo.toml).""" - text = path.read_text() - text = re.sub( - r'(version\s*=\s*")[0-9.]+"', - rf'\g<1>{new_version}"', - text, - count=1, - ) - path.write_text(text) - - -def write_package_json_version(path: Path, new_version: str) -> None: - """Write version in a package.json file.""" - data: dict[str, Any] = json.loads(path.read_text()) - data["version"] = new_version - path.write_text(json.dumps(data, indent=2) + "\n") - - -def print_changes(file_hashes: dict[str, str], previous: dict[str, Any]) -> None: - prev_files: dict[str, str] = previous.get("spec_files", {}) - print("Changed files:") - for path, current_hash in file_hashes.items(): - prev_hash = prev_files.get(path) - if prev_hash is None: - print(f" {path} (new)") - elif current_hash != prev_hash: - print(f" {path} (modified)") - for path in prev_files: - if path not in file_hashes: - print(f" {path} (deleted)") - - -# --- Main --- - - -def main() -> None: - skip_bump = "--no-bump" in sys.argv - major_bump = "--major" in sys.argv - - # cd to repo root - repo_root = Path(__file__).resolve().parent.parent - os.chdir(repo_root) - - resources = Path(RESOURCES_DIR) - if not resources.is_dir(): - print(f"Error: {RESOURCES_DIR}/ not found") - sys.exit(1) - - file_hashes, combined_hash = hash_spec_bundle(resources) - if not file_hashes: - print(f"No spec files found in {RESOURCES_DIR}/") - sys.exit(0) - - state_path = Path(STATE_FILE) - previous = load_state(state_path) - - if previous is None: - print("First run — establishing baseline (no version bump)") - for path, h in file_hashes.items(): - print(f" {path}: {h[:16]}...") - save_state(state_path, file_hashes, combined_hash) - print(f"State saved to {STATE_FILE}") - sys.exit(0) - - if combined_hash == previous.get("combined_hash"): - print("No spec changes detected") - sys.exit(0) - - print_changes(file_hashes, previous) - - if skip_bump: - print("Version bump skipped (--no-bump)") - else: - current_version = read_yaml_version(Path("python/sdk/config.yaml")) - new_version = bump_major(current_version) if major_bump else bump_minor(current_version) - bump_type = "major (breaking)" if major_bump else "minor" - print(f"Bumping versions ({bump_type}): {current_version} -> {new_version}") - - # Generator configs - write_yaml_version(Path("python/sdk/config.yaml"), new_version) - print(f" python/sdk/config.yaml -> {new_version}") - - write_yaml_version(Path("rust/gen/config.yaml"), new_version) - print(f" rust/gen/config.yaml -> {new_version}") - - write_json_version(Path("ts/sdk/openapitools.json"), new_version) - print(f" ts/sdk/openapitools.json -> {new_version}") - - # Package manifests - manifests: list[tuple[str, Any]] = [ - ("python/sdk/pyproject.toml", write_toml_version), - ("rust/Cargo.toml", write_toml_version), - ("ts/sdk/package.json", write_package_json_version), - ] - for rel_path, writer in manifests: - p = Path(rel_path) - if p.exists(): - writer(p, new_version) - print(f" {rel_path} -> {new_version}") - - save_state(state_path, file_hashes, combined_hash) - print(f"State saved to {STATE_FILE}") - - -if __name__ == "__main__": - main() diff --git a/ts/sdk/openapitools.json b/ts/sdk/openapitools.json index 918d9129..b19292a9 100644 --- a/ts/sdk/openapitools.json +++ b/ts/sdk/openapitools.json @@ -8,7 +8,7 @@ "hideGenerationTimestamp": true, "modelPropertyNaming": "camelCase", "npmName": "@bluefin/api-client", - "npmVersion": "1.16.0", + "npmVersion": "1.2.0", "nullSafeAdditionalProps": true, "packageName": "bluefin-pro-api-client", "paramNaming": "camelCase", @@ -21,4 +21,4 @@ }, "generatorName": "typescript-axios", "spaces": 2 -} +} \ No newline at end of file diff --git a/ts/sdk/package.json b/ts/sdk/package.json index 1d6fce9a..62d55a7d 100644 --- a/ts/sdk/package.json +++ b/ts/sdk/package.json @@ -52,5 +52,5 @@ "prepare": "npm run build" }, "types": "./dist/types/index.d.ts", - "version": "1.16.0" -} + "version": "1.15.0" +} \ No newline at end of file diff --git a/ts/sdk/src/.openapi-generator-ignore b/ts/sdk/src/.openapi-generator-ignore index da485663..ea56ba32 100644 --- a/ts/sdk/src/.openapi-generator-ignore +++ b/ts/sdk/src/.openapi-generator-ignore @@ -25,8 +25,4 @@ index.ts package.json README.md -tsconfig.json -request-signer.ts -sdk.ts -utils.ts -websocket.ts \ No newline at end of file +tsconfig.json \ No newline at end of file