Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v3.12.0 #361

Merged
merged 2 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 3.12.0 - 2025-01-13
### Changed
- Updated documentation links.

### Removed
- Crypto-loans
- `GET /sapi/v1/loan/repay/collateral/rate`

## 3.11.0 - 2024-12-19
### Added
- A new optional parameter `time_unit` can be used to select the time unit.
Expand Down
2 changes: 1 addition & 1 deletion binance/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "3.11.0"
__version__ = "3.12.0"
1 change: 0 additions & 1 deletion binance/spot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ def __init__(self, api_key=None, api_secret=None, **kwargs):
from binance.spot._crypto_loan import loan_vip_repay_history
from binance.spot._crypto_loan import loan_vip_collateral_account
from binance.spot._crypto_loan import loan_loanable_data
from binance.spot._crypto_loan import loan_collateral_rate

# PAY
from binance.spot._pay import pay_history
Expand Down
34 changes: 0 additions & 34 deletions binance/spot/_crypto_loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,37 +179,3 @@ def loan_loanable_data(self, **kwargs):
"""

return self.sign_request("GET", "/sapi/v1/loan/loanable/data", kwargs)


def loan_collateral_rate(
self, loanCoin: str, collateralCoin: str, repayAmount: float, **kwargs
):
"""Check Collateral Repay Rate (USER_DATA)

GET /sapi/v1/loan/repay/collateral/rate

https://developers.binance.com/docs/crypto_loan/stable-rate/market-data/Check-Collateral-Repay-Rate

Args:
loanCoin (str)
collateralCoin (str)
repayAmount (float)
Keyword Args:
recvWindow (int, optional): The value cannot be greater than 60000
"""

check_required_parameters(
[
[loanCoin, "loanCoin"],
[collateralCoin, "collateralCoin"],
[repayAmount, "repayAmount"],
]
)

payload = {
"loanCoin": loanCoin,
"collateralCoin": collateralCoin,
"repayAmount": repayAmount,
**kwargs,
}
return self.sign_request("GET", "/sapi/v1/loan/repay/collateral/rate", payload)
30 changes: 15 additions & 15 deletions binance/spot/_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def ping(self):

GET /api/v3/ping

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-connectivity
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#test-connectivity

"""

Expand All @@ -27,7 +27,7 @@ def time(self):

GET /api/v3/time

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#check-server-time
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#check-server-time

"""

Expand All @@ -43,7 +43,7 @@ def exchange_info(

GET /api/v3/exchangeinfo

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#exchange-information
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/general-endpoints#exchange-information

Args:
symbol (str, optional): the trading pair
Expand Down Expand Up @@ -76,7 +76,7 @@ def depth(self, symbol: str, **kwargs):

GET /api/v3/depth

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#order-book
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#order-book

Args:
symbol (str): the trading pair
Expand All @@ -95,7 +95,7 @@ def trades(self, symbol: str, **kwargs):

GET /api/v3/trades

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#recent-trades-list
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#recent-trades-list

Args:
symbol (str): the trading pair
Expand All @@ -113,7 +113,7 @@ def historical_trades(self, symbol: str, **kwargs):

GET /api/v3/historicalTrades

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#old-trade-lookup
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#old-trade-lookup

Args:
symbol (str): the trading pair
Expand All @@ -131,7 +131,7 @@ def agg_trades(self, symbol: str, **kwargs):

GET /api/v3/aggTrades

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#compressedaggregate-trades-list
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#compressedaggregate-trades-list

Args:
symbol (str): the trading pair
Expand All @@ -152,7 +152,7 @@ def klines(self, symbol: str, interval: str, **kwargs):

GET /api/v3/klines

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#klinecandlestick-data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#klinecandlestick-data

Args:
symbol (str): the trading pair
Expand All @@ -174,7 +174,7 @@ def ui_klines(self, symbol: str, interval: str, **kwargs):

GET /api/v3/uiKlines

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#uiklines
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#uiklines

Args:
symbol (str): the trading pair
Expand All @@ -196,7 +196,7 @@ def avg_price(self, symbol: str):

GET /api/v3/avgPrice

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-average-price
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#current-average-price

Args:
symbol (str): the trading pair
Expand All @@ -214,7 +214,7 @@ def ticker_24hr(self, symbol: str = None, symbols: list = None, **kwargs):

GET /api/v3/ticker/24hr

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#24hr-ticker-price-change-statistics
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#24hr-ticker-price-change-statistics

Args:
symbol (str, optional): the trading pair
Expand All @@ -237,7 +237,7 @@ def trading_day_ticker(self, symbol: str = None, symbols: list = None):

GET /api/v3/ticker/tradingDay

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#trading-day-ticker
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#trading-day-ticker

Args:
symbol (str, optional): Either symbol or symbols must be provided
Expand All @@ -259,7 +259,7 @@ def ticker_price(self, symbol: str = None, symbols: list = None):

GET /api/v3/ticker/price

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-price-ticker
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-price-ticker

Args:
symbol (str, optional): the trading pair
Expand All @@ -278,7 +278,7 @@ def book_ticker(self, symbol: str = None, symbols: list = None):

GET /api/v3/ticker/bookTicker

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#symbol-order-book-ticker
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#symbol-order-book-ticker

Args:
symbol (str, optional): the trading pair
Expand Down Expand Up @@ -307,7 +307,7 @@ def rolling_window_ticker(self, symbol: str = None, symbols: list = None, **kwar

GET /api/v3/ticker

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#rolling-window-price-change-statistics
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/market-data-endpoints#rolling-window-price-change-statistics

Args:
symbol (str, optional): the trading pair
Expand Down
42 changes: 21 additions & 21 deletions binance/spot/_trade.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def new_order_test(self, symbol: str, side: str, type: str, **kwargs):

POST /api/v3/order/test

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#test-new-order-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#test-new-order-trade

Args:
symbol (str)
Expand Down Expand Up @@ -41,7 +41,7 @@ def new_order(self, symbol: str, side: str, type: str, **kwargs):

POST /api/v3/order

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-trade

Args:
symbol (str)
Expand Down Expand Up @@ -75,7 +75,7 @@ def cancel_order(self, symbol: str, **kwargs):

DELETE /api/v3/order

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-trade

Args:
symbol (str)
Expand All @@ -100,7 +100,7 @@ def cancel_open_orders(self, symbol: str, **kwargs):

DELETE api/v3/openOrders

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-all-open-orders-on-a-symbol-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-all-open-orders-on-a-symbol-trade

Args:
symbol (str)
Expand All @@ -121,7 +121,7 @@ def get_order(self, symbol, **kwargs):

GET /api/v3/order

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-user_data

Args:
symbol (str)
Expand Down Expand Up @@ -152,7 +152,7 @@ def cancel_and_replace(

POST /api/v3/order/cancelReplace

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-an-existing-order-and-send-a-new-order-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-an-existing-order-and-send-a-new-order-trade

Args:
symbol (str)
Expand Down Expand Up @@ -206,7 +206,7 @@ def get_open_orders(self, symbol=None, **kwargs):

GET /api/v3/openOrders

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#current-open-orders-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#current-open-orders-user_data

Args:
symbol (str, optional)
Expand All @@ -226,7 +226,7 @@ def get_orders(self, symbol: str, **kwargs):

GET /api/v3/allOrders

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#all-orders-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#all-orders-user_data

Args:
symbol (str)
Expand Down Expand Up @@ -268,7 +268,7 @@ def new_oco_order(

POST /api/v3/orderList/oco

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-list---oco-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oco-trade

Args:
symbol (str)
Expand Down Expand Up @@ -345,7 +345,7 @@ def new_oto_order(

POST /api/v3/orderList/oto

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-list---oto-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---oto-trade

Args:
symbol (str)
Expand Down Expand Up @@ -428,7 +428,7 @@ def new_otoco_order(

POST /api/v3/orderList/otoco

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#new-order-list---otoco-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#new-order-list---otoco-trade

Args:
symbol (str)
Expand Down Expand Up @@ -502,7 +502,7 @@ def cancel_oco_order(self, symbol, **kwargs):

DELETE /api/v3/orderList

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#cancel-order-list-trade
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#cancel-order-list-trade

Args:
symbol (str)
Expand All @@ -526,7 +526,7 @@ def get_oco_order(self, **kwargs):

GET /api/v3/orderList

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-order-list-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-order-list-user_data

Keyword Args:
orderListId (int, optional): Either orderListId or listClientOrderId must be provided
Expand All @@ -544,7 +544,7 @@ def get_oco_orders(self, **kwargs):

GET /api/v3/allOrderList

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-all-order-lists-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-all-order-lists-user_data

Keyword Args:
fromId (int, optional): If supplied, neither startTime or endTime can be provided
Expand All @@ -563,7 +563,7 @@ def get_oco_open_orders(self, **kwargs):

GET /api/v3/openOrderList

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-open-order-lists-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/trading-endpoints#query-open-order-lists-user_data

Keyword Args:
recvWindow (int, optional): The value cannot be greater than 60000
Expand All @@ -580,7 +580,7 @@ def account(self, **kwargs):

GET /api/v3/account

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-information-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-information-user_data

Keyword Args:
omitZeroBalances (bool, optional): When set to true, emits only the non-zero balances of an account. Default value: false
Expand All @@ -598,7 +598,7 @@ def my_trades(self, symbol: str, **kwargs):

GET /api/v3/myTrades

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#account-trade-list-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#account-trade-list-user_data

Args:
symbol (str)
Expand All @@ -625,7 +625,7 @@ def get_order_rate_limit(self, **kwargs):

GET /api/v3/rateLimit/order

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-unfilled-order-count-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-unfilled-order-count-user_data

Keyword Args:
recvWindow (int, optional): The value cannot be greater than 60000
Expand Down Expand Up @@ -658,7 +658,7 @@ def query_prevented_matches(self, symbol: str, **kwargs):

GET /api/v3/myPreventedMatches

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-prevented-matches-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-prevented-matches-user_data

Args:
symbol (str)
Expand All @@ -681,7 +681,7 @@ def query_allocations(self, symbol: str, **kwargs):

GET /api/v3/myAllocations

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-allocations-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-allocations-user_data

Args:
symbol (str)
Expand All @@ -705,7 +705,7 @@ def query_commission_rates(self, symbol: str, **kwargs):

GET /api/v3/account/commission

https://developers.binance.com/docs/binance-spot-api-docs/rest-api/public-api-endpoints#query-commission-rates-user_data
https://developers.binance.com/docs/binance-spot-api-docs/rest-api/account-endpoints#query-commission-rates-user_data

Args:
symbol (str)
Expand Down
Loading
Loading