opskins-trade-interface
NodeJS interface for interaction with trade.opskins.com API
Contents
- Trade Opskins API Documentation
- Installation
- Usage
- Methods
- Module specific parameters
- Recommended use
Install
Clone this repo and include index.js or install via npm:
npm install opskins-trade-interface
Usage
const TradeInterface = const interface = APIKEY // Gets apikey user inventory { try // RECURSIVE: true - Gets all pages of inventory by requesting it multiple times const res = await tradeIUser console catcherr console }
Methods
All the methods use same parameters and produce same result as described in Trade Opskins API Documentation
Calling example method:
const res = await tradeIUser// IUser - collection of methods from docs// GetInventory - one of the methods of this collection// app_id - one of the method's parameters// RECURSIVE - one of the module's specific parameters console/* =>{ "status": 1, "time": 1528135996, "response": { "total": 123, "items": [...], "sort_parameters": {...} }}
Module specific parameters
There are several parameters that are added in addition to all other documented parameters all of which are optional
- RECURSIVE (boolean, false by default) - if true, gets all pages of response of some methods. Works for IUser.GetInventory, ITrade.GetOffers, ITrade.GetUserInventory, ITrade.GetUserInventoryFromSteamId
- CONCURRENCY (integer, 1 by default) - works in pair with RECURSIVE. Sets concurrency for requests queue. Notice that increasing CONCURRENCY gives faster method execution time, but increases the risk of being ratelimited by opskins.
- NOVALIDATION (boolean, false by default) - if true, skips parameters validation. Can be usefull if correct parameters unexpectadly rejected by the module
Recommended use
Its recommended to use this module through opskins-trade-manager in order to enhance development experience by having auto polling with events, class based outputs and more