@dedwatson/steam-mobile-confirmations
An updated trade-confirmation module for node-steam with support socks5 proxy
Last updated 4 months ago by dedwatson .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @dedwatson/steam-mobile-confirmations 
SYNC missed versions from official npm registry.

node-steam-mobile-confirmations

A pure JS library for accepting mobile confirmations. This is a better, more updated version of GaletskyIvan's older module.

Add support socks proxy.

Currently a work-in-progress.

Functionality

This will aim to:

  • Fetch mobile confirmations
  • Accept / Deny confirmations
  • Accept / Deny multi-confirmations
  • ...have good documentation

Installation

In the near future, you'll be able to do this: npm install steam-mobile-confirmations

Usage

Instantiate a SteamMobileConfirmations object, with the required defaults (keep reading for more detail):

var SteamMobileConfirmations = require('steam-mobile-confirmations');
var steamConfirmations = new SteamMobileConfirmations({
  steamId: steamId64,
  identitySecret: identitySecret,
  webCookie: webCookie
});

Obtain session information with node-steam and its plugin steam-weblogon

Examples

Coming soon.

Methods

The options param of all methods is an object. All callbacks are supplied with Error as the first argument, or null if no errors occurred.

constructor(options)

This sets up all final values, and should only be called once.

Options:

  • steamId is a valid SteamID64
  • identitySecret is the secret key used for generating confirmation codes. (not the one used for generating login codes)
  • webCookie is the cookies we need for interacting with steam. Fetch them from the modules mentioned above.
  • deviceId (optional) is the device id used for all calls. Starts with android: - one will be generated if you do not provide one.
  • steamOffset (optional) is the time offset between you and steam. This is highly recommended to be provided, as not providing it can cause avoidable errors. You can find this by running getTimeOffset() from the node-steam-totp module. (Use the returned offset value)
  • waitTime (optional) is how long (in milliseconds) the module will wait if it encounters an error before trying again. (Defaults to 10000)

updateCookies(webCookie)

This method updates the current session / cookies currently in use. Run this after the error needsNewSession is emitted.

webCookie can be obtained using node-steam and its plugin steam-weblogon

fetchConfirmations(callback)

Returns all currently outstanding (active) confirmations.

The second argument to callback will be an array of Confirmation objects.

acceptConfirmation(confirmation, callback)

This accepts a confirmation (or array of confirmations) from the fetchConfirmations() call. If an error occurs while accepting, it tries once more before erroring.

The second argument to callback will be a success boolean. (true for confirmed, false for error.)

getConfirmationTradeId(confirmation, callback)

You will likely not need to use this, since the trade offer ID is already included in the Confirmation object.

This will only fetch the confirmation information again, and then return the trade offer ID.

The second argument to callback will be the tradeId, fetched from Valve.

Events

'needsNewSession'

This is called when Steam returns a specific error, and your Steam Community session needs to be re-connected. Re-run steam-weblogon, and then call updateCookies() with the new cookies.

No calls will be made to Steam until you have called updateCookies()

License

MIT

Current Tags

  • 1.1.2                                ...           latest (4 months ago)

1 Versions

  • 1.1.2                                ...           4 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 0
Dependencies (4)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |