steamutils 1.1.49 → 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 +26 -13
- 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]
|
@@ -5451,19 +5451,32 @@ class SteamUser {
|
|
5451
5451
|
serverid: 1,
|
5452
5452
|
partner: SteamID.fromIndividualAccountID(tradeURLParams.partner).getSteamID64(),
|
5453
5453
|
tradeoffermessage,
|
5454
|
-
json_tradeoffer: JSON.stringify({
|
5454
|
+
json_tradeoffer: encodeURIComponent(JSON.stringify({
|
5455
5455
|
newversion: true,
|
5456
5456
|
version: 3,
|
5457
|
-
me
|
5458
|
-
|
5459
|
-
|
5457
|
+
me: {
|
5458
|
+
assets: myAssets,
|
5459
|
+
currency: [],
|
5460
|
+
ready: false
|
5461
|
+
},
|
5462
|
+
them: {
|
5463
|
+
assets: theirAssets,
|
5464
|
+
currency: [],
|
5465
|
+
ready: false
|
5466
|
+
},
|
5467
|
+
})),
|
5460
5468
|
captcha: '',
|
5461
|
-
trade_offer_create_params: JSON.stringify({trade_offer_access_token: tradeURLParams.token}),
|
5462
|
-
account: this.getMiniProfileUser(),
|
5469
|
+
trade_offer_create_params: encodeURIComponent(JSON.stringify({trade_offer_access_token: tradeURLParams.token})),
|
5463
5470
|
},
|
5464
5471
|
method: 'POST',
|
5465
5472
|
})
|
5466
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
|
+
}
|
5467
5480
|
}
|
5468
5481
|
}
|
5469
5482
|
|