Skip to content

Commit

Permalink
Updated documentation accordingly (misses some links)
Browse files Browse the repository at this point in the history
  • Loading branch information
BOTREL Kilian committed Sep 10, 2021
1 parent 46a6f44 commit a04e6c1
Show file tree
Hide file tree
Showing 2 changed files with 133 additions and 61 deletions.
192 changes: 132 additions & 60 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ These methods are designed to fill the gaps if the API evolves and the future bu
- [`futuresCashinPosition`](#futuresCashinPosition)
- [`futuresCloseAllPosisitions`](#futuresCloseAllPosisitions)
- [`futuresClosePosition`](#futuresClosePosition)
- [`futuresIndexHistory`](#futuresIndexHistory)
- [`futuresBidOfferHistory`](#futuresBidOfferHistory)
- [`futuresFixingHistory`](#futuresFixingHistory)
- [`futuresCarryFeesHistory`](#futuresCarryFeesHistory)
- [`deposit`](#deposit)
- [`depositHistory`](#depositHistory)
- [`futuresHistory`](#futuresHistory)
Expand Down Expand Up @@ -172,9 +176,19 @@ Retrieve all or a part of user positions.
```yaml
type:
type: String
required: true
enum: ['open', 'running', 'closed']
default: 'open'
from: Integer
required: false
to: Integer
required: false
enum: ['all', 'open', 'running', 'closed']
default: 'all'
limit: Integer
required: false
default: 100
```

Example:
Expand All @@ -185,6 +199,8 @@ Example:
})
```

[`GET /futures`](https://docs.lnmarkets.com/api/v1/#history) documentation for more details.

#### futuresUpdatePosition

Modify stoploss or takeprofit parameter of an existing position.
Expand Down Expand Up @@ -336,96 +352,162 @@ Example:

[`DELETE /futures`](https://docs.lnmarkets.com/api/v1/#cancel) documentation for more details.

#### deposit
#### futuresIndexHistory

Add funds to your LN Markets balance.
Get index history data.

```yaml
amount:
type: Integer
required: true
unit:
type: String
from: Integer
required: false
default: 'sat'
to: Integer
required: false
limit: Integer
required: false
default: 100
```

Example:

```JS
await lnm.deposit({
amount: 25000
await lnm.futuresIndexHistory({
limit: 20
})
```

[`POST /user/deposit`](https://docs.lnmarkets.com/api/v1/#deposit) documentation for more details.
[`GET /futures/history/index`]() documentation for more details (Waiting for new link).

#### depositHistory
#### futuresBidOfferHistory

Retrieve deposit history for this user.
Get bid and offer data over time.

```yaml
nbItem:
type: Integer
from: Integer
required: false
default: 50
index:
type: Integer
to: Integer
required: false
default: 0
getLength:
type: Boolean
limit: Integer
required: false
default: false
start:
type: Integer
default: 100
```

Example:

```JS
await lnm.futuresBidOfferHistory({
limit: 20
})
```

[`GET /futures/history/bid-offer`]() documentation for more details (Waiting for new link).

#### futuresFixingHistory

Get fixing data history.

```yaml
from: Integer
required: false
end:
type: Integer
to: Integer
required: false
limit: Integer
required: false
default: 100
```

Example:

```JS
await lnm.depositHistory({
nbItem: 30
await lnm.futuresFixingHistory({
limit: 20
})
```

[`GET /user/deposit`](https://docs.lnmarkets.com/api/v1/#deposit) documentation for more details.
[`GET /futures/history/fixing`]() documentation for more details (Waiting for new link).

#### futuresHistory
#### futuresCarryFeesHistory

Retrieve the past bid, offer and index data recorded.
Get carry-fees history.

```yaml
table:
type: String
from: Integer
required: false
to: Integer
required: false
limit: Integer
required: false
default: 100
```

Example:

```JS
await lnm.futuresCarryFeesHistory({
limit: 20
})
```

[`GET /futures/carry-fees`]() documentation for more details (Waiting for new link).

#### deposit

Add funds to your LN Markets balance.

```yaml
amount:
type: Integer
required: true
enum: ['bid_offer', 'index']
unit:
type: String
required: false
default: 'sat'
```

Example:

```JS
await lnm.deposit({
amount: 25000
})
```

[`POST /user/deposit`](https://docs.lnmarkets.com/api/v1/#deposit) documentation for more details.

#### depositHistory

Retrieve deposit history for this user.

```yaml
from:
type: Integer
required: false
to:
type: Integer
required: false
limit:
name: limit
type: Integer
required: false
default: 1000
```

Example:

```JS
await lnm.futuresHistory({
table: 'index',
limit: 250
await lnm.depositHistory({
limit: 30
})
```

[`GET /futures/history`](https://docs.lnmarkets.com/api/v1/#futures-data-history) documentation for more details.
[`GET /user/deposit`](https://docs.lnmarkets.com/api/v1/#deposit) documentation for more details.


#### getAnnouncements

Expand Down Expand Up @@ -457,9 +539,7 @@ Example:
await lnm.getLeaderboard()
```

[`GET /state/leaderboard`](https://docs.lnmarkets.com/api/v1/#api-leaderboard) documentation for more details.

[`GET /futures`](https://docs.lnmarkets.com/api/v1/#history) documentation for more details.
[`GET /futures/leaderboard`]() documentation for more details. (Waiting for new link)

#### getUser

Expand Down Expand Up @@ -582,22 +662,15 @@ Example:
Retrieve user withdraw history.

```yaml
nbItem:
type: Integer
required: false
default: 50
index:
from:
type: Integer
required: false
default: 0
getLength:
type: Boolean
required: false
default: false
start:
to:
type: Integer
required: false
end:
name: limit
type: Integer
required: false
```
Expand All @@ -606,7 +679,7 @@ Example:

```JS
await lnm.withdrawHistory({
nbItem: 25
limit: 25
})
```

Expand Down Expand Up @@ -635,7 +708,6 @@ Example:
```

[`POST /lnurl/withdraw`](https://docs.lnmarkets.com/api/v1/#create-a-lnurl-withdraw) documentation for more details.
Use LNURL to withdraw directly from the user balance to the wallet

#### requestAPI

Expand Down Expand Up @@ -675,4 +747,4 @@ Example:

## Examples

You can find some code examples in the `examples`folder !
You can find some code examples in the `examples` folder !
2 changes: 1 addition & 1 deletion src/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ module.exports = class LNMarketsHttp {
return this.requestAPI(options)
}

futuresCarryFees(params) {
futuresCarryFeesHistory(params) {
const options = {
method: 'GET',
endpoint: '/futures/carry-fees',
Expand Down

0 comments on commit a04e6c1

Please sign in to comment.