Skip to content

Commit

Permalink
Update api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Christopher-Li committed Nov 9, 2023
1 parent 8c5c258 commit acd82ca
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 39 deletions.
76 changes: 39 additions & 37 deletions indexer/services/comlink/public/api-documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
Base URLs:

* <a href="https://indexer.v4testnet.dydx.exchange/v4">https://indexer.v4testnet.dydx.exchange/v4</a>
* <a href="https://indexer.dydx.trade/v4">https://indexer.dydx.trade/v4</a>

* <a href="https://dydx-testnet.imperator.co">https://dydx-testnet.imperator.co</a>

# Authentication

Expand All @@ -23,7 +25,7 @@ headers = {
'Accept': 'application/json'
}

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/addresses/{address}', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/addresses/{address}', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/addresses/{address}',
fetch('https://indexer.dydx.trade/v4/addresses/{address}',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/addresses/{address}/subaccountNumber/{subaccountNumber}', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/addresses/{address}/subaccountNumber/{subaccountNumber}', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/addresses/{address}/subaccountNumber/{subaccountNumber}',
fetch('https://indexer.dydx.trade/v4/addresses/{address}/subaccountNumber/{subaccountNumber}',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/assetPositions', params={
r = requests.get('https://indexer.dydx.trade/v4/assetPositions', params={
'address': 'string', 'subaccountNumber': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/assetPositions?address=string&subaccountNumber=0',
fetch('https://indexer.dydx.trade/v4/assetPositions?address=string&subaccountNumber=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/candles/perpetualMarkets/{ticker}', params={
r = requests.get('https://indexer.dydx.trade/v4/candles/perpetualMarkets/{ticker}', params={
'resolution': '1MIN', 'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/candles/perpetualMarkets/{ticker}?resolution=1MIN&limit=0',
fetch('https://indexer.dydx.trade/v4/candles/perpetualMarkets/{ticker}?resolution=1MIN&limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/screen', params={
r = requests.get('https://indexer.dydx.trade/v4/screen', params={
'address': 'string'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/screen?address=string',
fetch('https://indexer.dydx.trade/v4/screen?address=string',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/fills', params={
r = requests.get('https://indexer.dydx.trade/v4/fills', params={
'address': 'string', 'subaccountNumber': '0', 'market': 'string', 'marketType': 'PERPETUAL', 'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/fills?address=string&subaccountNumber=0&market=string&marketType=PERPETUAL&limit=0',
fetch('https://indexer.dydx.trade/v4/fills?address=string&subaccountNumber=0&market=string&marketType=PERPETUAL&limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/height', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/height', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/height',
fetch('https://indexer.dydx.trade/v4/height',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/historicalFunding/{ticker}', params={
r = requests.get('https://indexer.dydx.trade/v4/historicalFunding/{ticker}', params={
'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/historicalFunding/{ticker}?limit=0',
fetch('https://indexer.dydx.trade/v4/historicalFunding/{ticker}?limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/historical-pnl', params={
r = requests.get('https://indexer.dydx.trade/v4/historical-pnl', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/historical-pnl?address=string&subaccountNumber=0&limit=0',
fetch('https://indexer.dydx.trade/v4/historical-pnl?address=string&subaccountNumber=0&limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/orderbooks/perpetualMarket/{ticker}', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/orderbooks/perpetualMarket/{ticker}', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/orderbooks/perpetualMarket/{ticker}',
fetch('https://indexer.dydx.trade/v4/orderbooks/perpetualMarket/{ticker}',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/orders', params={
r = requests.get('https://indexer.dydx.trade/v4/orders', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/orders?address=string&subaccountNumber=0&limit=0',
fetch('https://indexer.dydx.trade/v4/orders?address=string&subaccountNumber=0&limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/orders/{orderId}', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/orders/{orderId}', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/orders/{orderId}',
fetch('https://indexer.dydx.trade/v4/orders/{orderId}',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/perpetualMarkets', params={
r = requests.get('https://indexer.dydx.trade/v4/perpetualMarkets', params={
'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/perpetualMarkets?limit=0',
fetch('https://indexer.dydx.trade/v4/perpetualMarkets?limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/perpetualPositions', params={
r = requests.get('https://indexer.dydx.trade/v4/perpetualPositions', params={
'address': 'string', 'subaccountNumber': '0', 'status': [
"OPEN"
], 'limit': '0'
Expand All @@ -1362,7 +1364,7 @@ const headers = {
'Accept':'application/json'
};

fetch('https://indexer.v4testnet.dydx.exchange/v4/perpetualPositions?address=string&subaccountNumber=0&status=OPEN&limit=0',
fetch('https://indexer.dydx.trade/v4/perpetualPositions?address=string&subaccountNumber=0&status=OPEN&limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/sparklines', params={
r = requests.get('https://indexer.dydx.trade/v4/sparklines', params={
'timePeriod': 'ONE_DAY'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/sparklines?timePeriod=ONE_DAY',
fetch('https://indexer.dydx.trade/v4/sparklines?timePeriod=ONE_DAY',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/time', headers = headers)
r = requests.get('https://indexer.dydx.trade/v4/time', headers = headers)

print(r.json())

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/time',
fetch('https://indexer.dydx.trade/v4/time',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/trades/perpetualMarket/{ticker}', params={
r = requests.get('https://indexer.dydx.trade/v4/trades/perpetualMarket/{ticker}', params={
'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/trades/perpetualMarket/{ticker}?limit=0',
fetch('https://indexer.dydx.trade/v4/trades/perpetualMarket/{ticker}?limit=0',
{
method: 'GET',

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

r = requests.get('https://indexer.v4testnet.dydx.exchange/v4/transfers', params={
r = requests.get('https://indexer.dydx.trade/v4/transfers', params={
'address': 'string', 'subaccountNumber': '0', 'limit': '0'
}, headers = headers)

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

fetch('https://indexer.v4testnet.dydx.exchange/v4/transfers?address=string&subaccountNumber=0&limit=0',
fetch('https://indexer.dydx.trade/v4/transfers?address=string&subaccountNumber=0&limit=0',
{
method: 'GET',

Expand Down
6 changes: 5 additions & 1 deletion indexer/services/comlink/public/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1862,7 +1862,11 @@
},
"servers": [
{
"url": "https://indexer.v4testnet.dydx.exchange/v4",
"url": "https://indexer.dydx.trade/v4",
"description": "Mainnet"
},
{
"url": "https://dydx-testnet.imperator.co",
"description": "Public Testnet"
}
]
Expand Down
6 changes: 5 additions & 1 deletion indexer/services/comlink/src/scripts/generate-swagger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ generateSpec({
swaggerDocument.info.version = 'v1.0.0';
swaggerDocument.servers = [
{
url: 'https://indexer.v4testnet.dydx.exchange/v4',
url: 'https://indexer.dydx.trade/v4',
description: 'Mainnet',
},
{
url: 'https://dydx-testnet.imperator.co',
description: 'Public Testnet',
},
];
Expand Down

0 comments on commit acd82ca

Please sign in to comment.