Documentation
¶
Overview ¶
Implements methods to interact with the official Trade Offer API.
See: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService
Index ¶
- Constants
- type APIKey
- type Asset
- type Client
- func (c *Client) Cancel(id TradeOfferId) error
- func (c *Client) Decline(id TradeOfferId) error
- func (c *Client) GetOffers() (*TradeOffers, error)
- func (c *Client) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error)
- func (c *Client) GetTheirInventory(other steamid.SteamId, contextId uint64, appId uint32) (*inventory.Inventory, error)
- type TradeOffer
- type TradeOfferId
- type TradeOfferState
- type TradeOffers
Constants ¶
View Source
const ( TradeOfferState_Invalid TradeOfferState = 1 // Invalid TradeOfferState_Active = 2 // This trade offer has been sent, neither party has acted on it yet. TradeOfferState_Accepted = 3 // The trade offer was accepted by the recipient and items were exchanged. TradeOfferState_Countered = 4 // The recipient made a counter offer TradeOfferState_Expired = 5 // The trade offer was not accepted before the expiration date TradeOfferState_Canceled = 6 // The sender cancelled the offer TradeOfferState_Declined = 7 // The recipient declined the offer TradeOfferState_InvalidItems = 8 // Some of the items in the offer are no longer available (indicated by the missing flag in the output) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Asset ¶
type Asset struct {
AppId uint64 `json:",string"`
ContextId economy.ContextId `json:",string"`
AssetId economy.AssetId `json:",string"`
CurrencyId uint64 `json:",string"`
ClassId economy.ClassId `json:",string"`
InstanceId economy.InstanceId `json:",string"`
Amount uint64 `json:",string"`
Missing bool
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Cancel ¶
func (c *Client) Cancel(id TradeOfferId) error
func (*Client) Decline ¶
func (c *Client) Decline(id TradeOfferId) error
func (*Client) GetOffers ¶
func (c *Client) GetOffers() (*TradeOffers, error)
func (*Client) GetOwnInventory ¶
type TradeOffer ¶
type TradeOffer struct {
TradeOfferId TradeOfferId `json:",string"`
OtherAccountId steamid.SteamId `json:"accountid_other"`
Message string
ExpirationTime uint32 `json:"expiraton_time"`
State TradeOfferState `json:"trade_offer_state"`
ToGive []*Asset `json:"items_to_give"`
ToReceive []*Asset `json:"items_to_receive"`
IsOurs bool `json:"is_our_offer"`
TimeCreated uint32 `json:"time_created"`
TimeUpdated uint32 `json:"time_updated"`
}
type TradeOfferId ¶
type TradeOfferId uint64
type TradeOfferState ¶
type TradeOfferState uint
type TradeOffers ¶
type TradeOffers struct {
Sent []*TradeOffer `json:"trade_offers_sent"`
Received []*TradeOffer `json:"trade_offers_received"`
Descriptions inventory.Descriptions
}
Click to show internal directories.
Click to hide internal directories.