From a7f6dd9aa0f7c6c89f395fc7aa8d88bd896eef3a Mon Sep 17 00:00:00 2001 From: Shanshan Li Date: Wed, 8 Apr 2026 13:38:30 +0800 Subject: [PATCH] release v1.34.0 --- .openapi-generator/FILES | 9 + README.md | 9 +- cobo_waas2/__init__.py | 5 +- cobo_waas2/api/auto_sweep_api.py | 169 +++++++++++ cobo_waas2/api/fee_station_api.py | 275 ++++++++++++++++++ cobo_waas2/api_client.py | 2 +- cobo_waas2/models/__init__.py | 3 + cobo_waas2/models/create_auto_sweep_task.py | 8 +- .../models/fee_station_fiat_transaction.py | 110 +++++++ .../fee_station_fiat_transaction_type.py | 41 +++ ...e_station_fiat_transactions200_response.py | 100 +++++++ .../models/payment_estimate_fee_request.py | 8 +- .../models/payment_payout_recipient_info.py | 8 +- .../models/refund_link_business_info.py | 6 +- docs/AutoSweepApi.md | 73 +++++ docs/CreateAutoSweepTask.md | 1 + docs/FeeStationApi.md | 86 ++++++ docs/FeeStationFiatTransaction.md | 38 +++ docs/FeeStationFiatTransactionType.md | 12 + ...stFeeStationFiatTransactions200Response.md | 30 ++ docs/PaymentEstimateFeeRequest.md | 1 + docs/PaymentPayoutRecipientInfo.md | 1 + docs/RefundLinkBusinessInfo.md | 3 +- pyproject.toml | 2 +- setup.py | 2 +- test/test_auto_sweep_api.py | 12 + test/test_create_auto_sweep_task.py | 3 +- test/test_create_payout_request.py | 6 +- test/test_create_refund_link_request.py | 2 + test/test_fee_station_api.py | 18 ++ test/test_fee_station_fiat_transaction.py | 64 ++++ .../test_fee_station_fiat_transaction_type.py | 33 +++ ...e_station_fiat_transactions200_response.py | 66 +++++ test/test_list_payouts200_response.py | 3 +- test/test_payment_estimate_fee_request.py | 3 +- test/test_payment_payout.py | 3 +- test/test_payment_payout_detail.py | 3 +- test/test_payment_payout_event.py | 3 +- test/test_payment_payout_recipient_info.py | 3 +- test/test_refund_link_business_info.py | 2 +- test/test_webhook_event_data.py | 3 +- 41 files changed, 1200 insertions(+), 29 deletions(-) create mode 100644 cobo_waas2/models/fee_station_fiat_transaction.py create mode 100644 cobo_waas2/models/fee_station_fiat_transaction_type.py create mode 100644 cobo_waas2/models/list_fee_station_fiat_transactions200_response.py create mode 100644 docs/FeeStationFiatTransaction.md create mode 100644 docs/FeeStationFiatTransactionType.md create mode 100644 docs/ListFeeStationFiatTransactions200Response.md create mode 100644 test/test_fee_station_fiat_transaction.py create mode 100644 test/test_fee_station_fiat_transaction_type.py create mode 100644 test/test_list_fee_station_fiat_transactions200_response.py diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 33e31a18..602afb2e 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -288,6 +288,8 @@ cobo_waas2/models/fee_reserved.py cobo_waas2/models/fee_station_check_fee_station_usage.py cobo_waas2/models/fee_station_check_fee_station_usage_response.py cobo_waas2/models/fee_station_destination.py +cobo_waas2/models/fee_station_fiat_transaction.py +cobo_waas2/models/fee_station_fiat_transaction_type.py cobo_waas2/models/fee_station_gas_station_type.py cobo_waas2/models/fee_station_sponsor_transaction_description.py cobo_waas2/models/fee_station_transaction_type.py @@ -362,6 +364,7 @@ cobo_waas2/models/list_counterparty_entries200_response.py cobo_waas2/models/list_destination_entries200_response.py cobo_waas2/models/list_destinations200_response.py cobo_waas2/models/list_exchanges200_response_inner.py +cobo_waas2/models/list_fee_station_fiat_transactions200_response.py cobo_waas2/models/list_forced_sweep_requests200_response.py cobo_waas2/models/list_key_share_holder_groups200_response.py cobo_waas2/models/list_key_share_holders200_response.py @@ -1111,6 +1114,8 @@ docs/FeeStationApi.md docs/FeeStationCheckFeeStationUsage.md docs/FeeStationCheckFeeStationUsageResponse.md docs/FeeStationDestination.md +docs/FeeStationFiatTransaction.md +docs/FeeStationFiatTransactionType.md docs/FeeStationGasStationType.md docs/FeeStationSponsorTransactionDescription.md docs/FeeStationTransactionType.md @@ -1184,6 +1189,7 @@ docs/ListCounterpartyEntries200Response.md docs/ListDestinationEntries200Response.md docs/ListDestinations200Response.md docs/ListExchanges200ResponseInner.md +docs/ListFeeStationFiatTransactions200Response.md docs/ListForcedSweepRequests200Response.md docs/ListKeyShareHolderGroups200Response.md docs/ListKeyShareHolders200Response.md @@ -1948,6 +1954,8 @@ test/test_fee_station_api.py test/test_fee_station_check_fee_station_usage.py test/test_fee_station_check_fee_station_usage_response.py test/test_fee_station_destination.py +test/test_fee_station_fiat_transaction.py +test/test_fee_station_fiat_transaction_type.py test/test_fee_station_gas_station_type.py test/test_fee_station_sponsor_transaction_description.py test/test_fee_station_transaction_type.py @@ -2023,6 +2031,7 @@ test/test_list_counterparty_entries200_response.py test/test_list_destination_entries200_response.py test/test_list_destinations200_response.py test/test_list_exchanges200_response_inner.py +test/test_list_fee_station_fiat_transactions200_response.py test/test_list_forced_sweep_requests200_response.py test/test_list_key_share_holder_groups200_response.py test/test_list_key_share_holders200_response.py diff --git a/README.md b/README.md index 3d826751..71fd8d83 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ For more information about the WaaS 2.0 API, see [Introduction to WaaS 2.0](http This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: v2 -- Package version: 1.33.0 +- Package version: 1.34.0 - Generator version: 7.6.0 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://www.cobo.com/waas](https://www.cobo.com/waas) @@ -27,7 +27,7 @@ Python 3.7+ ### pip install ```sh -pip install cobo-waas2==1.33.0 +pip install cobo-waas2==1.34.0 ``` Then import the package: @@ -87,6 +87,7 @@ Class | Method | HTTP request | Description *AppWorkflowsApi* | [**list_app_workflows**](docs/AppWorkflowsApi.md#list_app_workflows) | **GET** /app/workflows | List app workflows *AppWorkflowsApi* | [**list_approval_requests**](docs/AppWorkflowsApi.md#list_approval_requests) | **GET** /app/workflows/approval_requests | List approval requests *AppWorkflowsApi* | [**revoke_approval_request**](docs/AppWorkflowsApi.md#revoke_approval_request) | **POST** /app/workflows/approval_requests/{approval_id}/revoke | Revoke approval request +*AutoSweepApi* | [**cancel_auto_sweep_task_by_id**](docs/AutoSweepApi.md#cancel_auto_sweep_task_by_id) | **POST** /auto_sweep/tasks/{task_id}/cancel | Cancel auto sweep task *AutoSweepApi* | [**create_auto_sweep_task**](docs/AutoSweepApi.md#create_auto_sweep_task) | **POST** /auto_sweep/tasks | Create auto-sweep task *AutoSweepApi* | [**create_wallet_sweep_to_addresses**](docs/AutoSweepApi.md#create_wallet_sweep_to_addresses) | **POST** /auto_sweep/sweep_to_addresses | Create sweep-to address *AutoSweepApi* | [**get_auto_sweep_task_by_id**](docs/AutoSweepApi.md#get_auto_sweep_task_by_id) | **GET** /auto_sweep/tasks/{task_id} | Get auto-sweep task details @@ -119,6 +120,7 @@ Class | Method | HTTP request | Description *FeeStationApi* | [**estimate_fee_station_fee**](docs/FeeStationApi.md#estimate_fee_station_fee) | **POST** /fee_station/transactions/estimate_fee | Estimate transaction fee *FeeStationApi* | [**get_fee_station_transaction_by_id**](docs/FeeStationApi.md#get_fee_station_transaction_by_id) | **GET** /fee_station/transactions/{transaction_id} | Get Fee Station transaction information *FeeStationApi* | [**list_fee_station_addresses**](docs/FeeStationApi.md#list_fee_station_addresses) | **GET** /fee_station/addresses | List Fee Station addresses +*FeeStationApi* | [**list_fee_station_fiat_transactions**](docs/FeeStationApi.md#list_fee_station_fiat_transactions) | **GET** /fee_station/fiat_transactions | List Fee Station fiat transactions *FeeStationApi* | [**list_fee_station_transactions**](docs/FeeStationApi.md#list_fee_station_transactions) | **GET** /fee_station/transactions | List all Fee Station transactions *FeeStationApi* | [**list_token_balances_for_fee_station**](docs/FeeStationApi.md#list_token_balances_for_fee_station) | **GET** /fee_station/tokens | List Fee Station token balances *GraphQLApi* | [**execute_graphql**](docs/GraphQLApi.md#execute_graphql) | **POST** /graphql | Execute a GraphQL query or mutation @@ -586,6 +588,8 @@ Class | Method | HTTP request | Description - [FeeStationCheckFeeStationUsage](docs/FeeStationCheckFeeStationUsage.md) - [FeeStationCheckFeeStationUsageResponse](docs/FeeStationCheckFeeStationUsageResponse.md) - [FeeStationDestination](docs/FeeStationDestination.md) + - [FeeStationFiatTransaction](docs/FeeStationFiatTransaction.md) + - [FeeStationFiatTransactionType](docs/FeeStationFiatTransactionType.md) - [FeeStationGasStationType](docs/FeeStationGasStationType.md) - [FeeStationSponsorTransactionDescription](docs/FeeStationSponsorTransactionDescription.md) - [FeeStationTransactionType](docs/FeeStationTransactionType.md) @@ -658,6 +662,7 @@ Class | Method | HTTP request | Description - [ListDestinationEntries200Response](docs/ListDestinationEntries200Response.md) - [ListDestinations200Response](docs/ListDestinations200Response.md) - [ListExchanges200ResponseInner](docs/ListExchanges200ResponseInner.md) + - [ListFeeStationFiatTransactions200Response](docs/ListFeeStationFiatTransactions200Response.md) - [ListForcedSweepRequests200Response](docs/ListForcedSweepRequests200Response.md) - [ListKeyShareHolderGroups200Response](docs/ListKeyShareHolderGroups200Response.md) - [ListKeyShareHolders200Response](docs/ListKeyShareHolders200Response.md) diff --git a/cobo_waas2/__init__.py b/cobo_waas2/__init__.py index 5917f4e4..1c9b0dcc 100644 --- a/cobo_waas2/__init__.py +++ b/cobo_waas2/__init__.py @@ -12,7 +12,7 @@ """ # noqa: E501 -__version__ = "1.33.0" +__version__ = "1.34.0" # import apis into sdk package from cobo_waas2.api.address_books_api import AddressBooksApi @@ -302,6 +302,8 @@ from cobo_waas2.models.fee_station_check_fee_station_usage import FeeStationCheckFeeStationUsage from cobo_waas2.models.fee_station_check_fee_station_usage_response import FeeStationCheckFeeStationUsageResponse from cobo_waas2.models.fee_station_destination import FeeStationDestination +from cobo_waas2.models.fee_station_fiat_transaction import FeeStationFiatTransaction +from cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType from cobo_waas2.models.fee_station_gas_station_type import FeeStationGasStationType from cobo_waas2.models.fee_station_sponsor_transaction_description import FeeStationSponsorTransactionDescription from cobo_waas2.models.fee_station_transaction_type import FeeStationTransactionType @@ -374,6 +376,7 @@ from cobo_waas2.models.list_destination_entries200_response import ListDestinationEntries200Response from cobo_waas2.models.list_destinations200_response import ListDestinations200Response from cobo_waas2.models.list_exchanges200_response_inner import ListExchanges200ResponseInner +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response from cobo_waas2.models.list_forced_sweep_requests200_response import ListForcedSweepRequests200Response from cobo_waas2.models.list_key_share_holder_groups200_response import ListKeyShareHolderGroups200Response from cobo_waas2.models.list_key_share_holders200_response import ListKeyShareHolders200Response diff --git a/cobo_waas2/api/auto_sweep_api.py b/cobo_waas2/api/auto_sweep_api.py index a6999369..1fb342a0 100644 --- a/cobo_waas2/api/auto_sweep_api.py +++ b/cobo_waas2/api/auto_sweep_api.py @@ -40,6 +40,175 @@ def __init__(self, api_client: ApiClient = None) -> None: api_client = ApiClient.get_default() self.api_client = api_client + @validate_call + def cancel_auto_sweep_task_by_id( + self, + task_id: Annotated[StrictStr, Field(description="The auto sweep task ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> AutoSweepTask: + """Cancel auto sweep task + + This operation cancels an in-progress auto sweep task by its ID. Only tasks with the `Submitted` status can be cancelled. Tasks that have already been processed (status `TransactionCreated`) cannot be cancelled. + + :param task_id: The auto sweep task ID. (required) + :type task_id: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_auto_sweep_task_by_id_serialize( + task_id=task_id, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoSweepTask", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def cancel_auto_sweep_task_by_id_with_http_info( + self, + task_id: Annotated[StrictStr, Field(description="The auto sweep task ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> ApiResponse[AutoSweepTask]: + """Cancel auto sweep task + + This operation cancels an in-progress auto sweep task by its ID. Only tasks with the `Submitted` status can be cancelled. Tasks that have already been processed (status `TransactionCreated`) cannot be cancelled. + + :param task_id: The auto sweep task ID. (required) + :type task_id: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_auto_sweep_task_by_id_serialize( + task_id=task_id, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoSweepTask", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def cancel_auto_sweep_task_by_id_without_preload_content( + self, + task_id: Annotated[StrictStr, Field(description="The auto sweep task ID.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> RESTResponseType: + """Cancel auto sweep task + + This operation cancels an in-progress auto sweep task by its ID. Only tasks with the `Submitted` status can be cancelled. Tasks that have already been processed (status `TransactionCreated`) cannot be cancelled. + + :param task_id: The auto sweep task ID. (required) + :type task_id: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._cancel_auto_sweep_task_by_id_serialize( + task_id=task_id, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "AutoSweepTask", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + def _cancel_auto_sweep_task_by_id_serialize( + self, + task_id, + ) -> RequestSerialized: + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if task_id is not None: + _path_params['task_id'] = task_id + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params = { + "Accept": "application/json", + "Content-Type": "application/json" + } + + return self.api_client.param_serialize( + method='POST', + resource_path='/auto_sweep/tasks/{task_id}/cancel', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + ) + @validate_call def create_auto_sweep_task( self, diff --git a/cobo_waas2/api/fee_station_api.py b/cobo_waas2/api/fee_station_api.py index 55cfdbc1..91107ebe 100644 --- a/cobo_waas2/api/fee_station_api.py +++ b/cobo_waas2/api/fee_station_api.py @@ -19,8 +19,10 @@ from cobo_waas2.models.estimated_fixed_fee import EstimatedFixedFee from cobo_waas2.models.fee_station_check_fee_station_usage import FeeStationCheckFeeStationUsage from cobo_waas2.models.fee_station_check_fee_station_usage_response import FeeStationCheckFeeStationUsageResponse +from cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType from cobo_waas2.models.fee_station_transfer import FeeStationTransfer from cobo_waas2.models.list_addresses200_response import ListAddresses200Response +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response from cobo_waas2.models.list_token_balances_for_fee_station200_response import ListTokenBalancesForFeeStation200Response from cobo_waas2.models.list_transactions200_response import ListTransactions200Response from cobo_waas2.models.transaction_detail import TransactionDetail @@ -788,6 +790,279 @@ def _list_fee_station_addresses_serialize( files=_files, ) + @validate_call + def list_fee_station_fiat_transactions( + self, + transaction_ids: Annotated[Optional[StrictStr], Field(description="A list of transaction IDs, separated by comma.")] = None, + transaction_type: Annotated[Optional[FeeStationFiatTransactionType], Field(description="The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. ")] = None, + min_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. ")] = None, + max_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. ")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. ")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of objects to return. For most operations, the value range is [1, 50].")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> ListFeeStationFiatTransactions200Response: + """List Fee Station fiat transactions + + This operation retrieves all Fee Station fiat transactions under your organization. You can filter the results by request IDs, transaction IDs, transaction type, and created timestamp. You can also paginate your query results. + + :param transaction_ids: A list of transaction IDs, separated by comma. + :type transaction_ids: str + :param transaction_type: The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. + :type transaction_type: FeeStationFiatTransactionType + :param min_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. + :type min_created_timestamp: int + :param max_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. + :type max_created_timestamp: int + :param before: A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. + :type before: str + :param after: A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. + :type after: str + :param limit: The maximum number of objects to return. For most operations, the value range is [1, 50]. + :type limit: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_fee_station_fiat_transactions_serialize( + transaction_ids=transaction_ids, + transaction_type=transaction_type, + min_created_timestamp=min_created_timestamp, + max_created_timestamp=max_created_timestamp, + before=before, + after=after, + limit=limit, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFeeStationFiatTransactions200Response", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + @validate_call + def list_fee_station_fiat_transactions_with_http_info( + self, + transaction_ids: Annotated[Optional[StrictStr], Field(description="A list of transaction IDs, separated by comma.")] = None, + transaction_type: Annotated[Optional[FeeStationFiatTransactionType], Field(description="The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. ")] = None, + min_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. ")] = None, + max_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. ")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. ")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of objects to return. For most operations, the value range is [1, 50].")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> ApiResponse[ListFeeStationFiatTransactions200Response]: + """List Fee Station fiat transactions + + This operation retrieves all Fee Station fiat transactions under your organization. You can filter the results by request IDs, transaction IDs, transaction type, and created timestamp. You can also paginate your query results. + + :param transaction_ids: A list of transaction IDs, separated by comma. + :type transaction_ids: str + :param transaction_type: The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. + :type transaction_type: FeeStationFiatTransactionType + :param min_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. + :type min_created_timestamp: int + :param max_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. + :type max_created_timestamp: int + :param before: A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. + :type before: str + :param after: A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. + :type after: str + :param limit: The maximum number of objects to return. For most operations, the value range is [1, 50]. + :type limit: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_fee_station_fiat_transactions_serialize( + transaction_ids=transaction_ids, + transaction_type=transaction_type, + min_created_timestamp=min_created_timestamp, + max_created_timestamp=max_created_timestamp, + before=before, + after=after, + limit=limit, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFeeStationFiatTransactions200Response", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + @validate_call + def list_fee_station_fiat_transactions_without_preload_content( + self, + transaction_ids: Annotated[Optional[StrictStr], Field(description="A list of transaction IDs, separated by comma.")] = None, + transaction_type: Annotated[Optional[FeeStationFiatTransactionType], Field(description="The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. ")] = None, + min_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. ")] = None, + max_created_timestamp: Annotated[Optional[StrictInt], Field(description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. ")] = None, + before: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. ")] = None, + after: Annotated[Optional[StrictStr], Field(description="A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. ")] = None, + limit: Annotated[Optional[StrictInt], Field(description="The maximum number of objects to return. For most operations, the value range is [1, 50].")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + ) -> RESTResponseType: + """List Fee Station fiat transactions + + This operation retrieves all Fee Station fiat transactions under your organization. You can filter the results by request IDs, transaction IDs, transaction type, and created timestamp. You can also paginate your query results. + + :param transaction_ids: A list of transaction IDs, separated by comma. + :type transaction_ids: str + :param transaction_type: The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. + :type transaction_type: FeeStationFiatTransactionType + :param min_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. + :type min_created_timestamp: int + :param max_created_timestamp: The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. + :type max_created_timestamp: int + :param before: A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. + :type before: str + :param after: A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. + :type after: str + :param limit: The maximum number of objects to return. For most operations, the value range is [1, 50]. + :type limit: 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 + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_fee_station_fiat_transactions_serialize( + transaction_ids=transaction_ids, + transaction_type=transaction_type, + min_created_timestamp=min_created_timestamp, + max_created_timestamp=max_created_timestamp, + before=before, + after=after, + limit=limit, + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "ListFeeStationFiatTransactions200Response", + '4XX': "ErrorResponse", + '5XX': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + def _list_fee_station_fiat_transactions_serialize( + self, + transaction_ids, + transaction_type, + min_created_timestamp, + max_created_timestamp, + before, + after, + limit, + ) -> RequestSerialized: + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _form_params: List[Tuple[str, str]] = [] + _files: Dict[str, Union[str, bytes]] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + # process the query parameters + if transaction_ids is not None: + + _query_params.append(('transaction_ids', transaction_ids)) + + if transaction_type is not None: + + _query_params.append(('transaction_type', transaction_type.value)) + + if min_created_timestamp is not None: + + _query_params.append(('min_created_timestamp', min_created_timestamp)) + + if max_created_timestamp is not None: + + _query_params.append(('max_created_timestamp', max_created_timestamp)) + + if before is not None: + + _query_params.append(('before', before)) + + if after is not None: + + _query_params.append(('after', after)) + + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the header parameters + # process the form parameters + # process the body parameter + + # set the HTTP header `Accept` + _header_params = { + "Accept": "application/json", + "Content-Type": "application/json" + } + + return self.api_client.param_serialize( + method='GET', + resource_path='/fee_station/fiat_transactions', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + ) + @validate_call def list_fee_station_transactions( self, diff --git a/cobo_waas2/api_client.py b/cobo_waas2/api_client.py index d683770d..fb2e1601 100644 --- a/cobo_waas2/api_client.py +++ b/cobo_waas2/api_client.py @@ -68,7 +68,7 @@ def __init__( self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} # Set default User-Agent. - self.user_agent = 'cobo-waas2-python-sdk/1.33.0' + self.user_agent = 'cobo-waas2-python-sdk/1.34.0' def __enter__(self): return self diff --git a/cobo_waas2/models/__init__.py b/cobo_waas2/models/__init__.py index b1c300fa..b3854856 100644 --- a/cobo_waas2/models/__init__.py +++ b/cobo_waas2/models/__init__.py @@ -265,6 +265,8 @@ from cobo_waas2.models.fee_station_check_fee_station_usage import FeeStationCheckFeeStationUsage from cobo_waas2.models.fee_station_check_fee_station_usage_response import FeeStationCheckFeeStationUsageResponse from cobo_waas2.models.fee_station_destination import FeeStationDestination +from cobo_waas2.models.fee_station_fiat_transaction import FeeStationFiatTransaction +from cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType from cobo_waas2.models.fee_station_gas_station_type import FeeStationGasStationType from cobo_waas2.models.fee_station_sponsor_transaction_description import FeeStationSponsorTransactionDescription from cobo_waas2.models.fee_station_transaction_type import FeeStationTransactionType @@ -337,6 +339,7 @@ from cobo_waas2.models.list_destination_entries200_response import ListDestinationEntries200Response from cobo_waas2.models.list_destinations200_response import ListDestinations200Response from cobo_waas2.models.list_exchanges200_response_inner import ListExchanges200ResponseInner +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response from cobo_waas2.models.list_forced_sweep_requests200_response import ListForcedSweepRequests200Response from cobo_waas2.models.list_key_share_holder_groups200_response import ListKeyShareHolderGroups200Response from cobo_waas2.models.list_key_share_holders200_response import ListKeyShareHolders200Response diff --git a/cobo_waas2/models/create_auto_sweep_task.py b/cobo_waas2/models/create_auto_sweep_task.py index a4e3d458..8f40a4c5 100644 --- a/cobo_waas2/models/create_auto_sweep_task.py +++ b/cobo_waas2/models/create_auto_sweep_task.py @@ -16,7 +16,7 @@ import json from pydantic import BaseModel, ConfigDict, Field, StrictStr -from typing import Any, ClassVar, Dict, List +from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -27,7 +27,8 @@ class CreateAutoSweepTask(BaseModel): """ # noqa: E501 wallet_id: StrictStr = Field(description="ID of the wallet where the token will be swept.") token_id: StrictStr = Field(description="ID of the token to be swept. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens).") - __properties: ClassVar[List[str]] = ["wallet_id", "token_id"] + min_balance_threshold: Optional[StrictStr] = Field(default=None, description="The minimum token balance threshold for auto sweep. If the token balance of an address is less than this threshold, the address will not be swept. ") + __properties: ClassVar[List[str]] = ["wallet_id", "token_id", "min_balance_threshold"] model_config = ConfigDict( populate_by_name=True, @@ -81,7 +82,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "wallet_id": obj.get("wallet_id"), - "token_id": obj.get("token_id") + "token_id": obj.get("token_id"), + "min_balance_threshold": obj.get("min_balance_threshold") }) return _obj diff --git a/cobo_waas2/models/fee_station_fiat_transaction.py b/cobo_waas2/models/fee_station_fiat_transaction.py new file mode 100644 index 00000000..dbea7a43 --- /dev/null +++ b/cobo_waas2/models/fee_station_fiat_transaction.py @@ -0,0 +1,110 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + 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 cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType +from typing import Optional, Set +from typing_extensions import Self + + +class FeeStationFiatTransaction(BaseModel): + """ + The information about a fiat transaction. + """ # noqa: E501 + transaction_id: StrictStr = Field(description="The transaction ID.") + main_transaction_id: Optional[StrictStr] = Field(default=None, description="The UUID of the parent (main) transaction that this record is associated with. Set only when the current record is a gas/fee transaction initiated by FeeStation; omit for main transactions.") + transaction_type: FeeStationFiatTransactionType + amount: StrictStr = Field(description="The transaction amount.") + fiat_currency: StrictStr = Field(description="The fiat currency of the transaction. Possible values include: - `USD`: US Dollar. ") + status: StrictStr = Field(description="The status of the fiat transaction. Possible values include: - `Created`: The transaction has been created. - `Succeeded`: The transaction has been completed successfully. ") + cobo_category: Optional[List[StrictStr]] = Field(default=None, description="The Cobo category of the transaction.") + created_timestamp: Optional[StrictInt] = Field(default=None, description="The time when the transaction was created, in Unix timestamp format, measured in milliseconds.") + modified_timestamp: Optional[StrictInt] = Field(default=None, description="The time when the transaction was last modified, in Unix timestamp format, measured in milliseconds.") + __properties: ClassVar[List[str]] = ["transaction_id", "main_transaction_id", "transaction_type", "amount", "fiat_currency", "status", "cobo_category", "created_timestamp", "modified_timestamp"] + + @field_validator('status') + def status_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['Created', 'Succeeded']): + raise ValueError("must be one of enum values ('Created', 'Succeeded')") + 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 FeeStationFiatTransaction 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 FeeStationFiatTransaction from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "transaction_id": obj.get("transaction_id"), + "main_transaction_id": obj.get("main_transaction_id"), + "transaction_type": obj.get("transaction_type"), + "amount": obj.get("amount"), + "fiat_currency": obj.get("fiat_currency"), + "status": obj.get("status"), + "cobo_category": obj.get("cobo_category"), + "created_timestamp": obj.get("created_timestamp"), + "modified_timestamp": obj.get("modified_timestamp") + }) + return _obj + + diff --git a/cobo_waas2/models/fee_station_fiat_transaction_type.py b/cobo_waas2/models/fee_station_fiat_transaction_type.py new file mode 100644 index 00000000..8c4ea35d --- /dev/null +++ b/cobo_waas2/models/fee_station_fiat_transaction_type.py @@ -0,0 +1,41 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class FeeStationFiatTransactionType(str, Enum): + """ + The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. + """ + + """ + allowed enum values + """ + DEPOSIT = 'deposit' + TRANSFER = 'transfer' + + UNKNOWN = None + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of FeeStationFiatTransactionType from a JSON string""" + return cls(json.loads(json_str)) + + @classmethod + def _missing_(cls, value): + return cls.UNKNOWN + + diff --git a/cobo_waas2/models/list_fee_station_fiat_transactions200_response.py b/cobo_waas2/models/list_fee_station_fiat_transactions200_response.py new file mode 100644 index 00000000..b01c703d --- /dev/null +++ b/cobo_waas2/models/list_fee_station_fiat_transactions200_response.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + 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 +from typing import Any, ClassVar, Dict, List, Optional +from cobo_waas2.models.fee_station_fiat_transaction import FeeStationFiatTransaction +from cobo_waas2.models.pagination import Pagination +from typing import Optional, Set +from typing_extensions import Self + + +class ListFeeStationFiatTransactions200Response(BaseModel): + """ + ListFeeStationFiatTransactions200Response + """ # noqa: E501 + data: Optional[List[FeeStationFiatTransaction]] = None + pagination: Optional[Pagination] = None + __properties: ClassVar[List[str]] = ["data", "pagination"] + + 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 ListFeeStationFiatTransactions200Response 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 in self.data: + if _item: + _items.append(_item.to_dict()) + _dict['data'] = _items + # override the default output from pydantic by calling `to_dict()` of pagination + if self.pagination: + _dict['pagination'] = self.pagination.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ListFeeStationFiatTransactions200Response from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "data": [FeeStationFiatTransaction.from_dict(_item) for _item in obj["data"]] if obj.get("data") is not None else None, + "pagination": Pagination.from_dict(obj["pagination"]) if obj.get("pagination") is not None else None + }) + return _obj + + diff --git a/cobo_waas2/models/payment_estimate_fee_request.py b/cobo_waas2/models/payment_estimate_fee_request.py index 1b49a243..7707f533 100644 --- a/cobo_waas2/models/payment_estimate_fee_request.py +++ b/cobo_waas2/models/payment_estimate_fee_request.py @@ -15,7 +15,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from cobo_waas2.models.payment_estimate_fee import PaymentEstimateFee from cobo_waas2.models.payment_fee_type import PaymentFeeType @@ -30,7 +30,8 @@ class PaymentEstimateFeeRequest(BaseModel): fee_type: Optional[PaymentFeeType] = None estimate_fees: List[PaymentEstimateFee] = Field(description="A list of token IDs and amounts for which fees will be calculated.") recipient_token_id: Optional[StrictStr] = Field(default=None, description="The token ID that the recipient will receive. Required only when `fee_type` is `CryptoPayoutBridge`.") - __properties: ClassVar[List[str]] = ["fee_type", "estimate_fees", "recipient_token_id"] + transfer_via_va: Optional[StrictBool] = Field(default=None, description="For OffRamp payout, whether the payout is transferred to a registered bank account via a virtual account (VA) or directly. - `true`: The payout is transferred to a registered bank account via a VA (virtual account). - `false`: The payout is transferred directly to a registered bank account. ") + __properties: ClassVar[List[str]] = ["fee_type", "estimate_fees", "recipient_token_id", "transfer_via_va"] model_config = ConfigDict( populate_by_name=True, @@ -92,7 +93,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: _obj = cls.model_validate({ "fee_type": obj.get("fee_type"), "estimate_fees": [PaymentEstimateFee.from_dict(_item) for _item in obj["estimate_fees"]] if obj.get("estimate_fees") is not None else None, - "recipient_token_id": obj.get("recipient_token_id") + "recipient_token_id": obj.get("recipient_token_id"), + "transfer_via_va": obj.get("transfer_via_va") }) return _obj diff --git a/cobo_waas2/models/payment_payout_recipient_info.py b/cobo_waas2/models/payment_payout_recipient_info.py index cd9f0eac..7d90d157 100644 --- a/cobo_waas2/models/payment_payout_recipient_info.py +++ b/cobo_waas2/models/payment_payout_recipient_info.py @@ -15,7 +15,7 @@ import re # noqa: F401 import json -from pydantic import BaseModel, ConfigDict, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr from typing import Any, ClassVar, Dict, List, Optional from typing import Optional, Set from typing_extensions import Self @@ -29,7 +29,8 @@ class PaymentPayoutRecipientInfo(BaseModel): token_id: Optional[StrictStr] = Field(default=None, description="The token ID for the cryptocurrency to be sent to the recipient. If `recipient_info.token_id` is on a different chain than `payout_param.token_id`, the token will be automatically bridged to the chain specified in `recipient_info.token_id`. ") currency: Optional[StrictStr] = Field(default=None, description="The fiat currency of the bank account to which the payout will be sent.") bank_account_id: Optional[StrictStr] = Field(default=None, description="The ID of the bank account to which the payout will be sent. You can retrieve the bank account ID by calling [List destination entries](https://www.cobo.com/payments/en/api-references/payment/list-destination-entries).") - __properties: ClassVar[List[str]] = ["address", "token_id", "currency", "bank_account_id"] + transfer_via_va: Optional[StrictBool] = Field(default=None, description="For OffRamp payout, whether the payout is transferred to a registered bank account via a virtual account (VA) or directly. - `true`: The payout is transferred to a registered bank account via a VA (virtual account). - `false`: The payout is transferred directly to a registered bank account. ") + __properties: ClassVar[List[str]] = ["address", "token_id", "currency", "bank_account_id", "transfer_via_va"] model_config = ConfigDict( populate_by_name=True, @@ -85,7 +86,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: "address": obj.get("address"), "token_id": obj.get("token_id"), "currency": obj.get("currency"), - "bank_account_id": obj.get("bank_account_id") + "bank_account_id": obj.get("bank_account_id"), + "transfer_via_va": obj.get("transfer_via_va") }) return _obj diff --git a/cobo_waas2/models/refund_link_business_info.py b/cobo_waas2/models/refund_link_business_info.py index 76e3c879..d23a4e67 100644 --- a/cobo_waas2/models/refund_link_business_info.py +++ b/cobo_waas2/models/refund_link_business_info.py @@ -26,12 +26,13 @@ class RefundLinkBusinessInfo(BaseModel): """ RefundLinkBusinessInfo """ # noqa: E501 - transaction_id: StrictStr = Field(description="The transaction ID of the original order payment or top-up. On the refund page, the from address of this transaction will be pre-filled as the default refund address. The refund will be processed in the same token and on the same blockchain as this transaction. ") + order_id: Optional[StrictStr] = Field(default=None, description="The id of the order to refund. Specify either `order_id` or `transaction_id`, but not both. ") + transaction_id: Optional[StrictStr] = Field(default=None, description="The transaction ID of the original order payment or top-up. Specify either `order_id` or `transaction_id`, but not both. On the refund page, the from address of this transaction will be pre-filled as the default refund address. The refund will be processed in the same token and on the same blockchain as this transaction. ") amount: StrictStr = Field(description="The amount to refund, denominated in the cryptocurrency of the original payment transaction. The amount must be a positive number and can have up to two decimal places.") refund_source: RefundType merchant_id: Optional[StrictStr] = Field(default=None, description="The merchant ID, required if `refund_source` is `Merchant`. The fund will be deducted from the specified merchant's balance.") fee_amount: Optional[StrictStr] = Field(default=None, description="The developer fee amount to charge the merchant, denominated in the cryptocurrency of the original payment transaction. This field is only valid when `refund_source` is `Merchant`. For more information, please refer to [Accounts and fund allocation](https://www.cobo.com/payments/en/guides/amounts-and-balances). Must be: - A positive integer with up to two decimal places. - Less than the refund amount ") - __properties: ClassVar[List[str]] = ["transaction_id", "amount", "refund_source", "merchant_id", "fee_amount"] + __properties: ClassVar[List[str]] = ["order_id", "transaction_id", "amount", "refund_source", "merchant_id", "fee_amount"] model_config = ConfigDict( populate_by_name=True, @@ -84,6 +85,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: return cls.model_validate(obj) _obj = cls.model_validate({ + "order_id": obj.get("order_id"), "transaction_id": obj.get("transaction_id"), "amount": obj.get("amount"), "refund_source": obj.get("refund_source"), diff --git a/docs/AutoSweepApi.md b/docs/AutoSweepApi.md index 3725aa0e..f1deb64a 100644 --- a/docs/AutoSweepApi.md +++ b/docs/AutoSweepApi.md @@ -4,6 +4,7 @@ All URIs are relative to *https://api.dev.cobo.com/v2* Method | HTTP request | Description ------------- | ------------- | ------------- +[**cancel_auto_sweep_task_by_id**](AutoSweepApi.md#cancel_auto_sweep_task_by_id) | **POST** /auto_sweep/tasks/{task_id}/cancel | Cancel auto sweep task [**create_auto_sweep_task**](AutoSweepApi.md#create_auto_sweep_task) | **POST** /auto_sweep/tasks | Create auto-sweep task [**create_wallet_sweep_to_addresses**](AutoSweepApi.md#create_wallet_sweep_to_addresses) | **POST** /auto_sweep/sweep_to_addresses | Create sweep-to address [**get_auto_sweep_task_by_id**](AutoSweepApi.md#get_auto_sweep_task_by_id) | **GET** /auto_sweep/tasks/{task_id} | Get auto-sweep task details @@ -11,6 +12,78 @@ Method | HTTP request | Description [**list_wallet_sweep_to_addresses**](AutoSweepApi.md#list_wallet_sweep_to_addresses) | **GET** /auto_sweep/sweep_to_addresses | List sweep-to addresses +# **cancel_auto_sweep_task_by_id** +> AutoSweepTask cancel_auto_sweep_task_by_id(task_id) + +Cancel auto sweep task + +This operation cancels an in-progress auto sweep task by its ID. Only tasks with the `Submitted` status can be cancelled. Tasks that have already been processed (status `TransactionCreated`) cannot be cancelled. + +### Example + +* OAuth Authentication (OAuth2): +* Api Key Authentication (CoboAuth): + +```python +import cobo_waas2 +from cobo_waas2.models.auto_sweep_task import AutoSweepTask +from cobo_waas2.rest import ApiException +from pprint import pprint + +# See configuration.py for a list of all supported configurations. +configuration = cobo_waas2.Configuration( + # Replace `` with your private key + api_private_key="", + # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2. + host="https://api.dev.cobo.com/v2" +) +# Enter a context with an instance of the API client +with cobo_waas2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = cobo_waas2.AutoSweepApi(api_client) + task_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479' + + try: + # Cancel auto sweep task + api_response = api_instance.cancel_auto_sweep_task_by_id(task_id) + print("The response of AutoSweepApi->cancel_auto_sweep_task_by_id:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling AutoSweepApi->cancel_auto_sweep_task_by_id: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **task_id** | **str**| The auto sweep task ID. | + +### Return type + +[**AutoSweepTask**](AutoSweepTask.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [CoboAuth](../README.md#CoboAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully cancelled the auto sweep task. | - | +**4XX** | Bad request. Your request contains malformed syntax or invalid parameters. | - | +**5XX** | Internal server error. | - | + +[[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) + # **create_auto_sweep_task** > AutoSweepTask create_auto_sweep_task(create_auto_sweep_task=create_auto_sweep_task) diff --git a/docs/CreateAutoSweepTask.md b/docs/CreateAutoSweepTask.md index 71a43123..485c69d3 100644 --- a/docs/CreateAutoSweepTask.md +++ b/docs/CreateAutoSweepTask.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **wallet_id** | **str** | ID of the wallet where the token will be swept. | **token_id** | **str** | ID of the token to be swept. You can retrieve the IDs of all the tokens you can use by calling [List enabled tokens](https://www.cobo.com/developers/v2/api-references/wallets/list-enabled-tokens). | +**min_balance_threshold** | **str** | The minimum token balance threshold for auto sweep. If the token balance of an address is less than this threshold, the address will not be swept. | [optional] ## Example diff --git a/docs/FeeStationApi.md b/docs/FeeStationApi.md index ba898427..3925e55d 100644 --- a/docs/FeeStationApi.md +++ b/docs/FeeStationApi.md @@ -8,6 +8,7 @@ Method | HTTP request | Description [**estimate_fee_station_fee**](FeeStationApi.md#estimate_fee_station_fee) | **POST** /fee_station/transactions/estimate_fee | Estimate transaction fee [**get_fee_station_transaction_by_id**](FeeStationApi.md#get_fee_station_transaction_by_id) | **GET** /fee_station/transactions/{transaction_id} | Get Fee Station transaction information [**list_fee_station_addresses**](FeeStationApi.md#list_fee_station_addresses) | **GET** /fee_station/addresses | List Fee Station addresses +[**list_fee_station_fiat_transactions**](FeeStationApi.md#list_fee_station_fiat_transactions) | **GET** /fee_station/fiat_transactions | List Fee Station fiat transactions [**list_fee_station_transactions**](FeeStationApi.md#list_fee_station_transactions) | **GET** /fee_station/transactions | List all Fee Station transactions [**list_token_balances_for_fee_station**](FeeStationApi.md#list_token_balances_for_fee_station) | **GET** /fee_station/tokens | List Fee Station token balances @@ -310,6 +311,91 @@ Name | Type | Description | Notes [[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) +# **list_fee_station_fiat_transactions** +> ListFeeStationFiatTransactions200Response list_fee_station_fiat_transactions(transaction_ids=transaction_ids, transaction_type=transaction_type, min_created_timestamp=min_created_timestamp, max_created_timestamp=max_created_timestamp, before=before, after=after, limit=limit) + +List Fee Station fiat transactions + +This operation retrieves all Fee Station fiat transactions under your organization. You can filter the results by request IDs, transaction IDs, transaction type, and created timestamp. You can also paginate your query results. + +### Example + +* OAuth Authentication (OAuth2): +* Api Key Authentication (CoboAuth): + +```python +import cobo_waas2 +from cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response +from cobo_waas2.rest import ApiException +from pprint import pprint + +# See configuration.py for a list of all supported configurations. +configuration = cobo_waas2.Configuration( + # Replace `` with your private key + api_private_key="", + # Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2. + host="https://api.dev.cobo.com/v2" +) +# Enter a context with an instance of the API client +with cobo_waas2.ApiClient(configuration) as api_client: + # Create an instance of the API class + api_instance = cobo_waas2.FeeStationApi(api_client) + transaction_ids = 'f47ac10b-58cc-4372-a567-0e02b2c3d479,557918d2-632a-4fe1-932f-315711f05fe3' + transaction_type = cobo_waas2.FeeStationFiatTransactionType() + min_created_timestamp = 1635744000000 + max_created_timestamp = 1635744000000 + before = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1' + after = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk' + limit = 10 + + try: + # List Fee Station fiat transactions + api_response = api_instance.list_fee_station_fiat_transactions(transaction_ids=transaction_ids, transaction_type=transaction_type, min_created_timestamp=min_created_timestamp, max_created_timestamp=max_created_timestamp, before=before, after=after, limit=limit) + print("The response of FeeStationApi->list_fee_station_fiat_transactions:\n") + pprint(api_response) + except Exception as e: + print("Exception when calling FeeStationApi->list_fee_station_fiat_transactions: %s\n" % e) +``` + + + +### Parameters + + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **transaction_ids** | **str**| A list of transaction IDs, separated by comma. | [optional] + **transaction_type** | [**FeeStationFiatTransactionType**](.md)| The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. | [optional] + **min_created_timestamp** | **int**| The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or after the specified time. If you specify `min_created_timestamp` without specifying `max_created_timestamp`, `max_created_timestamp` is automatically set to `min_created_timestamp` + 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is 90 days before the current time. This default value is subject to change. | [optional] + **max_created_timestamp** | **int**| The time when the transaction was created, in Unix timestamp format, measured in milliseconds. You can use this parameter to filter transactions created on or before the specified time. If you specify `max_created_timestamp` without specifying `min_created_timestamp`, `min_created_timestamp` is automatically set to `max_created_timestamp` - 90 days. If you specify both, the time range cannot exceed 90 days. If not provided, the default value is the current time. This default value is subject to change. | [optional] + **before** | **str**| A cursor indicating the position before the current page. This value is generated by Cobo and returned in the response. If you are paginating forward from the beginning, you do not need to provide it on the first request. When paginating backward (to the previous page), you should pass the before value returned from the last response. | [optional] + **after** | **str**| A cursor indicating the position after the current page. This value is generated by Cobo and returned in the response. You do not need to provide it on the first request. When paginating forward (to the next page), you should pass the after value returned from the last response. | [optional] + **limit** | **int**| The maximum number of objects to return. For most operations, the value range is [1, 50]. | [optional] [default to 10] + +### Return type + +[**ListFeeStationFiatTransactions200Response**](ListFeeStationFiatTransactions200Response.md) + +### Authorization + +[OAuth2](../README.md#OAuth2), [CoboAuth](../README.md#CoboAuth) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | The information about the fiat transactions. | - | +**4XX** | Bad request. Your request contains malformed syntax or invalid parameters. | - | +**5XX** | Internal server error. | - | + +[[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) + # **list_fee_station_transactions** > ListTransactions200Response list_fee_station_transactions(request_id=request_id, cobo_ids=cobo_ids, transaction_ids=transaction_ids, transaction_hashes=transaction_hashes, types=types, statuses=statuses, chain_ids=chain_ids, token_ids=token_ids, asset_ids=asset_ids, min_created_timestamp=min_created_timestamp, max_created_timestamp=max_created_timestamp, limit=limit, before=before, after=after, direction=direction) diff --git a/docs/FeeStationFiatTransaction.md b/docs/FeeStationFiatTransaction.md new file mode 100644 index 00000000..aa6317b0 --- /dev/null +++ b/docs/FeeStationFiatTransaction.md @@ -0,0 +1,38 @@ +# FeeStationFiatTransaction + +The information about a fiat transaction. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**transaction_id** | **str** | The transaction ID. | +**main_transaction_id** | **str** | The UUID of the parent (main) transaction that this record is associated with. Set only when the current record is a gas/fee transaction initiated by FeeStation; omit for main transactions. | [optional] +**transaction_type** | [**FeeStationFiatTransactionType**](FeeStationFiatTransactionType.md) | | +**amount** | **str** | The transaction amount. | +**fiat_currency** | **str** | The fiat currency of the transaction. Possible values include: - `USD`: US Dollar. | +**status** | **str** | The status of the fiat transaction. Possible values include: - `Created`: The transaction has been created. - `Succeeded`: The transaction has been completed successfully. | +**cobo_category** | **List[str]** | The Cobo category of the transaction. | [optional] +**created_timestamp** | **int** | The time when the transaction was created, in Unix timestamp format, measured in milliseconds. | [optional] +**modified_timestamp** | **int** | The time when the transaction was last modified, in Unix timestamp format, measured in milliseconds. | [optional] + +## Example + +```python +from cobo_waas2.models.fee_station_fiat_transaction import FeeStationFiatTransaction + +# TODO update the JSON string below +json = "{}" +# create an instance of FeeStationFiatTransaction from a JSON string +fee_station_fiat_transaction_instance = FeeStationFiatTransaction.from_json(json) +# print the JSON string representation of the object +print(FeeStationFiatTransaction.to_json()) + +# convert the object into a dict +fee_station_fiat_transaction_dict = fee_station_fiat_transaction_instance.to_dict() +# create an instance of FeeStationFiatTransaction from a dict +fee_station_fiat_transaction_from_dict = FeeStationFiatTransaction.from_dict(fee_station_fiat_transaction_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/docs/FeeStationFiatTransactionType.md b/docs/FeeStationFiatTransactionType.md new file mode 100644 index 00000000..3f89b08e --- /dev/null +++ b/docs/FeeStationFiatTransactionType.md @@ -0,0 +1,12 @@ +# FeeStationFiatTransactionType + +The type of the fiat transaction. Possible values include: - `deposit`: A deposit transaction. - `transfer`: A transfer transaction. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + +[[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/docs/ListFeeStationFiatTransactions200Response.md b/docs/ListFeeStationFiatTransactions200Response.md new file mode 100644 index 00000000..72155f31 --- /dev/null +++ b/docs/ListFeeStationFiatTransactions200Response.md @@ -0,0 +1,30 @@ +# ListFeeStationFiatTransactions200Response + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**List[FeeStationFiatTransaction]**](FeeStationFiatTransaction.md) | | [optional] +**pagination** | [**Pagination**](Pagination.md) | | [optional] + +## Example + +```python +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response + +# TODO update the JSON string below +json = "{}" +# create an instance of ListFeeStationFiatTransactions200Response from a JSON string +list_fee_station_fiat_transactions200_response_instance = ListFeeStationFiatTransactions200Response.from_json(json) +# print the JSON string representation of the object +print(ListFeeStationFiatTransactions200Response.to_json()) + +# convert the object into a dict +list_fee_station_fiat_transactions200_response_dict = list_fee_station_fiat_transactions200_response_instance.to_dict() +# create an instance of ListFeeStationFiatTransactions200Response from a dict +list_fee_station_fiat_transactions200_response_from_dict = ListFeeStationFiatTransactions200Response.from_dict(list_fee_station_fiat_transactions200_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/docs/PaymentEstimateFeeRequest.md b/docs/PaymentEstimateFeeRequest.md index 524125b2..22138517 100644 --- a/docs/PaymentEstimateFeeRequest.md +++ b/docs/PaymentEstimateFeeRequest.md @@ -8,6 +8,7 @@ Name | Type | Description | Notes **fee_type** | [**PaymentFeeType**](PaymentFeeType.md) | | [optional] **estimate_fees** | [**List[PaymentEstimateFee]**](PaymentEstimateFee.md) | A list of token IDs and amounts for which fees will be calculated. | **recipient_token_id** | **str** | The token ID that the recipient will receive. Required only when `fee_type` is `CryptoPayoutBridge`. | [optional] +**transfer_via_va** | **bool** | For OffRamp payout, whether the payout is transferred to a registered bank account via a virtual account (VA) or directly. - `true`: The payout is transferred to a registered bank account via a VA (virtual account). - `false`: The payout is transferred directly to a registered bank account. | [optional] ## Example diff --git a/docs/PaymentPayoutRecipientInfo.md b/docs/PaymentPayoutRecipientInfo.md index 7770701d..c7e869b7 100644 --- a/docs/PaymentPayoutRecipientInfo.md +++ b/docs/PaymentPayoutRecipientInfo.md @@ -9,6 +9,7 @@ Name | Type | Description | Notes **token_id** | **str** | The token ID for the cryptocurrency to be sent to the recipient. If `recipient_info.token_id` is on a different chain than `payout_param.token_id`, the token will be automatically bridged to the chain specified in `recipient_info.token_id`. | [optional] **currency** | **str** | The fiat currency of the bank account to which the payout will be sent. | [optional] **bank_account_id** | **str** | The ID of the bank account to which the payout will be sent. You can retrieve the bank account ID by calling [List destination entries](https://www.cobo.com/payments/en/api-references/payment/list-destination-entries). | [optional] +**transfer_via_va** | **bool** | For OffRamp payout, whether the payout is transferred to a registered bank account via a virtual account (VA) or directly. - `true`: The payout is transferred to a registered bank account via a VA (virtual account). - `false`: The payout is transferred directly to a registered bank account. | [optional] ## Example diff --git a/docs/RefundLinkBusinessInfo.md b/docs/RefundLinkBusinessInfo.md index 038eb9d4..ae8971d3 100644 --- a/docs/RefundLinkBusinessInfo.md +++ b/docs/RefundLinkBusinessInfo.md @@ -5,7 +5,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**transaction_id** | **str** | The transaction ID of the original order payment or top-up. On the refund page, the from address of this transaction will be pre-filled as the default refund address. The refund will be processed in the same token and on the same blockchain as this transaction. | +**order_id** | **str** | The id of the order to refund. Specify either `order_id` or `transaction_id`, but not both. | [optional] +**transaction_id** | **str** | The transaction ID of the original order payment or top-up. Specify either `order_id` or `transaction_id`, but not both. On the refund page, the from address of this transaction will be pre-filled as the default refund address. The refund will be processed in the same token and on the same blockchain as this transaction. | [optional] **amount** | **str** | The amount to refund, denominated in the cryptocurrency of the original payment transaction. The amount must be a positive number and can have up to two decimal places. | **refund_source** | [**RefundType**](RefundType.md) | | **merchant_id** | **str** | The merchant ID, required if `refund_source` is `Merchant`. The fund will be deducted from the specified merchant's balance. | [optional] diff --git a/pyproject.toml b/pyproject.toml index cb66708b..0cc9b3fe 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cobo_waas2" -version = "1.33.0" +version = "1.34.0" description = "Cobo Wallet as a Service 2.0" authors = ["Cobo WaaS "] license = "Apache 2.0" diff --git a/setup.py b/setup.py index 86df5c32..84854fde 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "cobo-waas2" -VERSION = "1.33.0" +VERSION = "1.34.0" PYTHON_REQUIRES = ">=3.9" REQUIRES = [ "urllib3 >= 2.6.0", diff --git a/test/test_auto_sweep_api.py b/test/test_auto_sweep_api.py index c91f59c7..611dad7b 100644 --- a/test/test_auto_sweep_api.py +++ b/test/test_auto_sweep_api.py @@ -29,6 +29,18 @@ def setUp(self) -> None: def tearDown(self) -> None: pass + def test_cancel_auto_sweep_task_by_id(self) -> None: + """ + Test case for cancel_auto_sweep_task_by_id + + Cancel auto sweep task + """ + """ + task_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479' + + api_response = self.api.cancel_auto_sweep_task_by_id(task_id) + """ + def test_create_auto_sweep_task(self) -> None: """ Test case for create_auto_sweep_task diff --git a/test/test_create_auto_sweep_task.py b/test/test_create_auto_sweep_task.py index ba62a17f..9eff6033 100644 --- a/test/test_create_auto_sweep_task.py +++ b/test/test_create_auto_sweep_task.py @@ -35,7 +35,8 @@ def make_instance(self, include_optional) -> CreateAutoSweepTask: if include_optional: return CreateAutoSweepTask( wallet_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479', - token_id = 'ETH_USDT' + token_id = 'ETH_USDT', + min_balance_threshold = '0.01' ) else: return CreateAutoSweepTask( diff --git a/test/test_create_payout_request.py b/test/test_create_payout_request.py index 6fbd6960..640d75bf 100644 --- a/test/test_create_payout_request.py +++ b/test/test_create_payout_request.py @@ -46,7 +46,8 @@ def make_instance(self, include_optional) -> CreatePayoutRequest: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), remark = 'Create payouts for customer 123' ) else: @@ -63,7 +64,8 @@ def make_instance(self, include_optional) -> CreatePayoutRequest: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), ) """ diff --git a/test/test_create_refund_link_request.py b/test/test_create_refund_link_request.py index 1d073a92..ab98ab78 100644 --- a/test/test_create_refund_link_request.py +++ b/test/test_create_refund_link_request.py @@ -35,6 +35,7 @@ def make_instance(self, include_optional) -> CreateRefundLinkRequest: if include_optional: return CreateRefundLinkRequest( business_info = cobo_waas2.models.refund_link_business_info.RefundLinkBusinessInfo( + order_id = 'O20250304-M1001-1001', transaction_id = 'aff0e1cb-15b2-4e1f-9b9d-a9133715986f', amount = '0.0025', refund_source = 'Merchant', @@ -48,6 +49,7 @@ def make_instance(self, include_optional) -> CreateRefundLinkRequest: else: return CreateRefundLinkRequest( business_info = cobo_waas2.models.refund_link_business_info.RefundLinkBusinessInfo( + order_id = 'O20250304-M1001-1001', transaction_id = 'aff0e1cb-15b2-4e1f-9b9d-a9133715986f', amount = '0.0025', refund_source = 'Merchant', diff --git a/test/test_fee_station_api.py b/test/test_fee_station_api.py index 7c7db65c..28bbb79d 100644 --- a/test/test_fee_station_api.py +++ b/test/test_fee_station_api.py @@ -81,6 +81,24 @@ def test_list_fee_station_addresses(self) -> None: api_response = self.api.list_fee_station_addresses(chain_ids=chain_ids, addresses=addresses, limit=limit, before=before, after=after) """ + def test_list_fee_station_fiat_transactions(self) -> None: + """ + Test case for list_fee_station_fiat_transactions + + List Fee Station fiat transactions + """ + """ + transaction_ids = 'f47ac10b-58cc-4372-a567-0e02b2c3d479,557918d2-632a-4fe1-932f-315711f05fe3' + transaction_type = cobo_waas2.FeeStationFiatTransactionType() + min_created_timestamp = 1635744000000 + max_created_timestamp = 1635744000000 + before = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1' + after = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk' + limit = 10 + + api_response = self.api.list_fee_station_fiat_transactions(transaction_ids=transaction_ids, transaction_type=transaction_type, min_created_timestamp=min_created_timestamp, max_created_timestamp=max_created_timestamp, before=before, after=after, limit=limit) + """ + def test_list_fee_station_transactions(self) -> None: """ Test case for list_fee_station_transactions diff --git a/test/test_fee_station_fiat_transaction.py b/test/test_fee_station_fiat_transaction.py new file mode 100644 index 00000000..ab72b834 --- /dev/null +++ b/test/test_fee_station_fiat_transaction.py @@ -0,0 +1,64 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cobo_waas2.models.fee_station_fiat_transaction import FeeStationFiatTransaction + + +class TestFeeStationFiatTransaction(unittest.TestCase): + """FeeStationFiatTransaction unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> FeeStationFiatTransaction: + """Test FeeStationFiatTransaction + include_option 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 `FeeStationFiatTransaction` + """ + model = FeeStationFiatTransaction() + if include_optional: + return FeeStationFiatTransaction( + transaction_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479', + main_transaction_id = 'b0530b27-104f-4338-87de-de01500326ea', + transaction_type = 'deposit', + amount = '100.00', + fiat_currency = 'USD', + status = 'Succeeded', + cobo_category = ["GasFeeSponsor"], + created_timestamp = 1635744000000, + modified_timestamp = 1635744000000 + ) + else: + return FeeStationFiatTransaction( + transaction_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479', + transaction_type = 'deposit', + amount = '100.00', + fiat_currency = 'USD', + status = 'Succeeded', + ) + """ + + def testFeeStationFiatTransaction(self): + """Test FeeStationFiatTransaction""" + # 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/test/test_fee_station_fiat_transaction_type.py b/test/test_fee_station_fiat_transaction_type.py new file mode 100644 index 00000000..19443401 --- /dev/null +++ b/test/test_fee_station_fiat_transaction_type.py @@ -0,0 +1,33 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cobo_waas2.models.fee_station_fiat_transaction_type import FeeStationFiatTransactionType + + +class TestFeeStationFiatTransactionType(unittest.TestCase): + """FeeStationFiatTransactionType unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def testFeeStationFiatTransactionType(self): + """Test FeeStationFiatTransactionType""" + # inst = FeeStationFiatTransactionType() + + +if __name__ == '__main__': + unittest.main() diff --git a/test/test_list_fee_station_fiat_transactions200_response.py b/test/test_list_fee_station_fiat_transactions200_response.py new file mode 100644 index 00000000..4b746084 --- /dev/null +++ b/test/test_list_fee_station_fiat_transactions200_response.py @@ -0,0 +1,66 @@ +# coding: utf-8 + +""" + Cobo Wallet as a Service 2.0 + + Contact: help@cobo.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import unittest + +from cobo_waas2.models.list_fee_station_fiat_transactions200_response import ListFeeStationFiatTransactions200Response + + +class TestListFeeStationFiatTransactions200Response(unittest.TestCase): + """ListFeeStationFiatTransactions200Response unit test stubs""" + + def setUp(self): + pass + + def tearDown(self): + pass + + def make_instance(self, include_optional) -> ListFeeStationFiatTransactions200Response: + """Test ListFeeStationFiatTransactions200Response + include_option 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 `ListFeeStationFiatTransactions200Response` + """ + model = ListFeeStationFiatTransactions200Response() + if include_optional: + return ListFeeStationFiatTransactions200Response( + data = [ + cobo_waas2.models.fee_station_fiat_transaction.FeeStationFiatTransaction( + transaction_id = 'f47ac10b-58cc-4372-a567-0e02b2c3d479', + main_transaction_id = 'b0530b27-104f-4338-87de-de01500326ea', + transaction_type = 'deposit', + amount = '100.00', + fiat_currency = 'USD', + status = 'Succeeded', + cobo_category = ["GasFeeSponsor"], + created_timestamp = 1635744000000, + modified_timestamp = 1635744000000, ) + ], + pagination = cobo_waas2.models.pagination.Pagination( + before = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGmk1', + after = 'RqeEoTkgKG5rpzqYzg2Hd3szmPoj2cE7w5jWwShz3C1vyGSAk', + total_count = 10000, ) + ) + else: + return ListFeeStationFiatTransactions200Response( + ) + """ + + def testListFeeStationFiatTransactions200Response(self): + """Test ListFeeStationFiatTransactions200Response""" + # 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/test/test_list_payouts200_response.py b/test/test_list_payouts200_response.py index a85be4f9..b570b44a 100644 --- a/test/test_list_payouts200_response.py +++ b/test/test_list_payouts200_response.py @@ -54,7 +54,8 @@ def make_instance(self, include_optional) -> ListPayouts200Response: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), initiator = 'b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d', actual_payout_amount = '500.00', commission_fees = [ diff --git a/test/test_payment_estimate_fee_request.py b/test/test_payment_estimate_fee_request.py index c488cb81..cde6fccb 100644 --- a/test/test_payment_estimate_fee_request.py +++ b/test/test_payment_estimate_fee_request.py @@ -40,7 +40,8 @@ def make_instance(self, include_optional) -> PaymentEstimateFeeRequest: token_id = '', amount = '500.00', ) ], - recipient_token_id = '' + recipient_token_id = '', + transfer_via_va = False ) else: return PaymentEstimateFeeRequest( diff --git a/test/test_payment_payout.py b/test/test_payment_payout.py index 24589b2a..80bf49d6 100644 --- a/test/test_payment_payout.py +++ b/test/test_payment_payout.py @@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> PaymentPayout: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), initiator = 'b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d', actual_payout_amount = '500.00', commission_fees = [ diff --git a/test/test_payment_payout_detail.py b/test/test_payment_payout_detail.py index 71f75de9..cf0a76dd 100644 --- a/test/test_payment_payout_detail.py +++ b/test/test_payment_payout_detail.py @@ -52,7 +52,8 @@ def make_instance(self, include_optional) -> PaymentPayoutDetail: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), initiator = 'b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d', actual_payout_amount = '500.00', commission_fees = [ diff --git a/test/test_payment_payout_event.py b/test/test_payment_payout_event.py index 6ce20124..ee83ed93 100644 --- a/test/test_payment_payout_event.py +++ b/test/test_payment_payout_event.py @@ -53,7 +53,8 @@ def make_instance(self, include_optional) -> PaymentPayoutEvent: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), initiator = 'b2ae1b5aaade686c968ef2bbd31cc75ba94e5a85fd9cb0b35b81dcc15f520e9d', actual_payout_amount = '500.00', commission_fees = [ diff --git a/test/test_payment_payout_recipient_info.py b/test/test_payment_payout_recipient_info.py index e56296fd..af331314 100644 --- a/test/test_payment_payout_recipient_info.py +++ b/test/test_payment_payout_recipient_info.py @@ -37,7 +37,8 @@ def make_instance(self, include_optional) -> PaymentPayoutRecipientInfo: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003' + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False ) else: return PaymentPayoutRecipientInfo( diff --git a/test/test_refund_link_business_info.py b/test/test_refund_link_business_info.py index a8904dc4..e71a9532 100644 --- a/test/test_refund_link_business_info.py +++ b/test/test_refund_link_business_info.py @@ -34,6 +34,7 @@ def make_instance(self, include_optional) -> RefundLinkBusinessInfo: model = RefundLinkBusinessInfo() if include_optional: return RefundLinkBusinessInfo( + order_id = 'O20250304-M1001-1001', transaction_id = 'aff0e1cb-15b2-4e1f-9b9d-a9133715986f', amount = '0.0025', refund_source = 'Merchant', @@ -42,7 +43,6 @@ def make_instance(self, include_optional) -> RefundLinkBusinessInfo: ) else: return RefundLinkBusinessInfo( - transaction_id = 'aff0e1cb-15b2-4e1f-9b9d-a9133715986f', amount = '0.0025', refund_source = 'Merchant', ) diff --git a/test/test_webhook_event_data.py b/test/test_webhook_event_data.py index 7bc2c7f0..0fd3acbe 100644 --- a/test/test_webhook_event_data.py +++ b/test/test_webhook_event_data.py @@ -338,7 +338,8 @@ def make_instance(self, include_optional) -> WebhookEventData: address = '0x9876543210abcdef1234567890abcdef12345678', token_id = 'TRON_USDT', currency = 'USD', - bank_account_id = '123e4567-e89b-12d3-a456-426614174003', ), + bank_account_id = '123e4567-e89b-12d3-a456-426614174003', + transfer_via_va = False, ), actual_payout_amount = '500.00', commission_fees = [ cobo_waas2.models.commission_fee.CommissionFee(