Skip to content

Trade

Methods of TradeMixin

Make and send trade offer

from aiosteampy import SteamClient, Game

client = SteamClient(...)

inv = await client.get_inventory(Game.CSGO)

partner_steam_id = 123456
partner_inv = await client.get_user_inventory(partner_steam_id, Game.CSGO)

offer_id = await client.make_trade_offer(partner_steam_id, [inv[0]], [partner_inv[0]], 'Hi, lets change our items!')

Get offer from Steam and check if offer is accepted

from aiosteampy import TradeOfferStatus

offer = await client.fetch_trade(offer_id)

offer.status == TradeOfferStatus.ACCEPTED

Get offers from Steam and counter one, accept & cancel

from aiosteampy import SteamClient, Game

client = SteamClient(...)

sent_offers, received_offers = await client.fetch_trade_offers()

await client.counter_trade_offer(received_offers[0], to_receive=[], message='I want this to be a gift!')

await client.accept_trade_offer(received_offers[1])

await client.cancel_trade_offer(received_offers[2])