From f3b6eaa83eca3388238c23b9e9e5743317c3c91c Mon Sep 17 00:00:00 2001 From: Revil Wang Date: Wed, 6 Dec 2023 15:15:00 +0800 Subject: [PATCH] release 4.60.1 --- README.md | 54 +- docs/AccountDetail.md | 1 + docs/AmendOrderResult.md | 2 +- docs/ApiV4KeyPerm.md | 2 +- docs/BatchOrder.md | 2 +- docs/Contract.md | 1 + docs/CrossMarginCurrency.md | 1 + docs/CurrencyPair.md | 2 + docs/DualGetOrders.md | 25 + docs/DualGetPlans.md | 22 + docs/EarnApi.md | 522 +++++++++ docs/Eth2Swap.md | 12 + docs/FuturesAccountBook.md | 2 + docs/FuturesApi.md | 14 +- docs/FuturesOrder.md | 1 + docs/MarginApi.md | 4 +- docs/Order.md | 2 +- docs/PlaceDualInvestmentOrder.md | 12 + docs/SpotApi.md | 2 +- docs/SpotPricePutOrder.md | 4 +- docs/StructuredBuy.md | 12 + docs/StructuredGetProjectList.md | 22 + docs/StructuredGetProjectListRequest.md | 14 + docs/StructuredOrderList.md | 17 + docs/StructuredOrderListRequest.md | 14 + docs/UniInterestMode.md | 2 +- docs/UnifiedAccount.md | 25 + docs/UnifiedApi.md | 635 ++++++++++ docs/UnifiedBalance.md | 17 + docs/UnifiedBorrowable.md | 11 + docs/UnifiedLoan.md | 15 + docs/UnifiedLoanRecord.md | 17 + docs/UnifiedMode.md | 11 + docs/UnifiedTransferable.md | 11 + docs/WalletApi.md | 4 +- docs/WithdrawStatus.md | 1 + docs/WithdrawalRecord.md | 20 + gate_api/__init__.py | 29 +- gate_api/api/__init__.py | 3 +- gate_api/api/earn_api.py | 860 ++++++++++++++ gate_api/api/futures_api.py | 18 +- gate_api/api/margin_api.py | 6 +- gate_api/api/spot_api.py | 4 +- gate_api/api/unified_api.py | 1028 +++++++++++++++++ gate_api/api/wallet_api.py | 6 +- gate_api/api_client.py | 2 +- gate_api/configuration.py | 4 +- gate_api/models/__init__.py | 24 +- gate_api/models/account_detail.py | 32 +- gate_api/models/amend_order_result.py | 4 +- gate_api/models/api_v4_key_perm.py | 6 +- gate_api/models/batch_order.py | 6 +- gate_api/models/contract.py | 31 +- gate_api/models/cross_margin_currency.py | 31 +- gate_api/models/currency_pair.py | 60 +- gate_api/models/dual_get_orders.py | 560 +++++++++ gate_api/models/dual_get_plans.py | 473 ++++++++ gate_api/models/eth2_swap.py | 145 +++ gate_api/models/futures_account_book.py | 86 +- gate_api/models/futures_order.py | 31 +- gate_api/models/order.py | 9 +- .../models/place_dual_investment_order.py | 145 +++ gate_api/models/spot_price_put_order.py | 13 +- gate_api/models/structured_buy.py | 143 +++ .../models/structured_get_project_list.py | 444 +++++++ .../structured_get_project_list_request.py | 195 ++++ gate_api/models/structured_order_list.py | 299 +++++ .../models/structured_order_list_request.py | 197 ++++ gate_api/models/unified_account.py | 558 +++++++++ gate_api/models/unified_balance.py | 328 ++++++ gate_api/models/unified_borrowable.py | 143 +++ gate_api/models/unified_loan.py | 237 ++++ gate_api/models/unified_loan_record.py | 299 +++++ gate_api/models/unified_mode.py | 145 +++ gate_api/models/unified_transferable.py | 143 +++ gate_api/models/withdraw_status.py | 31 +- gate_api/models/withdrawal_record.py | 437 +++++++ setup.py | 2 +- 78 files changed, 8653 insertions(+), 99 deletions(-) create mode 100644 docs/DualGetOrders.md create mode 100644 docs/DualGetPlans.md create mode 100644 docs/EarnApi.md create mode 100644 docs/Eth2Swap.md create mode 100644 docs/PlaceDualInvestmentOrder.md create mode 100644 docs/StructuredBuy.md create mode 100644 docs/StructuredGetProjectList.md create mode 100644 docs/StructuredGetProjectListRequest.md create mode 100644 docs/StructuredOrderList.md create mode 100644 docs/StructuredOrderListRequest.md create mode 100644 docs/UnifiedAccount.md create mode 100644 docs/UnifiedApi.md create mode 100644 docs/UnifiedBalance.md create mode 100644 docs/UnifiedBorrowable.md create mode 100644 docs/UnifiedLoan.md create mode 100644 docs/UnifiedLoanRecord.md create mode 100644 docs/UnifiedMode.md create mode 100644 docs/UnifiedTransferable.md create mode 100644 docs/WithdrawalRecord.md create mode 100644 gate_api/api/earn_api.py create mode 100644 gate_api/api/unified_api.py create mode 100644 gate_api/models/dual_get_orders.py create mode 100644 gate_api/models/dual_get_plans.py create mode 100644 gate_api/models/eth2_swap.py create mode 100644 gate_api/models/place_dual_investment_order.py create mode 100644 gate_api/models/structured_buy.py create mode 100644 gate_api/models/structured_get_project_list.py create mode 100644 gate_api/models/structured_get_project_list_request.py create mode 100644 gate_api/models/structured_order_list.py create mode 100644 gate_api/models/structured_order_list_request.py create mode 100644 gate_api/models/unified_account.py create mode 100644 gate_api/models/unified_balance.py create mode 100644 gate_api/models/unified_borrowable.py create mode 100644 gate_api/models/unified_loan.py create mode 100644 gate_api/models/unified_loan_record.py create mode 100644 gate_api/models/unified_mode.py create mode 100644 gate_api/models/unified_transferable.py create mode 100644 gate_api/models/withdrawal_record.py diff --git a/README.md b/README.md index f8edb98..8184ea5 100644 --- a/README.md +++ b/README.md @@ -5,8 +5,8 @@ APIv4 provides spot, margin and futures trading operations. There are public API This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 4.57.0 -- Package version: 4.57.0 +- API version: 4.60.1 +- Package version: 4.60.1 - Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://www.gate.io/page/contacts](https://www.gate.io/page/contacts) @@ -124,15 +124,6 @@ Class | Method | HTTP request | Description *MarginUniApi* | [**list_uni_loan_records**](docs/MarginUniApi.md#list_uni_loan_records) | **GET** /margin/uni/loan_records | Get load records *MarginUniApi* | [**list_uni_loan_interest_records**](docs/MarginUniApi.md#list_uni_loan_interest_records) | **GET** /margin/uni/interest_records | List interest records *MarginUniApi* | [**get_uni_borrowable**](docs/MarginUniApi.md#get_uni_borrowable) | **GET** /margin/uni/borrowable | Get maximum borrowable -*PortfolioApi* | [**list_portfolio_accounts**](docs/PortfolioApi.md#list_portfolio_accounts) | **GET** /portfolio/accounts | Get portfolio account information -*PortfolioApi* | [**list_account_portfolio_mode**](docs/PortfolioApi.md#list_account_portfolio_mode) | **GET** /portfolio/account_mode | Retrieve the account's portfolio mode -*PortfolioApi* | [**set_account_portfolio_mode**](docs/PortfolioApi.md#set_account_portfolio_mode) | **POST** /portfolio/account_mode | Configure the account's portfolio mode. -*PortfolioApi* | [**get_portfolio_borrowable**](docs/PortfolioApi.md#get_portfolio_borrowable) | **GET** /portfolio/borrowable | Retrieve the maximum borrowable amount for the account. -*PortfolioApi* | [**get_portfolio_transferable**](docs/PortfolioApi.md#get_portfolio_transferable) | **GET** /portfolio/transferable | Retrieve the maximum amount that can be transferred out from the account -*PortfolioApi* | [**list_portfolio_uni_loan_interest_records**](docs/PortfolioApi.md#list_portfolio_uni_loan_interest_records) | **GET** /portfolio/loans | List loans -*PortfolioApi* | [**create_portfolio_loan**](docs/PortfolioApi.md#create_portfolio_loan) | **POST** /portfolio/loans | Borrow or repay -*PortfolioApi* | [**list_portfolio_loan_records**](docs/PortfolioApi.md#list_portfolio_loan_records) | **GET** /portfolio/loan_records | Get load records -*PortfolioApi* | [**list_portfolio_loan_interest_records**](docs/PortfolioApi.md#list_portfolio_loan_interest_records) | **GET** /portfolio/interest_records | List interest records *SubAccountApi* | [**list_sub_accounts**](docs/SubAccountApi.md#list_sub_accounts) | **GET** /sub_accounts | List sub-accounts *SubAccountApi* | [**create_sub_accounts**](docs/SubAccountApi.md#create_sub_accounts) | **POST** /sub_accounts | Create a new sub-account *SubAccountApi* | [**get_sub_account**](docs/SubAccountApi.md#get_sub_account) | **GET** /sub_accounts/{user_id} | Get the sub-account @@ -143,6 +134,15 @@ Class | Method | HTTP request | Description *SubAccountApi* | [**delete_sub_account_keys**](docs/SubAccountApi.md#delete_sub_account_keys) | **DELETE** /sub_accounts/{user_id}/keys/{key} | Delete API key of the sub-account *SubAccountApi* | [**lock_sub_account**](docs/SubAccountApi.md#lock_sub_account) | **POST** /sub_accounts/{user_id}/lock | Lock the sub-account *SubAccountApi* | [**unlock_sub_account**](docs/SubAccountApi.md#unlock_sub_account) | **POST** /sub_accounts/{user_id}/unlock | Unlock the sub-account +*UnifiedApi* | [**list_unified_accounts**](docs/UnifiedApi.md#list_unified_accounts) | **GET** /unified/accounts | Get unified account information +*UnifiedApi* | [**list_unified_account_mode**](docs/UnifiedApi.md#list_unified_account_mode) | **GET** /unified/account_mode | Query mode of the unified account +*UnifiedApi* | [**set_unified_account_mode**](docs/UnifiedApi.md#set_unified_account_mode) | **POST** /unified/account_mode | Set mode of the unified account +*UnifiedApi* | [**get_unified_borrowable**](docs/UnifiedApi.md#get_unified_borrowable) | **GET** /unified/borrowable | Query about the maximum borrowing for the unified account +*UnifiedApi* | [**get_unified_transferable**](docs/UnifiedApi.md#get_unified_transferable) | **GET** /unified/transferable | Query about the maximum transferable for the unified account +*UnifiedApi* | [**list_unified_loans**](docs/UnifiedApi.md#list_unified_loans) | **GET** /unified/loans | List loans +*UnifiedApi* | [**create_unified_loan**](docs/UnifiedApi.md#create_unified_loan) | **POST** /unified/loans | Borrow or repay +*UnifiedApi* | [**list_unified_loan_records**](docs/UnifiedApi.md#list_unified_loan_records) | **GET** /unified/loan_records | Get load records +*UnifiedApi* | [**list_unified_loan_interest_records**](docs/UnifiedApi.md#list_unified_loan_interest_records) | **GET** /unified/interest_records | List interest records *AccountApi* | [**get_account_detail**](docs/AccountApi.md#get_account_detail) | **GET** /account/detail | Get account detail *AccountApi* | [**list_stp_groups**](docs/AccountApi.md#list_stp_groups) | **GET** /account/stp_groups | List STP Groups *AccountApi* | [**create_stp_group**](docs/AccountApi.md#create_stp_group) | **POST** /account/stp_groups | Create STP Group @@ -187,6 +187,14 @@ Class | Method | HTTP request | Description *DeliveryApi* | [**cancel_price_triggered_delivery_order_list**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order_list) | **DELETE** /delivery/{settle}/price_orders | Cancel all open orders *DeliveryApi* | [**get_price_triggered_delivery_order**](docs/DeliveryApi.md#get_price_triggered_delivery_order) | **GET** /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order *DeliveryApi* | [**cancel_price_triggered_delivery_order**](docs/DeliveryApi.md#cancel_price_triggered_delivery_order) | **DELETE** /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order +*EarnApi* | [**swap_eth2**](docs/EarnApi.md#swap_eth2) | **POST** /earn/staking/eth2/swap | ETH2 swap +*EarnApi* | [**list_dual_investment_plans**](docs/EarnApi.md#list_dual_investment_plans) | **GET** /earn/dual/investment_plan | Dual Investment product list +*EarnApi* | [**list_dual_orders**](docs/EarnApi.md#list_dual_orders) | **GET** /earn/dual/orders | Dual Investment order list +*EarnApi* | [**place_dual_order**](docs/EarnApi.md#place_dual_order) | **POST** /earn/dual/orders | Place Dual Investment order +*EarnApi* | [**cancel_dual_order**](docs/EarnApi.md#cancel_dual_order) | **DELETE** /earn/dual/orders/{order_id} | Cancel Dual Investment order +*EarnApi* | [**list_structured_products**](docs/EarnApi.md#list_structured_products) | **GET** /earn/structured/products | Structured Product List +*EarnApi* | [**list_structured_orders**](docs/EarnApi.md#list_structured_orders) | **GET** /earn/structured/orders | Structured Product Order List +*EarnApi* | [**place_structured_order**](docs/EarnApi.md#place_structured_order) | **POST** /earn/structured/orders | Place Structured Product Order *FlashSwapApi* | [**list_flash_swap_currencies**](docs/FlashSwapApi.md#list_flash_swap_currencies) | **GET** /flash_swap/currencies | List All Supported Currencies In Flash Swap (deprecated) *FlashSwapApi* | [**list_flash_swap_currency_pair**](docs/FlashSwapApi.md#list_flash_swap_currency_pair) | **GET** /flash_swap/currency_pairs | List All Supported Currency Pairs In Flash Swap *FlashSwapApi* | [**list_flash_swap_orders**](docs/FlashSwapApi.md#list_flash_swap_orders) | **GET** /flash_swap/orders | List all flash swap orders @@ -392,6 +400,9 @@ Class | Method | HTTP request | Description - [DeliveryContract](docs/DeliveryContract.md) - [DeliverySettlement](docs/DeliverySettlement.md) - [DepositAddress](docs/DepositAddress.md) + - [DualGetOrders](docs/DualGetOrders.md) + - [DualGetPlans](docs/DualGetPlans.md) + - [Eth2Swap](docs/Eth2Swap.md) - [FlashSwapCurrency](docs/FlashSwapCurrency.md) - [FlashSwapCurrencyPair](docs/FlashSwapCurrencyPair.md) - [FlashSwapOrder](docs/FlashSwapOrder.md) @@ -457,13 +468,7 @@ Class | Method | HTTP request | Description - [OrderPatch](docs/OrderPatch.md) - [OrderResp](docs/OrderResp.md) - [PatchUniLend](docs/PatchUniLend.md) - - [PortfolioAccount](docs/PortfolioAccount.md) - - [PortfolioBorrowable](docs/PortfolioBorrowable.md) - - [PortfolioLoan](docs/PortfolioLoan.md) - - [PortfolioLoanRecord](docs/PortfolioLoanRecord.md) - - [PortfolioMarginBalance](docs/PortfolioMarginBalance.md) - - [PortfolioMode](docs/PortfolioMode.md) - - [PortfolioTransferable](docs/PortfolioTransferable.md) + - [PlaceDualInvestmentOrder](docs/PlaceDualInvestmentOrder.md) - [Position](docs/Position.md) - [PositionClose](docs/PositionClose.md) - [PositionCloseOrder](docs/PositionCloseOrder.md) @@ -481,6 +486,11 @@ Class | Method | HTTP request | Description - [SpotPriceTriggeredOrder](docs/SpotPriceTriggeredOrder.md) - [StpGroup](docs/StpGroup.md) - [StpGroupUser](docs/StpGroupUser.md) + - [StructuredBuy](docs/StructuredBuy.md) + - [StructuredGetProjectList](docs/StructuredGetProjectList.md) + - [StructuredGetProjectListRequest](docs/StructuredGetProjectListRequest.md) + - [StructuredOrderList](docs/StructuredOrderList.md) + - [StructuredOrderListRequest](docs/StructuredOrderListRequest.md) - [SubAccount](docs/SubAccount.md) - [SubAccountBalance](docs/SubAccountBalance.md) - [SubAccountCrossMarginBalance](docs/SubAccountCrossMarginBalance.md) @@ -510,9 +520,17 @@ Class | Method | HTTP request | Description - [UniLoan](docs/UniLoan.md) - [UniLoanInterestRecord](docs/UniLoanInterestRecord.md) - [UniLoanRecord](docs/UniLoanRecord.md) + - [UnifiedAccount](docs/UnifiedAccount.md) + - [UnifiedBalance](docs/UnifiedBalance.md) + - [UnifiedBorrowable](docs/UnifiedBorrowable.md) + - [UnifiedLoan](docs/UnifiedLoan.md) + - [UnifiedLoanRecord](docs/UnifiedLoanRecord.md) + - [UnifiedMode](docs/UnifiedMode.md) + - [UnifiedTransferable](docs/UnifiedTransferable.md) - [UserLtvInfo](docs/UserLtvInfo.md) - [UserTotalAmount](docs/UserTotalAmount.md) - [WithdrawStatus](docs/WithdrawStatus.md) + - [WithdrawalRecord](docs/WithdrawalRecord.md) ## Documentation For Authorization diff --git a/docs/AccountDetail.md b/docs/AccountDetail.md index 65f2448..15328d0 100644 --- a/docs/AccountDetail.md +++ b/docs/AccountDetail.md @@ -7,6 +7,7 @@ Name | Type | Description | Notes **ip_whitelist** | **list[str]** | IP whitelist | [optional] **currency_pairs** | **list[str]** | CurrencyPair whitelisting | [optional] **user_id** | **int** | User ID | [optional] +**tier** | **int** | User VIP level | [optional] **key** | [**AccountDetailKey**](AccountDetailKey.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/AmendOrderResult.md b/docs/AmendOrderResult.md index 8c136db..80832a7 100644 --- a/docs/AmendOrderResult.md +++ b/docs/AmendOrderResult.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **succeeded** | **bool** | Update success status | [optional] [readonly] **label** | **str** | Error indicator for failed modifications; empty when successful | [optional] [readonly] **message** | **str** | Error description for failed modifications; empty when successful | [optional] [readonly] -**account** | **str** | Account types, spot - spot account, margin - margin account, portfolio - portfolio margin account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` | [optional] [readonly] +**account** | **str** | Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` | [optional] [readonly] [[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/ApiV4KeyPerm.md b/docs/ApiV4KeyPerm.md index d459b79..d73bd44 100644 --- a/docs/ApiV4KeyPerm.md +++ b/docs/ApiV4KeyPerm.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**name** | **str** | Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan | [optional] +**name** | **str** | Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options\\m- account: Account - unified: unified - loan: Loan | [optional] **read_only** | **bool** | read only | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/BatchOrder.md b/docs/BatchOrder.md index 21fb51f..fd7af20 100644 --- a/docs/BatchOrder.md +++ b/docs/BatchOrder.md @@ -16,7 +16,7 @@ Name | Type | Description | Notes **status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **str** | Currency pair | [optional] **type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] -**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, portfolio - portfolio account | [optional] [default to 'spot'] +**account** | **str** | Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, unified - unified account | [optional] [default to 'spot'] **side** | **str** | Order side | [optional] **amount** | **str** | Trade amount | [optional] **price** | **str** | Order price | [optional] diff --git a/docs/Contract.md b/docs/Contract.md index b8be5ee..40f779d 100644 --- a/docs/Contract.md +++ b/docs/Contract.md @@ -39,6 +39,7 @@ Name | Type | Description | Notes **enable_bonus** | **bool** | Whether bouns is enabled | [optional] **enable_credit** | **bool** | Whether portfolio margin account is enabled | [optional] **create_time** | **float** | Created time of the contract | [optional] +**funding_cap_ratio** | **str** | The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CrossMarginCurrency.md b/docs/CrossMarginCurrency.md index c768a5e..0e3038a 100644 --- a/docs/CrossMarginCurrency.md +++ b/docs/CrossMarginCurrency.md @@ -11,6 +11,7 @@ Name | Type | Description | Notes **user_max_borrow_amount** | **str** | Maximum borrow value allowed per user, in USDT | [optional] **total_max_borrow_amount** | **str** | Maximum borrow value allowed for this currency, in USDT | [optional] **price** | **str** | Price change between this currency and USDT | [optional] +**loanable** | **bool** | Whether currency is borrowed | [optional] **status** | **int** | status - `0` : disable - `1` : enable | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/CurrencyPair.md b/docs/CurrencyPair.md index 19d4e7b..5c4402c 100644 --- a/docs/CurrencyPair.md +++ b/docs/CurrencyPair.md @@ -10,6 +10,8 @@ Name | Type | Description | Notes **fee** | **str** | Trading fee | [optional] **min_base_amount** | **str** | Minimum amount of base currency to trade, `null` means no limit | [optional] **min_quote_amount** | **str** | Minimum amount of quote currency to trade, `null` means no limit | [optional] +**max_base_amount** | **str** | Maximum amount of base currency to trade, `null` means no limit | [optional] +**max_quote_amount** | **str** | Maximum amount of quote currency to trade, `null` means no limit | [optional] **amount_precision** | **int** | Amount scale | [optional] **precision** | **int** | Price scale | [optional] **trade_status** | **str** | How currency pair can be traded - untradable: cannot be bought or sold - buyable: can be bought - sellable: can be sold - tradable: can be bought or sold | [optional] diff --git a/docs/DualGetOrders.md b/docs/DualGetOrders.md new file mode 100644 index 0000000..8f8d577 --- /dev/null +++ b/docs/DualGetOrders.md @@ -0,0 +1,25 @@ +# DualGetOrders + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**plan_id** | **int** | Plan ID | [optional] +**copies** | **str** | Copies | [optional] +**invest_amount** | **str** | Investment Amount | [optional] +**settlement_amount** | **str** | Settlement Amount | [optional] +**create_time** | **int** | Creation time | [optional] +**complete_time** | **int** | Completion Time | [optional] +**status** | **str** | Status: `INIT`-INIT `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-SEttlement Processing `CANCELED`-Canceled `FAILED`-Failed | [optional] +**invest_currency** | **str** | Investment Currency | [optional] +**exercise_currency** | **str** | Strike Currency | [optional] +**exercise_price** | **str** | Strike price | [optional] +**settlement_price** | **str** | settlement price | [optional] +**settlement_currency** | **str** | Settle currency | [optional] +**apy_display** | **str** | APY | [optional] +**apy_settlement** | **str** | Settlement APY | [optional] +**delivery_time** | **int** | Settlement time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/DualGetPlans.md b/docs/DualGetPlans.md new file mode 100644 index 0000000..4bd3850 --- /dev/null +++ b/docs/DualGetPlans.md @@ -0,0 +1,22 @@ +# DualGetPlans + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Plan ID | [optional] +**instrument_name** | **str** | Instrument Name | [optional] +**invest_currency** | **str** | Investment Currency | [optional] +**exercise_currency** | **str** | Strike Currency | [optional] +**exercise_price** | **float** | Strike price | [optional] +**delivery_time** | **int** | Settlement time | [optional] +**min_copies** | **int** | Minimum Copies | [optional] +**max_copies** | **int** | Maximum Copies | [optional] +**per_value** | **str** | Per Unit Value | [optional] +**apy_display** | **str** | APY | [optional] +**start_time** | **int** | start time | [optional] +**end_time** | **int** | Finished time | [optional] +**status** | **str** | Status: `NOTSTARTED`-not started `ONGOING`-ongoing `ENDED`-ended | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/EarnApi.md b/docs/EarnApi.md new file mode 100644 index 0000000..33e49d9 --- /dev/null +++ b/docs/EarnApi.md @@ -0,0 +1,522 @@ +# gate_api.EarnApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**swap_eth2**](EarnApi.md#swap_eth2) | **POST** /earn/staking/eth2/swap | ETH2 swap +[**list_dual_investment_plans**](EarnApi.md#list_dual_investment_plans) | **GET** /earn/dual/investment_plan | Dual Investment product list +[**list_dual_orders**](EarnApi.md#list_dual_orders) | **GET** /earn/dual/orders | Dual Investment order list +[**place_dual_order**](EarnApi.md#place_dual_order) | **POST** /earn/dual/orders | Place Dual Investment order +[**cancel_dual_order**](EarnApi.md#cancel_dual_order) | **DELETE** /earn/dual/orders/{order_id} | Cancel Dual Investment order +[**list_structured_products**](EarnApi.md#list_structured_products) | **GET** /earn/structured/products | Structured Product List +[**list_structured_orders**](EarnApi.md#list_structured_orders) | **GET** /earn/structured/orders | Structured Product Order List +[**place_structured_order**](EarnApi.md#place_structured_order) | **POST** /earn/structured/orders | Place Structured Product Order + + +# **swap_eth2** +> swap_eth2(eth2_swap) + +ETH2 swap + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +eth2_swap = gate_api.Eth2Swap() # Eth2Swap | + +try: + # ETH2 swap + api_instance.swap_eth2(eth2_swap) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->swap_eth2: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **eth2_swap** | [**Eth2Swap**](Eth2Swap.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | swap success | - | + +[[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_dual_investment_plans** +> list[DualGetPlans] list_dual_investment_plans() + +Dual Investment product list + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) + +try: + # Dual Investment product list + api_response = api_instance.list_dual_investment_plans() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_dual_investment_plans: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[DualGetPlans]**](DualGetPlans.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful | - | + +[[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_dual_orders** +> list[DualGetOrders] list_dual_orders() + +Dual Investment order list + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) + +try: + # Dual Investment order list + api_response = api_instance.list_dual_orders() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_dual_orders: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +[**list[DualGetOrders]**](DualGetOrders.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful | - | + +[[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) + +# **place_dual_order** +> place_dual_order(place_dual_investment_order) + +Place Dual Investment order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +place_dual_investment_order = gate_api.PlaceDualInvestmentOrder() # PlaceDualInvestmentOrder | + +try: + # Place Dual Investment order + api_instance.place_dual_order(place_dual_investment_order) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->place_dual_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **place_dual_investment_order** | [**PlaceDualInvestmentOrder**](PlaceDualInvestmentOrder.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[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) + +# **cancel_dual_order** +> cancel_dual_order(order_id) + +Cancel Dual Investment order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +order_id = 1 # int | Order ID + +try: + # Cancel Dual Investment order + api_instance.cancel_dual_order(order_id) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->cancel_dual_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **order_id** | **int**| Order ID | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Cancel success | - | + +[[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_structured_products** +> list[StructuredGetProjectList] list_structured_products(structured_get_project_list_request) + +Structured Product List + +### Example + +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +structured_get_project_list_request = gate_api.StructuredGetProjectListRequest() # StructuredGetProjectListRequest | + +try: + # Structured Product List + api_response = api_instance.list_structured_products(structured_get_project_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_structured_products: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **structured_get_project_list_request** | [**StructuredGetProjectListRequest**](StructuredGetProjectListRequest.md)| | + +### Return type + +[**list[StructuredGetProjectList]**](StructuredGetProjectList.md) + +### Authorization + +No authorization required + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful | - | + +[[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_structured_orders** +> list[StructuredOrderList] list_structured_orders(structured_order_list_request) + +Structured Product Order List + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +structured_order_list_request = gate_api.StructuredOrderListRequest() # StructuredOrderListRequest | + +try: + # Structured Product Order List + api_response = api_instance.list_structured_orders(structured_order_list_request) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->list_structured_orders: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **structured_order_list_request** | [**StructuredOrderListRequest**](StructuredOrderListRequest.md)| | + +### Return type + +[**list[StructuredOrderList]**](StructuredOrderList.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successful | - | + +[[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) + +# **place_structured_order** +> place_structured_order(structured_buy) + +Place Structured Product Order + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.EarnApi(api_client) +structured_buy = gate_api.StructuredBuy() # StructuredBuy | + +try: + # Place Structured Product Order + api_instance.place_structured_order(structured_buy) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling EarnApi->place_structured_order: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **structured_buy** | [**StructuredBuy**](StructuredBuy.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/Eth2Swap.md b/docs/Eth2Swap.md new file mode 100644 index 0000000..a5ede25 --- /dev/null +++ b/docs/Eth2Swap.md @@ -0,0 +1,12 @@ +# Eth2Swap + +ETH2 Staking +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**side** | **str** | 1-Forward Swap(ETH -> ETH2), 2-Reverse Swap(ETH2 -> ETH) | +**amount** | **str** | amount | + +[[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/FuturesAccountBook.md b/docs/FuturesAccountBook.md index b1ba011..81262c7 100644 --- a/docs/FuturesAccountBook.md +++ b/docs/FuturesAccountBook.md @@ -8,6 +8,8 @@ Name | Type | Description | Notes **balance** | **str** | Balance after change | [optional] **type** | **str** | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] **text** | **str** | Comment | [optional] +**contract** | **str** | Futures contract, the field is only available for data after 2023-10-30. | [optional] +**trade_id** | **str** | trade id | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FuturesApi.md b/docs/FuturesApi.md index a38a61a..c576b4e 100644 --- a/docs/FuturesApi.md +++ b/docs/FuturesApi.md @@ -890,10 +890,12 @@ 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_futures_account_book** -> list[FuturesAccountBook] list_futures_account_book(settle, limit=limit, _from=_from, to=to, type=type) +> list[FuturesAccountBook] list_futures_account_book(settle, contract=contract, limit=limit, _from=_from, to=to, type=type) Query account book +If the `contract` field is provided, it can only filter records that include this field after 2023-10-30. + ### Example * Api Key Authentication (apiv4): @@ -919,6 +921,7 @@ api_client = gate_api.ApiClient(configuration) # Create an instance of the API class api_instance = gate_api.FuturesApi(api_client) settle = 'usdt' # str | Settle currency +contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional) limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100) _from = 1547706332 # int | Start timestamp (optional) to = 1547706332 # int | End timestamp (optional) @@ -926,7 +929,7 @@ type = 'dnw' # str | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Lo try: # Query account book - api_response = api_instance.list_futures_account_book(settle, limit=limit, _from=_from, to=to, type=type) + api_response = api_instance.list_futures_account_book(settle, contract=contract, limit=limit, _from=_from, to=to, type=type) print(api_response) except GateApiException as ex: print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) @@ -939,6 +942,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **settle** | **str**| Settle currency | + **contract** | **str**| Futures contract, return related data only if specified | [optional] **limit** | **int**| Maximum number of records to be returned in a single list | [optional] [default to 100] **_from** | **int**| Start timestamp | [optional] **to** | **int**| End timestamp | [optional] @@ -1679,7 +1683,7 @@ Name | Type | Description | Notes List futures orders -Zero-filled order cannot be retrieved 10 minutes after order cancellation +- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. ### Example @@ -2050,7 +2054,7 @@ Name | Type | Description | Notes Get a single order -Zero-filled order cannot be retrieved 10 minutes after order cancellation +- Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. ### Example @@ -2261,6 +2265,8 @@ Name | Type | Description | Notes List personal trading history +By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. + ### Example * Api Key Authentication (apiv4): diff --git a/docs/FuturesOrder.md b/docs/FuturesOrder.md index 309feb2..8f501ba 100644 --- a/docs/FuturesOrder.md +++ b/docs/FuturesOrder.md @@ -30,6 +30,7 @@ Name | Type | Description | Notes **stp_id** | **int** | Orders between users in the same `stp_id` group are not allowed to be self-traded 1. If the `stp_id` of two orders being matched is non-zero and equal, they will not be executed. Instead, the corresponding strategy will be executed based on the `stp_act` of the taker. 2. `stp_id` returns `0` by default for orders that have not been set for `STP group` | [optional] [readonly] **stp_act** | **str** | Self-Trading Prevention Action. Users can use this field to set self-trade prevetion strategies 1. After users join the `STP Group`, he can pass `stp_act` to limit the user's self-trade prevetion strategy. If `stp_act` is not passed, the default is `cn` strategy。 2. When the user does not join the `STP group`, an error will be returned when passing the `stp_act` parameter。 3. If the user did not use 'stp_act' when placing the order, 'stp_act' will return '-' - cn: Cancel newest, Cancel new orders and keep old ones - co: Cancel oldest, Cancel old orders and keep new ones - cb: Cancel both, Both old and new orders will be cancelled | [optional] **amend_text** | **str** | The custom data that the user remarked when amending the order | [optional] [readonly] +**biz_info** | **str** | Additional information | [optional] [readonly] [[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/MarginApi.md b/docs/MarginApi.md index 98fe6e9..02e2437 100644 --- a/docs/MarginApi.md +++ b/docs/MarginApi.md @@ -2291,7 +2291,7 @@ 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) # **get_cross_margin_borrowable** -> PortfolioBorrowable get_cross_margin_borrowable(currency) +> UnifiedBorrowable get_cross_margin_borrowable(currency) Get the max borrowable amount for a specific cross margin currency @@ -2339,7 +2339,7 @@ Name | Type | Description | Notes ### Return type -[**PortfolioBorrowable**](PortfolioBorrowable.md) +[**UnifiedBorrowable**](UnifiedBorrowable.md) ### Authorization diff --git a/docs/Order.md b/docs/Order.md index 43188de..812c90a 100644 --- a/docs/Order.md +++ b/docs/Order.md @@ -14,7 +14,7 @@ Name | Type | Description | Notes **status** | **str** | Order status - `open`: to be filled - `closed`: filled - `cancelled`: cancelled | [optional] [readonly] **currency_pair** | **str** | Currency pair | **type** | **str** | Order Type - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] -**account** | **str** | Account type, spot - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` | [optional] [default to 'spot'] +**account** | **str** | Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account. Portfolio margin accounts can only be set to `cross_margin` | [optional] [default to 'spot'] **side** | **str** | Order side | **amount** | **str** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | **price** | **str** | Price can't be empty when `type`= `limit` | [optional] diff --git a/docs/PlaceDualInvestmentOrder.md b/docs/PlaceDualInvestmentOrder.md new file mode 100644 index 0000000..e312955 --- /dev/null +++ b/docs/PlaceDualInvestmentOrder.md @@ -0,0 +1,12 @@ +# PlaceDualInvestmentOrder + +Dual Investment order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**plan_id** | **str** | Plan ID | +**copies** | **str** | Copies | + +[[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/SpotApi.md b/docs/SpotApi.md index 1990290..9c23ddf 100644 --- a/docs/SpotApi.md +++ b/docs/SpotApi.md @@ -1112,7 +1112,7 @@ Name | Type | Description | Notes Create an order -You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body +You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body ### Example diff --git a/docs/SpotPricePutOrder.md b/docs/SpotPricePutOrder.md index c3c209a..c75b807 100644 --- a/docs/SpotPricePutOrder.md +++ b/docs/SpotPricePutOrder.md @@ -3,10 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**type** | **str** | Order type, default to `limit` | [optional] [default to 'limit'] +**type** | **str** | Order type,default to `limit` - limit : Limit Order - market : Market Order | [optional] [default to 'limit'] **side** | **str** | Order side - buy: buy side - sell: sell side | **price** | **str** | Order price | -**amount** | **str** | Order amount | +**amount** | **str** | When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` | **account** | **str** | Trading account type. Portfolio margin account must set to `cross_margin` - normal: spot trading - margin: margin trading - cross_margin: cross_margin trading | [default to 'normal'] **time_in_force** | **str** | time_in_force - gtc: GoodTillCancelled - ioc: ImmediateOrCancelled, taker only | [optional] [default to 'gtc'] diff --git a/docs/StructuredBuy.md b/docs/StructuredBuy.md new file mode 100644 index 0000000..4a3e128 --- /dev/null +++ b/docs/StructuredBuy.md @@ -0,0 +1,12 @@ +# StructuredBuy + +Dual Investment Purchase +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**pid** | **str** | Plan ID | [optional] +**amount** | **str** | Purchase Amount | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredGetProjectList.md b/docs/StructuredGetProjectList.md new file mode 100644 index 0000000..38e9f37 --- /dev/null +++ b/docs/StructuredGetProjectList.md @@ -0,0 +1,22 @@ +# StructuredGetProjectList + +Structured Products +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Plan ID | [optional] +**type** | **str** | product type: `SharkFin2.0`-Shark Fin2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball | [optional] +**name_en** | **str** | name | [optional] +**investment_coin** | **str** | Investment Currency | [optional] +**investment_period** | **str** | Investment term | [optional] +**min_annual_rate** | **str** | Minimum annual rate | [optional] +**mid_annual_rate** | **str** | Intermediate annual rate | [optional] +**max_annual_rate** | **str** | Maximum annual rate | [optional] +**watch_market** | **str** | Watch market | [optional] +**start_time** | **int** | start time | [optional] +**end_time** | **int** | Finished time | [optional] +**status** | **str** | Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredGetProjectListRequest.md b/docs/StructuredGetProjectListRequest.md new file mode 100644 index 0000000..24fd250 --- /dev/null +++ b/docs/StructuredGetProjectListRequest.md @@ -0,0 +1,14 @@ +# StructuredGetProjectListRequest + +Dual Investment order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**type** | **str** | Product Type, default to empty for querying all. `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-RangeAccrual `SnowBall`-Snow Ball | [optional] +**status** | **str** | Status: default to empty for querying all. `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done | [optional] +**page** | **int** | Page number | [optional] +**limit** | **int** | Number of items returned in the list. Default is 100. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredOrderList.md b/docs/StructuredOrderList.md new file mode 100644 index 0000000..2886d54 --- /dev/null +++ b/docs/StructuredOrderList.md @@ -0,0 +1,17 @@ +# StructuredOrderList + +Structured order +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | Order ID | [optional] +**pid** | **str** | Plan ID | [optional] +**lock_coin** | **str** | Locked coin | [optional] +**amount** | **str** | Locked amount | [optional] +**status** | **str** | Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE | [optional] +**income** | **str** | Income | [optional] +**create_time** | **int** | Created time | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/StructuredOrderListRequest.md b/docs/StructuredOrderListRequest.md new file mode 100644 index 0000000..7c20834 --- /dev/null +++ b/docs/StructuredOrderListRequest.md @@ -0,0 +1,14 @@ +# StructuredOrderListRequest + +Structured Request Parameters +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_from** | **int** | start time | +**to** | **int** | Finished time | +**page** | **int** | Page number | [optional] +**limit** | **int** | Number of items returned in the list. Default is 100. | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UniInterestMode.md b/docs/UniInterestMode.md index 5d117d2..8084354 100644 --- a/docs/UniInterestMode.md +++ b/docs/UniInterestMode.md @@ -1,6 +1,6 @@ # UniInterestMode -余币宝利息复投开关 +Lend & Earn interest reinvestment toggle ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/UnifiedAccount.md b/docs/UnifiedAccount.md new file mode 100644 index 0000000..f854897 --- /dev/null +++ b/docs/UnifiedAccount.md @@ -0,0 +1,25 @@ +# UnifiedAccount + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **int** | User ID | [optional] +**refresh_time** | **int** | Time of the most recent refresh | [optional] +**locked** | **bool** | Whether account is locked | [optional] +**balances** | [**dict(str, UnifiedBalance)**](UnifiedBalance.md) | | [optional] +**total** | **str** | The total asset value in USDT. Sum of `(available + freeze) * price` | [optional] +**borrowed** | **str** | The total borrowed amount in USDT equivalent. Sum of `borrowed * price` | [optional] +**total_initial_margin** | **str** | Total initial margin | [optional] +**total_margin_balance** | **str** | Total margin balance | [optional] +**total_maintenance_margin** | **str** | Total maintenance margin | [optional] +**total_initial_margin_rate** | **str** | Total initial margin rate | [optional] +**total_maintenance_margin_rate** | **str** | Total maintenance margin rate | [optional] +**total_available_margin** | **str** | Total available margin | [optional] +**unified_account_total** | **str** | Total amount of the portfolio margin account | [optional] +**unified_account_total_liab** | **str** | Total liabilities of the portfolio margin account | [optional] +**unified_account_total_equity** | **str** | Total equity of the portfolio margin account | [optional] +**leverage** | **str** | Leverage | [optional] [readonly] + +[[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/UnifiedApi.md b/docs/UnifiedApi.md new file mode 100644 index 0000000..4b30785 --- /dev/null +++ b/docs/UnifiedApi.md @@ -0,0 +1,635 @@ +# gate_api.UnifiedApi + +All URIs are relative to *https://api.gateio.ws/api/v4* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**list_unified_accounts**](UnifiedApi.md#list_unified_accounts) | **GET** /unified/accounts | Get unified account information +[**list_unified_account_mode**](UnifiedApi.md#list_unified_account_mode) | **GET** /unified/account_mode | Query mode of the unified account +[**set_unified_account_mode**](UnifiedApi.md#set_unified_account_mode) | **POST** /unified/account_mode | Set mode of the unified account +[**get_unified_borrowable**](UnifiedApi.md#get_unified_borrowable) | **GET** /unified/borrowable | Query about the maximum borrowing for the unified account +[**get_unified_transferable**](UnifiedApi.md#get_unified_transferable) | **GET** /unified/transferable | Query about the maximum transferable for the unified account +[**list_unified_loans**](UnifiedApi.md#list_unified_loans) | **GET** /unified/loans | List loans +[**create_unified_loan**](UnifiedApi.md#create_unified_loan) | **POST** /unified/loans | Borrow or repay +[**list_unified_loan_records**](UnifiedApi.md#list_unified_loan_records) | **GET** /unified/loan_records | Get load records +[**list_unified_loan_interest_records**](UnifiedApi.md#list_unified_loan_interest_records) | **GET** /unified/interest_records | List interest records + + +# **list_unified_accounts** +> UnifiedAccount list_unified_accounts(currency=currency) + +Get unified account information + +The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. You can refer to the [Formula](#portfolio-account) in the documentation + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +currency = 'BTC' # str | Retrieve data of the specified currency (optional) + +try: + # Get unified account information + api_response = api_instance.list_unified_accounts(currency=currency) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->list_unified_accounts: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Retrieve data of the specified currency | [optional] + +### Return type + +[**UnifiedAccount**](UnifiedAccount.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | List retrieved | - | + +[[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_unified_account_mode** +> dict(str, bool) list_unified_account_mode() + +Query mode of the unified account + +cross_margin - cross margin, usdt_futures - usdt futures + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) + +try: + # Query mode of the unified account + api_response = api_instance.list_unified_account_mode() + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->list_unified_account_mode: %s\n" % e) +``` + +### Parameters +This endpoint does not need any parameter. + +### Return type + +**dict(str, bool)** + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[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) + +# **set_unified_account_mode** +> dict(str, bool) set_unified_account_mode(unified_mode) + +Set mode of the unified account + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +unified_mode = gate_api.UnifiedMode() # UnifiedMode | + +try: + # Set mode of the unified account + api_response = api_instance.set_unified_account_mode(unified_mode) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->set_unified_account_mode: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_mode** | [**UnifiedMode**](UnifiedMode.md)| | + +### Return type + +**dict(str, bool)** + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Success | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_unified_borrowable** +> UnifiedBorrowable get_unified_borrowable(currency) + +Query about the maximum borrowing for the unified account + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +currency = 'BTC' # str | Retrieve data of the specified currency + +try: + # Query about the maximum borrowing for the unified account + api_response = api_instance.get_unified_borrowable(currency) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->get_unified_borrowable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Retrieve data of the specified currency | + +### Return type + +[**UnifiedBorrowable**](UnifiedBorrowable.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + +# **get_unified_transferable** +> UnifiedTransferable get_unified_transferable(currency) + +Query about the maximum transferable for the unified account + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +currency = 'BTC' # str | Retrieve data of the specified currency + +try: + # Query about the maximum transferable for the unified account + api_response = api_instance.get_unified_transferable(currency) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->get_unified_transferable: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Retrieve data of the specified currency | + +### Return type + +[**UnifiedTransferable**](UnifiedTransferable.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[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_unified_loans** +> list[UniLoan] list_unified_loans(currency=currency, page=page, limit=limit) + +List loans + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +currency = 'BTC' # str | Retrieve data of the specified currency (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional) (default to 100) + +try: + # List loans + api_response = api_instance.list_unified_loans(currency=currency, page=page, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->list_unified_loans: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Retrieve data of the specified currency | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UniLoan]**](UniLoan.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[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_unified_loan** +> create_unified_loan(unified_loan) + +Borrow or repay + +When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +unified_loan = gate_api.UnifiedLoan() # UnifiedLoan | + +try: + # Borrow or repay + api_instance.create_unified_loan(unified_loan) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->create_unified_loan: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **unified_loan** | [**UnifiedLoan**](UnifiedLoan.md)| | + +### Return type + +void (empty response body) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: Not defined + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**204** | Operated successfully | - | + +[[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_unified_loan_records** +> list[UnifiedLoanRecord] list_unified_loan_records(type=type, currency=currency, page=page, limit=limit) + +Get load records + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +type = 'type_example' # str | The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds (optional) +currency = 'BTC' # str | Retrieve data of the specified currency (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional) (default to 100) + +try: + # Get load records + api_response = api_instance.list_unified_loan_records(type=type, currency=currency, page=page, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->list_unified_loan_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **type** | **str**| The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds | [optional] + **currency** | **str**| Retrieve data of the specified currency | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UnifiedLoanRecord]**](UnifiedLoanRecord.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[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_unified_loan_interest_records** +> list[UniLoanInterestRecord] list_unified_loan_interest_records(currency=currency, page=page, limit=limit) + +List interest records + +### Example + +* Api Key Authentication (apiv4): +```python +from __future__ import print_function +import gate_api +from gate_api.exceptions import ApiException, GateApiException +# Defining the host is optional and defaults to https://api.gateio.ws/api/v4 +# See configuration.py for a list of all supported configuration parameters. +# The client must configure the authentication and authorization parameters +# in accordance with the API server security policy. +# Examples for each auth method are provided below, use the example that +# satisfies your auth use case. + +# Configure APIv4 key authorization +configuration = gate_api.Configuration( + host = "https://api.gateio.ws/api/v4", + key = "YOU_API_KEY", + secret = "YOUR_API_SECRET" +) + +api_client = gate_api.ApiClient(configuration) +# Create an instance of the API class +api_instance = gate_api.UnifiedApi(api_client) +currency = 'BTC' # str | Retrieve data of the specified currency (optional) +page = 1 # int | Page number (optional) (default to 1) +limit = 100 # int | Maximum response items. Default: 100, minimum: 1, Maximum: 100 (optional) (default to 100) + +try: + # List interest records + api_response = api_instance.list_unified_loan_interest_records(currency=currency, page=page, limit=limit) + print(api_response) +except GateApiException as ex: + print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message)) +except ApiException as e: + print("Exception when calling UnifiedApi->list_unified_loan_interest_records: %s\n" % e) +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **currency** | **str**| Retrieve data of the specified currency | [optional] + **page** | **int**| Page number | [optional] [default to 1] + **limit** | **int**| Maximum response items. Default: 100, minimum: 1, Maximum: 100 | [optional] [default to 100] + +### Return type + +[**list[UniLoanInterestRecord]**](UniLoanInterestRecord.md) + +### Authorization + +[apiv4](../README.md#apiv4) + +### HTTP request headers + + - **Content-Type**: Not defined + - **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Successfully retrieved | - | + +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md) + diff --git a/docs/UnifiedBalance.md b/docs/UnifiedBalance.md new file mode 100644 index 0000000..97b63f8 --- /dev/null +++ b/docs/UnifiedBalance.md @@ -0,0 +1,17 @@ +# UnifiedBalance + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**available** | **str** | Available amount | [optional] +**freeze** | **str** | Locked amount | [optional] +**borrowed** | **str** | Borrowed amount | [optional] +**negative_liab** | **str** | Negative Liabilities | [optional] +**futures_pos_liab** | **str** | Borrowing to Open Positions in Futures | [optional] +**equity** | **str** | Equity | [optional] +**total_freeze** | **str** | Total freeze | [optional] +**total_liab** | **str** | Total liabilities | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedBorrowable.md b/docs/UnifiedBorrowable.md new file mode 100644 index 0000000..edd2c95 --- /dev/null +++ b/docs/UnifiedBorrowable.md @@ -0,0 +1,11 @@ +# UnifiedBorrowable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency detail | [optional] +**amount** | **str** | Max borrowable amount | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedLoan.md b/docs/UnifiedLoan.md new file mode 100644 index 0000000..9bc0760 --- /dev/null +++ b/docs/UnifiedLoan.md @@ -0,0 +1,15 @@ +# UnifiedLoan + +Borrow or repay +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency | +**type** | **str** | type: borrow - borrow, repay - repay | +**amount** | **str** | The amount of lending or repaying | +**repaid_all** | **bool** | Full repayment is solely for repayment operations. When set to 'true,' it overrides the 'amount,' allowing for direct full repayment. | [optional] +**text** | **str** | User defined custom ID | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/UnifiedLoanRecord.md b/docs/UnifiedLoanRecord.md new file mode 100644 index 0000000..e615b9e --- /dev/null +++ b/docs/UnifiedLoanRecord.md @@ -0,0 +1,17 @@ +# UnifiedLoanRecord + +Loan records +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **int** | id | [optional] [readonly] +**type** | **str** | type: borrow - borrow, repay - repay | [optional] [readonly] +**repayment_type** | **str** | Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment, cancel_auto_repay - automatic repayment after cancellation | [optional] [readonly] +**currency_pair** | **str** | Currency pair | [optional] [readonly] +**currency** | **str** | Currency | [optional] [readonly] +**amount** | **str** | The amount of lending or repaying | [optional] [readonly] +**create_time** | **int** | Created time | [optional] [readonly] + +[[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/UnifiedMode.md b/docs/UnifiedMode.md new file mode 100644 index 0000000..c99223e --- /dev/null +++ b/docs/UnifiedMode.md @@ -0,0 +1,11 @@ +# UnifiedMode + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **str** | Portfolio mode - cross_margin : cross margin - usdt_futures : usdt futures | +**enabled** | **bool** | Is it enabled? | + +[[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/UnifiedTransferable.md b/docs/UnifiedTransferable.md new file mode 100644 index 0000000..69f9b19 --- /dev/null +++ b/docs/UnifiedTransferable.md @@ -0,0 +1,11 @@ +# UnifiedTransferable + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**currency** | **str** | Currency detail | [optional] +**amount** | **str** | The maximum amount that can be transferred out | [optional] + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + + diff --git a/docs/WalletApi.md b/docs/WalletApi.md index 260d75d..374ac5d 100644 --- a/docs/WalletApi.md +++ b/docs/WalletApi.md @@ -148,7 +148,7 @@ 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_withdrawals** -> list[LedgerRecord] list_withdrawals(currency=currency, _from=_from, to=to, limit=limit, offset=offset) +> list[WithdrawalRecord] list_withdrawals(currency=currency, _from=_from, to=to, limit=limit, offset=offset) Retrieve withdrawal records @@ -206,7 +206,7 @@ Name | Type | Description | Notes ### Return type -[**list[LedgerRecord]**](LedgerRecord.md) +[**list[WithdrawalRecord]**](WithdrawalRecord.md) ### Authorization diff --git a/docs/WithdrawStatus.md b/docs/WithdrawStatus.md index a7f1755..2b8e5de 100644 --- a/docs/WithdrawStatus.md +++ b/docs/WithdrawStatus.md @@ -14,6 +14,7 @@ Name | Type | Description | Notes **withdraw_day_limit_remain** | **str** | Daily withdrawal amount left | [optional] **withdraw_eachtime_limit** | **str** | Maximum amount for each withdrawal | [optional] **withdraw_fix_on_chains** | **dict(str, str)** | Fixed withdrawal fee on multiple chains | [optional] +**withdraw_percent_on_chains** | **dict(str, str)** | Percentage withdrawal fee on multiple chains | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/WithdrawalRecord.md b/docs/WithdrawalRecord.md new file mode 100644 index 0000000..2c7788e --- /dev/null +++ b/docs/WithdrawalRecord.md @@ -0,0 +1,20 @@ +# WithdrawalRecord + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **str** | Record ID | [optional] [readonly] +**txid** | **str** | Hash record of the withdrawal | [optional] [readonly] +**withdraw_order_id** | **str** | Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) | [optional] +**timestamp** | **str** | Operation time | [optional] [readonly] +**amount** | **str** | Currency amount | +**fee** | **str** | fee | [optional] [readonly] +**currency** | **str** | Currency name | +**address** | **str** | Withdrawal address. Required for withdrawals | [optional] +**memo** | **str** | Additional remarks with regards to the withdrawal | [optional] +**status** | **str** | Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount | [optional] [readonly] +**chain** | **str** | Name of the chain used in withdrawals | + +[[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/gate_api/__init__.py b/gate_api/__init__.py index a70f197..20cc3a9 100644 --- a/gate_api/__init__.py +++ b/gate_api/__init__.py @@ -14,16 +14,17 @@ from __future__ import absolute_import -__version__ = "4.57.0" +__version__ = "4.60.1" # import apis into sdk package from gate_api.api.earn_uni_api import EarnUniApi from gate_api.api.margin_uni_api import MarginUniApi -from gate_api.api.portfolio_api import PortfolioApi from gate_api.api.sub_account_api import SubAccountApi +from gate_api.api.unified_api import UnifiedApi from gate_api.api.account_api import AccountApi from gate_api.api.collateral_loan_api import CollateralLoanApi from gate_api.api.delivery_api import DeliveryApi +from gate_api.api.earn_api import EarnApi from gate_api.api.flash_swap_api import FlashSwapApi from gate_api.api.futures_api import FuturesApi from gate_api.api.margin_api import MarginApi @@ -85,6 +86,9 @@ from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_settlement import DeliverySettlement from gate_api.models.deposit_address import DepositAddress +from gate_api.models.dual_get_orders import DualGetOrders +from gate_api.models.dual_get_plans import DualGetPlans +from gate_api.models.eth2_swap import Eth2Swap from gate_api.models.flash_swap_currency import FlashSwapCurrency from gate_api.models.flash_swap_currency_pair import FlashSwapCurrencyPair from gate_api.models.flash_swap_order import FlashSwapOrder @@ -150,13 +154,7 @@ from gate_api.models.order_patch import OrderPatch from gate_api.models.order_resp import OrderResp from gate_api.models.patch_uni_lend import PatchUniLend -from gate_api.models.portfolio_account import PortfolioAccount -from gate_api.models.portfolio_borrowable import PortfolioBorrowable -from gate_api.models.portfolio_loan import PortfolioLoan -from gate_api.models.portfolio_loan_record import PortfolioLoanRecord -from gate_api.models.portfolio_margin_balance import PortfolioMarginBalance -from gate_api.models.portfolio_mode import PortfolioMode -from gate_api.models.portfolio_transferable import PortfolioTransferable +from gate_api.models.place_dual_investment_order import PlaceDualInvestmentOrder from gate_api.models.position import Position from gate_api.models.position_close import PositionClose from gate_api.models.position_close_order import PositionCloseOrder @@ -174,6 +172,11 @@ from gate_api.models.spot_price_triggered_order import SpotPriceTriggeredOrder from gate_api.models.stp_group import StpGroup from gate_api.models.stp_group_user import StpGroupUser +from gate_api.models.structured_buy import StructuredBuy +from gate_api.models.structured_get_project_list import StructuredGetProjectList +from gate_api.models.structured_get_project_list_request import StructuredGetProjectListRequest +from gate_api.models.structured_order_list import StructuredOrderList +from gate_api.models.structured_order_list_request import StructuredOrderListRequest from gate_api.models.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance @@ -203,6 +206,14 @@ from gate_api.models.uni_loan import UniLoan from gate_api.models.uni_loan_interest_record import UniLoanInterestRecord from gate_api.models.uni_loan_record import UniLoanRecord +from gate_api.models.unified_account import UnifiedAccount +from gate_api.models.unified_balance import UnifiedBalance +from gate_api.models.unified_borrowable import UnifiedBorrowable +from gate_api.models.unified_loan import UnifiedLoan +from gate_api.models.unified_loan_record import UnifiedLoanRecord +from gate_api.models.unified_mode import UnifiedMode +from gate_api.models.unified_transferable import UnifiedTransferable from gate_api.models.user_ltv_info import UserLtvInfo from gate_api.models.user_total_amount import UserTotalAmount from gate_api.models.withdraw_status import WithdrawStatus +from gate_api.models.withdrawal_record import WithdrawalRecord diff --git a/gate_api/api/__init__.py b/gate_api/api/__init__.py index 72f2ec5..cf821b1 100644 --- a/gate_api/api/__init__.py +++ b/gate_api/api/__init__.py @@ -5,11 +5,12 @@ # import apis into api package from gate_api.api.earn_uni_api import EarnUniApi from gate_api.api.margin_uni_api import MarginUniApi -from gate_api.api.portfolio_api import PortfolioApi from gate_api.api.sub_account_api import SubAccountApi +from gate_api.api.unified_api import UnifiedApi from gate_api.api.account_api import AccountApi from gate_api.api.collateral_loan_api import CollateralLoanApi from gate_api.api.delivery_api import DeliveryApi +from gate_api.api.earn_api import EarnApi from gate_api.api.flash_swap_api import FlashSwapApi from gate_api.api.futures_api import FuturesApi from gate_api.api.margin_api import MarginApi diff --git a/gate_api/api/earn_api.py b/gate_api/api/earn_api.py new file mode 100644 index 0000000..e652cb1 --- /dev/null +++ b/gate_api/api/earn_api.py @@ -0,0 +1,860 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class EarnApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def swap_eth2(self, eth2_swap, **kwargs): # noqa: E501 + """ETH2 swap # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.swap_eth2(eth2_swap, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Eth2Swap eth2_swap: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.swap_eth2_with_http_info(eth2_swap, **kwargs) # noqa: E501 + + def swap_eth2_with_http_info(self, eth2_swap, **kwargs): # noqa: E501 + """ETH2 swap # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.swap_eth2_with_http_info(eth2_swap, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param Eth2Swap eth2_swap: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['eth2_swap'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method swap_eth2" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'eth2_swap' is set + if self.api_client.client_side_validation and ( + 'eth2_swap' not in local_var_params or local_var_params['eth2_swap'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError("Missing the required parameter `eth2_swap` when calling `swap_eth2`") # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'eth2_swap' in local_var_params: + body_params = local_var_params['eth2_swap'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/staking/eth2/swap', + 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_dual_investment_plans(self, **kwargs): # noqa: E501 + """Dual Investment product list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dual_investment_plans(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.DualGetPlans] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_dual_investment_plans_with_http_info(**kwargs) # noqa: E501 + + def list_dual_investment_plans_with_http_info(self, **kwargs): # noqa: E501 + """Dual Investment product list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dual_investment_plans_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.DualGetPlans], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" " to method list_dual_investment_plans" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/investment_plan', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[DualGetPlans]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_dual_orders(self, **kwargs): # noqa: E501 + """Dual Investment order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dual_orders(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.DualGetOrders] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_dual_orders_with_http_info(**kwargs) # noqa: E501 + + def list_dual_orders_with_http_info(self, **kwargs): # noqa: E501 + """Dual Investment order list # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_dual_orders_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.DualGetOrders], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_dual_orders" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/orders', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[DualGetOrders]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def place_dual_order(self, place_dual_investment_order, **kwargs): # noqa: E501 + """Place Dual Investment order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_dual_order(place_dual_investment_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceDualInvestmentOrder place_dual_investment_order: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.place_dual_order_with_http_info(place_dual_investment_order, **kwargs) # noqa: E501 + + def place_dual_order_with_http_info(self, place_dual_investment_order, **kwargs): # noqa: E501 + """Place Dual Investment order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_dual_order_with_http_info(place_dual_investment_order, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param PlaceDualInvestmentOrder place_dual_investment_order: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['place_dual_investment_order'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method place_dual_order" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'place_dual_investment_order' is set + if self.api_client.client_side_validation and ( + 'place_dual_investment_order' not in local_var_params + or local_var_params['place_dual_investment_order'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `place_dual_investment_order` when calling `place_dual_order`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'place_dual_investment_order' in local_var_params: + body_params = local_var_params['place_dual_investment_order'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/orders', + 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def cancel_dual_order(self, order_id, **kwargs): # noqa: E501 + """Cancel Dual Investment order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_dual_order(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.cancel_dual_order_with_http_info(order_id, **kwargs) # noqa: E501 + + def cancel_dual_order_with_http_info(self, order_id, **kwargs): # noqa: E501 + """Cancel Dual Investment order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.cancel_dual_order_with_http_info(order_id, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param int order_id: Order ID (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['order_id'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method cancel_dual_order" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'order_id' is set + if self.api_client.client_side_validation and ( + 'order_id' not in local_var_params or local_var_params['order_id'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `order_id` when calling `cancel_dual_order`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + if 'order_id' in local_var_params: + path_params['order_id'] = local_var_params['order_id'] # noqa: E501 + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/dual/orders/{order_id}', + 'DELETE', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_structured_products(self, structured_get_project_list_request, **kwargs): # noqa: E501 + """Structured Product List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_structured_products(structured_get_project_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredGetProjectListRequest structured_get_project_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.StructuredGetProjectList] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_structured_products_with_http_info(structured_get_project_list_request, **kwargs) # noqa: E501 + + def list_structured_products_with_http_info(self, structured_get_project_list_request, **kwargs): # noqa: E501 + """Structured Product List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_structured_products_with_http_info(structured_get_project_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredGetProjectListRequest structured_get_project_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.StructuredGetProjectList], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['structured_get_project_list_request'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_structured_products" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'structured_get_project_list_request' is set + if self.api_client.client_side_validation and ( + 'structured_get_project_list_request' not in local_var_params + or local_var_params['structured_get_project_list_request'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `structured_get_project_list_request` when calling `list_structured_products`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'structured_get_project_list_request' in local_var_params: + body_params = local_var_params['structured_get_project_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = [] # noqa: E501 + + return self.api_client.call_api( + '/earn/structured/products', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StructuredGetProjectList]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_structured_orders(self, structured_order_list_request, **kwargs): # noqa: E501 + """Structured Product Order List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_structured_orders(structured_order_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredOrderListRequest structured_order_list_request: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.StructuredOrderList] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_structured_orders_with_http_info(structured_order_list_request, **kwargs) # noqa: E501 + + def list_structured_orders_with_http_info(self, structured_order_list_request, **kwargs): # noqa: E501 + """Structured Product Order List # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_structured_orders_with_http_info(structured_order_list_request, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredOrderListRequest structured_order_list_request: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.StructuredOrderList], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['structured_order_list_request'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_structured_orders" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'structured_order_list_request' is set + if self.api_client.client_side_validation and ( + 'structured_order_list_request' not in local_var_params + or local_var_params['structured_order_list_request'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `structured_order_list_request` when calling `list_structured_orders`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'structured_order_list_request' in local_var_params: + body_params = local_var_params['structured_order_list_request'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/structured/orders', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[StructuredOrderList]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def place_structured_order(self, structured_buy, **kwargs): # noqa: E501 + """Place Structured Product Order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_structured_order(structured_buy, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredBuy structured_buy: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.place_structured_order_with_http_info(structured_buy, **kwargs) # noqa: E501 + + def place_structured_order_with_http_info(self, structured_buy, **kwargs): # noqa: E501 + """Place Structured Product Order # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.place_structured_order_with_http_info(structured_buy, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param StructuredBuy structured_buy: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['structured_buy'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method place_structured_order" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'structured_buy' is set + if self.api_client.client_side_validation and ( + 'structured_buy' not in local_var_params or local_var_params['structured_buy'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `structured_buy` when calling `place_structured_order`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'structured_buy' in local_var_params: + body_params = local_var_params['structured_buy'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/earn/structured/orders', + 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) diff --git a/gate_api/api/futures_api.py b/gate_api/api/futures_api.py index ad4afb4..c04932b 100644 --- a/gate_api/api/futures_api.py +++ b/gate_api/api/futures_api.py @@ -1684,6 +1684,7 @@ def list_futures_accounts_with_http_info(self, settle, **kwargs): # noqa: E501 def list_futures_account_book(self, settle, **kwargs): # noqa: E501 """Query account book # noqa: E501 + If the `contract` field is provided, it can only filter records that include this field after 2023-10-30. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_account_book(settle, async_req=True) @@ -1691,6 +1692,7 @@ def list_futures_account_book(self, settle, **kwargs): # noqa: E501 :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified :param int limit: Maximum number of records to be returned in a single list :param int _from: Start timestamp :param int to: End timestamp @@ -1712,6 +1714,7 @@ def list_futures_account_book(self, settle, **kwargs): # noqa: E501 def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E501 """Query account book # noqa: E501 + If the `contract` field is provided, it can only filter records that include this field after 2023-10-30. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_account_book_with_http_info(settle, async_req=True) @@ -1719,6 +1722,7 @@ def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E :param bool async_req: execute request asynchronously :param str settle: Settle currency (required) + :param str contract: Futures contract, return related data only if specified :param int limit: Maximum number of records to be returned in a single list :param int _from: Start timestamp :param int to: End timestamp @@ -1739,7 +1743,7 @@ def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E local_var_params = locals() - all_params = ['settle', 'limit', '_from', 'to', 'type'] + all_params = ['settle', 'contract', 'limit', '_from', 'to', 'type'] all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) for k, v in six.iteritems(local_var_params['kwargs']): @@ -1774,6 +1778,8 @@ def list_futures_account_book_with_http_info(self, settle, **kwargs): # noqa: E path_params['settle'] = local_var_params['settle'] # noqa: E501 query_params = [] + if 'contract' in local_var_params and local_var_params['contract'] is not None: # noqa: E501 + query_params.append(('contract', local_var_params['contract'])) # noqa: E501 if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 query_params.append(('limit', local_var_params['limit'])) # noqa: E501 if '_from' in local_var_params and local_var_params['_from'] is not None: # noqa: E501 @@ -3056,7 +3062,7 @@ def update_dual_mode_position_risk_limit_with_http_info(self, settle, contract, def list_futures_orders(self, settle, status, **kwargs): # noqa: E501 """List futures orders # noqa: E501 - Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501 + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_orders(settle, status, async_req=True) @@ -3086,7 +3092,7 @@ def list_futures_orders(self, settle, status, **kwargs): # noqa: E501 def list_futures_orders_with_http_info(self, settle, status, **kwargs): # noqa: E501 """List futures orders # noqa: E501 - Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501 + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/orders_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.list_futures_orders_with_http_info(settle, status, async_req=True) @@ -3718,7 +3724,7 @@ def create_batch_futures_order_with_http_info(self, settle, futures_order, **kwa def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 """Get a single order # noqa: E501 - Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501 + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_futures_order(settle, order_id, async_req=True) @@ -3744,7 +3750,7 @@ def get_futures_order(self, settle, order_id, **kwargs): # noqa: E501 def get_futures_order_with_http_info(self, settle, order_id, **kwargs): # noqa: E501 """Get a single order # noqa: E501 - Zero-filled order cannot be retrieved 10 minutes after order cancellation # noqa: E501 + - Zero-fill order cannot be retrieved for 10 minutes after cancellation - Historical orders, by default, only data within the past 6 months is supported. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_futures_order_with_http_info(settle, order_id, async_req=True) @@ -4084,6 +4090,7 @@ def cancel_futures_order_with_http_info(self, settle, order_id, **kwargs): # no def get_my_trades(self, settle, **kwargs): # noqa: E501 """List personal trading history # noqa: E501 + By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_my_trades(settle, async_req=True) @@ -4113,6 +4120,7 @@ def get_my_trades(self, settle, **kwargs): # noqa: E501 def get_my_trades_with_http_info(self, settle, **kwargs): # noqa: E501 """List personal trading history # noqa: E501 + By default, only data within the past 6 months is supported. If you need to query data for a longer period, please use `GET /futures/{settle}/my_trades_timerange`. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_my_trades_with_http_info(settle, async_req=True) diff --git a/gate_api/api/margin_api.py b/gate_api/api/margin_api.py index 9751009..f7bb387 100644 --- a/gate_api/api/margin_api.py +++ b/gate_api/api/margin_api.py @@ -3788,7 +3788,7 @@ def get_cross_margin_borrowable(self, currency, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: gate_api.PortfolioBorrowable + :rtype: gate_api.UnifiedBorrowable :return: If the method is called asynchronously, returns the request thread. """ @@ -3814,7 +3814,7 @@ def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noq number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(gate_api.PortfolioBorrowable, status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(gate_api.UnifiedBorrowable, status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -3868,7 +3868,7 @@ def get_cross_margin_borrowable_with_http_info(self, currency, **kwargs): # noq body=body_params, post_params=form_params, files=local_var_files, - response_type='PortfolioBorrowable', # noqa: E501 + response_type='UnifiedBorrowable', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/gate_api/api/spot_api.py b/gate_api/api/spot_api.py index 7d6e78d..8c98189 100644 --- a/gate_api/api/spot_api.py +++ b/gate_api/api/spot_api.py @@ -1876,7 +1876,7 @@ def list_orders_with_http_info(self, currency_pair, status, **kwargs): # noqa: def create_order(self, order, **kwargs): # noqa: E501 """Create an order # noqa: E501 - You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body # noqa: E501 + You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_order(order, async_req=True) @@ -1901,7 +1901,7 @@ def create_order(self, order, **kwargs): # noqa: E501 def create_order_with_http_info(self, order, **kwargs): # noqa: E501 """Create an order # noqa: E501 - You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders.if the user is in portfolio mode, it defaults to the portfolio account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body # noqa: E501 + You can place orders with spot, portfolio, margin or cross margin account through setting the `account `field. It defaults to `spot`, which means spot account is used to place orders. If the user is using unified account, it defaults to the unified account. When margin account is used, i.e., `account` is `margin`, `auto_borrow` field can be set to `true` to enable the server to borrow the amount lacked using `POST /margin/loans` when your account's balance is not enough. Whether margin orders' fill will be used to repay margin loans automatically is determined by the auto repayment setting in your **margin account**, which can be updated or queried using `/margin/auto_repay` API. When cross margin account is used, i.e., `account` is `cross_margin`, `auto_borrow` can also be enabled to achieve borrowing the insufficient amount automatically if cross account's balance is not enough. But it differs from margin account that automatic repayment is determined by order's `auto_repay` field and only current order's fill will be used to repay cross margin loans. Automatic repayment will be triggered when the order is finished, i.e., its status is either `cancelled` or `closed`. **Order status** An order waiting to be filled is `open`, and it stays `open` until it is filled totally. If fully filled, order is finished and its status turns to `closed`.If the order is cancelled before it is totally filled, whether or not partially filled, its status is `cancelled`. **Iceberg order** `iceberg` field can be used to set the amount shown. Set to `-1` to hide the order completely. Note that the hidden part's fee will be charged using taker's fee rate. **Self Trade Prevention** - Set `stp_act` to decide the strategy of self-trade prevention. For detailed usage, refer to the `stp_act` parameter in request body # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.create_order_with_http_info(order, async_req=True) diff --git a/gate_api/api/unified_api.py b/gate_api/api/unified_api.py new file mode 100644 index 0000000..1faaf0b --- /dev/null +++ b/gate_api/api/unified_api.py @@ -0,0 +1,1028 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +from __future__ import absolute_import + +import re # noqa: F401 + +# python 2 and python 3 compatibility library +import six + +from gate_api.api_client import ApiClient +from gate_api.exceptions import ApiTypeError, ApiValueError # noqa: F401 + + +class UnifiedApi(object): + """NOTE: This class is auto generated by OpenAPI Generator + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + def __init__(self, api_client=None): + if api_client is None: + api_client = ApiClient() + self.api_client = api_client + + def list_unified_accounts(self, **kwargs): # noqa: E501 + """Get unified account information # noqa: E501 + + The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. You can refer to the [Formula](#portfolio-account) in the documentation # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_accounts(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: gate_api.UnifiedAccount + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_accounts_with_http_info(**kwargs) # noqa: E501 + + def list_unified_accounts_with_http_info(self, **kwargs): # noqa: E501 + """Get unified account information # noqa: E501 + + The assets of each currency in the account will be adjusted according to their liquidity, defined by corresponding adjustment coefficients, and then uniformly converted to USD to calculate the total asset value and position value of the account. You can refer to the [Formula](#portfolio-account) in the documentation # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_accounts_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(gate_api.UnifiedAccount, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['currency'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_unified_accounts" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/accounts', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedAccount', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_unified_account_mode(self, **kwargs): # noqa: E501 + """Query mode of the unified account # noqa: E501 + + cross_margin - cross margin, usdt_futures - usdt futures # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_account_mode(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: dict(str, bool) + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_account_mode_with_http_info(**kwargs) # noqa: E501 + + def list_unified_account_mode_with_http_info(self, **kwargs): # noqa: E501 + """Query mode of the unified account # noqa: E501 + + cross_margin - cross margin, usdt_futures - usdt futures # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_account_mode_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(dict(str, bool), status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = [] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_unified_account_mode" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/account_mode', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, bool)', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def set_unified_account_mode(self, unified_mode, **kwargs): # noqa: E501 + """Set mode of the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_unified_account_mode(unified_mode, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedMode unified_mode: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: dict(str, bool) + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.set_unified_account_mode_with_http_info(unified_mode, **kwargs) # noqa: E501 + + def set_unified_account_mode_with_http_info(self, unified_mode, **kwargs): # noqa: E501 + """Set mode of the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.set_unified_account_mode_with_http_info(unified_mode, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedMode unified_mode: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(dict(str, bool), status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['unified_mode'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method set_unified_account_mode" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_mode' is set + if self.api_client.client_side_validation and ( + 'unified_mode' not in local_var_params or local_var_params['unified_mode'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `unified_mode` when calling `set_unified_account_mode`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_mode' in local_var_params: + body_params = local_var_params['unified_mode'] + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/account_mode', + 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='dict(str, bool)', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def get_unified_borrowable(self, currency, **kwargs): # noqa: E501 + """Query about the maximum borrowing for the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_borrowable(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: gate_api.UnifiedBorrowable + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_borrowable_with_http_info(currency, **kwargs) # noqa: E501 + + def get_unified_borrowable_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query about the maximum borrowing for the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_borrowable_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(gate_api.UnifiedBorrowable, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['currency'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_unified_borrowable" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currency' is set + if self.api_client.client_side_validation and ( + 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `currency` when calling `get_unified_borrowable`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/borrowable', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedBorrowable', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def get_unified_transferable(self, currency, **kwargs): # noqa: E501 + """Query about the maximum transferable for the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_transferable(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: gate_api.UnifiedTransferable + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.get_unified_transferable_with_http_info(currency, **kwargs) # noqa: E501 + + def get_unified_transferable_with_http_info(self, currency, **kwargs): # noqa: E501 + """Query about the maximum transferable for the unified account # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.get_unified_transferable_with_http_info(currency, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(gate_api.UnifiedTransferable, status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['currency'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method get_unified_transferable" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'currency' is set + if self.api_client.client_side_validation and ( + 'currency' not in local_var_params or local_var_params['currency'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `currency` when calling `get_unified_transferable`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/transferable', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='UnifiedTransferable', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_unified_loans(self, **kwargs): # noqa: E501 + """List loans # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loans(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.UniLoan] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loans_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loans_with_http_info(self, **kwargs): # noqa: E501 + """List loans # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loans_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.UniLoan], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['currency', 'page', 'limit'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_unified_loans" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + + if ( + self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `page` when calling `list_unified_loans`, must be a value greater than or equal to `1`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loans`, must be a value less than or equal to `100`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loans`, must be a value greater than or equal to `1`" + ) # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/loans', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoan]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def create_unified_loan(self, unified_loan, **kwargs): # noqa: E501 + """Borrow or repay # noqa: E501 + + When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_unified_loan(unified_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLoan unified_loan: (required) + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.create_unified_loan_with_http_info(unified_loan, **kwargs) # noqa: E501 + + def create_unified_loan_with_http_info(self, unified_loan, **kwargs): # noqa: E501 + """Borrow or repay # noqa: E501 + + When borrowing, it is essential to ensure that the borrowed amount is not below the minimum borrowing threshold for the specific cryptocurrency and does not exceed the maximum borrowing limit set by the platform and the user. The interest on the loan will be automatically deducted from the account at regular intervals. It is the user's responsibility to manage the repayment of the borrowed amount. For repayment, the option to repay the entire borrowed amount is available by setting the parameter `repaid_all=true` # noqa: E501 + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.create_unified_loan_with_http_info(unified_loan, async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param UnifiedLoan unified_loan: (required) + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: None + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['unified_loan'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method create_unified_loan" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + # verify the required parameter 'unified_loan' is set + if self.api_client.client_side_validation and ( + 'unified_loan' not in local_var_params or local_var_params['unified_loan'] is None # noqa: E501 + ): # noqa: E501 + raise ApiValueError( + "Missing the required parameter `unified_loan` when calling `create_unified_loan`" + ) # noqa: E501 + + collection_formats = {} + + path_params = {} + + query_params = [] + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + if 'unified_loan' in local_var_params: + body_params = local_var_params['unified_loan'] + # HTTP header `Content-Type` + header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 + ['application/json'] + ) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/loans', + 'POST', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type=None, # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_unified_loan_records(self, **kwargs): # noqa: E501 + """Get load records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loan_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.UnifiedLoanRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loan_records_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loan_records_with_http_info(self, **kwargs): # noqa: E501 + """Get load records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loan_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str type: The types of lending records, borrow - indicates the action of borrowing funds, repay - indicates the action of repaying the borrowed funds + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.UnifiedLoanRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['type', 'currency', 'page', 'limit'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method list_unified_loan_records" % k) + local_var_params[k] = v + del local_var_params['kwargs'] + + if ( + self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `page` when calling `list_unified_loan_records`, must be a value greater than or equal to `1`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loan_records`, must be a value less than or equal to `100`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loan_records`, must be a value greater than or equal to `1`" + ) # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'type' in local_var_params and local_var_params['type'] is not None: # noqa: E501 + query_params.append(('type', local_var_params['type'])) # noqa: E501 + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/loan_records', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UnifiedLoanRecord]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) + + def list_unified_loan_interest_records(self, **kwargs): # noqa: E501 + """List interest records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loan_interest_records(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: list[gate_api.UniLoanInterestRecord] + :return: If the method is called asynchronously, + returns the request thread. + """ + kwargs['_return_http_data_only'] = True + return self.list_unified_loan_interest_records_with_http_info(**kwargs) # noqa: E501 + + def list_unified_loan_interest_records_with_http_info(self, **kwargs): # noqa: E501 + """List interest records # noqa: E501 + + This method makes a synchronous HTTP request by default. To make an + asynchronous HTTP request, please pass async_req=True + >>> thread = api.list_unified_loan_interest_records_with_http_info(async_req=True) + >>> result = thread.get() + + :param bool async_req: execute request asynchronously + :param str currency: Retrieve data of the specified currency + :param int page: Page number + :param int limit: Maximum response items. Default: 100, minimum: 1, Maximum: 100 + :param _return_http_data_only: response data without head status code + and headers + :param _preload_content: if False, the urllib3.HTTPResponse object will + be returned without reading/decoding response + data. Default is True. + :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. + :rtype: tuple(list[gate_api.UniLoanInterestRecord], status_code(int), headers(HTTPHeaderDict)) + :return: If the method is called asynchronously, + returns the request thread. + """ + + local_var_params = locals() + + all_params = ['currency', 'page', 'limit'] + all_params.extend(['async_req', '_return_http_data_only', '_preload_content', '_request_timeout']) + + for k, v in six.iteritems(local_var_params['kwargs']): + if k not in all_params: + raise ApiTypeError( + "Got an unexpected keyword argument '%s'" " to method list_unified_loan_interest_records" % k + ) + local_var_params[k] = v + del local_var_params['kwargs'] + + if ( + self.api_client.client_side_validation and 'page' in local_var_params and local_var_params['page'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `page` when calling `list_unified_loan_interest_records`, must be a value greater than or equal to `1`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] > 100 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loan_interest_records`, must be a value less than or equal to `100`" + ) # noqa: E501 + if ( + self.api_client.client_side_validation and 'limit' in local_var_params and local_var_params['limit'] < 1 + ): # noqa: E501 + raise ApiValueError( + "Invalid value for parameter `limit` when calling `list_unified_loan_interest_records`, must be a value greater than or equal to `1`" + ) # noqa: E501 + collection_formats = {} + + path_params = {} + + query_params = [] + if 'currency' in local_var_params and local_var_params['currency'] is not None: # noqa: E501 + query_params.append(('currency', local_var_params['currency'])) # noqa: E501 + if 'page' in local_var_params and local_var_params['page'] is not None: # noqa: E501 + query_params.append(('page', local_var_params['page'])) # noqa: E501 + if 'limit' in local_var_params and local_var_params['limit'] is not None: # noqa: E501 + query_params.append(('limit', local_var_params['limit'])) # noqa: E501 + + header_params = {} + + form_params = [] + local_var_files = {} + + body_params = None + # HTTP header `Accept` + header_params['Accept'] = self.api_client.select_header_accept(['application/json']) # noqa: E501 + + # Authentication setting + auth_settings = ['apiv4'] # noqa: E501 + + return self.api_client.call_api( + '/unified/interest_records', + 'GET', + path_params, + query_params, + header_params, + body=body_params, + post_params=form_params, + files=local_var_files, + response_type='list[UniLoanInterestRecord]', # noqa: E501 + auth_settings=auth_settings, + async_req=local_var_params.get('async_req'), + _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 + _preload_content=local_var_params.get('_preload_content', True), + _request_timeout=local_var_params.get('_request_timeout'), + collection_formats=collection_formats, + ) diff --git a/gate_api/api/wallet_api.py b/gate_api/api/wallet_api.py index 3a9dbcb..cbdcd65 100644 --- a/gate_api/api/wallet_api.py +++ b/gate_api/api/wallet_api.py @@ -263,7 +263,7 @@ def list_withdrawals(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: list[gate_api.LedgerRecord] + :rtype: list[gate_api.WithdrawalRecord] :return: If the method is called asynchronously, returns the request thread. """ @@ -294,7 +294,7 @@ def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. - :rtype: tuple(list[gate_api.LedgerRecord], status_code(int), headers(HTTPHeaderDict)) + :rtype: tuple(list[gate_api.WithdrawalRecord], status_code(int), headers(HTTPHeaderDict)) :return: If the method is called asynchronously, returns the request thread. """ @@ -365,7 +365,7 @@ def list_withdrawals_with_http_info(self, **kwargs): # noqa: E501 body=body_params, post_params=form_params, files=local_var_files, - response_type='list[LedgerRecord]', # noqa: E501 + response_type='list[WithdrawalRecord]', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 diff --git a/gate_api/api_client.py b/gate_api/api_client.py index 47215d8..445aea6 100644 --- a/gate_api/api_client.py +++ b/gate_api/api_client.py @@ -82,7 +82,7 @@ def __init__(self, configuration=None, header_name=None, header_value=None, cook self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/4.57.0/python' + self.user_agent = 'OpenAPI-Generator/4.60.1/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): diff --git a/gate_api/configuration.py b/gate_api/configuration.py index 14e9461..cc2ca71 100644 --- a/gate_api/configuration.py +++ b/gate_api/configuration.py @@ -315,8 +315,8 @@ def to_debug_report(self): "Python SDK Debug Report:\n" "OS: {env}\n" "Python Version: {pyversion}\n" - "Version of the API: 4.57.0\n" - "SDK Package Version: 4.57.0".format(env=sys.platform, pyversion=sys.version) + "Version of the API: 4.60.1\n" + "SDK Package Version: 4.60.1".format(env=sys.platform, pyversion=sys.version) ) def get_host_settings(self): diff --git a/gate_api/models/__init__.py b/gate_api/models/__init__.py index 492360a..5a2ac40 100644 --- a/gate_api/models/__init__.py +++ b/gate_api/models/__init__.py @@ -56,6 +56,9 @@ from gate_api.models.delivery_contract import DeliveryContract from gate_api.models.delivery_settlement import DeliverySettlement from gate_api.models.deposit_address import DepositAddress +from gate_api.models.dual_get_orders import DualGetOrders +from gate_api.models.dual_get_plans import DualGetPlans +from gate_api.models.eth2_swap import Eth2Swap from gate_api.models.flash_swap_currency import FlashSwapCurrency from gate_api.models.flash_swap_currency_pair import FlashSwapCurrencyPair from gate_api.models.flash_swap_order import FlashSwapOrder @@ -121,13 +124,7 @@ from gate_api.models.order_patch import OrderPatch from gate_api.models.order_resp import OrderResp from gate_api.models.patch_uni_lend import PatchUniLend -from gate_api.models.portfolio_account import PortfolioAccount -from gate_api.models.portfolio_borrowable import PortfolioBorrowable -from gate_api.models.portfolio_loan import PortfolioLoan -from gate_api.models.portfolio_loan_record import PortfolioLoanRecord -from gate_api.models.portfolio_margin_balance import PortfolioMarginBalance -from gate_api.models.portfolio_mode import PortfolioMode -from gate_api.models.portfolio_transferable import PortfolioTransferable +from gate_api.models.place_dual_investment_order import PlaceDualInvestmentOrder from gate_api.models.position import Position from gate_api.models.position_close import PositionClose from gate_api.models.position_close_order import PositionCloseOrder @@ -145,6 +142,11 @@ from gate_api.models.spot_price_triggered_order import SpotPriceTriggeredOrder from gate_api.models.stp_group import StpGroup from gate_api.models.stp_group_user import StpGroupUser +from gate_api.models.structured_buy import StructuredBuy +from gate_api.models.structured_get_project_list import StructuredGetProjectList +from gate_api.models.structured_get_project_list_request import StructuredGetProjectListRequest +from gate_api.models.structured_order_list import StructuredOrderList +from gate_api.models.structured_order_list_request import StructuredOrderListRequest from gate_api.models.sub_account import SubAccount from gate_api.models.sub_account_balance import SubAccountBalance from gate_api.models.sub_account_cross_margin_balance import SubAccountCrossMarginBalance @@ -174,6 +176,14 @@ from gate_api.models.uni_loan import UniLoan from gate_api.models.uni_loan_interest_record import UniLoanInterestRecord from gate_api.models.uni_loan_record import UniLoanRecord +from gate_api.models.unified_account import UnifiedAccount +from gate_api.models.unified_balance import UnifiedBalance +from gate_api.models.unified_borrowable import UnifiedBorrowable +from gate_api.models.unified_loan import UnifiedLoan +from gate_api.models.unified_loan_record import UnifiedLoanRecord +from gate_api.models.unified_mode import UnifiedMode +from gate_api.models.unified_transferable import UnifiedTransferable from gate_api.models.user_ltv_info import UserLtvInfo from gate_api.models.user_total_amount import UserTotalAmount from gate_api.models.withdraw_status import WithdrawStatus +from gate_api.models.withdrawal_record import WithdrawalRecord diff --git a/gate_api/models/account_detail.py b/gate_api/models/account_detail.py index b7a1ad9..4261f12 100644 --- a/gate_api/models/account_detail.py +++ b/gate_api/models/account_detail.py @@ -36,6 +36,7 @@ class AccountDetail(object): 'ip_whitelist': 'list[str]', 'currency_pairs': 'list[str]', 'user_id': 'int', + 'tier': 'int', 'key': 'AccountDetailKey', } @@ -43,13 +44,14 @@ class AccountDetail(object): 'ip_whitelist': 'ip_whitelist', 'currency_pairs': 'currency_pairs', 'user_id': 'user_id', + 'tier': 'tier', 'key': 'key', } def __init__( - self, ip_whitelist=None, currency_pairs=None, user_id=None, key=None, local_vars_configuration=None + self, ip_whitelist=None, currency_pairs=None, user_id=None, tier=None, key=None, local_vars_configuration=None ): # noqa: E501 - # type: (list[str], list[str], int, AccountDetailKey, Configuration) -> None + # type: (list[str], list[str], int, int, AccountDetailKey, Configuration) -> None """AccountDetail - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -58,6 +60,7 @@ def __init__( self._ip_whitelist = None self._currency_pairs = None self._user_id = None + self._tier = None self._key = None self.discriminator = None @@ -67,6 +70,8 @@ def __init__( self.currency_pairs = currency_pairs if user_id is not None: self.user_id = user_id + if tier is not None: + self.tier = tier if key is not None: self.key = key @@ -139,6 +144,29 @@ def user_id(self, user_id): self._user_id = user_id + @property + def tier(self): + """Gets the tier of this AccountDetail. # noqa: E501 + + User VIP level # noqa: E501 + + :return: The tier of this AccountDetail. # noqa: E501 + :rtype: int + """ + return self._tier + + @tier.setter + def tier(self, tier): + """Sets the tier of this AccountDetail. + + User VIP level # noqa: E501 + + :param tier: The tier of this AccountDetail. # noqa: E501 + :type: int + """ + + self._tier = tier + @property def key(self): """Gets the key of this AccountDetail. # noqa: E501 diff --git a/gate_api/models/amend_order_result.py b/gate_api/models/amend_order_result.py index 2786e38..da2c8e2 100644 --- a/gate_api/models/amend_order_result.py +++ b/gate_api/models/amend_order_result.py @@ -264,7 +264,7 @@ def message(self, message): def account(self): """Gets the account of this AmendOrderResult. # noqa: E501 - Account types, spot - spot account, margin - margin account, portfolio - portfolio margin account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 + Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 :return: The account of this AmendOrderResult. # noqa: E501 :rtype: str @@ -275,7 +275,7 @@ def account(self): def account(self, account): """Sets the account of this AmendOrderResult. - Account types, spot - spot account, margin - margin account, portfolio - portfolio margin account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 + Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account.Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 :param account: The account of this AmendOrderResult. # noqa: E501 :type: str diff --git a/gate_api/models/api_v4_key_perm.py b/gate_api/models/api_v4_key_perm.py index df2bc84..4546921 100644 --- a/gate_api/models/api_v4_key_perm.py +++ b/gate_api/models/api_v4_key_perm.py @@ -56,7 +56,7 @@ def __init__(self, name=None, read_only=None, local_vars_configuration=None): # def name(self): """Gets the name of this ApiV4KeyPerm. # noqa: E501 - Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan # noqa: E501 + Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options\\m- account: Account - unified: unified - loan: Loan # noqa: E501 :return: The name of this ApiV4KeyPerm. # noqa: E501 :rtype: str @@ -67,7 +67,7 @@ def name(self): def name(self, name): """Sets the name of this ApiV4KeyPerm. - Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options- account: Account - portfolio: Portfolio - loan: Loan # noqa: E501 + Permission name (all permissions will be removed if no value is passed) - wallet: wallet - spot: spot/margin - futures: perpetual contract - delivery: delivery - earn: earn - options: options\\m- account: Account - unified: unified - loan: Loan # noqa: E501 :param name: The name of this ApiV4KeyPerm. # noqa: E501 :type: str @@ -80,7 +80,7 @@ def name(self, name): "earn", "options", "account", - "portfolio", + "unified", "loan", ] # noqa: E501 if self.local_vars_configuration.client_side_validation and name not in allowed_values: # noqa: E501 diff --git a/gate_api/models/batch_order.py b/gate_api/models/batch_order.py index b455dc6..a9ec800 100644 --- a/gate_api/models/batch_order.py +++ b/gate_api/models/batch_order.py @@ -539,7 +539,7 @@ def type(self, type): def account(self): """Gets the account of this BatchOrder. # noqa: E501 - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, portfolio - portfolio account # noqa: E501 + Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, unified - unified account # noqa: E501 :return: The account of this BatchOrder. # noqa: E501 :rtype: str @@ -550,12 +550,12 @@ def account(self): def account(self, account): """Sets the account of this BatchOrder. - Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, portfolio - portfolio account # noqa: E501 + Account type. spot - use spot account; margin - use margin account; cross_margin - use cross margin account, unified - unified account # noqa: E501 :param account: The account of this BatchOrder. # noqa: E501 :type: str """ - allowed_values = ["spot", "margin", "cross_margin", "portfolio"] # noqa: E501 + allowed_values = ["spot", "margin", "cross_margin", "unified"] # noqa: E501 if self.local_vars_configuration.client_side_validation and account not in allowed_values: # noqa: E501 raise ValueError( "Invalid value for `account` ({0}), must be one of {1}".format(account, allowed_values) # noqa: E501 diff --git a/gate_api/models/contract.py b/gate_api/models/contract.py index ebd2f2c..266ba18 100644 --- a/gate_api/models/contract.py +++ b/gate_api/models/contract.py @@ -68,6 +68,7 @@ class Contract(object): 'enable_bonus': 'bool', 'enable_credit': 'bool', 'create_time': 'float', + 'funding_cap_ratio': 'str', } attribute_map = { @@ -106,6 +107,7 @@ class Contract(object): 'enable_bonus': 'enable_bonus', 'enable_credit': 'enable_credit', 'create_time': 'create_time', + 'funding_cap_ratio': 'funding_cap_ratio', } def __init__( @@ -145,9 +147,10 @@ def __init__( enable_bonus=None, enable_credit=None, create_time=None, + funding_cap_ratio=None, local_vars_configuration=None, ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, float, str, str, str, int, int, str, str, str, int, int, int, int, float, bool, int, bool, bool, float, Configuration) -> None + # type: (str, str, str, str, str, str, str, str, str, str, str, str, str, str, str, int, float, str, str, str, int, int, str, str, str, int, int, int, int, float, bool, int, bool, bool, float, str, Configuration) -> None """Contract - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -188,6 +191,7 @@ def __init__( self._enable_bonus = None self._enable_credit = None self._create_time = None + self._funding_cap_ratio = None self.discriminator = None if name is not None: @@ -260,6 +264,8 @@ def __init__( self.enable_credit = enable_credit if create_time is not None: self.create_time = create_time + if funding_cap_ratio is not None: + self.funding_cap_ratio = funding_cap_ratio @property def name(self): @@ -1078,6 +1084,29 @@ def create_time(self, create_time): self._create_time = create_time + @property + def funding_cap_ratio(self): + """Gets the funding_cap_ratio of this Contract. # noqa: E501 + + The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio # noqa: E501 + + :return: The funding_cap_ratio of this Contract. # noqa: E501 + :rtype: str + """ + return self._funding_cap_ratio + + @funding_cap_ratio.setter + def funding_cap_ratio(self, funding_cap_ratio): + """Sets the funding_cap_ratio of this Contract. + + The factor for the maximum of the funding rate. Maximum of funding rate = (1/market maximum leverage - maintenance margin rate) * funding_cap_ratio # noqa: E501 + + :param funding_cap_ratio: The funding_cap_ratio of this Contract. # noqa: E501 + :type: str + """ + + self._funding_cap_ratio = funding_cap_ratio + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/cross_margin_currency.py b/gate_api/models/cross_margin_currency.py index 87d05de..07c9db1 100644 --- a/gate_api/models/cross_margin_currency.py +++ b/gate_api/models/cross_margin_currency.py @@ -41,6 +41,7 @@ class CrossMarginCurrency(object): 'user_max_borrow_amount': 'str', 'total_max_borrow_amount': 'str', 'price': 'str', + 'loanable': 'bool', 'status': 'int', } @@ -53,6 +54,7 @@ class CrossMarginCurrency(object): 'user_max_borrow_amount': 'user_max_borrow_amount', 'total_max_borrow_amount': 'total_max_borrow_amount', 'price': 'price', + 'loanable': 'loanable', 'status': 'status', } @@ -66,10 +68,11 @@ def __init__( user_max_borrow_amount=None, total_max_borrow_amount=None, price=None, + loanable=None, status=None, local_vars_configuration=None, ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, int, Configuration) -> None + # type: (str, str, str, str, str, str, str, str, bool, int, Configuration) -> None """CrossMarginCurrency - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -83,6 +86,7 @@ def __init__( self._user_max_borrow_amount = None self._total_max_borrow_amount = None self._price = None + self._loanable = None self._status = None self.discriminator = None @@ -102,6 +106,8 @@ def __init__( self.total_max_borrow_amount = total_max_borrow_amount if price is not None: self.price = price + if loanable is not None: + self.loanable = loanable if status is not None: self.status = status @@ -289,6 +295,29 @@ def price(self, price): self._price = price + @property + def loanable(self): + """Gets the loanable of this CrossMarginCurrency. # noqa: E501 + + Whether currency is borrowed # noqa: E501 + + :return: The loanable of this CrossMarginCurrency. # noqa: E501 + :rtype: bool + """ + return self._loanable + + @loanable.setter + def loanable(self, loanable): + """Sets the loanable of this CrossMarginCurrency. + + Whether currency is borrowed # noqa: E501 + + :param loanable: The loanable of this CrossMarginCurrency. # noqa: E501 + :type: bool + """ + + self._loanable = loanable + @property def status(self): """Gets the status of this CrossMarginCurrency. # noqa: E501 diff --git a/gate_api/models/currency_pair.py b/gate_api/models/currency_pair.py index 09c8aed..679af47 100644 --- a/gate_api/models/currency_pair.py +++ b/gate_api/models/currency_pair.py @@ -39,6 +39,8 @@ class CurrencyPair(object): 'fee': 'str', 'min_base_amount': 'str', 'min_quote_amount': 'str', + 'max_base_amount': 'str', + 'max_quote_amount': 'str', 'amount_precision': 'int', 'precision': 'int', 'trade_status': 'str', @@ -53,6 +55,8 @@ class CurrencyPair(object): 'fee': 'fee', 'min_base_amount': 'min_base_amount', 'min_quote_amount': 'min_quote_amount', + 'max_base_amount': 'max_base_amount', + 'max_quote_amount': 'max_quote_amount', 'amount_precision': 'amount_precision', 'precision': 'precision', 'trade_status': 'trade_status', @@ -68,6 +72,8 @@ def __init__( fee=None, min_base_amount=None, min_quote_amount=None, + max_base_amount=None, + max_quote_amount=None, amount_precision=None, precision=None, trade_status=None, @@ -75,7 +81,7 @@ def __init__( buy_start=None, local_vars_configuration=None, ): # noqa: E501 - # type: (str, str, str, str, str, str, int, int, str, int, int, Configuration) -> None + # type: (str, str, str, str, str, str, str, str, int, int, str, int, int, Configuration) -> None """CurrencyPair - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -87,6 +93,8 @@ def __init__( self._fee = None self._min_base_amount = None self._min_quote_amount = None + self._max_base_amount = None + self._max_quote_amount = None self._amount_precision = None self._precision = None self._trade_status = None @@ -106,6 +114,10 @@ def __init__( self.min_base_amount = min_base_amount if min_quote_amount is not None: self.min_quote_amount = min_quote_amount + if max_base_amount is not None: + self.max_base_amount = max_base_amount + if max_quote_amount is not None: + self.max_quote_amount = max_quote_amount if amount_precision is not None: self.amount_precision = amount_precision if precision is not None: @@ -255,6 +267,52 @@ def min_quote_amount(self, min_quote_amount): self._min_quote_amount = min_quote_amount + @property + def max_base_amount(self): + """Gets the max_base_amount of this CurrencyPair. # noqa: E501 + + Maximum amount of base currency to trade, `null` means no limit # noqa: E501 + + :return: The max_base_amount of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._max_base_amount + + @max_base_amount.setter + def max_base_amount(self, max_base_amount): + """Sets the max_base_amount of this CurrencyPair. + + Maximum amount of base currency to trade, `null` means no limit # noqa: E501 + + :param max_base_amount: The max_base_amount of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._max_base_amount = max_base_amount + + @property + def max_quote_amount(self): + """Gets the max_quote_amount of this CurrencyPair. # noqa: E501 + + Maximum amount of quote currency to trade, `null` means no limit # noqa: E501 + + :return: The max_quote_amount of this CurrencyPair. # noqa: E501 + :rtype: str + """ + return self._max_quote_amount + + @max_quote_amount.setter + def max_quote_amount(self, max_quote_amount): + """Sets the max_quote_amount of this CurrencyPair. + + Maximum amount of quote currency to trade, `null` means no limit # noqa: E501 + + :param max_quote_amount: The max_quote_amount of this CurrencyPair. # noqa: E501 + :type: str + """ + + self._max_quote_amount = max_quote_amount + @property def amount_precision(self): """Gets the amount_precision of this CurrencyPair. # noqa: E501 diff --git a/gate_api/models/dual_get_orders.py b/gate_api/models/dual_get_orders.py new file mode 100644 index 0000000..70ccdce --- /dev/null +++ b/gate_api/models/dual_get_orders.py @@ -0,0 +1,560 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualGetOrders(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'plan_id': 'int', + 'copies': 'str', + 'invest_amount': 'str', + 'settlement_amount': 'str', + 'create_time': 'int', + 'complete_time': 'int', + 'status': 'str', + 'invest_currency': 'str', + 'exercise_currency': 'str', + 'exercise_price': 'str', + 'settlement_price': 'str', + 'settlement_currency': 'str', + 'apy_display': 'str', + 'apy_settlement': 'str', + 'delivery_time': 'int', + } + + attribute_map = { + 'id': 'id', + 'plan_id': 'plan_id', + 'copies': 'copies', + 'invest_amount': 'invest_amount', + 'settlement_amount': 'settlement_amount', + 'create_time': 'create_time', + 'complete_time': 'complete_time', + 'status': 'status', + 'invest_currency': 'invest_currency', + 'exercise_currency': 'exercise_currency', + 'exercise_price': 'exercise_price', + 'settlement_price': 'settlement_price', + 'settlement_currency': 'settlement_currency', + 'apy_display': 'apy_display', + 'apy_settlement': 'apy_settlement', + 'delivery_time': 'delivery_time', + } + + def __init__( + self, + id=None, + plan_id=None, + copies=None, + invest_amount=None, + settlement_amount=None, + create_time=None, + complete_time=None, + status=None, + invest_currency=None, + exercise_currency=None, + exercise_price=None, + settlement_price=None, + settlement_currency=None, + apy_display=None, + apy_settlement=None, + delivery_time=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, int, str, str, str, int, int, str, str, str, str, str, str, str, str, int, Configuration) -> None + """DualGetOrders - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._plan_id = None + self._copies = None + self._invest_amount = None + self._settlement_amount = None + self._create_time = None + self._complete_time = None + self._status = None + self._invest_currency = None + self._exercise_currency = None + self._exercise_price = None + self._settlement_price = None + self._settlement_currency = None + self._apy_display = None + self._apy_settlement = None + self._delivery_time = None + self.discriminator = None + + if id is not None: + self.id = id + if plan_id is not None: + self.plan_id = plan_id + if copies is not None: + self.copies = copies + if invest_amount is not None: + self.invest_amount = invest_amount + if settlement_amount is not None: + self.settlement_amount = settlement_amount + if create_time is not None: + self.create_time = create_time + if complete_time is not None: + self.complete_time = complete_time + if status is not None: + self.status = status + if invest_currency is not None: + self.invest_currency = invest_currency + if exercise_currency is not None: + self.exercise_currency = exercise_currency + if exercise_price is not None: + self.exercise_price = exercise_price + if settlement_price is not None: + self.settlement_price = settlement_price + if settlement_currency is not None: + self.settlement_currency = settlement_currency + if apy_display is not None: + self.apy_display = apy_display + if apy_settlement is not None: + self.apy_settlement = apy_settlement + if delivery_time is not None: + self.delivery_time = delivery_time + + @property + def id(self): + """Gets the id of this DualGetOrders. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DualGetOrders. + + Order ID # noqa: E501 + + :param id: The id of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def plan_id(self): + """Gets the plan_id of this DualGetOrders. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this DualGetOrders. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._plan_id = plan_id + + @property + def copies(self): + """Gets the copies of this DualGetOrders. # noqa: E501 + + Copies # noqa: E501 + + :return: The copies of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._copies + + @copies.setter + def copies(self, copies): + """Sets the copies of this DualGetOrders. + + Copies # noqa: E501 + + :param copies: The copies of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._copies = copies + + @property + def invest_amount(self): + """Gets the invest_amount of this DualGetOrders. # noqa: E501 + + Investment Amount # noqa: E501 + + :return: The invest_amount of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._invest_amount + + @invest_amount.setter + def invest_amount(self, invest_amount): + """Sets the invest_amount of this DualGetOrders. + + Investment Amount # noqa: E501 + + :param invest_amount: The invest_amount of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._invest_amount = invest_amount + + @property + def settlement_amount(self): + """Gets the settlement_amount of this DualGetOrders. # noqa: E501 + + Settlement Amount # noqa: E501 + + :return: The settlement_amount of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_amount + + @settlement_amount.setter + def settlement_amount(self, settlement_amount): + """Sets the settlement_amount of this DualGetOrders. + + Settlement Amount # noqa: E501 + + :param settlement_amount: The settlement_amount of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_amount = settlement_amount + + @property + def create_time(self): + """Gets the create_time of this DualGetOrders. # noqa: E501 + + Creation time # noqa: E501 + + :return: The create_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this DualGetOrders. + + Creation time # noqa: E501 + + :param create_time: The create_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + @property + def complete_time(self): + """Gets the complete_time of this DualGetOrders. # noqa: E501 + + Completion Time # noqa: E501 + + :return: The complete_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._complete_time + + @complete_time.setter + def complete_time(self, complete_time): + """Sets the complete_time of this DualGetOrders. + + Completion Time # noqa: E501 + + :param complete_time: The complete_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._complete_time = complete_time + + @property + def status(self): + """Gets the status of this DualGetOrders. # noqa: E501 + + Status: `INIT`-INIT `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-SEttlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :return: The status of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DualGetOrders. + + Status: `INIT`-INIT `SETTLEMENT_SUCCESS`-Settlement Success `SETTLEMENT_PROCESSING`-SEttlement Processing `CANCELED`-Canceled `FAILED`-Failed # noqa: E501 + + :param status: The status of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def invest_currency(self): + """Gets the invest_currency of this DualGetOrders. # noqa: E501 + + Investment Currency # noqa: E501 + + :return: The invest_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualGetOrders. + + Investment Currency # noqa: E501 + + :param invest_currency: The invest_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this DualGetOrders. # noqa: E501 + + Strike Currency # noqa: E501 + + :return: The exercise_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this DualGetOrders. + + Strike Currency # noqa: E501 + + :param exercise_currency: The exercise_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def exercise_price(self): + """Gets the exercise_price of this DualGetOrders. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualGetOrders. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._exercise_price = exercise_price + + @property + def settlement_price(self): + """Gets the settlement_price of this DualGetOrders. # noqa: E501 + + settlement price # noqa: E501 + + :return: The settlement_price of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_price + + @settlement_price.setter + def settlement_price(self, settlement_price): + """Sets the settlement_price of this DualGetOrders. + + settlement price # noqa: E501 + + :param settlement_price: The settlement_price of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_price = settlement_price + + @property + def settlement_currency(self): + """Gets the settlement_currency of this DualGetOrders. # noqa: E501 + + Settle currency # noqa: E501 + + :return: The settlement_currency of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._settlement_currency + + @settlement_currency.setter + def settlement_currency(self, settlement_currency): + """Sets the settlement_currency of this DualGetOrders. + + Settle currency # noqa: E501 + + :param settlement_currency: The settlement_currency of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._settlement_currency = settlement_currency + + @property + def apy_display(self): + """Gets the apy_display of this DualGetOrders. # noqa: E501 + + APY # noqa: E501 + + :return: The apy_display of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualGetOrders. + + APY # noqa: E501 + + :param apy_display: The apy_display of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def apy_settlement(self): + """Gets the apy_settlement of this DualGetOrders. # noqa: E501 + + Settlement APY # noqa: E501 + + :return: The apy_settlement of this DualGetOrders. # noqa: E501 + :rtype: str + """ + return self._apy_settlement + + @apy_settlement.setter + def apy_settlement(self, apy_settlement): + """Sets the apy_settlement of this DualGetOrders. + + Settlement APY # noqa: E501 + + :param apy_settlement: The apy_settlement of this DualGetOrders. # noqa: E501 + :type: str + """ + + self._apy_settlement = apy_settlement + + @property + def delivery_time(self): + """Gets the delivery_time of this DualGetOrders. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_time of this DualGetOrders. # noqa: E501 + :rtype: int + """ + return self._delivery_time + + @delivery_time.setter + def delivery_time(self, delivery_time): + """Sets the delivery_time of this DualGetOrders. + + Settlement time # noqa: E501 + + :param delivery_time: The delivery_time of this DualGetOrders. # noqa: E501 + :type: int + """ + + self._delivery_time = delivery_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualGetOrders): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualGetOrders): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/dual_get_plans.py b/gate_api/models/dual_get_plans.py new file mode 100644 index 0000000..bd92265 --- /dev/null +++ b/gate_api/models/dual_get_plans.py @@ -0,0 +1,473 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class DualGetPlans(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'instrument_name': 'str', + 'invest_currency': 'str', + 'exercise_currency': 'str', + 'exercise_price': 'float', + 'delivery_time': 'int', + 'min_copies': 'int', + 'max_copies': 'int', + 'per_value': 'str', + 'apy_display': 'str', + 'start_time': 'int', + 'end_time': 'int', + 'status': 'str', + } + + attribute_map = { + 'id': 'id', + 'instrument_name': 'instrument_name', + 'invest_currency': 'invest_currency', + 'exercise_currency': 'exercise_currency', + 'exercise_price': 'exercise_price', + 'delivery_time': 'delivery_time', + 'min_copies': 'min_copies', + 'max_copies': 'max_copies', + 'per_value': 'per_value', + 'apy_display': 'apy_display', + 'start_time': 'start_time', + 'end_time': 'end_time', + 'status': 'status', + } + + def __init__( + self, + id=None, + instrument_name=None, + invest_currency=None, + exercise_currency=None, + exercise_price=None, + delivery_time=None, + min_copies=None, + max_copies=None, + per_value=None, + apy_display=None, + start_time=None, + end_time=None, + status=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, str, str, str, float, int, int, int, str, str, int, int, str, Configuration) -> None + """DualGetPlans - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._instrument_name = None + self._invest_currency = None + self._exercise_currency = None + self._exercise_price = None + self._delivery_time = None + self._min_copies = None + self._max_copies = None + self._per_value = None + self._apy_display = None + self._start_time = None + self._end_time = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if instrument_name is not None: + self.instrument_name = instrument_name + if invest_currency is not None: + self.invest_currency = invest_currency + if exercise_currency is not None: + self.exercise_currency = exercise_currency + if exercise_price is not None: + self.exercise_price = exercise_price + if delivery_time is not None: + self.delivery_time = delivery_time + if min_copies is not None: + self.min_copies = min_copies + if max_copies is not None: + self.max_copies = max_copies + if per_value is not None: + self.per_value = per_value + if apy_display is not None: + self.apy_display = apy_display + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this DualGetPlans. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The id of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this DualGetPlans. + + Plan ID # noqa: E501 + + :param id: The id of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def instrument_name(self): + """Gets the instrument_name of this DualGetPlans. # noqa: E501 + + Instrument Name # noqa: E501 + + :return: The instrument_name of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._instrument_name + + @instrument_name.setter + def instrument_name(self, instrument_name): + """Sets the instrument_name of this DualGetPlans. + + Instrument Name # noqa: E501 + + :param instrument_name: The instrument_name of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._instrument_name = instrument_name + + @property + def invest_currency(self): + """Gets the invest_currency of this DualGetPlans. # noqa: E501 + + Investment Currency # noqa: E501 + + :return: The invest_currency of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._invest_currency + + @invest_currency.setter + def invest_currency(self, invest_currency): + """Sets the invest_currency of this DualGetPlans. + + Investment Currency # noqa: E501 + + :param invest_currency: The invest_currency of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._invest_currency = invest_currency + + @property + def exercise_currency(self): + """Gets the exercise_currency of this DualGetPlans. # noqa: E501 + + Strike Currency # noqa: E501 + + :return: The exercise_currency of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._exercise_currency + + @exercise_currency.setter + def exercise_currency(self, exercise_currency): + """Sets the exercise_currency of this DualGetPlans. + + Strike Currency # noqa: E501 + + :param exercise_currency: The exercise_currency of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._exercise_currency = exercise_currency + + @property + def exercise_price(self): + """Gets the exercise_price of this DualGetPlans. # noqa: E501 + + Strike price # noqa: E501 + + :return: The exercise_price of this DualGetPlans. # noqa: E501 + :rtype: float + """ + return self._exercise_price + + @exercise_price.setter + def exercise_price(self, exercise_price): + """Sets the exercise_price of this DualGetPlans. + + Strike price # noqa: E501 + + :param exercise_price: The exercise_price of this DualGetPlans. # noqa: E501 + :type: float + """ + + self._exercise_price = exercise_price + + @property + def delivery_time(self): + """Gets the delivery_time of this DualGetPlans. # noqa: E501 + + Settlement time # noqa: E501 + + :return: The delivery_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._delivery_time + + @delivery_time.setter + def delivery_time(self, delivery_time): + """Sets the delivery_time of this DualGetPlans. + + Settlement time # noqa: E501 + + :param delivery_time: The delivery_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._delivery_time = delivery_time + + @property + def min_copies(self): + """Gets the min_copies of this DualGetPlans. # noqa: E501 + + Minimum Copies # noqa: E501 + + :return: The min_copies of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._min_copies + + @min_copies.setter + def min_copies(self, min_copies): + """Sets the min_copies of this DualGetPlans. + + Minimum Copies # noqa: E501 + + :param min_copies: The min_copies of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._min_copies = min_copies + + @property + def max_copies(self): + """Gets the max_copies of this DualGetPlans. # noqa: E501 + + Maximum Copies # noqa: E501 + + :return: The max_copies of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._max_copies + + @max_copies.setter + def max_copies(self, max_copies): + """Sets the max_copies of this DualGetPlans. + + Maximum Copies # noqa: E501 + + :param max_copies: The max_copies of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._max_copies = max_copies + + @property + def per_value(self): + """Gets the per_value of this DualGetPlans. # noqa: E501 + + Per Unit Value # noqa: E501 + + :return: The per_value of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._per_value + + @per_value.setter + def per_value(self, per_value): + """Sets the per_value of this DualGetPlans. + + Per Unit Value # noqa: E501 + + :param per_value: The per_value of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._per_value = per_value + + @property + def apy_display(self): + """Gets the apy_display of this DualGetPlans. # noqa: E501 + + APY # noqa: E501 + + :return: The apy_display of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._apy_display + + @apy_display.setter + def apy_display(self, apy_display): + """Sets the apy_display of this DualGetPlans. + + APY # noqa: E501 + + :param apy_display: The apy_display of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._apy_display = apy_display + + @property + def start_time(self): + """Gets the start_time of this DualGetPlans. # noqa: E501 + + start time # noqa: E501 + + :return: The start_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this DualGetPlans. + + start time # noqa: E501 + + :param start_time: The start_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this DualGetPlans. # noqa: E501 + + Finished time # noqa: E501 + + :return: The end_time of this DualGetPlans. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this DualGetPlans. + + Finished time # noqa: E501 + + :param end_time: The end_time of this DualGetPlans. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def status(self): + """Gets the status of this DualGetPlans. # noqa: E501 + + Status: `NOTSTARTED`-not started `ONGOING`-ongoing `ENDED`-ended # noqa: E501 + + :return: The status of this DualGetPlans. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this DualGetPlans. + + Status: `NOTSTARTED`-not started `ONGOING`-ongoing `ENDED`-ended # noqa: E501 + + :param status: The status of this DualGetPlans. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, DualGetPlans): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, DualGetPlans): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/eth2_swap.py b/gate_api/models/eth2_swap.py new file mode 100644 index 0000000..dee1b5d --- /dev/null +++ b/gate_api/models/eth2_swap.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class Eth2Swap(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'side': 'str', 'amount': 'str'} + + attribute_map = {'side': 'side', 'amount': 'amount'} + + def __init__(self, side=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """Eth2Swap - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._side = None + self._amount = None + self.discriminator = None + + self.side = side + self.amount = amount + + @property + def side(self): + """Gets the side of this Eth2Swap. # noqa: E501 + + 1-Forward Swap(ETH -> ETH2), 2-Reverse Swap(ETH2 -> ETH) # noqa: E501 + + :return: The side of this Eth2Swap. # noqa: E501 + :rtype: str + """ + return self._side + + @side.setter + def side(self, side): + """Sets the side of this Eth2Swap. + + 1-Forward Swap(ETH -> ETH2), 2-Reverse Swap(ETH2 -> ETH) # noqa: E501 + + :param side: The side of this Eth2Swap. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and side is None: # noqa: E501 + raise ValueError("Invalid value for `side`, must not be `None`") # noqa: E501 + + self._side = side + + @property + def amount(self): + """Gets the amount of this Eth2Swap. # noqa: E501 + + amount # noqa: E501 + + :return: The amount of this Eth2Swap. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this Eth2Swap. + + amount # noqa: E501 + + :param amount: The amount of this Eth2Swap. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, Eth2Swap): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, Eth2Swap): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/futures_account_book.py b/gate_api/models/futures_account_book.py index ef4b595..6989246 100644 --- a/gate_api/models/futures_account_book.py +++ b/gate_api/models/futures_account_book.py @@ -32,14 +32,38 @@ class FuturesAccountBook(object): attribute_map (dict): The key is attribute name and the value is json key in definition. """ - openapi_types = {'time': 'float', 'change': 'str', 'balance': 'str', 'type': 'str', 'text': 'str'} - - attribute_map = {'time': 'time', 'change': 'change', 'balance': 'balance', 'type': 'type', 'text': 'text'} + openapi_types = { + 'time': 'float', + 'change': 'str', + 'balance': 'str', + 'type': 'str', + 'text': 'str', + 'contract': 'str', + 'trade_id': 'str', + } + + attribute_map = { + 'time': 'time', + 'change': 'change', + 'balance': 'balance', + 'type': 'type', + 'text': 'text', + 'contract': 'contract', + 'trade_id': 'trade_id', + } def __init__( - self, time=None, change=None, balance=None, type=None, text=None, local_vars_configuration=None + self, + time=None, + change=None, + balance=None, + type=None, + text=None, + contract=None, + trade_id=None, + local_vars_configuration=None, ): # noqa: E501 - # type: (float, str, str, str, str, Configuration) -> None + # type: (float, str, str, str, str, str, str, Configuration) -> None """FuturesAccountBook - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -50,6 +74,8 @@ def __init__( self._balance = None self._type = None self._text = None + self._contract = None + self._trade_id = None self.discriminator = None if time is not None: @@ -62,6 +88,10 @@ def __init__( self.type = type if text is not None: self.text = text + if contract is not None: + self.contract = contract + if trade_id is not None: + self.trade_id = trade_id @property def time(self): @@ -183,6 +213,52 @@ def text(self, text): self._text = text + @property + def contract(self): + """Gets the contract of this FuturesAccountBook. # noqa: E501 + + Futures contract, the field is only available for data after 2023-10-30. # noqa: E501 + + :return: The contract of this FuturesAccountBook. # noqa: E501 + :rtype: str + """ + return self._contract + + @contract.setter + def contract(self, contract): + """Sets the contract of this FuturesAccountBook. + + Futures contract, the field is only available for data after 2023-10-30. # noqa: E501 + + :param contract: The contract of this FuturesAccountBook. # noqa: E501 + :type: str + """ + + self._contract = contract + + @property + def trade_id(self): + """Gets the trade_id of this FuturesAccountBook. # noqa: E501 + + trade id # noqa: E501 + + :return: The trade_id of this FuturesAccountBook. # noqa: E501 + :rtype: str + """ + return self._trade_id + + @trade_id.setter + def trade_id(self, trade_id): + """Sets the trade_id of this FuturesAccountBook. + + trade id # noqa: E501 + + :param trade_id: The trade_id of this FuturesAccountBook. # noqa: E501 + :type: str + """ + + self._trade_id = trade_id + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/futures_order.py b/gate_api/models/futures_order.py index e003b58..9b7f3fc 100644 --- a/gate_api/models/futures_order.py +++ b/gate_api/models/futures_order.py @@ -59,6 +59,7 @@ class FuturesOrder(object): 'stp_id': 'int', 'stp_act': 'str', 'amend_text': 'str', + 'biz_info': 'str', } attribute_map = { @@ -88,6 +89,7 @@ class FuturesOrder(object): 'stp_id': 'stp_id', 'stp_act': 'stp_act', 'amend_text': 'amend_text', + 'biz_info': 'biz_info', } def __init__( @@ -118,9 +120,10 @@ def __init__( stp_id=None, stp_act=None, amend_text=None, + biz_info=None, local_vars_configuration=None, ): # noqa: E501 - # type: (int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, Configuration) -> None + # type: (int, int, float, float, str, str, str, int, int, str, bool, bool, bool, bool, bool, str, int, str, str, str, str, int, str, int, str, str, str, Configuration) -> None """FuturesOrder - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -152,6 +155,7 @@ def __init__( self._stp_id = None self._stp_act = None self._amend_text = None + self._biz_info = None self.discriminator = None if id is not None: @@ -204,6 +208,8 @@ def __init__( self.stp_act = stp_act if amend_text is not None: self.amend_text = amend_text + if biz_info is not None: + self.biz_info = biz_info @property def id(self): @@ -846,6 +852,29 @@ def amend_text(self, amend_text): self._amend_text = amend_text + @property + def biz_info(self): + """Gets the biz_info of this FuturesOrder. # noqa: E501 + + Additional information # noqa: E501 + + :return: The biz_info of this FuturesOrder. # noqa: E501 + :rtype: str + """ + return self._biz_info + + @biz_info.setter + def biz_info(self, biz_info): + """Sets the biz_info of this FuturesOrder. + + Additional information # noqa: E501 + + :param biz_info: The biz_info of this FuturesOrder. # noqa: E501 + :type: str + """ + + self._biz_info = biz_info + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/order.py b/gate_api/models/order.py index a53d768..ab8345b 100644 --- a/gate_api/models/order.py +++ b/gate_api/models/order.py @@ -498,7 +498,7 @@ def type(self, type): def account(self): """Gets the account of this Order. # noqa: E501 - Account type, spot - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` # noqa: E501 + Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account. Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 :return: The account of this Order. # noqa: E501 :rtype: str @@ -509,16 +509,11 @@ def account(self): def account(self, account): """Sets the account of this Order. - Account type, spot - spot account, margin - margin account, cross_margin - cross margin account, portfolio - portfolio account Portfolio margin account must set to `cross_margin` # noqa: E501 + Account types, spot - spot account, margin - margin account, unified - unified account, cross_margin - cross margin account. Portfolio margin accounts can only be set to `cross_margin` # noqa: E501 :param account: The account of this Order. # noqa: E501 :type: str """ - allowed_values = ["spot", "margin", "cross_margin", "portfolio"] # noqa: E501 - if self.local_vars_configuration.client_side_validation and account not in allowed_values: # noqa: E501 - raise ValueError( - "Invalid value for `account` ({0}), must be one of {1}".format(account, allowed_values) # noqa: E501 - ) self._account = account diff --git a/gate_api/models/place_dual_investment_order.py b/gate_api/models/place_dual_investment_order.py new file mode 100644 index 0000000..057c080 --- /dev/null +++ b/gate_api/models/place_dual_investment_order.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class PlaceDualInvestmentOrder(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'plan_id': 'str', 'copies': 'str'} + + attribute_map = {'plan_id': 'plan_id', 'copies': 'copies'} + + def __init__(self, plan_id=None, copies=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """PlaceDualInvestmentOrder - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._plan_id = None + self._copies = None + self.discriminator = None + + self.plan_id = plan_id + self.copies = copies + + @property + def plan_id(self): + """Gets the plan_id of this PlaceDualInvestmentOrder. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The plan_id of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._plan_id + + @plan_id.setter + def plan_id(self, plan_id): + """Sets the plan_id of this PlaceDualInvestmentOrder. + + Plan ID # noqa: E501 + + :param plan_id: The plan_id of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and plan_id is None: # noqa: E501 + raise ValueError("Invalid value for `plan_id`, must not be `None`") # noqa: E501 + + self._plan_id = plan_id + + @property + def copies(self): + """Gets the copies of this PlaceDualInvestmentOrder. # noqa: E501 + + Copies # noqa: E501 + + :return: The copies of this PlaceDualInvestmentOrder. # noqa: E501 + :rtype: str + """ + return self._copies + + @copies.setter + def copies(self, copies): + """Sets the copies of this PlaceDualInvestmentOrder. + + Copies # noqa: E501 + + :param copies: The copies of this PlaceDualInvestmentOrder. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and copies is None: # noqa: E501 + raise ValueError("Invalid value for `copies`, must not be `None`") # noqa: E501 + + self._copies = copies + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, PlaceDualInvestmentOrder): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, PlaceDualInvestmentOrder): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/spot_price_put_order.py b/gate_api/models/spot_price_put_order.py index 49e1635..3491767 100644 --- a/gate_api/models/spot_price_put_order.py +++ b/gate_api/models/spot_price_put_order.py @@ -87,7 +87,7 @@ def __init__( def type(self): """Gets the type of this SpotPricePutOrder. # noqa: E501 - Order type, default to `limit` # noqa: E501 + Order type,default to `limit` - limit : Limit Order - market : Market Order # noqa: E501 :return: The type of this SpotPricePutOrder. # noqa: E501 :rtype: str @@ -98,11 +98,16 @@ def type(self): def type(self, type): """Sets the type of this SpotPricePutOrder. - Order type, default to `limit` # noqa: E501 + Order type,default to `limit` - limit : Limit Order - market : Market Order # noqa: E501 :param type: The type of this SpotPricePutOrder. # noqa: E501 :type: str """ + allowed_values = ["limit", "market"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values) # noqa: E501 + ) self._type = type @@ -165,7 +170,7 @@ def price(self, price): def amount(self): """Gets the amount of this SpotPricePutOrder. # noqa: E501 - Order amount # noqa: E501 + When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` # noqa: E501 :return: The amount of this SpotPricePutOrder. # noqa: E501 :rtype: str @@ -176,7 +181,7 @@ def amount(self): def amount(self, amount): """Sets the amount of this SpotPricePutOrder. - Order amount # noqa: E501 + When `type` is limit, it refers to base currency. For instance, `BTC_USDT` means `BTC` When `type` is `market`, it refers to different currency according to `side` - `side` : `buy` means quote currency, `BTC_USDT` means `USDT` - `side` : `sell` means base currency,`BTC_USDT` means `BTC` # noqa: E501 :param amount: The amount of this SpotPricePutOrder. # noqa: E501 :type: str diff --git a/gate_api/models/structured_buy.py b/gate_api/models/structured_buy.py new file mode 100644 index 0000000..1e43365 --- /dev/null +++ b/gate_api/models/structured_buy.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StructuredBuy(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'pid': 'str', 'amount': 'str'} + + attribute_map = {'pid': 'pid', 'amount': 'amount'} + + def __init__(self, pid=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """StructuredBuy - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._pid = None + self._amount = None + self.discriminator = None + + if pid is not None: + self.pid = pid + if amount is not None: + self.amount = amount + + @property + def pid(self): + """Gets the pid of this StructuredBuy. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The pid of this StructuredBuy. # noqa: E501 + :rtype: str + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this StructuredBuy. + + Plan ID # noqa: E501 + + :param pid: The pid of this StructuredBuy. # noqa: E501 + :type: str + """ + + self._pid = pid + + @property + def amount(self): + """Gets the amount of this StructuredBuy. # noqa: E501 + + Purchase Amount # noqa: E501 + + :return: The amount of this StructuredBuy. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this StructuredBuy. + + Purchase Amount # noqa: E501 + + :param amount: The amount of this StructuredBuy. # noqa: E501 + :type: str + """ + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StructuredBuy): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StructuredBuy): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_get_project_list.py b/gate_api/models/structured_get_project_list.py new file mode 100644 index 0000000..0db5533 --- /dev/null +++ b/gate_api/models/structured_get_project_list.py @@ -0,0 +1,444 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StructuredGetProjectList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'type': 'str', + 'name_en': 'str', + 'investment_coin': 'str', + 'investment_period': 'str', + 'min_annual_rate': 'str', + 'mid_annual_rate': 'str', + 'max_annual_rate': 'str', + 'watch_market': 'str', + 'start_time': 'int', + 'end_time': 'int', + 'status': 'str', + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'name_en': 'name_en', + 'investment_coin': 'investment_coin', + 'investment_period': 'investment_period', + 'min_annual_rate': 'min_annual_rate', + 'mid_annual_rate': 'mid_annual_rate', + 'max_annual_rate': 'max_annual_rate', + 'watch_market': 'watch_market', + 'start_time': 'start_time', + 'end_time': 'end_time', + 'status': 'status', + } + + def __init__( + self, + id=None, + type=None, + name_en=None, + investment_coin=None, + investment_period=None, + min_annual_rate=None, + mid_annual_rate=None, + max_annual_rate=None, + watch_market=None, + start_time=None, + end_time=None, + status=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, str, str, str, str, str, str, str, str, int, int, str, Configuration) -> None + """StructuredGetProjectList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._type = None + self._name_en = None + self._investment_coin = None + self._investment_period = None + self._min_annual_rate = None + self._mid_annual_rate = None + self._max_annual_rate = None + self._watch_market = None + self._start_time = None + self._end_time = None + self._status = None + self.discriminator = None + + if id is not None: + self.id = id + if type is not None: + self.type = type + if name_en is not None: + self.name_en = name_en + if investment_coin is not None: + self.investment_coin = investment_coin + if investment_period is not None: + self.investment_period = investment_period + if min_annual_rate is not None: + self.min_annual_rate = min_annual_rate + if mid_annual_rate is not None: + self.mid_annual_rate = mid_annual_rate + if max_annual_rate is not None: + self.max_annual_rate = max_annual_rate + if watch_market is not None: + self.watch_market = watch_market + if start_time is not None: + self.start_time = start_time + if end_time is not None: + self.end_time = end_time + if status is not None: + self.status = status + + @property + def id(self): + """Gets the id of this StructuredGetProjectList. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The id of this StructuredGetProjectList. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StructuredGetProjectList. + + Plan ID # noqa: E501 + + :param id: The id of this StructuredGetProjectList. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def type(self): + """Gets the type of this StructuredGetProjectList. # noqa: E501 + + product type: `SharkFin2.0`-Shark Fin2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball # noqa: E501 + + :return: The type of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this StructuredGetProjectList. + + product type: `SharkFin2.0`-Shark Fin2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-Range Accrual `SnowBall`-Snow Ball # noqa: E501 + + :param type: The type of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def name_en(self): + """Gets the name_en of this StructuredGetProjectList. # noqa: E501 + + name # noqa: E501 + + :return: The name_en of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._name_en + + @name_en.setter + def name_en(self, name_en): + """Sets the name_en of this StructuredGetProjectList. + + name # noqa: E501 + + :param name_en: The name_en of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._name_en = name_en + + @property + def investment_coin(self): + """Gets the investment_coin of this StructuredGetProjectList. # noqa: E501 + + Investment Currency # noqa: E501 + + :return: The investment_coin of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._investment_coin + + @investment_coin.setter + def investment_coin(self, investment_coin): + """Sets the investment_coin of this StructuredGetProjectList. + + Investment Currency # noqa: E501 + + :param investment_coin: The investment_coin of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._investment_coin = investment_coin + + @property + def investment_period(self): + """Gets the investment_period of this StructuredGetProjectList. # noqa: E501 + + Investment term # noqa: E501 + + :return: The investment_period of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._investment_period + + @investment_period.setter + def investment_period(self, investment_period): + """Sets the investment_period of this StructuredGetProjectList. + + Investment term # noqa: E501 + + :param investment_period: The investment_period of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._investment_period = investment_period + + @property + def min_annual_rate(self): + """Gets the min_annual_rate of this StructuredGetProjectList. # noqa: E501 + + Minimum annual rate # noqa: E501 + + :return: The min_annual_rate of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._min_annual_rate + + @min_annual_rate.setter + def min_annual_rate(self, min_annual_rate): + """Sets the min_annual_rate of this StructuredGetProjectList. + + Minimum annual rate # noqa: E501 + + :param min_annual_rate: The min_annual_rate of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._min_annual_rate = min_annual_rate + + @property + def mid_annual_rate(self): + """Gets the mid_annual_rate of this StructuredGetProjectList. # noqa: E501 + + Intermediate annual rate # noqa: E501 + + :return: The mid_annual_rate of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._mid_annual_rate + + @mid_annual_rate.setter + def mid_annual_rate(self, mid_annual_rate): + """Sets the mid_annual_rate of this StructuredGetProjectList. + + Intermediate annual rate # noqa: E501 + + :param mid_annual_rate: The mid_annual_rate of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._mid_annual_rate = mid_annual_rate + + @property + def max_annual_rate(self): + """Gets the max_annual_rate of this StructuredGetProjectList. # noqa: E501 + + Maximum annual rate # noqa: E501 + + :return: The max_annual_rate of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._max_annual_rate + + @max_annual_rate.setter + def max_annual_rate(self, max_annual_rate): + """Sets the max_annual_rate of this StructuredGetProjectList. + + Maximum annual rate # noqa: E501 + + :param max_annual_rate: The max_annual_rate of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._max_annual_rate = max_annual_rate + + @property + def watch_market(self): + """Gets the watch_market of this StructuredGetProjectList. # noqa: E501 + + Watch market # noqa: E501 + + :return: The watch_market of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._watch_market + + @watch_market.setter + def watch_market(self, watch_market): + """Sets the watch_market of this StructuredGetProjectList. + + Watch market # noqa: E501 + + :param watch_market: The watch_market of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._watch_market = watch_market + + @property + def start_time(self): + """Gets the start_time of this StructuredGetProjectList. # noqa: E501 + + start time # noqa: E501 + + :return: The start_time of this StructuredGetProjectList. # noqa: E501 + :rtype: int + """ + return self._start_time + + @start_time.setter + def start_time(self, start_time): + """Sets the start_time of this StructuredGetProjectList. + + start time # noqa: E501 + + :param start_time: The start_time of this StructuredGetProjectList. # noqa: E501 + :type: int + """ + + self._start_time = start_time + + @property + def end_time(self): + """Gets the end_time of this StructuredGetProjectList. # noqa: E501 + + Finished time # noqa: E501 + + :return: The end_time of this StructuredGetProjectList. # noqa: E501 + :rtype: int + """ + return self._end_time + + @end_time.setter + def end_time(self, end_time): + """Sets the end_time of this StructuredGetProjectList. + + Finished time # noqa: E501 + + :param end_time: The end_time of this StructuredGetProjectList. # noqa: E501 + :type: int + """ + + self._end_time = end_time + + @property + def status(self): + """Gets the status of this StructuredGetProjectList. # noqa: E501 + + Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 + + :return: The status of this StructuredGetProjectList. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this StructuredGetProjectList. + + Status: `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 + + :param status: The status of this StructuredGetProjectList. # noqa: E501 + :type: str + """ + + self._status = status + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StructuredGetProjectList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StructuredGetProjectList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_get_project_list_request.py b/gate_api/models/structured_get_project_list_request.py new file mode 100644 index 0000000..a395949 --- /dev/null +++ b/gate_api/models/structured_get_project_list_request.py @@ -0,0 +1,195 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StructuredGetProjectListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'type': 'str', 'status': 'str', 'page': 'int', 'limit': 'int'} + + attribute_map = {'type': 'type', 'status': 'status', 'page': 'page', 'limit': 'limit'} + + def __init__(self, type=None, status=None, page=None, limit=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, int, int, Configuration) -> None + """StructuredGetProjectListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._type = None + self._status = None + self._page = None + self._limit = None + self.discriminator = None + + if type is not None: + self.type = type + if status is not None: + self.status = status + if page is not None: + self.page = page + if limit is not None: + self.limit = limit + + @property + def type(self): + """Gets the type of this StructuredGetProjectListRequest. # noqa: E501 + + Product Type, default to empty for querying all. `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-RangeAccrual `SnowBall`-Snow Ball # noqa: E501 + + :return: The type of this StructuredGetProjectListRequest. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this StructuredGetProjectListRequest. + + Product Type, default to empty for querying all. `SharkFin2.0`-Shark Fin 2.0 `BullishSharkFin`-Bullish Shark Fin `BearishSharkFin`-Bearish Shark Fin `DoubleNoTouch`-Double No-Touch `RangeAccrual`-RangeAccrual `SnowBall`-Snow Ball # noqa: E501 + + :param type: The type of this StructuredGetProjectListRequest. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def status(self): + """Gets the status of this StructuredGetProjectListRequest. # noqa: E501 + + Status: default to empty for querying all. `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 + + :return: The status of this StructuredGetProjectListRequest. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this StructuredGetProjectListRequest. + + Status: default to empty for querying all. `in_process`-in progress `will_begin`-will begin `wait_settlement`-waiting for settlement `done`-done # noqa: E501 + + :param status: The status of this StructuredGetProjectListRequest. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def page(self): + """Gets the page of this StructuredGetProjectListRequest. # noqa: E501 + + Page number # noqa: E501 + + :return: The page of this StructuredGetProjectListRequest. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this StructuredGetProjectListRequest. + + Page number # noqa: E501 + + :param page: The page of this StructuredGetProjectListRequest. # noqa: E501 + :type: int + """ + + self._page = page + + @property + def limit(self): + """Gets the limit of this StructuredGetProjectListRequest. # noqa: E501 + + Number of items returned in the list. Default is 100. # noqa: E501 + + :return: The limit of this StructuredGetProjectListRequest. # noqa: E501 + :rtype: int + """ + return self._limit + + @limit.setter + def limit(self, limit): + """Sets the limit of this StructuredGetProjectListRequest. + + Number of items returned in the list. Default is 100. # noqa: E501 + + :param limit: The limit of this StructuredGetProjectListRequest. # noqa: E501 + :type: int + """ + + self._limit = limit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StructuredGetProjectListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StructuredGetProjectListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_order_list.py b/gate_api/models/structured_order_list.py new file mode 100644 index 0000000..8abd031 --- /dev/null +++ b/gate_api/models/structured_order_list.py @@ -0,0 +1,299 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StructuredOrderList(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'pid': 'str', + 'lock_coin': 'str', + 'amount': 'str', + 'status': 'str', + 'income': 'str', + 'create_time': 'int', + } + + attribute_map = { + 'id': 'id', + 'pid': 'pid', + 'lock_coin': 'lock_coin', + 'amount': 'amount', + 'status': 'status', + 'income': 'income', + 'create_time': 'create_time', + } + + def __init__( + self, + id=None, + pid=None, + lock_coin=None, + amount=None, + status=None, + income=None, + create_time=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, str, str, str, str, str, int, Configuration) -> None + """StructuredOrderList - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._pid = None + self._lock_coin = None + self._amount = None + self._status = None + self._income = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + if pid is not None: + self.pid = pid + if lock_coin is not None: + self.lock_coin = lock_coin + if amount is not None: + self.amount = amount + if status is not None: + self.status = status + if income is not None: + self.income = income + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this StructuredOrderList. # noqa: E501 + + Order ID # noqa: E501 + + :return: The id of this StructuredOrderList. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this StructuredOrderList. + + Order ID # noqa: E501 + + :param id: The id of this StructuredOrderList. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def pid(self): + """Gets the pid of this StructuredOrderList. # noqa: E501 + + Plan ID # noqa: E501 + + :return: The pid of this StructuredOrderList. # noqa: E501 + :rtype: str + """ + return self._pid + + @pid.setter + def pid(self, pid): + """Sets the pid of this StructuredOrderList. + + Plan ID # noqa: E501 + + :param pid: The pid of this StructuredOrderList. # noqa: E501 + :type: str + """ + + self._pid = pid + + @property + def lock_coin(self): + """Gets the lock_coin of this StructuredOrderList. # noqa: E501 + + Locked coin # noqa: E501 + + :return: The lock_coin of this StructuredOrderList. # noqa: E501 + :rtype: str + """ + return self._lock_coin + + @lock_coin.setter + def lock_coin(self, lock_coin): + """Sets the lock_coin of this StructuredOrderList. + + Locked coin # noqa: E501 + + :param lock_coin: The lock_coin of this StructuredOrderList. # noqa: E501 + :type: str + """ + + self._lock_coin = lock_coin + + @property + def amount(self): + """Gets the amount of this StructuredOrderList. # noqa: E501 + + Locked amount # noqa: E501 + + :return: The amount of this StructuredOrderList. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this StructuredOrderList. + + Locked amount # noqa: E501 + + :param amount: The amount of this StructuredOrderList. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def status(self): + """Gets the status of this StructuredOrderList. # noqa: E501 + + Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE # noqa: E501 + + :return: The status of this StructuredOrderList. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this StructuredOrderList. + + Status: SUCCESS - SUCCESS FAILED - FAILED DONE - DONE # noqa: E501 + + :param status: The status of this StructuredOrderList. # noqa: E501 + :type: str + """ + + self._status = status + + @property + def income(self): + """Gets the income of this StructuredOrderList. # noqa: E501 + + Income # noqa: E501 + + :return: The income of this StructuredOrderList. # noqa: E501 + :rtype: str + """ + return self._income + + @income.setter + def income(self, income): + """Sets the income of this StructuredOrderList. + + Income # noqa: E501 + + :param income: The income of this StructuredOrderList. # noqa: E501 + :type: str + """ + + self._income = income + + @property + def create_time(self): + """Gets the create_time of this StructuredOrderList. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this StructuredOrderList. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this StructuredOrderList. + + Created time # noqa: E501 + + :param create_time: The create_time of this StructuredOrderList. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StructuredOrderList): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StructuredOrderList): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/structured_order_list_request.py b/gate_api/models/structured_order_list_request.py new file mode 100644 index 0000000..bb9a76e --- /dev/null +++ b/gate_api/models/structured_order_list_request.py @@ -0,0 +1,197 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class StructuredOrderListRequest(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'_from': 'int', 'to': 'int', 'page': 'int', 'limit': 'int'} + + attribute_map = {'_from': 'from', 'to': 'to', 'page': 'page', 'limit': 'limit'} + + def __init__(self, _from=None, to=None, page=None, limit=None, local_vars_configuration=None): # noqa: E501 + # type: (int, int, int, int, Configuration) -> None + """StructuredOrderListRequest - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self.__from = None + self._to = None + self._page = None + self._limit = None + self.discriminator = None + + self._from = _from + self.to = to + if page is not None: + self.page = page + if limit is not None: + self.limit = limit + + @property + def _from(self): + """Gets the _from of this StructuredOrderListRequest. # noqa: E501 + + start time # noqa: E501 + + :return: The _from of this StructuredOrderListRequest. # noqa: E501 + :rtype: int + """ + return self.__from + + @_from.setter + def _from(self, _from): + """Sets the _from of this StructuredOrderListRequest. + + start time # noqa: E501 + + :param _from: The _from of this StructuredOrderListRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and _from is None: # noqa: E501 + raise ValueError("Invalid value for `_from`, must not be `None`") # noqa: E501 + + self.__from = _from + + @property + def to(self): + """Gets the to of this StructuredOrderListRequest. # noqa: E501 + + Finished time # noqa: E501 + + :return: The to of this StructuredOrderListRequest. # noqa: E501 + :rtype: int + """ + return self._to + + @to.setter + def to(self, to): + """Sets the to of this StructuredOrderListRequest. + + Finished time # noqa: E501 + + :param to: The to of this StructuredOrderListRequest. # noqa: E501 + :type: int + """ + if self.local_vars_configuration.client_side_validation and to is None: # noqa: E501 + raise ValueError("Invalid value for `to`, must not be `None`") # noqa: E501 + + self._to = to + + @property + def page(self): + """Gets the page of this StructuredOrderListRequest. # noqa: E501 + + Page number # noqa: E501 + + :return: The page of this StructuredOrderListRequest. # noqa: E501 + :rtype: int + """ + return self._page + + @page.setter + def page(self, page): + """Sets the page of this StructuredOrderListRequest. + + Page number # noqa: E501 + + :param page: The page of this StructuredOrderListRequest. # noqa: E501 + :type: int + """ + + self._page = page + + @property + def limit(self): + """Gets the limit of this StructuredOrderListRequest. # noqa: E501 + + Number of items returned in the list. Default is 100. # noqa: E501 + + :return: The limit of this StructuredOrderListRequest. # noqa: E501 + :rtype: int + """ + return self._limit + + @limit.setter + def limit(self, limit): + """Sets the limit of this StructuredOrderListRequest. + + Number of items returned in the list. Default is 100. # noqa: E501 + + :param limit: The limit of this StructuredOrderListRequest. # noqa: E501 + :type: int + """ + + self._limit = limit + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, StructuredOrderListRequest): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, StructuredOrderListRequest): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_account.py b/gate_api/models/unified_account.py new file mode 100644 index 0000000..34c86b5 --- /dev/null +++ b/gate_api/models/unified_account.py @@ -0,0 +1,558 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedAccount(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'user_id': 'int', + 'refresh_time': 'int', + 'locked': 'bool', + 'balances': 'dict(str, UnifiedBalance)', + 'total': 'str', + 'borrowed': 'str', + 'total_initial_margin': 'str', + 'total_margin_balance': 'str', + 'total_maintenance_margin': 'str', + 'total_initial_margin_rate': 'str', + 'total_maintenance_margin_rate': 'str', + 'total_available_margin': 'str', + 'unified_account_total': 'str', + 'unified_account_total_liab': 'str', + 'unified_account_total_equity': 'str', + 'leverage': 'str', + } + + attribute_map = { + 'user_id': 'user_id', + 'refresh_time': 'refresh_time', + 'locked': 'locked', + 'balances': 'balances', + 'total': 'total', + 'borrowed': 'borrowed', + 'total_initial_margin': 'total_initial_margin', + 'total_margin_balance': 'total_margin_balance', + 'total_maintenance_margin': 'total_maintenance_margin', + 'total_initial_margin_rate': 'total_initial_margin_rate', + 'total_maintenance_margin_rate': 'total_maintenance_margin_rate', + 'total_available_margin': 'total_available_margin', + 'unified_account_total': 'unified_account_total', + 'unified_account_total_liab': 'unified_account_total_liab', + 'unified_account_total_equity': 'unified_account_total_equity', + 'leverage': 'leverage', + } + + def __init__( + self, + user_id=None, + refresh_time=None, + locked=None, + balances=None, + total=None, + borrowed=None, + total_initial_margin=None, + total_margin_balance=None, + total_maintenance_margin=None, + total_initial_margin_rate=None, + total_maintenance_margin_rate=None, + total_available_margin=None, + unified_account_total=None, + unified_account_total_liab=None, + unified_account_total_equity=None, + leverage=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, int, bool, dict(str, UnifiedBalance), str, str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """UnifiedAccount - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._user_id = None + self._refresh_time = None + self._locked = None + self._balances = None + self._total = None + self._borrowed = None + self._total_initial_margin = None + self._total_margin_balance = None + self._total_maintenance_margin = None + self._total_initial_margin_rate = None + self._total_maintenance_margin_rate = None + self._total_available_margin = None + self._unified_account_total = None + self._unified_account_total_liab = None + self._unified_account_total_equity = None + self._leverage = None + self.discriminator = None + + if user_id is not None: + self.user_id = user_id + if refresh_time is not None: + self.refresh_time = refresh_time + if locked is not None: + self.locked = locked + if balances is not None: + self.balances = balances + if total is not None: + self.total = total + if borrowed is not None: + self.borrowed = borrowed + if total_initial_margin is not None: + self.total_initial_margin = total_initial_margin + if total_margin_balance is not None: + self.total_margin_balance = total_margin_balance + if total_maintenance_margin is not None: + self.total_maintenance_margin = total_maintenance_margin + if total_initial_margin_rate is not None: + self.total_initial_margin_rate = total_initial_margin_rate + if total_maintenance_margin_rate is not None: + self.total_maintenance_margin_rate = total_maintenance_margin_rate + if total_available_margin is not None: + self.total_available_margin = total_available_margin + if unified_account_total is not None: + self.unified_account_total = unified_account_total + if unified_account_total_liab is not None: + self.unified_account_total_liab = unified_account_total_liab + if unified_account_total_equity is not None: + self.unified_account_total_equity = unified_account_total_equity + if leverage is not None: + self.leverage = leverage + + @property + def user_id(self): + """Gets the user_id of this UnifiedAccount. # noqa: E501 + + User ID # noqa: E501 + + :return: The user_id of this UnifiedAccount. # noqa: E501 + :rtype: int + """ + return self._user_id + + @user_id.setter + def user_id(self, user_id): + """Sets the user_id of this UnifiedAccount. + + User ID # noqa: E501 + + :param user_id: The user_id of this UnifiedAccount. # noqa: E501 + :type: int + """ + + self._user_id = user_id + + @property + def refresh_time(self): + """Gets the refresh_time of this UnifiedAccount. # noqa: E501 + + Time of the most recent refresh # noqa: E501 + + :return: The refresh_time of this UnifiedAccount. # noqa: E501 + :rtype: int + """ + return self._refresh_time + + @refresh_time.setter + def refresh_time(self, refresh_time): + """Sets the refresh_time of this UnifiedAccount. + + Time of the most recent refresh # noqa: E501 + + :param refresh_time: The refresh_time of this UnifiedAccount. # noqa: E501 + :type: int + """ + + self._refresh_time = refresh_time + + @property + def locked(self): + """Gets the locked of this UnifiedAccount. # noqa: E501 + + Whether account is locked # noqa: E501 + + :return: The locked of this UnifiedAccount. # noqa: E501 + :rtype: bool + """ + return self._locked + + @locked.setter + def locked(self, locked): + """Sets the locked of this UnifiedAccount. + + Whether account is locked # noqa: E501 + + :param locked: The locked of this UnifiedAccount. # noqa: E501 + :type: bool + """ + + self._locked = locked + + @property + def balances(self): + """Gets the balances of this UnifiedAccount. # noqa: E501 + + + :return: The balances of this UnifiedAccount. # noqa: E501 + :rtype: dict(str, UnifiedBalance) + """ + return self._balances + + @balances.setter + def balances(self, balances): + """Sets the balances of this UnifiedAccount. + + + :param balances: The balances of this UnifiedAccount. # noqa: E501 + :type: dict(str, UnifiedBalance) + """ + + self._balances = balances + + @property + def total(self): + """Gets the total of this UnifiedAccount. # noqa: E501 + + The total asset value in USDT. Sum of `(available + freeze) * price` # noqa: E501 + + :return: The total of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total + + @total.setter + def total(self, total): + """Sets the total of this UnifiedAccount. + + The total asset value in USDT. Sum of `(available + freeze) * price` # noqa: E501 + + :param total: The total of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total = total + + @property + def borrowed(self): + """Gets the borrowed of this UnifiedAccount. # noqa: E501 + + The total borrowed amount in USDT equivalent. Sum of `borrowed * price` # noqa: E501 + + :return: The borrowed of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this UnifiedAccount. + + The total borrowed amount in USDT equivalent. Sum of `borrowed * price` # noqa: E501 + + :param borrowed: The borrowed of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + def total_initial_margin(self): + """Gets the total_initial_margin of this UnifiedAccount. # noqa: E501 + + Total initial margin # noqa: E501 + + :return: The total_initial_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin + + @total_initial_margin.setter + def total_initial_margin(self, total_initial_margin): + """Sets the total_initial_margin of this UnifiedAccount. + + Total initial margin # noqa: E501 + + :param total_initial_margin: The total_initial_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin = total_initial_margin + + @property + def total_margin_balance(self): + """Gets the total_margin_balance of this UnifiedAccount. # noqa: E501 + + Total margin balance # noqa: E501 + + :return: The total_margin_balance of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_margin_balance + + @total_margin_balance.setter + def total_margin_balance(self, total_margin_balance): + """Sets the total_margin_balance of this UnifiedAccount. + + Total margin balance # noqa: E501 + + :param total_margin_balance: The total_margin_balance of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_margin_balance = total_margin_balance + + @property + def total_maintenance_margin(self): + """Gets the total_maintenance_margin of this UnifiedAccount. # noqa: E501 + + Total maintenance margin # noqa: E501 + + :return: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin + + @total_maintenance_margin.setter + def total_maintenance_margin(self, total_maintenance_margin): + """Sets the total_maintenance_margin of this UnifiedAccount. + + Total maintenance margin # noqa: E501 + + :param total_maintenance_margin: The total_maintenance_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin = total_maintenance_margin + + @property + def total_initial_margin_rate(self): + """Gets the total_initial_margin_rate of this UnifiedAccount. # noqa: E501 + + Total initial margin rate # noqa: E501 + + :return: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_initial_margin_rate + + @total_initial_margin_rate.setter + def total_initial_margin_rate(self, total_initial_margin_rate): + """Sets the total_initial_margin_rate of this UnifiedAccount. + + Total initial margin rate # noqa: E501 + + :param total_initial_margin_rate: The total_initial_margin_rate of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_initial_margin_rate = total_initial_margin_rate + + @property + def total_maintenance_margin_rate(self): + """Gets the total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 + + Total maintenance margin rate # noqa: E501 + + :return: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_maintenance_margin_rate + + @total_maintenance_margin_rate.setter + def total_maintenance_margin_rate(self, total_maintenance_margin_rate): + """Sets the total_maintenance_margin_rate of this UnifiedAccount. + + Total maintenance margin rate # noqa: E501 + + :param total_maintenance_margin_rate: The total_maintenance_margin_rate of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_maintenance_margin_rate = total_maintenance_margin_rate + + @property + def total_available_margin(self): + """Gets the total_available_margin of this UnifiedAccount. # noqa: E501 + + Total available margin # noqa: E501 + + :return: The total_available_margin of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._total_available_margin + + @total_available_margin.setter + def total_available_margin(self, total_available_margin): + """Sets the total_available_margin of this UnifiedAccount. + + Total available margin # noqa: E501 + + :param total_available_margin: The total_available_margin of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._total_available_margin = total_available_margin + + @property + def unified_account_total(self): + """Gets the unified_account_total of this UnifiedAccount. # noqa: E501 + + Total amount of the portfolio margin account # noqa: E501 + + :return: The unified_account_total of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total + + @unified_account_total.setter + def unified_account_total(self, unified_account_total): + """Sets the unified_account_total of this UnifiedAccount. + + Total amount of the portfolio margin account # noqa: E501 + + :param unified_account_total: The unified_account_total of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total = unified_account_total + + @property + def unified_account_total_liab(self): + """Gets the unified_account_total_liab of this UnifiedAccount. # noqa: E501 + + Total liabilities of the portfolio margin account # noqa: E501 + + :return: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total_liab + + @unified_account_total_liab.setter + def unified_account_total_liab(self, unified_account_total_liab): + """Sets the unified_account_total_liab of this UnifiedAccount. + + Total liabilities of the portfolio margin account # noqa: E501 + + :param unified_account_total_liab: The unified_account_total_liab of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total_liab = unified_account_total_liab + + @property + def unified_account_total_equity(self): + """Gets the unified_account_total_equity of this UnifiedAccount. # noqa: E501 + + Total equity of the portfolio margin account # noqa: E501 + + :return: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._unified_account_total_equity + + @unified_account_total_equity.setter + def unified_account_total_equity(self, unified_account_total_equity): + """Sets the unified_account_total_equity of this UnifiedAccount. + + Total equity of the portfolio margin account # noqa: E501 + + :param unified_account_total_equity: The unified_account_total_equity of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._unified_account_total_equity = unified_account_total_equity + + @property + def leverage(self): + """Gets the leverage of this UnifiedAccount. # noqa: E501 + + Leverage # noqa: E501 + + :return: The leverage of this UnifiedAccount. # noqa: E501 + :rtype: str + """ + return self._leverage + + @leverage.setter + def leverage(self, leverage): + """Sets the leverage of this UnifiedAccount. + + Leverage # noqa: E501 + + :param leverage: The leverage of this UnifiedAccount. # noqa: E501 + :type: str + """ + + self._leverage = leverage + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedAccount): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedAccount): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_balance.py b/gate_api/models/unified_balance.py new file mode 100644 index 0000000..87a15ef --- /dev/null +++ b/gate_api/models/unified_balance.py @@ -0,0 +1,328 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedBalance(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'available': 'str', + 'freeze': 'str', + 'borrowed': 'str', + 'negative_liab': 'str', + 'futures_pos_liab': 'str', + 'equity': 'str', + 'total_freeze': 'str', + 'total_liab': 'str', + } + + attribute_map = { + 'available': 'available', + 'freeze': 'freeze', + 'borrowed': 'borrowed', + 'negative_liab': 'negative_liab', + 'futures_pos_liab': 'futures_pos_liab', + 'equity': 'equity', + 'total_freeze': 'total_freeze', + 'total_liab': 'total_liab', + } + + def __init__( + self, + available=None, + freeze=None, + borrowed=None, + negative_liab=None, + futures_pos_liab=None, + equity=None, + total_freeze=None, + total_liab=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, Configuration) -> None + """UnifiedBalance - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._available = None + self._freeze = None + self._borrowed = None + self._negative_liab = None + self._futures_pos_liab = None + self._equity = None + self._total_freeze = None + self._total_liab = None + self.discriminator = None + + if available is not None: + self.available = available + if freeze is not None: + self.freeze = freeze + if borrowed is not None: + self.borrowed = borrowed + if negative_liab is not None: + self.negative_liab = negative_liab + if futures_pos_liab is not None: + self.futures_pos_liab = futures_pos_liab + if equity is not None: + self.equity = equity + if total_freeze is not None: + self.total_freeze = total_freeze + if total_liab is not None: + self.total_liab = total_liab + + @property + def available(self): + """Gets the available of this UnifiedBalance. # noqa: E501 + + Available amount # noqa: E501 + + :return: The available of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._available + + @available.setter + def available(self, available): + """Sets the available of this UnifiedBalance. + + Available amount # noqa: E501 + + :param available: The available of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._available = available + + @property + def freeze(self): + """Gets the freeze of this UnifiedBalance. # noqa: E501 + + Locked amount # noqa: E501 + + :return: The freeze of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._freeze + + @freeze.setter + def freeze(self, freeze): + """Sets the freeze of this UnifiedBalance. + + Locked amount # noqa: E501 + + :param freeze: The freeze of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._freeze = freeze + + @property + def borrowed(self): + """Gets the borrowed of this UnifiedBalance. # noqa: E501 + + Borrowed amount # noqa: E501 + + :return: The borrowed of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._borrowed + + @borrowed.setter + def borrowed(self, borrowed): + """Sets the borrowed of this UnifiedBalance. + + Borrowed amount # noqa: E501 + + :param borrowed: The borrowed of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._borrowed = borrowed + + @property + def negative_liab(self): + """Gets the negative_liab of this UnifiedBalance. # noqa: E501 + + Negative Liabilities # noqa: E501 + + :return: The negative_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._negative_liab + + @negative_liab.setter + def negative_liab(self, negative_liab): + """Sets the negative_liab of this UnifiedBalance. + + Negative Liabilities # noqa: E501 + + :param negative_liab: The negative_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._negative_liab = negative_liab + + @property + def futures_pos_liab(self): + """Gets the futures_pos_liab of this UnifiedBalance. # noqa: E501 + + Borrowing to Open Positions in Futures # noqa: E501 + + :return: The futures_pos_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._futures_pos_liab + + @futures_pos_liab.setter + def futures_pos_liab(self, futures_pos_liab): + """Sets the futures_pos_liab of this UnifiedBalance. + + Borrowing to Open Positions in Futures # noqa: E501 + + :param futures_pos_liab: The futures_pos_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._futures_pos_liab = futures_pos_liab + + @property + def equity(self): + """Gets the equity of this UnifiedBalance. # noqa: E501 + + Equity # noqa: E501 + + :return: The equity of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._equity + + @equity.setter + def equity(self, equity): + """Sets the equity of this UnifiedBalance. + + Equity # noqa: E501 + + :param equity: The equity of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._equity = equity + + @property + def total_freeze(self): + """Gets the total_freeze of this UnifiedBalance. # noqa: E501 + + Total freeze # noqa: E501 + + :return: The total_freeze of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._total_freeze + + @total_freeze.setter + def total_freeze(self, total_freeze): + """Sets the total_freeze of this UnifiedBalance. + + Total freeze # noqa: E501 + + :param total_freeze: The total_freeze of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._total_freeze = total_freeze + + @property + def total_liab(self): + """Gets the total_liab of this UnifiedBalance. # noqa: E501 + + Total liabilities # noqa: E501 + + :return: The total_liab of this UnifiedBalance. # noqa: E501 + :rtype: str + """ + return self._total_liab + + @total_liab.setter + def total_liab(self, total_liab): + """Sets the total_liab of this UnifiedBalance. + + Total liabilities # noqa: E501 + + :param total_liab: The total_liab of this UnifiedBalance. # noqa: E501 + :type: str + """ + + self._total_liab = total_liab + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedBalance): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedBalance): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_borrowable.py b/gate_api/models/unified_borrowable.py new file mode 100644 index 0000000..25adbff --- /dev/null +++ b/gate_api/models/unified_borrowable.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedBorrowable(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'currency': 'str', 'amount': 'str'} + + attribute_map = {'currency': 'currency', 'amount': 'amount'} + + def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UnifiedBorrowable - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._amount = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + + @property + def currency(self): + """Gets the currency of this UnifiedBorrowable. # noqa: E501 + + Currency detail # noqa: E501 + + :return: The currency of this UnifiedBorrowable. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedBorrowable. + + Currency detail # noqa: E501 + + :param currency: The currency of this UnifiedBorrowable. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UnifiedBorrowable. # noqa: E501 + + Max borrowable amount # noqa: E501 + + :return: The amount of this UnifiedBorrowable. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedBorrowable. + + Max borrowable amount # noqa: E501 + + :param amount: The amount of this UnifiedBorrowable. # noqa: E501 + :type: str + """ + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedBorrowable): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedBorrowable): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_loan.py b/gate_api/models/unified_loan.py new file mode 100644 index 0000000..c2efd65 --- /dev/null +++ b/gate_api/models/unified_loan.py @@ -0,0 +1,237 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedLoan(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'currency': 'str', 'type': 'str', 'amount': 'str', 'repaid_all': 'bool', 'text': 'str'} + + attribute_map = { + 'currency': 'currency', + 'type': 'type', + 'amount': 'amount', + 'repaid_all': 'repaid_all', + 'text': 'text', + } + + def __init__( + self, currency=None, type=None, amount=None, repaid_all=None, text=None, local_vars_configuration=None + ): # noqa: E501 + # type: (str, str, str, bool, str, Configuration) -> None + """UnifiedLoan - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._type = None + self._amount = None + self._repaid_all = None + self._text = None + self.discriminator = None + + self.currency = currency + self.type = type + self.amount = amount + if repaid_all is not None: + self.repaid_all = repaid_all + if text is not None: + self.text = text + + @property + def currency(self): + """Gets the currency of this UnifiedLoan. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedLoan. + + Currency # noqa: E501 + + :param currency: The currency of this UnifiedLoan. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def type(self): + """Gets the type of this UnifiedLoan. # noqa: E501 + + type: borrow - borrow, repay - repay # noqa: E501 + + :return: The type of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UnifiedLoan. + + type: borrow - borrow, repay - repay # noqa: E501 + + :param type: The type of this UnifiedLoan. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and type is None: # noqa: E501 + raise ValueError("Invalid value for `type`, must not be `None`") # noqa: E501 + allowed_values = ["borrow", "repay"] # noqa: E501 + if self.local_vars_configuration.client_side_validation and type not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `type` ({0}), must be one of {1}".format(type, allowed_values) # noqa: E501 + ) + + self._type = type + + @property + def amount(self): + """Gets the amount of this UnifiedLoan. # noqa: E501 + + The amount of lending or repaying # noqa: E501 + + :return: The amount of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedLoan. + + The amount of lending or repaying # noqa: E501 + + :param amount: The amount of this UnifiedLoan. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def repaid_all(self): + """Gets the repaid_all of this UnifiedLoan. # noqa: E501 + + Full repayment is solely for repayment operations. When set to 'true,' it overrides the 'amount,' allowing for direct full repayment. # noqa: E501 + + :return: The repaid_all of this UnifiedLoan. # noqa: E501 + :rtype: bool + """ + return self._repaid_all + + @repaid_all.setter + def repaid_all(self, repaid_all): + """Sets the repaid_all of this UnifiedLoan. + + Full repayment is solely for repayment operations. When set to 'true,' it overrides the 'amount,' allowing for direct full repayment. # noqa: E501 + + :param repaid_all: The repaid_all of this UnifiedLoan. # noqa: E501 + :type: bool + """ + + self._repaid_all = repaid_all + + @property + def text(self): + """Gets the text of this UnifiedLoan. # noqa: E501 + + User defined custom ID # noqa: E501 + + :return: The text of this UnifiedLoan. # noqa: E501 + :rtype: str + """ + return self._text + + @text.setter + def text(self, text): + """Sets the text of this UnifiedLoan. + + User defined custom ID # noqa: E501 + + :param text: The text of this UnifiedLoan. # noqa: E501 + :type: str + """ + + self._text = text + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedLoan): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLoan): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_loan_record.py b/gate_api/models/unified_loan_record.py new file mode 100644 index 0000000..42fb136 --- /dev/null +++ b/gate_api/models/unified_loan_record.py @@ -0,0 +1,299 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedLoanRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'int', + 'type': 'str', + 'repayment_type': 'str', + 'currency_pair': 'str', + 'currency': 'str', + 'amount': 'str', + 'create_time': 'int', + } + + attribute_map = { + 'id': 'id', + 'type': 'type', + 'repayment_type': 'repayment_type', + 'currency_pair': 'currency_pair', + 'currency': 'currency', + 'amount': 'amount', + 'create_time': 'create_time', + } + + def __init__( + self, + id=None, + type=None, + repayment_type=None, + currency_pair=None, + currency=None, + amount=None, + create_time=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (int, str, str, str, str, str, int, Configuration) -> None + """UnifiedLoanRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._type = None + self._repayment_type = None + self._currency_pair = None + self._currency = None + self._amount = None + self._create_time = None + self.discriminator = None + + if id is not None: + self.id = id + if type is not None: + self.type = type + if repayment_type is not None: + self.repayment_type = repayment_type + if currency_pair is not None: + self.currency_pair = currency_pair + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + if create_time is not None: + self.create_time = create_time + + @property + def id(self): + """Gets the id of this UnifiedLoanRecord. # noqa: E501 + + id # noqa: E501 + + :return: The id of this UnifiedLoanRecord. # noqa: E501 + :rtype: int + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this UnifiedLoanRecord. + + id # noqa: E501 + + :param id: The id of this UnifiedLoanRecord. # noqa: E501 + :type: int + """ + + self._id = id + + @property + def type(self): + """Gets the type of this UnifiedLoanRecord. # noqa: E501 + + type: borrow - borrow, repay - repay # noqa: E501 + + :return: The type of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._type + + @type.setter + def type(self, type): + """Sets the type of this UnifiedLoanRecord. + + type: borrow - borrow, repay - repay # noqa: E501 + + :param type: The type of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._type = type + + @property + def repayment_type(self): + """Gets the repayment_type of this UnifiedLoanRecord. # noqa: E501 + + Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment, cancel_auto_repay - automatic repayment after cancellation # noqa: E501 + + :return: The repayment_type of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._repayment_type + + @repayment_type.setter + def repayment_type(self, repayment_type): + """Sets the repayment_type of this UnifiedLoanRecord. + + Repayment type: none - no repayment type, manual_repay - manual repayment, auto_repay - automatic repayment, cancel_auto_repay - automatic repayment after cancellation # noqa: E501 + + :param repayment_type: The repayment_type of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._repayment_type = repayment_type + + @property + def currency_pair(self): + """Gets the currency_pair of this UnifiedLoanRecord. # noqa: E501 + + Currency pair # noqa: E501 + + :return: The currency_pair of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency_pair + + @currency_pair.setter + def currency_pair(self, currency_pair): + """Sets the currency_pair of this UnifiedLoanRecord. + + Currency pair # noqa: E501 + + :param currency_pair: The currency_pair of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._currency_pair = currency_pair + + @property + def currency(self): + """Gets the currency of this UnifiedLoanRecord. # noqa: E501 + + Currency # noqa: E501 + + :return: The currency of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedLoanRecord. + + Currency # noqa: E501 + + :param currency: The currency of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UnifiedLoanRecord. # noqa: E501 + + The amount of lending or repaying # noqa: E501 + + :return: The amount of this UnifiedLoanRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedLoanRecord. + + The amount of lending or repaying # noqa: E501 + + :param amount: The amount of this UnifiedLoanRecord. # noqa: E501 + :type: str + """ + + self._amount = amount + + @property + def create_time(self): + """Gets the create_time of this UnifiedLoanRecord. # noqa: E501 + + Created time # noqa: E501 + + :return: The create_time of this UnifiedLoanRecord. # noqa: E501 + :rtype: int + """ + return self._create_time + + @create_time.setter + def create_time(self, create_time): + """Sets the create_time of this UnifiedLoanRecord. + + Created time # noqa: E501 + + :param create_time: The create_time of this UnifiedLoanRecord. # noqa: E501 + :type: int + """ + + self._create_time = create_time + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedLoanRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedLoanRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_mode.py b/gate_api/models/unified_mode.py new file mode 100644 index 0000000..50dd5a1 --- /dev/null +++ b/gate_api/models/unified_mode.py @@ -0,0 +1,145 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedMode(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'mode': 'str', 'enabled': 'bool'} + + attribute_map = {'mode': 'mode', 'enabled': 'enabled'} + + def __init__(self, mode=None, enabled=None, local_vars_configuration=None): # noqa: E501 + # type: (str, bool, Configuration) -> None + """UnifiedMode - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._mode = None + self._enabled = None + self.discriminator = None + + self.mode = mode + self.enabled = enabled + + @property + def mode(self): + """Gets the mode of this UnifiedMode. # noqa: E501 + + Portfolio mode - cross_margin : cross margin - usdt_futures : usdt futures # noqa: E501 + + :return: The mode of this UnifiedMode. # noqa: E501 + :rtype: str + """ + return self._mode + + @mode.setter + def mode(self, mode): + """Sets the mode of this UnifiedMode. + + Portfolio mode - cross_margin : cross margin - usdt_futures : usdt futures # noqa: E501 + + :param mode: The mode of this UnifiedMode. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and mode is None: # noqa: E501 + raise ValueError("Invalid value for `mode`, must not be `None`") # noqa: E501 + + self._mode = mode + + @property + def enabled(self): + """Gets the enabled of this UnifiedMode. # noqa: E501 + + Is it enabled? # noqa: E501 + + :return: The enabled of this UnifiedMode. # noqa: E501 + :rtype: bool + """ + return self._enabled + + @enabled.setter + def enabled(self, enabled): + """Sets the enabled of this UnifiedMode. + + Is it enabled? # noqa: E501 + + :param enabled: The enabled of this UnifiedMode. # noqa: E501 + :type: bool + """ + if self.local_vars_configuration.client_side_validation and enabled is None: # noqa: E501 + raise ValueError("Invalid value for `enabled`, must not be `None`") # noqa: E501 + + self._enabled = enabled + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedMode): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedMode): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/unified_transferable.py b/gate_api/models/unified_transferable.py new file mode 100644 index 0000000..6d9ba88 --- /dev/null +++ b/gate_api/models/unified_transferable.py @@ -0,0 +1,143 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class UnifiedTransferable(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = {'currency': 'str', 'amount': 'str'} + + attribute_map = {'currency': 'currency', 'amount': 'amount'} + + def __init__(self, currency=None, amount=None, local_vars_configuration=None): # noqa: E501 + # type: (str, str, Configuration) -> None + """UnifiedTransferable - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._currency = None + self._amount = None + self.discriminator = None + + if currency is not None: + self.currency = currency + if amount is not None: + self.amount = amount + + @property + def currency(self): + """Gets the currency of this UnifiedTransferable. # noqa: E501 + + Currency detail # noqa: E501 + + :return: The currency of this UnifiedTransferable. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this UnifiedTransferable. + + Currency detail # noqa: E501 + + :param currency: The currency of this UnifiedTransferable. # noqa: E501 + :type: str + """ + + self._currency = currency + + @property + def amount(self): + """Gets the amount of this UnifiedTransferable. # noqa: E501 + + The maximum amount that can be transferred out # noqa: E501 + + :return: The amount of this UnifiedTransferable. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this UnifiedTransferable. + + The maximum amount that can be transferred out # noqa: E501 + + :param amount: The amount of this UnifiedTransferable. # noqa: E501 + :type: str + """ + + self._amount = amount + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, UnifiedTransferable): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, UnifiedTransferable): + return True + + return self.to_dict() != other.to_dict() diff --git a/gate_api/models/withdraw_status.py b/gate_api/models/withdraw_status.py index 6badeab..229a17d 100644 --- a/gate_api/models/withdraw_status.py +++ b/gate_api/models/withdraw_status.py @@ -44,6 +44,7 @@ class WithdrawStatus(object): 'withdraw_day_limit_remain': 'str', 'withdraw_eachtime_limit': 'str', 'withdraw_fix_on_chains': 'dict(str, str)', + 'withdraw_percent_on_chains': 'dict(str, str)', } attribute_map = { @@ -58,6 +59,7 @@ class WithdrawStatus(object): 'withdraw_day_limit_remain': 'withdraw_day_limit_remain', 'withdraw_eachtime_limit': 'withdraw_eachtime_limit', 'withdraw_fix_on_chains': 'withdraw_fix_on_chains', + 'withdraw_percent_on_chains': 'withdraw_percent_on_chains', } def __init__( @@ -73,9 +75,10 @@ def __init__( withdraw_day_limit_remain=None, withdraw_eachtime_limit=None, withdraw_fix_on_chains=None, + withdraw_percent_on_chains=None, local_vars_configuration=None, ): # noqa: E501 - # type: (str, str, str, str, str, str, str, str, str, str, dict(str, str), Configuration) -> None + # type: (str, str, str, str, str, str, str, str, str, str, dict(str, str), dict(str, str), Configuration) -> None """WithdrawStatus - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() @@ -92,6 +95,7 @@ def __init__( self._withdraw_day_limit_remain = None self._withdraw_eachtime_limit = None self._withdraw_fix_on_chains = None + self._withdraw_percent_on_chains = None self.discriminator = None if currency is not None: @@ -116,6 +120,8 @@ def __init__( self.withdraw_eachtime_limit = withdraw_eachtime_limit if withdraw_fix_on_chains is not None: self.withdraw_fix_on_chains = withdraw_fix_on_chains + if withdraw_percent_on_chains is not None: + self.withdraw_percent_on_chains = withdraw_percent_on_chains @property def currency(self): @@ -370,6 +376,29 @@ def withdraw_fix_on_chains(self, withdraw_fix_on_chains): self._withdraw_fix_on_chains = withdraw_fix_on_chains + @property + def withdraw_percent_on_chains(self): + """Gets the withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + + Percentage withdrawal fee on multiple chains # noqa: E501 + + :return: The withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + :rtype: dict(str, str) + """ + return self._withdraw_percent_on_chains + + @withdraw_percent_on_chains.setter + def withdraw_percent_on_chains(self, withdraw_percent_on_chains): + """Sets the withdraw_percent_on_chains of this WithdrawStatus. + + Percentage withdrawal fee on multiple chains # noqa: E501 + + :param withdraw_percent_on_chains: The withdraw_percent_on_chains of this WithdrawStatus. # noqa: E501 + :type: dict(str, str) + """ + + self._withdraw_percent_on_chains = withdraw_percent_on_chains + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/gate_api/models/withdrawal_record.py b/gate_api/models/withdrawal_record.py new file mode 100644 index 0000000..99275d6 --- /dev/null +++ b/gate_api/models/withdrawal_record.py @@ -0,0 +1,437 @@ +# coding: utf-8 + +""" + Gate API v4 + + Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501 + + Contact: support@mail.gate.io + Generated by: https://openapi-generator.tech +""" + + +import pprint +import re # noqa: F401 + +import six + +from gate_api.configuration import Configuration + + +class WithdrawalRecord(object): + """NOTE: This class is auto generated by OpenAPI Generator. + Ref: https://openapi-generator.tech + + Do not edit the class manually. + """ + + """ + Attributes: + openapi_types (dict): The key is attribute name + and the value is attribute type. + attribute_map (dict): The key is attribute name + and the value is json key in definition. + """ + openapi_types = { + 'id': 'str', + 'txid': 'str', + 'withdraw_order_id': 'str', + 'timestamp': 'str', + 'amount': 'str', + 'fee': 'str', + 'currency': 'str', + 'address': 'str', + 'memo': 'str', + 'status': 'str', + 'chain': 'str', + } + + attribute_map = { + 'id': 'id', + 'txid': 'txid', + 'withdraw_order_id': 'withdraw_order_id', + 'timestamp': 'timestamp', + 'amount': 'amount', + 'fee': 'fee', + 'currency': 'currency', + 'address': 'address', + 'memo': 'memo', + 'status': 'status', + 'chain': 'chain', + } + + def __init__( + self, + id=None, + txid=None, + withdraw_order_id=None, + timestamp=None, + amount=None, + fee=None, + currency=None, + address=None, + memo=None, + status=None, + chain=None, + local_vars_configuration=None, + ): # noqa: E501 + # type: (str, str, str, str, str, str, str, str, str, str, str, Configuration) -> None + """WithdrawalRecord - a model defined in OpenAPI""" # noqa: E501 + if local_vars_configuration is None: + local_vars_configuration = Configuration() + self.local_vars_configuration = local_vars_configuration + + self._id = None + self._txid = None + self._withdraw_order_id = None + self._timestamp = None + self._amount = None + self._fee = None + self._currency = None + self._address = None + self._memo = None + self._status = None + self._chain = None + self.discriminator = None + + if id is not None: + self.id = id + if txid is not None: + self.txid = txid + if withdraw_order_id is not None: + self.withdraw_order_id = withdraw_order_id + if timestamp is not None: + self.timestamp = timestamp + self.amount = amount + if fee is not None: + self.fee = fee + self.currency = currency + if address is not None: + self.address = address + if memo is not None: + self.memo = memo + if status is not None: + self.status = status + self.chain = chain + + @property + def id(self): + """Gets the id of this WithdrawalRecord. # noqa: E501 + + Record ID # noqa: E501 + + :return: The id of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._id + + @id.setter + def id(self, id): + """Sets the id of this WithdrawalRecord. + + Record ID # noqa: E501 + + :param id: The id of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._id = id + + @property + def txid(self): + """Gets the txid of this WithdrawalRecord. # noqa: E501 + + Hash record of the withdrawal # noqa: E501 + + :return: The txid of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._txid + + @txid.setter + def txid(self, txid): + """Sets the txid of this WithdrawalRecord. + + Hash record of the withdrawal # noqa: E501 + + :param txid: The txid of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._txid = txid + + @property + def withdraw_order_id(self): + """Gets the withdraw_order_id of this WithdrawalRecord. # noqa: E501 + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :return: The withdraw_order_id of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._withdraw_order_id + + @withdraw_order_id.setter + def withdraw_order_id(self, withdraw_order_id): + """Sets the withdraw_order_id of this WithdrawalRecord. + + Client order id, up to 32 length and can only include 0-9, A-Z, a-z, underscore(_), hyphen(-) or dot(.) # noqa: E501 + + :param withdraw_order_id: The withdraw_order_id of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._withdraw_order_id = withdraw_order_id + + @property + def timestamp(self): + """Gets the timestamp of this WithdrawalRecord. # noqa: E501 + + Operation time # noqa: E501 + + :return: The timestamp of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._timestamp + + @timestamp.setter + def timestamp(self, timestamp): + """Sets the timestamp of this WithdrawalRecord. + + Operation time # noqa: E501 + + :param timestamp: The timestamp of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._timestamp = timestamp + + @property + def amount(self): + """Gets the amount of this WithdrawalRecord. # noqa: E501 + + Currency amount # noqa: E501 + + :return: The amount of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._amount + + @amount.setter + def amount(self, amount): + """Sets the amount of this WithdrawalRecord. + + Currency amount # noqa: E501 + + :param amount: The amount of this WithdrawalRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and amount is None: # noqa: E501 + raise ValueError("Invalid value for `amount`, must not be `None`") # noqa: E501 + + self._amount = amount + + @property + def fee(self): + """Gets the fee of this WithdrawalRecord. # noqa: E501 + + fee # noqa: E501 + + :return: The fee of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._fee + + @fee.setter + def fee(self, fee): + """Sets the fee of this WithdrawalRecord. + + fee # noqa: E501 + + :param fee: The fee of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._fee = fee + + @property + def currency(self): + """Gets the currency of this WithdrawalRecord. # noqa: E501 + + Currency name # noqa: E501 + + :return: The currency of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._currency + + @currency.setter + def currency(self, currency): + """Sets the currency of this WithdrawalRecord. + + Currency name # noqa: E501 + + :param currency: The currency of this WithdrawalRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and currency is None: # noqa: E501 + raise ValueError("Invalid value for `currency`, must not be `None`") # noqa: E501 + + self._currency = currency + + @property + def address(self): + """Gets the address of this WithdrawalRecord. # noqa: E501 + + Withdrawal address. Required for withdrawals # noqa: E501 + + :return: The address of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._address + + @address.setter + def address(self, address): + """Sets the address of this WithdrawalRecord. + + Withdrawal address. Required for withdrawals # noqa: E501 + + :param address: The address of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._address = address + + @property + def memo(self): + """Gets the memo of this WithdrawalRecord. # noqa: E501 + + Additional remarks with regards to the withdrawal # noqa: E501 + + :return: The memo of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._memo + + @memo.setter + def memo(self, memo): + """Sets the memo of this WithdrawalRecord. + + Additional remarks with regards to the withdrawal # noqa: E501 + + :param memo: The memo of this WithdrawalRecord. # noqa: E501 + :type: str + """ + + self._memo = memo + + @property + def status(self): + """Gets the status of this WithdrawalRecord. # noqa: E501 + + Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount # noqa: E501 + + :return: The status of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._status + + @status.setter + def status(self, status): + """Sets the status of this WithdrawalRecord. + + Record status. - DONE: done - CANCEL: cancelled - REQUEST: requesting - MANUAL: pending manual approval - BCODE: GateCode operation - EXTPEND: pending confirm after sending - FAIL: pending confirm when fail - INVALID: invalid order - VERIFY: verifying - PROCES: processing - PEND: pending - DMOVE: required manual approval - SPLITPEND: the order is automatically split due to large amount # noqa: E501 + + :param status: The status of this WithdrawalRecord. # noqa: E501 + :type: str + """ + allowed_values = [ + "DONE", + "CANCEL", + "REQUEST", + "MANUAL", + "BCODE", + "EXTPEND", + "FAIL", + "INVALID", + "VERIFY", + "PROCES", + "PEND", + "DMOVE", + "SPLITPEND", + ] # noqa: E501 + if self.local_vars_configuration.client_side_validation and status not in allowed_values: # noqa: E501 + raise ValueError( + "Invalid value for `status` ({0}), must be one of {1}".format(status, allowed_values) # noqa: E501 + ) + + self._status = status + + @property + def chain(self): + """Gets the chain of this WithdrawalRecord. # noqa: E501 + + Name of the chain used in withdrawals # noqa: E501 + + :return: The chain of this WithdrawalRecord. # noqa: E501 + :rtype: str + """ + return self._chain + + @chain.setter + def chain(self, chain): + """Sets the chain of this WithdrawalRecord. + + Name of the chain used in withdrawals # noqa: E501 + + :param chain: The chain of this WithdrawalRecord. # noqa: E501 + :type: str + """ + if self.local_vars_configuration.client_side_validation and chain is None: # noqa: E501 + raise ValueError("Invalid value for `chain`, must not be `None`") # noqa: E501 + + self._chain = chain + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.openapi_types): + value = getattr(self, attr) + if isinstance(value, list): + result[attr] = list(map(lambda x: x.to_dict() if hasattr(x, "to_dict") else x, value)) + elif hasattr(value, "to_dict"): + result[attr] = value.to_dict() + elif isinstance(value, dict): + result[attr] = dict( + map( + lambda item: (item[0], item[1].to_dict()) if hasattr(item[1], "to_dict") else item, + value.items(), + ) + ) + else: + result[attr] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, WithdrawalRecord): + return False + + return self.to_dict() == other.to_dict() + + def __ne__(self, other): + """Returns true if both objects are not equal""" + if not isinstance(other, WithdrawalRecord): + return True + + return self.to_dict() != other.to_dict() diff --git a/setup.py b/setup.py index 8450823..a358760 100644 --- a/setup.py +++ b/setup.py @@ -13,7 +13,7 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "gate-api" -VERSION = "4.57.0" +VERSION = "4.60.1" # To install the library, run the following # # python setup.py install