Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auction methods #22

Merged
merged 2 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs-ru.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ await api.market.search({ categoryName: 'steam', pmin: 250, pmax: 250 })
* `currency: string` - валюта для параметра amount
* `holdLengthValue: number` - значение холда
* `holdLengthOption: 'hour'|'day'|'week'|'month'|'year'` - тип значения холда
* `secretAnswer: string` - секретное слово

### market.addItem
Добавляет аккаунт
Expand Down Expand Up @@ -291,3 +292,18 @@ await api.market.search({ categoryName: 'steam', pmin: 250, pmax: 250 })
Удаляет прокси
* `proxyId: number` - айди прокси
* `deleteAll?: boolean` - удалить все прокси

### market.getAuction
Получение информации об аукционе
* `itemId: number` - айди аккаунта

### market.addBid
Добавление новой ставки на аукцион
* `itemId: number` - айди аккаунта
* `amount: number` - сумма в вашей валюте
* `currency: string` - валюта для параметра amount

### market.removeBid
Удаление ставки с аукциона
* `itemId: number` - айди аккаунта
* `bidId: number` - айди ставки, можно узнать с помощью метода market.getAuction
11 changes: 4 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lolzteam/sdk",
"version": "0.2.5",
"version": "0.2.6",
"description": "Lolzteam API for node.js",
"license": "GPL-3.0",
"main": "src/index.js",
Expand Down
17 changes: 17 additions & 0 deletions src/api/market.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,4 +360,21 @@ export class LZTApiMarketGroup extends LZTApiGroup {
extra: extraData
})
}

async getAuction({ itemId } = {}){
return await this.caller.call('GET', `/${itemId}/auction`)
}

async addBid({ itemId, currency, amount } = {}){
return await this.caller.call('POST', `/${itemId}/auction/bid`, {
currency,
amount
})
}

async removeBid({ itemId, bidId } = {}) {
return await this.caller.call('DELETE', `/${itemId}/auction/bid`, {
bid_id: bidId
})
}
}
Loading