1.0.2 • Published 6 years ago

wax-trade v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

node-wax-trade

Setup

const trade = require('wax-trade');

API Response

All successful responses are structured like this, with data being in the response object

{
    "status": 1,
    "time": 1531232754,
    "response": {
        "offer": {
           "offer info here"
        }
    }
}

Methods

logOn

Must be called before any other methods

Parameters

ParameterTypeRequiredDescription
apiKeystringYesYour API Key displayed by OPSkins
secretstringYesYour OPSkins 2FA Secret
callbackfunctionYesCallback function(err, result)

acceptOffer

Accepts a specified incoming offer

Parameters

ParameterTypeRequiredDescription
offer_idintYesThe trade offer ID of incoming offer
callbackfunctionYesCallback function(err, result)

cancelOffer

Cancels a specified incoming or outgoing offer

Parameters

ParameterTypeRequiredDescription
offer_idintYesThe trade offer ID of the offer
callbackfunctionYesCallback function(err, result)

getApps

Returns all apps on OPSkins

Parameters

ParameterTypeRequiredDescription
callbackfunctionYesCallback function(err, result)

getOffer

Gets a single trade offer. You must be involved in the requested trade

Parameters

ParameterTypeRequiredDescription
offer_idintYesThe trade offer ID of the offer
callbackfunctionYesCallback function(err, result)

getOffers

Gets multiple trade offers. If no parameters are specified, all past trade offers will be returned

Parameters

ParameterTypeRequiredDescription
uidintThe trade offer ID of the offer
statestringComma-separated list of offer states to filter by
typestringEither sent, received or null - only show offers which were sent, received or both
pageintThe starting page number - defaults to 1
per_pageintNumber of items per page - defaults to 100 - max 100
idsint-csvThe trade offer IDs to retrieve
callbackfunctionYesCallback function(err, result)

getTradeUrl

Gets the Trade URL for the logged in account

Parameters

ParameterTypeRequiredDescription
callbackfunctionYesCallback function(err, result)

getUserInventory

Retrieves a user's inventory

Parameters

ParameterTypeRequiredDescription
uidintYesUser ID of the user's inventory
app_idintYesInternal App ID
pageintThe starting page number - defaults to 1
per_pageintNumber of items per page - defaults to 100 - max 100
searchstringAdditional search by item's name
callbackfunctionYesCallback function(err, result)

getUserInventoryFromSteamId

Retrieves a user's inventory by their SteamID64

Parameters

ParameterTypeRequiredDescription
steam_idintYesThe SteamID64 of the user's inventory
app_idintYesInternal App ID
pageintThe starting page number - defaults to 1
per_pageintNumber of items per page - defaults to 100 - max 100
searchstringAdditional search by item's name
callbackfunctionYesCallback function(err, result)

regenerateTradeUrl

Regenerates the Trade URL for the logged in account

Parameters

ParameterTypeRequiredDescription
callbackfunctionYesCallback function(err, result)

sendOffer

Sends a trade offer to the specified user

Parameters

ParameterTypeRequiredDescription
uidintYesUser ID of the user to send the offer to
tokenstringYesTrade token of the user to send the offer to
itemsstringYesA comma-separated list of all item IDs to include in the offer - sender and recipient - 100 max per side
messagestringMessage to include with the trade offer
callbackfunctionYesCallback function(err, result)

sendOfferToSteamId

Sends a trade offer to the specified user by SteamID64

Parameters

ParameterTypeRequiredDescription
steam_idintYesSteamID64 of the user to send the offer to
itemsstringYesA comma-separated list of all item IDs to include in the offer - sender and recipient - 200 max per side
messagestringMessage to include with the trade offer
callbackfunctionYesCallback function(err, result)

Offer States

  • STATE_ACTIVE = 2 -- The offer is active and the recipient can accept it to exchange the items
  • STATE_ACCEPTED = 3 -- The recipient accepted the offer and items were exchanged
  • STATE_EXPIRED = 5 -- The offer expired from inactivity
  • STATE_CANCELED = 6 -- The sender canceled the offer
  • STATE_DECLINED = 7 -- The recipient declined the offer
  • STATE_INVALID_ITEMS = 8 -- One of the items in the offer is no longer available so the offer was canceled automatically
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago