quer/the-steam-awards

Multiple Trade offer ? Is it possible?

SENPAY98K opened this issue · 2 comments

Is it possible to use the library steam-tradeoffer-manager into your script to withdraw steam inventories (tf2 or csgo) to a specific account ?

new module for example?

module.exports = function (steamClient, RequestCommunity, RequestStore, SessionID, options, callback) {
	// Get our inventory
	RequestStore.getInventoryContents(730, 2, true, function (err, inventory) {
		if (err) {
			console.log(err);
			return;
		}

		if (inventory.length == 0) {
			// Inventory empty
			console.log("CS:GO inventory is empty");
			return;
		}

		console.log("Found " + inventory.length + " CS:GO items");

		// Create and send the offer
		let offer = RequestStore.createOffer("https://steamcommunity.com/tradeoffer/new/?partner=12345678&token=xxxxxxxx");
		offer.addMyItems(inventory);
		offer.setMessage("Here, have some items!");
		offer.send(function (err, status) {
			if (err) {
				console.log(err);
				return;
			}

			if (status == 'pending') {
				// We need to confirm it
				console.log(`Offer #${offer.id} sent, but requires confirmation`);
				community.acceptConfirmationForObject("identitySecret", offer.id, function (err) {
					if (err) {
						console.log(err);
					} else {
						console.log("Offer confirmed");
					}
				});
			} else {
				console.log(`Offer #${offer.id} sent successfully`);
			}
		});
	});
};
quer commented

i do not think it is. as i use the "steam-node" library. and the library "steam-tradeoffer-manager" from what i can tell, only work on the "steam-user" or "steamcommunity" library.

It is on my todo to find a way to get it to work. but it is way down the pipe line.

but as most is request call. then you can decode the other library, to see the calles. and how it done.

eks like this methode:
https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/blob/7637eff30f5de8a81c35c044db3f37e5aac652ff/lib/classes/TradeOffer.js#L440

where it just a call to accect the offer. then in the "steam-totp" to accept on the mobile. and the "steam-totp" you do have access to in the script

Yes i could get it to work but for a single accounts, while i have +50 so its kinda pain to run the them one by one.
Anyway thanks for the quick reply.