steamutils 1.1.50 → 1.1.52
Sign up to get free protection for your applications and to get access to all the features.
- package/SteamClient.js +2 -0
- package/index.js +23 -9
- package/package.json +1 -1
package/SteamClient.js
CHANGED
@@ -698,6 +698,7 @@ function SteamClient({
|
|
698
698
|
}
|
699
699
|
|
700
700
|
steamClient.on('loggedOn', async (loggedOnResponse) => {
|
701
|
+
await sleep(10000)
|
701
702
|
steamClient.setPersona(SteamUser.EPersonaState.Online)
|
702
703
|
await sendHello()
|
703
704
|
callEvent(events.loggedOn)
|
@@ -707,6 +708,7 @@ function SteamClient({
|
|
707
708
|
}, 60000, 'autoRequestFreeLicense')
|
708
709
|
}
|
709
710
|
if (autoPlay) {
|
711
|
+
await sleep(10000)
|
710
712
|
onCookie(function () {
|
711
713
|
autoGamePlay()
|
712
714
|
})
|
package/index.js
CHANGED
@@ -5426,16 +5426,16 @@ class SteamUser {
|
|
5426
5426
|
return trade_offer_access_url
|
5427
5427
|
}
|
5428
5428
|
|
5429
|
-
async sendTradeOffer({tradeURL,
|
5429
|
+
async sendTradeOffer({tradeURL, myAssets, theirAssets, tradeoffermessage = ''}) {//partner: steamid not accountid
|
5430
5430
|
// const meExample = {
|
5431
|
-
//
|
5432
|
-
//
|
5433
|
-
//
|
5431
|
+
// assets: [{appid: 730, contextid: "2", amount: 1, assetid: "30492209501"}],
|
5432
|
+
// currency: [],
|
5433
|
+
// ready: false
|
5434
5434
|
// }
|
5435
5435
|
// const themExample = {
|
5436
|
-
//
|
5437
|
-
//
|
5438
|
-
//
|
5436
|
+
// assets: [{appid: 730, contextid: "2", amount: 1, assetid: "30494845811"}],
|
5437
|
+
// currency: [],
|
5438
|
+
// ready: false
|
5439
5439
|
// }
|
5440
5440
|
const tradeURLParams = url.parse(tradeURL).query.split('&').reduce((accumulator, currentValue, index) => ({
|
5441
5441
|
...accumulator, [currentValue.split('=')[0]]: currentValue.split('=')[1]
|
@@ -5454,8 +5454,16 @@ class SteamUser {
|
|
5454
5454
|
json_tradeoffer: encodeURIComponent(JSON.stringify({
|
5455
5455
|
newversion: true,
|
5456
5456
|
version: 3,
|
5457
|
-
me
|
5458
|
-
|
5457
|
+
me: {
|
5458
|
+
assets: myAssets,
|
5459
|
+
currency: [],
|
5460
|
+
ready: false
|
5461
|
+
},
|
5462
|
+
them: {
|
5463
|
+
assets: theirAssets,
|
5464
|
+
currency: [],
|
5465
|
+
ready: false
|
5466
|
+
},
|
5459
5467
|
})),
|
5460
5468
|
captcha: '',
|
5461
5469
|
trade_offer_create_params: encodeURIComponent(JSON.stringify({trade_offer_access_token: tradeURLParams.token})),
|
@@ -5463,6 +5471,12 @@ class SteamUser {
|
|
5463
5471
|
method: 'POST',
|
5464
5472
|
})
|
5465
5473
|
return result.data
|
5474
|
+
const resultExample = {
|
5475
|
+
tradeofferid: "6093097382",
|
5476
|
+
needs_mobile_confirmation: true,
|
5477
|
+
needs_email_confirmation: false,
|
5478
|
+
email_domain: "gmail.com"
|
5479
|
+
}
|
5466
5480
|
}
|
5467
5481
|
}
|
5468
5482
|
|