Почему не создается ордер Steam api?
Выставляю ордера на предметы в Steam, используя этот API: https://github.com/bukson/steampy#market-methods Указываю api key аккаунта, логин, пароль и путь к maFile на компьютере. Когда указываю предмет из игры Counter-Strike: Global Ofensive (например предмет glove case), то ордер на этот выставляется. Но если создаю ордер на Steam карточку, то вылетает ошибка. Код:
from steampy.client import SteamClient
from steampy.models import Currency
from steampy.utils import GameOptions
steam_client = SteamClient('4301...A') # API_KEY
# USERNAME, PASSWORD, PATH_TO_STEAMGUARD_FILE
steam_client.login('xi...2', 'z...R2',
r'C:\Users\me\Desktop\steam desktop\SDA-1.0.10\maFiles\76561198877671188.maFile')
dict_orders_items = {}
item_name_1 = "Glove Case"
item_name_2 = "Urki"
# название предмета, цена в копейках, кол-во ордеров, тип игры (CS), валюта (рубли)
response = steam_client.market.create_buy_order(item_name_1, "100", 1, GameOptions.CS, Currency.RUB)
dict_orders_items[item_name_1] = response['buy_orderid']
print(dict_orders_items)
response = steam_client.market.create_buy_order(item_name_2, "100", 1, GameOptions.STEAM, Currency.RUB)
dict_orders_items[item_name_2] = response['buy_orderid']
print(dict_orders_items)
А при создании на steam карточку urki вылетает ошибка:
Traceback (most recent call last):
File "C:\Users\me\PycharmProjects\steam api\question.py", line 20, in <module>
response = steam_client.market.create_buy_order(item_name_2, "100", 1, GameOptions.STEAM, Currency.RUB)
File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\steampy\market.py", line 18, in func_wrapper
return func(self, *args, **kwargs)
File "C:\Users\me\AppData\Local\Programs\Python\Python39\lib\site-packages\steampy\market.py", line 126, in create_buy_order
raise ApiException("There was a problem creating the order. Are you using the right currency? success: %s"
steampy.exceptions.ApiException: There was a problem creating the order. Are you using the right currency? success: 42
Это метод create_buy_order (как видно, он в любой ошибке выведет, что ему не нравится валюта. Поменял на другую, аналогичная ошибка. Если бы была проблема в валюте, то он бы не выставил glove case по валюте рубль
@login_required
def create_buy_order(self, market_name: str, price_single_item: str, quantity: int, game: GameOptions,
currency: Currency = Currency.USD) -> dict:
data = {
"sessionid": self._session_id,
"currency": currency.value,
"appid": game.app_id,
"market_hash_name": market_name,
"price_total": str(Decimal(price_single_item) * Decimal(quantity)),
"quantity": quantity
}
headers = {'Referer': "%s/market/listings/%s/%s" % (SteamUrl.COMMUNITY_URL, game.app_id, market_name)}
response = self._session.post(SteamUrl.COMMUNITY_URL + "/market/createbuyorder/", data,
headers=headers).json()
if response.get("success") != 1:
raise ApiException("There was a problem creating the order. Are you using the right currency? success: %s"
% response.get("success"))
return response
