diff --git a/python/sdk/src/.openapi-generator/FILES b/python/sdk/src/.openapi-generator/FILES index 5b57c3f..8ceb1d8 100644 --- a/python/sdk/src/.openapi-generator/FILES +++ b/python/sdk/src/.openapi-generator/FILES @@ -61,7 +61,6 @@ openapi_client/docs/ContractsConfig.md openapi_client/docs/CountryResponse.md openapi_client/docs/CreateOrderRequest.md openapi_client/docs/CreateOrderRequestSignedFields.md -openapi_client/docs/CreateOrderRequestTwapConfig.md openapi_client/docs/CreateOrderResponse.md openapi_client/docs/EpochConfigs.md openapi_client/docs/EpochConfigsResponse.md @@ -107,6 +106,7 @@ openapi_client/docs/OrderCancellationUpdate.md openapi_client/docs/OrderSide.md openapi_client/docs/OrderStatus.md openapi_client/docs/OrderTimeInForce.md +openapi_client/docs/OrderTwapConfig.md openapi_client/docs/OrderType.md openapi_client/docs/OrderbookDepthResponse.md openapi_client/docs/OrderbookDiffDepthUpdate.md @@ -203,7 +203,6 @@ openapi_client/models/contracts_config.py openapi_client/models/country_response.py openapi_client/models/create_order_request.py openapi_client/models/create_order_request_signed_fields.py -openapi_client/models/create_order_request_twap_config.py openapi_client/models/create_order_response.py openapi_client/models/epoch_configs.py openapi_client/models/epoch_configs_response.py @@ -248,6 +247,7 @@ openapi_client/models/order_cancellation_update.py openapi_client/models/order_side.py openapi_client/models/order_status.py openapi_client/models/order_time_in_force.py +openapi_client/models/order_twap_config.py openapi_client/models/order_type.py openapi_client/models/orderbook_depth_response.py openapi_client/models/orderbook_diff_depth_update.py @@ -291,4 +291,5 @@ 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_order_twap_config.py openapi_client_README.md diff --git a/python/sdk/src/openapi_client/__init__.py b/python/sdk/src/openapi_client/__init__.py index b6e41f4..c5cbf8a 100644 --- a/python/sdk/src/openapi_client/__init__.py +++ b/python/sdk/src/openapi_client/__init__.py @@ -86,7 +86,6 @@ from openapi_client.models.country_response import CountryResponse from openapi_client.models.create_order_request import CreateOrderRequest from openapi_client.models.create_order_request_signed_fields import CreateOrderRequestSignedFields -from openapi_client.models.create_order_request_twap_config import CreateOrderRequestTwapConfig from openapi_client.models.create_order_response import CreateOrderResponse from openapi_client.models.epoch_configs import EpochConfigs from openapi_client.models.epoch_configs_response import EpochConfigsResponse @@ -131,6 +130,7 @@ from openapi_client.models.order_side import OrderSide from openapi_client.models.order_status import OrderStatus from openapi_client.models.order_time_in_force import OrderTimeInForce +from openapi_client.models.order_twap_config import OrderTwapConfig from openapi_client.models.order_type import OrderType from openapi_client.models.orderbook_depth_response import OrderbookDepthResponse from openapi_client.models.orderbook_diff_depth_update import OrderbookDiffDepthUpdate diff --git a/python/sdk/src/openapi_client/docs/CreateOrderRequest.md b/python/sdk/src/openapi_client/docs/CreateOrderRequest.md index f930295..70cc92e 100644 --- a/python/sdk/src/openapi_client/docs/CreateOrderRequest.md +++ b/python/sdk/src/openapi_client/docs/CreateOrderRequest.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **time_in_force** | [**OrderTimeInForce**](OrderTimeInForce.md) | Omit or set to null for market orders; otherwise, choose a valid time-in-force value. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill | [optional] **trigger_price_e9** | **str** | Trigger price in base e9 for stop orders. This should always be a number | [optional] **self_trade_prevention_type** | [**SelfTradePreventionType**](SelfTradePreventionType.md) | | [optional] [default to SelfTradePreventionType.MAKER] -**twap_config** | [**CreateOrderRequestTwapConfig**](CreateOrderRequestTwapConfig.md) | | [optional] +**twap_config** | [**OrderTwapConfig**](OrderTwapConfig.md) | | [optional] ## Example diff --git a/python/sdk/src/openapi_client/docs/Error.md b/python/sdk/src/openapi_client/docs/Error.md index 170413c..b2937c4 100644 --- a/python/sdk/src/openapi_client/docs/Error.md +++ b/python/sdk/src/openapi_client/docs/Error.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error_code** | **str** | A code representing the type of error. | [optional] **message** | **str** | A human-readable message describing the error. | +**details** | **Dict[str, object]** | Additional structured details about the error. | [optional] ## Example diff --git a/python/sdk/src/openapi_client/docs/OpenOrderResponse.md b/python/sdk/src/openapi_client/docs/OpenOrderResponse.md index d994a3b..3398daf 100644 --- a/python/sdk/src/openapi_client/docs/OpenOrderResponse.md +++ b/python/sdk/src/openapi_client/docs/OpenOrderResponse.md @@ -26,6 +26,7 @@ Name | Type | Description | Notes **filled_quantity_e9** | **str** | The quantity in base e9 of the asset currently filled. This should always be a number | **status** | [**OrderStatus**](OrderStatus.md) | | **self_trade_prevention_type** | [**SelfTradePreventionType**](SelfTradePreventionType.md) | | [default to SelfTradePreventionType.MAKER] +**twap_config** | [**OrderTwapConfig**](OrderTwapConfig.md) | | [optional] **order_time_at_millis** | **int** | The timestamp in millis when the order was opened | **updated_at_millis** | **int** | The timestamp in millis that this order was last updated (including status updates) | diff --git a/python/sdk/src/openapi_client/docs/OrderTwapConfig.md b/python/sdk/src/openapi_client/docs/OrderTwapConfig.md new file mode 100644 index 0000000..c537647 --- /dev/null +++ b/python/sdk/src/openapi_client/docs/OrderTwapConfig.md @@ -0,0 +1,31 @@ +# OrderTwapConfig + +Configuration for Time-Weighted Average Price orders + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**sub_orders_count** | **str** | Number of sub-orders to split the total quantity into | [optional] +**running_time_in_minutes** | **str** | Total time in minutes over which to execute the TWAP order | [optional] + +## Example + +```python +from openapi_client.models.order_twap_config import OrderTwapConfig + +# TODO update the JSON string below +json = "{}" +# create an instance of OrderTwapConfig from a JSON string +order_twap_config_instance = OrderTwapConfig.from_json(json) +# print the JSON string representation of the object +print(OrderTwapConfig.to_json()) + +# convert the object into a dict +order_twap_config_dict = order_twap_config_instance.to_dict() +# create an instance of OrderTwapConfig from a dict +order_twap_config_from_dict = OrderTwapConfig.from_dict(order_twap_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/models/__init__.py b/python/sdk/src/openapi_client/models/__init__.py index 7ce9955..97eb416 100644 --- a/python/sdk/src/openapi_client/models/__init__.py +++ b/python/sdk/src/openapi_client/models/__init__.py @@ -64,7 +64,6 @@ from openapi_client.models.country_response import CountryResponse from openapi_client.models.create_order_request import CreateOrderRequest from openapi_client.models.create_order_request_signed_fields import CreateOrderRequestSignedFields -from openapi_client.models.create_order_request_twap_config import CreateOrderRequestTwapConfig from openapi_client.models.create_order_response import CreateOrderResponse from openapi_client.models.epoch_configs import EpochConfigs from openapi_client.models.epoch_configs_response import EpochConfigsResponse @@ -109,6 +108,7 @@ from openapi_client.models.order_side import OrderSide from openapi_client.models.order_status import OrderStatus from openapi_client.models.order_time_in_force import OrderTimeInForce +from openapi_client.models.order_twap_config import OrderTwapConfig from openapi_client.models.order_type import OrderType from openapi_client.models.orderbook_depth_response import OrderbookDepthResponse from openapi_client.models.orderbook_diff_depth_update import OrderbookDiffDepthUpdate diff --git a/python/sdk/src/openapi_client/models/create_order_request.py b/python/sdk/src/openapi_client/models/create_order_request.py index 7ea8671..a49682a 100644 --- a/python/sdk/src/openapi_client/models/create_order_request.py +++ b/python/sdk/src/openapi_client/models/create_order_request.py @@ -20,8 +20,8 @@ from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from openapi_client.models.create_order_request_signed_fields import CreateOrderRequestSignedFields -from openapi_client.models.create_order_request_twap_config import CreateOrderRequestTwapConfig from openapi_client.models.order_time_in_force import OrderTimeInForce +from openapi_client.models.order_twap_config import OrderTwapConfig from openapi_client.models.order_type import OrderType from openapi_client.models.self_trade_prevention_type import SelfTradePreventionType from typing import Optional, Set @@ -40,7 +40,7 @@ class CreateOrderRequest(BaseModel): time_in_force: Optional[OrderTimeInForce] = Field(default=None, description="Omit or set to null for market orders; otherwise, choose a valid time-in-force value. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill ", alias="timeInForce") trigger_price_e9: Optional[StrictStr] = Field(default=None, description="Trigger price in base e9 for stop orders. This should always be a number", alias="triggerPriceE9") self_trade_prevention_type: Optional[SelfTradePreventionType] = Field(default=SelfTradePreventionType.MAKER, alias="selfTradePreventionType") - twap_config: Optional[CreateOrderRequestTwapConfig] = Field(default=None, alias="twapConfig") + twap_config: Optional[OrderTwapConfig] = Field(default=None, alias="twapConfig") __properties: ClassVar[List[str]] = ["signedFields", "signature", "clientOrderId", "type", "reduceOnly", "postOnly", "timeInForce", "triggerPriceE9", "selfTradePreventionType", "twapConfig"] model_config = ConfigDict( @@ -109,7 +109,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "timeInForce": obj.get("timeInForce"), "triggerPriceE9": obj.get("triggerPriceE9"), "selfTradePreventionType": obj.get("selfTradePreventionType") if obj.get("selfTradePreventionType") is not None else SelfTradePreventionType.MAKER, - "twapConfig": CreateOrderRequestTwapConfig.from_dict(obj["twapConfig"]) if obj.get("twapConfig") is not None else None + "twapConfig": OrderTwapConfig.from_dict(obj["twapConfig"]) if obj.get("twapConfig") is not None else None }) return _obj diff --git a/python/sdk/src/openapi_client/models/error.py b/python/sdk/src/openapi_client/models/error.py index 9e018dc..15c0d04 100644 --- a/python/sdk/src/openapi_client/models/error.py +++ b/python/sdk/src/openapi_client/models/error.py @@ -28,7 +28,8 @@ class Error(BaseModel): """ # noqa: E501 error_code: Optional[StrictStr] = Field(default=None, description="A code representing the type of error.", alias="errorCode") message: StrictStr = Field(description="A human-readable message describing the error.") - __properties: ClassVar[List[str]] = ["errorCode", "message"] + details: Optional[Dict[str, Any]] = Field(default=None, description="Additional structured details about the error.") + __properties: ClassVar[List[str]] = ["errorCode", "message", "details"] model_config = ConfigDict( populate_by_name=True, @@ -82,7 +83,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "errorCode": obj.get("errorCode"), - "message": obj.get("message") + "message": obj.get("message"), + "details": obj.get("details") }) return _obj diff --git a/python/sdk/src/openapi_client/models/open_order_response.py b/python/sdk/src/openapi_client/models/open_order_response.py index 20df45d..0cedd66 100644 --- a/python/sdk/src/openapi_client/models/open_order_response.py +++ b/python/sdk/src/openapi_client/models/open_order_response.py @@ -22,6 +22,7 @@ from openapi_client.models.order_side import OrderSide from openapi_client.models.order_status import OrderStatus from openapi_client.models.order_time_in_force import OrderTimeInForce +from openapi_client.models.order_twap_config import OrderTwapConfig from openapi_client.models.order_type import OrderType from openapi_client.models.self_trade_prevention_type import SelfTradePreventionType from typing import Optional, Set @@ -52,9 +53,10 @@ class OpenOrderResponse(BaseModel): filled_quantity_e9: StrictStr = Field(description="The quantity in base e9 of the asset currently filled. This should always be a number", alias="filledQuantityE9") status: OrderStatus self_trade_prevention_type: SelfTradePreventionType = Field(alias="selfTradePreventionType") + twap_config: Optional[OrderTwapConfig] = Field(default=None, alias="twapConfig") order_time_at_millis: StrictInt = Field(description="The timestamp in millis when the order was opened", alias="orderTimeAtMillis") updated_at_millis: StrictInt = Field(description="The timestamp in millis that this order was last updated (including status updates)", alias="updatedAtMillis") - __properties: ClassVar[List[str]] = ["orderHash", "clientOrderId", "symbol", "accountAddress", "signerAddress", "priceE9", "quantityE9", "side", "leverageE9", "isIsolated", "salt", "expiresAtMillis", "signedAtMillis", "type", "reduceOnly", "postOnly", "timeInForce", "triggerPriceE9", "filledQuantityE9", "status", "selfTradePreventionType", "orderTimeAtMillis", "updatedAtMillis"] + __properties: ClassVar[List[str]] = ["orderHash", "clientOrderId", "symbol", "accountAddress", "signerAddress", "priceE9", "quantityE9", "side", "leverageE9", "isIsolated", "salt", "expiresAtMillis", "signedAtMillis", "type", "reduceOnly", "postOnly", "timeInForce", "triggerPriceE9", "filledQuantityE9", "status", "selfTradePreventionType", "twapConfig", "orderTimeAtMillis", "updatedAtMillis"] model_config = ConfigDict( populate_by_name=True, @@ -95,6 +97,9 @@ def to_dict(self) -> Dict[str, Any]: exclude=excluded_fields, exclude_none=True, ) + # override the default output from pydantic by calling `to_dict()` of twap_config + if self.twap_config: + _dict['twapConfig'] = self.twap_config.to_dict() return _dict @classmethod @@ -128,6 +133,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "filledQuantityE9": obj.get("filledQuantityE9"), "status": obj.get("status"), "selfTradePreventionType": obj.get("selfTradePreventionType") if obj.get("selfTradePreventionType") is not None else SelfTradePreventionType.MAKER, + "twapConfig": OrderTwapConfig.from_dict(obj["twapConfig"]) if obj.get("twapConfig") is not None else None, "orderTimeAtMillis": obj.get("orderTimeAtMillis"), "updatedAtMillis": obj.get("updatedAtMillis") }) diff --git a/python/sdk/src/openapi_client/models/order_twap_config.py b/python/sdk/src/openapi_client/models/order_twap_config.py new file mode 100644 index 0000000..b7db7bd --- /dev/null +++ b/python/sdk/src/openapi_client/models/order_twap_config.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 OrderTwapConfig(BaseModel): + """ + Configuration for Time-Weighted Average Price orders + """ # noqa: E501 + sub_orders_count: Optional[StrictStr] = Field(default=None, description="Number of sub-orders to split the total quantity into", alias="subOrdersCount") + running_time_in_minutes: Optional[StrictStr] = Field(default=None, description="Total time in minutes over which to execute the TWAP order", alias="runningTimeInMinutes") + __properties: ClassVar[List[str]] = ["subOrdersCount", "runningTimeInMinutes"] + + 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 OrderTwapConfig 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 OrderTwapConfig from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "subOrdersCount": obj.get("subOrdersCount"), + "runningTimeInMinutes": obj.get("runningTimeInMinutes") + }) + return _obj + + diff --git a/python/sdk/src/openapi_client/test/test_order_twap_config.py b/python/sdk/src/openapi_client/test/test_order_twap_config.py new file mode 100644 index 0000000..2a8123d --- /dev/null +++ b/python/sdk/src/openapi_client/test/test_order_twap_config.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.order_twap_config import OrderTwapConfig + +class TestOrderTwapConfig(unittest.TestCase): + """OrderTwapConfig unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> OrderTwapConfig: + """Test OrderTwapConfig + 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 `OrderTwapConfig` + """ + model = OrderTwapConfig() + if include_optional: + return OrderTwapConfig( + sub_orders_count = '5', + running_time_in_minutes = '30' + ) + else: + return OrderTwapConfig( + ) + """ + + def testOrderTwapConfig(self): + """Test OrderTwapConfig""" + # 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 f0a2c6c..e137dea 100644 --- a/python/sdk/src/openapi_client_README.md +++ b/python/sdk/src/openapi_client_README.md @@ -175,7 +175,6 @@ Class | Method | HTTP request | Description - [CountryResponse](openapi_client/docs/CountryResponse.md) - [CreateOrderRequest](openapi_client/docs/CreateOrderRequest.md) - [CreateOrderRequestSignedFields](openapi_client/docs/CreateOrderRequestSignedFields.md) - - [CreateOrderRequestTwapConfig](openapi_client/docs/CreateOrderRequestTwapConfig.md) - [CreateOrderResponse](openapi_client/docs/CreateOrderResponse.md) - [EpochConfigs](openapi_client/docs/EpochConfigs.md) - [EpochConfigsResponse](openapi_client/docs/EpochConfigsResponse.md) @@ -220,6 +219,7 @@ Class | Method | HTTP request | Description - [OrderSide](openapi_client/docs/OrderSide.md) - [OrderStatus](openapi_client/docs/OrderStatus.md) - [OrderTimeInForce](openapi_client/docs/OrderTimeInForce.md) + - [OrderTwapConfig](openapi_client/docs/OrderTwapConfig.md) - [OrderType](openapi_client/docs/OrderType.md) - [OrderbookDepthResponse](openapi_client/docs/OrderbookDepthResponse.md) - [OrderbookDiffDepthUpdate](openapi_client/docs/OrderbookDiffDepthUpdate.md) diff --git a/resources/common.yaml b/resources/common.yaml index 178d96a..5f6c5cb 100644 --- a/resources/common.yaml +++ b/resources/common.yaml @@ -145,6 +145,10 @@ components: message: type: string description: A human-readable message describing the error. + details: + type: object + additionalProperties: true + description: Additional structured details about the error. required: - message Trade: diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 3d870ee..a9f8e00 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -99,7 +99,7 @@ dependencies = [ [[package]] name = "bluefin-pro" -version = "1.5.0" +version = "1.8.0" dependencies = [ "base64", "bcs", @@ -123,7 +123,7 @@ dependencies = [ [[package]] name = "bluefin_api" -version = "1.5.0" +version = "1.8.0" dependencies = [ "reqwest", "serde", diff --git a/rust/gen/bluefin_api/.openapi-generator/FILES b/rust/gen/bluefin_api/.openapi-generator/FILES index c1d51e2..f5c4d13 100644 --- a/rust/gen/bluefin_api/.openapi-generator/FILES +++ b/rust/gen/bluefin_api/.openapi-generator/FILES @@ -54,7 +54,6 @@ docs/ContractsConfig.md docs/CountryResponse.md docs/CreateOrderRequest.md docs/CreateOrderRequestSignedFields.md -docs/CreateOrderRequestTwapConfig.md docs/CreateOrderResponse.md docs/EpochConfigs.md docs/EpochConfigsResponse.md @@ -100,6 +99,7 @@ docs/OrderCancellationUpdate.md docs/OrderSide.md docs/OrderStatus.md docs/OrderTimeInForce.md +docs/OrderTwapConfig.md docs/OrderType.md docs/OrderbookDepthResponse.md docs/OrderbookDiffDepthUpdate.md @@ -204,7 +204,6 @@ src/models/contracts_config.rs src/models/country_response.rs src/models/create_order_request.rs src/models/create_order_request_signed_fields.rs -src/models/create_order_request_twap_config.rs src/models/create_order_response.rs src/models/epoch_configs.rs src/models/epoch_configs_response.rs @@ -250,6 +249,7 @@ src/models/order_cancellation_update.rs src/models/order_side.rs src/models/order_status.rs src/models/order_time_in_force.rs +src/models/order_twap_config.rs src/models/order_type.rs src/models/orderbook_depth_response.rs src/models/orderbook_diff_depth_update.rs diff --git a/rust/gen/bluefin_api/README.md b/rust/gen/bluefin_api/README.md index c2b1a47..d19b7b5 100644 --- a/rust/gen/bluefin_api/README.md +++ b/rust/gen/bluefin_api/README.md @@ -135,7 +135,6 @@ Class | Method | HTTP request | Description - [CountryResponse](docs/CountryResponse.md) - [CreateOrderRequest](docs/CreateOrderRequest.md) - [CreateOrderRequestSignedFields](docs/CreateOrderRequestSignedFields.md) - - [CreateOrderRequestTwapConfig](docs/CreateOrderRequestTwapConfig.md) - [CreateOrderResponse](docs/CreateOrderResponse.md) - [EpochConfigs](docs/EpochConfigs.md) - [EpochConfigsResponse](docs/EpochConfigsResponse.md) @@ -180,6 +179,7 @@ Class | Method | HTTP request | Description - [OrderSide](docs/OrderSide.md) - [OrderStatus](docs/OrderStatus.md) - [OrderTimeInForce](docs/OrderTimeInForce.md) + - [OrderTwapConfig](docs/OrderTwapConfig.md) - [OrderType](docs/OrderType.md) - [OrderbookDepthResponse](docs/OrderbookDepthResponse.md) - [OrderbookDiffDepthUpdate](docs/OrderbookDiffDepthUpdate.md) diff --git a/rust/gen/bluefin_api/docs/CreateOrderRequest.md b/rust/gen/bluefin_api/docs/CreateOrderRequest.md index c14ce0b..2536e77 100644 --- a/rust/gen/bluefin_api/docs/CreateOrderRequest.md +++ b/rust/gen/bluefin_api/docs/CreateOrderRequest.md @@ -13,7 +13,7 @@ Name | Type | Description | Notes **time_in_force** | Option<[**models::OrderTimeInForce**](OrderTimeInForce.md)> | Omit or set to null for market orders; otherwise, choose a valid time-in-force value. GTT: Good Til Time IOC: Immediate Or Cancel FOK: Fill Or Kill | [optional] **trigger_price_e9** | Option<**String**> | Trigger price in base e9 for stop orders. This should always be a number | [optional] **self_trade_prevention_type** | Option<[**models::SelfTradePreventionType**](SelfTradePreventionType.md)> | | [optional] -**twap_config** | Option<[**models::CreateOrderRequestTwapConfig**](CreateOrderRequest_twapConfig.md)> | | [optional] +**twap_config** | Option<[**models::OrderTwapConfig**](OrderTwapConfig.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/Error.md b/rust/gen/bluefin_api/docs/Error.md index c372846..60c95dc 100644 --- a/rust/gen/bluefin_api/docs/Error.md +++ b/rust/gen/bluefin_api/docs/Error.md @@ -6,6 +6,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error_code** | Option<**String**> | A code representing the type of error. | [optional] **message** | **String** | A human-readable message describing the error. | +**details** | Option<[**std::collections::HashMap**](serde_json::Value.md)> | Additional structured details about the error. | [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/OpenOrderResponse.md b/rust/gen/bluefin_api/docs/OpenOrderResponse.md index 5907146..e56f5d4 100644 --- a/rust/gen/bluefin_api/docs/OpenOrderResponse.md +++ b/rust/gen/bluefin_api/docs/OpenOrderResponse.md @@ -25,6 +25,7 @@ Name | Type | Description | Notes **filled_quantity_e9** | **String** | The quantity in base e9 of the asset currently filled. This should always be a number | **status** | [**models::OrderStatus**](OrderStatus.md) | | **self_trade_prevention_type** | [**models::SelfTradePreventionType**](SelfTradePreventionType.md) | | +**twap_config** | Option<[**models::OrderTwapConfig**](OrderTwapConfig.md)> | | [optional] **order_time_at_millis** | **i64** | The timestamp in millis when the order was opened | **updated_at_millis** | **i64** | The timestamp in millis that this order was last updated (including status updates) | diff --git a/rust/gen/bluefin_api/docs/OrderTwapConfig.md b/rust/gen/bluefin_api/docs/OrderTwapConfig.md new file mode 100644 index 0000000..756e73d --- /dev/null +++ b/rust/gen/bluefin_api/docs/OrderTwapConfig.md @@ -0,0 +1,12 @@ +# OrderTwapConfig + +## 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/src/models/create_order_request.rs b/rust/gen/bluefin_api/src/models/create_order_request.rs index d4d6cdb..ff1c260 100644 --- a/rust/gen/bluefin_api/src/models/create_order_request.rs +++ b/rust/gen/bluefin_api/src/models/create_order_request.rs @@ -38,7 +38,7 @@ pub struct CreateOrderRequest { #[serde(rename = "selfTradePreventionType", skip_serializing_if = "Option::is_none")] pub self_trade_prevention_type: Option, #[serde(rename = "twapConfig", skip_serializing_if = "Option::is_none")] - pub twap_config: Option, + pub twap_config: Option, } impl CreateOrderRequest { diff --git a/rust/gen/bluefin_api/src/models/error.rs b/rust/gen/bluefin_api/src/models/error.rs index f81faac..5661a02 100644 --- a/rust/gen/bluefin_api/src/models/error.rs +++ b/rust/gen/bluefin_api/src/models/error.rs @@ -19,6 +19,9 @@ pub struct Error { /// A human-readable message describing the error. #[serde(rename = "message")] pub message: String, + /// Additional structured details about the error. + #[serde(rename = "details", skip_serializing_if = "Option::is_none")] + pub details: Option>, } impl Error { @@ -26,6 +29,7 @@ impl Error { Error { error_code: None, message, + details: None, } } } diff --git a/rust/gen/bluefin_api/src/models/mod.rs b/rust/gen/bluefin_api/src/models/mod.rs index 23de05f..f514121 100644 --- a/rust/gen/bluefin_api/src/models/mod.rs +++ b/rust/gen/bluefin_api/src/models/mod.rs @@ -98,8 +98,6 @@ pub mod create_order_request; pub use self::create_order_request::CreateOrderRequest; pub mod create_order_request_signed_fields; pub use self::create_order_request_signed_fields::CreateOrderRequestSignedFields; -pub mod create_order_request_twap_config; -pub use self::create_order_request_twap_config::CreateOrderRequestTwapConfig; pub mod create_order_response; pub use self::create_order_response::CreateOrderResponse; pub mod epoch_configs; @@ -188,6 +186,8 @@ pub mod order_status; pub use self::order_status::OrderStatus; pub mod order_time_in_force; pub use self::order_time_in_force::OrderTimeInForce; +pub mod order_twap_config; +pub use self::order_twap_config::OrderTwapConfig; pub mod order_type; pub use self::order_type::OrderType; pub mod orderbook_depth_response; diff --git a/rust/gen/bluefin_api/src/models/open_order_response.rs b/rust/gen/bluefin_api/src/models/open_order_response.rs index 36fcf5e..c93ad81 100644 --- a/rust/gen/bluefin_api/src/models/open_order_response.rs +++ b/rust/gen/bluefin_api/src/models/open_order_response.rs @@ -71,6 +71,8 @@ pub struct OpenOrderResponse { pub status: models::OrderStatus, #[serde(rename = "selfTradePreventionType")] pub self_trade_prevention_type: models::SelfTradePreventionType, + #[serde(rename = "twapConfig", skip_serializing_if = "Option::is_none")] + pub twap_config: Option, /// The timestamp in millis when the order was opened #[serde(rename = "orderTimeAtMillis")] pub order_time_at_millis: i64, @@ -103,6 +105,7 @@ impl OpenOrderResponse { filled_quantity_e9, status, self_trade_prevention_type, + twap_config: None, order_time_at_millis, updated_at_millis, } diff --git a/rust/gen/bluefin_api/src/models/order_twap_config.rs b/rust/gen/bluefin_api/src/models/order_twap_config.rs new file mode 100644 index 0000000..edb4102 --- /dev/null +++ b/rust/gen/bluefin_api/src/models/order_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}; + +/// OrderTwapConfig : Configuration for Time-Weighted Average Price orders +#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)] +pub struct OrderTwapConfig { + /// 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 OrderTwapConfig { + /// Configuration for Time-Weighted Average Price orders + pub fn new() -> OrderTwapConfig { + OrderTwapConfig { + sub_orders_count: None, + running_time_in_minutes: None, + } + } +} + diff --git a/ts/sdk/package.json b/ts/sdk/package.json index ef52728..f6f9bc5 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.8.4" + "version": "1.8.5" } diff --git a/ts/sdk/src/api.ts b/ts/sdk/src/api.ts index 21a6046..b137734 100644 --- a/ts/sdk/src/api.ts +++ b/ts/sdk/src/api.ts @@ -3426,6 +3426,12 @@ export interface ModelError { * @memberof ModelError */ 'message': string; + /** + * Additional structured details about the error. + * @type {{ [key: string]: any | undefined; }} + * @memberof ModelError + */ + 'details'?: { [key: string]: any | undefined; }; } /** * diff --git a/ts/sdk/src/docs/Error.md b/ts/sdk/src/docs/Error.md index b26659f..92ac6d6 100644 --- a/ts/sdk/src/docs/Error.md +++ b/ts/sdk/src/docs/Error.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **errorCode** | **string** | A code representing the type of error. | [optional] [default to undefined] **message** | **string** | A human-readable message describing the error. | [default to undefined] +**details** | **{ [key: string]: any | undefined; }** | Additional structured details about the error. | [optional] [default to undefined] ## Example @@ -16,6 +17,7 @@ import { ModelError } from '@bluefin/api-client'; const instance: ModelError = { errorCode, message, + details, }; ```