Documentation
¶
Index ¶
- Constants
- type AuctionRequest
- type BlueGem
- type BuyNowRequest
- type BuyRequestPayload
- type BuyResponse
- type CSFloat
- func (api *CSFloat) Buy(apiKey string, payload BuyRequestPayload) (*BuyResponse, error)
- func (api *CSFloat) FloatRange(f float32) (float32, float32)
- func (api *CSFloat) History(apiKey string, payload HistoryRequestPayload) (*HistoryResponse, error)
- func (api *CSFloat) Inventory(apiKey string) (*InventoryResponse, error)
- func (api *CSFloat) ItemBuyOrders(apiKey string, item *Item) (*ItemBuyOrdersResponse, error)
- func (api *CSFloat) List(apiKey string, payload ListRequest) (*ListResponse, error)
- func (api *CSFloat) Listing(apiKey string, listingId string) (*ListingResponse, error)
- func (api *CSFloat) ListingBuyOrders(apiKey, listingId string) (*ItemBuyOrdersResponse, error)
- func (api *CSFloat) Listings(apiKey string, query ListingsRequest) (*ListingsResponse, error)
- func (api *CSFloat) Me(apiKey string) (*MeResponse, error)
- func (api *CSFloat) Similar(apiKey, listingId string) (*SimilarResponse, error)
- func (api *CSFloat) SimpleItemBuyOrders(apiKey string, item *Item) (*SimpleItemBuyOrdersResponse, error)
- func (api *CSFloat) Stall(apiKey, steamId string) (*StallResponse, error)
- func (api *CSFloat) Trades(apiKey string, payload TradesRequest) (*TradesResponse, error)
- func (api *CSFloat) Transactions(apiKey string, payload TransactionsRequest) (*TransactionsResponse, error)
- func (api *CSFloat) Unlist(apiKey, listingId string) (*UnlistResponse, error)
- func (api *CSFloat) UpdateListing(apiKey, id string, payload UpdateListingRequest) (*UpdateListingResponse, error)
- type Category
- type Charm
- type Error
- type Fade
- type GenericResponse
- type HistoryEntry
- type HistoryRequestPayload
- type HistoryResponse
- type InventoryItem
- type InventoryResponse
- type Item
- type ItemBuyOrder
- type ItemBuyOrdersResponse
- type ItemReference
- type ItemType
- type ListRequest
- type ListResponse
- type ListedItem
- type ListingResponse
- type ListingType
- type ListingsRequest
- type ListingsResponse
- type MeResponse
- type MeUser
- type Order
- type Rarity
- type Ratelimits
- type Reference
- type Response
- type SimilarResponse
- type SimpleItemBuyOrdersResponse
- type Stall
- type StallResponse
- type Sticker
- type Trade
- type TradeState
- type TradesRequest
- type TradesResponse
- type Transaction
- type TransactionDetailType
- type TransactionDetails
- type TransactionType
- type TransactionsRequest
- type TransactionsResponse
- type UnlistResponse
- type UpdateListingRequest
- type UpdateListingResponse
- type VerificationMode
- type WearName
Constants ¶
View Source
const ( ErrorCodeAlreadySold = 4 // ErrorCodeInvalidPurchaseState is thrown along HTTP status code 422. It // is unclear when exactly, but it seems similar to AlreadySold. It might // be unlisted. ErrorCodeInvalidPurchaseState = 6 ErrorCodePriceChanged = 15 // ErrorCodeSalesHistoryNotAvailable implies that the history for a certain // item was disabled. This is done for cases for example. ErrorCodeSalesHistoryNotAvailable = 200 )
View Source
const ( Normal = 1 StatTrak = 2 Souvenir = 3 )
View Source
const Fee float64 = 2
Fee is a constant fee. Technically the profile has a setting, but it seems its unachievable to reduce the fee, so this is fine for now.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuctionRequest ¶
type BuyNowRequest ¶
type BuyNowRequest struct {
Price uint `json:"price,omitempty"`
}
type BuyRequestPayload ¶
type BuyResponse ¶
type BuyResponse struct {
GenericResponse
}
type CSFloat ¶
type CSFloat struct {
// contains filtered or unexported fields
}
func NewWithHTTPClient ¶
func (*CSFloat) Buy ¶
func (api *CSFloat) Buy(apiKey string, payload BuyRequestPayload) (*BuyResponse, error)
func (*CSFloat) FloatRange ¶
FloatRange returns the float range for the given quality (fn, mw, ...).
func (*CSFloat) History ¶
func (api *CSFloat) History(apiKey string, payload HistoryRequestPayload) (*HistoryResponse, error)
func (*CSFloat) Inventory ¶
func (api *CSFloat) Inventory(apiKey string) (*InventoryResponse, error)
Inventory returns all visible (tradable) items from the Steam inventory. This includes items already listed in the stall, those will have a `listing_id` set.
func (*CSFloat) ItemBuyOrders ¶
func (api *CSFloat) ItemBuyOrders(apiKey string, item *Item) (*ItemBuyOrdersResponse, error)
func (*CSFloat) List ¶
func (api *CSFloat) List(apiKey string, payload ListRequest) (*ListResponse, error)
func (*CSFloat) Listing ¶
func (api *CSFloat) Listing(apiKey string, listingId string) (*ListingResponse, error)
Listing returns an existing listing.
func (*CSFloat) ListingBuyOrders ¶
func (api *CSFloat) ListingBuyOrders(apiKey, listingId string) (*ItemBuyOrdersResponse, error)
func (*CSFloat) Listings ¶
func (api *CSFloat) Listings(apiKey string, query ListingsRequest) (*ListingsResponse, error)
func (*CSFloat) Similar ¶
func (api *CSFloat) Similar(apiKey, listingId string) (*SimilarResponse, error)
func (*CSFloat) SimpleItemBuyOrders ¶
func (api *CSFloat) SimpleItemBuyOrders(apiKey string, item *Item) (*SimpleItemBuyOrdersResponse, error)
func (*CSFloat) Trades ¶
func (api *CSFloat) Trades(apiKey string, payload TradesRequest) (*TradesResponse, error)
func (*CSFloat) Transactions ¶
func (api *CSFloat) Transactions(apiKey string, payload TransactionsRequest) (*TransactionsResponse, error)
func (*CSFloat) Unlist ¶
func (api *CSFloat) Unlist(apiKey, listingId string) (*UnlistResponse, error)
func (*CSFloat) UpdateListing ¶
func (api *CSFloat) UpdateListing(apiKey, id string, payload UpdateListingRequest) (*UpdateListingResponse, error)
type GenericResponse ¶
type GenericResponse struct { // Ratelimits will have zero values if the request fails completly. Ratelimits Ratelimits `json:"-"` // Error will only be set if an error happened after successfully reaching // the server. However, there might still be other errors, for example when // decoding the server response. Error *Error `json:"-"` }
type HistoryEntry ¶
type HistoryRequestPayload ¶
type HistoryResponse ¶
type HistoryResponse struct { GenericResponse Data []HistoryEntry }
type InventoryItem ¶
type InventoryItem struct { Item // ListingID is only filled for items that are already in the stall. ListingID string `json:"listing_id"` Reference ItemReference `json:"reference"` }
type InventoryResponse ¶
type InventoryResponse struct { GenericResponse Data []InventoryItem }
type Item ¶
type Item struct { ID string `json:"asset_id"` Rarity Rarity `json:"rarity"` Type ItemType `jsob:"type"` MarketHashName string `json:"market_hash_name"` IconURL string `json:"icon_url"` // InspectLink is used to open CS. However, CSFloat also uses it as a key to // filter buy orders for a concrete asset. InspectLink string `json:"inspect_link"` Float float64 `json:"float_value"` IsStattrak bool `json:"is_stattrak"` IsSouvenir bool `json:"is_souvenir"` // DefIndex is the weapon type DefIndex uint `json:"def_index"` StickerIndex uint `json:"sticker_index"` // PaintIndex is the skin type PaintIndex uint `json:"paint_index"` // PaintSeed determines the skin pattern PaintSeed uint `json:"paint_seed"` Stickers []Sticker `json:"stickers,omitempty"` Charms []Charm `json:"keychains,omitempty"` Fade *Fade `json:"fade,omitempty"` BlueGem *BlueGem `json:"blue_gem,omitempty"` Collection string `json:"collection"` CharmIndex uint `json:"keychain_index"` CharmPattern uint `json:"keychain_pattern"` }
type ItemBuyOrder ¶
type ItemBuyOrdersResponse ¶
type ItemBuyOrdersResponse struct { GenericResponse Data []ItemBuyOrder `json:"data"` }
type ItemReference ¶
type ListRequest ¶
type ListRequest struct { *BuyNowRequest *AuctionRequest AssetId string `json:"asset_id"` AuctionType ListingType `json:"type"` Description string `json:"description"` }
type ListResponse ¶
type ListResponse struct { GenericResponse Item ListedItem }
type ListedItem ¶
type ListedItem struct { ID string `json:"id"` Price int `json:"price"` Item Item `json:"item"` Reference ItemReference `json:"reference"` Type ListingType `json:"type"` Description string `json:"description"` Private bool `json:"private"` MaxOfferDiscount uint `json:"max_offer_discount"` Watchers uint `json:"watchers"` }
type ListingResponse ¶
type ListingResponse struct { GenericResponse Item ListedItem }
type ListingType ¶
type ListingType string
const ( BuyNow ListingType = "buy_now" Auction ListingType = "auction" )
type ListingsRequest ¶
type ListingsResponse ¶
type ListingsResponse struct { GenericResponse Data []ListedItem `json:"data"` }
type MeResponse ¶
type MeResponse struct { GenericResponse User MeUser `json:"user"` }
type Ratelimits ¶
type SimilarResponse ¶
type SimilarResponse struct { GenericResponse Data []*ListedItem }
type SimpleItemBuyOrdersResponse ¶
type SimpleItemBuyOrdersResponse struct { GenericResponse Data []ItemBuyOrder `json:"data"` }
type Stall ¶
type Stall struct { Items []ListedItem `json:"data"` Count int `json:"total_count"` }
type StallResponse ¶
type StallResponse struct { GenericResponse Stall }
type Trade ¶
type Trade struct { ID string `json:"id"` // BuyerId is the steam ID, which can be your own ID if you are the buyer. BuyerId string `json:"buyer_id"` Contract ListedItem `json:"contract"` // CreatedAt is the time at which the sale was made, either through a buy // order or manually. CreatedAt time.Time `json:"created_at"` // AcceptedAt, is the time where the trade accepted the trade on CSFloat. AcceptedAt time.Time `json:"accepted_at"` // TradeProtectionEndsAt is the time at which the Steam trade protection // ends. Only after this, we can verify. TradeProtectionEndsAt time.Time `json:"trade_protection_ends_at"` // VerifySaleAt is the time after which the traede protection runs out. VerifySaleAt time.Time `json:"verify_sale_at"` // VerifiedAt is the time at which escrow ended. VerifiedAt time.Time `json:"verified_at"` State TradeState `json:"state"` VerificationMode VerificationMode `json:"verification_mode"` }
type TradeState ¶
type TradeState string
const ( // Queued means it was just bought, step 1. Queued TradeState = "queued" // Pending is the stage after queued, meaning the sale was accepted, but // has not been verified yet. You can also be in this state if the item // is still in trade protection, but would otherwise be verified. In this // state it is relevant to check for all the different timestamp fields on // the trade object. The verification mode will also already be escrow at // this point in time. Pending TradeState = "pending" // Verified means both sides have received the goods. Verified TradeState = "verified" // Cancelled means the buyer decided not to buy afterall. Cancelled TradeState = "cancelled" // Failed means the buyer failed to accept. Failed TradeState = "failed" )
type TradesRequest ¶
type TradesRequest struct { // Page, default 0 (latest) Page uint `json:"page"` // Limit, default 100 Limit uint `json:"limit"` // States, empty by default, not filtering States []TradeState }
type TradesResponse ¶
type TradesResponse struct { GenericResponse Trades []Trade `json:"trades"` Count uint `json:"count"` }
type Transaction ¶
type Transaction struct { ID string `json:"id"` CreatedAt time.Time `json:"created_at"` UserID string `json:"user_id"` Type TransactionType `json:"type"` Details TransactionDetails `json:"details"` BalanceOffset int `json:"balance_offset"` PendingOffset int `json:"pending_offset"` }
type TransactionDetailType ¶
type TransactionDetailType string
const ( TransactionDetailTypeBuyerConfirm TransactionDetailType = "buyer_confirm" TransactionDetailTypeBuyerPing TransactionDetailType = "buyer_ping" TransactionDetailTypeLink TransactionDetailType = "link" TransactionDetailTypeFloatDB TransactionDetailType = "floatdb" )
type TransactionDetails ¶
type TransactionDetails struct { ContractID string `json:"contract_id"` TradeID string `json:"trade_id"` BidID string `json:"bid_id"` // ListingID is used for BidPosted ListingID string `json:"listing_id"` BuyOrderID string `json:"buy_order_id"` OriginalTransactionId string `json:"original_tx"` Type TransactionDetailType `json:"type"` // FeeAmountString should not be used, use the FeeAmount function instead. FeeAmountString string `json:"fee_amount"` // Reason is used for fines and others. Reason string `json:"reason"` // Fee is used for Deposits. God knows why its a seperate field and not // FeeAmountString. FeeString string `json:"fee"` PaymentMethod string `json:"payment_method"` PaymentProcessor string `json:"payment_processor"` // SessionID is for strip deposits. SessionID string `json:"session_id"` }
func (TransactionDetails) Fee ¶
func (details TransactionDetails) Fee() int
func (TransactionDetails) FeeAmount ¶
func (details TransactionDetails) FeeAmount() int
type TransactionType ¶
type TransactionType string
const ( TransactionTypeDeposit TransactionType = "deposit" TransactionTypeWithdrawal TransactionType = "withdrawal" TransactionTypeContractSold TransactionType = "contract_sold" TransactionTypeContractSaleRefund TransactionType = "contract_sale_refund" TransactionTypeContractPurchased TransactionType = "contract_purchased" TransactionTypeContractPurchaseRefund TransactionType = "contract_purchase_refund" TransactionTypeTradeVerified TransactionType = "trade_verified" TransactionTypeFine TransactionType = "fine" TransactionTypeBidDeclined TransactionType = "bid_declined" TransactionTypeBidPosted TransactionType = "bid_posted" )
type TransactionsRequest ¶
type TransactionsResponse ¶
type TransactionsResponse struct { GenericResponse Transactions []Transaction `json:"transactions"` Count uint `json:"count"` }
type UnlistResponse ¶
type UnlistResponse struct {
GenericResponse
}
type UpdateListingRequest ¶
type UpdateListingRequest struct {
MaxOfferDiscount uint `json:"max_offer_discount"`
}
type UpdateListingResponse ¶
type UpdateListingResponse struct {
GenericResponse
}
type VerificationMode ¶
type VerificationMode string
const ( // Inventory is the mode right after purchase, before anyone has // accepted anything until the seller accepted the sale. Inventory VerificationMode = "inventory" // Escrow means both sides have accepted everything, but the balance isn't // usable yet. Escrow VerificationMode = "escrow" )
Click to show internal directories.
Click to hide internal directories.