steamutils 1.3.72 → 1.3.73
Sign up to get free protection for your applications and to get access to all the features.
- package/index.js +47 -0
- package/package.json +1 -1
package/index.js
CHANGED
@@ -6048,6 +6048,53 @@ export default class SteamUser {
|
|
6048
6048
|
}
|
6049
6049
|
}
|
6050
6050
|
|
6051
|
+
async getMyMarketHistory({ start = 0, count = 10 } = {}) {
|
6052
|
+
const result = await this._httpRequestAjax({
|
6053
|
+
url: `market/myhistory/render/?query=&start=${start}&count=${count}`,
|
6054
|
+
});
|
6055
|
+
if (result instanceof ResponseError) {
|
6056
|
+
return result;
|
6057
|
+
}
|
6058
|
+
const data = result?.data;
|
6059
|
+
if (data?.success === true) {
|
6060
|
+
const $ = cheerio.load(data.results_html);
|
6061
|
+
const list = [];
|
6062
|
+
$(".market_listing_row").each(function () {
|
6063
|
+
const $1 = $(this);
|
6064
|
+
const id = $1.attr("id");
|
6065
|
+
const listingid = id.substringBetweenOrNull("history_row_", "_");
|
6066
|
+
if (!listingid) {
|
6067
|
+
return;
|
6068
|
+
}
|
6069
|
+
const gainOrLoss = StringUtils.cleanSpace($1.find(".market_listing_gainorloss").text());
|
6070
|
+
const image = $1.find(`.market_listing_item_img`).attr("src");
|
6071
|
+
const price = parseInt($1.find(`.market_table_value .market_listing_price`).text().replaceAll(`(`, "").replaceAll(`)`, "").replaceAll(`₫`, "").replaceAll(`.`, "").replaceAll(`,`, "").trim()) || "";
|
6072
|
+
const item_name = $1.find(".market_listing_item_name").text();
|
6073
|
+
const game_name = $1.find(".market_listing_game_name").text();
|
6074
|
+
|
6075
|
+
const listedOn = StringUtils.cleanSpace($1.find(".market_listing_listed_date + .market_listing_listed_date").text().replaceAll(`Listed:`, ""));
|
6076
|
+
const actedOn = StringUtils.cleanSpace($1.find(".market_listing_whoactedwith + .market_listing_listed_date").text().replaceAll(`Listed:`, ""));
|
6077
|
+
|
6078
|
+
const status = StringUtils.cleanSpace($1.find(".market_listing_whoactedwith").text());
|
6079
|
+
|
6080
|
+
list.push({
|
6081
|
+
id,
|
6082
|
+
listingid,
|
6083
|
+
price,
|
6084
|
+
item_name,
|
6085
|
+
game_name,
|
6086
|
+
listedOn,
|
6087
|
+
actedOn,
|
6088
|
+
image,
|
6089
|
+
gainOrLoss,
|
6090
|
+
status,
|
6091
|
+
});
|
6092
|
+
});
|
6093
|
+
const assets = Object.values(data.assets["730"]?.["2"] || {});
|
6094
|
+
return { ...data, list, assets, success: true };
|
6095
|
+
}
|
6096
|
+
}
|
6097
|
+
|
6051
6098
|
async getPlayerReports(token) {
|
6052
6099
|
const param = {
|
6053
6100
|
sessionid: this._sessionId,
|