Migrate to yarn

This commit is contained in:
2022-07-07 00:51:28 +03:00
parent 1af1048670
commit 78fd1b5adf
32 changed files with 10289 additions and 20356 deletions

24
gather/src/items/Part.ts Normal file
View File

@@ -0,0 +1,24 @@
import Api from '../api'
export default class Part {
part: string
urlPath: string
url: string
amount: number
constructor (set: string, part: string, amount: number = 1) {
this.part = part
this.urlPath = `${set}_prime_${part}`
this.url = `https://warframe.market/items/${set}_prime_${part}`
this.amount = amount ?? 1
}
async getPrice (): Promise<number> {
const orders = await Api.getSortedOrders(this.urlPath)
if (orders.length === 0) {
return 0
}
return Number(orders[0].platinum) * this.amount
}
}