Skip to content

Commit ca95a29

Browse files
committed
futures wallet endpoints update
1 parent 822c01f commit ca95a29

File tree

2 files changed

+150
-1
lines changed

2 files changed

+150
-1
lines changed

include/Exchange_Client.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ class Client
199199
Json::Value collateral_adjust(const Params* params_ptr);
200200
Json::Value collateral_adjust_history(const Params* params_ptr = nullptr);
201201
Json::Value collateral_liquidation_history(const Params* params_ptr = nullptr);
202+
Json::Value collateral_check_repay_limit(const Params* params_ptr);
203+
Json::Value collateral_get_repay_quote(const Params* params_ptr);
204+
Json::Value collateral_repay(const Params* params_ptr);
205+
Json::Value collateral_repay_result(const Params* params_ptr);
206+
Json::Value collateral_cross_interest_history(const Params* params_ptr);
202207

203208
};
204209

@@ -308,6 +313,7 @@ class Client
308313
Json::Value get_purchase_record(const Params* params_ptr);
309314
Json::Value get_redemption_record(const Params* params_ptr);
310315
Json::Value get_interest_history(const Params* params_ptr);
316+
Json::Value change_fixed_pos_to_daily_pos(const Params* params_ptr);
311317

312318
};
313319

@@ -334,7 +340,7 @@ class Client
334340
explicit BLVT(const Client<T>& client);
335341
~BLVT();
336342

337-
Json::Value get_blvt_info(const Params* params_ptr);
343+
Json::Value get_blvt_info(const Params* params_ptr = nullptr);
338344
Json::Value subscribe_blvt(const Params* params_ptr);
339345
Json::Value get_subscribe_blvt_history(const Params* params_ptr);
340346
Json::Value redeem_blvt(const Params* params_ptr);

src/Binance_Client.cpp

Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,126 @@ Json::Value Client<T>::FuturesWallet::collateral_liquidation_history(const Param
15551555
}
15561556
}
15571557

1558+
/**
1559+
Check the maximum and minimum limit when repay with collateral
1560+
@param params_ptr - a pointer to the request Params object
1561+
@return the json returned by the request
1562+
*/
1563+
template <typename T>
1564+
Json::Value Client<T>::FuturesWallet::collateral_check_repay_limit(const Params* params_ptr)
1565+
{
1566+
try
1567+
{
1568+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/futures/loan/collateralRepayLimit";
1569+
std::string query = this->user_client->_generate_query(params_ptr, 1);
1570+
Json::Value response = (this->user_client->_rest_client)->_getreq(full_path + query);
1571+
1572+
return response;
1573+
}
1574+
catch (ClientException e)
1575+
{
1576+
e.append_to_traceback(std::string(__FUNCTION__));
1577+
throw(e);
1578+
}
1579+
}
1580+
1581+
/**
1582+
Get Collateral Repay Quote
1583+
* the quote will be valid within 25 seconds
1584+
1585+
@param params_ptr - a pointer to the request Params object
1586+
@return the json returned by the request
1587+
*/
1588+
template <typename T>
1589+
Json::Value Client<T>::FuturesWallet::collateral_get_repay_quote(const Params* params_ptr)
1590+
{
1591+
try
1592+
{
1593+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/futures/loan/collateralRepay";
1594+
std::string query = this->user_client->_generate_query(params_ptr, 1);
1595+
Json::Value response = (this->user_client->_rest_client)->_getreq(full_path + query);
1596+
1597+
return response;
1598+
}
1599+
catch (ClientException e)
1600+
{
1601+
e.append_to_traceback(std::string(__FUNCTION__));
1602+
throw(e);
1603+
}
1604+
}
1605+
1606+
/**
1607+
Repay with Collateral
1608+
1609+
@param params_ptr - a pointer to the request Params object
1610+
@return the json returned by the request
1611+
*/
1612+
template <typename T>
1613+
Json::Value Client<T>::FuturesWallet::collateral_repay(const Params* params_ptr)
1614+
{
1615+
try
1616+
{
1617+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/futures/loan/collateralRepay";
1618+
std::string query = this->user_client->_generate_query(params_ptr, 1);
1619+
Json::Value response = (this->user_client->_rest_client)->_postreq(full_path + query);
1620+
1621+
return response;
1622+
}
1623+
catch (ClientException e)
1624+
{
1625+
e.append_to_traceback(std::string(__FUNCTION__));
1626+
throw(e);
1627+
}
1628+
}
1629+
1630+
/**
1631+
Check collateral repayment result
1632+
1633+
@param params_ptr - a pointer to the request Params object
1634+
@return the json returned by the request
1635+
*/
1636+
template <typename T>
1637+
Json::Value Client<T>::FuturesWallet::collateral_repay_result(const Params* params_ptr)
1638+
{
1639+
try
1640+
{
1641+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/futures/loan/collateralRepayResult";
1642+
std::string query = this->user_client->_generate_query(params_ptr, 1);
1643+
Json::Value response = (this->user_client->_rest_client)->_getreq(full_path + query);
1644+
1645+
return response;
1646+
}
1647+
catch (ClientException e)
1648+
{
1649+
e.append_to_traceback(std::string(__FUNCTION__));
1650+
throw(e);
1651+
}
1652+
}
1653+
1654+
/**
1655+
Cross-Collateral Interest History
1656+
1657+
@param params_ptr - a pointer to the request Params object
1658+
@return the json returned by the request
1659+
*/
1660+
template <typename T>
1661+
Json::Value Client<T>::FuturesWallet::collateral_cross_interest_history(const Params* params_ptr)
1662+
{
1663+
try
1664+
{
1665+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/futures/loan/interestHistory";
1666+
std::string query = this->user_client->_generate_query(params_ptr, 1);
1667+
Json::Value response = (this->user_client->_rest_client)->_getreq(full_path + query);
1668+
1669+
return response;
1670+
}
1671+
catch (ClientException e)
1672+
{
1673+
e.append_to_traceback(std::string(__FUNCTION__));
1674+
throw(e);
1675+
}
1676+
}
1677+
15581678
// ------------------------------ End | Client FuturesWallet - User FuturesWallet Endpoints
15591679

15601680

@@ -3347,6 +3467,29 @@ Json::Value Client<T>::Savings::get_interest_history(const Params* params_ptr)
33473467
}
33483468
};
33493469

3470+
/**
3471+
Change Fixed/Activity Position to Daily Position
3472+
@param params_ptr - a pointer to the request Params object
3473+
@return json returned by the request
3474+
*/
3475+
template <typename T>
3476+
Json::Value Client<T>::Savings::change_fixed_pos_to_daily_pos(const Params* params_ptr)
3477+
{
3478+
try
3479+
{
3480+
std::string full_path = _BASE_REST_SPOT + "/sapi/v1/lending/positionChanged";
3481+
std::string query = user_client->_generate_query(params_ptr, 1);
3482+
Json::Value response = (user_client->_rest_client)->_getreq(full_path + query);
3483+
3484+
return response;
3485+
}
3486+
catch (ClientException e)
3487+
{
3488+
e.append_to_traceback(std::string(__FUNCTION__));
3489+
throw(e);
3490+
}
3491+
};
3492+
33503493
// ------------------------------ End | Client Savings - User Savings Endpoints
33513494

33523495

0 commit comments

Comments
 (0)