Skip to main content
Module

x/steam_trader/mod.ts>TradeOffer

https://deno.land/x/steam_trader
Latest
class TradeOffer
Re-export
import { TradeOffer } from "https://deno.land/x/steam_trader@v0.4.0/mod.ts";

Constructors

new
TradeOffer(
manager: TradeManager,
partner: string | SteamID,
token?: string,
)

Properties

private
_token: string | undefined

the token used to create an offer. usually available in user's trade url

optional
cancelTime: number

milliseconds. if set before sending, this offer will be automatically cancelled after this amount of time passed.

confirmationMethod: EConfirmationMethod

If this offer needs to be confirmed by you, this is a value from EConfirmationMethod

optional
countering: string
created: Date | undefined

A Date object representing when the trade offer was sent

escrowEndsAt: Date | undefined
expires: Date | undefined

A Date object representing when the trade offer will expire if not acted on

fromRealTimeTrade: boolean | undefined

true if this trade offer was created automatically from a real-time trade that was committed, false if it was explicitly sent as a trade offer

id: string | undefined

The trade offer's unique numeric ID, represented as a string

isOurOffer: boolean | undefined

true if this offer was sent by you, false if you received it

itemsToGive: Array<EconItem>

An array of items to be given from your account should this offer be accepted If this offer has not yet been sent or was just sent, object in this array will not contain classid or instanceid properties, as it would had you loaded a sent offer

itemsToReceive: Array<EconItem>

An array of items to be given from the other account and received by yours should this offer be accepted If this offer has not yet been sent or was just sent, object in this array will not contain classid or instanceid properties, as it would had you loaded a sent offer

manager: TradeManager
message: string | undefined

A message, possibly empty, included with the trade offer by its sender

optional
partner: SteamID

The other party in this offer, as a SteamID object

optional
pendingCancelTime: number

milliseconds. if set before sending, this offer will be automatically cancelled after this amount of time passed (when still pending).

A value from the ETradeOfferState enum

readonly
token
tradeID: string | undefined

A numeric trade ID, represented as a string, if the offer was accepted. null otherwise. This value won't be very useful to you.

updated: Date | undefined

A Date object representing when the trade offer was last updated (equal to created if never updated)

Methods

private
_update(data: Offer)

do not use this method to update an offer. it is used internally.

private
itemMapper(item: EconItem)
accept(skipStateUpdate?): Promise<
| "accepted"
| "pending"
| "escrow"
| string
>

alias for decline()

Confirms an offer that is in CreatedNeedsConfirmation state.

throws error if offer is unsent, not in CreatedNeedsConfirmation state or confirmation object for offerid is not found

getExchangeDetails(getDetailsIfFailed?)
setMessage(msg: string)
setToken(token: string)

Static Methods

from(manager: TradeManager, data: Offer)
fromOfferId(manager: TradeManager, offerid: string)