tradeoffer

package
v0.0.0-...-f7db80a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2015 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Implements methods to interact with the official Trade Offer API.

See: https://developer.valvesoftware.com/wiki/Steam_Web_API/IEconService

Index

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 APIKey

type APIKey string

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 NewClient

func NewClient(key APIKey, sessionId, steamLogin string) *Client

func (*Client) Accept

func (c *Client) Accept(id TradeOfferId) error

func (*Client) Cancel

func (c *Client) Cancel(id TradeOfferId) error

func (*Client) Create

func (c *Client) Create(other steamid.SteamId, accessToken *string, myItems, theirItems []TradeItem, countered *TradeOfferId, message string) error

Sends a new trade offer to the given Steam user. You can optionally specify an access token if you've got one. In addition, `countered` can be non-nil, indicating the trade offer this is a counter for.

func (*Client) Decline

func (c *Client) Decline(id TradeOfferId) error

func (*Client) GetOffers

func (c *Client) GetOffers() (*TradeOffers, error)

func (*Client) GetOwnInventory

func (c *Client) GetOwnInventory(contextId uint64, appId uint32) (*inventory.Inventory, error)

func (*Client) GetTheirInventory

func (c *Client) GetTheirInventory(other steamid.SteamId, contextId uint64, appId uint32) (*inventory.Inventory, error)

type TradeItem

type TradeItem struct {
	AppId     uint32
	ContextId uint64
	Amount    uint
	AssetId   uint64
}

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
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL