Documentation ¶
Overview ¶
Wrapper around the HTTP trading API for type safety 'n' stuff.
Index ¶
- Constants
- type Action
- type Currency
- type Event
- type EventList
- type Main
- type Status
- type Trade
- func (t *Trade) AddItem(slot uint, itemId, contextId uint64, appId uint32) (*Status, error)
- func (t *Trade) Cancel() (*Status, error)
- func (t *Trade) Chat(message string) (*Status, error)
- func (t *Trade) Confirm() (*Status, error)
- func (t *Trade) GetForeignInventory(contextId uint64, appId uint32, start *uint) (*inventory.PartialInventory, error)
- func (t *Trade) GetMain() (*Main, error)
- func (t *Trade) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error)
- func (t *Trade) GetStatus() (*Status, error)
- func (t *Trade) RemoveItem(slot uint, itemId, contextId uint64, appId uint32) (*Status, error)
- func (t *Trade) SetCurrency(amount uint, currencyId, contextId uint64, appId uint32) (*Status, error)
- func (t *Trade) SetReady(ready bool) (*Status, error)
- type TradeStatus
- type User
Constants ¶
View Source
const ( TradeStatus_Open TradeStatus = 0 TradeStatus_Complete = 1 TradeStatus_Empty = 2 // when both parties trade no items TradeStatus_Cancelled = 3 TradeStatus_Timeout = 4 // the partner timed out TradeStatus_Failed = 5 )
View Source
const ( Action_AddItem Action = 0 Action_RemoveItem = 1 Action_Ready = 2 Action_Unready = 3 Action_Accept = 4 Action_SetCurrency = 6 Action_ChatMessage = 7 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event struct { SteamId steamid.SteamId `json:",string"` Action Action `json:",string"` Timestamp uint64 AppId uint32 ContextId uint64 `json:",string"` AssetId uint64 `json:",string"` Text string // only used for chat messages // The following is used for SetCurrency CurrencyId uint64 `json:",string"` OldAmount uint64 `json:"old_amount,string"` NewAmount uint64 `json:"amount,string"` }
type EventList ¶
func (*EventList) UnmarshalJSON ¶
The EventList can either be an array or an object of id -> event
type Trade ¶
type Trade struct { LogPos uint // not automatically updated Version uint // Incremented for each item change by Steam; not automatically updated. // contains filtered or unexported fields }
func New ¶
Creates a new Trade based on the given cookies `sessionid` and `steamLogin` and the trade partner's Steam ID.
func (*Trade) GetForeignInventory ¶
func (t *Trade) GetForeignInventory(contextId uint64, appId uint32, start *uint) (*inventory.PartialInventory, error)
Thread-safe.
func (*Trade) GetOwnInventory ¶
Thread-safe.
func (*Trade) RemoveItem ¶
func (*Trade) SetCurrency ¶
type TradeStatus ¶
type TradeStatus uint
Click to show internal directories.
Click to hide internal directories.