Search the Community
Showing results for tags 'error'.
-
Hello everyone! Due to recent update I tried implementing buy order confirmation and I failed (partly)π. I came here to ask for help because It seems I can't understand why my code runs into the problems. here are the pieces of my code: function getCookiesHeaders(contentLength, cookiesStr, itemName, game) { return { Accept: "*/*", "Accept-Encoding": "gzip, deflate, br, zstd", "Accept-Language": "en-US,en;q=0.9", Connection: "keep-alive", "Content-Length": contentLength, "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8", Cookie: cookiesStr, Host: "steamcommunity.com", Origin: "https://steamcommunity.com", Referer: `https://steamcommunity.com/market/listings/${ GAME_IDENTIFIERS[game] }/${encodeURI(itemName)}`, "Sec-Fetch-Dest": "empty", "Sec-Fetch-Mode": "cors", "Sec-Fetch-Site": "same-origin", "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36", "sec-ch-ua": '"Google Chrome";v="138", "Not)A.Brand";v="8", "Chromium";v="138"', "sec-ch-ua-mobile": "?0", "sec-ch-ua-platform": '"Windows"', }; } function getParamsWithFee(cookies, priceInfo) { const { converted_price: subtotal, converted_fee: fee } = priceInfo; return { sessionid: cookies.sessionid, currency: 18, subtotal, fee, total: fee + subtotal, quantity: 1, billing_state: "", save_my_address: 0, confirmation: 0 }; } function generateListingIdLink(listingId) { return "https://steamcommunity.com/market/buylisting/" + listingId; } async function buyItem(itemName, priceDetails, listingId, game, buyingCookies) { // all these params are fine const confData = { identitySecret: "myIdentitySecretFromMyFile", steamId: "mySteamIdFromMyFile", cookies: buyingCookies }; const { cookies, cookiesStr } = getStrObjCookies(buyingCookies); const params = getParamsWithFee(cookies, priceDetails); const { bodyParams, contentLength } = getSearchParamsData(params); const headers = getCookiesHeaders(contentLength, cookiesStr, itemName, game); const sendBuyReq = async () => { try{ const response = await axios.post(generateListingIdLink(listingId), bodyParams, { headers, validateStatus: (statusCode) => { return statusCode <= 400 || statusCode === 406}}) // validateStatus needs to be done because axios thinks that 406 statusCode here is error and it falls into catch scope console.log('Response status:', response.status); return response; }catch(err){ console.log(err.message, "--errorMsg--"); throw err; } } try { const { data } = await sendBuyReq(); // that's fine it works great. From SDA it's clearly visible that the buy order is set. // I tried here await waitTime(2) so my buy information could get in time to the servers. await confirmBuyListing(confData); // The problem might be right here but it's unlikely because by itself it works await waitTime(1); // I tried increasing time from 1 sec to 2 secs. bodyParams.set("confirmation", data.confirmation?.confirmation_id); // updataing params with confirmationId to send new buyLink() const { data: finalizedData } = await sendBuyReq(); // THE MAIN PROBLEM IS HERE if (finalizedData.success === 22) console.log(finalizedData); // testing } catch (err) { console.log(err); } } I tried checking for confirmation_id and it's fine. Left that just as bodyParams.set("confirmation", data.confirmation?.confirmation_id); I think that line with "// THE MAIN PROBLEM IS HERE" is main part because when I make request it shows "status:502" but the original repetitave steam request shows "status:406" And this is the part where I can't understand why I get 502 code in my code. If needed I will add confirmBuyListing function for clarification. Shortly I tested the function with browser manual buying and it confirmed and I bought the item Despite what I wrote above my second thought would be, the problem lies within both confirmation function and buyLink function. I've seen 3 diffrent projects that this confirmation logic was implemented in: C#, JS, PYTHON and I chose python approach because pythonists have already confirmed that they solved this confirmation problem so I tried to follow their solution (this solution could be found in steamPy issues on git). I don't know what is the cause of that status 502. I did almost everything I prayed and cursed and still can't find the cause of that. I am not giving up on this but the only thing I am looking here is helpπ°π° *Possible solution is to run python solution directly in my js file from pythonists (the last thing I wanna do).
- 1 reply
-
- confirmation
- request
-
(and 2 more)
Tagged with:
-
I'm trying to reconnect the user and I'm handling all possible errors. As you can see in the logs, the first module I wrote in the stack trace is `SteamAccountClient.login()`, which calls `client.logOn() (a method from steam-user)` This image shows the code for `SteamAccountClient.login()`. It's wrapping `client.logOn()` in a try-catch block, so no error should've be thrown. I noticed an internal use of the `logOn()` method within a timeout, but without any try-catch block. This could be why my app is crashing, even though it's shown in the stack trace.
- 1 reply
-
- steam-user
- error
-
(and 2 more)
Tagged with:
-
Hey! I'm trying to make some requests with httpProxy, but I'm facing issues already with the initial connection. This is my code: import SteamUser from 'steam-user'; const client = new SteamUser({ httpProxy: 'http://USER:[email protected]:60000', // webCompatibilityMode: true, }); client.on('debug', (msg) => console.log(msg)); client.logOn({ anonymous: true }); client.on('loggedOn', async function (details) { console.log('Logged into Steam as ' + client.steamID.getSteam3RenderedID()); console.log('with public ip: ' + client.publicIP); client.logOff(); process.exit(); }); I'm using Node v16.20.2 and compared an older version of steam-user (4.19.4) and newer version (5.0.4) with a same/similar result. 4.19.4 debug log: [T1] Connecting to TCP CM: 205.196.6.214:27018 and stays stuck here. 4.19.4 debug log with webCompatibilityMode: true: Forcing protocol to EConnectionProtocol.WebSocket because webCompatibilityMode is enabled [W1] Randomly chose WebSocket CM ext3-sto2.steamserver.net:27024 [W1] WebSocket disconnected with error: unable to get local issuer certificate [W1] Handling connection close and keeps repeating a similar message over and over again. 5.0.4 debug log: GetCMListForConnect error: unable to get local issuer certificate Emitted 'error' event on SteamUser instance at: at SteamUser._doConnection (/node_modules/.pnpm/[email protected]/node_modules/steam-user/components/09-logon.js:299:10) at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', proxyConnecting: false Repeats the first line few times and then throws the error. 5.0.4 debug log with webCompatibilityMode: true: Forcing protocol to EConnectionProtocol.WebSocket because webCompatibilityMode is enabled GetCMListForConnect error: unable to get local issuer certificate Emitted 'error' event on SteamUser instance at: at SteamUser._doConnection (/node_modules/.pnpm/[email protected]/node_modules/steam-user/components/09-logon.js:299:10) at processTicksAndRejections (node:internal/process/task_queues:96:5) { code: 'UNABLE_TO_GET_ISSUER_CERT_LOCALLY', proxyConnecting: false Repeats the first 2 lines few times and then throws the error. I'd happily provide any more details if necessary. I would really appreciate any directions or insight into what might cause the issue.
-
node_modules/steam-user/components/helpers.js:247 let parts = jwt.split('.'); ^ TypeError: jwt.split is not a function
-
This happens when requiring the steam-user package. I've tried installing the lzma package manually and using different versions of node but still nothing. I'm pretty new to this stack as a whole so please be nice, just trying to get the package to work.
-
Could i have some help with the Access denied error when using getEncryptedAppTicket The problem i am having is that getEncryptedAppTicket returns Access Denied Also clientSteam.accountName returns undefined even though clientSteam.steamID is returning a Valid User ID Code Below: clientSteam.logOn({ 'accountName': username, 'password': password }); clientSteam.on('loggedOn', details => { console.log('[Steam]: Signed into Steam as ' + clientSteam.steamID + '.' + ' ' + clientSteam.accountName ); clientSteam.getEncryptedAppTicket(AppId, null, (err, ticket) => { if (err) { console.log("[Steam]: AppTicket error: " + err); return; }
-
calling getManifest returns the error: Error: Fail at Object.exports.eresultError (test\node_modules\steam-user\components\helpers.js:96:12) at SteamUser.<anonymous> (test\node_modules\steam-user\components\cdn.js:155:27) at SteamUser._handleMessage (test\node_modules\steam-user\components\messages.js:629:34) at SteamUser._handleNetMessage (test\node_modules\steam-user\components\messages.js:552:7) at SteamUser._processMulti (test\node_modules\steam-user\components\messages.js:676:8) { eresult: 2 } ^ this seems to be an issue with "getCDNAuthToken" as when we're simply calling getManifest(730, 731, manifestid, (result) => { console.log(e) }) simply returns the error "eresult: 2"
-
I have copied this code and need help what i need to change to make it work... Items that bot is requiring opponent has, so the item is existing and if the guy doesnt have the item, console says that. I got this error and dont know why.. . the script is here if(isNaN(amount) || amount === undefined){ console.log('invalid number'); } else{ var count = 0; var i = 0; console.log("Creating Offer, please wait!"); //Check Players inventory for the keys, and make sure we have enough sets to supply var offer = manager.createOffer(_message); offer.getPartnerInventoryContents(440, 2, function(err, inventory, currencies){ if(err){ console.log(err); } var a = []; for(var i = 0; i < inventory.length; ++i){ if(inventory.market_hash_name == 'Refined Metal' && a.length < amount){ console.log("Adding Item"); a.push(inventory.id); offer.addTheirItem({id: inventory.id, appid: 440, contextid: 2}); console.log("Length of a "+a.length); console.log(a); ++count; } } inventory.forEach(function(val){ if(val.market_hash_name == 'Refined Metal'){ console.log("Adding Item"); offer.addTheirItem({id: val.instanceid, appid: 440, contextid: 2}); ++count; } }); if(count < amount){ console.log("count: "+count); console.log("You don't have enough keys for me to send this trade."); } else{ offer.send(function(err, status){ if(err){ console.log(err); console.log("An Error has Occured while sending offer."); } if(status == "pending"){ console.log("Confirming Offer!"); } if(status == "sent"){ console.log("Offer Sent!"); } }); } }); }
-
I'm trying to compile "Unrestricted FOV" plugin but I'm getting the following error: Can you help me, please?)
-
Error: Access Denied when trying to set cookies for two different bots
Guest posted a topic in node-steamcommunity
I am trying to set cookies for two different bots running in the same file, and when I get to the second bot, the script errors: Error: Access Denied at SteamCommunity.<anonymous> (C:\Users\easto\node_modules\steamcommunity\components\webapi.js:15:20) at Request._callback (C:\Users\easto\node_modules\steamcommunity\components\http.js:67:15) at Request.self.callback (C:\Users\easto\node_modules\request\request.js:185:22) at emitTwo (events.js:126:13) at Request.emit (events.js:214:7) at Request.<anonymous> (C:\Users\easto\node_modules\request\request.js:1161:10) at emitOne (events.js:116:13) at Request.emit (events.js:211:7) at Gunzip.<anonymous> (C:\Users\easto\node_modules\request\request.js:1083:12) at Object.onceWrapper (events.js:313:30) The second bot successfully logins, it only errors when setting the cookies for the second bot. -
Hello world :3. I'm trying to catch any posible error output when i login. First i tried with try catch, but it didn't work in any way i tried, then investigating i got to know that it needed to be done by adding an event listener to the error event, but when i try to implement the event listener, i get the error that evenlistener is not a function: client.logOn.addEventListener("error", function(err) { if ( err ) { console.log('Critical error!!!!! '+ err + ' Check data of:'+client.steamID) } }, true); Since i already did this post, i'll add one more question; How can i call the value from a diferent place, for example if i want to show the value of "limited" from client.on('accountLimitations'), and call it in a fs.writefile that i have inside client.on('loggedOn', i have to do it by making a global.limited, or how can i?, the other way i tried was client.accountLimitations.limited, but it always gets a undefined or null result. Sorry for the bother and noob questions :v Thanks for taking the time to read my problem. Have a great day.
-
I get a number of different errors when running the bot and they are always to do with the offers. This is what I have so far with the new offer for a stranger and the owner offer stuff. Just to let anyone know this bot sells TF2 Scrap for Steam Emoticons. The Code: manager.on('newOffer', (offer) => { let counter = 0 if (offer.itemsToGive.length == offer.itemsToReceive.length) { for (let i = 0; i < offer.itemsToGive.length; i++) { if (offer.itemsToReceive[i].type.includes("Emoticon") && offer.itemsToGive[i].name == "Scrap Metal") { counter++ } } if (counter == offer.itemsToGive.length) { offer.accept(function(err, status) { if (err) { console.log("Unable to accept offer: " + err.message); } else { console.log("Offer accepted: " + status); if (status == "pending") { community.acceptConfirmationForObject(config.identity, offer.id, function(err) { if (err) { console.log("Can't confirm trade offer: " + err.message); } else { console.log("Trade offer " + offer.id + " confirmed"); } }) } } }) } } else if (offer.itemsToGive.length == 0){ offer.accept((err, status) => { if (err) { console.log(err); } else { console.log(`Donation accepted. Status: ${status}.`); } }); } else { offer.decline(err => { if (err) { console.log(err); } else { console.log('Donation declined (wanted our items).'); } }); } }); //owner send trade, bot instantly accepts manager.on('newOffer', (offer) => { if (offer.partner.getSteamID64() === config.ownerID) { acceptOffer(offer); console.log("Successfully accepted") } else { delcineOffer(offer); } }); Some examples of errors I get, "Cannot read property 'partner' of undefined" that error is from the owner code. Then when removing that code the bot works, but it means I cannot send trades as the owner with out logging onto the bot's account and accepting it manually. I hope someone can help me. Thanks Unmet
- 1 reply
-
- node.js
- node-steam-tradeoffer-manager
- (and 5 more)
-
Sometimes when i use getUserDetails(), i receive the error: has declined your trade request. why i'm getting this error, and how may i avoid this?
- 1 reply
-
- node.js
- node-steam-tradeoffer-manager
-
(and 2 more)
Tagged with:
-
Hello, When I send offer i get error: "callback is not a function" in steam-tradeoffer-manager/lib/helpers.js in 45 line. That is my code: function sendOffer(customer, bot, customerItems, botItems) { var botInventory = manager.getUserInventoryContents(customer, 753, 6, true, function(err, inventory, currencies) { return inventory; }); var customerInventory = manager.getUserInventoryContents(bot, 753, 6, true, function(err, inventory, currencies) { return inventory; }); var Exchange = manager.createOffer(customer); var message = "Thank You for trading with me. Here's your cards. This offer expires in 10 minutes."; var ExchangeBot = GetExchangeItems(botInventory, botItems); var ExchangeUser = GetExchangeItems(customerInventory, customerItems); Exchange.addTheirItems(ExchangeUser); Exchange.addMyItems(ExchangeBot); Exchange.send(message, 'Dh58A2w', function(err, status) { console.log('Exchange ID:' + Exchange.id + ' send: ', status); }); } And I have second question. How to send offers to friends without token?
- 1 reply
-
- node.js
- node-steam-tradeoffer-manager
-
(and 1 more)
Tagged with: