Esempio n. 1
0
 def future_position(self, symbol, contract_type):
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'contract_type': contract_type
     }
     params['sign'] = HttpsRequest.build_sign(params, self.__secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['position'], params)
Esempio n. 2
0
 def future_withdraw_info(self, symbol, withdraw_id):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'withdraw_id': withdraw_id
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['withdraw_info'],
                              params)
Esempio n. 3
0
 def future_cancel(self, symbol, contract_type, order_id):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'contract_type': contract_type,
         'order_id': order_id
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['cancel'], params)
Esempio n. 4
0
 def future_trade_history(self, symbol, date, since):
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'date': date,
         'since': since
     }
     params['sign'] = HttpsRequest.build_sign(params, self.__secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['trades_history'],
                              params)
Esempio n. 5
0
 def future_batch_trade(self, symbol, contract_type, orders_data,
                        lever_rate):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'contract_type': contract_type,
         'orders_data': orders_data,
         'lever_rate': lever_rate
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['batch_trade'],
                              params)
Esempio n. 6
0
 def future_withdraw(self, symbol, charge_fee, trade_pwd, withdraw_address,
                     withdraw_amount, target):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'charge_fee': charge_fee,
         'trade_pwd': trade_pwd,
         'withdraw_address': withdraw_address,
         'withdraw_amount': withdraw_amount,
         'target': target
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['withdraw'], params)
Esempio n. 7
0
 def future_explosive(self, symbol, contract_type, status, current_page,
                      page_number, page_length):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'contract_type': contract_type,
         'status': status,
         'current_page': current_page,
         'page_number': page_number,
         'page_length': page_length
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['explosive'], params)
Esempio n. 8
0
 def future_order_info(self, symbol, contract_type, order_id, status,
                       current_page, page_length):
     params = {
         'api_key': self._api_key,
         'symbol': symbol,
         'contract_type': contract_type,
         'order_id': order_id,
         'status': status,
         'current_page': current_page,
         'page_length': page_length
     }
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['order_info'],
                              params)
Esempio n. 9
0
 def future_trade(self,
                  symbol,
                  contract_type,
                  price='',
                  amount='',
                  trade_type='',
                  match_price='',
                  lever_rate=''):
     params = {
         'api_key': self.__api_key,
         'symbol': symbol,
         'contract_type': contract_type,
         'amount': amount,
         'type': trade_type,
         'match_price': match_price,
         'lever_rate': lever_rate
     }
     if price:
         params['price'] = price
     params['sign'] = HttpsRequest.build_sign(params, self.__secret_key)
     return HttpsRequest.post(OKCoinBase.RESOURCES_URL['trades'], params)
Esempio n. 10
0
 def future_user_info_4fix(self):
     params = {'api_key': self._api_key}
     params['sign'] = HttpsRequest.build_sign(params, self._secret_key)
     return HttpsRequest.post(self,
                              OKCoinBase.RESOURCES_URL['user_info_4fix'],
                              params)