npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

wax-trade

v1.0.2

Published

A small package for simplifying interaction with the WAX Expresstrade API

Downloads

12

Readme

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

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