Documentation ¶
Overview ¶
Package api implements a trading API client.
Index ¶
- type Action
- type Client
- func (t *Client) AddItem(slot uint, itemID, contextID uint64, appID uint32) (*Result, error)
- func (t *Client) Cancel() (*Result, error)
- func (t *Client) Chat(message string) (*Result, error)
- func (t *Client) Confirm() (*Result, error)
- func (t *Client) GetForeignInventory(contextID uint64, appID uint32, start uint) (*inventory.PartialInventory, error)
- func (t *Client) GetMain() (*Main, error)
- func (t *Client) GetOwnInventory(contextID uint64, appID uint32) (*inventory.Inventory, error)
- func (t *Client) GetStatus() (*Result, error)
- func (t *Client) RemoveItem(slot uint, itemID, contextID uint64, appID uint32) (*Result, error)
- func (t *Client) SetCurrency(amount uint, currencyID, contextID uint64, appID uint32) (*Result, error)
- func (t *Client) SetReady(ready bool) (*Result, error)
- type Currency
- type Event
- type EventList
- type Main
- type Result
- type Status
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client 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 ¶
New creates a new Trade based on the given cookies `sessionid`, `steamLogin`, `steamLoginSecure` and the trade partner's Steam ID.
func (*Client) GetForeignInventory ¶
func (t *Client) GetForeignInventory(contextID uint64, appID uint32, start uint) (*inventory.PartialInventory, error)
Thread-safe.
func (*Client) GetOwnInventory ¶
Thread-safe.
func (*Client) RemoveItem ¶
func (*Client) SetCurrency ¶
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
Click to show internal directories.
Click to hide internal directories.