Skip to main content

steam_tradeoffer_manager/
lib.rs

1//! Makes Steam trade offers easy!
2//! 
3//! Based on the excellent [node-steam-tradeoffer-manager](https://github.com/DoctorMcKay/node-steam-tradeoffer-manager).
4//! 
5//! ## Features
6//! 
7//! - Richly-featured API for creating, accepting, cancelling, and declining trade offers.
8//! - Manages account trade offer state.
9//! - Mobile confirmations.
10//! - Loading inventories.
11//! - Trade history.
12//! - Helper method for getting your Steam Web API key.
13//! - Automatically cancels offers past a set duration during polls.
14//! - Loads descriptions (classinfos) for assets. Classinfos are cached to file and read when
15//!   available. The manager holds a [Least frequently used (LFU) cache](https://en.wikipedia.org/wiki/Least_frequently_used)
16//!   of classinfos in memory to reduce file reads.
17//! - Uses [tokio](https://crates.io/crates/tokio) asynchronous runtime for performing polling.
18//! - Trade items <em>blazingly fast!</em>
19//! 
20//! ## Usage
21//! 
22//! All tasks relating to trade offers can be interfaced through [`TradeOfferManager`]. If more
23//! direct control is needed, the underlying API's can be found in [`api`] and [`mobile_api`].
24//!
25//! See [examples](https://github.com/juliarose/steam-tradeoffers/tree/main/examples).
26
27#![warn(missing_docs)]
28extern crate lazy_static;
29
30// Internal modules
31mod manager;
32mod serialize;
33mod helpers;
34mod classinfo_cache;
35mod time;
36mod session;
37mod static_functions;
38
39// Public modules
40pub mod error;
41pub mod request;
42pub mod response;
43pub mod enums;
44pub mod types;
45pub mod api;
46pub mod mobile_api;
47
48// Re-exports for convenience
49pub use static_functions::get_inventory;
50pub use classinfo_cache::ClassInfoCache;
51pub use manager::{TradeOfferManager, TradeOfferManagerBuilder};
52
53// Polling-related exports in a dedicated submodule
54pub mod polling {
55    //! Models related to polling trade offers.
56    pub use super::manager::polling::{
57        Poll,
58        Result,
59        PollAction,
60        PollType,
61        PollOptions,
62        PollReceiver,
63        PollSender,
64    };
65}
66
67// External crate re-exports
68pub use reqwest;
69pub use reqwest_middleware;
70pub use chrono;
71pub use steamid_ng;
72pub use steamid_ng::SteamID;
73pub use another_steam_totp::get_steam_server_time_offset;