Files
warframe-center/gather/src/items/Part.js
2022-03-14 01:41:52 +03:00

16 lines
402 B
JavaScript

const Api = require('../api')
module.exports = class Part {
constructor (set, part, amount) {
this.part = part
this.urlPath = `${set}_prime_${part}`
this.url = `https://warframe.market/items/${set}_prime_${part}`
this.amount = amount ?? 1
}
async getPrice () {
const orders = await Api.getSortedOrders(this.urlPath)
return Number(orders[0].platinum) * this.amount
}
}