diff --git a/src/lib/alarms/trade_offer.ts b/src/lib/alarms/trade_offer.ts index 3d4b186..a2290d8 100644 --- a/src/lib/alarms/trade_offer.ts +++ b/src/lib/alarms/trade_offer.ts @@ -90,7 +90,7 @@ export async function pingCancelTrades(pendingTrades: Trade[]) { } try { - await PingCancelTrade.handleRequest({trade_id: trade.id}, {}); + await PingCancelTrade.handleRequest({trade_id: trade.id, steam_id: tradeOffers.steam_id}, {}); } catch (e) { console.error(`failed to send cancel ping for trade ${trade.id}`, e); } @@ -238,7 +238,11 @@ async function getSentTradeOffersFromAPI(): Promise { return data.response.trade_offers_sent.map(offerStateMapper); } -async function getSentAndReceivedTradeOffersFromAPI(): Promise<{received: OfferStatus[]; sent: OfferStatus[]}> { +async function getSentAndReceivedTradeOffersFromAPI(): Promise<{ + received: OfferStatus[]; + sent: OfferStatus[]; + steam_id?: string | null; +}> { const access = await getAccessToken(); const resp = await fetch( @@ -256,6 +260,7 @@ async function getSentAndReceivedTradeOffersFromAPI(): Promise<{received: OfferS return { received: data.response.trade_offers_received.map(offerStateMapper), sent: data.response.trade_offers_sent.map(offerStateMapper), + steam_id: access.steam_id, }; } diff --git a/src/lib/bridge/handlers/ping_cancel_trade.ts b/src/lib/bridge/handlers/ping_cancel_trade.ts index a319ebe..eacfbf9 100644 --- a/src/lib/bridge/handlers/ping_cancel_trade.ts +++ b/src/lib/bridge/handlers/ping_cancel_trade.ts @@ -5,6 +5,7 @@ import {Trade} from '../../types/float_market'; export interface PingCancelTradeRequest { trade_id: string; + steam_id?: string | null; } export interface PingCancelTradeResponse { @@ -17,6 +18,12 @@ export const PingCancelTrade = new SimpleHandler