node-wax-trade
Setup
const trade = ;
API Response
All successful responses are structured like this, with data being in the response
object
Methods
logOn
Must be called before any other methods
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
apiKey | string | Yes | Your API Key displayed by OPSkins |
secret | string | Yes | Your OPSkins 2FA Secret |
callback | function | Yes | Callback function(err, result) |
acceptOffer
Accepts a specified incoming offer
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
offer_id | int | Yes | The trade offer ID of incoming offer |
callback | function | Yes | Callback function(err, result) |
cancelOffer
Cancels a specified incoming or outgoing offer
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
offer_id | int | Yes | The trade offer ID of the offer |
callback | function | Yes | Callback function(err, result) |
getApps
Returns all apps on OPSkins
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
callback | function | Yes | Callback function(err, result) |
getOffer
Gets a single trade offer. You must be involved in the requested trade
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
offer_id | int | Yes | The trade offer ID of the offer |
callback | function | Yes | Callback function(err, result) |
getOffers
Gets multiple trade offers. If no parameters are specified, all past trade offers will be returned
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
uid | int | The trade offer ID of the offer | |
state | string | Comma-separated list of offer states to filter by | |
type | string | Either sent , received or null - only show offers which were sent, received or both |
|
page | int | The starting page number - defaults to 1 | |
per_page | int | Number of items per page - defaults to 100 - max 100 | |
ids | int-csv | The trade offer IDs to retrieve | |
callback | function | Yes | Callback function(err, result) |
getTradeUrl
Gets the Trade URL for the logged in account
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
callback | function | Yes | Callback function(err, result) |
getUserInventory
Retrieves a user's inventory
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
uid | int | Yes | User ID of the user's inventory |
app_id | int | Yes | Internal App ID |
page | int | The starting page number - defaults to 1 | |
per_page | int | Number of items per page - defaults to 100 - max 100 | |
search | string | Additional search by item's name | |
callback | function | Yes | Callback function(err, result) |
getUserInventoryFromSteamId
Retrieves a user's inventory by their SteamID64
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
steam_id | int | Yes | The SteamID64 of the user's inventory |
app_id | int | Yes | Internal App ID |
page | int | The starting page number - defaults to 1 | |
per_page | int | Number of items per page - defaults to 100 - max 100 | |
search | string | Additional search by item's name | |
callback | function | Yes | Callback function(err, result) |
regenerateTradeUrl
Regenerates the Trade URL for the logged in account
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
callback | function | Yes | Callback function(err, result) |
sendOffer
Sends a trade offer to the specified user
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
uid | int | Yes | User ID of the user to send the offer to |
token | string | Yes | Trade token of the user to send the offer to |
items | string | Yes | A comma-separated list of all item IDs to include in the offer - sender and recipient - 100 max per side |
message | string | Message to include with the trade offer | |
callback | function | Yes | Callback function(err, result) |
sendOfferToSteamId
Sends a trade offer to the specified user by SteamID64
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
steam_id | int | Yes | SteamID64 of the user to send the offer to |
items | string | Yes | A comma-separated list of all item IDs to include in the offer - sender and recipient - 200 max per side |
message | string | Message to include with the trade offer | |
callback | function | Yes | Callback 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