Installations
npm install waxpeer
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
20.11.1
NPM Version
9.6.1
Score
59.1
Supply Chain
99
Quality
84.8
Maintenance
100
Vulnerability
99.6
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (100%)
Developer
skylight-ity
Download Statistics
Total Downloads
38,177
Last Day
48
Last Week
262
Last Month
1,290
Last Year
16,396
GitHub Statistics
14 Stars
59 Commits
14 Forks
2 Watching
4 Branches
4 Contributors
Package Meta Information
Latest Version
1.6.3
Package Id
waxpeer@1.6.3
Unpacked Size
165.71 kB
Size
36.91 kB
File Count
28
NPM Version
9.6.1
Node Version
20.11.1
Publised On
19 Oct 2024
Total Downloads
Cumulative downloads
Total Downloads
38,177
Last day
-7.7%
48
Compared to previous day
Last week
-7.4%
262
Compared to previous week
Last month
-11.8%
1,290
Compared to previous month
Last year
32.6%
16,396
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dependencies
8
Dev Dependencies
3
Waxpeer API wrapper for Node.js
Full API documentation here
Trade websocket documentation here
Breaking changes due to Steam API update
Now in order to go online and sell items safely you need to implement the following logic:
- Make sure that you have enabled the collection of user data on the website under the "Sell items" tab (by default it is enabled).
- Going online now requires a valid Steam access token because the API key functionality has been limited. You need to send it once an hour or immediately after an refresh (the token is active only 24 hours after refreshing in Steam), otherwise it will expire and all your items will be disabled from sale, and active trades will be considered stalled and may be canceled.
- We categorically recommend not to make a mobile confirmation for a created trade until you send its trade id using the callback method.
- Online may be delayed until the access token is verified or a valid token is received. Therefore, please note that in the trade socket there is a new
user_change
event, in whichcan_p2p
indicates whether you are online or not when it is changed by p2p controller. - If you do not want to use this package, but will be implementing your own trade socket connection, make sure you specify the
source
parameter on the authentification event (auth
) without which the account will not be able to get online (example: "source": "myAwesomeProject").
Installation
1$ npm install waxpeer
Initialization with the new requirements
1import { Waxpeer, TradeWebsocket, WebsiteWebsocket } from 'waxpeer'; 2 3//API wrapper 4const WP = new Waxpeer(WAXPEER_API); 5 6const tokenUpd = await WP.UserSteamToken( 7 btoa( 8 'eyAidHlwIjogIkpXVCIsICJhbGciOiAiRWREU0EiIH0.eyAiaXfsd23123123.2B9wKjf2323-S3i3ctdCg', //your Steam access token, which must be valid for more than an hour (the token is active only 24 hours after refreshing in Steam) and belong to the account from which you are trying to go online. 9 ), 10 ); 11if (!tokenUpd?.success) //most likely you need to refresh access token and try again with a new token 12//Trade websocket 13const TS = new TradeWebsocket(STEAM_API, STEAM_ID, TRADELINK, WAX_API, ACCESS_TOKEN); //auto connect after init. At least one of [STEAM_API, WAX_API, ACCESS_TOKEN] is required! 14// const TS = new TradeWebsocket(null, STEAM_ID, TRADELINK, WAX_API); //example with waxApi to be able sell from limited account BUT not Rust game 15// const TS = new TradeWebsocket(null, STEAM_ID, TRADELINK, null, ACCESS_TOKEN); //example with waxApi to be able sell from limited account BUT not Rust game 16 17TS.disconnectWss(); //disconnect 18TS.connectWss(); //connect 19TS.on('user_change', ({can_p2p}: TradeWebsocketChangeUser) => { //new online change event 20 console.log(can_p2p); //example: true 21}); 22TS.on('send-trade', (message: TradeWebsocketCreateTradeData) => { 23 console.log(message); 24 //you create a trade in steam and have a tradeid from Steam response 25 const callback = await WP.steamTrade(tradeid, message.waxid); 26 if(!callback?.success) //if the response is not successful (success is false) you need to update your Steam access token and cancel the trade (if it was created) without performing mobile confirmation. 27 //if the answer is successful, you can do mobile confirmation 28}); 29 30//Website websocket 31const WS = new WebsiteWebsocket(WAXPEER_API, ['csgo']); //auto connect after init 32WS.disconnectWss(); //disconnect 33WS.connectWss(); //connect
Fetch your user data
1const user = await WP.getProfile(); 2console.log(user);
Fetch your trades and transactions history
1const history = WP.myHistory(0, '2022-11-11', '2022-12-12', 'DESC'); 2console.log(history);
Change your tradelink
1let data = await WP.changeTradeLink('https://steamcommunity.com/tradeoffer/new/?partner=900267897&token=P2YkRJOk'); 2console.log(data);
Save new Steam API key
1let data = await WP.setMyKeys('11EDA9771EB4A200B579A530009CC000'); 2console.log(data);
Buy items using item_id and send to specific tradelink
1const purchase = await WP.buyItemWithId(17441538677, 798500, 'oFvyi0Ma', '378049039'); 2console.log(purchase);
Buy item by name and send to specific tradelink
1const purchase = await WP.buyItemWithName( 2 'AK-47 | Redline (Field-Tested)', 3 15000, 4 'oFvyi0Ma', 5 '378049039', 6 null, 7 'csgo', 8); 9console.log(purchase);
Fetch all unique items and their min price and count
1const items = await WP.getPrices('csgo'); 2console.log(items);
Fetch all dopplers phases by filters
1const items = await WP.getPricesDopplers('any'); 2console.log(items);
Fetch all listings by names
1const items = await WP.massInfo(['AK-47 | Redline (Field-Tested)', 'csgo']); 2console.log(items);
Search available items by name(s)
1const items = await WP.searchItems(['AK-47 | Redline (Field-Tested)', 'csgo']); 2console.log(items);
Checking the status of many steam trades by project_id identifier
1const items = await WP.customTradeRequest(['my_id_1', 'my_id_2']); 2console.log(items);
Checking the status of many steam trades by Waxpeer ids
1const items = await WP.tradeRequestStatus(['12345', '23456']); 2console.log(items);
Fetches available item(s) based on the item_id(s) passed in query
1const items = await WP.checkItemAvailability(['17441538677', '17441538678']); 2console.log(items);
Check tradelink validity
1const data = await WP.validateTradeLink('https://steamcommunity.com/tradeoffer/new/?partner=900267897&token=P2YkRJOk'); 2console.log(data);
Get recent purchases by filters
1const data = await WP.getHistory('153912146', 'ssR242yo'); 2console.log(data);
Fetch trades that need to be sent
1const data = await WP.readyToTransferP2P('11EDA9771EB4A200B579A530009CC000'); 2console.log(data);
Force p2p status check. Recommended for usage with poor network connections
1const data = await WP.checkWssUser('765611983383140000'); 2console.log(data);
Edit price for listed items
1const data = await WP.editItems([{ item_id: 1, price: 1 }], 'csgo'); 2console.log(data);
Fetch my inventory
1const data = await WP.fetchInventory('csgo'); 2console.log(data);
Get items that you can list for sale
1const data = await WP.getMyInventory(0, 'csgo'); 2console.log(data);
Get listed steam items
1const data = await WP.myListedItems('csgo'); 2console.log(data);
List steam items from inventory
1const data = await WP.listItemsSteam([{ item_id: 1, price: 1 }], 'csgo'); 2console.log(data);
Remove item(s) by item id(s)
1const data = await WP.removeItems([1, 2, 3, 4]); 2console.log(data);
Remove all listings
1const data = await WP.removeAll('csgo'); 2console.log(data);
Buy order trigger history
1const data = await WP.buyOrderHistory(0, 'csgo'); 2console.log(data);
Active buy orders. Sorted by price DESC, if a filter by name is specified
1const data = await WP.buyOrders(0, 'AK-47 | Redline (Field-Tested)', '1', 'csgo'); 2console.log(data);
Create a buy order to auto purchase items. Currently independent of the p2p status of the user
1const data = await WP.createBuyOrder('AK-47 | Redline (Field-Tested)', 5, 15000, 'csgo'); 2console.log(data);
Edit buy order
1const data = await WP.editBuyOrder(123, 5, 1000); 2console.log(data);
Remove buy order(s)
1const data = await WP.removeBuyOrder([1, 2, 3]); 2console.log(data);
Remove all buy orders by filters
1const data = await WP.removeAllOrders('csgo'); 2console.log(data);
Fetches items based on the game you pass as a query
1const data = await WP.getItemsList(0, null, 'knife', 'DESC'); 2console.log(data);
Fetches recommended item price and other info
1const data = await WP.getSteamItems(730); 2console.log(data);
Merchant. Check if user is in system
1const data = await WP.getMerchantUser('76561198000000000', 'my_merchant'); 2console.log(data);
Merchant. Insert a user into a system
1const data = await WP.postMerchantUser( 2 'my_merchant', 3 'https://steamcommunity.com/tradeoffer/new/?partner=900267897&token=P2YkRJOk', 4 '76561198000000000', 5); 6console.log(data);
Merchant. Fetch user inventory
1const data = await WP.MerchantInventoryUpdate('76561198000000000', 'my_merchant'); 2console.log(data);
Merchant. Get items that you can list for the user
1const data = await WP.MerchantInventory('76561198000000000', 'my_merchant', 730); 2console.log(data);
Merchant. List steam items from inventory
1const data = await WP.MerchantListItemsSteam('my_merchant', '76561198000000000', [{ item_id: 1, price: 1 }]); 2console.log(data);
Merchant. Returns history of deposits
1const data = await WP.MerchantDepositsHistory( 2 'my_merchant', 3 '76561198000000000', 4 'aaabe17b-dddd-4444-affd-dcad3fa6fbbe', 5); 6console.log(data);
Trade websocket events that you need to implement
1TS.on('send-trade', (message: TradeWebsocketCreateTradeData) => { 2 console.log(message); 3}); 4TS.on('cancelTrade', (message: TradeWebsocketCancelTradeData) => { 5 console.log(message); 6}); 7TS.on('accept_withdraw', (message: TradeWebsocketAcceptWithdrawData) => { 8 console.log(message); 9}); 10TS.on('user_change', ({ can_p2p }: TradeWebsocketChangeUser) => { 11 console.log(can_p2p); //example: true 12});
Website websocket events
1//manual sub events [csgo,rust,tf2,dota2] 2WS.on('new', (message: IInventoryEmit) => { 3 console.log(message); //waxpeer new item event 4}); 5WS.on('update', (message: IInventoryEmit) => { 6 console.log(message); //waxpeer item removed event 7}); 8WS.on('removed', (message: IInventoryEmit) => { 9 console.log(message); //waxpeer item removed event 10}); 11 12//auto sub after auth 13WS.on('change_user', (message: ChangeUserEvent) => { 14 if (message.name === 'wallet') console.log(message); // user change event 15}); 16WS.on('steamTrade', (message: SteamTrade) => { 17 console.log(message); //waxpeer trade event 18});
API error handling
1try { 2 let user = await WP.getProfile(); 3 console.log(user); 4} catch (e) { 5 let timeout = axios.isCancel(e) ? true : false; 6 let response = e?.response?.data; 7 let status_code = e?.response?.status; 8 console.log({ timeout, status_code, response }); //{ timeout: false, status_code: 403, response: { success: false, msg: 'wrong api' } } 9}
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 9/12 approved changesets -- score normalized to 7
Reason
4 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-8hc4-vh64-cxmj
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
Reason
2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 27 are checked with a SAST tool
Score
3.1
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More