Skip to content

Commit

Permalink
Update Api documentation to have correct required fields (#1167)
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li authored Mar 13, 2024
1 parent 0d41406 commit d92b5b2
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 76 deletions.
82 changes: 36 additions & 46 deletions indexer/services/comlink/public/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/candles/perpetualMarkets/{ticker}', params={
'resolution': '1MIN', 'limit': '0'
'resolution': '1MIN'
}, headers = headers)

print(r.json())
Expand All @@ -359,7 +359,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/candles/perpetualMarkets/{ticker}?resolution=1MIN&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/candles/perpetualMarkets/{ticker}?resolution=1MIN',
{
method: 'GET',

Expand All @@ -381,7 +381,7 @@ fetch('https://dydx-testnet.imperator.co/v4/candles/perpetualMarkets/{ticker}?re
|---|---|---|---|---|
|ticker|path|string|true|none|
|resolution|query|[CandleResolution](#schemacandleresolution)|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|fromISO|query|string|false|none|
|toISO|query|string|false|none|

Expand Down Expand Up @@ -512,7 +512,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/fills', params={
'address': 'string', 'subaccountNumber': '0', 'market': 'string', 'marketType': 'PERPETUAL', 'limit': '0'
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

print(r.json())
Expand All @@ -525,7 +525,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/fills?address=string&subaccountNumber=0&market=string&marketType=PERPETUAL&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/fills?address=string&subaccountNumber=0',
{
method: 'GET',

Expand All @@ -547,9 +547,9 @@ fetch('https://dydx-testnet.imperator.co/v4/fills?address=string&subaccountNumbe
|---|---|---|---|---|
|address|query|string|true|none|
|subaccountNumber|query|number(double)|true|none|
|market|query|string|true|none|
|marketType|query|[MarketType](#schemamarkettype)|true|none|
|limit|query|number(double)|true|none|
|market|query|string|false|none|
|marketType|query|[MarketType](#schemamarkettype)|false|none|
|limit|query|number(double)|false|none|
|createdBeforeOrAtHeight|query|number(double)|false|none|
|createdBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|

Expand Down Expand Up @@ -669,9 +669,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://dydx-testnet.imperator.co/v4/historicalBlockTradingRewards/{address}', params={
'limit': '0'
}, headers = headers)
r = requests.get('https://dydx-testnet.imperator.co/v4/historicalBlockTradingRewards/{address}', headers = headers)

print(r.json())

Expand All @@ -683,7 +681,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/historicalBlockTradingRewards/{address}?limit=0',
fetch('https://dydx-testnet.imperator.co/v4/historicalBlockTradingRewards/{address}',
{
method: 'GET',

Expand All @@ -704,7 +702,7 @@ fetch('https://dydx-testnet.imperator.co/v4/historicalBlockTradingRewards/{addre
|Name|In|Type|Required|Description|
|---|---|---|---|---|
|address|path|string|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|startingBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|
|startingBeforeOrAtHeight|query|string|false|none|

Expand Down Expand Up @@ -746,9 +744,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://dydx-testnet.imperator.co/v4/historicalFunding/{ticker}', params={
'limit': '0'
}, headers = headers)
r = requests.get('https://dydx-testnet.imperator.co/v4/historicalFunding/{ticker}', headers = headers)

print(r.json())

Expand All @@ -760,7 +756,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/historicalFunding/{ticker}?limit=0',
fetch('https://dydx-testnet.imperator.co/v4/historicalFunding/{ticker}',
{
method: 'GET',

Expand All @@ -781,7 +777,7 @@ fetch('https://dydx-testnet.imperator.co/v4/historicalFunding/{ticker}?limit=0',
|Name|In|Type|Required|Description|
|---|---|---|---|---|
|ticker|path|string|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|effectiveBeforeOrAtHeight|query|number(double)|false|none|
|effectiveBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|

Expand Down Expand Up @@ -826,7 +822,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/historical-pnl', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

print(r.json())
Expand All @@ -839,7 +835,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/historical-pnl?address=string&subaccountNumber=0&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/historical-pnl?address=string&subaccountNumber=0',
{
method: 'GET',

Expand All @@ -861,7 +857,7 @@ fetch('https://dydx-testnet.imperator.co/v4/historical-pnl?address=string&subacc
|---|---|---|---|---|
|address|query|string|true|none|
|subaccountNumber|query|number(double)|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|createdBeforeOrAtHeight|query|number(double)|false|none|
|createdBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|
|createdOnOrAfterHeight|query|number(double)|false|none|
Expand Down Expand Up @@ -911,7 +907,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/historicalTradingRewardAggregations/{address}', params={
'period': 'DAILY', 'limit': '0'
'period': 'DAILY'
}, headers = headers)

print(r.json())
Expand All @@ -924,7 +920,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/historicalTradingRewardAggregations/{address}?period=DAILY&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/historicalTradingRewardAggregations/{address}?period=DAILY',
{
method: 'GET',

Expand All @@ -946,7 +942,7 @@ fetch('https://dydx-testnet.imperator.co/v4/historicalTradingRewardAggregations/
|---|---|---|---|---|
|address|path|string|true|none|
|period|query|[TradingRewardAggregationPeriod](#schematradingrewardaggregationperiod)|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|startingBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|
|startingBeforeOrAtHeight|query|string|false|none|

Expand Down Expand Up @@ -1077,7 +1073,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/orders', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

print(r.json())
Expand All @@ -1090,7 +1086,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/orders?address=string&subaccountNumber=0&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/orders?address=string&subaccountNumber=0',
{
method: 'GET',

Expand All @@ -1112,7 +1108,7 @@ fetch('https://dydx-testnet.imperator.co/v4/orders?address=string&subaccountNumb
|---|---|---|---|---|
|address|query|string|true|none|
|subaccountNumber|query|number(double)|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|ticker|query|string|false|none|
|side|query|[OrderSide](#schemaorderside)|false|none|
|type|query|[OrderType](#schemaordertype)|false|none|
Expand Down Expand Up @@ -1353,9 +1349,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://dydx-testnet.imperator.co/v4/perpetualMarkets', params={
'limit': '0'
}, headers = headers)
r = requests.get('https://dydx-testnet.imperator.co/v4/perpetualMarkets', headers = headers)

print(r.json())

Expand All @@ -1367,7 +1361,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/perpetualMarkets?limit=0',
fetch('https://dydx-testnet.imperator.co/v4/perpetualMarkets',
{
method: 'GET',

Expand All @@ -1387,7 +1381,7 @@ fetch('https://dydx-testnet.imperator.co/v4/perpetualMarkets?limit=0',

|Name|In|Type|Required|Description|
|---|---|---|---|---|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|ticker|query|string|false|none|

> Example responses
Expand Down Expand Up @@ -1462,9 +1456,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/perpetualPositions', params={
'address': 'string', 'subaccountNumber': '0', 'status': [
"OPEN"
], 'limit': '0'
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

print(r.json())
Expand All @@ -1477,7 +1469,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/perpetualPositions?address=string&subaccountNumber=0&status=OPEN&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/perpetualPositions?address=string&subaccountNumber=0',
{
method: 'GET',

Expand All @@ -1499,8 +1491,8 @@ fetch('https://dydx-testnet.imperator.co/v4/perpetualPositions?address=string&su
|---|---|---|---|---|
|address|query|string|true|none|
|subaccountNumber|query|number(double)|true|none|
|status|query|array[string]|true|none|
|limit|query|number(double)|true|none|
|status|query|array[string]|false|none|
|limit|query|number(double)|false|none|
|createdBeforeOrAtHeight|query|number(double)|false|none|
|createdBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|

Expand Down Expand Up @@ -1703,9 +1695,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://dydx-testnet.imperator.co/v4/trades/perpetualMarket/{ticker}', params={
'limit': '0'
}, headers = headers)
r = requests.get('https://dydx-testnet.imperator.co/v4/trades/perpetualMarket/{ticker}', headers = headers)

print(r.json())

Expand All @@ -1717,7 +1707,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/trades/perpetualMarket/{ticker}?limit=0',
fetch('https://dydx-testnet.imperator.co/v4/trades/perpetualMarket/{ticker}',
{
method: 'GET',

Expand All @@ -1738,7 +1728,7 @@ fetch('https://dydx-testnet.imperator.co/v4/trades/perpetualMarket/{ticker}?limi
|Name|In|Type|Required|Description|
|---|---|---|---|---|
|ticker|path|string|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|createdBeforeOrAtHeight|query|number(double)|false|none|
|createdBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|

Expand Down Expand Up @@ -1785,7 +1775,7 @@ headers = {
}

r = requests.get('https://dydx-testnet.imperator.co/v4/transfers', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

print(r.json())
Expand All @@ -1798,7 +1788,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://dydx-testnet.imperator.co/v4/transfers?address=string&subaccountNumber=0&limit=0',
fetch('https://dydx-testnet.imperator.co/v4/transfers?address=string&subaccountNumber=0',
{
method: 'GET',

Expand All @@ -1820,7 +1810,7 @@ fetch('https://dydx-testnet.imperator.co/v4/transfers?address=string&subaccountN
|---|---|---|---|---|
|address|query|string|true|none|
|subaccountNumber|query|number(double)|true|none|
|limit|query|number(double)|true|none|
|limit|query|number(double)|false|none|
|createdBeforeOrAtHeight|query|number(double)|false|none|
|createdBeforeOrAt|query|[IsoString](#schemaisostring)|false|none|

Expand Down
Loading

0 comments on commit d92b5b2

Please sign in to comment.